|
@@ -4,7 +4,6 @@ package com.diagbot.facade;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.diagbot.client.MedAppealExamineInfoServiceClient;
|
|
|
import com.diagbot.client.MedAppealExamineInfoServiceClientFacade;
|
|
|
import com.diagbot.dto.AnalyzeDTO;
|
|
|
|
|
@@ -50,7 +49,7 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
@Autowired
|
|
|
private QcresultDetailFacade qcresultDetailFacade;
|
|
|
@Autowired
|
|
|
- private MedAppealInfoManagementFacade medAppealInfoManagementFacade;
|
|
|
+ private MedAppealInfoManagementFacade medAppealInfoManagementFacade;
|
|
|
@Autowired
|
|
|
private QcresultInfoFacade qcresultInfoFacade;
|
|
|
@Autowired
|
|
@@ -58,17 +57,23 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
|
|
|
/**
|
|
|
* 审核通过
|
|
|
+ *
|
|
|
* @param approvedVo
|
|
|
* @return
|
|
|
*/
|
|
|
- public Boolean approved (ApprovedVo approvedVo) {
|
|
|
+ public Boolean approved(ApprovedVo approvedVo) {
|
|
|
LocalDateTime dateTime = LocalDateTime.now();
|
|
|
QcresultVO qcresultVO = new QcresultVO();
|
|
|
qcresultVO.setBehospitalCode(approvedVo.getBehospitalCode());
|
|
|
qcresultVO.setHospitalId(approvedVo.getHospitalId());
|
|
|
QcResultAlgVO qcResultAlgVO = approvedVo.getQcResultAlgVO();
|
|
|
Long modeId = approvedVo.getModeId();
|
|
|
- if(modeId!=null){
|
|
|
+ Long casesEntryId = approvedVo.getQcResultAlgVO().getCasesEntryId();
|
|
|
+ if (casesEntryId != null) {
|
|
|
+ QcresultDetail qcresultDetail = getQcresultDetail(approvedVo);
|
|
|
+ approvedVo.setQcresultDetailId(qcresultDetail.getId());
|
|
|
+ }
|
|
|
+ if (modeId != null) {
|
|
|
QcCasesEntry qcCasesEntry = qcCasesEntryFacade.getOne(new QueryWrapper<QcCasesEntry>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("mode_id", modeId)
|
|
@@ -79,13 +84,16 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
qcresultVO.setOptResultAlgVO(qcResultAlgVO);
|
|
|
//获取处理方式
|
|
|
String handling = approvedVo.getExampleOperation();
|
|
|
- if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.UP_OR_DEL.getKey())){
|
|
|
+ if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.UP_OR_DEL.getKey())) {
|
|
|
QcresultDetail detail = getQcresultDetail(approvedVo);
|
|
|
+ if (detail == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "该条目不存在,请走驳回流程!");
|
|
|
+ }
|
|
|
//调用删除接口
|
|
|
qcresultVO.setDelStatus(0);
|
|
|
qcresultVO.setType(4);
|
|
|
AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
|
|
|
- if(analyzeDTORespDTO.getIsSuccess()){
|
|
|
+ if (analyzeDTORespDTO.getIsSuccess()) {
|
|
|
approvedVo.setQcresultDetailId(detail.getId());
|
|
|
Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
|
|
@@ -98,21 +106,24 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
.eq("appeal_info_id", approvedVo.getId())
|
|
|
.eq("check_id", approvedVo.getAppealId())
|
|
|
);
|
|
|
- if(appealInfo && update){
|
|
|
- return true;
|
|
|
- }else {
|
|
|
+ if (appealInfo && update) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "删除失败!");
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.UP_OR_UP.getKey())){
|
|
|
+ if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.UP_OR_UP.getKey())) {
|
|
|
QcresultDetail detail = getQcresultDetail(approvedVo);
|
|
|
+ if (detail == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "该条目不存在,请走驳回流程!");
|
|
|
+ }
|
|
|
//调用修改接口
|
|
|
qcresultVO.setType(3);
|
|
|
AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
|
|
|
- if(analyzeDTORespDTO.getIsSuccess()){
|
|
|
+ if (analyzeDTORespDTO.getIsSuccess()) {
|
|
|
approvedVo.setQcresultDetailId(detail.getId());
|
|
|
Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
|
|
@@ -125,31 +136,26 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
.eq("appeal_info_id", approvedVo.getId())
|
|
|
.eq("check_id", approvedVo.getAppealId())
|
|
|
);
|
|
|
- if(appealInfo && update){
|
|
|
- return true;
|
|
|
- }else {
|
|
|
+ if (appealInfo && update) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "修改失败!");
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.ADD_EXIST.getKey())){
|
|
|
+ if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.ADD_EXIST.getKey())) {
|
|
|
//判断是否已存在该条目
|
|
|
- QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", approvedVo.getHospitalId())
|
|
|
- .eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
- .eq("cases_entry_id", qcResultAlgVO.getCasesEntryId())
|
|
|
- );
|
|
|
- if(qcresultDetail!=null){
|
|
|
+ QcresultDetail qcresultDetail = getQcresultDetail(approvedVo);
|
|
|
+ if (qcresultDetail != null) {
|
|
|
throw new CommonException(CommonErrorCode.IS_EXISTS, "该条目已存在!");
|
|
|
}
|
|
|
//调用新增接口
|
|
|
qcresultVO.setType(1);
|
|
|
|
|
|
AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
|
|
|
- if(analyzeDTORespDTO.getIsSuccess()){
|
|
|
+ if (analyzeDTORespDTO.getIsSuccess()) {
|
|
|
QcresultDetail detail = getQcresultDetail(approvedVo);
|
|
|
MedAppealInfo medAppealInfo = new MedAppealInfo();
|
|
|
medAppealInfo.setQcresultDetailId(detail.getId());
|
|
@@ -170,27 +176,30 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
.eq("appeal_info_id", approvedVo.getId())
|
|
|
.eq("check_id", approvedVo.getAppealId())
|
|
|
);
|
|
|
- if(update && update1){
|
|
|
- return true;
|
|
|
- }else {
|
|
|
+ if (update && update1) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "新增失败!");
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.RECOVER.getKey())){
|
|
|
+ if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.RECOVER.getKey())) {
|
|
|
qcresultVO.setType(4);
|
|
|
qcresultVO.setDelStatus(1);
|
|
|
//调用删除恢复接口
|
|
|
+ QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
|
|
|
+ .eq("hospital_id", approvedVo.getHospitalId())
|
|
|
+ .eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
+ .eq("cases_entry_id", approvedVo.getQcResultAlgVO().getCasesEntryId())
|
|
|
+ .eq("grade_type", 2)
|
|
|
+ );
|
|
|
+ if (qcresultDetail == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "该条目不存在,请走驳回流程!");
|
|
|
+ }
|
|
|
AnalyzeDTO analyzeDTORespDTO = qcresultInfoFacade.changeQcResult(qcresultVO);
|
|
|
- if(analyzeDTORespDTO.getIsSuccess()){
|
|
|
- QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
|
|
|
- .eq("hospital_id", approvedVo.getHospitalId())
|
|
|
- .eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
- .eq("cases_entry_id", approvedVo.getQcResultAlgVO().getCasesEntryId())
|
|
|
- .eq("grade_type",2)
|
|
|
- );
|
|
|
+ if (analyzeDTORespDTO.getIsSuccess()) {
|
|
|
approvedVo.setQcresultDetailId(qcresultDetail.getId());
|
|
|
Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
|
|
@@ -203,18 +212,18 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
.eq("appeal_info_id", approvedVo.getId())
|
|
|
.eq("check_id", approvedVo.getAppealId())
|
|
|
);
|
|
|
- if(appealInfo && update){
|
|
|
- return true;
|
|
|
- }else {
|
|
|
+ if (appealInfo && update) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "审核通过失败!");
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "恢复失败!");
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.ADD_NO_EXIST.getKey())){
|
|
|
+ if (StringUtil.isNotEmpty(handling) && handling.equals(ExampleOperationEnum.ADD_NO_EXIST.getKey())) {
|
|
|
Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
- MedAppealExamineInfo medAppealExamineInfo= new MedAppealExamineInfo();
|
|
|
+ MedAppealExamineInfo medAppealExamineInfo = new MedAppealExamineInfo();
|
|
|
medAppealExamineInfo.setExampleOperation(ExampleOperationEnum.ADD_NO_EXIST.getKey());
|
|
|
medAppealExamineInfo.setExampleStatus(ExampleStatusEnum.ADOPT_EXAMPLE.getKey());
|
|
|
medAppealExamineInfo.setProcessResult(approvedVo.getProcessResult());
|
|
@@ -233,7 +242,7 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "无此类型处理方式!");
|
|
|
}
|
|
|
|
|
|
- public Boolean updateAppealInfo (ApprovedVo approvedVo) {
|
|
|
+ public Boolean updateAppealInfo(ApprovedVo approvedVo) {
|
|
|
MedAppealInfo medAppealInfo = new MedAppealInfo();
|
|
|
medAppealInfo.setQcresultDetailId(approvedVo.getQcresultDetailId());
|
|
|
medAppealInfo.setWorkFlowNodeId(approvedVo.getWorkFlowNodeId());
|
|
@@ -243,14 +252,15 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
.eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
.eq("id", approvedVo.getId())
|
|
|
);
|
|
|
- if(update){
|
|
|
+ if (update) {
|
|
|
return true;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public QcresultDetail getQcresultDetail (ApprovedVo approvedVo) {
|
|
|
+ // 获取detail条目信息
|
|
|
+ public QcresultDetail getQcresultDetail(ApprovedVo approvedVo) {
|
|
|
QcresultDetail qcresultDetail = qcresultDetailFacade.getOne(new QueryWrapper<QcresultDetail>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", approvedVo.getHospitalId())
|
|
@@ -266,7 +276,7 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
getAppealReviewVO.setSearchCount(false);
|
|
|
RespDTO<Page<GetAppealReviewDTO>> appealReview = medAppealExamineInfoServiceClient.getAppealReview(getAppealReviewVO);
|
|
|
//格式转换
|
|
|
- List<ExportGetAppealReviewDTO> out = BeanUtil.listCopyTo(appealReview.data.getRecords(),ExportGetAppealReviewDTO.class);
|
|
|
+ List<ExportGetAppealReviewDTO> out = BeanUtil.listCopyTo(appealReview.data.getRecords(), ExportGetAppealReviewDTO.class);
|
|
|
String fileName = "申诉审核.xls";
|
|
|
ExcelUtils.exportExcelUser(out, null, "sheet1", ExportGetAppealReviewDTO.class, fileName, response);
|
|
|
}
|
|
@@ -277,7 +287,7 @@ public class MedAppealExamineInfoManagementFacade extends MedAppealExamineInfoSe
|
|
|
getComplaintRecordVO.setSearchCount(false);
|
|
|
RespDTO<Page<GetComplaintRecordDTO>> complaintRecord = medAppealExamineInfoServiceClient.getComplaintRecord(getComplaintRecordVO);
|
|
|
//格式转换
|
|
|
- List<ExportGetComplaintRecordDTO> out = BeanUtil.listCopyTo(complaintRecord.data.getRecords(),ExportGetComplaintRecordDTO.class);
|
|
|
+ List<ExportGetComplaintRecordDTO> out = BeanUtil.listCopyTo(complaintRecord.data.getRecords(), ExportGetComplaintRecordDTO.class);
|
|
|
String fileName = "申诉记录.xls";
|
|
|
ExcelUtils.exportExcelUser(out, null, "sheet1", ExportGetComplaintRecordDTO.class, fileName, response);
|
|
|
}
|