From 214b0462236390399ea184b3c4a3993fc0daf504 Mon Sep 17 00:00:00 2001
From: fhx <308050795@qq.com>
Date: 星期五, 08 十二月 2023 10:10:07 +0800
Subject: [PATCH] Merge branch 'master-prod-new' into fhx-prod-分配治疗修改

---
 phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatCardController.java |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatCardController.java b/phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatCardController.java
index e52edb8..542643a 100644
--- a/phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatCardController.java
+++ b/phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatCardController.java
@@ -6,6 +6,7 @@
 import com.hx.phiappt.common.RoleType;
 import com.hx.phiappt.dao.mapper.TreatSingleMapper;
 import com.hx.phiappt.model.BaseEntity;
+import com.hx.phiappt.model.intro.IntroData;
 import com.hx.phiappt.model.intro.IntroExpert;
 import com.hx.phiappt.model.intro.IntroProjectManual;
 import com.hx.phiappt.model.treat.TreatCardNotice;
@@ -21,6 +22,7 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -101,13 +103,13 @@
         //鏌ヨ娌荤枟閫氱煡鍗曢」鐩俊鎭拰浠嬬粛
         sql.setLength(0);
         values.put("type", IntroProjectManual.TYPE_TREAT_CARD);
-        sql.append(" select tp.num, tp.projectId, ts.isKnow ")
-                .append(" , p.name, p.unit, p.specification as spec, p.projectGeneralId ")
-                .append("  , pi.doctorQualification, pi.bodyPartName as bodyPartsName ")
+        sql.append(" select tp.num, tp.projectId, ts.isKnow, tp.projectName, tp.projectName as name, p.projectGeneralId ")
+//                .append(" , p.unit, p.specification as spec ")
+//                .append("  , pi.doctorQualification, pi.bodyPartName as bodyPartsName ")
                 .append(" from treat_single ts  ")
                 .append(" left join treat_project tp on tp.treatSingleId = ts.id and tp.isDel = 0 ")
                 .append(" left join project p on p.id = tp.projectId ")
-                .append(" left join project_info pi on pi.projectId = p.id ")
+//                .append(" left join project_info pi on pi.projectId = p.id ")
                 .append(" where ts.isDel = 0  ");
         //鍒ゆ柇鏄崟鐙煡鏌愪釜娌荤枟閫氱煡鍗曡繕鏄叏閮�
         if (StringUtils.noNull(treatSingleId)) {
@@ -119,7 +121,7 @@
         sqlSentence.setSqlSentence(sql.toString());
         List<Map<String, Object>> projectList = commonService.selectListMap(TreatSingleMapper.class, sqlSentence);
 
-
+        StringBuffer pName = new StringBuffer();
         Integer isKnowNum = BaseEntity.NO;
         //閬嶅巻鏌ヨ椤圭洰瀵瑰簲浠嬬粛鎵嬪唽
         if (projectList != null) {
@@ -145,6 +147,7 @@
 
             Map<String, Object> map;
             for (Map<String, Object> m : projectList) {
+                pName.append(m.get("name")).append("銆�");
                 //鍒ゆ柇绱姞鏄惁鐢ㄦ埛宸茬煡鎮夋暟閲�
                 if(m.containsKey("isKnow") && m.get("isKnow") != null
                         && Integer.parseInt(m.get("isKnow").toString()) == BaseEntity.NO){
@@ -171,6 +174,18 @@
 
             //杩囨护鑾峰彇content涓嶄负绌虹殑
             projectList = projectList.stream().filter(s -> s.containsKey("content")).collect(Collectors.toList());
+            pName.delete(pName.length() - 1, pName.length());
+        }
+
+        //濡傛灉椤圭洰浠嬬粛閮戒负绌猴紝鍒欓粯璁よ繑鍥炰竴涓搧鐗屼粙缁嶅浘鍘诲睍绀�
+        if(projectList == null || projectList.size() < 1){
+            projectList = new ArrayList<>();
+            Map<String, Object> map = new HashMap<>();
+            map.put("projectName", pName.toString()); //鎵ц椤圭洰鍚�
+            map.put("name", "鍝佺墝");  //灞曠ず浠嬬粛鍚�
+            map.put("showType", IntroData.SHOW_TYPE_FILE);
+            map.put("content", "https://phiskin-crm-1305571091.cos.ap-shanghai.myqcloud.com/template/image/zlkppjs.png");
+            projectList.add(map);
         }
 
 

--
Gitblit v1.8.0