|
|
|
|
@ -23,10 +23,8 @@ import java.time.LocalDate;
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.Month; |
|
|
|
|
import java.time.ZoneId; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; |
|
|
|
|
|
|
|
|
|
@ -106,6 +104,7 @@ public class Job {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private final DwdAsjZfbaShrxx2Service dwdAsjZfbaShrxx2Service; |
|
|
|
|
private final DwdAsjZfbaShrxxService dwdAsjZfbaShrxxService; |
|
|
|
|
private final RpcApplyService rpcApplyService; |
|
|
|
|
private final SupPoliceService policeService; |
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
@ -116,6 +115,7 @@ public class Job {
|
|
|
|
|
private final RpcInfringerResultService rpcInfringerResultService; |
|
|
|
|
private final DwdRyZfbaBaryxxService dwdRyZfbaBaryxxService; |
|
|
|
|
private final RpcApplySuperviseService rpcApplySuperviseService; |
|
|
|
|
private final TXsshrxxbService tXsshrxxbService; |
|
|
|
|
// 每天一次 23:30:00
|
|
|
|
|
//todo 维权信息
|
|
|
|
|
@Scheduled(cron = "0 30 23 * * ?") |
|
|
|
|
@ -127,9 +127,21 @@ public class Job {
|
|
|
|
|
Date startTime = sdf.parse("2025-01-01 00:00:00"); |
|
|
|
|
Date endTime = sdf.parse("2025-12-30 00:00:00"); |
|
|
|
|
|
|
|
|
|
List<DwdAsjZfbaShrxx2> shrxxList = dwdAsjZfbaShrxx2Service.list(startTime,endTime); |
|
|
|
|
List<DwdAsjZfbaShrxx> shrxxList = dwdAsjZfbaShrxxService.list(startTime,endTime); |
|
|
|
|
if(CollectionUtil.isEmpty(shrxxList)){ |
|
|
|
|
log.info("时间范围内无受害人信息"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.info("数据:{}条", shrxxList.size()); |
|
|
|
|
shrxxList.forEach(item -> { |
|
|
|
|
|
|
|
|
|
List<String> zjList = shrxxList.stream().map(s->s.getZj()).toList(); |
|
|
|
|
List<TXsshrxxb> tXsshrxxbs = tXsshrxxbService.getListAllByZjs(zjList); |
|
|
|
|
if(CollectionUtil.isEmpty(tXsshrxxbs)){ |
|
|
|
|
log.info("未找到受伤民辅警"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
tXsshrxxbs.forEach(item -> { |
|
|
|
|
RpcApplySupervise rpcApply = new RpcApplySupervise(); |
|
|
|
|
rpcApply.setRpcId(item.getZj()); |
|
|
|
|
rpcApply.setCrtTime(LocalDateTime.now()); |
|
|
|
|
@ -140,19 +152,13 @@ public class Job {
|
|
|
|
|
if (Objects.nonNull(item.getShrq())) { |
|
|
|
|
rpcApply.setHappenTime(item.getShrq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 案件编号
|
|
|
|
|
rpcApply.setCaseNumber(item.getAjbh()); |
|
|
|
|
// 受害人警号
|
|
|
|
|
SupPolice police = policeService.getByIdCode(item.getGmsfhm()); |
|
|
|
|
|
|
|
|
|
if (Objects.nonNull(police)) { |
|
|
|
|
// 警号
|
|
|
|
|
rpcApply.setApplicantEmpNo(police.getEmpNo()); |
|
|
|
|
// //警员身份
|
|
|
|
|
// SupDepart depart = departService.getById(police.getOrgId());
|
|
|
|
|
// rpcApply.setDepartId(depart.getId());
|
|
|
|
|
// rpcApply.setDepartId(depart.getName());
|
|
|
|
|
} |
|
|
|
|
if (StrUtil.isNotBlank(item.getAjbh())) { |
|
|
|
|
DwdAsjZfbaAjjbxx ajjbxx = dwdAsjZfbaAjjbxxMapper.selectByAjbh(item.getAjbh()); |
|
|
|
|
@ -186,28 +192,33 @@ public class Job {
|
|
|
|
|
rpcApply.setDepartName(supDepart.getShortName()); |
|
|
|
|
} |
|
|
|
|
//获取二级单位的信息
|
|
|
|
|
String StatisticsGroupName = null; |
|
|
|
|
//判断是否为非长沙市公安局
|
|
|
|
|
if(!unitName.contains("长沙市公安局")){ |
|
|
|
|
//非长沙市公安局
|
|
|
|
|
String[] deptsData = ajjbxx.getBadwidmc().split("局"); |
|
|
|
|
if(deptsData.length > 0){ |
|
|
|
|
String[] depts =deptsData[0].split("省"); |
|
|
|
|
if(depts.length > 0){ |
|
|
|
|
StatisticsGroupName="湖南省长沙市公安局" + depts[1]+"局"; |
|
|
|
|
}else{ |
|
|
|
|
log.info("无法分割‘省’"); |
|
|
|
|
String statisticsGroupName = null; |
|
|
|
|
final String CHANGSHA_POLICE = "长沙市公安局"; |
|
|
|
|
// 判断是否为非长沙市公安局
|
|
|
|
|
if (unitName != null && !unitName.contains(CHANGSHA_POLICE)) { |
|
|
|
|
// 非长沙市公安局
|
|
|
|
|
String badwidmc = ajjbxx.getBadwidmc(); |
|
|
|
|
if (badwidmc != null && !badwidmc.isEmpty()) { |
|
|
|
|
// 优化字符串处理,使用indexOf代替split以提高性能
|
|
|
|
|
int juIndex = badwidmc.indexOf('局'); |
|
|
|
|
if (juIndex > 0) { |
|
|
|
|
String beforeJu = badwidmc.substring(0, juIndex); |
|
|
|
|
int shengIndex = beforeJu.indexOf('省'); |
|
|
|
|
if (shengIndex > 0 && shengIndex < beforeJu.length() - 1) { |
|
|
|
|
String afterSheng = beforeJu.substring(shengIndex + 1); |
|
|
|
|
statisticsGroupName = "湖南省长沙市公安局" + afterSheng + "局"; |
|
|
|
|
} else { |
|
|
|
|
log.info("无法分割'省'或'省'后没有有效内容: {}", beforeJu); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.info("无法在{}中找到'局'字", badwidmc); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
log.info("无法分割‘局’"); |
|
|
|
|
} else { |
|
|
|
|
log.info("获取到的办案单位名称为空或null"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
//长沙市公安局
|
|
|
|
|
StatisticsGroupName ="长沙市公安局"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SupDepart groupDept= supDepartMapper.selectOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getName,StatisticsGroupName)); |
|
|
|
|
SupDepart groupDept= supDepartMapper.selectOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getName,statisticsGroupName)); |
|
|
|
|
if(ObjectUtil.isNotEmpty(groupDept)){ |
|
|
|
|
rpcApply.setSecondDepartId(groupDept.getId()); |
|
|
|
|
} |
|
|
|
|
@ -237,9 +248,9 @@ public class Job {
|
|
|
|
|
RpcApplyPerson rpcApplyPerson= new RpcApplyPerson(); |
|
|
|
|
rpcApplyPerson.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); |
|
|
|
|
//受伤程度屏蔽
|
|
|
|
|
if(StrUtil.isNotBlank(item.getShcdmc())){ |
|
|
|
|
rpcApplyPerson.setInjurySeverity(item.getShcdmc()); |
|
|
|
|
} |
|
|
|
|
// if(StrUtil.isNotBlank(item.getShcdmc())){
|
|
|
|
|
// rpcApplyPerson.setInjurySeverity(item.getShcdmc());
|
|
|
|
|
// }
|
|
|
|
|
rpcApplyPerson.setCreatTime(LocalDateTime.now()); |
|
|
|
|
rpcApplyPerson.setUdpTime(LocalDateTime.now()); |
|
|
|
|
rpcApplyPerson.setId(IdUtil.fastSimpleUUID()); |
|
|
|
|
@ -249,11 +260,9 @@ public class Job {
|
|
|
|
|
// rpcApplyPerson.setFormsOfTort(item.getShxsmc());
|
|
|
|
|
rpcApplyPerson.setEmpName(item.getXm()); |
|
|
|
|
if(StrUtil.isNotEmpty(item.getXbmc())){ |
|
|
|
|
rpcApplyPerson.setGender( item.getXbmc().split("性")[0]); |
|
|
|
|
rpcApplyPerson.setGender("1".equals(item.getXbmc())?"男":"女"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SupPolice policeData = policeService.getByIdCode(item.getGmsfhm()); |
|
|
|
|
// rpcApplyPerson.setEmpNo(item.get);
|
|
|
|
|
if(Objects.nonNull(police)){ |
|
|
|
|
rpcApply.setApplicantEmpNo(police.getEmpNo()); |
|
|
|
|
} |
|
|
|
|
|