|
|
|
@@ -616,6 +616,14 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
WxCouponMall couponMall = new WxCouponMall(); |
|
|
|
couponMall.updateTenantInfo(record); |
|
|
|
couponMall.setProductId(record.getId()); |
|
|
|
List<WxCouponMall> couponMallList = wxCouponMallMapper.findList(couponMall); |
|
|
|
Map<String,Integer> alreadyMallTenant = new HashMap<String,Integer>(); |
|
|
|
if (null != couponMallList && couponMallList.size() > 0 ) { |
|
|
|
for (int i = 0 ; i < couponMallList.size() ; i ++) { |
|
|
|
WxCouponMall c = couponMallList.get(i); |
|
|
|
alreadyMallTenant.put(c.getMallTenantId(),c.getStatus()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxCouponMallMapper.delteAllByProductId(couponMall); |
|
|
|
for (String mt : record.getMallTenantIds()) { |
|
|
|
WxCouponMall mall = new WxCouponMall(); |
|
|
|
@@ -624,10 +632,15 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
mall.setProductId(record.getId()); |
|
|
|
mall.setCreateDate(new Date()); |
|
|
|
mall.setUpdateDate(new Date()); |
|
|
|
if (EnumCouponType.checkCreateWithMerchants(record.getType())) { |
|
|
|
mall.setStatus(EnumCouponMallStatus.FINISED.getCode()); |
|
|
|
Integer status = alreadyMallTenant.get(mt); |
|
|
|
if (null != status ) { |
|
|
|
mall.setStatus(status); |
|
|
|
}else { |
|
|
|
mall.setStatus(EnumCouponMallStatus.UNFINISED.getCode()); |
|
|
|
if (EnumCouponType.checkCreateWithMerchants(record.getType())) { |
|
|
|
mall.setStatus(EnumCouponMallStatus.FINISED.getCode()); |
|
|
|
}else { |
|
|
|
mall.setStatus(EnumCouponMallStatus.UNFINISED.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxCouponMallMapper.insert(mall); |
|
|
|
} |
|
|
|
|