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