From cf49fe7440cc77300091239cf78d0b4916b3f1e0 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 11 十月 2019 16:45:55 +0800 Subject: [PATCH] 增加饿了么订单 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java | 84 +++++++++++++++++++++++++++++++----------- 1 files changed, 62 insertions(+), 22 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java index 4988bef..8cd39b1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java @@ -19,7 +19,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.yeshi.fanli.controller.admin.utils.AdminUtils; -import com.yeshi.fanli.dto.money.AccountDetails; +import com.yeshi.fanli.dto.ChartTDO; import com.yeshi.fanli.entity.bus.user.BindingAccount; import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode; import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum; @@ -31,21 +31,20 @@ import com.yeshi.fanli.entity.money.UserMoneyDetail; import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException; import com.yeshi.fanli.service.inter.count.UserInfoCountService; -import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce; -import com.yeshi.fanli.service.inter.user.BindingAccountService; +import com.yeshi.fanli.service.inter.money.UserMoneyDetailService; +import com.yeshi.fanli.service.inter.money.extract.BindingAccountService; import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService; import com.yeshi.fanli.service.inter.user.UserAccountService; -import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService; import com.yeshi.fanli.service.inter.user.UserInfoDeleteRecordService; import com.yeshi.fanli.service.inter.user.UserInfoExtraService; import com.yeshi.fanli.service.inter.user.UserInfoService; -import com.yeshi.fanli.service.inter.user.UserMoneyDetailService; import com.yeshi.fanli.service.inter.user.UserRankService; +import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce; +import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; import com.yeshi.fanli.tag.PageEntity; import com.yeshi.fanli.util.Constant; -import com.yeshi.fanli.util.GsonUtil; import com.yeshi.fanli.util.StringUtil; -import com.yeshi.fanli.util.factory.AccountDetailsFactory; +import com.yeshi.fanli.vo.user.UserGoldCoinVO; import com.yeshi.fanli.vo.user.UserInfoVO; import net.sf.json.JSONArray; @@ -80,12 +79,12 @@ @Resource private UserMoneyDetailService userMoneyDetailService; - + @Resource private UserInfoDeleteRecordService userInfoDeleteRecordService; - + @Resource - private UserAccountService userAccountService; + private UserAccountService userAccountService; /** * 鏌ヨ鐢ㄦ埛淇℃伅鍒楄〃 姝e父鐢ㄦ埛/寮傚父鐢ㄦ埛 @@ -363,7 +362,7 @@ * @param out */ @RequestMapping(value = "forbiddenUser") - public void forbiddenUser(String callback, Long uid, HttpServletRequest request, PrintWriter out) { + public void forbiddenUser(String callback, Long uid, HttpServletRequest request, PrintWriter out) { try { if (uid == null) { @@ -381,12 +380,11 @@ if (admin == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐧诲綍澶辨晥,璇风櫥褰�")); return; - } - + } + String reason = "鍚庡彴灏佺锛屾搷浣滀汉锛�" + admin.getId() + "-" + admin.getName(); userAccountService.forbiddenUserAll(uid, reason); - JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鐢ㄦ埛灏佺鎴愬姛")); } catch (Exception e) { @@ -764,7 +762,6 @@ } try { - List<UserMoneyDetail> userMoneyDetailsList = userMoneyDetailService.listByUidWithState(uid, pageIndex, pageSize); if (userMoneyDetailsList == null || userMoneyDetailsList.size() == 0) { @@ -772,18 +769,15 @@ return; } - List<AccountDetails> detailList = new ArrayList<>(); - for (UserMoneyDetail detail : userMoneyDetailsList) - detailList.add(AccountDetailsFactory.create(detail)); - long count = userMoneyDetailService.countByUidWithState(uid); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); + Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create(); JSONObject data = new JSONObject(); data.put("pe", pe); - data.put("result_list", GsonUtil.toJsonExpose(detailList)); + data.put("result_list", gson.toJson(userMoneyDetailsList)); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); @@ -864,7 +858,7 @@ JSONArray line_list = new JSONArray(); for (String channel : channelList) { - List<Map<String, Object>> list = userInfoCountService.countNewUserByDate(channel, dateType, year, + List<ChartTDO> list = userInfoCountService.countNewUserByDate(channel, dateType, year, startTime, endTime); if ("all".equalsIgnoreCase(channel)) { @@ -982,7 +976,7 @@ JSONArray line_list = new JSONArray(); for (String channel : channelList) { - List<Map<String, Object>> list = userInfoCountService.getTodayBuyRate(channel, dateType, year, + List<ChartTDO> list = userInfoCountService.getTodayBuyRate(channel, dateType, year, startTime, endTime); if ("all".equalsIgnoreCase(channel)) { @@ -1095,4 +1089,50 @@ } } + + /** + * 鑾峰彇閲戝竵鎺掕姒� + * @param callback + * @param pageIndex + * @param pageSize + * @param type + * @param out + */ + @RequestMapping(value = "getGoldTop") + public void getGoldTop(String callback, Integer pageIndex, Integer pageSize, Integer type, + PrintWriter out) { + if (type == null) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("type涓嶈兘涓虹┖")); + return; + } + + if (pageIndex == null) + pageIndex = 1; + + if (pageSize == null) + pageSize = 50; + + long count = 0; + List<UserGoldCoinVO> list = null; + if (type == 0) { + count = userInfoCountService.countByHasGoldCoin(); + list = userInfoCountService.listByHasGoldCoin((pageIndex - 1) * pageSize, pageSize); + } else if (type == 1 || type == 2) { + count = userInfoCountService.countByUserGoldCoin(type); + list = userInfoCountService.listByUserGoldCoin((pageIndex - 1) * pageSize, pageSize, type); + } + + if(list == null) + list = new ArrayList<>(); + + + int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); + PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); + + JSONObject data = new JSONObject(); + data.put("pe", pe); + data.put("list", list); + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); + } + } -- Gitblit v1.8.0