|
@@ -3,12 +3,18 @@ package com.lantone.report.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
+import com.lantone.common.dto.appeal.GetAppealInfoDTO;
|
|
|
import com.lantone.common.dto.appeal.GetReviewerDTO;
|
|
|
import com.lantone.common.enums.IsDeleteEnum;
|
|
|
import com.lantone.common.exception.Asserts;
|
|
|
import com.lantone.common.util.DateUtil;
|
|
|
import com.lantone.common.util.ListUtil;
|
|
|
+import com.lantone.common.util.MapUtil;
|
|
|
import com.lantone.common.vo.appeal.AddAppealInfoVO;
|
|
|
+import com.lantone.common.vo.appeal.CancelAppealInfoVO;
|
|
|
+import com.lantone.common.vo.appeal.GetAppealInfoVO;
|
|
|
+import com.lantone.common.vo.appeal.GetAppealOperationTypeVO;
|
|
|
import com.lantone.common.vo.appeal.GetReviewerVO;
|
|
|
import com.lantone.common.vo.appeal.MedAppealInfoVO;
|
|
|
import com.lantone.dblayermbg.entity.appeal.AppealExamineInfo;
|
|
@@ -20,6 +26,8 @@ import com.lantone.dblayermbg.facade.appeal.AppealInfoFacade;
|
|
|
import com.lantone.dblayermbg.facade.appeal.QcresultDetailFacade2;
|
|
|
import com.lantone.dblayermbg.facade.appeal.SysUserRoleFacade2;
|
|
|
import com.lantone.dblayermbg.facade.appeal.WorkFlowNodeFacade;
|
|
|
+import com.lantone.report.enums.AppealOperationTypeEnum;
|
|
|
+import com.lantone.report.enums.ExampleStatusEnum;
|
|
|
import com.lantone.report.enums.WorkFlowNodeEnum;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -27,6 +35,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:申诉审核管理
|
|
@@ -72,7 +81,7 @@ public class MedAppealInfoManagementFacade {
|
|
|
return addAppealInfoAndExamineInfo(addAppealInfoVO);
|
|
|
}
|
|
|
//获取申诉记录当前节点状态(1:申诉|2:撤销|3:科室审核)
|
|
|
- if (WorkFlowNodeEnum.APPEAL.getKey().equals(addAppealInfoVO.getWorkFlowNodeId()+"")) {
|
|
|
+ if (WorkFlowNodeEnum.APPEAL.getKey().equals(addAppealInfoVO.getWorkFlowNodeId() + "")) {
|
|
|
Asserts.fail2("该缺陷已被申诉");
|
|
|
} else {
|
|
|
//删除申诉记录
|
|
@@ -115,7 +124,7 @@ public class MedAppealInfoManagementFacade {
|
|
|
return addAppealInfoAndExamineInfo(addAppealInfoVO);
|
|
|
}
|
|
|
//获取申诉记录当前节点状态(1:申诉|2:撤销|3:科室审核)
|
|
|
- if (WorkFlowNodeEnum.APPEAL.getKey().equals(addAppealInfoVO.getWorkFlowNodeId()+"")) {
|
|
|
+ if (WorkFlowNodeEnum.APPEAL.getKey().equals(addAppealInfoVO.getWorkFlowNodeId() + "")) {
|
|
|
Asserts.fail2("该缺陷已被申诉");
|
|
|
} else {
|
|
|
//删除申诉记录
|
|
@@ -204,19 +213,100 @@ public class MedAppealInfoManagementFacade {
|
|
|
if (ListUtil.isEmpty(appealInfos)) {
|
|
|
return reviewers;
|
|
|
}
|
|
|
+ List<GetReviewerDTO> temp = new ArrayList<>(reviewers);
|
|
|
if (ListUtil.isNotEmpty(reviewers)) {
|
|
|
List<GetReviewerDTO> out = new ArrayList<>();
|
|
|
for (AppealInfo appealInfo : appealInfos) {
|
|
|
for (GetReviewerDTO getReviewerDTO : reviewers) {
|
|
|
- if (getReviewerDTO.getId().equals(appealInfo.getClaimantId())) {
|
|
|
+ if (getReviewerDTO.getId().intValue() == appealInfo.getCheckId().intValue()) {
|
|
|
out.add(getReviewerDTO);
|
|
|
- reviewers.remove(getReviewerDTO);
|
|
|
+ temp.remove(getReviewerDTO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- out.addAll(reviewers);
|
|
|
+ out.addAll(temp);
|
|
|
return out;
|
|
|
}
|
|
|
return reviewers;
|
|
|
}
|
|
|
+
|
|
|
+ public Map<String, String> getAppealOperationType(GetAppealOperationTypeVO getAppealOperationTypeVO) {
|
|
|
+ Map<String, String> out = Maps.newHashMap();
|
|
|
+ //通过缺陷id获取缺陷
|
|
|
+ QcresultDetail qcresultDetail = qcresultDetailFacade.getById(getAppealOperationTypeVO.getQcresultDetailId());
|
|
|
+ switch (getAppealOperationTypeVO.getAppealOperationType()) {
|
|
|
+ case "0":
|
|
|
+ if (qcresultDetail == null) {
|
|
|
+ Asserts.fail2("质控缺陷条目不存在");
|
|
|
+ }
|
|
|
+ if (IsDeleteEnum.N.getKey().equals(qcresultDetail.getIsDeleted())) {
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.UP_OR_DEL.getKey());
|
|
|
+ } else {
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.RECOVER.getKey());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "1":
|
|
|
+ if (ExampleStatusEnum.ADOPT_EXAMPLE.getKey().equals(getAppealOperationTypeVO.getExampleStatus())) {
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.UP_OR_DEL.getKey());
|
|
|
+ } else {
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.ADD_EXIST.getKey());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.ADD_NO_EXIST.getKey());
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ if (ExampleStatusEnum.ADOPT_EXAMPLE.getKey().equals(getAppealOperationTypeVO.getExampleStatus())) {
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.UP_OR_DEL.getKey());
|
|
|
+ } else {
|
|
|
+ out.put("appealOperationType", AppealOperationTypeEnum.RECOVER.getKey());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ Asserts.fail2("申诉操作类型不存在");
|
|
|
+ }
|
|
|
+ return out;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param cancelAppealInfoVO
|
|
|
+ * @Description撤销申诉
|
|
|
+ * @Return java.lang.Boolean
|
|
|
+ */
|
|
|
+ public Boolean cancelAppealInfo(CancelAppealInfoVO cancelAppealInfoVO) {
|
|
|
+ //获取申诉记录
|
|
|
+ AppealInfo appealInfo = appealInfoFacade.getById(cancelAppealInfoVO.getId());
|
|
|
+ if (appealInfo == null) {
|
|
|
+ Asserts.fail2("撤回申诉条目不存在");
|
|
|
+ }
|
|
|
+ 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())
|
|
|
+ .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"));
|
|
|
+ //逻辑删除该申诉(撤回)
|
|
|
+ appealInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
|
|
|
+ appealInfo.setWorkFlowNodeId(cancelAppealInfoVO.getWorkFlowNodeId());
|
|
|
+ appealInfo.setGmtModified(DateUtil.now());
|
|
|
+ Boolean out = appealInfoFacade.updateById(appealInfo);
|
|
|
+ //存在历史记录还原最后一条
|
|
|
+ if (ListUtil.isNotEmpty(appealInfoHistory)) {
|
|
|
+ AppealInfo appealInfoOld = appealInfoHistory.get(0);
|
|
|
+ appealInfoOld.setIsDeleted(IsDeleteEnum.N.getKey());
|
|
|
+ return appealInfoFacade.saveOrUpdate(appealInfoOld);
|
|
|
+ }
|
|
|
+ return out;
|
|
|
+ } else {
|
|
|
+ Asserts.fail2("撤回申诉条目状态不是申诉状态");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ public GetAppealInfoDTO getAppealInfo(GetAppealInfoVO getAppealInfoVO) {
|
|
|
+ return appealInfoFacade.getBaseMapper().getAppealInfo(getAppealInfoVO);
|
|
|
+ }
|
|
|
}
|