yujian
2019-07-12 9d8dfb01ff72c57abad3b80f3d65e81a5354db03
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -52,7 +52,6 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
import com.yeshi.fanli.util.factory.goods.CommonOrderFactory;
import com.yeshi.fanli.util.jd.JDApiUtil;
@@ -921,6 +920,14 @@
      if (list.size() == 0) {
         return list;
      }
      List<String> listNo = new ArrayList<String>();
      for (CommonOrderVO commonOrderVO : list) {
         listNo.add(commonOrderVO.getOrderNo());
      }
      // 已经使用券订单
      List<UserSystemCouponRecord> couponRecordList = userSystemCouponRecordService.getRecordByOrderNoList(listNo);
      SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
      for (CommonOrderVO order : list) {
@@ -998,6 +1005,28 @@
               }
            }
         }
         // 奖励订单、免单 使用记录
         if (couponRecordList != null && couponRecordList.size() > 0) {
            for (UserSystemCouponRecord couponRecord : couponRecordList) {
               // 订单号匹配
               if (order.getOrderNo().equals(couponRecord.getOrderNo())) {
                  String systemCouponType = couponRecord.getCouponType();
                  Integer couponState = couponRecord.getState();
                  if (CouponTypeEnum.freeCoupon.name().equals(systemCouponType)
                        || CouponTypeEnum.welfareFreeCoupon.name().equals(systemCouponType)) {
                      if (UserSystemCouponRecord.STATE_SUCCESS == couponState) {
                        // 免单成功
                         order.setOtherState(1);
                     }
                  }
                  break;
               }
            }
         }
      }