admin
2020-02-18 ddf5db7d31af51fcf697eac0cee7dd46ff73bcc1
fanli/src/main/java/com/yeshi/fanli/service/impl/order/LostOrderServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.order;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -16,12 +17,13 @@
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.system.ConfigKeyEnum;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.msg.UserOrderMsgNotificationService;
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.util.Constant;
import com.yeshi.fanli.service.inter.order.msg.UserOrderMsgNotificationService;
import com.yeshi.fanli.service.inter.order.tb.TaoBaoPunishOrderService;
import com.yeshi.fanli.util.Utils;
@Service
@@ -42,6 +44,9 @@
   @Resource
   private UserOrderMsgNotificationService userOrderMsgNotificationService;
   @Resource
   private TaoBaoPunishOrderService taoBaoPunishOrderService;
   @Transactional
   @Override
   public int addLostOrder(LostOrder lostOrder) {
@@ -50,6 +55,14 @@
      if (type == null) { // 默认为淘宝订单
         lostOrder.setType(1);
         type = 1;
      }
      // 是否处于违规订单中
      if (type == 1) {
         int count = taoBaoPunishOrderService.countByTradeParentId(orderId);
         if (count > 0) {
            return -1001;
         }
      }
      // 订单是否已申诉
@@ -72,12 +85,12 @@
      }
      // 是否为分享赚订单
      if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS) > 0)
      if (hongBaoOrderService.countByOrderNoAndHongBaoType(orderId, HongBaoV2.TYPE_SHARE_GOODS, type) > 0)
         return -5;
      // 次数限制
      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;
      }
@@ -105,7 +118,7 @@
            lostOrderwriteLock.unlock();
         }
         Order or = orderService.getSystemOrderByUid(Constant.TAOBAO, lostOrder.getUserInfo().getId());
         Order or = orderService.getSystemOrderByUid(type, lostOrder.getUserInfo().getId());
         if (or != null) {
            boolean b = Utils.isUserOrder(or.getOrderId(), lostOrder.getOrderId());
            if (b) {
@@ -292,25 +305,24 @@
    * @return
    */
   @Override
   public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType) {
      return lostOrderMapper.listQuery(start, count, key, state, handleType);
   public List<LostOrder> listQuery(long start, int count, String key, Integer state, Integer handleType,
         Integer type) {
      return lostOrderMapper.listQuery(start, count, key, state, handleType, type);
   }
   @Override
   public long countQuery(String key, Integer state, Integer handleType) {
      return lostOrderMapper.countQuery(key, state, handleType);
   public long countQuery(String key, Integer state, Integer handleType, Integer type) {
      return lostOrderMapper.countQuery(key, state, handleType, type);
   }
   @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) {
      return lostOrderMapper.countLostOrderNum(preDay);
   }
   @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