|
|
@@ -158,7 +158,11 @@ public class CaseFrontSheetService {
|
|
|
list = basDao.selectPatientsForBasByBah2(param);
|
|
|
}
|
|
|
if (list.isEmpty()) {
|
|
|
- return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有此患者的结算信息,请联系病房核实。");
|
|
|
+ int status = param.getFileStatus() == 0 ? 0 : 1;
|
|
|
+ list = basDao.selectSignApply(param.getBah(), status);
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST, "没有此患者的结算信息或归档申请,请联系病房核实。");
|
|
|
+ }
|
|
|
}
|
|
|
if (param.getLateFlag() != 3) {
|
|
|
list.removeIf(item -> !item.getLateFlag().equals(param.getLateFlag()));
|
|
|
@@ -290,15 +294,6 @@ public class CaseFrontSheetService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- public synchronized ResultVo<List<PureCodeName>> savePatientInfo(OpCaseFrontsheet param) {
|
|
|
- CaseFrontsheetMain sheet = param.getSheet();
|
|
|
- final String bah = sheet.getBah();
|
|
|
- final int times = sheet.getAdmissTimes();
|
|
|
- dao.writeBaOpLog(param.getOpType(), param.getStaffId(), bah, times);
|
|
|
- return param.getOpType() == 1 ? saveSheet(sheet) : archiveSheet(sheet);
|
|
|
- }
|
|
|
-
|
|
|
private ResultVo<List<PureCodeName>> saveSheet(CaseFrontsheetMain sheet) {
|
|
|
String bah = sheet.getBah();
|
|
|
int times = sheet.getAdmissTimes();
|
|
|
@@ -346,10 +341,28 @@ public class CaseFrontSheetService {
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
|
|
|
+ public ResultVo<List<PureCodeName>> signApply(CaseFrontsheetMain sheet) {
|
|
|
+ Integer status = dao.getSignApplyStatus(sheet.getBah(), sheet.getAdmissTimes());
|
|
|
+ if (null == status) {
|
|
|
+ List<PureCodeName> message = VerifyCaseFrontSheet.getInstance().printVerify(sheet);
|
|
|
+ if (message.isEmpty()) {
|
|
|
+ dao.insertNewSignApply(sheet.getBah(), sheet.getAdmissTimes(),
|
|
|
+ sheet.getName(), sheet.getSex(), TokenUtil.getTokenUserId());
|
|
|
+ return ResultVoUtil.success();
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "校验未通过。", message);
|
|
|
+ }
|
|
|
+ if (status == 0) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "此病案已提交过归档申请,请耐心等待病案室签收。");
|
|
|
+ }
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "此病案已签收,无法继续申请。");
|
|
|
+ }
|
|
|
+
|
|
|
private ResultVo<List<PureCodeName>> archiveSheet(CaseFrontsheetMain sheet) {
|
|
|
- String bah = sheet.getBah();
|
|
|
- int times = sheet.getAdmissTimes();
|
|
|
- if (userDao.getUserRoles(TokenUtil.getTokenUserId()).contains(7)) {
|
|
|
+ String staff = TokenUtil.getTokenUserId();
|
|
|
+ if (userDao.getUserRoles(staff).contains(7)) {
|
|
|
+ String bah = sheet.getBah();
|
|
|
+ int times = sheet.getAdmissTimes();
|
|
|
if (isLateSubmit(sheet.getDismissDate()) > 8) {
|
|
|
sheet.setLateFlag(1);
|
|
|
} else {
|
|
|
@@ -384,6 +397,7 @@ public class CaseFrontSheetService {
|
|
|
basDao.insert(caseFrontsheetSurgery);
|
|
|
}
|
|
|
}
|
|
|
+ dao.updateSignApply(bah, times, staff);
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您没有签收首页的权限。");
|
|
|
@@ -514,10 +528,14 @@ public class CaseFrontSheetService {
|
|
|
if (sheet.getFileStatus() == 2) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "已打印的病案首页无法再次保存!");
|
|
|
}
|
|
|
- List<PureCodeName> message = VerifyCaseFrontSheet.getInstance().saveVerify(sheet);
|
|
|
- log.info("保存前病案逻辑校验, 操作员:{} >>> {}", TokenUtil.getTokenUserId(), message);
|
|
|
+ int optype = info.getOpType();
|
|
|
+ List<PureCodeName> message = optype == 1 ? VerifyCaseFrontSheet.getInstance().saveVerify(sheet) :
|
|
|
+ VerifyCaseFrontSheet.getInstance().printVerify(sheet);
|
|
|
if (message.isEmpty()) {
|
|
|
- return savePatientInfo(info);
|
|
|
+ final String bah = sheet.getBah();
|
|
|
+ final int times = sheet.getAdmissTimes();
|
|
|
+ dao.writeBaOpLog(optype, info.getStaffId(), bah, times);
|
|
|
+ return optype == 1 ? saveSheet(sheet) : archiveSheet(sheet);
|
|
|
} else {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INTERNAL_SERVER_ERROR, "校验未通过。", message);
|
|
|
}
|