浏览代码

返回用户头像

xiaochan 3 年之前
父节点
当前提交
1a8be290fd

+ 1 - 1
src/main/java/thyyxxk/webserver/dao/his/LoginDao.java

@@ -63,7 +63,7 @@ public interface LoginDao {
     List<MenuItem> selectMenusByRoles(@Param("roles") List<Integer> roles);
 
     @Select("<script>" +
-            "select * from t_intergration_platform_menu where id in " +
+            "select *,path as completeRoute from t_intergration_platform_menu where id in " +
             "(select menu_id from t_intergration_platform_role_menu where role_id in " +
             "<foreach collection='roles' item='role' separator=',' open='(' close='))'>" +
             "#{role}" +

+ 37 - 32
src/main/java/thyyxxk/webserver/entity/login/VueMenu.java

@@ -1,52 +1,57 @@
 package thyyxxk.webserver.entity.login;
 
-import java.io.Serializable;
-import java.util.List;
-
 import com.alibaba.fastjson.JSONObject;
 import lombok.Data;
 
+import java.io.Serializable;
+import java.util.List;
+
 @Data
 public class VueMenu implements Serializable {
 
-	private static final long serialVersionUID =  3627463231401203121L;
+    private static final long serialVersionUID = 3627463231401203121L;
+
+    /**
+     * id
+     */
+    private Integer id;
 
-	/**
-	 * id
-	 */
-	private Integer id;
+    /**
+     * 路径
+     */
+    private String path;
 
-	/**
-	 * 路径
-	 */
-	private String path;
+    /**
+     * 完整路径
+     */
+    private String completeRoute;
 
-	/**
-	 * 标题
-	 */
-	private String metaTitle;
+    /**
+     * 标题
+     */
+    private String metaTitle;
 
-	/**
-	 * 图标
-	 */
-	private String metaIcon;
+    /**
+     * 图标
+     */
+    private String metaIcon;
 
-	/**
-	 * 父id
-	 */
-	private Integer parent;
+    /**
+     * 父id
+     */
+    private Integer parent;
 
-	private Boolean hideTabs;
+    private Boolean hideTabs;
 
-	private Boolean hideMenu;
+    private Boolean hideMenu;
 
-	/**
-	 * 重定向至
-	 */
-	private String redirect;
+    /**
+     * 重定向至
+     */
+    private String redirect;
 
-	private JSONObject meta;
+    private JSONObject meta;
 
-	private List<VueMenu> children;
+    private List<VueMenu> children;
 
 }

+ 10 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/XinZhenYzActOrder.java

@@ -223,6 +223,16 @@ public class XinZhenYzActOrder {
      */
     private BigDecimal stockAmount;
 
+    /**
+     * >0 这个患者的科室就不能这个药品
+     */
+    private Integer deptRestrictions;
+
+    /**
+     * 1= 禁止药房使用
+     */
+    private Integer visibleFlagZy;
+
 
     /*
      * 如果这个药是抗菌药物的话 就需要在 yz_act_record_kss中插入

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

@@ -1,5 +1,6 @@
 package thyyxxk.webserver.service;
 
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -10,6 +11,7 @@ import thyyxxk.webserver.entity.dictionary.CodeName;
 import thyyxxk.webserver.entity.login.UserInfo;
 import thyyxxk.webserver.entity.login.VueMenu;
 import thyyxxk.webserver.entity.settings.permissions.MenuItem;
+import thyyxxk.webserver.service.externalhttp.CorpWxSrvc;
 import thyyxxk.webserver.service.redislike.RedisLikeService;
 import thyyxxk.webserver.utils.*;
 
@@ -24,12 +26,14 @@ public class LoginService {
     private final LoginDao dao;
     private final TokenService tokenService;
     private final RedisLikeService redisLikeService;
+    private final CorpWxSrvc srvc;
 
     @Autowired
-    public LoginService(LoginDao dao, TokenService tokenService, RedisLikeService redisLikeService) {
+    public LoginService(LoginDao dao, TokenService tokenService, RedisLikeService redisLikeService, CorpWxSrvc srvc) {
         this.dao = dao;
         this.tokenService = tokenService;
         this.redisLikeService = redisLikeService;
+        this.srvc = srvc;
     }
 
     public ResultVo<UserInfo> login(UserInfo userInfo) {
@@ -46,6 +50,12 @@ public class LoginService {
             return ResultVoUtil.fail(ExceptionEnum.INVALID_PASSWORD);
         }
         String token = tokenService.getToken(tempUserInfo);
+        try {
+            JSONObject json = srvc.getUserinfo(TokenUtil.getWeComAddressBookToken(), tempUserInfo.getCodeRs());
+            tempUserInfo.setAvatar(json.getString("avatar"));
+        } catch (Exception ignored) {
+        }
+
         tempUserInfo.setToken(token);
         tempUserInfo.setSid(makeSid(tempUserInfo.getCode(), token, userInfo.getSid()));
         tempUserInfo.setRoles(dao.getUserRoles(tempUserInfo.getCode()));

+ 9 - 3
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -374,8 +374,6 @@ public class YiZhuLuRuServer {
             }
             doctorSOrderMap.put(item.getId(), item);
         }
-
-
         // 医嘱 map {医嘱号: { 具体数据 }}
         // 获取患者信息
         XinZhenYiZhu huanZheXinXi = dao.huoQuHuanZheXinXi(param.getInpatientNo(), param.getAdmissTimes());
@@ -388,8 +386,10 @@ public class YiZhuLuRuServer {
         boolean isThereAnyErrorMessage = false;
         Map<String, Object> map = new HashMap<>();
         String sid = WebSocketServer.getSid();
+        Map<String, XinZhenYzActOrder> drug = getDrugInformation(yaoPingCode, huanZheXinXi.getSmallDept());
+        Map<String, List<XinZhenYzActOrder>> project = getProjectInformation(xiangMuCode);
         for (XinZhenYzActOrder item : param.getList()) {
-            Map<String, Object> 错误信息 = checkData(item, getDrugInformation(yaoPingCode, huanZheXinXi.getSmallDept()), getProjectInformation(xiangMuCode), huanZheXinXi, 医生级别);
+            Map<String, Object> 错误信息 = checkData(item, drug, project, huanZheXinXi, 医生级别);
             if (!错误信息.isEmpty()) {
                 if (!isThereAnyErrorMessage && 错误信息.containsKey("error")) {
                     isThereAnyErrorMessage = true;
@@ -580,6 +580,12 @@ public class YiZhuLuRuServer {
                     警告信息.add(String.format("该药品剩余数量为:【%s】", feiYongXinXi.getStockAmount().stripTrailingZeros().toPlainString()));
                 }
                 if (严格校验) {
+                    if (feiYongXinXi.getDeptRestrictions() > 0) {
+                        错误信息.add("该药品禁止在患者所在的科室使用。");
+                    }
+                    if (feiYongXinXi.getVisibleFlagZy() == 1) {
+                        错误信息.add("该药品禁止住院患者使用。");
+                    }
                     item.setKjywFlag(feiYongXinXi.getKjywFlag());
                     if (feiYongXinXi.getKjywFlag() == 1) {
                         if (item.getYyfs() == null) {

+ 4 - 0
src/main/java/thyyxxk/webserver/utils/TreeUtil.java

@@ -67,6 +67,10 @@ public class TreeUtil {
         for (VueMenu item : tempList) {
             VueMenu template = treeMap.get(item.getParent());
             if (null != template) {
+                if (StringUtil.notBlank(item.getPath())) {
+                    item.setCompleteRoute(template.getCompleteRoute() + "/" + item.getCompleteRoute());
+                }
+
                 if (null == template.getChildren()) {
                     template.setChildren(new ArrayList<>());
                 }