diff --git a/pom.xml b/pom.xml index 1125a3b..141936a 100644 --- a/pom.xml +++ b/pom.xml @@ -234,9 +234,9 @@ - org.jsoup - jsoup - 1.18.3 + cn.com.jit + authSDK + 3.0.3 diff --git a/sql/20250116.sql b/sql/20250116.sql new file mode 100644 index 0000000..925a671 --- /dev/null +++ b/sql/20250116.sql @@ -0,0 +1,23 @@ +CREATE TABLE `model_generation` ( + `id` int NOT NULL AUTO_INCREMENT, + `model_id` int NOT NULL, + `involve_depart_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '涉及单位', + `involve_depart_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '涉及单位ID', + `involve_police_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '涉及人员', + `involve_police_emp_no` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '涉及人员警号', + `happen_time` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发生时间', + `thing_desc_generation` text COLLATE utf8mb4_general_ci COMMENT '预警内容生成器', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='模型生成表'; + +ALTER TABLE `negative`.`model` + ADD COLUMN `clue_table_name` varchar(255) NULL COMMENT '模型结果表名' AFTER `reply_limit`, + ADD COLUMN `clue_unique_field_name` varchar(255) NULL COMMENT '同步唯一字段名' AFTER `reply_limit`, + ADD COLUMN `clue_cycle` varchar(255) NULL COMMENT '同步周期' AFTER `reply_limit`, + ADD COLUMN `clue_cycle_day_of_week` varchar(255) NULL COMMENT '同步周期-周' AFTER `reply_limit`, + ADD COLUMN `clue_cycle_time` varchar(255) NULL COMMENT '同步时间' AFTER `reply_limit`; + +ALTER TABLE `negative`.`model` + ADD COLUMN `thing_desc_generation` text NULL COMMENT '模型结果表名' AFTER `clue_cycle_time`; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java index 4876188..d0b3dfc 100644 --- a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -35,7 +35,8 @@ public class InterceptorConfig implements WebMvcConfigurer { registry.addInterceptor(new DefaultInterceptor()) .addPathPatterns("/**") .excludePathPatterns("/api/**") - .excludePathPatterns("/login") + // 登录 + .excludePathPatterns("/login", "/jit/**") .excludePathPatterns("/auth/self") .excludePathPatterns("/file/stream/**", "/templates/**") .excludePathPatterns("/datav/risk/**") diff --git a/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java b/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java index e274d69..327509c 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java @@ -9,7 +9,8 @@ import lombok.Getter; public enum TimeLimitEnum { WORK_137("137工作制", "3+7", 1, 3, 7), - WORK_145("145工作制", "4+5", 1, 4, 5), + WORK_177("177工作制", "7+7", 1, 7, 7), + WORK_15_15("15+15工作制", "15+15", 1, 15, 15), WORK_30_30("30+30工作制", "30+30", 1, 30, 30), OTHER("其他", "other", null, null, null); diff --git a/src/main/java/com/biutag/supervision/controller/LoginController.java b/src/main/java/com/biutag/supervision/controller/LoginController.java index 8b7ffae..4bc12eb 100644 --- a/src/main/java/com/biutag/supervision/controller/LoginController.java +++ b/src/main/java/com/biutag/supervision/controller/LoginController.java @@ -1,12 +1,11 @@ package com.biutag.supervision.controller; -import cn.hutool.core.util.IdUtil; -import com.biutag.supervision.common.UserContextHolder; -import com.biutag.supervision.constants.RedisKeyConstants; +import cn.com.jit.JitAuthClient; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.AccountDto; import com.biutag.supervision.pojo.entity.BaseAccount; -import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.vo.TokenVo; import com.biutag.supervision.service.BaseAccountService; import com.biutag.supervision.service.UserLoginService; @@ -14,15 +13,14 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.redis.core.RedisTemplate; import org.springframework.security.crypto.bcrypt.BCrypt; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; +import java.util.Map; import java.util.Objects; -import java.util.concurrent.TimeUnit; @Tag(name = "登录接口") @Slf4j @@ -34,11 +32,6 @@ public class LoginController { private final UserLoginService userLoginService; - private final RedisTemplate redisTemplate; - - @Value("${token.timeout}") - private Integer tokenTimeout; - @Operation(summary = "登录") @PostMapping("login") public Result login(@RequestBody AccountDto account) { @@ -51,17 +44,42 @@ public class LoginController { log.error(e.getMessage(), e); throw new RuntimeException("用户名或密码有误,请重新输入"); } - UserAuth userAuth = userLoginService.buildUserAuth(baseAccount.getAccount()); - String token = IdUtil.fastSimpleUUID(); - redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, tokenTimeout, TimeUnit.HOURS); + String token = userLoginService.login(account.getAccount()); return Result.success(new TokenVo().setToken(token)); } @PostMapping("logout") public Result logout() { - redisTemplate.opsForValue(); - redisTemplate.delete(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, UserContextHolder.getCurrentToken())); + userLoginService.logout(); return Result.success(); } + @Operation(summary ="生成数字证书随机数") + @GetMapping("jit/random") + public Result random() { + String path = "/app/conf/jitMessage.properties"; + JitAuthClient jitAuthClient = new JitAuthClient(path); + String random = jitAuthClient.random(); + return Result.success(random); + } + + @Operation(summary ="数字证书登录") + @PostMapping("jit/p7certAuth") + public Result p7certAuth(@RequestBody JSONObject body) { + String path = "/app/conf/jitMessage.properties"; + JitAuthClient jitAuthClient = new JitAuthClient(path); + Map responseMap = jitAuthClient.authenP7(body.getString("random"), body.getString("signed_data"), ""); + String responseStr = JSON.toJSONString(responseMap); + log.info("返回的结果:{}", responseStr); + JSONObject response = JSON.parseObject(responseStr); + if (!response.getBoolean("isSuccess")) { + throw new RuntimeException(response.getString("errDesc")); + } + String cerSubject = response.getJSONObject("certAttributeNodeMap").getString("_saml_cert_subject"); + log.info("_saml_cert_subject:{}", cerSubject); + String idCode = cerSubject.split(",")[0].split(" ")[1]; + log.info("身份证:{}", idCode); + String token = userLoginService.login(idCode); + return Result.success(new TokenVo().setToken(token)); + } } 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 8075700..f521283 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelController.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.mapper.ModelClassMapper; 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.model.ModelClassModel; @@ -40,7 +41,7 @@ public class ModelController { } @GetMapping("{id}") - public Result list(@PathVariable String id) { + public Result get(@PathVariable String id) { return Result.success(modelService.getById(id)); } @@ -70,7 +71,7 @@ public class ModelController { if (Objects.nonNull(modelDto.getInvolveProblem())) { model.setInvolveProblem(String.join(",", modelDto.getInvolveProblem())); } - return Result.success(modelService.saveModel(model, modelDto.getProblems())); + return Result.success(modelService.saveModel(model, modelDto.getProblems(), modelDto)); } @PutMapping @@ -80,7 +81,7 @@ public class ModelController { if (Objects.nonNull(modelDto.getInvolveProblem())) { model.setInvolveProblem(String.join(",", modelDto.getInvolveProblem())); } - modelService.updateModel(model, modelDto.getProblems()); + modelService.updateModel(model, modelDto.getProblems(), modelDto); return Result.success(model); } @@ -89,4 +90,13 @@ public class ModelController { return Result.success(modelService.remove(id)); } + /** + * + * @return + */ + @GetMapping("clueMappingData/list") + public Result> clueMappingData() { + return Result.success(modelService.listClueMappingData()); + } + } 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 98faf06..25a6e29 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -78,7 +78,7 @@ public class NegativeController { public Result outerDetail(@PathVariable String id) { DataCaseVerif dataCaseVerif = dataCaseVerifService.getOne(new LambdaQueryWrapper().eq(DataCaseVerif::getOuterId, id)); if (dataCaseVerif == null) { - throw new RuntimeException("案件核查数据异常!"); + throw new RuntimeException("当前案件未录入一体化平台,请忽略!"); } Negative negative = negativeService.getOne(new LambdaUpdateWrapper().eq(Negative::getOriginId, dataCaseVerif.getOriginId())); if (negative == null) { diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java index a4e9bcb..d55169f 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -1,6 +1,7 @@ package com.biutag.supervision.flow.action; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -11,6 +12,7 @@ import com.biutag.supervision.pojo.dto.ActionDto; import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.JSON; import com.biutag.supervision.util.TimeUtil; import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; @@ -87,6 +89,10 @@ public class ApplyCompletionAction implements Action { .set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId()) .set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason()) .set(Negative::getInvolveDepartName, departService.getById(verifyData.getInvolveDepartId()).getShortName()); + // 经办人 + if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices())) { + updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices())); + } // 涉及单位 SupDepart depart = departService.getById(verifyData.getInvolveDepartId()); if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { diff --git a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java index da3c851..dfe46ac 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java @@ -1,6 +1,7 @@ package com.biutag.supervision.flow.action; import cn.hutool.core.bean.BeanUtil; +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; @@ -14,6 +15,7 @@ import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.NegativeProblemRelation; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.JSON; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -58,6 +60,10 @@ public class SaveAction implements Action { .set(Negative::getRectifyDesc, verifyData.getRectifyDesc()) .set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason()) .set(Negative::getCheckStatusName, verifyData.getCheckStatusName()); + // 经办人 + if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices())) { + updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices())); + } // 涉及单位 SupDepart depart = departService.getById(verifyData.getInvolveDepartId()); updateWrapper.set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId()) diff --git a/src/main/java/com/biutag/supervision/mapper/ModelMapper.java b/src/main/java/com/biutag/supervision/mapper/ModelMapper.java index 62ca945..c081170 100644 --- a/src/main/java/com/biutag/supervision/mapper/ModelMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/ModelMapper.java @@ -1,8 +1,16 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.dto.ModelClueMappingItem; import com.biutag.supervision.pojo.entity.Model; +import org.apache.ibatis.annotations.Select; + +import java.util.List; public interface ModelMapper extends BaseMapper { + + @Select("SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT,TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'csga_wdpcdb' ORDER BY TABLE_NAME,ORDINAL_POSITION") + List selectClueMappingData(); + } \ No newline at end of file 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 756cc7b..0e28172 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java @@ -207,4 +207,7 @@ public class NegativeVo { private List scorePolices = new ArrayList<>(); + // 经办人 + private List handlePolices = new ArrayList<>(); + } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java index fbf0518..2f4198b 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java @@ -40,6 +40,10 @@ public class DataPetition12337Distribute { @NotBlank private String approvalFlow; + // 下发流程 + @NotBlank + private String distributionFlow; + private String businessTypeCode; private String businessTypeName; diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingData.java b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingData.java new file mode 100644 index 0000000..06eec0e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingData.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2025/1/14 + */ +@Setter +@Getter +public class ModelClueMappingData { + + private List fields = new ArrayList<>(); + + private String tableName; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingItem.java b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingItem.java new file mode 100644 index 0000000..498b4f5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingItem.java @@ -0,0 +1,22 @@ +package com.biutag.supervision.pojo.dto; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2025/1/14 + */ +@Setter +@Getter +public class ModelClueMappingItem { + + private String columnName; + + private String dataType; + + private String columnComment; + + private String tableName; + +} 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 f0a8910..b2a9563 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java @@ -1,12 +1,12 @@ package com.biutag.supervision.pojo.dto; 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; -import java.util.Map; @Setter @Getter @@ -81,9 +81,36 @@ public class ModelDto { // 模型类型 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 involveProblem = new ArrayList<>(); // 问题类型 private List problems = new ArrayList<>(); + // 预警内容生成器 + private String thingDescGeneration; + + // 结果字段映射 + private ModelGeneration modelGeneration; + + // 同步机构映射 + private String clueDepartSource; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDistributeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDistributeDto.java index d73995a..950d476 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDistributeDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDistributeDto.java @@ -37,6 +37,10 @@ public class NegativeImportDistributeDto { @NotBlank private String approvalFlow; + // 下发流程 + @NotBlank + private String distributionFlow; + private List thingFiles = new ArrayList<>(); } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java index 06be451..f10959e 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java @@ -61,6 +61,9 @@ public class VerifyData { private List files = new ArrayList<>(); + // 经办人 + private List handlePolices; + @Setter @Getter public static class Blame { @@ -146,6 +149,8 @@ public class VerifyData { private String type; + + } @Setter @@ -230,4 +235,12 @@ public class VerifyData { } + @Setter + @Getter + public static class HandlePolice { + private String name; + private String empNo; + private String idCode; + } + } 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 1c8ec2d..e0437bf 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Model.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Model.java @@ -120,8 +120,6 @@ public class Model { // 模型结果表名 private String clueTableName; - // 同步时间字段名 - private String clueTimeFieldName; // 同步唯一字段名 private String clueUniqueFieldName; @@ -135,4 +133,10 @@ public class Model { // 同步时间 private String clueCycleTime; + // 同步机构映射 + private String clueDepartSource; + + // 预警内容生成器 + private String thingDescGeneration; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/ModelGeneration.java b/src/main/java/com/biutag/supervision/pojo/entity/ModelGeneration.java index 103c565..8bcfefa 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/ModelGeneration.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/ModelGeneration.java @@ -13,7 +13,7 @@ import java.time.LocalDateTime; public class ModelGeneration { // - @TableId(value = "id") + @TableId(value = "id", type = IdType.AUTO) private Integer id; // diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java index 0f64b8d..6094984 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -2,12 +2,15 @@ package com.biutag.supervision.pojo.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; @Accessors(chain = true) @Setter @@ -297,4 +300,7 @@ public class Negative { // 三级部门 private String threeInvolveDepartId; + // 经办人 + private String handlePolices; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java b/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java index a85a682..22748a0 100644 --- a/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java +++ b/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java @@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.common.UserContextHolder; -import com.biutag.supervision.constants.enums.DistributionStateEnum; -import com.biutag.supervision.constants.enums.HostLevelEnums; -import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.mapper.DataPetition12337Mapper; import com.biutag.supervision.pojo.dto.DataPetition12337Distribute; import com.biutag.supervision.pojo.dto.DataPetition12337Dto; @@ -122,21 +120,25 @@ public class DataPetition12337Service extends ServiceImpl { private final ModelProblemTypeService modelProblemTypeService; + private final ModelGenerationService modelGenerationService; + public List listByDistributionMethodOfNegative() { return list(new LambdaQueryWrapper().eq(Model::getDistributionMethod, DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue())); } @Transactional(rollbackFor = Exception.class) - public boolean saveModel(Model model, List problems) { + public boolean saveModel(Model model, List problems, ModelDto modelDto) { if (StrUtil.isNotBlank(model.getDistributionCycle()) && DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) : ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek()); @@ -44,6 +52,13 @@ public class ModelService extends ServiceImpl { model.setCreateDepartId(user.getDepartId()); model.setCreateDepartName(user.getDepartName()); boolean save = save(model); + if ("2".equals(modelDto.getModelingMethod()) && modelDto.getModelGeneration() != null) { + modelDto.getModelGeneration().setModelId(model.getId()); + modelDto.getModelGeneration().setCreateTime(LocalDateTime.now()); + modelDto.getModelGeneration().setUpdateTime(LocalDateTime.now()); + modelDto.getModelGeneration().setThingDescGeneration(modelDto.getThingDescGeneration()); + modelGenerationService.save(modelDto.getModelGeneration()); + } if (!problems.isEmpty()) { List problemTypes = problems.stream().map(item -> { ModelProblemType modelProblemType = new ModelProblemType(); @@ -57,7 +72,7 @@ public class ModelService extends ServiceImpl { } @Transactional(rollbackFor = Exception.class) - public boolean updateModel(Model model, List problems) { + public boolean updateModel(Model model, List problems, ModelDto modelDto) { if (StrUtil.isNotBlank(model.getDistributionCycle()) && DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) : ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek()); @@ -74,12 +89,37 @@ public class ModelService extends ServiceImpl { }).toList(); modelProblemTypeService.saveBatch(problemTypes); } + if ("2".equals(modelDto.getModelingMethod()) && modelDto.getModelGeneration() != null) { + ModelGeneration one = modelGenerationService.getOne(new LambdaQueryWrapper().eq(ModelGeneration::getModelId, model.getId())); + if (one != null) { + modelDto.getModelGeneration().setId(one.getId()); + modelDto.getModelGeneration().setCreateTime(one.getCreateTime()); + } + modelDto.getModelGeneration().setModelId(model.getId()); + modelDto.getModelGeneration().setUpdateTime(LocalDateTime.now()); + modelDto.getModelGeneration().setThingDescGeneration(modelDto.getThingDescGeneration()); + modelGenerationService.saveOrUpdate(modelDto.getModelGeneration()); + } return updateById(model); } + @Transactional(rollbackFor = Exception.class) public boolean remove(Integer modelId) { + modelGenerationService.remove(new LambdaQueryWrapper().eq(ModelGeneration::getModelId, modelId)); return removeById(modelId); } + public List listClueMappingData() { + List items = baseMapper.selectClueMappingData(); + Map> collect = items.stream().collect(Collectors.groupingBy(ModelClueMappingItem::getTableName)); + List list = collect.keySet().stream().sorted().map(tableName -> { + ModelClueMappingData data = new ModelClueMappingData(); + data.setTableName(tableName); + data.setFields(collect.get(tableName)); + return data; + }).toList(); + return list; + } + } diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java index cc205e4..3b72cec 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -8,6 +8,7 @@ import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -31,6 +32,7 @@ import com.biutag.supervision.util.SpringUtil; import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -90,7 +92,10 @@ public class NegativeService extends ServiceImpl { List flowActions = flowActionService.list(flowKey.get()); NegativeVo vo = new NegativeVo(); - BeanUtil.copyProperties(negative, vo); + BeanUtils.copyProperties(negative, vo); + if (StrUtil.isNotBlank(negative.getHandlePolices())) { + vo.setHandlePolices(JSON.parseArray(negative.getHandlePolices(), VerifyData.HandlePolice.class)); + } List blameVos = blameService.list(id); vo.setBlames(blameVos); if (!blameVos.isEmpty()) { diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index 0b6ca44..5cb5529 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -9,10 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.common.UserContextHolder; -import com.biutag.supervision.constants.enums.HostLevelEnums; -import com.biutag.supervision.constants.enums.NegativeTaskCategoryEnum; -import com.biutag.supervision.constants.enums.NegativeTaskStatusEnum; -import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.mapper.NegativeTaskMapper; import com.biutag.supervision.pojo.dto.NegativeDto; import com.biutag.supervision.pojo.dto.NegativeImportDistributeDto; @@ -153,9 +150,22 @@ public class NegativeTaskService extends ServiceImpl redisTemplate; + + @Value("${token.timeout}") + private Integer tokenTimeout; + + public String login(String account) { + UserAuth userAuth = buildUserAuth(account); + String token = IdUtil.fastSimpleUUID(); + redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, tokenTimeout, TimeUnit.HOURS); + return token; + } + + public void logout() { + redisTemplate.opsForValue(); + redisTemplate.delete(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, UserContextHolder.getCurrentToken())); + } + public UserAuth buildUserAuth(String account) { BaseUser user = userService.getByUserName(account); SupDepart depart = Optional.ofNullable(policeService.getByIdCode(account)) diff --git a/src/main/resources/jitMessage.properties b/src/main/resources/jitMessage.properties new file mode 100644 index 0000000..586e707 --- /dev/null +++ b/src/main/resources/jitMessage.properties @@ -0,0 +1,5 @@ +#\u8ba4\u8bc1\u5730\u5740 +authURL=http://172.16.22.243:6180/MessageService +#\u5e94\u7528\u6807\u8bc6,\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4fee\u6539\uff0c\u4e0e\u7f51\u5173\u4e2d\u914d\u7f6e\u7684\u5e94\u7528\u6807\u8bc6\u4e00\u81f4 +appId=testApp2 +