From 5d4d65d0260c9b3ea45c016e18d1332e3d55cb99 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Thu, 5 Dec 2024 18:59:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=81=B5=E6=95=8F?= =?UTF-8?q?=E6=84=9F=E7=9F=A5-=E9=97=AE=E9=A2=98=E5=88=86=E5=8F=91?= =?UTF-8?q?=E6=B6=89=E5=AB=8C=E9=97=AE=E9=A2=98=E5=BF=85=E5=A1=AB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E7=9A=84=E9=97=AE=E9=A2=98=20fix:=20?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=9E=81=E7=AB=AF=E8=B5=8B=E5=88=86=E8=A7=84?= =?UTF-8?q?=E5=88=99=EF=BC=9A=E8=B0=83=E6=95=B4=E6=9D=83=E9=87=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=B0=8F=E6=95=B0=E7=82=B9=E5=90=8E3=E4=BD=8D?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=95=8C=E9=9D=A2=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=20fit:=20=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=9A=E6=96=B0=E5=A2=9E=E2=80=9C=E8=BD=AC?= =?UTF-8?q?=E5=BE=85=E5=8A=9E=E2=80=9D=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=B0=86?= =?UTF-8?q?=E5=B7=B2=E5=8A=9E=E7=BB=93=E7=9A=84=E4=BB=B6=E8=BD=AC=E4=B8=BA?= =?UTF-8?q?=E5=B8=82=E5=B1=80=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/work/NegativeController.java | 38 +++++++++++++++++-- .../pojo/dto/ModelClueTaskDistribute.java | 2 +- .../pojo/entity/RiskScoreRule.java | 2 +- .../pojo/model/NegativeWorkModel.java | 3 ++ .../pojo/vo/RiskScoreRuleTree.java | 2 +- .../supervision/service/ModelClueService.java | 2 +- .../supervision/service/SupPoliceService.java | 1 - .../java/com/biutag/supervision/StrUtil.java | 11 +++++- 8 files changed, 51 insertions(+), 10 deletions(-) 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); } + }