DESKTOP-0GD05B0\Administrator 2 년 전
부모
커밋
b16c2c4cd1

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/login/UserInfo.java

@@ -8,6 +8,7 @@ import thyyxxk.webserver.constants.Ysjb;
 import thyyxxk.webserver.utils.StringUtil;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author dj
@@ -137,6 +138,7 @@ public class UserInfo {
     private List<String> partTimeDept;
     private String partTimeDeptCode;
     private String partTimeDeptName;
+    private Map<String, String> partTimeDeptMap;
 
     public String getDoctorXzYpName() {
         return RestrictedDrugLevels.getName(doctorXzYp);

+ 8 - 1
src/main/java/thyyxxk/webserver/service/LoginService.java

@@ -56,7 +56,14 @@ public class LoginService {
             tempUserInfo.setAvatar(json.getString("avatar"));
         } catch (Exception ignored) {
         }
-
+        Set<String> deptList = publicServer.getChildDeptByUserCode();
+        if (deptList != null && !deptList.isEmpty()) {
+            Map<String, String> tempMap = new HashMap<>(deptList.size());
+            deptList.forEach(item -> {
+                tempMap.put(item, redisLikeService.getDeptName(item));
+            });
+            tempUserInfo.setPartTimeDeptMap(tempMap);
+        }
         tempUserInfo.setToken(token);
         tempUserInfo.setSid(makeSid(tempUserInfo.getCode(), token, userInfo.getSid()));
         tempUserInfo.setRoles(dao.getUserRoles(tempUserInfo.getCode()));

+ 1 - 2
src/main/java/thyyxxk/webserver/service/inpatient/XiangMuLuRuService.java

@@ -130,8 +130,7 @@ public class XiangMuLuRuService {
         }
         // 因为这里是护士也要看的所以护士可以看患者所以科室的费用
         if (StringUtil.notBlank(v.getDept())) {
-            Set<String> deptList = publicServer.getChildDeptByUserCode();
-            qw.in("exec_unit", deptList);
+            qw.in("exec_unit", v.getDept());
         }
         int order = Integer.parseInt(v.getOrderNo().stripTrailingZeros().toPlainString());
         if (order != 2 && order != 1) {