Browse Source

fix: 修复移动督察APP随手拍新增问题,问题类型错误的BUG

fix: 修复编辑模型数字工坊的信息无法回显的问题
master
wxc 6 months ago
parent
commit
e7b0483358
  1. 5
      src/main/java/com/biutag/supervision/constants/enums/TaskTypeEnum.java
  2. 6
      src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java
  3. 11
      src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java
  4. 17
      src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelController.java
  5. 116
      src/main/java/com/biutag/supervision/pojo/vo/ModelVo.java
  6. 22
      src/main/java/com/biutag/supervision/service/SupTaskProblemService.java

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

@ -13,5 +13,8 @@ public enum TaskTypeEnum {
inspection,
// 自查任务
selfexamination;
selfexamination,
// 问题随拍
problem_shooting;
}

6
src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java

@ -76,10 +76,4 @@ public class InspectionController {
return Result.success();
}
@PostMapping("{taskId}/problem")
public Result<Boolean> addProblem(@PathVariable Integer taskId, @RequestBody TaskProblemDto dto) {
dto.setTaskId(taskId);
return Result.success(taskProblemService.save(dto));
}
}

11
src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java

@ -4,15 +4,13 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.TaskProblemDto;
import com.biutag.supervision.pojo.entity.SupTaskPerson;
import com.biutag.supervision.pojo.entity.SupTaskProblem;
import com.biutag.supervision.pojo.param.TaskProblemQueryParam;
import com.biutag.supervision.service.SupTaskProblemService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.stream.Collectors;
@ -43,4 +41,9 @@ public class TaskProblemController {
return Result.success(taskProblemService.getById(id));
}
@PostMapping
public Result<Boolean> add(@RequestBody TaskProblemDto dto) {
return Result.success(taskProblemService.save(dto));
}
}

17
src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelController.java

@ -9,14 +9,18 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.ModelClueMappingData;
import com.biutag.supervision.pojo.dto.ModelDto;
import com.biutag.supervision.pojo.entity.Model;
import com.biutag.supervision.pojo.entity.ModelGeneration;
import com.biutag.supervision.pojo.model.ModelClassModel;
import com.biutag.supervision.pojo.param.ModelQueryParam;
import com.biutag.supervision.pojo.vo.ModelTree;
import com.biutag.supervision.pojo.vo.ModelVo;
import com.biutag.supervision.service.ModelGenerationService;
import com.biutag.supervision.service.ModelService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@ -29,6 +33,8 @@ public class ModelController {
private final ModelClassMapper modelClassMapper;
private final ModelGenerationService modelGenerationService;
@GetMapping
public Result<Page<Model>> list(ModelQueryParam queryParam) {
LambdaQueryWrapper<Model> queryWrapper = new LambdaQueryWrapper<>();
@ -41,8 +47,15 @@ public class ModelController {
}
@GetMapping("{id}")
public Result<Model> get(@PathVariable String id) {
return Result.success(modelService.getById(id));
public Result<ModelVo> get(@PathVariable Integer id) {
Model model = modelService.getById(id);
ModelVo vo = new ModelVo();
BeanUtil.copyProperties(model, vo);
if (StrUtil.isNotBlank(model.getInvolveProblem())) {
vo.setInvolveProblem(Arrays.stream(model.getInvolveProblem().split(",")).toList());
}
vo.setModelGeneration(modelGenerationService.getOne(new LambdaQueryWrapper<ModelGeneration>().eq(ModelGeneration::getModelId, id)));
return Result.success(vo);
}
@GetMapping("tree")

116
src/main/java/com/biutag/supervision/pojo/vo/ModelVo.java

@ -0,0 +1,116 @@
package com.biutag.supervision.pojo.vo;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.ModelGeneration;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Setter
@Getter
public class ModelVo {
private Integer id;
private String modelName;
private Integer classId;
private String icon;
private String iconColor;
private String remarks;
// 分发方式
private String distributionMethod;
// 分发周期
private String distributionCycle;
// 分发周期 周
private String distributionCycleDayOfWeek;
// 分发周期 时间
private String distributionCycleTime;
// 分发周期,cron 表达式
private String distributionCycleExpression;
// 限时
private String timeLimit;
private Integer maxSignDuration;
private Integer maxHandleDuration;
private Integer maxExtensionDuration;
private String distributionFlow;
private String approvalFlow;
private String createDepartId;
private String createDepartName;
// 建模方式
private String modelingMethod;
// 模型数据类型
private String modelDataType;
private String modelSql;
private Integer riskScoreRuleId;
// 预警问题处置
private String warningHandling;
private String handleDepartId;
// 业务类型
private String businessTypeCode;
// 警种
private String policeType;
// 模型类型
private String modelType;
// 模型结果表名
private String clueTableName;
// 同步时间字段名
private String clueTimeFieldName;
// 同步唯一字段名
private String clueUniqueFieldName;
// 同步周期 day-每天 week-每周
private String clueCycle;
// 同步周期 周 MON TUE WED THU FRI SAT SUN
private String clueCycleDayOfWeek;
// 同步时间
private String clueCycleTime;
private List<String> involveProblem = new ArrayList<>();
// 问题类型
private List<VerifyData.Problem> problems = new ArrayList<>();
// 预警内容生成器
private String thingDescGeneration;
// 结果字段映射
private ModelGeneration modelGeneration;
// 同步机构映射
private String clueDepartSource;
}

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

@ -1,15 +1,15 @@
package com.biutag.supervision.service;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.constants.enums.DistributionStateEnum;
import com.biutag.supervision.constants.enums.TaskStatusEnum;
import com.biutag.supervision.constants.enums.TaskTypeEnum;
import com.biutag.supervision.mapper.SupTaskProblemMapper;
import com.biutag.supervision.pojo.dto.TaskProblemDto;
import com.biutag.supervision.pojo.entity.SupTask;
import com.biutag.supervision.pojo.entity.SupTaskProblem;
import com.biutag.supervision.mapper.SupTaskProblemMapper;
import com.biutag.supervision.pojo.entity.SupTaskSelfexaminationContent;
import com.biutag.supervision.util.JSON;
import lombok.RequiredArgsConstructor;
@ -49,13 +49,19 @@ public class SupTaskProblemService extends ServiceImpl<SupTaskProblemMapper, Sup
}
problem.setCreateTime(LocalDateTime.now());
problem.setDistributionState(DistributionStateEnum.UNDISTRIBUTED.getValue());
SupTask task = taskService.getById(dto.getTaskId());
problem.setTaskType(task.getTaskType());
if (Objects.nonNull(dto.getContentId())) {
taskSelfexaminationContentService.update(new LambdaUpdateWrapper<SupTaskSelfexaminationContent>()
.eq(SupTaskSelfexaminationContent::getId, dto.getContentId())
.set(SupTaskSelfexaminationContent::getStatus, TaskStatusEnum.done.name()));
if (Objects.nonNull(dto.getTaskId())) {
SupTask task = taskService.getById(dto.getTaskId());
problem.setTaskType(task.getTaskType());
if (Objects.nonNull(dto.getContentId())) {
taskSelfexaminationContentService.update(new LambdaUpdateWrapper<SupTaskSelfexaminationContent>()
.eq(SupTaskSelfexaminationContent::getId, dto.getContentId())
.set(SupTaskSelfexaminationContent::getStatus, TaskStatusEnum.done.name()));
}
} else {
// 问题随拍
problem.setTaskType(TaskTypeEnum.problem_shooting.name());
}
return save(problem);
}

Loading…
Cancel
Save