diff --git a/sql/241204.sql b/sql/241204.sql new file mode 100644 index 0000000..4feedaf --- /dev/null +++ b/sql/241204.sql @@ -0,0 +1,4 @@ +update model set involve_problem = null; + +ALTER TABLE `negative`.`model` + ADD COLUMN `icon_color` varchar(255) NULL COMMENT '图标颜色' AFTER `icon`; \ No newline at end of file diff --git a/sql/0911.sql b/sql/history/0911.sql similarity index 100% rename from sql/0911.sql rename to sql/history/0911.sql diff --git a/sql/1008.sql b/sql/history/1008.sql similarity index 100% rename from sql/1008.sql rename to sql/history/1008.sql diff --git a/sql/1011.sql b/sql/history/1011.sql similarity index 100% rename from sql/1011.sql rename to sql/history/1011.sql diff --git a/sql/1014.sql b/sql/history/1014.sql similarity index 100% rename from sql/1014.sql rename to sql/history/1014.sql diff --git a/sql/1027.sql b/sql/history/1027.sql similarity index 100% rename from sql/1027.sql rename to sql/history/1027.sql diff --git a/sql/1106.sql b/sql/history/1106.sql similarity index 100% rename from sql/1106.sql rename to sql/history/1106.sql diff --git a/sql/1107.sql b/sql/history/1107.sql similarity index 100% rename from sql/1107.sql rename to sql/history/1107.sql diff --git a/sql/1109.sql b/sql/history/1109.sql similarity index 100% rename from sql/1109.sql rename to sql/history/1109.sql diff --git a/sql/1114.sql b/sql/history/1114.sql similarity index 100% rename from sql/1114.sql rename to sql/history/1114.sql diff --git a/sql/1126.sql b/sql/history/1126.sql similarity index 100% rename from sql/1126.sql rename to sql/history/1126.sql diff --git a/sql/1128.sql b/sql/history/1128.sql similarity index 100% rename from sql/1128.sql rename to sql/history/1128.sql diff --git a/sql/data.sql b/sql/history/data.sql similarity index 100% rename from sql/data.sql rename to sql/history/data.sql diff --git a/sql/dict.sql b/sql/history/dict.sql similarity index 100% rename from sql/dict.sql rename to sql/history/dict.sql diff --git a/sql/file_class.sql b/sql/history/file_class.sql similarity index 100% rename from sql/file_class.sql rename to sql/history/file_class.sql diff --git a/sql/negative_0904.sql b/sql/history/negative_0904.sql similarity index 100% rename from sql/negative_0904.sql rename to sql/history/negative_0904.sql diff --git a/sql/negative_mark.sql b/sql/history/negative_mark.sql similarity index 100% rename from sql/negative_mark.sql rename to sql/history/negative_mark.sql diff --git a/sql/open-platform_0904.sql b/sql/history/open-platform_0904.sql similarity index 100% rename from sql/open-platform_0904.sql rename to sql/history/open-platform_0904.sql diff --git a/sql/truncate.sql b/sql/history/truncate.sql similarity index 100% rename from sql/truncate.sql rename to sql/history/truncate.sql diff --git a/sql/update-data.sql b/sql/history/update-data.sql similarity index 100% rename from sql/update-data.sql rename to sql/history/update-data.sql diff --git a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java index 67d3995..ddc8291 100644 --- a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -36,8 +36,8 @@ public class InterceptorConfig implements WebMvcConfigurer { .excludePathPatterns("/file/stream/**", "/templates/**") .excludePathPatterns("/datav/risk/**") .excludePathPatterns("/score/**") + .excludePathPatterns("/updateInvolveProblem") .excludePathPatterns(List.of("/doc.html", "/webjars/**", "/favicon.ico", "/v3/api-docs/**")); - registry.addInterceptor(new ApiInterceptor()) .addPathPatterns("/api/jwdc/**"); } diff --git a/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java b/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java new file mode 100644 index 0000000..64205d2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/InvolveProblemEnum.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2024/12/4 + */ +@AllArgsConstructor +public enum InvolveProblemEnum { + // 自动回访不满意 + ZDHFBMY("1"); + + @Getter + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/controller/UpdateController.java b/src/main/java/com/biutag/supervision/controller/UpdateController.java new file mode 100644 index 0000000..87d9ac1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/UpdateController.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.controller; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.service.NegativeService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author wxc + * @date 2024/12/4 + */ +@Slf4j +@RequiredArgsConstructor +@RestController +public class UpdateController { + + private final NegativeService negativeService; + + @RequestMapping("updateInvolveProblem") + public String update() { + List list = negativeService.list(new LambdaUpdateWrapper().isNotNull(Negative::getInvolveProblem)); + int i = 0; + for (Negative negative : list) { + if (StrUtil.isBlank(negative.getInvolveProblem())) { + continue; + } + log.info("第{}条数据--------", i++); + try { + JSONArray jsonArray = JSON.parseArray(negative.getInvolveProblem()); + String val = jsonArray.stream().map(item -> ((JSONObject) item).getString("dictValue")).collect(Collectors.joining(",")); + System.out.println(val); + negativeService.update(new LambdaUpdateWrapper().eq(Negative::getId, negative.getId()).set(Negative::getInvolveProblem, val)); + } catch (Exception e) { + log.error("更新涉嫌问题异常:{}", e.getMessage(), e); + } + } + return "success"; + } +} diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java index 62014ce..039dc28 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelController.java @@ -64,7 +64,7 @@ public class ModelController { Model model = new Model(); BeanUtil.copyProperties(modelDto, model); if (Objects.nonNull(modelDto.getInvolveProblem())) { - model.setInvolveProblem(JSON.toJSONString(modelDto.getInvolveProblem())); + model.setInvolveProblem(String.join(",", modelDto.getInvolveProblem())); } return Result.success(modelService.saveModel(model, modelDto.getProblems())); } @@ -74,7 +74,7 @@ public class ModelController { Model model = new Model(); BeanUtil.copyProperties(modelDto, model); if (Objects.nonNull(modelDto.getInvolveProblem())) { - model.setInvolveProblem(JSON.toJSONString(modelDto.getInvolveProblem())); + model.setInvolveProblem(String.join(",", modelDto.getInvolveProblem())); } modelService.updateModel(model, modelDto.getProblems()); return Result.success(model); diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java index 9f561b3..f204759 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -76,7 +76,7 @@ public class ProfileDepartController { ProfileDepart profileDepart = new ProfileDepart(); SupDepart depart = departService.getById(departId); profileDepart.getDepartInfo() - .setName(depart.getName()) + .setName(depart.getShortName()) .setShortName(depart.getShortName()); List polices = policeService.listAllByDepartId(departId); profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null)); 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 d46a6d6..62e26f2 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -1,8 +1,10 @@ package com.biutag.supervision.controller.work; +import cn.hutool.core.collection.CollectionUtil; 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.flow.FlowService; @@ -86,8 +88,14 @@ public class NegativeController { .set(Negative::getReportNumber, negativeDto.getReportNumber()) .set(Negative::getInvolveDepartId, negativeDto.getInvolveDepartId()) .set(Negative::getInvolveDepartName, negativeDto.getResponderName()) + .set(Negative::getUpdUser, UserContextHolder.getCurrentUser().getNickName()) .set(Negative::getUpdTime, LocalDateTime.now()); - negativeService.update(updateWrapper); + if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) { + updateWrapper.set(Negative::getInvolveProblem, String.join(",", negativeDto.getInvolveProblem())); + } else { + updateWrapper.set(Negative::getInvolveProblem, null); + } + negativeService.update(updateWrapper); return Result.success(); } diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java index 1712de6..fa379e4 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java @@ -60,8 +60,8 @@ public class NegativeVo { // 业务类别名称 private String businessTypeName; - // 涉嫌问题JSON - private String involveProblemLables; + // 涉嫌问题 + private String involveProblem; // 涉及警种名称 private String policeTypeName; diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java b/src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java index 8d487d0..31e1c55 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java @@ -20,6 +20,8 @@ public class ModelDto { private String icon; + private String iconColor; + private String remarks; // 分发方式 @@ -76,7 +78,7 @@ public class ModelDto { // 警种 private String policeType; - private List> involveProblem; + private List involveProblem = new ArrayList<>(); // 问题类型 private List problems = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java index c5134a2..58ecb92 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java @@ -52,8 +52,8 @@ public class NegativeDto { // 涉及警种 private String policeType; - // 涉嫌问题JSON - private List> involveProblem; + // 涉嫌问题 + private List involveProblem = new ArrayList<>(); // 反映人姓名 private String responderName; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Model.java b/src/main/java/com/biutag/supervision/pojo/entity/Model.java index 183dd33..73c8366 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Model.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Model.java @@ -110,4 +110,6 @@ public class Model { private String involveProblem; + private String iconColor; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index c3e7d09..32aa495 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -168,7 +168,9 @@ public class ModelClueService extends ServiceImpl { } negative.setBusinessTypeCode(model.getPoliceType()); - //negative.setInvolveProblem(JSON.parseArray(model.getInvolveProblem(), Map.class)); + if (StrUtil.isNotBlank(model.getInvolveProblem())) { + negative.setInvolveProblem(Arrays.stream(model.getInvolveProblem().split(",")).toList()); + } // 涉及单位 negative.setInvolveDepartId(item.getInvolveDepartId()); negative.setInvolveDepartName(item.getInvolveDepartName()); @@ -185,16 +187,16 @@ public class ModelClueService extends ServiceImpl { SupDepart depart = departService.getById(item.getInvolveDepartId()); if (depart.getLevel().equals(DepartLevelEnum.SECOND.getValue())) { negative.setDepartId(depart.getId()); - negative.setDepartName(depart.getName()); + negative.setDepartName(depart.getShortName()); } if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue())) { SupDepart parentDepart = departService.getParentDepart(item.getInvolveDepartId()); negative.setDepartId(parentDepart.getId()); - negative.setDepartName(parentDepart.getName()); + negative.setDepartName(parentDepart.getShortName()); } if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.THIRD.getValue())) { negative.setDepartId(depart.getId()); - negative.setDepartName(depart.getName()); + negative.setDepartName(depart.getShortName()); } negative.setTimeLimit(model.getTimeLimit()); negative.setMaxSignDuration(model.getMaxSignDuration()); diff --git a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java index 1c9ba4b..4b6a943 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java @@ -34,16 +34,26 @@ public class NegativeExtensionApplyService extends ServiceImpl 1) { - step3.setComments(list.get(1).getComments()); - step3.setState(list.get(1).getState()); - step3.setCreateTime(list.get(1).getCreateTime()); + if (negative.getIsSecondHandle()) { + apply.setApproveSteps(List.of(step1, step3)); + if (!list.isEmpty()) { + step3.setComments(list.get(0).getComments()); + step3.setState(list.get(0).getState()); + step3.setCreateTime(list.get(0).getCreateTime()); + } + } else { + + apply.setApproveSteps(List.of(step1, step2, step3)); + if (!list.isEmpty()) { + step2.setComments(list.get(0).getComments()); + step2.setState(list.get(0).getState()); + step2.setCreateTime(list.get(0).getCreateTime()); + } + if (list.size() > 1) { + step3.setComments(list.get(1).getComments()); + step3.setState(list.get(1).getState()); + step3.setCreateTime(list.get(1).getCreateTime()); + } } return apply; } diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java index 141fa94..9e752af 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -1,6 +1,7 @@ package com.biutag.supervision.service; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; @@ -25,7 +26,6 @@ import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.dto.jwdc.NegativeApiDto; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.model.UserAuth; -import com.biutag.supervision.util.JSON; import com.biutag.supervision.util.SpringUtil; import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; @@ -34,7 +34,10 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; -import java.util.*; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -87,10 +90,6 @@ public class NegativeService extends ServiceImpl { NegativeVo vo = new NegativeVo(); BeanUtil.copyProperties(negative, vo); - if (StrUtil.isNotBlank(negative.getInvolveProblem())) { - String involveProblemLables = JSON.readValueForList(negative.getInvolveProblem(), Map.class).stream().map(item -> String.valueOf(item.get("dictLabel"))).collect(Collectors.joining(" ")); - vo.setInvolveProblemLables(involveProblemLables); - } List blameVos = blameService.list(id); vo.setBlames(blameVos); if (!blameVos.isEmpty()) { @@ -182,8 +181,9 @@ public class NegativeService extends ServiceImpl { .setCrtDepartLevel(secondFlag ? DepartLevelEnum.SECOND.getValue() : DepartLevelEnum.FIRST.getValue()) .setCrtTime(now) .setUpdTime(now); - if (Objects.nonNull(negativeDto.getInvolveProblem())) { - negative.setInvolveProblem(JSON.toJSONString(negativeDto.getInvolveProblem())); + + if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) { + negative.setInvolveProblem(String.join(",", negativeDto.getInvolveProblem())); } save(negative); // 添加一条 negative 数据 negativeDto.setId(negative.getId()); @@ -262,12 +262,7 @@ public class NegativeService extends ServiceImpl { .setCrtTime(now) .setUpdTime(now); - // [{"dictLabel":"自动回访不满意\n","dictType":"suspectProblem","dictValue":"1"}] - Map involveProblem = new HashMap<>(); - involveProblem.put("dictLabel", "自动回访不满意"); - involveProblem.put("dictType", "suspectProblem"); - involveProblem.put("dictValue", "1"); - negative.setInvolveProblem(JSON.toJSONString(Collections.singletonList(involveProblem))); + negative.setInvolveProblem(InvolveProblemEnum.ZDHFBMY.getValue()); if (Objects.nonNull(dept)) { negative.setInvolveDepartId(dept.getId())