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

This commit is contained in:
sj
2022-11-11 16:27:49 +08:00
parent aa792a10b1
commit a30fb508de
@@ -192,7 +192,12 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
for (YxStoreCouponUser couponUser : storeCouponUsers) {
YxStoreCouponUserQueryVo queryVo = generator.convert(couponUser,YxStoreCouponUserQueryVo.class);
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;
if (idList.length>3){
needIdlist= Arrays.asList(Arrays.copyOf(idList, 3));