|
|
|
package com.supervision.police.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.supervision.police.domain.ModelCase;
|
|
|
|
import com.supervision.police.domain.TaskCaseRecord;
|
|
|
|
import com.supervision.police.dto.AnalyseCaseDTO;
|
|
|
|
import com.supervision.police.dto.CaseProcessDTO;
|
|
|
|
import com.supervision.police.service.*;
|
|
|
|
import com.supervision.police.vo.CaseProcessReqVO;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@Service
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
public class MroServiceImpl implements MroService {
|
|
|
|
|
|
|
|
private final ModelCaseService modelCaseService;
|
|
|
|
|
|
|
|
private final ModelService modelService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IPage<CaseProcessDTO> queryCaseList(CaseProcessReqVO caseProcessReqVO, Integer page, Integer size) {
|
|
|
|
|
|
|
|
Page<ModelCase> paged = modelCaseService.lambdaQuery()
|
|
|
|
.like(StrUtil.isNotEmpty(caseProcessReqVO.getCaseName()), ModelCase::getCaseName, caseProcessReqVO.getCaseName())
|
|
|
|
.in(CollUtil.isNotEmpty(caseProcessReqVO.getIdentifyResult()), ModelCase::getIdentifyResult, caseProcessReqVO.getIdentifyResult())
|
|
|
|
.in(CollUtil.isNotEmpty(caseProcessReqVO.getAnalysisStatus()), ModelCase::getCaseAnalysisStatus, caseProcessReqVO.getAnalysisStatus())
|
|
|
|
.orderBy(true, StrUtil.equalsIgnoreCase(caseProcessReqVO.getSort(), "desc"), ModelCase::getCaseAnalysisSuccessTime)
|
|
|
|
.page(Page.of(page, size));
|
|
|
|
return paged.convert(CaseProcessDTO::new);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void analysisCase(List<String> caseIds) {
|
|
|
|
|
|
|
|
Assert.notEmpty(caseIds, "案件id不能为空!");
|
|
|
|
List<ModelCase> modelCases = modelCaseService.listByIds(caseIds);
|
|
|
|
Assert.notEmpty(modelCases, "案件不存在!");
|
|
|
|
|
|
|
|
for (ModelCase modelCase : modelCases) {
|
|
|
|
int caseAnalysisStatus = modelCase.getCaseAnalysisStatus();
|
|
|
|
if (1 == caseAnalysisStatus) {
|
|
|
|
log.info("案件【{}】正在分析中,跳过", modelCase.getCaseName());
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
AnalyseCaseDTO analyseCaseDTO = new AnalyseCaseDTO();
|
|
|
|
analyseCaseDTO.setCaseId(modelCase.getId());
|
|
|
|
modelService.analyseCaseWrapper(analyseCaseDTO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|