|
|
|
@@ -11,6 +11,7 @@ import com.simple.service.WxCouponService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.simple.common.IdWorker; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxCouponChannelServiceImpl implements WxCouponChannelService { |
|
|
|
@@ -49,29 +50,31 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void addBatch(String[] ids,Integer channelId,String tanantId) { |
|
|
|
for (String couponidstr:ids) { |
|
|
|
Long couponid = Long.parseLong(couponidstr); |
|
|
|
addCuponChannel(couponid,channelId,tanantId); |
|
|
|
@Transactional |
|
|
|
public void addBatch(String[] ids,String[] channelId,String tanantId) { |
|
|
|
|
|
|
|
for (String targetIdstr:channelId) { |
|
|
|
Integer targetId = Integer.parseInt(targetIdstr); |
|
|
|
for (String couponidstr:ids) { |
|
|
|
Long couponid = Long.parseLong(couponidstr); |
|
|
|
addCuponChannel(couponid,targetId,tanantId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void addCuponChannel(Long couponid,Integer channelId,String tanantId){ |
|
|
|
} |
|
|
|
|
|
|
|
public void addCuponChannel(Long couponid,Integer channelId,String tanantId){ |
|
|
|
WxCoupon wxCouponUP = new WxCoupon(); |
|
|
|
wxCouponUP.setId(couponid); |
|
|
|
wxCouponUP.setStatus(1); |
|
|
|
wxCouponService.saveOrUpdate(wxCouponUP); |
|
|
|
|
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.setCouponId(couponid); |
|
|
|
wxCouponChannel.setCouponStatus(1); |
|
|
|
wxCouponChannel.setTargetAd(channelId); |
|
|
|
wxCouponChannel.setTenantId(tanantId); |
|
|
|
saveOrUpdate(wxCouponChannel); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|