소스 검색

接受会诊时收对应的费用和修改会诊级别

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

+ 4 - 0
src/main/java/thyyxxk/webserver/dao/his/casefrontsheet/JieShouHuiZhenDao.java

@@ -32,6 +32,10 @@ public interface JieShouHuiZhenDao {
     Page<JieShouHuiZhenPojo> getHuiZhenData(Page<JieShouHuiZhenPojo> page,
                                             @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
 
+
+    @Select("SELECT order_code FROM zd_emp_title where code = #{code} ")
+    String getOrderCodeByEmpTit(String code);
+
     @Select("select a.inpatient_no, " +
             "       b.admiss_date, " +
             "       rtrim(name)                                                                                          name, " +

+ 24 - 19
src/main/java/thyyxxk/webserver/service/casefrontsheet/JieShouHuiZhenService.java

@@ -36,6 +36,10 @@ public class JieShouHuiZhenService {
     private final PublicServer publicServer;
     private final RedisLikeService redisLikeService;
 
+    public static final String 主任编码 = "01425";
+    public static final String 副主任编码 = "01426";
+    public static final String 主治编码 = "01427";
+
     @Autowired
     public JieShouHuiZhenService(JieShouHuiZhenDao dao, PublicServer publicServer, RedisLikeService redisLikeService) {
         this.dao = dao;
@@ -99,36 +103,37 @@ public class JieShouHuiZhenService {
             }
             param.setHzDoctor2(TokenUtil.getTokenUserId());
             UserInfo userInfo = redisLikeService.getUserInfoByToken();
-
-            param.setHzType(getHzTypeByTitCode(userInfo.getEmpTitCode()));
+            if (StringUtil.isBlank(userInfo.getEmpTitCode())) {
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您还没有职称,请医务部或者人资维护。");
+            }
+            String orderCode = dao.getOrderCodeByEmpTit(userInfo.getEmpTitCode());
+            if (StringUtil.isBlank(orderCode)) {
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您的职称不支持,您接受会诊。");
+            }
+            param.setHzType(getHzTypeByOrderCode(orderCode));
             JieShouHuiZhenPojo reqData = dao.getHuanZheXinXi(param.getAdmissTimes(), param.getReqTimes(), param.getInpatientNo());
-
             dao.wanChenHuiZhen(param);
-            dao.updateOrderConsultationCode(HuiZhenShenQingService.getOrderCode(userInfo.getEmpTitCode()), reqData.getActOrderNo());
+            dao.updateOrderConsultationCode(orderCode, reqData.getActOrderNo());
             log.info("完成会诊 ==》 操作人:{},数据:{}", TokenUtil.getTokenUserId(), param);
             return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, param.getStatusFlag() == 1 ? "保存成功" : "完成会诊");
         }
         return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER);
     }
 
-    private String getHzTypeByTitCode(String code) {
-        if (StringUtil.isBlank(code)) {
-            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "您没有对应的职称,请医务部维护");
-        }
-        List<String> titCodeList = Arrays.asList("001", "002", "003");
-        if (!titCodeList.contains(code)) {
-            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "您的职称不符合会诊条件,只有【主任医师】,【副主任医师】,【主治医师】,才能会诊。");
-        }
-        if ("001".equals(code)) {
-            return "3";
-        } else if ("003".equals(code)) {
-            return "1";
-        } else {
-            return "2";
+
+    private String getHzTypeByOrderCode(String code) {
+        switch (code) {
+            case 主任编码:
+                return "3";
+            case 副主任编码:
+                return "2";
+            case 主治编码:
+                return "1";
+            default:
+                return "0";
         }
     }
 
-
 }