forked from gzzfw/backEnd/gz-dyh

liyj
2024-09-15 63e6c990e5bfd5c48b1abfeb273a500b783e7fa7
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseReturnService.java
@@ -10,6 +10,7 @@
import cn.huge.module.cases.domain.po.CaseReturn;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
@@ -150,6 +151,27 @@
    }
    /**
     * 根据纠纷编号查询最新的一条
     * @param caseId 纠纷编号
     * @return
     */
    public CaseReturn getNewByCaseId(String caseId, int caseTaskType){
        try{
            QueryWrapper<CaseReturn> caseReturnQueryWrapper = new QueryWrapper<>();
            caseReturnQueryWrapper.eq("case_id", caseId).eq("case_task_type", caseTaskType).orderByDesc("return_time");
            List<CaseReturn> caseReturnList = mapper.selectList(caseReturnQueryWrapper);
            if (CollectionUtils.isNotEmpty(caseReturnList)) {
                return caseReturnList.get(0);
            }else {
                return null;
            }
        }catch (Exception e){
            log.error("[CaseReturnService.getByCaseId]调用失败,异常信息:"+e, e);
            throw new ServiceException("CaseReturnService.getByCaseId", e);
        }
    }
    /**
     * 首页查询
     * @param auditUnitId 审核组织编号
     * @return long