admin
2020-04-15 d4588f4e43336b26b356b869c29d0c76390167d5
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -2041,11 +2041,11 @@
            
            // 是否已使用奖励券、免单券情况
             if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
               couponUseFactory(order, signList, listRecordTB);
               couponUseFactory(order, listRecordTB);
            } else if (sourceType == Constant.SOURCE_TYPE_JD) {
               couponUseFactory(order, signList, listRecordJD);
               couponUseFactory(order, listRecordJD);
            } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
               couponUseFactory(order, signList, listRecordPDD);
               couponUseFactory(order, listRecordPDD);
            }
         } else if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
            // 分享
@@ -2124,18 +2124,14 @@
    * 订单: 免单标识 奖励标识
    * 
    * @param order
    * @param hasRewardCoupon
    * @param hongBaoState
    * @param list
    * @param signList
    */
   private void couponUseFactory(CommonOrderVO order,List<String> signList, List<UserSystemCouponRecord> list) throws Exception {
   private void couponUseFactory(CommonOrderVO order, List<UserSystemCouponRecord> list) throws Exception {
      if (list == null || list.size() == 0) {
         return;
      }
      // 是否免单商品
      boolean freeOrder = false;
      String text = null;
      for (UserSystemCouponRecord couponRecord : list) {
         int goodSource = couponRecord.getGoodSource();
         if (goodSource == 0)
@@ -2145,47 +2141,30 @@
         if (order.getOrderNo().equals(orderNo) && goodSource == order.getSourceType()) {
            Integer state = couponRecord.getState();
            String systemCouponType = couponRecord.getCouponType();
            if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
            if (CouponTypeEnum.rebatePercentCoupon.name().equals(systemCouponType)
                  && UserSystemCouponRecord.STATE_SUCCESS == state) {
               text = "已奖励";
            } else if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
                  || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)
                  || CouponTypeEnum.freeCouponBuy.name().equals(systemCouponType)) {
               if (UserSystemCouponRecord.STATE_FREE_ON == state) {
                  // 免单中
                  freeOrder = true;
                  signList.add(PIC_FREE_ON);
                  text = "免单中";
               } else if (UserSystemCouponRecord.STATE_SUCCESS == state) {
                  // 免单成功
                  freeOrder = true;
                  signList.add(PIC_FREE_SUCCEED);
               } else if (UserSystemCouponRecord.STATE_FAIL_RULE == state
                     || UserSystemCouponRecord.STATE_FAIL_DRAWBACK == state) {
                  // 规则不匹配、退款
                  freeOrder = true;
                  signList.add(PIC_FREE_FAIL);
               }
                  text = "免单成功";
               }
            }
            break;
         }
      }
      // 免单详情
      if (freeOrder) {
      if (!StringUtil.isNullOrEmpty(text)) {
         ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
         rewardStyleVO.setContent("免单详情 >");
         rewardStyleVO.setContent(text);
         rewardStyleVO.setColor("#E5005C");
         rewardStyleVO.setBottomColor("#FFDCEA");
         Map<String, Object> jumpLink = new HashMap<String, Object>();
         jumpLink.put("orderNo", order.getOrderNo());
         jumpLink.put("goodsType", order.getSourceType() + "");
         Map<String, Object> jump = new HashMap<String, Object>();
         jump.put("type", 1); // 页面跳转
         jump.put("params", jumpLink);
         jump.put("jumpDetail", jumpDetailV2Service.getByTypeCache("freeCouponDetail"));
         Map<String, Object> rewardMap = new HashMap<String, Object>();
         rewardMap.put("text", rewardStyleVO);
         rewardMap.put("jump", jump);
         order.setRewardDetail(rewardMap);
      }
   }