| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoService hongBaoService;
|
| | |
|
| | | @Resource
|
| | | private ExtractService extractService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleService;
|
| | |
|
| | | @Resource
|
| | | private OrderItemServcie orderItemService;
|
| | |
|
| | | @Resource
|
| | | private ShareService shareService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserRankService userRankService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | |
| | | * @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;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | 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);
|
| | |
| | |
|
| | | 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));
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 用户账号- 封禁/解封 |
| | | * @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("操作异常"));
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | }
|