|
@@ -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";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|