Browse Source

250116

main
wxc 11 months ago
parent
commit
949ad7bbba
  1. 6
      pom.xml
  2. 23
      sql/20250116.sql
  3. 3
      src/main/java/com/biutag/supervision/config/InterceptorConfig.java
  4. 3
      src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java
  5. 52
      src/main/java/com/biutag/supervision/controller/LoginController.java
  6. 16
      src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelController.java
  7. 2
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  8. 6
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  9. 6
      src/main/java/com/biutag/supervision/flow/action/SaveAction.java
  10. 8
      src/main/java/com/biutag/supervision/mapper/ModelMapper.java
  11. 3
      src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java
  12. 4
      src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java
  13. 21
      src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingData.java
  14. 22
      src/main/java/com/biutag/supervision/pojo/dto/ModelClueMappingItem.java
  15. 29
      src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java
  16. 4
      src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDistributeDto.java
  17. 13
      src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java
  18. 8
      src/main/java/com/biutag/supervision/pojo/entity/Model.java
  19. 2
      src/main/java/com/biutag/supervision/pojo/entity/ModelGeneration.java
  20. 6
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  21. 32
      src/main/java/com/biutag/supervision/service/DataPetition12337Service.java
  22. 44
      src/main/java/com/biutag/supervision/service/ModelService.java
  23. 7
      src/main/java/com/biutag/supervision/service/NegativeService.java
  24. 22
      src/main/java/com/biutag/supervision/service/NegativeTaskService.java
  25. 2
      src/main/java/com/biutag/supervision/service/NegativeWorkService.java
  26. 23
      src/main/java/com/biutag/supervision/service/UserLoginService.java
  27. 5
      src/main/resources/jitMessage.properties

6
pom.xml

@ -226,9 +226,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jsoup</groupId> <groupId>cn.com.jit</groupId>
<artifactId>jsoup</artifactId> <artifactId>authSDK</artifactId>
<version>1.18.3</version> <version>3.0.3</version>
</dependency> </dependency>
</dependencies> </dependencies>

