From 1bb06ff92767a2c6db534dc1e78cb2d2d9dcf65c Mon Sep 17 00:00:00 2001
From: zhouxiantao <1026371446@qq.com>
Date: Wed, 11 Sep 2024 12:53:38 +0800
Subject: [PATCH] 小程序来访登记,异常抛出

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoUnfoldService.java |   51 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 31 insertions(+), 20 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 b48fc15..090f220 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
@@ -15,10 +15,12 @@
 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;
@@ -173,29 +175,38 @@
     }
 
     public TransactResultDTO getTransactResult(String caseId){
-        //查询办理结果信息
-        CaseInfoUnfold caseInfoUnfold = this.getById(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);
 
-        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());
+                    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);
         }
-        Map<String, Object> terms = new HashMap<>();
-        terms.put("mainId", caseId);
-        terms.put("ownerIds", "'"+caseId+"'");
-        List<FileIdInfoBaseDTO> fileIdInfoBaseDTOList = sysClient.listIdInfoByOwnerIdList(terms);
-        if(ObjectUtils.isNotEmpty(fileIdInfoBaseDTOList)){
-            transactResultDTO.setFileInfoBaseDTOList(fileIdInfoBaseDTOList.get(0).getFileList());
-        }
-        return transactResultDTO;
     }
 
 }

--
Gitblit v1.8.0