diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java index 62e26f2..9c66090 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -1,26 +1,32 @@ package com.biutag.supervision.controller.work; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.common.validation.AddGroup; import com.biutag.supervision.common.validation.EditGroup; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.FlowNodeEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.constants.enums.WorkStatusEnum; import com.biutag.supervision.flow.FlowService; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.NegativeDetail; import com.biutag.supervision.pojo.dto.ActionDto; import com.biutag.supervision.pojo.dto.NegativeDto; -import com.biutag.supervision.pojo.entity.DepartNegativeRate; -import com.biutag.supervision.pojo.entity.Negative; -import com.biutag.supervision.pojo.entity.NegativeTask; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.NegativeQueryParam; import com.biutag.supervision.pojo.vo.NegativeConfirmationCompletionVo; import com.biutag.supervision.pojo.vo.NegativeQueryVo; import com.biutag.supervision.service.*; import com.biutag.supervision.util.JSON; import lombok.RequiredArgsConstructor; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -42,6 +48,8 @@ public class NegativeController { private final DepartNegativeRateService departNegativeRateService; + private final NegativeWorkService negativeWorkService; + @GetMapping public Result> list(NegativeQueryParam queryParam) { return Result.success(negativeQueryService.page(queryParam)); @@ -108,6 +116,30 @@ public class NegativeController { return Result.success(flowService.execute(action)); } + private final NegativeHistoryService historyService; + + @PostMapping("{id}/transferTodo") + @Transactional(rollbackFor = Exception.class) + public Result transferTodo(@PathVariable String id) { + negativeService.update(new LambdaUpdateWrapper().eq(Negative::getId, id).set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) + .set(Negative::getFlowKey, FlowNodeEnum.FIRST_APPROVE.getKey()).set(Negative::getUpdTime, LocalDateTime.now())); + negativeWorkService.update(new LambdaUpdateWrapper().eq(NegativeWork::getNegativeId, id) + .eq(NegativeWork::getRoleCode, RoleCodeEnum.FIRST_ADMIN.getCode()) + .set(NegativeWork::getStatus, WorkStatusEnum.todo.name()) + .set(NegativeWork::getUpdateTime, LocalDateTime.now())); + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeHistory history = new NegativeHistory().setHistoryId(IdUtil.fastSimpleUUID()) + .setNegativeId(id) + .setActionName("转为待办") + .setDepartName(AppConstants.ROOT_DEPART_NAME) + .setCrtUser(user.getUserId()) + .setCrtUserName(user.getUserName()) + .setCrtName(user.getNickName()) + .setCrtTime(LocalDateTime.now()); + historyService.save(history); + return Result.success(); + } + @PostMapping("export/excel") public Result export(NegativeQueryParam queryParam) { queryParam.setSize(10000); diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java index b55e4ae..398f771 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueTaskDistribute.java @@ -51,7 +51,7 @@ public class ModelClueTaskDistribute { // 警种 private String policeType; - private String involveProblem; + private List involveProblem = new ArrayList<>(); private List thingFiles = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RiskScoreRule.java b/src/main/java/com/biutag/supervision/pojo/entity/RiskScoreRule.java index 4272a9f..338b4b8 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RiskScoreRule.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RiskScoreRule.java @@ -35,7 +35,7 @@ public class RiskScoreRule { // 权重 @TableField("weight") - private Integer weight; + private Double weight; // 状态 @TableField("status") diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java index 9aef049..ac01562 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java @@ -94,4 +94,7 @@ public class NegativeWorkModel { private String checkStatusName; + // 当前处理对象 + private String currentProcessingObject; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RiskScoreRuleTree.java b/src/main/java/com/biutag/supervision/pojo/vo/RiskScoreRuleTree.java index 019c510..5a3e255 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/RiskScoreRuleTree.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/RiskScoreRuleTree.java @@ -30,7 +30,7 @@ public class RiskScoreRuleTree { private String ruleDesc; // 权重 - private Integer weight; + private Double weight; // 状态 private Boolean status; diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 32aa495..16e4c04 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -128,7 +128,7 @@ public class ModelClueService extends ServiceImpl { } model.setBusinessTypeCode(taskDistribute.getBusinessTypeCode()); model.setPoliceType(taskDistribute.getPoliceType()); - model.setInvolveProblem(taskDistribute.getInvolveProblem()); + model.setInvolveProblem(String.join(",", taskDistribute.getInvolveProblem())); return distribution(modelClues, model, taskDistribute.getTaskName(), taskDistribute.getThingFiles()); } diff --git a/src/main/java/com/biutag/supervision/service/SupPoliceService.java b/src/main/java/com/biutag/supervision/service/SupPoliceService.java index df76eca..8156bed 100644 --- a/src/main/java/com/biutag/supervision/service/SupPoliceService.java +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -67,7 +67,6 @@ public class SupPoliceService extends ServiceImpl { } } } - queryWrapper.orderByDesc("field(p.job,'辅警','民警','四级机构副职','四级机构正职','三级机构副职','三级机构正职二','三级机构正职一','二级机构副职','二级机构正职二','二级机构正职一','市局领导副职','市局领导正职')"); queryWrapper.orderByDesc("field(p.position,'副职','正职')"); queryWrapper.orderByAsc("d.level").orderByDesc("p.position").orderByDesc("p.sort_id").orderByAsc("p.person_status"); return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); diff --git a/src/test/java/com/biutag/supervision/StrUtil.java b/src/test/java/com/biutag/supervision/StrUtil.java index 2234169..051d69d 100644 --- a/src/test/java/com/biutag/supervision/StrUtil.java +++ b/src/test/java/com/biutag/supervision/StrUtil.java @@ -1,14 +1,20 @@ package com.biutag.supervision; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.img.ImgUtil; import cn.hutool.core.io.FileTypeUtil; import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.resource.ResourceUtil; import com.biutag.supervision.util.JSON; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.net.URL; import java.time.LocalDate; import java.util.List; @@ -16,7 +22,8 @@ import java.util.List; public class StrUtil { @Test - public void testSubstr() { - System.out.println(StrUtil.class.getSimpleName()); + public void testSubstr() throws FileNotFoundException { + ImgUtil.compress(new File("C:\\Users\\ldj\\Desktop\\文件类型\\1204.png"), new File("C:\\Users\\ldj\\Desktop\\文件类型\\1204.jpg"), 1); } + }