diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java index 9ee6547..6a3184c 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVMailViewController.java @@ -116,6 +116,7 @@ public class DataVMailViewController { // @Cacheable(cacheNames = "Supervision:Screen:MailMap", key = "#beginTime.getTime()+'_'+#endTime.getTime()") public Result getMailMapIcon(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { + endTime = DateUtil.endOfDay(endTime); // 信访数据总数概览 List mailMapIconList = dataMailService.getMailMapIcon(beginTime, endTime); JSONObject data = new JSONObject().fluentPut("mailMapIconList", mailMapIconList); diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java index e172681..826c453 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVRightsComfortController.java @@ -70,6 +70,7 @@ public class DataVRightsComfortController { List list = rpcApplyService.list(new LambdaQueryWrapper() .between(RpcApply::getCrtTime, beginTime, finalEndTime) .eq(RpcApply::getType, RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue())); + //获取案件编号 Set caseNumbers = list.stream().map(RpcApply::getCaseNumber).collect(Collectors.toSet()); // 维权案件总数 result.setRightsNumber(caseNumbers.size()); diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index c53d90c..619ca3e 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -1,14 +1,20 @@ 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.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.pojo.entity.Negative; -import com.biutag.supervision.service.BusinessDepartService; -import com.biutag.supervision.service.BusinessPoliceService; -import com.biutag.supervision.service.MailService; -import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; +import com.biutag.supervision.mapper.DwdAsjZfbaAjjbxxMapper; +import com.biutag.supervision.mapper.DwdAsjZfbaWfrwfxxMapper; +import com.biutag.supervision.mapper.RpcInfringerResultMapper; +import com.biutag.supervision.mapper.SupDepartMapper; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.service.*; import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -20,6 +26,7 @@ import java.time.ZoneId; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; 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()))); }); } + 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 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().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().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 wfrwfxxes = dwdAsjZfbaWfrwfxxMapper.selectList(new LambdaQueryWrapper().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); + }); + } + + }); + } } diff --git a/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaWfrwfxxMapper.java b/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaWfrwfxxMapper.java new file mode 100644 index 0000000..67b2e29 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaWfrwfxxMapper.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.DwdAsjZfbaWfrwfxx; + +@DS("slave2") +public interface DwdAsjZfbaWfrwfxxMapper extends BaseMapper { + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java index 382f4d4..70ba8c5 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java @@ -29,4 +29,12 @@ public class DwdAsjZfbaAjjbxx { @TableField("jyaq") private String jyaq; -} \ No newline at end of file + //受案单位 + @TableField("badwidmc") + private String badwidmc; + + //具体案件类型 + @TableField("ajlbmc") + private String ajlbmc; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java new file mode 100644 index 0000000..54d039f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaWfrwfxx.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +/** + * 违法人信息表 + * */ +@Getter +@Setter +public class DwdAsjZfbaWfrwfxx { + + @TableField("ajbh") + private String ajbh; + + @TableField("xm") + private String xm; + + @TableField("clfs") + private String clfs; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java index 7968a3b..f8eb038 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyPerson.java @@ -11,7 +11,7 @@ import java.time.LocalDateTime; @Getter public class RpcApplyPerson { - // + // @TableId(value = "id") private String id; @@ -27,6 +27,7 @@ public class RpcApplyPerson { @TableField("provide_relief") private String provideRelief; + // 受伤程度 private String injurySeverity; private String injurySeverityName; @@ -38,4 +39,4 @@ public class RpcApplyPerson { private LocalDateTime udpTime; -} \ No newline at end of file +} diff --git a/src/main/java/com/biutag/supervision/service/DwdAsjZfbaWfrwfxxService.java b/src/main/java/com/biutag/supervision/service/DwdAsjZfbaWfrwfxxService.java new file mode 100644 index 0000000..6d3e16f --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DwdAsjZfbaWfrwfxxService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.DwdAsjZfbaWfrwfxxMapper; +import com.biutag.supervision.pojo.entity.DwdAsjZfbaWfrwfxx; +import org.springframework.stereotype.Service; + +@Service +public class DwdAsjZfbaWfrwfxxService extends ServiceImpl { + +}