|
@@ -69,12 +69,12 @@ public class MedAppealInfoManagementFacade {
|
|
|
switch (addAppealInfoVO.getAppealOperationType()) {
|
|
|
//删改
|
|
|
case "0":
|
|
|
- //通过缺陷id获取该缺陷记录
|
|
|
- QcresultDetail qcresultDetail = getQcresultDetailById(addAppealInfoVO.getQcresultDetailId());
|
|
|
+ //通过医院id+病历id+条目ID+未删除 获取该缺陷记录
|
|
|
+ QcresultDetail qcresultDetail = getQcresultDetailById(addAppealInfoVO);
|
|
|
//获取该病历缺陷申诉记录(医院id+病历id+质控缺陷id+未删除)
|
|
|
AppealInfo appealInfo = getAppealInfo(addAppealInfoVO.getHospitalId()
|
|
|
, addAppealInfoVO.getBehospitalCode()
|
|
|
- , addAppealInfoVO.getQcresultDetailId());
|
|
|
+ , addAppealInfoVO.getCasesEntryId());
|
|
|
//缺陷状态-删除
|
|
|
if (IsDeleteEnum.Y.getKey().equals(qcresultDetail.getIsDeleted())) {
|
|
|
Asserts.fail("该缺陷已被删除,请走恢复流程");
|
|
@@ -93,8 +93,8 @@ public class MedAppealInfoManagementFacade {
|
|
|
.eq("id", appealInfo.getId()));
|
|
|
//逻辑删除申诉审批记录
|
|
|
appealExamineInfoFacade.update(new UpdateWrapper<AppealExamineInfo>()
|
|
|
- .set("is_deleted",IsDeleteEnum.Y.getKey())
|
|
|
- .eq("appeal_info_id",appealInfo.getId()));
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .eq("appeal_info_id", appealInfo.getId()));
|
|
|
}
|
|
|
//新增申诉记录+审核记录
|
|
|
return addAppealInfoAndExamineInfo(addAppealInfoVO);
|
|
@@ -115,15 +115,15 @@ public class MedAppealInfoManagementFacade {
|
|
|
AppealInfo oldAppealInfo = getAppealInfo(addAppealInfoVO);
|
|
|
if (oldAppealInfo != null) {
|
|
|
//如果最新的一条是已审核
|
|
|
- if(WorkFlowNodeEnum.DEPT_CHECK.getKey().equals(oldAppealInfo.getWorkFlowNodeId() + "")){
|
|
|
+ if (WorkFlowNodeEnum.DEPT_CHECK.getKey().equals(oldAppealInfo.getWorkFlowNodeId() + "")) {
|
|
|
//删除改新增已有(已审核)申诉记录
|
|
|
appealInfoFacade.update(new UpdateWrapper<AppealInfo>().set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
.eq("id", oldAppealInfo.getId()));
|
|
|
//逻辑删除申诉审批记录
|
|
|
appealExamineInfoFacade.update(new UpdateWrapper<AppealExamineInfo>()
|
|
|
- .set("is_deleted",IsDeleteEnum.Y.getKey())
|
|
|
- .eq("appeal_info_id",oldAppealInfo.getId()));
|
|
|
- }else if (WorkFlowNodeEnum.APPEAL.getKey().equals(oldAppealInfo.getWorkFlowNodeId() + "")) {
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .eq("appeal_info_id", oldAppealInfo.getId()));
|
|
|
+ } else if (WorkFlowNodeEnum.APPEAL.getKey().equals(oldAppealInfo.getWorkFlowNodeId() + "")) {
|
|
|
Asserts.fail("该缺陷已被申诉无需再次恢复");
|
|
|
}
|
|
|
|
|
@@ -145,11 +145,11 @@ public class MedAppealInfoManagementFacade {
|
|
|
//恢复
|
|
|
case "3":
|
|
|
//通过缺陷id获取该缺陷记录
|
|
|
- QcresultDetail qcresultDetail1 = getQcresultDetailById(addAppealInfoVO.getQcresultDetailId());
|
|
|
+ QcresultDetail qcresultDetail1 = getQcresultDetailById(addAppealInfoVO);
|
|
|
//获取该病历缺陷申诉记录(医院id+病历id+质控缺陷id+未删除)
|
|
|
AppealInfo appealInfo1 = getAppealInfo(addAppealInfoVO.getHospitalId()
|
|
|
, addAppealInfoVO.getBehospitalCode()
|
|
|
- , addAppealInfoVO.getQcresultDetailId());
|
|
|
+ , addAppealInfoVO.getCasesEntryId());
|
|
|
//缺陷状态-删除
|
|
|
if (qcresultDetail1.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
|
|
|
Asserts.fail("缺陷已被恢复无需再次恢复");
|
|
@@ -167,8 +167,8 @@ public class MedAppealInfoManagementFacade {
|
|
|
appealInfoFacade.update(new UpdateWrapper<AppealInfo>().set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
.eq("id", appealInfo1.getId()));
|
|
|
appealExamineInfoFacade.update(new UpdateWrapper<AppealExamineInfo>()
|
|
|
- .set("is_deleted",IsDeleteEnum.Y.getKey())
|
|
|
- .eq("appeal_info_id",appealInfo1.getId()));
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .eq("appeal_info_id", appealInfo1.getId()));
|
|
|
}
|
|
|
//新增申诉记录+审核记录
|
|
|
return addAppealInfoAndExamineInfo(addAppealInfoVO);
|
|
@@ -220,19 +220,19 @@ public class MedAppealInfoManagementFacade {
|
|
|
/**
|
|
|
* @param hospitalId
|
|
|
* @param behospitalCode
|
|
|
- * @param qcresultDetailId
|
|
|
+ * @param getCasesEntryId
|
|
|
* @Description获取该病历缺陷申诉记录
|
|
|
* @Return com.lantone.report.entity.AppealInfo
|
|
|
*/
|
|
|
- private AppealInfo getAppealInfo(Long hospitalId, String behospitalCode, Long qcresultDetailId) {
|
|
|
+ private AppealInfo getAppealInfo(Long hospitalId, String behospitalCode, Long getCasesEntryId) {
|
|
|
|
|
|
- if (qcresultDetailId == null) {
|
|
|
+ if (getCasesEntryId == null) {
|
|
|
Asserts.fail("质控缺陷id为空");
|
|
|
}
|
|
|
List<AppealInfo> appealInfos = appealInfoFacade.list(new QueryWrapper<AppealInfo>()
|
|
|
.eq("hospital_id", hospitalId)
|
|
|
.eq("behospital_code", behospitalCode)
|
|
|
- .eq("qcresult_detail_id", qcresultDetailId)
|
|
|
+ .eq("cases_entry_id", getCasesEntryId)
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.orderByDesc("gmt_create"));
|
|
|
if (ListUtil.isNotEmpty(appealInfos)) {
|
|
@@ -242,19 +242,24 @@ public class MedAppealInfoManagementFacade {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param qcresultDetailId
|
|
|
- * @Description通过id获取质控缺陷条目
|
|
|
+ * @param addAppealInfoVO
|
|
|
+ * @Description通过医院id+病历id+条目ID+未删除 获取该缺陷记录
|
|
|
* @Return com.lantone.report.entity.QcresultDetail
|
|
|
*/
|
|
|
- private QcresultDetail getQcresultDetailById(Long qcresultDetailId) {
|
|
|
- if (qcresultDetailId == null) {
|
|
|
- Asserts.fail("质控缺陷id为空");
|
|
|
+ private QcresultDetail getQcresultDetailById(AddAppealInfoVO addAppealInfoVO) {
|
|
|
+ if (addAppealInfoVO.getCasesEntryId() == null) {
|
|
|
+ Asserts.fail("条目ID为空");
|
|
|
}
|
|
|
- QcresultDetail qcresultDetail = qcresultDetailFacade.getById(qcresultDetailId);
|
|
|
- if (qcresultDetail == null) {
|
|
|
+ List<QcresultDetail> qcresultDetails = qcresultDetailFacade.list(new QueryWrapper<QcresultDetail>()
|
|
|
+ .eq("hospital_id", addAppealInfoVO.getHospitalId())
|
|
|
+ .eq("behospital_code", addAppealInfoVO.getBehospitalCode())
|
|
|
+ .eq("cases_entry_id", addAppealInfoVO.getCasesEntryId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .orderByDesc("gmt_create"));
|
|
|
+ if (ListUtil.isEmpty(qcresultDetails)) {
|
|
|
Asserts.fail("质控缺陷不存在");
|
|
|
}
|
|
|
- return qcresultDetail;
|
|
|
+ return qcresultDetails.get(0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -357,7 +362,6 @@ public class MedAppealInfoManagementFacade {
|
|
|
.eq("hospital_id", appealInfo.getHospitalId())
|
|
|
.eq("behospital_code", appealInfo.getBehospitalCode())
|
|
|
.notIn("work_flow_node_id", WorkFlowNodeEnum.APPEAL_BACK.getKey())
|
|
|
- .eq(appealInfo.getQcresultDetailId() != null, "qcresult_detail_id", appealInfo.getQcresultDetailId())
|
|
|
.eq(appealInfo.getCasesEntryId() != null, "cases_entry_id", appealInfo.getCasesEntryId())
|
|
|
.eq("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
.orderByDesc("gmt_create"));
|
|
@@ -372,11 +376,11 @@ public class MedAppealInfoManagementFacade {
|
|
|
appealInfo.setWorkFlowNodeId(cancelAppealInfoVO.getWorkFlowNodeId());
|
|
|
appealInfo.setGmtModified(DateUtil.now());
|
|
|
out = appealInfoFacade.updateById(appealInfo);
|
|
|
- if(out){
|
|
|
+ if (out) {
|
|
|
//逻辑删除申诉申请审批记录
|
|
|
return appealExamineInfoFacade.update(new UpdateWrapper<AppealExamineInfo>()
|
|
|
- .set("is_deleted",IsDeleteEnum.Y.getKey())
|
|
|
- .eq("appeal_info_id",appealInfo.getId()));
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .eq("appeal_info_id", appealInfo.getId()));
|
|
|
}
|
|
|
Asserts.fail("撤回失败");
|
|
|
} else {
|