|
|
|
@@ -59,7 +59,7 @@ public class WxCampaignServiceImpl implements WxCampaignService { |
|
|
|
return wxCampaignMapper.selectByPrimaryKey(id); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public ResultData saveOrUpdate(WxCampaign wxCampaign) { |
|
|
|
if(wxCampaign.getType().equals(EnumCampaignType.STABLE.getCode())) { |
|
|
|
@@ -90,22 +90,21 @@ public class WxCampaignServiceImpl implements WxCampaignService { |
|
|
|
wxCampaignMapper.updateByPrimaryKeySelective(wxCampaign); |
|
|
|
} |
|
|
|
//type 为固定格式才会有券的信息 才会有投放的问题 |
|
|
|
wxCampaign = wxCampaignMapper.selectByPrimaryKey(wxCampaign.getId()); |
|
|
|
if (wxCampaign.getType().equals(EnumCampaignType.STABLE.getCode())) { |
|
|
|
if (wxCampaign.getStatus().equals(EnumCampaignStatus.STATUS_THROW_IN.getCode())) { |
|
|
|
addOrUpdateBatch(JSONArray.parseArray(wxCampaign.getCouponIds(), String.class), wxCampaign); |
|
|
|
} else { |
|
|
|
delBatch(wxCampaign); |
|
|
|
} |
|
|
|
} |
|
|
|
couponInject(wxCampaign); |
|
|
|
return new ResultData(Result.SUCCESS,"操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public ResultData updateStatus(WxCampaign wxCampaign) { |
|
|
|
wxCampaignMapper.updateByPrimaryKeySelective(wxCampaign); |
|
|
|
wxCampaign = wxCampaignMapper.selectByPrimaryKey(wxCampaign); |
|
|
|
//type 为固定格式才会有券的信息 才会有投放的问题 |
|
|
|
couponInject(wxCampaign); |
|
|
|
return new ResultData(Result.SUCCESS, "操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public void couponInject(WxCampaign wxCampaign) { |
|
|
|
wxCampaign = wxCampaignMapper.selectByPrimaryKey(wxCampaign.getId()); |
|
|
|
if (wxCampaign.getType().equals(EnumCampaignType.STABLE.getCode())) { |
|
|
|
if (wxCampaign.getStatus().equals(EnumCampaignStatus.STATUS_THROW_IN.getCode())) { |
|
|
|
addOrUpdateBatch(JSONArray.parseArray(wxCampaign.getCouponIds(), String.class), wxCampaign); |
|
|
|
@@ -113,7 +112,6 @@ public class WxCampaignServiceImpl implements WxCampaignService { |
|
|
|
delBatch(wxCampaign); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "操作成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public void delBatch(WxCampaign record) { |
|
|
|
|