|
@@ -132,6 +132,20 @@ public class MedAppealInfoManagementFacade {
|
|
|
return addAppealInfoAndExamineInfo(addAppealInfoVO);
|
|
|
//新增缺失
|
|
|
case "2":
|
|
|
+ //1.判断新增缺失是否存在(医院id+病历id+申诉说明+状态【申诉】)
|
|
|
+ AppealInfo notAppealInfo = getAppealInfo(addAppealInfoVO.getHospitalId(), addAppealInfoVO.getBehospitalCode()
|
|
|
+ , addAppealInfoVO.getAppealExplain());
|
|
|
+ if (WorkFlowNodeEnum.APPEAL.getKey().equals(notAppealInfo.getWorkFlowNodeId() + "")) {
|
|
|
+ Asserts.fail("该缺陷已被申诉");
|
|
|
+ } else {
|
|
|
+ //删除申诉记录
|
|
|
+ appealInfoFacade.update(new UpdateWrapper<AppealInfo>().set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .eq("id", notAppealInfo.getId()));
|
|
|
+ //逻辑删除申诉审批记录
|
|
|
+ appealExamineInfoFacade.update(new UpdateWrapper<AppealExamineInfo>()
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .eq("appeal_info_id", notAppealInfo.getId()));
|
|
|
+ }
|
|
|
//补全缺失模块信息
|
|
|
if (StringUtil.isNotBlank(addAppealInfoVO.getModeName())) {
|
|
|
//获取模块名称
|
|
@@ -140,6 +154,7 @@ public class MedAppealInfoManagementFacade {
|
|
|
addAppealInfoVO.setModeId(modeId);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//新增申诉记录+审核记录
|
|
|
return addAppealInfoAndExamineInfo(addAppealInfoVO);
|
|
|
//恢复
|
|
@@ -241,6 +256,27 @@ public class MedAppealInfoManagementFacade {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param hospitalId
|
|
|
+ * @param behospitalCode
|
|
|
+ * @Description获取该病历缺陷申诉记录(新增缺失)
|
|
|
+ * @Return com.lantone.report.entity.AppealInfo
|
|
|
+ */
|
|
|
+ private AppealInfo getAppealInfo(Long hospitalId, String behospitalCode, String appealExplain) {
|
|
|
+
|
|
|
+ List<AppealInfo> appealInfos = appealInfoFacade.list(new QueryWrapper<AppealInfo>()
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .eq("behospital_code", behospitalCode)
|
|
|
+ .eq("appeal_operation_type", AppealOperationTypeEnum.ADD_NO_EXIST.getKey())
|
|
|
+ .eq("appeal_explain", appealExplain)
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .orderByDesc("gmt_create"));
|
|
|
+ if (ListUtil.isNotEmpty(appealInfos)) {
|
|
|
+ return appealInfos.get(0);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param addAppealInfoVO
|
|
|
* @Description通过医院id+病历id+条目ID+未删除 获取该缺陷记录
|
|
@@ -357,19 +393,40 @@ public class MedAppealInfoManagementFacade {
|
|
|
Asserts.fail("撤回申诉条目不存在");
|
|
|
}
|
|
|
if (WorkFlowNodeEnum.APPEAL.getKey().equals(appealInfo.getWorkFlowNodeId() + "")) {
|
|
|
- //获取该条目申诉历史记录
|
|
|
- List<AppealInfo> appealInfoHistory = appealInfoFacade.list(new QueryWrapper<AppealInfo>()
|
|
|
- .eq("hospital_id", appealInfo.getHospitalId())
|
|
|
- .eq("behospital_code", appealInfo.getBehospitalCode())
|
|
|
- .notIn("work_flow_node_id", WorkFlowNodeEnum.APPEAL_BACK.getKey())
|
|
|
- .eq(appealInfo.getCasesEntryId() != null, "cases_entry_id", appealInfo.getCasesEntryId())
|
|
|
- .eq("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
- .orderByDesc("gmt_create"));
|
|
|
+ List<AppealInfo> appealInfoHistory = null;
|
|
|
+ //非新增缺失
|
|
|
+ if (!AppealOperationTypeEnum.ADD_NO_EXIST.getKey().equals(appealInfo.getAppealOperationType())) {
|
|
|
+ //获取该条目申诉历史记录(非新增缺失)
|
|
|
+ appealInfoHistory = appealInfoFacade.list(new QueryWrapper<AppealInfo>()
|
|
|
+ .eq("hospital_id", appealInfo.getHospitalId())
|
|
|
+ .eq("behospital_code", appealInfo.getBehospitalCode())
|
|
|
+ .notIn("work_flow_node_id", WorkFlowNodeEnum.APPEAL_BACK.getKey())
|
|
|
+ .eq(appealInfo.getCasesEntryId() != null, "cases_entry_id", appealInfo.getCasesEntryId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .orderByDesc("gmt_create"));
|
|
|
+ } else {
|
|
|
+ appealInfoHistory = appealInfoFacade.list(new QueryWrapper<AppealInfo>()
|
|
|
+ .eq("hospital_id", appealInfo.getHospitalId())
|
|
|
+ .eq("behospital_code", appealInfo.getBehospitalCode())
|
|
|
+ .notIn("work_flow_node_id", WorkFlowNodeEnum.APPEAL_BACK.getKey())
|
|
|
+ .eq("appeal_operation_type", AppealOperationTypeEnum.ADD_NO_EXIST.getKey())
|
|
|
+ .eq(appealInfo.getAppealExplain() != null, "appeal_explain", appealInfo.getAppealExplain())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .orderByDesc("gmt_create"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//存在历史记录还原最后一条
|
|
|
if (ListUtil.isNotEmpty(appealInfoHistory)) {
|
|
|
AppealInfo appealInfoOld = appealInfoHistory.get(0);
|
|
|
appealInfoOld.setIsDeleted(IsDeleteEnum.N.getKey());
|
|
|
out = appealInfoFacade.saveOrUpdate(appealInfoOld);
|
|
|
+ //还原审批记录
|
|
|
+ if (out) {
|
|
|
+ out = appealExamineInfoFacade.update(new UpdateWrapper<AppealExamineInfo>()
|
|
|
+ .set("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("appeal_info_id", appealInfoOld.getId()));
|
|
|
+ }
|
|
|
}
|
|
|
//逻辑删除该申诉(撤回)
|
|
|
appealInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
|