|
|
|
@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
import com.supervision.constant.CaseAnalysisStatusEnum;
|
|
|
|
|
import com.supervision.constant.CaseDataStatusEnum;
|
|
|
|
|
import com.supervision.constant.ScoreEnum;
|
|
|
|
|
import com.supervision.police.domain.CasePerson;
|
|
|
|
|
import com.supervision.police.domain.ModelCase;
|
|
|
|
|
import com.supervision.police.domain.NoteRecord;
|
|
|
|
|
import com.supervision.police.mapper.CasePersonMapper;
|
|
|
|
|
import com.supervision.police.mapper.ModelCaseMapper;
|
|
|
|
|
import com.supervision.police.mapper.NoteRecordMapper;
|
|
|
|
|
import com.supervision.police.service.CaseStatusManageService;
|
|
|
|
@ -16,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
@ -27,31 +31,23 @@ public class CaseStatusManageServiceImpl implements CaseStatusManageService {
|
|
|
|
|
|
|
|
|
|
private final NoteRecordMapper noteRecordMapper;
|
|
|
|
|
|
|
|
|
|
private final CasePersonMapper casePersonMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void whenSaveCasePeople(String caseId, String roleId) {
|
|
|
|
|
public void whenSaveCasePeople(String caseId, CasePerson casePerson) {
|
|
|
|
|
Assert.notEmpty(caseId, "案件id不能为空");
|
|
|
|
|
Assert.notEmpty(roleId, "角色id不能为空");
|
|
|
|
|
|
|
|
|
|
// 只处理行为人的角色类型
|
|
|
|
|
if (!"1".equals(roleId)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Assert.notEmpty(casePerson.getRoleCode(), "角色id不能为空");
|
|
|
|
|
|
|
|
|
|
ModelCase modelCase = modelCaseMapper.selectById(caseId);
|
|
|
|
|
Assert.notNull(modelCase,"案件信息不存在");
|
|
|
|
|
|
|
|
|
|
if (0 != modelCase.getCaseDataStatus()){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 查看是否有笔录
|
|
|
|
|
Long count = noteRecordMapper.selectCount(
|
|
|
|
|
new LambdaQueryWrapper<>(new NoteRecord())
|
|
|
|
|
.eq(NoteRecord::getCaseId, caseId).eq(NoteRecord::getRole, roleId));
|
|
|
|
|
if ("1".equals(casePerson.getRoleCode())){
|
|
|
|
|
List<CasePerson> casePersonList = casePersonMapper.selectList(
|
|
|
|
|
new LambdaQueryWrapper<CasePerson>().eq(CasePerson::getCaseId, caseId).eq(CasePerson::getRoleCode, "1"));
|
|
|
|
|
String lawActor = casePersonList.stream().map(CasePerson::getName).collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
|
|
if (count > 0){
|
|
|
|
|
modelCaseMapper.update(new LambdaUpdateWrapper<ModelCase>()
|
|
|
|
|
.eq(ModelCase::getId, caseId)
|
|
|
|
|
.set(ModelCase::getCaseDataStatus, CaseDataStatusEnum.UPDATE.getCode()));
|
|
|
|
|
.eq(ModelCase::getId, caseId).set(ModelCase::getLawActor, lawActor));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,9 +58,18 @@ public class CaseStatusManageServiceImpl implements CaseStatusManageService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void whenUploadRecord(String caseId) {
|
|
|
|
|
modelCaseMapper.update(new LambdaUpdateWrapper<ModelCase>()
|
|
|
|
|
.eq(ModelCase::getId, caseId)
|
|
|
|
|
.set(ModelCase::getCaseDataStatus, CaseDataStatusEnum.UPDATE.getCode()));
|
|
|
|
|
// 存在行为人的笔录信息
|
|
|
|
|
Long count = noteRecordMapper.selectCount(
|
|
|
|
|
new LambdaQueryWrapper<>(new NoteRecord())
|
|
|
|
|
.eq(NoteRecord::getCaseId, caseId).eq(NoteRecord::getRole,"行为人"));
|
|
|
|
|
|
|
|
|
|
if (count > 0){
|
|
|
|
|
modelCaseMapper.update(new LambdaUpdateWrapper<ModelCase>()
|
|
|
|
|
.eq(ModelCase::getId, caseId)
|
|
|
|
|
.set(ModelCase::getCaseDataStatus, CaseDataStatusEnum.UPDATE.getCode())
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|