|
|
@@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.dao.his.casefrontsheet.HuiZhenShenQingDao;
|
|
|
+import thyyxxk.webserver.dao.his.zhuyuanyisheng.YiZhuLuRuDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.casefrontsheet.YshHzRecord;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
@@ -15,6 +16,7 @@ import thyyxxk.webserver.utils.StringUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -31,10 +33,12 @@ import java.util.List;
|
|
|
public class HuiZhenShenQingService {
|
|
|
private final HuiZhenShenQingDao dao;
|
|
|
private final PublicServer publicServer;
|
|
|
+ private final YiZhuLuRuDao yiZhuLuRuDao;
|
|
|
|
|
|
- public HuiZhenShenQingService(HuiZhenShenQingDao dao, PublicServer publicServer) {
|
|
|
+ public HuiZhenShenQingService(HuiZhenShenQingDao dao, PublicServer publicServer, YiZhuLuRuDao yiZhuLuRuDao) {
|
|
|
this.dao = dao;
|
|
|
this.publicServer = publicServer;
|
|
|
+ this.yiZhuLuRuDao = yiZhuLuRuDao;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -63,17 +67,10 @@ public class HuiZhenShenQingService {
|
|
|
public ResultVo<String> submitHuiZhenShenQing(YshHzRecord param) {
|
|
|
log.info("会诊申请====>申请人:{},数据:{}", TokenUtil.getTokenUserId(), JSON.toJSONString(param));
|
|
|
publicServer.huanZheJieSuan(param.getInpatientNo(), param.getAdmissTimes());
|
|
|
- /*
|
|
|
- * 获取一个新的医嘱号
|
|
|
- * 需要一套指令 先把表锁住 在查询出医嘱号 在加一更新加一就完事了
|
|
|
- */
|
|
|
- dao.lockTable();
|
|
|
- float actOrderNo = dao.getActOrderNo() + 1;
|
|
|
- dao.updateActOrderNo(actOrderNo);
|
|
|
//下面是给申请次数 加一
|
|
|
param.setReqTimes(dao.getMaxReqTimes(param.getInpatientNo(), param.getAdmissTimes()) + 1);
|
|
|
param.setInputDate(new Date());
|
|
|
- param.setActOrderNo((int) actOrderNo);
|
|
|
+ param.setActOrderNo(BigDecimal.valueOf(publicServer.getActOrderNo()));
|
|
|
param.setInputId(TokenUtil.getTokenUserId());
|
|
|
param.setReqDate(param.getInputDate());
|
|
|
param.setOrderCode(getOrderCode("00" + param.getHzType()));
|
|
|
@@ -83,9 +80,14 @@ public class HuiZhenShenQingService {
|
|
|
//申请成功了就还需要插入一条医嘱
|
|
|
dao.chaRuYiZhu(param);
|
|
|
log.info("插入数据:{}", JSON.toJSONString(param));
|
|
|
+ List<String> content = new ArrayList<>();
|
|
|
+ content.add(String.format("会诊名:【%s】<br>" +
|
|
|
+ "会诊级别:【%s】", param.getOrderName(), param.getHzTypeName()));
|
|
|
+ publicServer.faSongXiaoXi(yiZhuLuRuDao.huoQuHuanZheXinXi(param.getInpatientNo(), param.getAdmissTimes()), content, "新增会诊申请", TokenUtil.getTokenUserId());
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "会诊申请成功,正在通知会诊医生。 <p>(〜^㉨^)〜</p>");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 查询会诊的信息
|
|
|
*
|