Browse Source

科室信息不存在推全科模板

Zhaops 6 years ago
parent
commit
e7ed00ee35

+ 9 - 3
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -14,7 +14,6 @@ import com.diagbot.dto.QuestionDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DeptVital;
 import com.diagbot.entity.QuestionInfo;
-import com.diagbot.entity.VitalOrder;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LisSourceEnum;
 import com.diagbot.enums.QuantitativeTypeEnum;
@@ -408,7 +407,14 @@ public class PushFacade {
                 eq("name", deptName);
         DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQueryWrapper);
         if (deptInfo == null) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "科室信息不存在");
+            //科室信息不存在时推全科模板
+            deptName = "全科";
+            deptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                    eq("name", deptName);
+            deptInfo = deptInfoFacade.getOne(deptInfoQueryWrapper);
+            if (deptInfo == null) {
+                throw new CommonException(CommonErrorCode.NOT_EXISTS, "全科信息未维护");
+            }
         }
 
         QueryWrapper<DeptVital> deptVitalQueryWrapper = new QueryWrapper<>();
@@ -417,7 +423,7 @@ public class PushFacade {
                 orderByAsc("order_no");
         List<DeptVital> deptVitalList = deptVitalFacade.list(deptVitalQueryWrapper);
         //标签列表
-        for (DeptVital deptVital:deptVitalList) {
+        for (DeptVital deptVital : deptVitalList) {
             QuestionVO questionVO = new QuestionVO();
             questionVO.setAge(pushVO.getAge());
             questionVO.setSexType(pushVO.getSex());

+ 5 - 5
icss-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -46,13 +46,13 @@ public class TreatmentFacade {
      * @param
      * @return
      */
-    public Map<String,Object> getTreatment(Map<String,String> treatmentMap,Long diseaseId) {
+    public Map<String, Object> getTreatment(Map<String, String> treatmentMap, Long diseaseId) {
         Map<String, Object> retMap = new LinkedHashMap<>();
-        QuestionInfo disease=questionFacade.getById(diseaseId);
-        if(disease==null) {
+        QuestionInfo disease = questionFacade.getById(diseaseId);
+        if (disease == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "诊断不存在");
         }
-        if(!treatmentMap.containsKey(disease.getTagName())){
+        if (!treatmentMap.containsKey(disease.getTagName())) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "诊断名称和id不匹配");
         }
 
@@ -65,7 +65,7 @@ public class TreatmentFacade {
         retMap.put("surgeryTreatment", surgeryTreatmentDetailList.size() > 0 ? surgeryTreatmentDetailList.get(0).getContent() : "");
 
         //获取知识图谱治疗方案
-        String treatment=treatmentMap.get(disease.getTagName());
+        String treatment = treatmentMap.get(disease.getTagName());
         if (StringUtil.isBlank(treatment)) {
             return retMap;
         }