|
@@ -66,7 +66,7 @@ public class ShipWarningServiceImpl implements ShipWarningService {
|
|
|
//根据规则ID删除 规则模型区域关系
|
|
|
shipWarningModelMapper.delRuleModelAreaByRId(paramRuleId);
|
|
|
//删除规则下的规则模型参数关系
|
|
|
- shipWarningModelMapper.delRuleModelParamByRId(paramRuleId);
|
|
|
+ //shipWarningModelMapper.delRuleModelParamByRId(paramRuleId);
|
|
|
ruleId = paramRuleId;
|
|
|
}else {
|
|
|
if(shipWarningModelMapper.selectWarningRuleByName(name,null)>0){
|
|
@@ -81,14 +81,21 @@ public class ShipWarningServiceImpl implements ShipWarningService {
|
|
|
|
|
|
String finalRuleId = ruleId;
|
|
|
warningRuleReq.getParamList().stream().forEach(list->{
|
|
|
- RuleModelParamData ruleModelParamData = new RuleModelParamData();
|
|
|
- ruleModelParamData.setId(worker.nextId());
|
|
|
- ruleModelParamData.setRuleId(finalRuleId);
|
|
|
- ruleModelParamData.setModelId(modelId);
|
|
|
- ruleModelParamData.setParamId(list.getParamId());
|
|
|
- ruleModelParamData.setParamValue(list.getParamValue());
|
|
|
- ruleModelParamData.setCreateBy(userId);
|
|
|
- shipWarningModelMapper.insertRuleModelParam(ruleModelParamData);
|
|
|
+ RuleModelParamData ruleModelParamByRMP = shipWarningModelMapper.getRuleModelParamByRMP(finalRuleId, modelId, list.getParamId());
|
|
|
+ if(ruleModelParamByRMP!=null){
|
|
|
+ ruleModelParamByRMP.setParamValue(list.getParamValue());
|
|
|
+ shipWarningModelMapper.insertRuleModelParam(ruleModelParamByRMP);
|
|
|
+ }else {
|
|
|
+ RuleModelParamData ruleModelParamData = new RuleModelParamData();
|
|
|
+ ruleModelParamData.setId(worker.nextId());
|
|
|
+ ruleModelParamData.setRuleId(finalRuleId);
|
|
|
+ ruleModelParamData.setModelId(modelId);
|
|
|
+ ruleModelParamData.setParamId(list.getParamId());
|
|
|
+ ruleModelParamData.setParamValue(list.getParamValue());
|
|
|
+ ruleModelParamData.setCreateBy(userId);
|
|
|
+ shipWarningModelMapper.insertRuleModelParam(ruleModelParamData);
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
|
|
|
String[] splits = warningRuleReq.getAreaList().split(",");
|