|
@@ -0,0 +1,326 @@
|
|
|
|
+package com.lantone.report.facade;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.lantone.common.dto.RespDTO;
|
|
|
|
+import com.lantone.common.dto.analyze.AnalyzeDTO;
|
|
|
|
+import com.lantone.common.dto.appeal.GetAppealInfoDTO;
|
|
|
|
+import com.lantone.common.dto.appeal.GetAuditDTO;
|
|
|
|
+import com.lantone.common.dto.appeal.GetAppealReviewDTO;
|
|
|
|
+import com.lantone.common.dto.appeal.GetComplaintRecordDTO;
|
|
|
|
+import com.lantone.common.enums.IsDeleteEnum;
|
|
|
|
+import com.lantone.common.exception.Asserts;
|
|
|
|
+import com.lantone.common.util.StringUtil;
|
|
|
|
+import com.lantone.common.vo.appeal.*;
|
|
|
|
+import com.lantone.common.vo.report.QcResultAlgVO;
|
|
|
|
+import com.lantone.common.vo.report.QcresultVO;
|
|
|
|
+import com.lantone.dblayermbg.entity.analyze.MedQcresultDetail;
|
|
|
|
+import com.lantone.dblayermbg.entity.appeal.AppealExamineInfo;
|
|
|
|
+import com.lantone.dblayermbg.entity.appeal.AppealInfo;
|
|
|
|
+import com.lantone.dblayermbg.facade.analyze.MedQcresultDetailFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.appeal.AppealExamineInfoFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.appeal.AppealInfoFacade;
|
|
|
|
+import com.lantone.report.client.MedAppealExamineInfoServiceClient;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Description:申述记录
|
|
|
|
+ * @Author: songxl
|
|
|
|
+ * @Date 2022/1/5
|
|
|
|
+ */
|
|
|
|
+@Component
|
|
|
|
+public class MedAppealExamineInfoManagementFacade {
|
|
|
|
+ @Autowired
|
|
|
|
+ private AppealExamineInfoFacade appealExamineInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private MedQcresultDetailFacade medQcresultDetailFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AppealInfoFacade appealInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ MedAppealExamineInfoServiceClient medAppealExamineInfoServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ MedAppealInfoManagementFacade medAppealInfoManagementFacade;
|
|
|
|
+ /**
|
|
|
|
+ * 申诉记录
|
|
|
|
+ * @param getComplaintRecordVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public IPage<GetComplaintRecordDTO> getComplaintRecord(GetComplaintRecordVO getComplaintRecordVO) {
|
|
|
|
+ return appealExamineInfoFacade.getBaseMapper().getComplaintRecord(getComplaintRecordVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 申诉审核列表
|
|
|
|
+ * @param getAppealReviewVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public IPage<GetAppealReviewDTO> getAppealReview(GetAppealReviewVO getAppealReviewVO) {
|
|
|
|
+ return appealExamineInfoFacade.getBaseMapper().getAppealReview(getAppealReviewVO);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 获取申述详情
|
|
|
|
+ * @param getAuditVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public GetAuditDTO getAudit(GetAuditVO getAuditVO) {
|
|
|
|
+ return appealExamineInfoFacade.getBaseMapper().getAudit(getAuditVO);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 审核通过
|
|
|
|
+ * @param approvedVo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean approved (ApprovedVo approvedVo) {
|
|
|
|
+ QcresultVO qcresultVO = new QcresultVO();
|
|
|
|
+ qcresultVO.setBehospitalCode(approvedVo.getBehospitalCode());
|
|
|
|
+ qcresultVO.setHospitalId(approvedVo.getHospitalId());
|
|
|
|
+ QcResultAlgVO qcResultAlgVO = new QcResultAlgVO();
|
|
|
|
+ qcResultAlgVO.setCasesId(approvedVo.getCasesId());
|
|
|
|
+ qcResultAlgVO.setScore(approvedVo.getValue());
|
|
|
|
+ qcResultAlgVO.setMsg(approvedVo.getCasesEntryMsg());
|
|
|
|
+ //获取处理方式
|
|
|
|
+ String handling = approvedVo.getExampleOperation();
|
|
|
|
+ if(StringUtil.isNotEmpty(handling) && handling.equals("删除")){
|
|
|
|
+ //调用删除接口
|
|
|
|
+ qcResultAlgVO.setCasesEntryId(approvedVo.getQcresultDetailId());
|
|
|
|
+ qcresultVO.setOptResultAlgVO(qcResultAlgVO);
|
|
|
|
+ qcresultVO.setDelStatus(1);
|
|
|
|
+ RespDTO<AnalyzeDTO> analyzeDTORespDTO = medAppealExamineInfoServiceClient.logicDelCase(qcresultVO);
|
|
|
|
+ if(analyzeDTORespDTO.data.getIsSuccess()){
|
|
|
|
+ Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
|
+ AppealExamineInfo appealExamineInfo = new AppealExamineInfo();
|
|
|
|
+ appealExamineInfo.setExampleOperation("2");
|
|
|
|
+ appealExamineInfo.setExampleStatus("2");
|
|
|
|
+ appealExamineInfo.setRemark(approvedVo.getRemark());
|
|
|
|
+ appealExamineInfo.setAppealInfoId(approvedVo.getAppealId());
|
|
|
|
+ int appealExamineInfoUpdate = appealExamineInfoFacade.getBaseMapper().update(appealExamineInfo, new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("appeal_info_id", approvedVo.getId())
|
|
|
|
+ .eq("check_id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfo && appealExamineInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("审核通过失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("删除失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtil.isNotEmpty(handling) && handling.equals("修改")){
|
|
|
|
+ //调用修改接口
|
|
|
|
+ qcResultAlgVO.setCasesEntryId(approvedVo.getQcresultDetailId());
|
|
|
|
+ qcresultVO.setOptResultAlgVO(qcResultAlgVO);
|
|
|
|
+ RespDTO<AnalyzeDTO> analyzeDTORespDTO = medAppealExamineInfoServiceClient.updCase(qcresultVO);
|
|
|
|
+ if(analyzeDTORespDTO.data.getIsSuccess()){
|
|
|
|
+ Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
|
+ AppealExamineInfo appealExamineInfo = new AppealExamineInfo();
|
|
|
|
+ appealExamineInfo.setExampleOperation("1");
|
|
|
|
+ appealExamineInfo.setExampleStatus("2");
|
|
|
|
+ appealExamineInfo.setRemark(approvedVo.getRemark());
|
|
|
|
+ appealExamineInfo.setAppealInfoId(approvedVo.getAppealId());
|
|
|
|
+ int appealExamineInfoUpdate = appealExamineInfoFacade.getBaseMapper().update(appealExamineInfo, new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("appeal_info_id", approvedVo.getId())
|
|
|
|
+ .eq("check_id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfo && appealExamineInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("审核通过失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("修改!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtil.isNotEmpty(handling) && handling.equals("新增已有")){
|
|
|
|
+ qcResultAlgVO.setCasesEntryId(approvedVo.getCasesEntryId());
|
|
|
|
+ qcresultVO.setOptResultAlgVO(qcResultAlgVO);
|
|
|
|
+ //判断是否已存在该条目
|
|
|
|
+ MedQcresultDetail qcresultDetail = medQcresultDetailFacade.getBaseMapper().selectOne(new QueryWrapper<MedQcresultDetail>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", approvedVo.getHospitalId())
|
|
|
|
+ .eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
|
+ .eq("cases_entry_id", approvedVo.getCasesEntryId())
|
|
|
|
+ );
|
|
|
|
+ if(qcresultDetail!=null){
|
|
|
|
+ Asserts.fail2("该条目已存在");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ //调用新增接口
|
|
|
|
+ RespDTO<AnalyzeDTO> analyzeDTORespDTO = medAppealExamineInfoServiceClient.addCase(qcresultVO);
|
|
|
|
+ if(analyzeDTORespDTO.data.getIsSuccess()){
|
|
|
|
+ AppealInfo appealInfo = new AppealInfo();
|
|
|
|
+ appealInfo.setCasesEntryId(approvedVo.getCasesEntryId());
|
|
|
|
+ appealInfo.setCasesEntryMsg(approvedVo.getCasesEntryMsg());
|
|
|
|
+ appealInfo.setCasesEntryName(approvedVo.getCasesEntryName());
|
|
|
|
+ appealInfo.setValue(approvedVo.getValue().longValue());
|
|
|
|
+ appealInfo.setWorkFlowNodeId(3L);
|
|
|
|
+ int appealInfoUpdate = appealInfoFacade.getBaseMapper().update(appealInfo, new QueryWrapper<AppealInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", approvedVo.getHospitalId())
|
|
|
|
+ .eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
|
+ .eq("id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ AppealExamineInfo appealExamineInfo = new AppealExamineInfo();
|
|
|
|
+ appealExamineInfo.setExampleOperation("3");
|
|
|
|
+ appealExamineInfo.setExampleStatus("2");
|
|
|
|
+ appealExamineInfo.setRemark(approvedVo.getRemark());
|
|
|
|
+ appealExamineInfo.setAppealInfoId(approvedVo.getAppealId());
|
|
|
|
+ int appealExamineInfoUpdate = appealExamineInfoFacade.getBaseMapper().update(appealExamineInfo, new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("appeal_info_id", approvedVo.getId())
|
|
|
|
+ .eq("check_id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfoUpdate==1 && appealExamineInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("审核通过失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("新增失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtil.isNotEmpty(handling) && handling.equals("恢复")){
|
|
|
|
+ qcResultAlgVO.setCasesEntryId(approvedVo.getQcresultDetailId());
|
|
|
|
+ qcresultVO.setOptResultAlgVO(qcResultAlgVO);
|
|
|
|
+ qcresultVO.setDelStatus(0);
|
|
|
|
+ //调用删除接口
|
|
|
|
+ RespDTO<AnalyzeDTO> analyzeDTORespDTO = medAppealExamineInfoServiceClient.updCase(qcresultVO);
|
|
|
|
+ if(analyzeDTORespDTO.data.getIsSuccess()){
|
|
|
|
+ Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
|
+ AppealExamineInfo appealExamineInfo = new AppealExamineInfo();
|
|
|
|
+ appealExamineInfo.setExampleOperation("5");
|
|
|
|
+ appealExamineInfo.setExampleStatus("2");
|
|
|
|
+ appealExamineInfo.setRemark(approvedVo.getRemark());
|
|
|
|
+ appealExamineInfo.setAppealInfoId(approvedVo.getAppealId());
|
|
|
|
+ int appealExamineInfoUpdate = appealExamineInfoFacade.getBaseMapper().update(appealExamineInfo, new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("appeal_info_id", approvedVo.getId())
|
|
|
|
+ .eq("check_id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfo && appealExamineInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("审核通过失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("恢复失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(StringUtil.isNotEmpty(handling) && handling.equals("新增缺失")){
|
|
|
|
+ qcResultAlgVO.setCasesEntryId(approvedVo.getQcresultDetailId());
|
|
|
|
+ qcresultVO.setOptResultAlgVO(qcResultAlgVO);
|
|
|
|
+ qcresultVO.setDelStatus(0);
|
|
|
|
+ //调用删除接口
|
|
|
|
+ RespDTO<AnalyzeDTO> analyzeDTORespDTO = medAppealExamineInfoServiceClient.updCase(qcresultVO);
|
|
|
|
+ if(analyzeDTORespDTO.data.getIsSuccess()){
|
|
|
|
+ Boolean appealInfo = updateAppealInfo(approvedVo);
|
|
|
|
+ AppealExamineInfo appealExamineInfo = new AppealExamineInfo();
|
|
|
|
+ appealExamineInfo.setExampleOperation("4");
|
|
|
|
+ appealExamineInfo.setExampleStatus("2");
|
|
|
|
+ appealExamineInfo.setProcessResult(approvedVo.getProcessResult());
|
|
|
|
+ appealExamineInfo.setAppealInfoId(approvedVo.getAppealId());
|
|
|
|
+ int appealExamineInfoUpdate = appealExamineInfoFacade.getBaseMapper().update(appealExamineInfo, new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("appeal_info_id", approvedVo.getId())
|
|
|
|
+ .eq("check_id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfo && appealExamineInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("审核通过失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("恢复失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ Asserts.fail2("无此类型处理方式!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 驳回
|
|
|
|
+ * @param rejectedVo
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean rejected(RejectedVo rejectedVo) {
|
|
|
|
+ AppealInfo appealInfo = new AppealInfo();
|
|
|
|
+ appealInfo.setWorkFlowNodeId(3L);
|
|
|
|
+ int appealInfoUpdate = appealInfoFacade.getBaseMapper().update(appealInfo, new QueryWrapper<AppealInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", rejectedVo.getHospitalId())
|
|
|
|
+ .eq("behospital_code", rejectedVo.getBehospitalCode())
|
|
|
|
+ .eq("id", rejectedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ AppealExamineInfo appealExamineInfo = new AppealExamineInfo();
|
|
|
|
+ appealExamineInfo.setExampleOperation("3");
|
|
|
|
+ appealExamineInfo.setExampleStatus("1");
|
|
|
|
+ appealExamineInfo.setRejectReason(rejectedVo.getRejectedReason());
|
|
|
|
+ appealExamineInfo.setAppealInfoId(rejectedVo.getAppealId());
|
|
|
|
+ int appealExamineInfoUpdate = appealExamineInfoFacade.getBaseMapper().update(appealExamineInfo, new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("appeal_info_id", rejectedVo.getId())
|
|
|
|
+ .eq("check_id", rejectedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfoUpdate==1 && appealExamineInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ Asserts.fail2("驳回失败!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取待审核数量
|
|
|
|
+ * @param getAuditNumberVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Integer getAuditNumber(GetAuditNumberVO getAuditNumberVO) {
|
|
|
|
+ Integer count = appealExamineInfoFacade.getBaseMapper().selectCount(new QueryWrapper<AppealExamineInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("check_id", getAuditNumberVO.getId())
|
|
|
|
+ .eq("example_status", 0)
|
|
|
|
+ );
|
|
|
|
+ return count;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 审核查看
|
|
|
|
+ * @param getApprovedViewVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public GetAppealInfoDTO getApprovedView(GetApprovedViewVO getApprovedViewVO) {
|
|
|
|
+ GetAppealInfoVO getAppealInfoVO = new GetAppealInfoVO();
|
|
|
|
+ getAppealInfoVO.setId(getApprovedViewVO.getId());
|
|
|
|
+ getAppealInfoVO.setType(getApprovedViewVO.getType());
|
|
|
|
+ return appealInfoFacade.getBaseMapper().getAppealInfo(getAppealInfoVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Boolean updateAppealInfo (ApprovedVo approvedVo) {
|
|
|
|
+ AppealInfo appealInfo = new AppealInfo();
|
|
|
|
+ appealInfo.setWorkFlowNodeId(3L);
|
|
|
|
+ int appealInfoUpdate = appealInfoFacade.getBaseMapper().update(appealInfo, new QueryWrapper<AppealInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", approvedVo.getHospitalId())
|
|
|
|
+ .eq("behospital_code", approvedVo.getBehospitalCode())
|
|
|
|
+ .eq("id", approvedVo.getAppealId())
|
|
|
|
+ );
|
|
|
|
+ if(appealInfoUpdate==1){
|
|
|
|
+ return true;
|
|
|
|
+ }else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|