|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.supervision.police.service.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
@ -13,12 +14,14 @@ import com.supervision.police.mapper.CasePersonMapper;
|
|
|
|
|
import com.supervision.police.mapper.ModelCaseMapper;
|
|
|
|
|
import com.supervision.police.mapper.NoteRecordMapper;
|
|
|
|
|
import com.supervision.police.service.CaseStatusManageService;
|
|
|
|
|
import com.supervision.police.service.ComDictionaryService;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@ -33,6 +36,8 @@ public class CaseStatusManageServiceImpl implements CaseStatusManageService {
|
|
|
|
|
|
|
|
|
|
private final CasePersonMapper casePersonMapper;
|
|
|
|
|
|
|
|
|
|
private final ComDictionaryService dictionaryService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void whenSaveCasePeople(String caseId, CasePerson casePerson) {
|
|
|
|
|
Assert.notEmpty(caseId, "案件id不能为空");
|
|
|
|
@ -66,10 +71,16 @@ public class CaseStatusManageServiceImpl implements CaseStatusManageService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void whenUploadRecord(String caseId) {
|
|
|
|
|
Map<String, String> caseRoleMap = dictionaryService.getDictionaryMap("case_role");
|
|
|
|
|
List<String> list = caseRoleMap.entrySet().stream().filter(entry -> "行为人".equals(entry.getValue())).map(Map.Entry::getKey).toList();
|
|
|
|
|
if (CollUtil.isEmpty(list)){
|
|
|
|
|
log.info("不存在行为人,不更新案件数据");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 存在行为人的笔录信息
|
|
|
|
|
Long count = noteRecordMapper.selectCount(
|
|
|
|
|
new LambdaQueryWrapper<>(new NoteRecord())
|
|
|
|
|
.eq(NoteRecord::getCaseId, caseId).eq(NoteRecord::getRole,"行为人"));
|
|
|
|
|
.eq(NoteRecord::getCaseId, caseId).eq(NoteRecord::getRole,list.get(0)));
|
|
|
|
|
|
|
|
|
|
if (count > 0){
|
|
|
|
|
modelCaseMapper.update(new LambdaUpdateWrapper<ModelCase>()
|
|
|
|
|