yujian
2019-08-28 d88c167fc5973a2c15ff1539e4cdab36e4a7842c
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -329,7 +329,9 @@
      SimpleDateFormat formatday = new SimpleDateFormat("yyyy.MM.dd");
      // 是否存在奖励券
      boolean hasRewardCoupon = userSystemCouponService.hasRewardCoupon(uid);
      //boolean hasRewardCoupon = userSystemCouponService.hasRewardCoupon(uid);
      boolean hasRewardCoupon = userSystemCouponService.getIncludeNotExchange(uid);
      boolean exchangeCoupon = userSystemCouponService.getIncludeExchange(uid);
      // 2019.8.1开始返回维权信息
      Date august = null;
@@ -548,13 +550,13 @@
         } else {
            // 奖励订单、免单 使用记录
            if (sourceType == null) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList, acceptData);
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, null, signList, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, signList, acceptData);
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, listRecordTB, signList, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_JD) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, signList, acceptData);
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, listRecordJD, signList, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, signList, acceptData);
               setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, listRecordPDD, signList, acceptData);
            }
         }
@@ -576,7 +578,7 @@
    * @param list
    * @param signList
    */
   public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState,
   public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, boolean exchangeCoupon, Integer hongBaoState,
         Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList, AcceptData acceptData) {
      // 是否免单商品
@@ -624,6 +626,21 @@
      // 订单标识
      order.setSignList(signList);
      // 1.6.5 是否存在新兑换的券
      if (!hasRewardCoupon && exchangeCoupon) {
         try {
            String downTime = order.getDownTime();
            if (!StringUtil.isNullOrEmpty(downTime)) {
               long downOrderTime = TimeUtil.convertDateToTemp2(downTime);
               long limitDate = TimeUtil.convertDateToTemp("2019-09-01");
               if (downOrderTime > limitDate )
                  hasRewardCoupon = true;
            }
         } catch (Exception e) {
            e.printStackTrace();
         }
      }
      boolean rewardOrder = false;
      int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
@@ -635,7 +652,7 @@
         // 有可用的奖励券 、非免单订单 、且已到账的 、返利订单
         type = 2;
         rewardOrder = true;
      }
      }
      if (rewardOrder) {
         ClientTextStyleVO rewardStyleVO = new ClientTextStyleVO();
@@ -1412,4 +1429,10 @@
      return commonOrderMapper.listBySourceTypeAndStateAndThirdCrateTime(sourceType, state, minTime, maxTime,
            (page - 1) * pageSize, pageSize);
   }
   @Override
   public List<CommonOrder> getByOrderNo(Long uid, String orderNO) {
      return commonOrderMapper.getByOrderNo(uid, orderNO);
   }
}