23
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`;

3
src/main/java/com/biutag/supervision/config/InterceptorConfig.java

@ -35,7 +35,8 @@ public class InterceptorConfig implements WebMvcConfigurer {
registry.addInterceptor(new DefaultInterceptor()) registry.addInterceptor(new DefaultInterceptor())
.addPathPatterns("/**") .addPathPatterns("/**")
.excludePathPatterns("/api/**") .excludePathPatterns("/api/**")
.excludePathPatterns("/login") // 登录
.excludePathPatterns("/login", "/jit/**")
.excludePathPatterns("/auth/self") .excludePathPatterns("/auth/self")
.excludePathPatterns("/file/stream/**", "/templates/**") .excludePathPatterns("/file/stream/**", "/templates/**")
.excludePathPatterns("/datav/risk/**") .excludePathPatterns("/datav/risk/**")

3
src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java

@ -9,7 +9,8 @@ import lombok.Getter;
public enum TimeLimitEnum { public enum TimeLimitEnum {
WORK_137("137工作制", "3+7", 1, 3, 7), 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), WORK_30_30("30+30工作制", "30+30", 1, 30, 30),
OTHER("其他", "other", null, null, null); OTHER("其他", "other", null, null, null);

52
src/main/java/com/biutag/supervision/controller/LoginController.java

@ -1,12 +1,11 @@
package com.biutag.supervision.controller; package com.biutag.supervision.controller;
import cn.hutool.core.util.IdUtil; import cn.com.jit.JitAuthClient;
import com.biutag.supervision.common.UserContextHolder; import com.alibaba.fastjson2.JSON;
import com.biutag.supervision.constants.RedisKeyConstants; import com.alibaba.fastjson2.JSONObject;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.AccountDto; import com.biutag.supervision.pojo.dto.AccountDto;
import com.biutag.supervision.pojo.entity.BaseAccount; 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.pojo.vo.TokenVo;
import com.biutag.supervision.service.BaseAccountService; import com.biutag.supervision.service.BaseAccountService;
import com.biutag.supervision.service.UserLoginService; 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 io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.security.crypto.bcrypt.BCrypt;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Tag(name = "登录接口") @Tag(name = "登录接口")
@Slf4j @Slf4j
@ -34,11 +32,6 @@ public class LoginController {
private final UserLoginService userLoginService; private final UserLoginService userLoginService;
private final RedisTemplate<Object, Object> redisTemplate;
@Value("${token.timeout}")
private Integer tokenTimeout;
@Operation(summary = "登录") @Operation(summary = "登录")
@PostMapping("login") @PostMapping("login")
public Result<TokenVo> login(@RequestBody AccountDto account) { public Result<TokenVo> login(@RequestBody AccountDto account) {
@ -51,17 +44,42 @@ public class LoginController {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
throw new RuntimeException("用户名或密码有误,请重新输入"); throw new RuntimeException("用户名或密码有误,请重新输入");
} }
UserAuth userAuth = userLoginService.buildUserAuth(baseAccount.getAccount()); String token = userLoginService.login(account.getAccount());
String token = IdUtil.fastSimpleUUID();
redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, token), userAuth, tokenTimeout, TimeUnit.HOURS);
return Result.success(new TokenVo().setToken(token)); return Result.success(new TokenVo().setToken(token));
} }
@PostMapping("logout") @PostMapping("logout")
public Result<Void> logout() { public Result<Void> logout() {
redisTemplate.opsForValue(); userLoginService.logout();
redisTemplate.delete(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, UserContextHolder.getCurrentToken()));
return Result.success(); return Result.success();
} }
@Operation(summary ="生成数字证书随机数")
@GetMapping("jit/random")
public Result<String> 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<TokenVo> 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));
}
} }

16
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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.mapper.ModelClassMapper; import com.biutag.supervision.mapper.ModelClassMapper;
import com.biutag.supervision.pojo.Result; 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.dto.ModelDto;
import com.biutag.supervision.pojo.entity.Model; import com.biutag.supervision.pojo.entity.Model;
import com.biutag.supervision.pojo.model.ModelClassModel; import com.biutag.supervision.pojo.model.ModelClassModel;
@ -40,7 +41,7 @@ public class ModelController {
} }
@GetMapping("{id}") @GetMapping("{id}")
public Result<Model> list(@PathVariable String id) { public Result<Model> get(@PathVariable String id) {
return Result.success(modelService.getById(id)); return Result.success(modelService.getById(id));
} }
@ -70,7 +71,7 @@ public class ModelController {
if (Objects.nonNull(modelDto.getInvolveProblem())) { if (Objects.nonNull(modelDto.getInvolveProblem())) {
model.setInvolveProblem(String.join(",", 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 @PutMapping
@ -80,7 +81,7 @@ public class ModelController {
if (Objects.nonNull(modelDto.getInvolveProblem())) { if (Objects.nonNull(modelDto.getInvolveProblem())) {
model.setInvolveProblem(String.join(",", modelDto.getInvolveProblem())); model.setInvolveProblem(String.join(",", modelDto.getInvolveProblem()));
} }
modelService.updateModel(model, modelDto.getProblems()); modelService.updateModel(model, modelDto.getProblems(), modelDto);
return Result.success(model); return Result.success(model);
} }
@ -89,4 +90,13 @@ public class ModelController {
return Result.success(modelService.remove(id)); return Result.success(modelService.remove(id));
} }
/**
*
* @return
*/
@GetMapping("clueMappingData/list")
public Result<List<ModelClueMappingData>> clueMappingData() {
return Result.success(modelService.listClueMappingData());
}
} }

2
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -78,7 +78,7 @@ public class NegativeController {
public Result<NegativeDetail> outerDetail(@PathVariable String id) { public Result<NegativeDetail> outerDetail(@PathVariable String id) {
DataCaseVerif dataCaseVerif = dataCaseVerifService.getOne(new LambdaQueryWrapper<DataCaseVerif>().eq(DataCaseVerif::getOuterId, id)); DataCaseVerif dataCaseVerif = dataCaseVerifService.getOne(new LambdaQueryWrapper<DataCaseVerif>().eq(DataCaseVerif::getOuterId, id));
if (dataCaseVerif == null) { if (dataCaseVerif == null) {
throw new RuntimeException("案件核查数据异常!"); throw new RuntimeException("当前案件未录入一体化平台,请忽略!");
} }
Negative negative = negativeService.getOne(new LambdaUpdateWrapper<Negative>().eq(Negative::getOriginId, dataCaseVerif.getOriginId())); Negative negative = negativeService.getOne(new LambdaUpdateWrapper<Negative>().eq(Negative::getOriginId, dataCaseVerif.getOriginId()));
if (negative == null) { if (negative == null) {

6
src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java

@ -1,6 +1,7 @@
package com.biutag.supervision.flow.action; package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import com.biutag.supervision.util.JSON;
import com.biutag.supervision.util.TimeUtil; import com.biutag.supervision.util.TimeUtil;
import jakarta.validation.Validator; import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -87,6 +89,10 @@ public class ApplyCompletionAction implements Action {
.set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId()) .set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId())
.set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason()) .set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason())
.set(Negative::getInvolveDepartName, departService.getById(verifyData.getInvolveDepartId()).getShortName()); .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()); SupDepart depart = departService.getById(verifyData.getInvolveDepartId());
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) {

6
src/main/java/com/biutag/supervision/flow/action/SaveAction.java

@ -1,6 +1,7 @@
package com.biutag.supervision.flow.action; package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 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.NegativeProblemRelation;
import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import com.biutag.supervision.util.JSON;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -58,6 +60,10 @@ public class SaveAction implements Action {
.set(Negative::getRectifyDesc, verifyData.getRectifyDesc()) .set(Negative::getRectifyDesc, verifyData.getRectifyDesc())
.set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason()) .set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason())
.set(Negative::getCheckStatusName, verifyData.getCheckStatusName()); .set(Negative::getCheckStatusName, verifyData.getCheckStatusName());
// 经办人
if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices())) {
updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices()));
}
// 涉及单位 // 涉及单位
SupDepart depart = departService.getById(verifyData.getInvolveDepartId()); SupDepart depart = departService.getById(verifyData.getInvolveDepartId());
updateWrapper.set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId()) updateWrapper.set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId())

8
src/main/java/com/biutag/supervision/mapper/ModelMapper.java

@ -1,8 +1,16 @@
package com.biutag.supervision.mapper; package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.dto.ModelClueMappingItem;
import com.biutag.supervision.pojo.entity.Model; import com.biutag.supervision.pojo.entity.Model;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface ModelMapper extends BaseMapper<Model> { public interface ModelMapper extends BaseMapper<Model> {
@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<ModelClueMappingItem> selectClueMappingData();
} }

3
src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java

@ -207,4 +207,7 @@ public class NegativeVo {
private List<NegativeScorePolice> scorePolices = new ArrayList<>(); private List<NegativeScorePolice> scorePolices = new ArrayList<>();
// 经办人
private List<VerifyData.HandlePolice> handlePolices = new ArrayList<>();
} }

4
src/main/java/com/biutag/supervision/pojo/dto/DataPetition12337Distribute.java

@ -40,6 +40,10 @@ public class DataPetition12337Distribute {
@NotBlank @NotBlank
private String approvalFlow; private String approvalFlow;
// 下发流程
@NotBlank
private String distributionFlow;
private String businessTypeCode; private String businessTypeCode;
private String businessTypeName; private String businessTypeName;

21
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<ModelClueMappingItem> fields = new ArrayList<>();
private String tableName;
}

22
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;
}

29
src/main/java/com/biutag/supervision/pojo/dto/ModelDto.java

@ -1,12 +1,12 @@
package com.biutag.supervision.pojo.dto; package com.biutag.supervision.pojo.dto;
import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.ModelGeneration;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
@Setter @Setter
@Getter @Getter
@ -81,9 +81,36 @@ public class ModelDto {
// 模型类型 // 模型类型
private String modelType; 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<String> involveProblem = new ArrayList<>();
// 问题类型 // 问题类型
private List<VerifyData.Problem> problems = new ArrayList<>(); private List<VerifyData.Problem> problems = new ArrayList<>();
// 预警内容生成器
private String thingDescGeneration;
// 结果字段映射
private ModelGeneration modelGeneration;
// 同步机构映射
private String clueDepartSource;
} }

4
src/main/java/com/biutag/supervision/pojo/dto/NegativeImportDistributeDto.java

@ -37,6 +37,10 @@ public class NegativeImportDistributeDto {
@NotBlank @NotBlank
private String approvalFlow; private String approvalFlow;
// 下发流程
@NotBlank
private String distributionFlow;
private List<FileVo> thingFiles = new ArrayList<>(); private List<FileVo> thingFiles = new ArrayList<>();
} }

13
src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java

@ -61,6 +61,9 @@ public class VerifyData {
private List<FileVo> files = new ArrayList<>(); private List<FileVo> files = new ArrayList<>();
// 经办人
private List<HandlePolice> handlePolices;
@Setter @Setter
@Getter @Getter
public static class Blame { public static class Blame {
@ -146,6 +149,8 @@ public class VerifyData {
private String type; private String type;
} }
@Setter @Setter
@ -230,4 +235,12 @@ public class VerifyData {
} }
@Setter
@Getter
public static class HandlePolice {
private String name;
private String empNo;
private String idCode;
}
} }

8
src/main/java/com/biutag/supervision/pojo/entity/Model.java

@ -120,8 +120,6 @@ public class Model {
// 模型结果表名 // 模型结果表名
private String clueTableName; private String clueTableName;
// 同步时间字段名
private String clueTimeFieldName;
// 同步唯一字段名 // 同步唯一字段名
private String clueUniqueFieldName; private String clueUniqueFieldName;
@ -135,4 +133,10 @@ public class Model {
// 同步时间 // 同步时间
private String clueCycleTime; private String clueCycleTime;
// 同步机构映射
private String clueDepartSource;
// 预警内容生成器
private String thingDescGeneration;
} }

2
src/main/java/com/biutag/supervision/pojo/entity/ModelGeneration.java

@ -13,7 +13,7 @@ import java.time.LocalDateTime;
public class ModelGeneration { public class ModelGeneration {
// //
@TableId(value = "id") @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Integer id;
// //

6
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.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Accessors(chain = true) @Accessors(chain = true)
@Setter @Setter
@ -297,4 +300,7 @@ public class Negative {
// 三级部门 // 三级部门
private String threeInvolveDepartId; private String threeInvolveDepartId;
// 经办人
private String handlePolices;
} }

32
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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.DistributionStateEnum; import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.constants.enums.HostLevelEnums;
import com.biutag.supervision.constants.enums.ProblemSourcesEnum;
import com.biutag.supervision.mapper.DataPetition12337Mapper; import com.biutag.supervision.mapper.DataPetition12337Mapper;
import com.biutag.supervision.pojo.dto.DataPetition12337Distribute; import com.biutag.supervision.pojo.dto.DataPetition12337Distribute;
import com.biutag.supervision.pojo.dto.DataPetition12337Dto; import com.biutag.supervision.pojo.dto.DataPetition12337Dto;
@ -122,21 +120,25 @@ public class DataPetition12337Service extends ServiceImpl<DataPetition12337Mappe
negativeDto.setContactPhone(item.getPhone()); negativeDto.setContactPhone(item.getPhone());
negativeDto.setThingDesc(item.getWjwfProject()); negativeDto.setThingDesc(item.getWjwfProject());
negativeDto.setThingFiles(distributeData.getThingFiles()); negativeDto.setThingFiles(distributeData.getThingFiles());
String departId; String involveDepartId;
String departName; String involveDepartName;
if (StrUtil.isNotBlank(item.getThirdDepartId())) { if (StrUtil.isNotBlank(item.getThirdDepartId())) {
departId = item.getThirdDepartId(); involveDepartId = item.getThirdDepartId();
departName = item.getThirdDepartName(); involveDepartName = item.getThirdDepartName();
} else { } else {
departId = item.getSecondDepartId(); involveDepartId = item.getSecondDepartId();
departName = item.getSecondDepartName(); involveDepartName = item.getSecondDepartName();
}
negativeDto.setInvolveDepartId(involveDepartId); // 涉及单位
negativeDto.setInvolveDepartName(involveDepartName);
// 办理单位
if (StrUtil.isBlank(item.getThirdDepartId()) || DistributionFlowEnum.SECOND.getValue().equals(distributeData.getDistributionFlow())) {
negativeDto.setDepartId(item.getSecondDepartId());
negativeDto.setDepartName(item.getSecondDepartId());
} else {
negativeDto.setDepartId(item.getThirdDepartId());
negativeDto.setDepartName(item.getThirdDepartName());
} }
negativeDto.setInvolveDepartId(departId); // 涉及单位
negativeDto.setInvolveDepartName(departName);
negativeDto.setDepartId(departId);
negativeDto.setDepartName(departName);
negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue());
negativeDto.setApprovalFlow(distributeData.getApprovalFlow()); // 审批流程 negativeDto.setApprovalFlow(distributeData.getApprovalFlow()); // 审批流程
negativeDto.setTimeLimit(distributeData.getTimeLimit()); // 办理时限 negativeDto.setTimeLimit(distributeData.getTimeLimit()); // 办理时限

44
src/main/java/com/biutag/supervision/service/ModelService.java

@ -8,8 +8,12 @@ import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.DistributionCycleEnum; import com.biutag.supervision.constants.enums.DistributionCycleEnum;
import com.biutag.supervision.constants.enums.DistributionMethodEnum; import com.biutag.supervision.constants.enums.DistributionMethodEnum;
import com.biutag.supervision.mapper.ModelMapper; import com.biutag.supervision.mapper.ModelMapper;
import com.biutag.supervision.pojo.dto.ModelClueMappingData;
import com.biutag.supervision.pojo.dto.ModelClueMappingItem;
import com.biutag.supervision.pojo.dto.ModelDto;
import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.Model; import com.biutag.supervision.pojo.entity.Model;
import com.biutag.supervision.pojo.entity.ModelGeneration;
import com.biutag.supervision.pojo.entity.ModelProblemType; import com.biutag.supervision.pojo.entity.ModelProblemType;
import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.util.ExpressionBuilder; import com.biutag.supervision.util.ExpressionBuilder;
@ -19,6 +23,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -26,12 +32,14 @@ public class ModelService extends ServiceImpl<ModelMapper, Model> {
private final ModelProblemTypeService modelProblemTypeService; private final ModelProblemTypeService modelProblemTypeService;
private final ModelGenerationService modelGenerationService;
public List<Model> listByDistributionMethodOfNegative() { public List<Model> listByDistributionMethodOfNegative() {
return list(new LambdaQueryWrapper<Model>().eq(Model::getDistributionMethod, DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue())); return list(new LambdaQueryWrapper<Model>().eq(Model::getDistributionMethod, DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue()));
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveModel(Model model, List<VerifyData.Problem> problems) { public boolean saveModel(Model model, List<VerifyData.Problem> problems, ModelDto modelDto) {
if (StrUtil.isNotBlank(model.getDistributionCycle()) && DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { if (StrUtil.isNotBlank(model.getDistributionCycle()) && DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) {
String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) : String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) :
ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek()); ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek());
@ -44,6 +52,13 @@ public class ModelService extends ServiceImpl<ModelMapper, Model> {
model.setCreateDepartId(user.getDepartId()); model.setCreateDepartId(user.getDepartId());
model.setCreateDepartName(user.getDepartName()); model.setCreateDepartName(user.getDepartName());
boolean save = save(model); 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()) { if (!problems.isEmpty()) {
List<ModelProblemType> problemTypes = problems.stream().map(item -> { List<ModelProblemType> problemTypes = problems.stream().map(item -> {
ModelProblemType modelProblemType = new ModelProblemType(); ModelProblemType modelProblemType = new ModelProblemType();
@ -57,7 +72,7 @@ public class ModelService extends ServiceImpl<ModelMapper, Model> {
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateModel(Model model, List<VerifyData.Problem> problems) { public boolean updateModel(Model model, List<VerifyData.Problem> problems, ModelDto modelDto) {
if (StrUtil.isNotBlank(model.getDistributionCycle()) && DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) { if (StrUtil.isNotBlank(model.getDistributionCycle()) && DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue().equals(model.getDistributionMethod())) {
String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) : String expression = DistributionCycleEnum.day.name().equals(model.getDistributionCycle()) ? ExpressionBuilder.build(model.getDistributionCycleTime()) :
ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek()); ExpressionBuilder.build(model.getDistributionCycleTime(), model.getDistributionCycleDayOfWeek());
@ -74,12 +89,37 @@ public class ModelService extends ServiceImpl<ModelMapper, Model> {
}).toList(); }).toList();
modelProblemTypeService.saveBatch(problemTypes); modelProblemTypeService.saveBatch(problemTypes);
} }
if ("2".equals(modelDto.getModelingMethod()) && modelDto.getModelGeneration() != null) {
ModelGeneration one = modelGenerationService.getOne(new LambdaQueryWrapper<ModelGeneration>().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); return updateById(model);
} }
@Transactional(rollbackFor = Exception.class)
public boolean remove(Integer modelId) { public boolean remove(Integer modelId) {
modelGenerationService.remove(new LambdaQueryWrapper<ModelGeneration>().eq(ModelGeneration::getModelId, modelId));
return removeById(modelId); return removeById(modelId);
} }
public List<ModelClueMappingData> listClueMappingData() {
List<ModelClueMappingItem> items = baseMapper.selectClueMappingData();
Map<String, List<ModelClueMappingItem>> collect = items.stream().collect(Collectors.groupingBy(ModelClueMappingItem::getTableName));
List<ModelClueMappingData> list = collect.keySet().stream().sorted().map(tableName -> {
ModelClueMappingData data = new ModelClueMappingData();
data.setTableName(tableName);
data.setFields(collect.get(tableName));
return data;
}).toList();
return list;
}
} }

7
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.NumberUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; 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.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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 com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -90,7 +92,10 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
List<FlowAction> flowActions = flowActionService.list(flowKey.get()); List<FlowAction> flowActions = flowActionService.list(flowKey.get());
NegativeVo vo = new NegativeVo(); 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<Blame> blameVos = blameService.list(id); List<Blame> blameVos = blameService.list(id);
vo.setBlames(blameVos); vo.setBlames(blameVos);
if (!blameVos.isEmpty()) { if (!blameVos.isEmpty()) {

22
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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.HostLevelEnums; import com.biutag.supervision.constants.enums.*;
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.mapper.NegativeTaskMapper; import com.biutag.supervision.mapper.NegativeTaskMapper;
import com.biutag.supervision.pojo.dto.NegativeDto; import com.biutag.supervision.pojo.dto.NegativeDto;
import com.biutag.supervision.pojo.dto.NegativeImportDistributeDto; import com.biutag.supervision.pojo.dto.NegativeImportDistributeDto;
@ -153,9 +150,22 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
negativeDto.setThingFiles(distributeData.getThingFiles()); negativeDto.setThingFiles(distributeData.getThingFiles());
SupDepart depart = departService.getById(item.getInvolveDepartId()); SupDepart depart = departService.getById(item.getInvolveDepartId());
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) {
negativeDto.setDepartId(depart.getId());
negativeDto.setDepartName(depart.getShortName());
} else if(DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) {
if (DistributionFlowEnum.SECOND.getValue().equals(distributeData.getDistributionFlow())) {
SupDepart parent = departService.getById(depart.getPid());
negativeDto.setDepartId(parent.getId());
negativeDto.setDepartName(parent.getShortName());
} else {
negativeDto.setDepartId(depart.getId());
negativeDto.setDepartName(depart.getShortName());
}
} else {
throw new RuntimeException("数据异常,请联系系统管理员");
}
negativeDto.setDepartId(item.getInvolveDepartId());
negativeDto.setDepartName(depart.getShortName());
negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue());
negativeDto.setApprovalFlow(distributeData.getApprovalFlow()); // 审批流程 negativeDto.setApprovalFlow(distributeData.getApprovalFlow()); // 审批流程

2
src/main/java/com/biutag/supervision/service/NegativeWorkService.java

@ -60,8 +60,8 @@ public class NegativeWorkService extends ServiceImpl<NegativeWorkMapper, Negativ
.eq(StrUtil.isNotBlank(param.getSpecialSupervision()), "n.special_supervision", param.getSpecialSupervision()) .eq(StrUtil.isNotBlank(param.getSpecialSupervision()), "n.special_supervision", param.getSpecialSupervision())
.eq(Objects.nonNull(param.getCrtDepartLevel()), "n.crt_depart_level", param.getCrtDepartLevel()) .eq(Objects.nonNull(param.getCrtDepartLevel()), "n.crt_depart_level", param.getCrtDepartLevel())
.like(StrUtil.isNotBlank(param.getReportNumber()), "n.report_number", param.getReportNumber()) .like(StrUtil.isNotBlank(param.getReportNumber()), "n.report_number", param.getReportNumber())
.like(StrUtil.isNotBlank(param.getCaseNumber()), "n.case_number", param.getCaseNumber())
.in(Objects.nonNull(param.getHandleResultCode()) && !param.getHandleResultCode().isEmpty(), "nb.handleResultCode", param.getHandleResultCode()) .in(Objects.nonNull(param.getHandleResultCode()) && !param.getHandleResultCode().isEmpty(), "nb.handleResultCode", param.getHandleResultCode())
.orderByDesc("w.create_time"); .orderByDesc("w.create_time");
if (param.getHappenTime().size() == 2) { if (param.getHappenTime().size() == 2) {

23
src/main/java/com/biutag/supervision/service/UserLoginService.java

@ -1,12 +1,18 @@
package com.biutag.supervision.service; package com.biutag.supervision.service;
import cn.hutool.core.util.IdUtil;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.RedisKeyConstants;
import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.model.UserAuth;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.TimeUnit;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
@ -24,6 +30,23 @@ public class UserLoginService {
private final NegSourceAuthorityService negSourceAuthorityService; private final NegSourceAuthorityService negSourceAuthorityService;
private final RedisTemplate<Object, Object> 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) { public UserAuth buildUserAuth(String account) {
BaseUser user = userService.getByUserName(account); BaseUser user = userService.getByUserName(account);
SupDepart depart = Optional.ofNullable(policeService.getByIdCode(account)) SupDepart depart = Optional.ofNullable(policeService.getByIdCode(account))

5
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
Loading…
Cancel
Save