|
|
|
@@ -22,13 +22,13 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponMapper wxCouponMapper; |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
WxCouponChannelService wxCouponChannelService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
WxCouponSendService wxCouponSendService; |
|
|
|
|
|
|
|
|
|
|
|
@@ -57,7 +57,7 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
if (record.getId() == null) { |
|
|
|
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
wxCouponMapper.insertSelective(record); |
|
|
|
} else { |
|
|
|
wxCouponMapper.updateByPrimaryKeySelective(record); |
|
|
|
@@ -84,11 +84,11 @@ public class WxCouponServiceImpl implements WxCouponService { |
|
|
|
@Transactional |
|
|
|
public ResultData updateCoupon(WxCoupon wxCoupon) { |
|
|
|
WxCoupon query = wxCouponMapper.selectByPrimaryKey(wxCoupon.getId()); |
|
|
|
if(wxCoupon.getStatus()!=null){ |
|
|
|
if(wxCoupon.getStatus()==1){ //已作废 |
|
|
|
if (wxCoupon.getStatus() != null) { |
|
|
|
if (query.getStatus() == 0 && wxCoupon.getStatus() == 1) { |
|
|
|
//作废所有投放频道 |
|
|
|
wxCouponChannelService.updateStatusByCouponId(wxCoupon.getId(),query.getTenantId(),1); |
|
|
|
wxCouponSendService.updateStatusByCouponId(query.getId(),query.getTenantId(),1); |
|
|
|
wxCouponChannelService.updateStatusByCouponId(wxCoupon.getId(), query.getTenantId(), 1); |
|
|
|
wxCouponSendService.updateStatusByCouponId(query.getId(), query.getTenantId(), 1); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(saveOrUpdate(wxCoupon)); |
|
|
|
|