Browse Source

fix: 移动督察

master
wxc 5 months ago
parent
commit
82227c2fb7
  1. 2
      src/main/java/com/biutag/supervision/constants/enums/TaskTypeEnum.java
  2. 14
      src/main/java/com/biutag/supervision/job/RiskJob.java
  3. 5
      src/main/java/com/biutag/supervision/pojo/dto/TaskProblemDto.java
  4. 3
      src/main/java/com/biutag/supervision/pojo/entity/SupTaskProblem.java
  5. 3
      src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionProblemVo.java
  6. 1
      src/main/java/com/biutag/supervision/service/SupTaskProblemService.java

2
src/main/java/com/biutag/supervision/constants/enums/TaskTypeEnum.java

@ -15,6 +15,8 @@ public enum TaskTypeEnum {
// 自查任务
selfexamination,
risk_personal,
// 问题随拍
problem_shooting;

14
src/main/java/com/biutag/supervision/job/RiskJob.java

@ -2,6 +2,7 @@ package com.biutag.supervision.job;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.TaskTypeEnum;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.entity.SupRiskPersonal;
import com.biutag.supervision.pojo.entity.SupRiskPersonalSupRecord;
@ -33,10 +34,17 @@ public class RiskJob {
private final SupTaskService taskService;
// 每10分钟执行一次
@Scheduled(fixedRate = 600000)
public void updateHandleTimeout() {
@Scheduled(fixedRate = 60000)
public void updateRiskPersonalWork() {
LocalDateTime now = LocalDateTime.now();
List<SupRiskPersonal> list = riskPersonalService.list(new LambdaQueryWrapper<SupRiskPersonal>().eq(SupRiskPersonal::getWorkStatus, WorkStatusEnum.done.name()));
// 重点人员
List<SupTask> tasks = taskService.list(new LambdaQueryWrapper<SupTask>().le(SupTask::getBeginTime, now).ge(SupTask::getEndTime, now)
.eq(SupTask::getTaskType, TaskTypeEnum.risk_personal.name()));
if (tasks.isEmpty()) {
return;
}
List<SupRiskPersonal> list = riskPersonalService.list(new LambdaQueryWrapper<SupRiskPersonal>().eq(SupRiskPersonal::getWorkStatus, WorkStatusEnum.done.name())
.in(SupRiskPersonal::getTaskId, tasks.stream().map(SupTask::getId).toList()));
for (SupRiskPersonal riskPersonal : list) {
SupTask task = taskService.getById(riskPersonal.getTaskId());

5
src/main/java/com/biutag/supervision/pojo/dto/TaskProblemDto.java

@ -1,9 +1,11 @@
package com.biutag.supervision.pojo.dto;
import com.biutag.supervision.pojo.vo.FileVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -35,6 +37,9 @@ public class TaskProblemDto {
private Integer contentId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime supTime;
@Setter
@Getter
public static class People {

3
src/main/java/com/biutag/supervision/pojo/entity/SupTaskProblem.java

@ -50,6 +50,9 @@ public class SupTaskProblem {
@TableField("files")
private String files;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime supTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@TableField("create_time")
private LocalDateTime createTime;

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

@ -39,6 +39,9 @@ public class TaskInspectionProblemVo {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime supTime;
// 附件
private List<FileVo> files = new ArrayList<>();

1
src/main/java/com/biutag/supervision/service/SupTaskProblemService.java

@ -40,6 +40,7 @@ public class SupTaskProblemService extends ServiceImpl<SupTaskProblemMapper, Sup
@Transactional(rollbackFor = Exception.class)
public boolean save(TaskProblemDto dto) {
SupTaskProblem problem = new SupTaskProblem();
problem.setSupTime(dto.getSupTime());
problem.setTaskId(dto.getTaskId());
problem.setHasProblem(dto.getHasProblem());
problem.setDepartId(dto.getDepartId());

Loading…
Cancel
Save