| | |
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public List<DailyCountOrder> getDailyCountList(String type, Date startTime, Date endTime, String channel) throws Exception {
|
| | | public List<DailyCountOrder> getDailyCountList(String type, Date startTime, Date endTime, String channel)
|
| | | throws Exception {
|
| | | // 查询类型
|
| | | DailyCountOrderEnum typeEnum = getTypeEnum(type);
|
| | | if (typeEnum == null) {
|
| | |
| | |
|
| | | /**
|
| | | * 获取枚举类型
|
| | | * |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取枚举类型
|
| | | * |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | |
| | | return "";
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 初始数据
|
| | | * |
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | | */
|
| | |
| | | if (lastRecord != null) {
|
| | | lastDate = lastRecord.getUpdateDate();
|
| | | } else {
|
| | | lastDate = TimeUtil.parse("2017-05-06");
|
| | | lastDate = TimeUtil.parse("2018-01-20");
|
| | | }
|
| | |
|
| | | long min = DateUtil.dateDiffMin(lastDate, new Date());
|
| | | if (min <= 10) { // 10分钟以内不统计
|
| | | return;
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | |
| | |
|
| | | /**
|
| | | * 统计订单数量
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @param orderType
|
| | |
| | |
|
| | | /**
|
| | | * 统计各个渠道订单数据
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | |
|
| | | for (UserInfoRegister register: listRegister) {
|
| | | Long uid = register.getId();
|
| | | String vlaue =register.getChannel().getVlaue();
|
| | | String vlaue = register.getChannel();
|
| | | // 渠道 、用户id匹配
|
| | | if (channelVlaue.equalsIgnoreCase(vlaue) && uid.longValue() == orderUid.longValue()) {
|
| | | count ++;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | DailyCountOrder obj = new DailyCountOrder();
|
| | | obj.setTotal(BigDecimal.valueOf(count));
|
| | |
| | |
|
| | | /**
|
| | | * 统计新人24H内下单数量
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | |
|
| | | /**
|
| | | * 统计渠道金额
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | listRegister = userInfoRegisterService.listByMultipleUids(listUid);
|
| | | }
|
| | |
|
| | | |
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | BigDecimal money = new BigDecimal(0);
|
| | |
| | | for (CountOrderDTO dto: listOrder) {
|
| | | Long orderUid = dto.getUid();
|
| | | BigDecimal commission = dto.getCommission();
|
| | | if (commission != null || orderUid == null) {
|
| | | if (commission == null || orderUid == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | for (UserInfoRegister register: listRegister) {
|
| | | Long uid = register.getId();
|
| | | String vlaue =register.getChannel().getVlaue();
|
| | | String vlaue = register.getChannel();
|
| | | // 渠道 、用户id匹配
|
| | | if (channelVlaue.equalsIgnoreCase(vlaue) && uid.longValue() == orderUid.longValue()) {
|
| | | money = MoneyBigDecimalUtil.add(money, commission);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | DailyCountOrder obj = new DailyCountOrder();
|
| | | obj.setTotal(money);
|
| | |
| | |
|
| | | /**
|
| | | * 统计维权订单数量
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | dailyCountOrderDao.save(obj);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询维权金额
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | dailyCountOrderDao.save(obj);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 淘宝订单跟踪率
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | }
|
| | |
|
| | | DailyCountOrder obj = new DailyCountOrder();
|
| | | obj.setRate(true);
|
| | | obj.setTotalDay(BigDecimal.valueOf(total));
|
| | | obj.setTotalValid(BigDecimal.valueOf(count));
|
| | | obj.setTotal(rate);
|
| | | obj.setType(typeEnum);
|
| | | obj.setUpdateDate(new Date());
|
| | |
| | |
|
| | | /**
|
| | | * 京东订单跟踪率
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | }
|
| | |
|
| | | DailyCountOrder obj = new DailyCountOrder();
|
| | | obj.setRate(true);
|
| | | obj.setTotalDay(BigDecimal.valueOf(total));
|
| | | obj.setTotalValid(BigDecimal.valueOf(count));
|
| | | obj.setTotal(rate);
|
| | | obj.setType(typeEnum);
|
| | | obj.setUpdateDate(new Date());
|
| | |
| | | dailyCountOrderDao.save(obj);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 拼多多订单跟踪率
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | }
|
| | |
|
| | | DailyCountOrder obj = new DailyCountOrder();
|
| | | obj.setRate(true);
|
| | | obj.setTotalDay(BigDecimal.valueOf(total));
|
| | | obj.setTotalValid(BigDecimal.valueOf(count));
|
| | | obj.setTotal(rate);
|
| | | obj.setType(typeEnum);
|
| | | obj.setUpdateDate(new Date());
|
| | |
| | |
|
| | | /**
|
| | | * 统计申诉订单未处理数量
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | dailyCountOrderDao.save(obj);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 统计申诉订单 处理失败
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | | dailyCountOrderDao.save(obj);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 统计申诉订单 处理成功
|
| | | * |
| | | * @param preDay
|
| | | * @param typeEnum
|
| | | * @throws Exception
|
| | |
| | |
|
| | | /**
|
| | | * 订单找回成功统计金额
|
| | | * |
| | | * @param preDay
|
| | | * @throws Exception
|
| | | */
|