| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.order.HongBaoOrder;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.order.tb.TaoBaoPunishOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | // 次数限制
|
| | | long count = lostOrderMapper.countTodayAppeal(lostOrder.getUserInfo().getId());
|
| | | String countMax = configService.get("order_appeal_count_day");
|
| | | String countMax = configService.get(ConfigKeyEnum.orderAppealCountDay.getKey());
|
| | | if (countMax != null && countMax.trim().length() > 0 && count >= Long.parseLong(countMax)) {
|
| | | return -7;
|
| | | }
|
| | |
| | | update.setId(lo.getId());
|
| | | update.setResultCode(LostOrder.RESULT_CODE_SUCCESS);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | Order order = orderService.findOrderByOrderIdAndType(orderId, Order.ORDER_TYPE_TAOBAO);
|
| | | Order order = orderService.findOrderByOrderIdAndType(orderId, orderType);
|
| | |
|
| | | List<HongBaoOrder> hongBaoOrderList = hongBaoOrderService.listDetailByOrderIdAndSourceType(orderId,
|
| | | orderType);
|
| | | int goodsCount = 0;
|
| | | BigDecimal fanMoney = new BigDecimal(0);
|
| | | for (HongBaoOrder hongBaoOrder : hongBaoOrderList) {
|
| | | if (hongBaoOrder.getCommonOrder().getState() != CommonOrder.STATE_SX) {
|
| | | goodsCount += hongBaoOrder.getCommonOrder().getCount();
|
| | | fanMoney = fanMoney.add(hongBaoOrder.getHongBaoV2().getMoney());
|
| | | }
|
| | | }
|
| | | |
| | | if (order != null)
|
| | | // 添加通知
|
| | | userOrderMsgNotificationService.orderFoundSuccess(lo.getUserInfo().getId(), lo.getOrderId(),
|
| | | order.getMoney(), 1, new Date(lo.getHandleTime()));
|
| | | userOrderMsgNotificationService.orderFoundSuccess(lo.getUserInfo().getId(), orderId, orderType,
|
| | | Constant.TYPE_REBATE, order.getMoney(), fanMoney, goodsCount, new Date(lo.getCreateTime()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | update.setResultCode(LostOrder.RESULT_CODE_FAIL);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | // 添加通知
|
| | | userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId(), null, 1,
|
| | | new Date(order.getHandleTime()));
|
| | | userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | update.setResultCode(LostOrder.RESULT_CODE_FAIL);
|
| | | lostOrderMapper.updateByPrimaryKeySelective(update);
|
| | | // 添加通知
|
| | | userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId(), null, 1,
|
| | | new Date(order.getHandleTime()));
|
| | | userOrderMsgNotificationService.orderFoundFail(order.getUserInfo().getId(), order.getOrderId());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return lostOrderMapper.countLostNum(dateType, resultCode, year, startTime, endTime);
|
| | | public Integer countLostOrderNum(String preDay, int resultCode) {
|
| | | return lostOrderMapper.countLostOrderNum(preDay, resultCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception {
|
| | | return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
|
| | | public BigDecimal countAppealMoney(String preDay) {
|
| | | return lostOrderMapper.countAppealMoney(preDay);
|
| | | }
|
| | |
|
| | | @Override
|