lenovodn преди 2 години
родител
ревизия
79b04218e1

+ 33 - 91
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/FactorEnchanceController.java

@@ -37,6 +37,7 @@ import lombok.extern.slf4j.Slf4j;
 
 import org.jeecg.modules.medical.vo.CommonResponse;
 import org.jeecg.modules.message.websocket.WebSocket;
+import org.jeecg.modules.system.service.ISysDictService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -74,6 +75,7 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
     private final IMedicalInsRuleInfoService medicalInsRuleInfoService;
     private final IRuleFactorRelaService ruleFactorRelaService;
     private final IEventAttrService eventAttrService;
+    private final ISysDictService dictService;
 
 
     /**
@@ -247,7 +249,7 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
             factorEnchance.setFactorCatalogStr(first.get().getRuleName());
         }
         factorEnchance.setFactorCatalogId(factorEnchance.getFactorCatalog());
-        if (factorEnchance.getEnhanceType() == 1 || factorEnchance.getEnhanceType() == 4|| factorEnchance.getEnhanceType() == 7) {
+        if (factorEnchance.getEnhanceType() == 1 || factorEnchance.getEnhanceType() == 4 || factorEnchance.getEnhanceType() == 7) {
             List<FactorAttrRela> inList = factorAttrRelaService.lambdaQuery().eq(FactorAttrRela::getIoType, Constant.INPUT).eq(FactorAttrRela::getFactorEnhanceId, factorEnchance.getId()).list();
             if (inList.size() > 0) {
                 inList.sort(Comparator.comparing(FactorAttrRela::getSeqNum));
@@ -270,7 +272,7 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
 
     @ApiOperation(value = "factor_enchance-通过id查询", notes = "factor_enchance-通过id查询")
     @GetMapping(value = "/queryDynamicDataById")
-    public Result<?> queryDynamicDataById(@RequestParam(name = "id", required = true) String id) {
+    public Result<?> queryDynamicDataById(@RequestParam(name = "id", required = false) String id) {
         RuleFactorRela ruleFactorRela = ruleFactorRelaService.getById(id);
         if (ruleFactorRela == null) {
             return Result.error("未找到对应数据");
@@ -288,7 +290,7 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
             factorEnchance.setFactorCatalogStr(first.get().getRuleName());
         }
         factorEnchance.setFactorCatalogId(factorEnchance.getFactorCatalog());
-        if (factorEnchance.getEnhanceType() == 1 || factorEnchance.getEnhanceType() == 4|| factorEnchance.getEnhanceType() == 7) {
+        if (factorEnchance.getEnhanceType() == 1 || factorEnchance.getEnhanceType() == 4 || factorEnchance.getEnhanceType() == 7) {
             List<FactorAttrRela> inList = factorAttrRelaService.lambdaQuery().eq(FactorAttrRela::getIoType, Constant.INPUT).eq(FactorAttrRela::getFactorEnhanceId, factorEnchance.getId()).list();
             if (inList.size() > 0) {
                 inList.sort(Comparator.comparing(FactorAttrRela::getSeqNum));
@@ -338,52 +340,6 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 }
             }
         }
-//        if (dictDtos.size() > 0) {
-//            dictDtos.forEach(it -> {
-//                switch (it.getValue()) {
-//                    case "medicineDataType":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("medicine_data_type");
-//                        break;
-//                    case "changeClass":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("change_class");
-//                        break;
-//                    case "categoriesItems":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("categories_items");
-//                        break;
-//                    case "medicalInsLevel":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("medical_ins_level");
-//                        break;
-//                    case "doctorLevel":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("doctor_level");
-//                        break;
-//                    case "state":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("state");
-//                        break;
-//                    case "medicalDiagnoseCode":
-//                        it.setComponent("a-textarea");
-//                        break;
-//                    case "correlationMedicalDiagnoseCode":
-//                        it.setComponent("a-textarea");
-//                        break;
-//                    case "gender":
-//                        it.setComponent("j-dict-select-tag");
-//                        it.setDictCode("sex");
-//                        break;
-//                    default:
-//                        it.setComponent("a-input");
-//                        break;
-//                }
-//            });
-//
-//        }
-
-//        LinkedHashMap<String, Object> map = new LinkedHashMap<>();
         String title = "";
         List<MedicalEnchanceDto> dtoList = new ArrayList<>();
         switch (enchanceTypeEnum) {
@@ -426,7 +382,6 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 title = "SQL取值";
                 break;
             case LOGICAL_EXPRESSION:
-
                 MedicalEnchanceDto logical1 = new MedicalEnchanceDto();
                 logical1.setText("要素提取标题");
                 logical1.setValue(factorEnchance.getRuleEnchanceName());
@@ -437,45 +392,51 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 logical2.setValue(factorEnchance.getFactorCatalogStr());
                 logical2.setComponent("a-input");
                 dtoList.add(logical2);
-
                 MedicalEnchanceDto logical3 = new MedicalEnchanceDto();
                 logical3.setText("判断类型");
                 logical3.setValue(factorEnchance.getExtAttr1());
                 logical3.setComponent("a-input");
                 dtoList.add(logical3);
-
                 MedicalEnchanceDto logical4 = new MedicalEnchanceDto();
-                //                logical4.setComponent("a-input");
-//                map.put("要素提取标题", factorEnchance.getRuleEnchanceName());
-//                map.put("医保规则", factorEnchance.getFactorCatalogStr());
-//                map.put("判断类型", factorEnchance.getExtAttr1());
+                List<String> str = new ArrayList<>();
                 if (factorEnchance.getExtAttr3().equals("0")) {
                     logical4.setText("逻辑表达式");
-                    logical4.setValue(factorEnchance.getFactorCondRelaList());
-//                    factorEnchance.getFactorCondRelaList().forEach(it -> {
-//                        map.put("逻辑表达式", it.getExtAttr1());
-//                        map.put("比较符", it.getOperator());
-//                        map.put("引用属性类型", it.getRefAttrType());
-//                        if (it.getRefAttrType() == 1) {
-//                            map.put("扩展属性", it.getExtAttr1());
-//                        } else {
-//                            map.put("引用属性标识", it.getRefEventAttrId());
-//                        }
-//                    });
+                    factorEnchance.getFactorCondRelaList().forEach(it -> {
+                        EventAttr one = eventAttrService.lambdaQuery().eq(EventAttr::getId, it.getEventAttrId()).one();
+                        String string = "";
+                        String type = "";
+                        String text = "";
+                        String operator = "";
+                        if (one != null) {
+                            operator = dictService.queryDictTextByKey("operator", it.getOperator().toString());
+                            if (it.getRefAttrType() == 1) {
+                                type = "扩展属性:";
+                                text = it.getExtAttr1();
+                            } else {
+                                type = "引用属性标识:";
+                                EventAttr two = eventAttrService.lambdaQuery().eq(EventAttr::getId, it.getRefEventAttrId()).one();
+                                text = two.getChName();
+                            }
+                        }
+                        String concat = string.concat("逻辑表达式:").concat(one.getChName()+";").concat("比较符:")
+                                .concat(operator+";").concat("引用属性类型:").concat(type).concat(text);
+                        str.add(concat);
+                    });
+                    logical4.setValue(str);
                 } else {
-                    logical4.setText("判断表达式字符串");
-                    logical4.setValue(factorEnchance.getEnhanceValue());
+                    logical4.setText("判断表达式字符串:");
+                    String string = factorEnchance.getEnhanceValue();
+
+                    str.add(string);
+                    logical4.setValue(str);
                 }
                 dtoList.add(logical4);
-
                 MedicalEnchanceDto logical5 = new MedicalEnchanceDto();
                 logical5.setText("输出要素");
                 logical5.setValue(factorEnchance.getOutParamNameList());
                 logical5.setComponent("a-select");
                 dtoList.add(logical5);
-//                map.put("输出要素", factorEnchance.getOutParamList());
                 title = "逻辑判断";
-
                 break;
             case PLUGIN:
                 MedicalEnchanceDto plugin1 = new MedicalEnchanceDto();
@@ -488,22 +449,16 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 plugin2.setValue(factorEnchance.getFactorCatalogStr());
                 plugin2.setComponent("a-input");
                 dtoList.add(plugin2);
-//                map.put("插件名称", factorEnchance.getRuleEnchanceName());
-//                map.put("医保规则", factorEnchance.getFactorCatalogStr());
                 MedicalEnchanceDto plugin3 = new MedicalEnchanceDto();
                 plugin3.setText("描述");
                 plugin3.setValue(factorEnchance.getRemarks());
                 plugin3.setComponent("a-input");
                 dtoList.add(plugin3);
-//                map.put("描述", factorEnchance.getRemarks());
                 MedicalEnchanceDto plugin4 = new MedicalEnchanceDto();
                 plugin4.setText("插件Bean名称");
                 plugin4.setValue(factorEnchance.getEnhanceValue());
                 plugin4.setComponent("a-input");
                 dtoList.add(plugin4);
-//                map.put("插件Bean名称", factorEnchance.getEnhanceValue());
-//                map.put("输入要素", factorEnchance.getInParamList());
-//                map.put("输出要素", factorEnchance.getOutParamList());
                 MedicalEnchanceDto plugin5 = new MedicalEnchanceDto();
                 plugin5.setText("输入要素");
                 plugin5.setValue(factorEnchance.getInParamNameList());
@@ -515,7 +470,6 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 plugin6.setComponent("a-select");
                 dtoList.add(plugin6);
                 title = "插件提取";
-
                 break;
             case CONSTANT:
                 MedicalEnchanceDto constant1 = new MedicalEnchanceDto();
@@ -528,22 +482,17 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 constant2.setValue(factorEnchance.getFactorCatalogStr());
                 constant2.setComponent("a-input");
                 dtoList.add(constant2);
-//                map.put("要素提取标题", factorEnchance.getRuleEnchanceName());
-//                map.put("医保规则", factorEnchance.getFactorCatalogStr());
-//                map.put("常量值", factorEnchance.getExtAttr1());
                 MedicalEnchanceDto constant3 = new MedicalEnchanceDto();
                 constant3.setText("常量值");
                 constant3.setValue(factorEnchance.getExtAttr1());
                 constant3.setComponent("a-input");
                 dtoList.add(constant3);
-//                map.put("输出要素", factorEnchance.getOutParamList());
                 MedicalEnchanceDto constant4 = new MedicalEnchanceDto();
                 constant4.setText("输出要素");
                 constant4.setValue(factorEnchance.getOutParamNameList());
                 constant4.setComponent("a-select");
                 dtoList.add(constant4);
                 title = "常量赋值";
-
                 break;
             case PROPERTIES:
                 MedicalEnchanceDto prop1 = new MedicalEnchanceDto();
@@ -556,10 +505,6 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 prop2.setValue(factorEnchance.getFactorCatalogStr());
                 prop2.setComponent("a-input");
                 dtoList.add(prop2);
-//                map.put("要素提取标题", factorEnchance.getRuleEnchanceName());
-//                map.put("医保规则", factorEnchance.getFactorCatalogStr());
-//                map.put("输入要素", factorEnchance.getInParamList());
-//                map.put("输出要素", factorEnchance.getOutParamList());
                 MedicalEnchanceDto prop3 = new MedicalEnchanceDto();
                 prop3.setText("输入要素");
                 prop3.setValue(factorEnchance.getInParamNameList());
@@ -571,14 +516,11 @@ public class FactorEnchanceController extends JeecgController<FactorEnchance, IF
                 prop4.setComponent("a-select");
                 dtoList.add(prop4);
                 title = "属性赋值";
-
                 break;
             default:
                 log.error("有配置的未处理类型");
                 break;
         }
-
-
         if (factorEnchance == null) {
             return Result.error("未找到对应数据");
         }

+ 63 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/medical/controller/MedicalInsRuleInfoController.java

@@ -82,6 +82,7 @@ public class MedicalInsRuleInfoController extends JeecgController<MedicalInsRule
     private final ISysDictService sysDictService;
     private final IMedicalInsRuleProjectService projectService;
     private final IFactorEnchanceService enchanceService;
+    private final ISysDictService dictService;
 
     public final RedisTemplate redisTemplate;
 
@@ -419,6 +420,68 @@ public class MedicalInsRuleInfoController extends JeecgController<MedicalInsRule
         }
         return Result.OK(medicalInsRuleInfo);
     }
+    @ApiOperation(value = "medical_ins_rule_info-通过id查询", notes = "medical_ins_rule_info-通过id查询")
+    @GetMapping(value = "/dynamicDataById")
+    public Result<?> dynamicDataById(@RequestParam(name = "id", required = true) String id) {
+        MedicalInsRuleInfo medicalInsRuleInfo = medicalInsRuleInfoService.getById(id);
+        if (medicalInsRuleInfo == null) {
+            return Result.error("未找到对应数据");
+        }
+        String title = "规则配置";
+        List<MedicalEnchanceDto> dtoList = new ArrayList<>();
+        MedicalEnchanceDto dto1 = new MedicalEnchanceDto();
+        dto1.setText("规则名称");
+        dto1.setValue(medicalInsRuleInfo.getRuleName());
+        dto1.setComponent("a-input");
+        dtoList.add(dto1);
+        MedicalEnchanceDto dto2 = new MedicalEnchanceDto();
+        dto2.setText("规则描述");
+        dto2.setValue(medicalInsRuleInfo.getDescription());
+        dto2.setComponent("a-input");
+        dtoList.add(dto2);
+        MedicalEnchanceDto dto3 = new MedicalEnchanceDto();
+        dto3.setText("违规等级");
+        String violationLevel = dictService.queryDictTextByKey("operator", medicalInsRuleInfo.getViolationLevel().toString());
+        dto3.setValue(violationLevel);
+        dto3.setComponent("a-input");
+        dtoList.add(dto3);
+        MedicalEnchanceDto dto4 = new MedicalEnchanceDto();
+        dto4.setText("规则调用场景");
+        String callScenario = dictService.queryDictTextByKey("call_scenario", medicalInsRuleInfo.getCallScenario().toString());
+        dto4.setValue(callScenario);
+        dto4.setComponent("a-input");
+        dtoList.add(dto4);
+        MedicalEnchanceDto dto5 = new MedicalEnchanceDto();
+        dto5.setText("就诊类型");
+        String treatmentType = dictService.queryDictTextByKey("consultation_type", medicalInsRuleInfo.getTreatmentType().toString());
+        dto5.setValue(treatmentType);
+        dto5.setComponent("a-input");
+        dtoList.add(dto5);
+        MedicalEnchanceDto dto6 = new MedicalEnchanceDto();
+        dto6.setText("是否启用");
+        dto6.setValue(medicalInsRuleInfo.getState().equals("00A")?"启用":"停用");
+        dto6.setComponent("a-input");
+        dtoList.add(dto6);
+        MedicalEnchanceDto dto7 = new MedicalEnchanceDto();
+        dto7.setText("数据来源");
+        dto7.setValue(medicalInsRuleInfo.getDataSource());
+        dto7.setComponent("a-input");
+        dtoList.add(dto7);
+        MedicalEnchanceDto dto8 = new MedicalEnchanceDto();
+        dto8.setText("规则逻辑");
+        dto8.setValue(medicalInsRuleInfo.getRegularLogic());
+        dto8.setComponent("a-input");
+        dtoList.add(dto8);
+        MedicalEnchanceDto dto9 = new MedicalEnchanceDto();
+        dto9.setText("规则逻辑");
+        dto9.setValue(medicalInsRuleInfo.getExpressions());
+        dto9.setComponent("a-input");
+        dtoList.add(dto9);
+        HashMap<String, Object> hashMap = new HashMap<>();
+        hashMap.put("title", title);
+        hashMap.put("data", dtoList);
+        return Result.OK(hashMap);
+    }
 
     /**
      * 导出excel