|
|
|
@ -2,16 +2,21 @@ package com.supervision.demo;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import cn.hutool.poi.excel.ExcelReader;
|
|
|
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.supervision.police.domain.CasePerson;
|
|
|
|
|
import com.supervision.police.domain.ModelAtomicIndex;
|
|
|
|
|
import com.supervision.police.domain.ModelIndex;
|
|
|
|
|
import com.supervision.police.domain.NoteRecord;
|
|
|
|
|
import com.supervision.police.dto.AtomicData;
|
|
|
|
|
import com.supervision.police.dto.JudgeLogic;
|
|
|
|
|
import com.supervision.police.mapper.CasePersonMapper;
|
|
|
|
|
import com.supervision.police.mapper.ModelAtomicIndexMapper;
|
|
|
|
|
import com.supervision.police.mapper.ModelIndexMapper;
|
|
|
|
|
import com.supervision.police.mapper.NoteRecordMapper;
|
|
|
|
|
import com.supervision.police.mybatis.RowSqlMapper;
|
|
|
|
|
import com.supervision.police.service.ModelIndexAtomicRelationService;
|
|
|
|
|
import lombok.Data;
|
|
|
|
@ -42,6 +47,12 @@ public class ModelIndexTest {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private RowSqlMapper rowSqlMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private NoteRecordMapper noteRecordMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private CasePersonMapper casePersonMapper;
|
|
|
|
|
//@Test
|
|
|
|
|
public void modelIndexGenerate() {
|
|
|
|
|
|
|
|
|
@ -64,6 +75,44 @@ public class ModelIndexTest {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成案件人员脚本
|
|
|
|
|
*/
|
|
|
|
|
//@Test
|
|
|
|
|
public void recordPersonGenerate() {
|
|
|
|
|
|
|
|
|
|
List<NoteRecord> noteRecords = noteRecordMapper.selectList(new LambdaQueryWrapper<>());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<CasePerson> casePersonList = casePersonMapper.selectList(new LambdaQueryWrapper<>());
|
|
|
|
|
|
|
|
|
|
Map<String, Map<String, List<CasePerson>>> collect = casePersonList.stream().collect(Collectors.groupingBy(CasePerson::getCaseId, Collectors.groupingBy(CasePerson::getName)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (NoteRecord noteRecord : noteRecords) {
|
|
|
|
|
if (StrUtil.isNotEmpty(noteRecord.getCasePersonId())){
|
|
|
|
|
log.info("casePersonId is not null continue ..");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(noteRecord.getName())){
|
|
|
|
|
log.info("Name is null stop next opt");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, List<CasePerson>> stringListMap = collect.get(noteRecord.getCaseId());
|
|
|
|
|
|
|
|
|
|
List<CasePerson> casePersonList1 = stringListMap.get(noteRecord.getName());
|
|
|
|
|
if (CollUtil.isNotEmpty(casePersonList1)){
|
|
|
|
|
casePersonList1.forEach(casePerson -> {
|
|
|
|
|
noteRecord.setCasePersonId(casePerson.getId());
|
|
|
|
|
noteRecordMapper.updateById(noteRecord);
|
|
|
|
|
});
|
|
|
|
|
}else {
|
|
|
|
|
log.info("casePersonList is null stop next opt");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void modelAtomicIndexGenerate() {
|
|
|
|
|
|
|
|
|
|