| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.OutputStream;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLDecoder;
|
| | | import java.net.URLEncoder;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.wx.RedPackRecord;
|
| | | import org.yeshi.utils.wx.WXRedPackUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.exception.ExtractException;
|
| | | import com.yeshi.fanli.exception.NotExistObjectException;
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.ExtractCountService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.count.UserInfoCountService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractAuditRecordService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractCountService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.push.PushRecordService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractAuditRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | | private ExtractCountService extractCountService;
|
| | |
|
| | | @Resource
|
| | | private AccountMessageService accountMessageService;
|
| | |
|
| | | @Resource
|
| | | private PushRecordService pushRecordService;
|
| | |
|
| | | @Resource
|
| | |
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderService taoBaoWeiQuanOrderService;
|
| | |
|
| | | private final static String TODAY = "1";
|
| | | private final static String THREE = "2";
|
| | | private final static String AWEEK = "3";
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @RequestMapping(value = "getExtractList", method = RequestMethod.POST)
|
| | | public void getExtractList(int pageIndex, PrintWriter out) {
|
| | | List<Extract> extractList = extractService.getExtractList(pageIndex - 1);
|
| | | int count = extractService.getCount();
|
| | | int totalPage = count % Constant.PAGE_SIZE == 0 ? count / Constant.PAGE_SIZE : count / Constant.PAGE_SIZE + 1;
|
| | | PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count, totalPage);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("extractList", extractList);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * 方法说明: 通过提现请求
|
| | | * |
| | | * @author mawurui createTime 2018年3月14日 下午3:15:42
|
| | | * @param id
|
| | | * @param out
|
| | | * @param request
|
| | | */
|
| | | @RequestMapping(value = "passExtract", method = RequestMethod.POST)
|
| | | public void passExtract(String callback, long id, PrintWriter out, HttpServletRequest request) {
|
| | |
|
| | | // TODO 需要邮箱发送短信验证
|
| | |
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | |
|
| | | Integer integer = extractService.passExtract(id, admin);
|
| | | Extract extract = extractService.getExtractById(id);
|
| | | long uid = extract.getUserInfo().getId();
|
| | |
|
| | | if (integer == null) {
|
| | | out.print(JsonUtil.loadTrueResult("通过"));
|
| | | LogHelper
|
| | | .userInfo("[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "通过了[id=" + id + "]的提现申请!"); // 同意之后成功
|
| | | } else if (integer == 1) {
|
| | |
|
| | | out.print(JsonUtil.loadFalseResult("不存在该对象")); // 同意之后失败
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 同意提现id=" + id + "的提现申请不存在");
|
| | | String title = "你的提现申请被驳回";
|
| | | String content = "非常遗憾,你的提现申请被驳回。我们通过核对发现你的账目明细有误,我们会在审计完成之后给你发通知消息。如有疑问请联系客服。";
|
| | | // xingePushController.pushSystemZnx(uid, title, content, out);
|
| | | } else {
|
| | |
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 同意提现id=" + id + "的提现申请状态异常");
|
| | | out.print(JsonUtil.loadFalseResult("该状态不等于不为初始状态"));
|
| | | String title = "你的提现申请不成功";
|
| | | String content = "请确保你的提现账户的隐私设置为 允许邮箱、手机号、会员名找到我。否则无法成功完成转账。如有疑问请联系客服。";
|
| | | // xingePushController.pushSystemZnx(uid, title, content, out);
|
| | | }
|
| | | }
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | /* 允许提现 操作 */
|
| | | Integer integer = extractService.passExtract(id, admin);
|
| | |
|
| | | Extract extract = extractService.getExtractById(id);
|
| | | long uid = extract.getUserInfo().getId();
|
| | |
|
| | | // 日志记录
|
| | | if (integer == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("通过"));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("已通过"));
|
| | | LogHelper
|
| | | .userInfo("[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "通过了[id=" + id + "]的提现申请!"); // 同意之后成功
|
| | | .userInfo("[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "通过了[id=" + id + "]的提现申请!");
|
| | | } else if (integer == 1) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("不存在该对象"));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该提现记录已不存在,请刷新"));
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 同意提现id=" + id + "的提现申请不存在");
|
| | | String title = "你的提现申请被驳回";
|
| | | String content = "非常遗憾,你的提现申请被驳回。我们通过核对发现你的账目明细有误,我们会在审计完成之后给你发通知消息。如有疑问请联系客服。";
|
| | | // xingePushController.pushSystemZnx(uid, title, content, out);
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该状态不等于不为初始状态"));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("该用户已被处理,请刷新"));
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 同意提现id=" + id + "的提现申请状态异常");
|
| | | String title = "你的提现申请不成功";
|
| | | String content = "请确保你的提现账户的隐私设置为 允许邮箱、手机号、会员名找到我。否则无法成功完成转账。如有疑问请联系客服。";
|
| | | // xingePushController.pushSystemZnx(uid, title, content, out);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * 方法说明: 拒绝提现请求
|
| | | * |
| | | * @author mawurui createTime 2018年3月14日 下午3:15:55
|
| | | * @param id
|
| | | * @param reason
|
| | | * @param out
|
| | | * @param request
|
| | | */
|
| | | @RequestMapping(value = "rejectExtract", method = RequestMethod.POST)
|
| | | public void rejectExtract(String callback, long id, String reason, PrintWriter out, HttpServletRequest request) {
|
| | | AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
|
| | |
|
| | | Extract extract = extractService.getExtractById(id);
|
| | | long uid = extract.getUserInfo().getId();
|
| | | long extractTime = extract.getExtractTime();
|
| | |
|
| | | try {
|
| | | extractService.rejectExtract(id, reason, extractTime, admin);// 提现失败
|
| | |
|
| | | // 调用推送站内信给用户
|
| | | out.print(JsonUtil.loadTrueResult("拒绝"));
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "拒绝了[id=" + id
|
| | | + "]的提现申请!拒绝原因是" + reason);
|
| | |
|
| | | String title = "你的提现申请被驳回";
|
| | | String content = "非常遗憾,你的提现申请被驳回。我们通过核对发现你的账目明细有误,我们会在审计完成之后给你发通知消息。如有疑问请联系客服。";
|
| | | // xingePushController.pushSystemZnx(uid, title, content, out);
|
| | | } catch (ObjectStateException e) {
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 拒绝提现id=" + id + "的提现申请状态异常!"); //
|
| | |
|
| | | out.print(JsonUtil.loadFalseResult(e.getMessage()));
|
| | | } catch (NotExistObjectException e) {
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 拒绝提现id=" + id + "的提现申请不存在!");
|
| | |
|
| | | out.print(JsonUtil.loadFalseResult(e.getMessage()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | /* 拒绝提现 操作 */
|
| | |
|
| | | try {
|
| | | // 编码转换
|
| | | reason = URLDecoder.decode(reason, "UTF-8");
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | |
|
| | | try {
|
| | | Extract extract = extractService.getExtractById(id);
|
| | | long extractTime = extract.getExtractTime();
|
| | | extractService.rejectExtract(id, reason, extractTime, admin);// 提现失败
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("拒绝"));
|
| | | extractService.rejectExtract(id, reason, admin);// 提现失败
|
| | |
|
| | | // 调用推送站内信给用户
|
| | | // out.print(JsonUtil.loadTrueResult("拒绝"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("拒绝成功"));
|
| | |
|
| | | LogHelper.userInfo("[ip:" + IPUtil.getRemotIP(request) + "]" + admin.getName() + "拒绝了[id=" + id
|
| | | + "]的提现申请!拒绝原因是" + reason);
|
| | |
|
| | | String title = "你的提现申请被驳回";
|
| | | String content = "非常遗憾,你的提现申请被驳回。我们通过核对发现你的账目明细有误,我们会在审计完成之后给你发通知消息。如有疑问请联系客服。";
|
| | | // xingePushController.pushSystemZnx(uid, title, content, out);
|
| | | } catch (ObjectStateException e) {
|
| | | LogHelper.userInfo(
|
| | | "[ip:" + IPUtil.getRemotIP(request) + "][管理员:" + admin.getName() + "] 拒绝提现id=" + id + "的提现申请状态异常!"); //
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMessage()));
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 资金校验是否异常
|
| | | * |
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "checkExtract", method = RequestMethod.POST)
|
| | | public void checkExtract(String uid, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | try {
|
| | | extractService.checkExtract(uid);
|
| | | data.put("code", "1"); // 正常
|
| | | } catch (ExtractException e) {
|
| | | data.put("code", "0");// 异常
|
| | | }
|
| | | out.print(data);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | // }
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | Integer days = null;
|
| | | if (TODAY.equals(timeSlot)) {
|
| | | if ("1".equals(timeSlot)) {
|
| | | days = 0; // 今日
|
| | | } else if (THREE.equals(timeSlot)) {
|
| | | } else if ("2".equals(timeSlot)) {
|
| | | days = 3; // 前3天
|
| | | } else if (AWEEK.equals(timeSlot)) {
|
| | | } else if ("3".equals(timeSlot)) {
|
| | | days = 7; // 前7天
|
| | | }
|
| | |
|
| | |
| | | if (adminUser == null) {
|
| | | record.setAdminUser(new AdminUser());
|
| | | }
|
| | | // 查询用户备注信息
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(record.getExtract().getUserInfo().getId());
|
| | | if (extra != null) {
|
| | | record.getExtract().getUserInfo().setStateDesc(extra.getMark());
|
| | | }
|
| | |
|
| | | int warnLevel = 0;
|
| | | Extract extract = record.getExtract();
|
| | | if (extract != null) {
|
| | | Integer extractState = extract.getState();
|
| | | if (extractState != null && extractState == 0) {
|
| | | if (extractState != null && extractState == Extract.STATE_NOT_PROCESS) {
|
| | | UserInfo userInfo = extract.getUserInfo();
|
| | | if (userInfo != null) {
|
| | | double countTodayMoney = extractService.countTodayMoney(userInfo.getId());
|
| | | if (countTodayMoney >= 100) {
|
| | | BigDecimal countTodayMoney = extractService.sumTodayApplyMoney(userInfo.getId(),
|
| | | TimeUtil.getGernalTime(extract.getExtractTime()));
|
| | | if (countTodayMoney.compareTo(new BigDecimal(100)) > 0) {
|
| | | warnLevel = 1;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (record.getExtraInfo() != null) {
|
| | | StringBuffer desc = new StringBuffer();
|
| | | if (System.currentTimeMillis() > TimeUtil.convertToTimeTemp("2019-06-21", "yyyy-MM-dd")) {
|
| | | desc.append("大笔订单数:" + record.getExtraInfo().getOrderCount50More() + "\n#");
|
| | | desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
|
| | | desc.append("维权订单佣金:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
|
| | | if (record.getExtraInfo().getOrderCount50More() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderCount() > 1
|
| | | || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(10)) >= 0)
|
| | | warnLevel = 2;
|
| | | } else {
|
| | | if (record.getExtraInfo().getOrderCount50More() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderCount() > 0
|
| | | || record.getExtraInfo().getWeiQuanOrderFanAmount().compareTo(new BigDecimal(0)) > 0)
|
| | | warnLevel = 2;
|
| | | desc.append("大于50元订单:" + record.getExtraInfo().getOrderCount50More() + "\n#");
|
| | | desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
|
| | | desc.append("维权订单退回金额:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
|
| | | desc.append("180天安全订单数:" + record.getExtraInfo().getSafeOrderCount());
|
| | | }
|
| | | record.setExtraInfoStr(desc.toString());
|
| | | }
|
| | |
|
| | | // if (warnLevel == 0) {
|
| | | // // 查询同店铺商品,同商品订单超过一定数量的
|
| | | // List<Integer> typeList = new ArrayList<>();
|
| | | // typeList.add(HongBaoV2.TYPE_ZIGOU);
|
| | | // long sameGoodsOrderCount =
|
| | | // commonOrderCountService.countSameGoodsOrderByUidAndHongBaoType(typeList,
|
| | | // record.getExtract().getUserInfo().getId(),
|
| | | // Integer.parseInt(configService.get("admin_min_same_goods_order_count")));
|
| | | // long sameShopOrderCount =
|
| | | // commonOrderCountService.countSameShopOrderByUidAndHongBaoType(typeList,
|
| | | // record.getExtract().getUserInfo().getId(),
|
| | | // Integer.parseInt(configService.get("admin_min_same_shop_order_count")));
|
| | | // if (sameGoodsOrderCount > 0 || sameShopOrderCount > 0) {
|
| | | // warnLevel = 3;
|
| | | // record.setExtraInfoStr(
|
| | | // String.format("同店铺:%s 同商品:%s", sameShopOrderCount,
|
| | | // sameGoodsOrderCount));
|
| | | // }
|
| | | // }
|
| | |
|
| | | record.setWarnLevel(warnLevel);
|
| | |
|
| | | }
|
| | |
|
| | | int count = extractAuditRecordService.getMyAuditedTimeSlotCount(key, state, null, days);
|
| | |
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | gsonBuilder.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | |
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult(e.getMessage()));
|
| | | }
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getMyAuditedDanger")
|
| | | public void getMyAuditedDanger(String callback, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请登录"));
|
| | | return;
|
| | | }
|
| | | // 查询同店铺商品,同商品订单超过一定数量的
|
| | | List<Integer> typeList = new ArrayList<>();
|
| | | typeList.add(HongBaoV2.TYPE_ZIGOU);
|
| | | long sameGoodsOrderCount = commonOrderCountService.countSameGoodsOrderByUidAndHongBaoType(typeList, uid,
|
| | | Integer.parseInt(configService.get("admin_min_same_goods_order_count")));
|
| | | long sameShopOrderCount = commonOrderCountService.countSameShopOrderByUidAndHongBaoType(typeList, uid,
|
| | | Integer.parseInt(configService.get("admin_min_same_shop_order_count")));
|
| | | if (sameGoodsOrderCount > 0 || sameShopOrderCount > 0) {
|
| | | String text = (String.format("同店铺:%s 同商品:%s", sameShopOrderCount, sameGoodsOrderCount));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(text));
|
| | | return;
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("店铺/商品无异常"));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | surplusTime = DateUtil.dateDiff(formattodayTime, formatTime);
|
| | | }
|
| | |
|
| | | String mark = "";
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(extract.getUserInfo().getId());
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getMark())) {
|
| | | mark = "警惕!! " + userInfoExtra.getMark();
|
| | | }
|
| | |
|
| | | data.put("mark", mark);
|
| | | data.put("extract", extract);
|
| | | data.put("beforeMoney", beforeMoney);
|
| | | data.put("surplusTime", surplusTime);
|
| | |
| | | surplusTime = DateUtil.dateDiff(formattodayTime, formatTime);
|
| | | }
|
| | |
|
| | | String mark = "";
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(extract.getUserInfo().getId());
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getMark())) {
|
| | | mark = "警惕!! " + userInfoExtra.getMark();
|
| | | }
|
| | |
|
| | | data.put("mark", mark);
|
| | | data.put("extract", extract);
|
| | | data.put("beforeMoney", beforeMoney);
|
| | | data.put("surplusTime", surplusTime);
|
| | |
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无提现记录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | for (ExtractAuditRecord record : list) {
|
| | |
|
| | | if (record.getExtraInfo() != null) {
|
| | | StringBuffer desc = new StringBuffer();
|
| | | desc.append("大于50元订单:" + record.getExtraInfo().getOrderCount50More() + "\n#");
|
| | | desc.append("维权订单数:" + record.getExtraInfo().getWeiQuanOrderCount() + "\n#");
|
| | | desc.append("维权订单退回金额:" + record.getExtraInfo().getWeiQuanOrderFanAmount() + "\n#");
|
| | | desc.append("180天安全订单数:" + record.getExtraInfo().getSafeOrderCount());
|
| | | record.setExtraInfoStr(desc.toString());
|
| | | }
|
| | | }
|
| | |
|
| | | int count = extractAuditRecordService.getByUidCount(uid);
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | extractService.checkExtract(uid);
|
| | | extractService.checkExtract(Long.parseLong(uid));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("资金正常"));
|
| | | } catch (ExtractException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | innerList.put("name", "驳回数");
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countAuditTotal(state, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | List<ChartTDO> list = extractAuditRecordService.countAuditTotal(state, dateType, year, startTime,
|
| | | endTime);
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | @RequestMapping(value = "getExtractApplyMoney")
|
| | | public void getExtractApplyMoney(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year,
|
| | | startTime, endTime);
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | |
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | @RequestMapping(value = "getExtractApplyNumber")
|
| | | public void getExtractApplyNumber(String callback, Integer state, Integer dateType, String year, String startTime,
|
| | | String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONArray line_list = new JSONArray();
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year,
|
| | | startTime, endTime);
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | |
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 下载提现红包Openid
|
| | | * |
| | | * @param callback
|
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "downAutoExtractTxt")
|
| | | public void downAutoExtractTxt(String callback, HttpServletResponse response, PrintWriter out) {
|
| | | try {
|
| | | List<String> list = extractService.getAutoExtractOpenIds();
|
| | | if (list == null || list.size() <= 1) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无用户满足自动提现条件"));
|
| | | return;
|
| | | }
|
| | |
|
| | | String filepath = "自动提现OpenId " + java.lang.System.currentTimeMillis() + ".txt";
|
| | | response.reset();
|
| | | response.setContentType("application/octet-stream");
|
| | | String fileName = URLDecoder.decode(filepath, "utf-8");
|
| | | response.addHeader("Content-Disposition",
|
| | | "attachment;" + "filename=\"" + URLEncoder.encode(fileName, "utf-8") + "\"");
|
| | |
|
| | | StringBuilder sb = new StringBuilder();
|
| | | for (String t : list) {
|
| | | sb.append(t + "\r\n");
|
| | | }
|
| | |
|
| | | String opid_str = sb.toString();
|
| | | if (!StringUtil.isNullOrEmpty(opid_str) && opid_str.endsWith("\r\n")) {
|
| | | opid_str = opid_str.substring(0, opid_str.length() - 2);
|
| | | }
|
| | |
|
| | | OutputStream os = response.getOutputStream();
|
| | | byte[] byt = opid_str.getBytes();
|
| | | os.write(byt);
|
| | | os.flush();
|
| | | os.close();
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 上传提现红包Excel
|
| | | * |
| | | * @param file
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "uploadExcel", method = RequestMethod.POST)
|
| | | public void uploadExcel(@RequestParam("file") CommonsMultipartFile file, PrintWriter out) {
|
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件不能为空!"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | List<RedPackRecord> list = WXRedPackUtil.readCsv(file.getInputStream());
|
| | | extractService.updateManualExtractRecord(list);
|
| | | out.print(JsonUtil.loadTrueResult("上传成功"));
|
| | | } catch (ExtractException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | out.print(JsonUtil.loadFalseResult("上传失败"));
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | public static String getValue(String[] item,int index){
|
| | | if(item.length > index){
|
| | | String value = item[index];
|
| | | return value;
|
| | | }
|
| | | return "";
|
| | | }
|
| | | |
| | | /**
|
| | | * 预览红包发生人
|
| | | * |
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "preAutoUser")
|
| | | public void preAutoUser(String callback, Integer pageIndex, PrintWriter out) {
|
| | | try {
|
| | | List<UserInfo> list = extractService.preAutoUser();
|
| | | if (list == null || list.isEmpty()) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无用户满足自动提现条件"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | Integer pageSize = 100;
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | |
|
| | | int count = list.size();
|
| | | int totalPage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1;
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | List<UserInfo> listResult = null;
|
| | | if (pageIndex < totalPage) {
|
| | | int start = (pageIndex - 1) * pageSize;
|
| | | listResult = list.subList(start, start + pageSize);
|
| | | } else if (pageIndex == totalPage) {
|
| | | listResult = list.subList((pageIndex - 1) * pageSize, list.size());
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("没有更多了"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", listResult);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | |