admin
2019-08-19 e5e38de6745c8fcae91fa7e459898f3663d00001
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -548,13 +548,13 @@
         } else {
            // 奖励订单、免单 使用记录
            if (sourceType == null) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList);
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, signList);
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordTB, signList, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_JD) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, signList);
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordJD, signList, acceptData);
            } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, signList);
               setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, listRecordPDD, signList, acceptData);
            }
         }
@@ -577,7 +577,7 @@
    * @param signList
    */
   public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, Integer hongBaoState,
         Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList) {
         Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList, AcceptData acceptData) {
      // 是否免单商品
      boolean freeOrder = false;
@@ -645,6 +645,9 @@
         Map<String, Object> jumpLink = new HashMap<String, Object>();
         jumpLink.put("orderNo", order.getOrderNo());
         if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
            jumpLink.put("goodsType", order.getSourceType());
         }
         Map<String, Object> jump = new HashMap<String, Object>();
         jump.put("type", type);
@@ -667,6 +670,9 @@
         Map<String, Object> jumpLink = new HashMap<String, Object>();
         jumpLink.put("orderNo", order.getOrderNo());
         if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
            jumpLink.put("goodsType", order.getSourceType());
         }
         Map<String, Object> jump = new HashMap<String, Object>();
         jump.put("type", 1); // 页面跳转
@@ -1023,8 +1029,14 @@
         Integer type, Integer orderState, String startTime, String endTime, Integer source)
         throws CommonOrderException {
      List<CommonOrderVO> list = commonOrderMapper.listQuery(start, count, keyType, key, state, type, orderState,
            startTime, endTime, source);
      List<CommonOrderVO> list = null;
      if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 搜索框无值或者按订单号搜索时都只搜索主订单
         list = commonOrderMapper.listQueryWithNoChild(start, count, keyType, key, state, type, orderState,
               startTime, endTime, source);
      } else
         list = commonOrderMapper.listQuery(start, count, keyType, key, state, type, orderState, startTime, endTime,
               source);
      if (list == null) {
         list = new ArrayList<CommonOrderVO>();
@@ -1155,6 +1167,8 @@
                        || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
                     if (UserSystemCouponRecord.STATE_SUCCESS == couponState) {
                        // 免单成功
                        order.setOtherState(2);
                     } else if (UserSystemCouponRecord.STATE_FREE_ON == couponState) {
                        order.setOtherState(1);
                     }
                  }
@@ -1170,6 +1184,8 @@
                        || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
                     if (UserSystemCouponRecord.STATE_SUCCESS == couponState) {
                        // 免单成功
                        order.setOtherState(2);
                     } else if (UserSystemCouponRecord.STATE_FREE_ON == couponState) {
                        order.setOtherState(1);
                     }
                  }
@@ -1185,6 +1201,8 @@
                        || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
                     if (UserSystemCouponRecord.STATE_SUCCESS == couponState) {
                        // 免单成功
                        order.setOtherState(2);
                     } else if (UserSystemCouponRecord.STATE_FREE_ON == couponState) {
                        order.setOtherState(1);
                     }
                  }
@@ -1201,7 +1219,11 @@
   @Override
   public long countQuery(Integer keyType, String key, Integer state, Integer type, Integer orderState,
         String startTime, String endTime, Integer source) throws CommonOrderException {
      return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
      if (StringUtil.isNullOrEmpty(key) || keyType == 1) {// 搜索框无值或者按订单号搜索时都只搜索主订单
         return commonOrderMapper.countQueryWithNoChild(keyType, key, state, type, orderState, startTime, endTime,
               source);
      } else
         return commonOrderMapper.countQuery(keyType, key, state, type, orderState, startTime, endTime, source);
   }
   @Override
@@ -1379,5 +1401,4 @@
      return commonOrderMapper.listBySourceTypeAndStateAndThirdCrateTime(sourceType, state, minTime, maxTime,
            (page - 1) * pageSize, pageSize);
   }
}