|
@@ -36,12 +36,10 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class MedicalTechnologyIsPaidService {
|
|
|
private final DuiWaiJieKouDao dao;
|
|
|
- private final RedisLikeService redisLikeService;
|
|
|
private final HospitalizationCostsService hospitalizationCostsService;
|
|
|
|
|
|
- public MedicalTechnologyIsPaidService(DuiWaiJieKouDao dao, RedisLikeService redisLikeService, HospitalizationCostsService hospitalizationCostsService) {
|
|
|
+ public MedicalTechnologyIsPaidService(DuiWaiJieKouDao dao, HospitalizationCostsService hospitalizationCostsService) {
|
|
|
this.dao = dao;
|
|
|
- this.redisLikeService = redisLikeService;
|
|
|
this.hospitalizationCostsService = hospitalizationCostsService;
|
|
|
}
|
|
|
|
|
@@ -75,18 +73,12 @@ public class MedicalTechnologyIsPaidService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到原申请。");
|
|
|
}
|
|
|
|
|
|
- UserInfo userInfo;
|
|
|
- try {
|
|
|
- userInfo = redisLikeService.getUserInfoByCode(confirmId);
|
|
|
- } catch (Exception ignore) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
- }
|
|
|
+ UserInfo userInfo = dao.getUserInfo(confirmId);
|
|
|
|
|
|
if (userInfo == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 1 确认 3 取消
|
|
|
Date date = new Date();
|
|
|
|
|
@@ -118,49 +110,19 @@ public class MedicalTechnologyIsPaidService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "护士未执行");
|
|
|
}
|
|
|
|
|
|
- Date date = new Date();
|
|
|
-
|
|
|
- UserInfo userInfo;
|
|
|
- try {
|
|
|
- userInfo = redisLikeService.getUserInfoByCode(confirmId);
|
|
|
- } catch (Exception ignore) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
- }
|
|
|
+ UserInfo userInfo = dao.getUserInfo(confirmId);
|
|
|
|
|
|
if (userInfo == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
}
|
|
|
|
|
|
- // 1 确认 2 取消
|
|
|
- int flag = 1;
|
|
|
-
|
|
|
- int yshFlag = dao.updateYshYjReqFlag(confirmId, reqNo, date, userInfo.getDeptCode(), flag);
|
|
|
-
|
|
|
- if (yshFlag == 0) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "更新失败请联系管理员");
|
|
|
- }
|
|
|
-
|
|
|
- int feeCount = dao.confirmTheIntermediateTable(confirmId,
|
|
|
- yshYjReq.getActOrderNo(),
|
|
|
- date,
|
|
|
- userInfo.getDeptCode(),
|
|
|
- yshYjReq.getInpatientNo(),
|
|
|
- yshYjReq.getAdmissTimes(), flag);
|
|
|
-
|
|
|
- if (feeCount == 0) {
|
|
|
- throw new BizException(ExceptionEnum.INVALID_PARAM, "更新失败请联系管理员");
|
|
|
- }
|
|
|
+ int ZY_CONFIRM = 1;
|
|
|
+ setReqFlag(userInfo, yshYjReq, ZY_CONFIRM);
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS);
|
|
|
}
|
|
|
|
|
|
public ResultVo<String> zyProjectCancel(Integer reqNo, String confirmId) {
|
|
|
- UserInfo userInfo;
|
|
|
- try {
|
|
|
- userInfo = redisLikeService.getUserInfoByCode(confirmId);
|
|
|
- } catch (Exception ignore) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
- }
|
|
|
-
|
|
|
+ UserInfo userInfo = dao.getUserInfo(confirmId);
|
|
|
if (userInfo == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
}
|
|
@@ -171,17 +133,28 @@ public class MedicalTechnologyIsPaidService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查询到申请单");
|
|
|
}
|
|
|
|
|
|
- // 1 确认 2 取消
|
|
|
- int flag = 2;
|
|
|
+ int ZY_CANCEL = 2;
|
|
|
+ setReqFlag(userInfo, yshYjReq, ZY_CANCEL);
|
|
|
+ hospitalizationCostsService.refundsByPatientOrder(yshYjReq.getInpatientNo(), yshYjReq.getAdmissTimes(), yshYjReq.getActOrderNo());
|
|
|
+ return ResultVoUtil.success("操作成功。");
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置申请单状态
|
|
|
+ *
|
|
|
+ * @param userInfo 用户信息
|
|
|
+ * @param yshYjReq 申请单的信息
|
|
|
+ * @param flag 状态
|
|
|
+ */
|
|
|
+ private void setReqFlag(UserInfo userInfo, YshYjReq yshYjReq, int flag) {
|
|
|
Date date = new Date();
|
|
|
- int yshFlag = dao.updateYshYjReqFlag(confirmId, reqNo, date, userInfo.getDeptCode(), flag);
|
|
|
+ int yshFlag = dao.updateYshYjReqFlag(userInfo.getCode(), yshYjReq.getReqNo(), date, userInfo.getDeptCode(), flag);
|
|
|
|
|
|
if (yshFlag == 0) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "更新失败请联系管理员");
|
|
|
+ throw new BizException(ExceptionEnum.INVALID_PARAM, "更新失败请联系管理员");
|
|
|
}
|
|
|
|
|
|
- int feeCount = dao.confirmTheIntermediateTable(confirmId,
|
|
|
+ int feeCount = dao.confirmTheIntermediateTable(userInfo.getCode(),
|
|
|
yshYjReq.getActOrderNo(),
|
|
|
date,
|
|
|
userInfo.getDeptCode(),
|
|
@@ -191,8 +164,6 @@ public class MedicalTechnologyIsPaidService {
|
|
|
if (feeCount == 0) {
|
|
|
throw new BizException(ExceptionEnum.INVALID_PARAM, "更新失败请联系管理员");
|
|
|
}
|
|
|
- hospitalizationCostsService.refundsByPatientOrder(yshYjReq.getInpatientNo(), yshYjReq.getAdmissTimes(), yshYjReq.getActOrderNo());
|
|
|
- return ResultVoUtil.success("操作成功。");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -204,7 +175,7 @@ public class MedicalTechnologyIsPaidService {
|
|
|
* @return 返回提示
|
|
|
*/
|
|
|
public ResultVo<String> medConfirmList(List<String> reqNoList, String confirmId) {
|
|
|
- UserInfo userInfo = redisLikeService.getUserInfoByCode(confirmId);
|
|
|
+ UserInfo userInfo = dao.getUserInfo(confirmId);
|
|
|
if (userInfo == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "未查询到确认人数据");
|
|
|
}
|