广脉:1、新增是过滤id。2、影响因素删除时,需要考虑影响因素关联是否有引用,引用则不可删除。

This commit is contained in:
zhengyf 2025-05-30 15:01:33 +08:00
parent 150ce57bfb
commit fd6dcba206
5 changed files with 13 additions and 8 deletions

View File

@ -223,7 +223,6 @@
keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_influence_factor_correlation(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="factorId != null">factor_id ,</if>
<if test="factorName != null and factorName != ''">factor_name ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
@ -254,7 +253,6 @@
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="factorId != null">#{factorId} ,</if>
<if test="factorName != null and factorName != ''">#{factorName} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>

View File

@ -205,7 +205,6 @@
keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_influence_factor(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="aeConfModuleId != null">ae_conf_module_id ,</if>
<if test="aeConfModuleName != null and aeConfModuleName != ''">ae_conf_module_name ,</if>
<if test="factorName != null and factorName != ''">factor_name ,</if>
@ -232,7 +231,6 @@
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="aeConfModuleId != null">#{aeConfModuleId} ,</if>
<if test="aeConfModuleName != null and aeConfModuleName != ''">#{aeConfModuleName} ,</if>
<if test="factorName != null and factorName != ''">#{factorName} ,</if>

View File

@ -3,6 +3,8 @@ package com.hzya.frame.voucher.ae.comf.factor.service.impl;
import cn.hutool.core.lang.Assert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzya.frame.voucher.ae.comf.factor.dao.IAeConfInfluenceFactorCorrelationDao;
import com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorCorrelationEntity;
import com.hzya.frame.voucher.ae.comf.factor.entity.AeConfInfluenceFactorEntity;
import com.hzya.frame.voucher.ae.comf.factor.dao.IAeConfInfluenceFactorDao;
import com.hzya.frame.voucher.ae.comf.factor.service.IAeConfInfluenceFactorService;
@ -32,6 +34,8 @@ public class AeConfInfluenceFactorServiceImpl extends BaseService<AeConfInfluenc
this.dao = dao;
}
@Autowired
private IAeConfInfluenceFactorCorrelationDao aeConfInfluenceFactorCorrelationDao;
@Autowired
private IAeConfBusinessModuleDao aeConfBusinessModuleDao;
@Autowired
@ -87,9 +91,18 @@ public class AeConfInfluenceFactorServiceImpl extends BaseService<AeConfInfluenc
}
/**
* 删除时需要考虑影响因素关联是否有引用引用则不可删除
*/
@Override
public int logicRemove(AeConfInfluenceFactorEntity entity) throws Exception {
Assert.notNull(entity.getId(), "删除影响因素设置时影响因素id不能为空");
AeConfInfluenceFactorCorrelationEntity factorCorrelation = new AeConfInfluenceFactorCorrelationEntity();
factorCorrelation.setFactorId(Long.valueOf(entity.getId()));
List<AeConfInfluenceFactorCorrelationEntity> correlationList = aeConfInfluenceFactorCorrelationDao.query(factorCorrelation);
if(correlationList.size()!=0){
Assert.state(false,"删除失败。该影响因素已被关联,请检查影响因素关联配置。");
}
return aeConfInfluenceFactorDao.logicRemove(entity);
}

View File

@ -157,7 +157,6 @@
keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_business_module(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="moduleName != null and moduleName != ''">module_name ,</if>
<if test="def1 != null and def1 != ''">def1 ,</if>
<if test="def2 != null and def2 != ''">def2 ,</if>
@ -180,7 +179,6 @@
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="moduleName != null and moduleName != ''">#{moduleName} ,</if>
<if test="def1 != null and def1 != ''">#{def1} ,</if>
<if test="def2 != null and def2 != ''">#{def2} ,</if>

View File

@ -200,7 +200,6 @@
keyProperty="id" useGeneratedKeys="true">
insert into ae_conf_business_module_mdm(
<trim suffix="" suffixOverrides=",">
<if test="id != null">id ,</if>
<if test="aeConfModuleId != null">ae_conf_module_id ,</if>
<if test="aeConfModuleName != null and aeConfModuleName != ''">ae_conf_module_name ,</if>
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
@ -227,7 +226,6 @@
</trim>
)values(
<trim suffix="" suffixOverrides=",">
<if test="id != null">#{id} ,</if>
<if test="aeConfModuleId != null">#{aeConfModuleId} ,</if>
<if test="aeConfModuleName != null and aeConfModuleName != ''">#{aeConfModuleName} ,</if>
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>