forked from gzzfw/backEnd/gz-dyh

wangwh
2024-09-29 a903065d0a865deec05f1e53f9c096c5e931f786
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseReturnService.java
@@ -4,22 +4,20 @@
import cn.huge.base.common.utils.DateUtils;
import cn.huge.base.common.utils.IdUtils;
import cn.huge.module.cases.domain.dto.FrontPageListDTO;
import cn.huge.module.cases.domain.po.CaseWindupApply;
import cn.huge.module.client.api.impl.UtilsClientImpl;
import cn.huge.module.cases.dao.mapper.CaseReturnMapper;
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;
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.List;
import java.util.Map;
@@ -150,6 +148,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