forked from gzzfw/backEnd/gz-dyh

wangwh
2024-10-08 fb7dcd20fbde955782f33909f1d2d9c39b48afc0
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseAssistApplyService.java
@@ -3,6 +3,7 @@
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.consts.CaseTaskConsts;
import cn.huge.module.cases.domain.dto.FrontPageListDTO;
import cn.huge.module.cases.domain.po.*;
@@ -11,7 +12,6 @@
import cn.huge.module.client.api.impl.UtilsClientImpl;
import cn.huge.module.cases.dao.mapper.CaseAssistApplyMapper;
import cn.huge.module.constant.BaseConsts;
import cn.huge.module.cust.constant.UserBaseConsts;
import cn.huge.module.cust.dto.CtUnitDTO;
import cn.huge.module.cust.dto.CtUserDTO;
import cn.huge.module.flow.consts.FlowableConsts;
@@ -34,7 +34,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * @title: 联合处置申请信息表业务逻辑处理
@@ -312,26 +311,27 @@
    /**
     * 根据案件编号查询联合处置申请
     * @param caseId 条件
     * @param id 主键编号
     * @return long
     */
    public CaseAssistApply caseAssistApplyByCaseId(String caseId){
    public CaseAssistApply caseAssistApplyById(String id){
        try {
            QueryWrapper<CaseAssistApply> caseAssistApplyQueryWrapper = new QueryWrapper<>();
            caseAssistApplyQueryWrapper.eq("case_id", caseId).eq("apply_status", 0)
                    .orderByDesc("create_time");
            caseAssistApplyQueryWrapper.eq("id", id);
            CaseAssistApply caseAssistApply = mapper.selectOne(caseAssistApplyQueryWrapper);
            Map<String, Object> terms = new HashMap<>();
            terms.put("mainId", caseId);
            terms.put("ownerIds", "'" + caseAssistApply.getId() + "'");
            List<FileIdInfoBaseDTO> fileIdInfoBaseDTOList = sysClient.listIdInfoByOwnerIdList(terms);
            if (CollectionUtils.isNotEmpty(fileIdInfoBaseDTOList)) {
                caseAssistApply.setFileInfoBaseDTOList(fileIdInfoBaseDTOList.get(0).getFileList());
            if(ObjectUtils.isNotEmpty(caseAssistApply)){
                Map<String, Object> terms = new HashMap<>();
                terms.put("mainId", caseAssistApply.getCaseId());
                terms.put("ownerIds", "'" + caseAssistApply.getId() + "'");
                List<FileIdInfoBaseDTO> fileIdInfoBaseDTOList = sysClient.listIdInfoByOwnerIdList(terms);
                if (CollectionUtils.isNotEmpty(fileIdInfoBaseDTOList)) {
                    caseAssistApply.setFileInfoBaseDTOList(fileIdInfoBaseDTOList.get(0).getFileList());
                }
            }
            return caseAssistApply;
        }catch(Exception e ){
            log.error("[CaseAssistApplyService.caseAssistApplyByCaseId]调用失败,异常信息:"+e, e);
            throw new ServiceException("CaseAssistApplyService.caseAssistApplyByCaseId", e);
            log.error("[CaseAssistApplyService.caseAssistApplyById]调用失败,异常信息:"+e, e);
            throw new ServiceException("CaseAssistApplyService.caseAssistApplyById", e);
        }
    }