浏览代码

删除没用的接口以及解决登录的bug

xiaochan 2 年之前
父节点
当前提交
8589580f07

+ 0 - 4
src/main/java/thyyxxk/webserver/controller/reports/ConsumablesStatisticsController.java

@@ -49,8 +49,4 @@ public class ConsumablesStatisticsController {
         return service.getDropdownBox();
     }
 
-    @PostMapping("/chaKanXiangMuHuoYaoPin")
-    public ResultVo<IPage<QueryDrugsAndProjects>> chaKanXiangMuHuoYaoPin(@RequestBody QueryDrugsAndProjects param) {
-        return service.chaKanXiangMuHuoYaoPin(param);
-    }
 }

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

@@ -56,7 +56,7 @@ public class LoginService {
             tempUserInfo.setAvatar(json.getString("avatar"));
         } catch (Exception ignored) {
         }
-        Set<String> deptList = publicServer.getChildDeptByUserCode();
+        Set<String> deptList = publicServer.getChildDeptByUserCode(tempUserInfo.getCode());
         if (deptList != null && !deptList.isEmpty()) {
             Map<String, String> tempMap = new HashMap<>(deptList.size());
             deptList.forEach(item -> {

+ 15 - 0
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -323,6 +323,15 @@ public class PublicServer {
         return getChildDeptByUserCode(true);
     }
 
+    public Set<String> getChildDeptByUserCode(String userCode) {
+        return getChildDeptByUserCode(true, userCode);
+    }
+
+    public Set<String> getChildDeptByUserCode(boolean needPartTimeDept, String userCode) {
+        UserInfo userInfo = redisLikeService.getUserInfoByCode(userCode);
+        return getDept(needPartTimeDept, userInfo);
+    }
+
     /**
      * 获取医生的子科室 和 兼职科室 以及兼职下面的子科室
      *
@@ -330,6 +339,11 @@ public class PublicServer {
      */
     public Set<String> getChildDeptByUserCode(boolean needPartTimeDept) {
         UserInfo userInfo = redisLikeService.getUserInfoByToken();
+        return getDept(needPartTimeDept, userInfo);
+    }
+
+    @NotNull
+    private Set<String> getDept(boolean needPartTimeDept, UserInfo userInfo) {
         Set<String> list = new HashSet<>();
         if (needPartTimeDept && ListUtil.notBlank(userInfo.getPartTimeDept())) {
             list.addAll(userInfo.getPartTimeDept());
@@ -344,6 +358,7 @@ public class PublicServer {
         return list;
     }
 
+
     /**
      * 获取科室 列表 下面的子科室
      *

+ 1 - 14
src/main/java/thyyxxk/webserver/service/reports/ConsumablesStatisticsService.java

@@ -82,18 +82,5 @@ public class ConsumablesStatisticsService {
         return ResultVoUtil.success(dao.chargeClassName());
     }
 
-    /**
-     * 查询药品或者项目信息
-     *
-     * @param param 查询字段
-     * @return 返回信息
-     */
-    public ResultVo<IPage<QueryDrugsAndProjects>> chaKanXiangMuHuoYaoPin(QueryDrugsAndProjects param) {
-        if (dao.getXiangMuHuoYaoPin("zd_charge_item", param.getChargeCode()).equals(param.getChargeCode())) {
-            log.info("项目");
-        } else if (dao.getXiangMuHuoYaoPin("yp_zd_dict", param.getChargeCode()).equals(param.getChargeCode())) {
-            log.info("药品");
-        }
-        return ResultVoUtil.success();
-    }
+
 }

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

@@ -1,6 +1,5 @@
 package thyyxxk.webserver.service.zhuyuanyisheng;
 
-import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
@@ -13,7 +12,6 @@ import org.apache.ibatis.session.ExecutorType;
 import org.apache.ibatis.session.SqlSession;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.jetbrains.annotations.NotNull;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import thyyxxk.webserver.config.exception.BizException;
@@ -250,6 +248,7 @@ public class YiZhuLuRuServer {
      */
     public ResultVo<Map<String, Object>> confirmOrders(XinZhenYiZhu param) {
         QueryWrapper<?> qw = new QueryWrapper<>();
+
         qw.eq("a.inpatient_no", param.getInpatientNo())
                 .eq("a.admiss_times", param.getAdmissTimes())
                 .eq("a.status_flag", "1")
@@ -257,7 +256,9 @@ public class YiZhuLuRuServer {
                 // 排除出院带药的医嘱
                 .ne("isnull(a.self_buy,'0')", "4")
                 .orderByAsc("a.act_order_no");
+
         param.setList(dao.selectOrderNo(qw));
+
         List<XinZhenYzActOrder> yiZhuList = param.getList();
         if (ListUtil.isBlank(yiZhuList)) {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有需要确认的医嘱.");
@@ -459,6 +460,17 @@ public class YiZhuLuRuServer {
             dao.howOftenTheSubPhysicianOrderIsModified(param.getData(), selectSupplyCode);
         }
 
+        QueryWrapper<?> qw = getQueryWrapper(param, data);
+
+        Map<String, Object> successMap = new HashMap<>();
+        successMap.put("code", 200);
+        successMap.put("data", getOrderList(dao.selectOrderNo(qw)));
+
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "添加成功。", successMap);
+    }
+
+    @NotNull
+    private static QueryWrapper<?> getQueryWrapper(XinZhenYiZhu param, XinZhenYzActOrder data) {
         QueryWrapper<?> qw = new QueryWrapper<>();
 
         qw.eq("a.inpatient_no", param.getInpatientNo());
@@ -477,19 +489,14 @@ public class YiZhuLuRuServer {
         }
 
         qw.orderByAsc("a.act_order_no");
-
-        Map<String, Object> successMap = new HashMap<>();
-        successMap.put("code", 200);
-        successMap.put("data", getOrderList(dao.selectOrderNo(qw)));
-
-        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "添加成功。", successMap);
+        return qw;
     }
 
     /**
      * 把医嘱模板中的数据插入到 患者的医嘱表中
      *
      * @param param 参数
-     * @return
+     * @return 返回插入的医嘱
      */
     public ResultVo<JSONObject> insertTemplateOrder(XinZhenYiZhu param) {
         if (StringUtil.isBlank(param.getInpatientNo())) {