From df03194e4b0c0737cf84127c4dd69d456e30ed24 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:24:00 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java | 88 ++++++++++++++++++++++++++++++------------- 1 files changed, 61 insertions(+), 27 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 894c274..8a881a2 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 @@ -21,7 +21,6 @@ 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.entity.admin.UserInfoAdmin; 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; @@ -37,9 +36,7 @@ import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.count.UserInfoCountService; import com.yeshi.fanli.service.inter.goods.ShareService; -import com.yeshi.fanli.service.inter.hongbao.HongBaoService; import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce; -import com.yeshi.fanli.service.inter.order.OrderItemServcie; import com.yeshi.fanli.service.inter.order.OrderService; import com.yeshi.fanli.service.inter.user.BindingAccountService; import com.yeshi.fanli.service.inter.user.ExtractService; @@ -57,6 +54,7 @@ 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.UserInfoVO; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -80,16 +78,10 @@ private ConfigService configService; @Resource - private HongBaoService hongBaoService; - - @Resource private ExtractService extractService; @Resource private ThreeSaleSerivce threeSaleService; - - @Resource - private OrderItemServcie orderItemService; @Resource private ShareService shareService; @@ -114,7 +106,7 @@ @Resource private UserRankService userRankService; - + @Resource private UserMoneyDetailService userMoneyDetailService; @@ -308,22 +300,15 @@ * @param out */ @RequestMapping(value = "query") - public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer userType, Integer days, - String startTime, String endTime, Integer orderMode, PrintWriter out) { + public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank, + Integer days, String startTime, String endTime, Integer orderMode, Integer type, PrintWriter out) { try { - - // 缁撴潫鏃堕棿 2018-06-06 00:00:00 鍔犱笂涓�澶� - if (!StringUtil.isNullOrEmpty(endTime)) { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date enddate = sdf.parse(endTime); - Calendar c = Calendar.getInstance(); - c.setTime(enddate); - c.add(Calendar.DAY_OF_MONTH, 1);// 浠婂ぉ+1澶� - endTime = sdf.format(c.getTime()); + if (type == null) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛绫诲瀷type涓嶈兘涓虹┖")); + return; } - + if (pageIndex == null) pageIndex = 1; @@ -344,15 +329,35 @@ } } - List<UserInfoAdmin> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, key, userType, - days, startTime, endTime, orderField, orderMode); + String userRank = null; + if (rank != null) { + switch (rank) { + case 1: + userRank = "闈掗摐"; + break; + case 2: + userRank = "鐧介摱"; + break; + case 3: + userRank = "榛勯噾"; + break; + case 4: + userRank = "閾傞噾"; + break; + default: + break; + } + } + + List<UserInfoVO> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, type, key, keyType, + userRank, days, startTime, endTime, orderField, orderMode); if (userList == null || userList.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鐩稿叧鏁版嵁")); return; } - long count = userInfoService.queryCount(key, userType, days, startTime, endTime); + long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); @@ -363,7 +368,6 @@ JSONObject data = new JSONObject(); data.put("pe", pe); - // data.put("sumMoney", sumMoney); data.put("resultList", gson.toJson(userList)); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); @@ -1290,4 +1294,34 @@ } } + + + /** + * 鐢ㄦ埛璐﹀彿- 灏佺/瑙e皝 + * @param callback + * @param code + * @param type 1("寰俊unionId"), 2("娣樺疂ID"), 3("鎵嬫満鍙�"), 4("鏀粯瀹濊处鍙�"); + * @param out + */ + @RequestMapping(value = "saveForbiddenInfo") + public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) { + try { + if (code == null || code.trim().length() == 0 || type == null) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍙傛暟涓嶈兘涓虹┖")); + } + + forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type); + + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇敼鎴愬姛")); + + } catch (ForbiddenUserIdentifyCodeException e) { + e.printStackTrace(); + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); + } catch (Exception e) { + e.printStackTrace(); + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); + } + + } + } -- Gitblit v1.8.0