admin
2019-12-11 8b3371befea773bda4e08b19189c25c32ea6818f
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -213,8 +213,8 @@
    * @param list
    * @param signList
    */
   public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, boolean exchangeCoupon,
         Integer hongBaoState, Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList,
   public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon,   Integer hongBaoState,
         Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList,
         Long uid, AcceptData acceptData) {
      // 是否免单商品
@@ -262,35 +262,34 @@
      // 订单标识
      order.setSignList(signList);
      // 1.6.5 是否存在新兑换的券
      if (!hasRewardCoupon && exchangeCoupon) {
         try {
            Date thirdCreateTime = order.getThirdCreateTime();
            if (thirdCreateTime != null) {
               long downOrderTime = thirdCreateTime.getTime();
               long limitDate = TimeUtil.convertDateToTemp("2019-09-10");
               if (downOrderTime > limitDate)
                  hasRewardCoupon = true;
            }
         } catch (Exception e) {
            e.printStackTrace();
         }
      }
      boolean rewardOrder = false;
      int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
      if (rewardSuccess) {
         if (!VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
            rewardOrder = true; // 奖励成功 2.0.2 消失
      boolean rewardOrder = false;
      if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
         if (rewardSuccess) {
            rewardOrder = true; // 以前版本奖励成功 的显示入口
         }
      } else if (hasRewardCoupon && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType
            && HongBaoV2.STATE_YILINGQU == hongBaoState) { // 有可用的奖励券 、非免单订单 、且已到账的 、返利订单
         if (!userVIPInfoService.isVIP(uid)) { // 非会员可使用奖励券
         // 已到账的返利订单、非会员可使用奖励券
         if (!freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType && HongBaoV2.STATE_YILINGQU == hongBaoState
               && !userVIPInfoService.isVIP(uid)) {
            type = 2; 
            rewardOrder = true; 
         }
      } else if (hasRewardCoupon && !freeOrder && HongBaoV2.TYPE_ZIGOU == hongBaoType
               && HongBaoV2.STATE_YILINGQU == hongBaoState && !userVIPInfoService.isVIP(uid)) {
          // 有可用的奖励券 、非免单订单 、且已到账的 、返利订单、 非超级会员
         type = 2;
         rewardOrder = true;
      }
      // 维权订单 不可使用
      Integer orderState = order.getState();
      if(CommonOrder.STATE_WQ == orderState) {
         rewardOrder = false;
      }
      if (rewardOrder) {
         try {
            boolean newEdition = false;
@@ -298,13 +297,12 @@
            String unit = null;
            boolean canUse = false;
            // 版本区分:2.1
            // 版本区分:2.1  奖励券倒计时
            if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
               Date thirdCreateTime = order.getThirdCreateTime();
               if (thirdCreateTime != null) {
                  long downOrderTime = thirdCreateTime.getTime();
                  long limitDate = Long.parseLong("1571760000000"); // TODO
                                                         // 日期待确定2019-11-10
                  long limitDate = TimeUtil.parse(Constant.COUPON_REWARD_TIME).getTime();
                  if (downOrderTime > limitDate) {
                     newEdition = true;
                     Date endDay = DateUtil.plusDayDate(4, thirdCreateTime);
@@ -470,8 +468,7 @@
      Date august = TimeUtil.parse("2019-08-01");
      // 是否存在奖励券
      boolean hasRewardCoupon = userSystemCouponService.getIncludeNotExchange(uid);
      boolean exchangeCoupon = userSystemCouponService.getIncludeExchange(uid);
      boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid);
      // 需要查询是否为VIP的用户ID,只有邀请订单才需要查询
      List<Long> needSelectVIPUidList = new ArrayList<>();
@@ -616,7 +613,7 @@
         } else if (CommonOrder.STATE_SX == orderState) {
            orderStateContent = "未付款/已退款";
         } else if (CommonOrder.STATE_WQ == orderState) {
            orderStateContent = "已维权";
            orderStateContent = "已售后";
            if (sourceType != null && sourceType == Constant.SOURCE_TYPE_TAOBAO) {
               /* 订单维权 判断是否全部维权 */
               List<TaoBaoWeiQuanOrder> listWQ = taoBaoWeiQuanOrderMapper
@@ -634,11 +631,11 @@
               } else {
                  // 2019.8.1 返回维权信息
                  if (settleTime != null && august != null && settleTime.getTime() > august.getTime()) {
                     orderStateContent = "维权成功";
                     orderStateContent = "售后成功";
                     WeiQuanInfo weiQuanInfo = new WeiQuanInfo();
                     weiQuanInfo.setOldHongBao("¥" + hongBao.setScale(2, BigDecimal.ROUND_DOWN).toString());
                     weiQuanInfo
                           .setWqHongBao("维权:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
                           .setWqHongBao("售后:-¥" + weiQuanMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
                     hongBao = MoneyBigDecimalUtil.sub(hongBao, weiQuanMoney);
                     order.setWeiQuanInfo(weiQuanInfo);
                  }
@@ -772,16 +769,16 @@
         } else {
            // 奖励订单、免单 使用记录
            if (sourceType == null) {
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, null,
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null,
                     signList, uid, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType,
                     listRecordTB, signList, uid, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_JD) {
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType,
                     listRecordJD, signList, uid, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType,
                     listRecordPDD, signList, uid, acceptData);
            }
         }