|
|
|
@ -1,14 +1,20 @@ |
|
|
|
package com.biutag.supervision.job; |
|
|
|
package com.biutag.supervision.job; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.constants.enums.ComfortStatus; |
|
|
|
import com.biutag.supervision.constants.enums.ProcessingStatusEnum; |
|
|
|
import com.biutag.supervision.constants.enums.ProcessingStatusEnum; |
|
|
|
import com.biutag.supervision.pojo.entity.Negative; |
|
|
|
import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; |
|
|
|
import com.biutag.supervision.service.BusinessDepartService; |
|
|
|
import com.biutag.supervision.mapper.DwdAsjZfbaAjjbxxMapper; |
|
|
|
import com.biutag.supervision.service.BusinessPoliceService; |
|
|
|
import com.biutag.supervision.mapper.DwdAsjZfbaWfrwfxxMapper; |
|
|
|
import com.biutag.supervision.service.MailService; |
|
|
|
import com.biutag.supervision.mapper.RpcInfringerResultMapper; |
|
|
|
import com.biutag.supervision.service.NegativeService; |
|
|
|
import com.biutag.supervision.mapper.SupDepartMapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.*; |
|
|
|
|
|
|
|
import com.biutag.supervision.service.*; |
|
|
|
import com.biutag.supervision.util.TimeUtil; |
|
|
|
import com.biutag.supervision.util.TimeUtil; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -20,6 +26,7 @@ import java.time.ZoneId; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; |
|
|
|
import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY; |
|
|
|
|
|
|
|
|
|
|
|
@ -88,6 +95,121 @@ public class Job { |
|
|
|
TimeUtil.getRemainingDuration(item.getFirstDistributeTime(), item.getMaxSignDuration(), item.getMaxHandleDuration(), item.getExtensionDays(), item.getFlowKey()))); |
|
|
|
TimeUtil.getRemainingDuration(item.getFirstDistributeTime(), item.getMaxSignDuration(), item.getMaxHandleDuration(), item.getExtensionDays(), item.getFlowKey()))); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private final DwdAsjZfbaShrxx2Service dwdAsjZfbaShrxx2Service; |
|
|
|
|
|
|
|
private final RpcApplyService rpcApplyService; |
|
|
|
|
|
|
|
private final SupPoliceService policeService; |
|
|
|
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
|
|
|
private final DwdAsjZfbaAjjbxxMapper dwdAsjZfbaAjjbxxMapper; |
|
|
|
|
|
|
|
private final SupDepartMapper supDepartMapper; |
|
|
|
|
|
|
|
private final RpcApplyPersonService rpcApplyPersonService; |
|
|
|
|
|
|
|
private final DwdAsjZfbaWfrwfxxMapper dwdAsjZfbaWfrwfxxMapper; |
|
|
|
|
|
|
|
private final RpcInfringerResultService rpcInfringerResultService; |
|
|
|
|
|
|
|
// 每天一次 23:30:00
|
|
|
|
|
|
|
|
//todo 维权信息
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 30 23 * * ?") |
|
|
|
|
|
|
|
public void rights() { |
|
|
|
|
|
|
|
log.info("rights--------------------"); |
|
|
|
|
|
|
|
log.info("维权信息抓取中---------------------"); |
|
|
|
|
|
|
|
// 维权
|
|
|
|
|
|
|
|
List<DwdAsjZfbaShrxx2> shrxxList = dwdAsjZfbaShrxx2Service.listAll(); |
|
|
|
|
|
|
|
log.info("数据:{}条", shrxxList.size()); |
|
|
|
|
|
|
|
shrxxList.forEach(item -> { |
|
|
|
|
|
|
|
RpcApply rpcApply = new RpcApply(); |
|
|
|
|
|
|
|
rpcApply.setRpcId(item.getZj()); |
|
|
|
|
|
|
|
rpcApply.setCrtTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
rpcApply.setUptTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
// 姓名
|
|
|
|
|
|
|
|
rpcApply.setApplicantEmpName(item.getXm()); |
|
|
|
|
|
|
|
// 受害日期
|
|
|
|
|
|
|
|
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()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取单位进行处理
|
|
|
|
|
|
|
|
if(StrUtil.isNotEmpty(ajjbxx.getBadwidmc())){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SupDepart supDepart=supDepartMapper.selectOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getName,ajjbxx.getBadwidmc())); |
|
|
|
|
|
|
|
rpcApply.setDepartId(supDepart.getId()); |
|
|
|
|
|
|
|
rpcApply.setDepartName(supDepart.getShortName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取二级单位的信息
|
|
|
|
|
|
|
|
String[] depts = ajjbxx.getBadwidmc().split("局"); |
|
|
|
|
|
|
|
String StatisticsGroupName = null; |
|
|
|
|
|
|
|
if(depts.length >= 2){ |
|
|
|
|
|
|
|
StatisticsGroupName = depts[0]+"局"+depts[1]+"局"; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
StatisticsGroupName = depts[0]+"局"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SupDepart groupDept= supDepartMapper.selectOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getName,StatisticsGroupName)); |
|
|
|
|
|
|
|
rpcApply.setSecondDepartId(groupDept.getId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 案件信息
|
|
|
|
|
|
|
|
rpcApply.setFactReason(ajjbxx.getJyaq()); |
|
|
|
|
|
|
|
if ("刑事".equals(ajjbxx.getAjbzmc())) { |
|
|
|
|
|
|
|
rpcApply.setInfringerHandle("刑事追究"); |
|
|
|
|
|
|
|
rpcApply.setCaseType("1"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("行政".equals(ajjbxx.getAjbzmc())) { |
|
|
|
|
|
|
|
rpcApply.setInfringerHandle("行政处罚"); |
|
|
|
|
|
|
|
rpcApply.setCaseType("2"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
rpcApply.setCaseCategory(ajjbxx.getAjlbmc()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 申请类型
|
|
|
|
|
|
|
|
rpcApply.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); |
|
|
|
|
|
|
|
// 已办结
|
|
|
|
|
|
|
|
rpcApply.setRpcStatus(ComfortStatus.completed.name()); |
|
|
|
|
|
|
|
// 数据来源
|
|
|
|
|
|
|
|
rpcApply.setSource("gbase"); |
|
|
|
|
|
|
|
rpcApplyService.save(rpcApply); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//受害人列表
|
|
|
|
|
|
|
|
RpcApplyPerson rpcApplyPerson= new RpcApplyPerson(); |
|
|
|
|
|
|
|
rpcApplyPerson.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); |
|
|
|
|
|
|
|
rpcApplyPerson.setInjurySeverity(item.getShcdmc()); |
|
|
|
|
|
|
|
rpcApplyPerson.setCreatTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
rpcApplyPerson.setUdpTime(LocalDateTime.now()); |
|
|
|
|
|
|
|
rpcApplyPerson.setId(IdUtil.fastSimpleUUID()); |
|
|
|
|
|
|
|
if(Objects.nonNull(police)){ |
|
|
|
|
|
|
|
rpcApply.setApplicantEmpNo(police.getEmpNo()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
rpcApplyPerson.setRpcId(item.getZj()); |
|
|
|
|
|
|
|
//存储受害人信息
|
|
|
|
|
|
|
|
rpcApplyPersonService.save(rpcApplyPerson); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//存储犯人信息
|
|
|
|
|
|
|
|
List<DwdAsjZfbaWfrwfxx> wfrwfxxes = dwdAsjZfbaWfrwfxxMapper.selectList(new LambdaQueryWrapper<DwdAsjZfbaWfrwfxx>().eq(DwdAsjZfbaWfrwfxx::getAjbh,item.getAjbh())); |
|
|
|
|
|
|
|
log.info("违法人员信息数据:{}条", wfrwfxxes.size()); |
|
|
|
|
|
|
|
if (ArrayUtil.isNotEmpty(wfrwfxxes)){ |
|
|
|
|
|
|
|
wfrwfxxes.forEach(x->{ |
|
|
|
|
|
|
|
RpcInfringerResult rpcInfringerResult =new RpcInfringerResult(); |
|
|
|
|
|
|
|
rpcInfringerResult.setId(IdUtil.fastSimpleUUID()); |
|
|
|
|
|
|
|
rpcInfringerResult.setRpcId(item.getZj()); |
|
|
|
|
|
|
|
rpcInfringerResult.setTortName(x.getXm()); |
|
|
|
|
|
|
|
rpcInfringerResult.setDefendHandleWayName(x.getClfs()); |
|
|
|
|
|
|
|
//保存犯人信息
|
|
|
|
|
|
|
|
rpcInfringerResultService.save(rpcInfringerResult); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|