Browse Source

fix: 修复文件分类未保存的问题

master
wxc 6 months ago
parent
commit
ef3e81a94b
  1. 2
      src/main/java/com/biutag/supervision/flow/FlowService.java
  2. 64
      src/main/java/com/biutag/supervision/job/Job.java
  3. 3
      src/main/java/com/biutag/supervision/pojo/vo/FileVo.java

2
src/main/java/com/biutag/supervision/flow/FlowService.java

@ -35,7 +35,7 @@ public class FlowService {
public Boolean execute(ActionDto actionDto) { public Boolean execute(ActionDto actionDto) {
Action action = actions Action action = actions
.stream() .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() .findFirst()
.orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员")); .orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员"));
action.next(actionDto); action.next(actionDto);

64
src/main/java/com/biutag/supervision/job/Job.java

@ -1,11 +1,14 @@
package com.biutag.supervision.job; package com.biutag.supervision.job;
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.pojo.entity.SupDepart; import com.biutag.supervision.mapper.DwdAsjZfbaAjjbxxMapper;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import com.biutag.supervision.util.TimeUtil; import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -18,6 +21,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;
@ -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 // 每天一次 23:30:00
//@Scheduled(cron = "0 30 23 * * ?") @Scheduled(cron = "0 30 23 * * ?")
public void rights() { public void rights() {
log.info("rights--------------------");
// 维权
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());
// 案件信息
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);
});
} }
} }

3
src/main/java/com/biutag/supervision/pojo/vo/FileVo.java

@ -8,6 +8,7 @@ import lombok.experimental.Accessors;
@Setter @Setter
@Getter @Getter
public class FileVo { public class FileVo {
private String id; private String id;
private String confinementId; private String confinementId;
@ -16,6 +17,6 @@ public class FileVo {
private String fileName; private String fileName;
// private Integer fileClassId; private Integer fileClassId;
} }

Loading…
Cancel
Save