|
|
@@ -1,5 +1,6 @@
|
|
|
package org.jeecg.modules.medical.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -108,11 +109,16 @@ public class RuleFactorRelaController extends JeecgController<RuleFactorRela, IR
|
|
|
@AutoLog(value = "配置规则批量添加")
|
|
|
@ApiOperation(value = "配置规则批量添加", notes = "配置规则批量添加")
|
|
|
@PostMapping(value = "/addList")
|
|
|
- public Result<String> addList(@RequestBody List<RuleFactorRela> list) {
|
|
|
- if (list.size() > 0) {
|
|
|
- Integer seqNum = ruleFactorRelaService.maxSeqNum(list.get(0).getMedicalInsRuleInfoId());
|
|
|
- list.stream().forEach(it -> {
|
|
|
- it.setSeqNum(seqNum + 1);
|
|
|
+ public Result<String> addList(@RequestBody RuleFactorRela ruleFactorRela) {
|
|
|
+ if (ruleFactorRela.getMedicalInsRuleInfoId()!=null) {
|
|
|
+ Integer seqNum = ruleFactorRelaService.maxSeqNum(ruleFactorRela.getMedicalInsRuleInfoId());
|
|
|
+ List<RuleFactorRela> list = new ArrayList<>();
|
|
|
+ ruleFactorRela.getFactorEnhanceIdList().stream().forEach(it -> {
|
|
|
+ RuleFactorRela rale= new RuleFactorRela();
|
|
|
+ rale.setFactorEnhanceId(it);
|
|
|
+ rale.setMedicalInsRuleInfoId(ruleFactorRela.getMedicalInsRuleInfoId());
|
|
|
+ rale.setSeqNum(seqNum + 1);
|
|
|
+ list.add(rale);
|
|
|
});
|
|
|
ruleFactorRelaService.saveBatch(list);
|
|
|
}
|