Browse Source

修复优惠券被删除是用户券包报错

zyj
sj 2 years ago
parent
commit
a30fb508de
  1. 7
      zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java

7
zsw-bxg/src/main/java/co/yixiang/modules/activity/service/impl/YxStoreCouponUserServiceImpl.java

@ -192,7 +192,12 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
for (YxStoreCouponUser couponUser : storeCouponUsers) { for (YxStoreCouponUser couponUser : storeCouponUsers) {
YxStoreCouponUserQueryVo queryVo = generator.convert(couponUser,YxStoreCouponUserQueryVo.class); YxStoreCouponUserQueryVo queryVo = generator.convert(couponUser,YxStoreCouponUserQueryVo.class);
queryVo.setCname(couponUser.getCouponTitle()); queryVo.setCname(couponUser.getCouponTitle());
String[] idList= storeCouponService.getById(queryVo.getCid()).getProductId().split(","); String[] idList = new String[0];
YxStoreCoupon yxStoreCoupon=storeCouponService.getById(queryVo.getCid());
//防止券被删除报错
if (ObjectUtil.isNotEmpty(yxStoreCoupon)){
idList= storeCouponService.getById(queryVo.getCid()).getProductId().split(",");
}
List<String> needIdlist; List<String> needIdlist;
if (idList.length>3){ if (idList.length>3){
needIdlist= Arrays.asList(Arrays.copyOf(idList, 3)); needIdlist= Arrays.asList(Arrays.copyOf(idList, 3));

Loading…
Cancel
Save