| @@ -8,6 +8,7 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.WxVtwoActivityOrderStatistics; | import com.iformall.domain.vo.WxVtwoActivityOrderStatistics; | ||||
| import com.iformall.domain.vo.WxVtwoActivityRuleDetail; | import com.iformall.domain.vo.WxVtwoActivityRuleDetail; | ||||
| import com.iformall.domain.vo.WxVtwoActivityTaxDeductionRule; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxVtwoActivityAwardService; | import com.iformall.service.WxVtwoActivityAwardService; | ||||
| @@ -129,6 +130,7 @@ public class WxVtwoCashBackActivityServiceImpl extends ServiceImpl<WxVtwoCashBac | |||||
| @Override | @Override | ||||
| @Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
| public boolean saveOrUpdate(WxVtwoCashBackActivity cashBackActivity) { | public boolean saveOrUpdate(WxVtwoCashBackActivity cashBackActivity) { | ||||
| handlerActivityRules(cashBackActivity); | |||||
| Date now = new Date(); | Date now = new Date(); | ||||
| if(cashBackActivity.getId() == null){ | if(cashBackActivity.getId() == null){ | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -156,6 +158,12 @@ public class WxVtwoCashBackActivityServiceImpl extends ServiceImpl<WxVtwoCashBac | |||||
| return true; | return true; | ||||
| } | } | ||||
| private void handlerActivityRules(WxVtwoCashBackActivity cashBackActivity) { | |||||
| if(cashBackActivity.getTaxDeductionRulesObject() != null){ | |||||
| cashBackActivity.setTaxDeductionRules(JSONObject.toJSONString(cashBackActivity.getTaxDeductionRulesObject())); | |||||
| } | |||||
| } | |||||
| @Override | @Override | ||||
| public WxVtwoCashBackActivity getInfoById(Long id, String tenantId) { | public WxVtwoCashBackActivity getInfoById(Long id, String tenantId) { | ||||
| WxVtwoCashBackActivity cashBackActivity = wxVtwoCashBackActivityMapper.selectById(id, tenantId); | WxVtwoCashBackActivity cashBackActivity = wxVtwoCashBackActivityMapper.selectById(id, tenantId); | ||||
| @@ -163,6 +171,10 @@ public class WxVtwoCashBackActivityServiceImpl extends ServiceImpl<WxVtwoCashBac | |||||
| return null; | return null; | ||||
| } | } | ||||
| if(StringUtil.isNotBlank(cashBackActivity.getTaxDeductionRules())){ | |||||
| cashBackActivity.setTaxDeductionRulesObject(JSONObject.parseObject(cashBackActivity.getTaxDeductionRules(), WxVtwoActivityTaxDeductionRule.class)); | |||||
| } | |||||
| WxVtwoCashBackAward cashBackAwardQ = new WxVtwoCashBackAward(); | WxVtwoCashBackAward cashBackAwardQ = new WxVtwoCashBackAward(); | ||||
| cashBackAwardQ.setTenantId(tenantId); | cashBackAwardQ.setTenantId(tenantId); | ||||
| cashBackAwardQ.setActivityId(id); | cashBackAwardQ.setActivityId(id); | ||||