diff --git a/src/main/java/com/biutag/supervision/flow/FlowService.java b/src/main/java/com/biutag/supervision/flow/FlowService.java index 020c5cc..8241bd3 100644 --- a/src/main/java/com/biutag/supervision/flow/FlowService.java +++ b/src/main/java/com/biutag/supervision/flow/FlowService.java @@ -35,7 +35,7 @@ public class FlowService { public Boolean execute(ActionDto actionDto) { Action action = actions .stream() - .filter(item -> item.getClass().getSimpleName().startsWith(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey())))) + .filter(item -> item.getClass().getSimpleName().startsWith(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey())) + "Action")) .findFirst() .orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员")); action.next(actionDto); diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 37a1b04..a8eb1fe 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -1,11 +1,14 @@ package com.biutag.supervision.job; 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.pojo.entity.SupDepart; +import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; +import com.biutag.supervision.mapper.DwdAsjZfbaAjjbxxMapper; +import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.service.*; import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; @@ -18,6 +21,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; @@ -87,13 +91,61 @@ public class Job { }); } - + private final DwdAsjZfbaShrxx2Service dwdAsjZfbaShrxx2Service; + private final RpcApplyService rpcApplyService; + private final SupPoliceService policeService; + private final SupDepartService departService; + private final DwdAsjZfbaAjjbxxMapper dwdAsjZfbaAjjbxxMapper; // 每天一次 23:30:00 - //@Scheduled(cron = "0 30 23 * * ?") + @Scheduled(cron = "0 30 23 * * ?") public void rights() { - - + log.info("rights--------------------"); + // 维权 + 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()); + // 案件信息 + rpcApply.setFactReason(ajjbxx.getJyaq()); + if ("刑事".equals(ajjbxx.getAjbzmc())) { + rpcApply.setInfringerHandle("刑事追究"); + } + if ("行政".equals(ajjbxx.getAjbzmc())) { + rpcApply.setInfringerHandle("行政处罚"); + } + } + // 申请类型 + rpcApply.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); + // 已办结 + rpcApply.setRpcStatus(ComfortStatus.completed.name()); + // 数据来源 + rpcApply.setSource("gbase"); + rpcApplyService.save(rpcApply); + }); } } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java b/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java index 71f330d..9106a07 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/FileVo.java @@ -8,6 +8,7 @@ import lombok.experimental.Accessors; @Setter @Getter public class FileVo { + private String id; private String confinementId; @@ -16,6 +17,6 @@ public class FileVo { private String fileName; -// private Integer fileClassId; + private Integer fileClassId; }