|
|
@@ -1,6 +1,7 @@
|
|
|
package org.jeecg.modules.medical.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.modules.medical.Constant;
|
|
|
import org.jeecg.modules.medical.entity.EventAttr;
|
|
|
@@ -14,6 +15,7 @@ import org.jeecg.modules.medical.mapper.FactorEnchanceMapper;
|
|
|
import org.jeecg.modules.medical.mapper.RuleFactorRelaMapper;
|
|
|
import org.jeecg.modules.medical.service.IFactorCondRelaService;
|
|
|
import org.jeecg.modules.medical.service.IFactorEnchanceService;
|
|
|
+import org.jeecg.modules.system.entity.SysAnnouncementSend;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -26,7 +28,7 @@ import java.util.List;
|
|
|
/**
|
|
|
* @Description: factor_enchance
|
|
|
* @Author: jeecg-boot
|
|
|
- * @Date: 2023-04-23
|
|
|
+ * @Date: 2023-04-23
|
|
|
* @Version: V1.0
|
|
|
*/
|
|
|
@Service
|
|
|
@@ -40,10 +42,14 @@ public class FactorEnchanceServiceImpl extends ServiceImpl<FactorEnchanceMapper,
|
|
|
@Override
|
|
|
public Integer saveSqlFactorEnchance(FactorEnchance factorEnchance) {
|
|
|
// List<FactorAttrRela> factorAttrRelaList = new ArrayList<>();
|
|
|
- if(CollectionUtil.isNotEmpty(factorEnchance.getInParamList())){
|
|
|
+ if (CollectionUtil.isNotEmpty(factorEnchance.getInParamList())) {
|
|
|
FactorAttrRela factorAttrRela = null;
|
|
|
- int index=1;
|
|
|
- for(Integer eventAttrId : factorEnchance.getInParamList()){
|
|
|
+ int index = 1;
|
|
|
+ QueryWrapper<FactorAttrRela> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("factor_enhance_id", factorEnchance.getId());
|
|
|
+ queryWrapper.eq("io_type", Constant.INPUT);
|
|
|
+ factorAttrRelaMapper.delete(queryWrapper);
|
|
|
+ for (Integer eventAttrId : factorEnchance.getInParamList()) {
|
|
|
factorAttrRela = new FactorAttrRela();
|
|
|
factorAttrRela.setFactorEnhanceId(factorEnchance.getId());
|
|
|
factorAttrRela.setIoType(Constant.INPUT);
|
|
|
@@ -54,10 +60,14 @@ public class FactorEnchanceServiceImpl extends ServiceImpl<FactorEnchanceMapper,
|
|
|
factorAttrRelaMapper.insert(factorAttrRela);
|
|
|
}
|
|
|
}
|
|
|
- if(CollectionUtil.isNotEmpty(factorEnchance.getOutParamList())){
|
|
|
+ if (CollectionUtil.isNotEmpty(factorEnchance.getOutParamList())) {
|
|
|
FactorAttrRela factorAttrRela = null;
|
|
|
- int index=1;
|
|
|
- for(Integer eventAttrId : factorEnchance.getOutParamList()){
|
|
|
+ int index = 1;
|
|
|
+ QueryWrapper<FactorAttrRela> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("factor_enhance_id", factorEnchance.getId());
|
|
|
+ queryWrapper.eq("io_type", Constant.OUTPUT);
|
|
|
+ factorAttrRelaMapper.delete(queryWrapper);
|
|
|
+ for (Integer eventAttrId : factorEnchance.getOutParamList()) {
|
|
|
factorAttrRela = new FactorAttrRela();
|
|
|
factorAttrRela.setFactorEnhanceId(factorEnchance.getId());
|
|
|
factorAttrRela.setIoType(Constant.OUTPUT);
|
|
|
@@ -74,7 +84,10 @@ public class FactorEnchanceServiceImpl extends ServiceImpl<FactorEnchanceMapper,
|
|
|
|
|
|
@Override
|
|
|
public Integer saveLogicalFactorEnchance(FactorEnchance factorEnchance) {
|
|
|
- if(CollectionUtil.isNotEmpty(factorEnchance.getFactorCondRelaList())) {
|
|
|
+ if (CollectionUtil.isNotEmpty(factorEnchance.getFactorCondRelaList())) {
|
|
|
+ QueryWrapper<FactorCondRela> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("factor_enhance_id", factorEnchance.getId());
|
|
|
+ factorCondRelaMapper.delete(queryWrapper);
|
|
|
for (FactorCondRela factorCondRela : factorEnchance.getFactorCondRelaList()) {
|
|
|
factorCondRela.setFactorEnhanceId(factorEnchance.getId());
|
|
|
factorCondRelaMapper.insert(factorCondRela);
|