admin
2020-04-02 e8e2e233af733ca3ba625223e2fd2255165e6b70
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -31,6 +31,7 @@
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.jd.JDOrder;
@@ -65,6 +66,7 @@
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.manger.user.UserLevelManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
@@ -139,6 +141,9 @@
   
   @Resource
   private UserInviteService userInviteService;
   @Resource
   private UserLevelManager userLevelManager;
   @Resource(name = "producer")
   private Producer orderProducer;
@@ -285,7 +290,6 @@
      }
      Map<Long, Boolean> vipUserMap = userVIPInfoService.listByUids(needSelectVIPUidList);
      // 设置是否为vip订单
      for (CommonOrderVO order : listOrder) {
         if (order.getHongBaoType() == HongBaoV2.TYPE_YIJI || order.getHongBaoType() == HongBaoV2.TYPE_ERJI
@@ -345,7 +349,6 @@
                  totalSettlement = commonOrder.getTotalPayment();
               }
               commonGoodsVO.setActualPay("付款金额:¥" + totalSettlement);
               // 邀请订单信息保护
               if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
@@ -1181,10 +1184,11 @@
      if (oldCommonOrder == null)// 新增
      {
         commonOrder.setCreateTime(new Date());
         UserLevelEnum userLevel = userLevelManager.getUserLevel(commonOrder.getUserInfo().getId(),
               commonOrder.getThirdCreateTime());
         // 查询是否为vip
         boolean isVIP = userVIPInfoService.isVIP(commonOrder.getUserInfo().getId());
         if (isVIP)
            commonOrder.setUrank(100);// VIP订单
         if (userLevel != null)
            commonOrder.setUrank(userLevel.getOrderRank());// VIP订单
         else {
            UserInfo user = userInfoService.selectAvailableByPrimaryKey(commonOrder.getUserInfo().getId());
            if (user != null)
@@ -1748,13 +1752,10 @@
      return commonOrderMapper.countSearchOrderByUid(uid, list);
   }
   @Override
   public List<CommonOrder> getMinSettleTimeAndUid() {
      return commonOrderMapper.getMinSettleTimeAndUid();
   }
   
   @Override
   public List<CommonOrderVO> searchOrderByUid(AcceptData acceptData, int page, int size, Long uid, List<ESOrder> list)
@@ -1920,7 +1921,6 @@
            }
         }
         
         // 订单类型
         if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
            Integer orderType = order.getOrderType();
@@ -1933,7 +1933,6 @@
            order.setOrderType(4);
         }
                  
         Date thirdCreateTime = order.getThirdCreateTime();
         if (thirdCreateTime != null) {
            order.setDownTime("下单时间:" + format.format(thirdCreateTime));
@@ -1944,7 +1943,6 @@
         if (settleTime != null) {
            order.setReceiveTime("收货时间:" + format.format(settleTime));
         }
         /* 订单状态 转换处理 */
         String orderStateContent = "";
@@ -1966,11 +1964,12 @@
            }
         }
         // 2.1显示返利说明连接>  未失效-自购-分享
         if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            if (CommonOrder.STATE_SX != orderState && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)
                  && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType) || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) ) {
            if (CommonOrder.STATE_SX != orderState
                  && thirdCreateTime.getTime() > TimeUtil.convertDateToTemp(Constant.ORDER_SHOW_BRACE_TIME)
                  && ((HongBaoV2.TYPE_ZIGOU == hongBaoType || 2 == hongBaoType)
                        || HongBaoV2.TYPE_SHARE_GOODS == hongBaoType)) {
               String rebateLink = configService.get(ConfigKeyEnum.orderRebateDescLink.getKey());
               order.setRebateLink(rebateLink + "?orderNo=" + orderNo +"&sourceType=" + sourceType);
            }