From b512f03e1ea30e22209ec5a889d568c45f3e03c9 Mon Sep 17 00:00:00 2001
From: wangwh <2397901735@qq.com>
Date: Fri, 13 Sep 2024 10:41:03 +0800
Subject: [PATCH] 1、删除经办人 2、规范代码
---
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoUnfoldService.java | 96 +++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 94 insertions(+), 2 deletions(-)
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoUnfoldService.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoUnfoldService.java
index abde617..abe9633 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoUnfoldService.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoUnfoldService.java
@@ -3,21 +3,35 @@
import cn.huge.base.common.exception.ServiceException;
import cn.huge.base.common.utils.DateUtils;
import cn.huge.base.common.utils.IdUtils;
+import cn.huge.base.common.utils.ObjectUtils;
+import cn.huge.module.cases.domain.po.CaseAssistApply;
+import cn.huge.module.cases.domain.dto.TransactResultDTO;
+import cn.huge.module.client.api.impl.CustClientImpl;
+import cn.huge.module.client.api.impl.SysClientImpl;
import cn.huge.module.client.api.impl.UtilsClientImpl;
import cn.huge.module.cases.dao.mapper.CaseInfoUnfoldMapper;
import cn.huge.module.cases.domain.po.CaseInfoUnfold;
+import cn.huge.module.cust.dto.CtUserDTO;
+import cn.huge.module.mediate.constant.AuditBaseConstsEnum;
+import cn.huge.module.mediate.constant.CaseBaseConsts;
+import cn.huge.module.mediate.constant.CaseBaseConstsEnum;
+import cn.huge.module.sys.constant.FileOwnerTypeBaseEnum;
+import cn.huge.module.sys.dto.FileIdInfoBaseDTO;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Maps;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Transactional;
-import javax.annotation.PostConstruct;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -39,6 +53,15 @@
@Autowired
private UtilsClientImpl utilsClient;
+
+ @Autowired
+ private CustClientImpl custClient;
+
+ @Autowired
+ private CaseAssistApplyService assistApplyService;
+
+ @Autowired
+ private SysClientImpl sysClient;
/**
* 更新对象
@@ -130,4 +153,73 @@
}
}
+ /**
+ * PC端-选择经办人
+ * @param caseId 对象
+ * @param userId 条件
+ */
+ public void choosePrincipal(String caseId, String userId){
+ try{
+ // 获取当前登录用户
+ CtUserDTO loginUser = custClient.clientGetUserAll(userId);
+ CaseInfoUnfold CaseInfoUnfold = new CaseInfoUnfold();
+ CaseInfoUnfold.setId(caseId);
+ CaseInfoUnfold.setMediatorId(loginUser.getId());
+ CaseInfoUnfold.setMediator(loginUser.getTrueName());
+ CaseInfoUnfold.setMediatorMobile(loginUser.getMobile());
+ mapper.updateCaseInfoUnfold(CaseInfoUnfold);
+ }catch (Exception e){
+ log.error("[CaseInfoUnfoldService.choosePrincipal]调用失败,异常信息:"+e, e);
+ throw new ServiceException("CaseInfoUnfoldService.choosePrincipal", e);
+ }
+ }
+
+ /**
+ * PC端-删除经办人
+ * @param caseId 对象
+ */
+ public void deletePrincipal(String caseId){
+ try{
+ mapper.deletePrincipal(caseId);
+ }catch (Exception e){
+ log.error("[CaseInfoUnfoldService.choosePrincipal]调用失败,异常信息:"+e, e);
+ throw new ServiceException("CaseInfoUnfoldService.choosePrincipal", e);
+ }
+ }
+
+ public TransactResultDTO getTransactResult(String caseId){
+ try {
+ //查询办理结果信息
+ CaseInfoUnfold caseInfoUnfold = this.getById(caseId);
+ if(StringUtils.isNotBlank(caseInfoUnfold.getMediResult())) {
+ TransactResultDTO transactResultDTO = new TransactResultDTO();
+ BeanUtils.copyProperties(caseInfoUnfold, transactResultDTO);
+ if (ObjectUtils.isNotEmpty(transactResultDTO)) {
+ QueryWrapper<CaseAssistApply> caseAssistApplyQueryWrapper = new QueryWrapper<>();
+ caseAssistApplyQueryWrapper.select("apply_assist_unit_name").eq("case_id", caseId).eq("apply_status", 1)
+ .eq("audit_result", AuditBaseConstsEnum.AUDIT_RESULT_1.getIndex());
+ CaseAssistApply caseAssistApply = assistApplyService.getOne(caseAssistApplyQueryWrapper);
+
+ if (ObjectUtils.isNotEmpty(caseAssistApply)) {
+ transactResultDTO.setApplyAssistUnitName(caseAssistApply.getApplyAssistUnitName());
+ }
+ }
+ Map<String, Object> terms = new HashMap<>();
+ terms.put("mainId", caseId);
+ terms.put("ownerIds", "'" + caseId + "'");
+ terms.put("types", "'" + FileOwnerTypeBaseEnum.OWNER_TYPE_302.getIndex() + "'");
+ List<FileIdInfoBaseDTO> fileIdInfoBaseDTOList = sysClient.listIdInfoByOwnerIdList(terms);
+ if (ObjectUtils.isNotEmpty(fileIdInfoBaseDTOList)) {
+ transactResultDTO.setFileInfoBaseDTOList(fileIdInfoBaseDTOList.get(0).getFileList());
+ }
+ return transactResultDTO;
+ }else {
+ return null;
+ }
+ }catch (Exception e){
+ log.error("[CaseInfoUnfoldService.getTransactResult]调用失败,异常信息:"+e, e);
+ throw new ServiceException("CaseInfoUnfoldService.getTransactResult", e);
+ }
+ }
+
}
--
Gitblit v1.8.0