diff --git a/libs/words/installMavenJar.bat b/libs/words/installMavenJar.bat new file mode 100644 index 0000000..c8c3b53 --- /dev/null +++ b/libs/words/installMavenJar.bat @@ -0,0 +1 @@ +mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dfile="words-15.8.0.jar" -Dpackaging=jar \ No newline at end of file diff --git a/libs/words/words-15.8.0.jar b/libs/words/words-15.8.0.jar new file mode 100644 index 0000000..c0e699f Binary files /dev/null and b/libs/words/words-15.8.0.jar differ diff --git a/pom.xml b/pom.xml index 1429e95..f933067 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,27 @@ com.microsoft.sqlserver mssql-jdbc - 9.4.0.jre11 + 12.8.1.jre11 + + + javax.xml.bind + jaxb-api + 2.3.0 + + + com.sun.xml.bind + jaxb-impl + 2.3.0 + + + com.sun.xml.bind + jaxb-core + 2.3.0 + + + javax.activation + activation + 1.1.1 @@ -181,6 +201,12 @@ 4.9 + + com.aspose + aspose-words + 15.8.0 + + diff --git a/sql/1126.sql b/sql/1126.sql new file mode 100644 index 0000000..a1c340a --- /dev/null +++ b/sql/1126.sql @@ -0,0 +1,34 @@ +ALTER TABLE `negative`.`negative` + ADD COLUMN `countersign_apply_id` int; + +INSERT INTO `negative`.`flow_action`(`id`, `action_key`, `flow_key`, `next_flow_key`, `button_label`, `button_type`, `plain`, `sort`, `action_name`, `validate_form`, `do_close`, `open_dialog`) VALUES (21, 'apply_countersign', 'second_approve', NULL, '单位会签', 'primary', 1, 1, '发起会签', 0, NULL, 1); +INSERT INTO `negative`.`flow_action`(`id`, `action_key`, `flow_key`, `next_flow_key`, `button_label`, `button_type`, `plain`, `sort`, `action_name`, `validate_form`, `do_close`, `open_dialog`) VALUES (22, 'countersign', 'countersign', NULL, '提交会签', 'primary', 0, 1, '提交会签', 1, 1, 0); +INSERT INTO `negative`.`flow_action`(`id`, `action_key`, `flow_key`, `next_flow_key`, `button_label`, `button_type`, `plain`, `sort`, `action_name`, `validate_form`, `do_close`, `open_dialog`) VALUES (23, 'apply_countersign', 'first_approve', '', '单位会签', 'primary', 1, 1, '发起会签', 0, NULL, 1); + + +CREATE TABLE `negative_countersign` ( + `id` int NOT NULL AUTO_INCREMENT, + `countersign_apply_id` int NOT NULL, + `negative_id` varchar(40) NOT NULL, + `comments` text , + `files` text , + `depart_id` varchar(40) DEFAULT NULL, + `depart_name` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `creator` varchar(255) DEFAULT NULL, + `creator_name` varchar(255) DEFAULT NULL, + `state` varchar(255) DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='单位会签表'; + +CREATE TABLE `negative_countersign_apply` ( + `id` int NOT NULL AUTO_INCREMENT, + `negative_id` varchar(40) NOT NULL, + `requirement` text NOT NULL, + `create_time` datetime NOT NULL, + `creator` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, + `creator_name` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, + `create_depart_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 COMMENT='单位会签申请表'; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/constants/AppConstants.java b/src/main/java/com/biutag/supervision/constants/AppConstants.java index 6d67389..a71035e 100644 --- a/src/main/java/com/biutag/supervision/constants/AppConstants.java +++ b/src/main/java/com/biutag/supervision/constants/AppConstants.java @@ -25,4 +25,8 @@ public class AppConstants { public static final String SIGN_RETURN_ACTION_NAME = "已退回"; + public static final String UN_DEL = "0"; + + public static final String DEL = "1"; + } diff --git a/src/main/java/com/biutag/supervision/constants/enums/CountersignState.java b/src/main/java/com/biutag/supervision/constants/enums/CountersignState.java new file mode 100644 index 0000000..ead7778 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/CountersignState.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.constants.enums; + +/** + * @author wxc + * @date 2024/11/26 + */ +public enum CountersignState { + + uncompleted, + completed; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java index 18b7a41..10e909a 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java @@ -7,6 +7,7 @@ import lombok.Getter; @Getter public enum DepartLevelEnum { + FIRST(0), SECOND_CATEGORY(1), SECOND(2), THREE(3); diff --git a/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java index 8bbe13c..17ef861 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/FlowNodeEnum.java @@ -18,6 +18,7 @@ public enum FlowNodeEnum { FIRST_APPROVE("first_approve"), SECOND_EXTENSION_APPROVE("second_extension_approve"), FIRST_EXTENSION_APPROVE("first_extension_approve"), + COUNTERSIGN("countersign"), COMPLETED("completed"); private String key; diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java index 029e10c..2b12d0e 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java @@ -28,7 +28,7 @@ public enum ProblemSourcesEnum { JJZRSJ("经济责任审计", "29"), ZXSJ("专项审计", "30"), - JWDC("警务评议", "2"), + JWDC("民意感知", "2"), JYDC("警意调查", "3"), CFJD("持法监督", "4"), JCKH("检查考核", "8"), diff --git a/src/main/java/com/biutag/supervision/controller/FileController.java b/src/main/java/com/biutag/supervision/controller/FileController.java index a1dd2d9..a9893c8 100644 --- a/src/main/java/com/biutag/supervision/controller/FileController.java +++ b/src/main/java/com/biutag/supervision/controller/FileController.java @@ -4,6 +4,7 @@ import cn.hutool.core.io.IoUtil; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.vo.FileVo; import com.biutag.supervision.service.FileService; +import com.biutag.supervision.util.WordUtil; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.io.InputStream; @Slf4j @RequiredArgsConstructor @@ -40,7 +42,11 @@ public class FileController { } else { response.setContentType("application/octet-stream"); } - IoUtil.copy(fileService.download(filePath), response.getOutputStream()); + InputStream is = fileService.download(filePath); + if (filePath.toLowerCase().endsWith(".doc")) { + is = WordUtil.convertDocx(is); + } + IoUtil.copy(is, response.getOutputStream()); } } diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/RiskPersonalController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/RiskPersonalController.java index d1db9b7..b3955d7 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/RiskPersonalController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/RiskPersonalController.java @@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.RiskPersonalDetail; import com.biutag.supervision.pojo.entity.*; @@ -45,11 +46,22 @@ public class RiskPersonalController { @GetMapping public Result> list(RiskPersonalQueryParam param) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.like(StrUtil.isNotBlank(param.getName()), RiskPersonal::getName, param.getName()) + queryWrapper + .eq(RiskPersonal::getDel, AppConstants.UN_DEL) + .like(StrUtil.isNotBlank(param.getName()), RiskPersonal::getName, param.getName()) .like(StrUtil.isNotBlank(param.getMobileNumber()), RiskPersonal::getMobileNumber, param.getMobileNumber()) .like(StrUtil.isNotBlank(param.getIdCode()), RiskPersonal::getIdCode, param.getIdCode()) .eq(Objects.nonNull(param.getAge()), RiskPersonal::getAge, param.getAge()) - .eq(StrUtil.isNotBlank(param.getControlDepartId()), RiskPersonal::getControlDepartId, param.getControlDepartId()); + .like(StrUtil.isNotBlank(param.getTags()), RiskPersonal::getTags, param.getTags()); + if (StrUtil.isNotBlank(param.getTags())) { + LambdaQueryWrapper qw = new LambdaQueryWrapper() + .like(RiskPersonalTag::getSmallTag, param.getTags()); + List personalTags = riskPersonalTagService.list(qw); + if (personalTags.isEmpty()) { + return Result.success(new Page().setTotal(0).setRecords(new ArrayList<>())); + } + queryWrapper.in(RiskPersonal::getIdCode, personalTags.stream().map(RiskPersonalTag::getIdCode).collect(Collectors.toSet())); + } queryWrapper.orderByDesc(RiskPersonal::getRiskScore).orderByDesc(RiskPersonal::getCreateTime); Page page = riskPersonalService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); if (page.getRecords().isEmpty()) { @@ -86,7 +98,7 @@ public class RiskPersonalController { List records = models.isEmpty() ? new ArrayList<>() : riskModelTaskClueService.page(Page.of(1, 100), new LambdaQueryWrapper() .eq(RiskModelTaskClue::getIdCode, riskPersonal.getIdCode()) .in(RiskModelTaskClue::getModelId, models.stream().map(Model::getId).toList()) - .eq(RiskModelTaskClue::getDel, "0") + .eq(RiskModelTaskClue::getDel, AppConstants.UN_DEL) .orderByDesc(RiskModelTaskClue::getScore) .orderByAsc(RiskModelTaskClue::getCreateTime)).getRecords(); riskRule.setClues(records); diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java index d8e83cb..5eb4d28 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ScoreController.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.NumberUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.mapper.DepartScoreMapper; import com.biutag.supervision.mapper.PoliceScoreMapper; import com.biutag.supervision.pojo.Result; @@ -93,7 +94,7 @@ public class ScoreController { if (Objects.isNull(size)) { size = 1000000; } - List riskPersonals = riskPersonalService.page(Page.of(1, size), new LambdaQueryWrapper().eq(RiskPersonal::getDel, "0") + List riskPersonals = riskPersonalService.page(Page.of(1, size), new LambdaQueryWrapper().eq(RiskPersonal::getDel, AppConstants.UN_DEL) ).getRecords(); log.info("{}条数据正在打分", riskPersonals.size()); List rules1 = riskScoreRuleService.list(new LambdaQueryWrapper().eq(RiskScoreRule::getLevel, 1)); @@ -111,7 +112,7 @@ public class ScoreController { double score3 = riskModelTaskClueService.list(new LambdaQueryWrapper() .eq(RiskModelTaskClue::getModelId, model.getId()) .eq(RiskModelTaskClue::getIdCode, personal.getIdCode()) - .eq(RiskModelTaskClue::getDel, "0")) + .eq(RiskModelTaskClue::getDel, AppConstants.UN_DEL)) .stream().mapToDouble(RiskModelTaskClue::getScore).sum(); score3 = Math.min(rule2.getScore(), score3); log.info("{} 分值 = {}", rule2.getRiskName(), score3); diff --git a/src/main/java/com/biutag/supervision/flow/FlowService.java b/src/main/java/com/biutag/supervision/flow/FlowService.java index a7f5da8..a74dcda 100644 --- a/src/main/java/com/biutag/supervision/flow/FlowService.java +++ b/src/main/java/com/biutag/supervision/flow/FlowService.java @@ -32,7 +32,7 @@ public class FlowService { public Boolean execute(ActionDto actionDto) { Action action = actions .stream() - .filter(item -> item.getClass().getName().contains(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey())))) + .filter(item -> item.getClass().getSimpleName().startsWith(StrUtil.upperFirst(StrUtil.toCamelCase(actionDto.getActionKey())))) .findFirst() .orElseThrow(() -> new RuntimeException("配置异常,请联系系统管理员")); action.next(actionDto); 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 ee96306..a953bf0 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -95,7 +95,7 @@ public class ApplyCompletionAction implements Action { } negativeBlame - .setBlameId(IdUtil.fastSimpleUUID()) + .setBlameId(IdUtil.getSnowflakeNextIdStr()) .setNegativeId(negativeId) .setCrtTime(now) .setUpdTime(now); diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java new file mode 100644 index 0000000..f6c084b --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java @@ -0,0 +1,107 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.ApplyCountersignData; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.*; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @author wxc + * @date 2024/11/26 + */ +@RequiredArgsConstructor +@Component +public class ApplyCountersignAction implements Action { + + private final NegativeCountersignApplyService countersignApplyService; + + private final NegativeCountersignService countersignService; + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + private final SupDepartService departService; + + @Override + public void next(ActionDto actionDto) { + ApplyCountersignData applyCountersignData = BeanUtil.toBean(actionDto.getData(), ApplyCountersignData.class); + addWork(actionDto, applyCountersignData); + addCountersign(actionDto.getNegativeId(), applyCountersignData); + } + + private void addCountersign(String negativeId, ApplyCountersignData applyCountersignData) { + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeCountersignApply countersignApply = new NegativeCountersignApply(); + countersignApply.setNegativeId(negativeId) + .setRequirement(applyCountersignData.getRequirement()) + .setCreateTime(LocalDateTime.now()) + .setCreator(user.getUserName()) + .setCreatorName(user.getNickName()); + countersignApplyService.save(countersignApply); + Set departIds = applyCountersignData.getCountersignDeparts().stream().map(ApplyCountersignData.CountersignDepart::getId).collect(Collectors.toSet()); + + List countersigns = departIds.stream().map(departId -> { + NegativeCountersign countersign = new NegativeCountersign(); + countersign.setCountersignApplyId(countersignApply.getId()) + .setNegativeId(negativeId) + .setDepartId(departId) + .setDepartName(departService.getById(departId).getShortName()) + .setState(CountersignState.uncompleted.name()) + .setCreateTime(LocalDateTime.now()); + return countersign; + }).toList(); + countersignService.saveBatch(countersigns); + // 更新 + negativeService.update(new LambdaUpdateWrapper().eq(Negative::getId, negativeId) + .set(Negative::getCountersignApplyId, countersignApply.getId()) + .set(Negative::getUpdTime, LocalDateTime.now())); + } + + private void addWork(ActionDto actionDto, ApplyCountersignData applyCountersignData) { + List works = workService.list(actionDto.getNegativeId()); + Set departIds = applyCountersignData.getCountersignDeparts().stream() + .map(ApplyCountersignData.CountersignDepart::getId) + .collect(Collectors.toSet()); + List filterWorks = works.stream().filter(item -> !FlowNodeEnum.COUNTERSIGN.getKey().equals(item.getFlowKey()) && departIds.contains(item.getDepartId())).toList(); + if (!filterWorks.isEmpty()) { + throw new RuntimeException(String.format("办理单位【%s】不能参与会签", filterWorks.stream().map(NegativeWork::getDepartName).collect(Collectors.joining("、")))); + } + List workDepartIds = works.stream().filter(item -> FlowNodeEnum.COUNTERSIGN.getKey().equals(item.getFlowKey()) && departIds.contains(item.getDepartId())).map(NegativeWork::getDepartId).toList(); + if (!workDepartIds.isEmpty()) { + // 删除 之前work记录,避免重复 + workService.remove(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, actionDto.getNegativeId()).in(NegativeWork::getDepartId, workDepartIds)); + } + Integer workId = actionDto.getWorkId(); + NegativeWork work = workService.getById(workId); + List negativeWorks = departIds.stream().map(departId -> { + NegativeWork w = new NegativeWork(); + SupDepart depart = departService.getById(departId); + w.setRoleCode(depart.getLevel().equals(DepartLevelEnum.SECOND.getValue()) ? RoleCodeEnum.SECOND_ADMIN.getCode() : RoleCodeEnum.THREE_ADMIN.getCode()) + .setStatus(WorkStatusEnum.todo.name()) + .setDepartId(departId) + .setNegativeId(actionDto.getNegativeId()) + .setDepartName(depart.getShortName()) + .setProblemSourcesCode(work.getProblemSourcesCode()) + .setCreateTime(LocalDateTime.now()) + .setUpdateTime(LocalDateTime.now()) + .setFlowKey("countersign"); + return w; + }).toList(); + workService.saveBatch(negativeWorks); + } + +} diff --git a/src/main/java/com/biutag/supervision/flow/action/CountersignAction.java b/src/main/java/com/biutag/supervision/flow/action/CountersignAction.java new file mode 100644 index 0000000..d8fb16f --- /dev/null +++ b/src/main/java/com/biutag/supervision/flow/action/CountersignAction.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.flow.action; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.CountersignState; +import com.biutag.supervision.constants.enums.WorkStatusEnum; +import com.biutag.supervision.pojo.dto.ActionDto; +import com.biutag.supervision.pojo.dto.flow.CountersignData; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeCountersign; +import com.biutag.supervision.pojo.entity.NegativeWork; +import com.biutag.supervision.service.NegativeCountersignService; +import com.biutag.supervision.service.NegativeService; +import com.biutag.supervision.service.NegativeWorkService; +import com.biutag.supervision.util.JSON; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.Objects; + +/** + * @author wxc + * @date 2024/11/26 + */ +@RequiredArgsConstructor +@Component +public class CountersignAction implements Action { + + private final NegativeCountersignService countersignService; + + private final NegativeService negativeService; + + private final NegativeWorkService workService; + + @Override + public void next(ActionDto actionDto) { + CountersignData countersignData = BeanUtil.toBean(actionDto.getData(), CountersignData.class); + addWork(actionDto.getWorkId()); + updateCountersign(actionDto.getNegativeId(), actionDto.getWorkId(), countersignData); + } + + public void updateCountersign(String negativeId, Integer workId, CountersignData countersignData) { + Negative negative = negativeService.getById(negativeId); + NegativeWork work = workService.getById(workId); + countersignService.update(new LambdaUpdateWrapper() + .eq(NegativeCountersign::getNegativeId, negativeId) + .eq(NegativeCountersign::getCountersignApplyId, negative.getCountersignApplyId()) + .eq(NegativeCountersign::getDepartId, work.getDepartId()) + .set(NegativeCountersign::getComments, countersignData.getComments()) + .set(NegativeCountersign::getFiles, Objects.isNull(countersignData.getFiles()) || countersignData.getFiles().isEmpty() ? null : + JSON.toJSONString(countersignData.getFiles())) + .set(NegativeCountersign::getState, CountersignState.completed.name()) + .set(NegativeCountersign::getUpdateTime, LocalDateTime.now())); + } + + public void addWork(Integer workId) { + workService.update(new LambdaUpdateWrapper().eq(NegativeWork::getId, workId).set(NegativeWork::getStatus, WorkStatusEnum.done.name()).set(NegativeWork::getUpdateTime, LocalDateTime.now())); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java index 0ecbce5..2f40e03 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/FirstExtensionReturnAction.java @@ -47,10 +47,12 @@ public class FirstExtensionReturnAction implements Action { } public void addExtensionApprove(ActionDto actionDto, String comments) { + Negative negative = negativeService.getById(actionDto.getNegativeId()); UserAuth user = UserContextHolder.getCurrentUser(); NegativeWork work = workService.getById(actionDto.getWorkId()); NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() .setNegativeId(actionDto.getNegativeId()) + .setNegativeExtensionApplyId(negative.getNegativeExtensionApplyId()) .setComments(comments) .setHandlerDepartId(work.getDepartId()) .setHandlerDepartName(work.getDepartName()) 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 705ee8d..27f67f2 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java @@ -72,8 +72,9 @@ public class SaveAction implements Action { /** * 如果涉及不为空,则先删除原有数据,再新增 */ + negativeBlameService.remove(negativeId); + negativeProblemRelationService.remove(negativeId); if (!verifyData.getBlames().isEmpty()) { - negativeBlameService.remove(negativeId); List problemRelations = new ArrayList<>(); List negativeBlames = verifyData.getBlames().stream().map(item -> { NegativeBlame negativeBlame = new NegativeBlame(); @@ -84,7 +85,7 @@ public class SaveAction implements Action { BeanUtil.copyProperties(blameLeader, negativeBlame); } negativeBlame.setNegativeId(negativeId) - .setBlameId(IdUtil.fastSimpleUUID()) + .setBlameId(IdUtil.getSnowflakeNextIdStr()) .setCrtTime(LocalDateTime.now()) .setUpdTime(LocalDateTime.now()); problemRelations.addAll(item.getProblems().stream().map(problem -> { @@ -101,7 +102,6 @@ public class SaveAction implements Action { negativeBlameService.saveBatch(negativeBlames); // 新增涉及人员问题类型 if (!problemRelations.isEmpty()) { - negativeProblemRelationService.remove(negativeId); negativeProblemRelationService.saveBatch(problemRelations); } } diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java index 8f32dae..1004802 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionReturnAction.java @@ -47,10 +47,12 @@ public class SecondExtensionReturnAction implements Action { } public void addExtensionApprove(ActionDto actionDto, String comments) { + Negative negative = negativeService.getById(actionDto.getNegativeId()); UserAuth user = UserContextHolder.getCurrentUser(); NegativeWork work = workService.getById(actionDto.getWorkId()); NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() .setNegativeId(actionDto.getNegativeId()) + .setNegativeExtensionApplyId(negative.getNegativeExtensionApplyId()) .setComments(comments) .setHandlerDepartId(work.getDepartId()) .setHandlerDepartName(work.getDepartName()) diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeCountersignApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeCountersignApplyMapper.java new file mode 100644 index 0000000..8aea92a --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeCountersignApplyMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeCountersignApply; + +public interface NegativeCountersignApplyMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java new file mode 100644 index 0000000..199f1f1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.NegativeCountersign; + +public interface NegativeCountersignMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/domain/CountersignApply.java b/src/main/java/com/biutag/supervision/pojo/domain/CountersignApply.java new file mode 100644 index 0000000..d1bd1d6 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/CountersignApply.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.entity.NegativeCountersign; +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; + +/** + * @author wxc + * @date 2024/11/26 + */ +@Accessors(chain = true) +@Setter +@Getter +public class CountersignApply { + + private Integer id; + + private String requirement; + + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime createTime; + + private String creatorName; + + private String createDepartName; + + private List countersigns = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java b/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java index f4e7d93..476a1b1 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/ExtensionApply.java @@ -1,6 +1,7 @@ package com.biutag.supervision.pojo.domain; -import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.pojo.model.ExtensionApproveStepModel; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -14,25 +15,13 @@ import java.util.List; @Getter public class ExtensionApply { - private Integer id; - - private String negativeId; - - private String handlerDepartId; - - private String handlerDepartName; - - private String handlerUserName; - - private String handlerName; - private String comments; private Integer extensionDays; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime createTime; - private List approves = new ArrayList<>(); - + private List approveSteps = new ArrayList<>(); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java index 7b43b21..0df4b43 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeDetail.java @@ -32,6 +32,8 @@ public class NegativeDetail { // 延期申请 private ExtensionApply extensionApply; + private List countersignApplys = new ArrayList<>(); + // 是否收藏 private Boolean isFav; 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 2737e53..1712de6 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java @@ -186,6 +186,9 @@ public class NegativeVo { // 佐证材料情况 private String verifyFileSituation; + // 单位会签ID + private Integer countersignApplyId; + // 涉及人员 private List blames = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/ApplyCountersignData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApplyCountersignData.java new file mode 100644 index 0000000..0ee1fdf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/ApplyCountersignData.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.pojo.dto.flow; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/26 + */ +@Setter +@Getter +public class ApplyCountersignData { + + @NotBlank(message = "会签具体要求不能为空") + private String requirement; + + @Size(min = 1, message = "参与会签单位不能少于1个") + private List countersignDeparts = new ArrayList<>(); + + @Setter + @Getter + public class CountersignDepart { + private String id; + } +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/CountersignData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/CountersignData.java new file mode 100644 index 0000000..818a9c0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/CountersignData.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.dto.flow; + +import com.biutag.supervision.pojo.vo.FileVo; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** + * @author wxc + * @date 2024/11/26 + */ +@Setter +@Getter +public class CountersignData { + + @NotBlank(message = "会签具体要求不能为空") + private String comments; + + private List files; + +} 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 65ae198..14ad7c8 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 @@ -223,6 +223,8 @@ public class VerifyData { @NotBlank private String threeLevelContent; + private String threeLevelContentOther; + } } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataMigration.java b/src/main/java/com/biutag/supervision/pojo/entity/DataMigration.java index 5591269..04a4d01 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataMigration.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataMigration.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -7,7 +8,6 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; -import java.util.Date; /** * 数据库迁移记录 @@ -19,7 +19,7 @@ public class DataMigration implements Serializable { /** * 数据迁移操作id */ - @TableId(value = "id") + @TableId(value = "id", type = IdType.AUTO) private Integer id; /** diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeeting.java b/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeeting.java index 75ff5b9..eeb8039 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeeting.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeeting.java @@ -54,7 +54,7 @@ public class DataPoliceMeeting implements Serializable { * */ @TableField(value = "business_id") - private String businessId; + private Integer businessId; /** * diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeetingV.java b/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeetingV.java index 7d4884b..506e1b2 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeetingV.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPoliceMeetingV.java @@ -54,7 +54,7 @@ public class DataPoliceMeetingV implements Serializable { * */ @TableField(value = "business_id") - private String businessId; + private Integer businessId; /** * 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 ceae6c5..63ca1ee 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Model.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Model.java @@ -93,4 +93,8 @@ public class Model { private String modelSql; private Integer riskScoreRuleId; + + // 预警问题处置 + private String warningHandling; + } \ No newline at end of file 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 44c9b3c..1862ed1 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -267,4 +267,10 @@ public class Negative { // 佐证材料情况 private String verifyFileSituation; + // 单位会签ID + private Integer countersignApplyId; + + // 创建单位层级 (默认为市局) + private Integer crtDepartLevel; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersign.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersign.java new file mode 100644 index 0000000..298f8c1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersign.java @@ -0,0 +1,61 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeCountersign { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("countersign_apply_id") + private Integer countersignApplyId; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("comments") + private String comments; + + // + @TableField("files") + private String files; + + // + @TableField("depart_id") + private String departId; + + // + @TableField("depart_name") + private String departName; + + // + @TableField("create_time") + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + // + @TableField("creator") + private String creator; + + // + @TableField("creator_name") + private String creatorName; + + private String state; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java new file mode 100644 index 0000000..eeb0c10 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +@Accessors(chain = true) +@Setter +@Getter +public class NegativeCountersignApply { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("negative_id") + private String negativeId; + + // + @TableField("requirement") + private String requirement; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("creator") + private String creator; + + // + @TableField("creator_name") + private String creatorName; + + // + @TableField("create_depart_name") + private String createDepartName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java index dae2ebc..16e82cb 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java @@ -43,4 +43,8 @@ public class NegativeProblemRelation { @TableField("threeLevelContent") private String threeLevelContent; + // 其他内容 + @TableField("threeLevelContent") + private String threeLevelContentOther; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/model/ExtensionApproveStepModel.java b/src/main/java/com/biutag/supervision/pojo/model/ExtensionApproveStepModel.java new file mode 100644 index 0000000..ceed26f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/ExtensionApproveStepModel.java @@ -0,0 +1,28 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/11/25 + */ +@AllArgsConstructor +@Setter +@Getter +public class ExtensionApproveStepModel { + + private String title; + + private String comments; + + private String state; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java index 55b10a7..9aef049 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java @@ -10,7 +10,9 @@ import java.time.LocalDateTime; @Getter public class NegativeWorkModel { - private Integer id; + private Integer workId; + + private String workFlowKey; private String negativeId; diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java index 92135e7..c4f12cf 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -60,4 +60,10 @@ public class NegativeQueryParam extends BasePage { private String order; private String orderProp; + private String specialSupervision; + + private String reportNumber; + + private Integer crtDepartLevel; + } diff --git a/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java index 8e17fa7..d9be686 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/RiskPersonalQueryParam.java @@ -20,6 +20,8 @@ public class RiskPersonalQueryParam extends BasePage { private String idCode; - private String controlDepartId; + private String tags; + + private String smallTags; } diff --git a/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java b/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java index 5f624b1..fad10eb 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/WorkParam.java @@ -21,4 +21,6 @@ public class WorkParam extends BasePage { private String involveDepartId; private String handleThreeDepartId; private String processingStatus; + private String checkStatus; + private List handleResultCode = new ArrayList<>(); } diff --git a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java index 46f44a7..ee5594a 100644 --- a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java +++ b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java @@ -46,6 +46,8 @@ public class BusinessDepartService extends ServiceImpl page(BusinessQueryParam businessQueryParam) { // 测基础数据 if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今年所有的数据")) { @@ -83,6 +85,12 @@ public class BusinessDepartService extends ServiceImpl getDataPoliceMeetingFromSqlServer(LocalDateTime lastSelectTime, LocalDateTime now) { return dataPoliceMeetingSqlServerMapper.selectAimList(lastSelectTime, now); } - - // @PostConstruct // public void startMigration() { // CompletableFuture.runAsync(() -> migrateData()); @@ -67,21 +52,20 @@ public class DataMigrationServiceImpl extends ServiceImpl dataPoliceMeetingFromSqlServerList; do { dataPoliceMeetingFromSqlServerList = getDataPoliceMeetingFromSqlServer(lastMigrationTime, LocalDateTime.now(), pageNum, pageSize); + System.out.println("查询到" + dataPoliceMeetingFromSqlServerList.size() + "条数据"); // 3、开始新的迁移 boolean migrationSuccessful = updateMigration(dataPoliceMeetingFromSqlServerList); total += dataPoliceMeetingFromSqlServerList.size(); @@ -92,30 +76,30 @@ public class DataMigrationServiceImpl extends ServiceImpl dataPoliceMeetingFromSqlServerList) { try { - - for (DataPoliceMeetingV dataPoliceMeetingV : dataPoliceMeetingFromSqlServerList) { - DataPoliceMeeting dataPoliceMeeting = new DataPoliceMeeting(); - BeanUtils.copyProperties(dataPoliceMeetingV, dataPoliceMeeting); - dataPoliceMeetingMysqlMapper.insert(dataPoliceMeeting); + if (!dataPoliceMeetingFromSqlServerList.isEmpty()) { + List dataPoliceMeetingList = new ArrayList<>(dataPoliceMeetingFromSqlServerList.size()); + for (DataPoliceMeetingV dataPoliceMeetingV : dataPoliceMeetingFromSqlServerList) { + DataPoliceMeeting dataPoliceMeeting = new DataPoliceMeeting(); + BeanUtils.copyProperties(dataPoliceMeetingV, dataPoliceMeeting); + dataPoliceMeetingList.add(dataPoliceMeeting); + } + System.out.println("准备插入" + dataPoliceMeetingList.size() + "条数据"); + dataPoliceMeetingMysqlMapper.insert(dataPoliceMeetingList); + System.out.println("插入成功"); } return true; } catch (BeansException e) { @@ -126,10 +110,10 @@ public class DataMigrationServiceImpl extends ServiceImpl getDataPoliceMeetingFromSqlServer(LocalDateTime lastSelectTime, LocalDateTime now, int pageNum, int pageSize) { int offset = (pageNum - 1) * pageSize; + System.out.println("开始查询sqlserver,offset:" + offset); return dataPoliceMeetingSqlServerMapper.selectAimListWithPagination(lastSelectTime, now, offset, pageSize); } - private void updateMigrationRecord(LocalDateTime startTime, LocalDateTime endTime, List dataPoliceMeetingFromSqlServerList) { DataMigration dataMigration = new DataMigration(); dataMigration.setTarget("sqlServer"); @@ -140,9 +124,6 @@ public class DataMigrationServiceImpl extends ServiceImpl { + + private final NegativeCountersignService countersignService; + + public List list(String negativeId) { + List list = list(new LambdaQueryWrapper().eq(NegativeCountersignApply::getNegativeId, negativeId)); + return list.stream().map(apply -> { + CountersignApply countersignApply = new CountersignApply(); + BeanUtil.copyProperties(apply, countersignApply); + countersignApply.setCountersigns(countersignService.list(apply.getId())); + return countersignApply; + }).toList(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java b/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java new file mode 100644 index 0000000..3ac9776 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.NegativeCountersign; +import com.biutag.supervision.mapper.NegativeCountersignMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class NegativeCountersignService extends ServiceImpl { + + public List list(Integer countersignApplyId) { + return list(new LambdaQueryWrapper().eq(NegativeCountersign::getCountersignApplyId, countersignApplyId) + .orderByAsc(NegativeCountersign::getState)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java index fcdda0a..1c9ba4b 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java @@ -2,24 +2,52 @@ package com.biutag.supervision.service; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.ApproveStateEnum; +import com.biutag.supervision.mapper.NegativeExtensionApplyMapper; import com.biutag.supervision.pojo.domain.ExtensionApply; +import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeExtensionApply; -import com.biutag.supervision.mapper.NegativeExtensionApplyMapper; +import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; +import com.biutag.supervision.pojo.model.ExtensionApproveStepModel; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.Comparator; +import java.util.List; + @RequiredArgsConstructor @Service public class NegativeExtensionApplyService extends ServiceImpl { private final NegativeExtensionApproveService extensionApproveService; - public ExtensionApply get(int id) { - NegativeExtensionApply extensionApply = getById(id); + public ExtensionApply get(Negative negative) { + NegativeExtensionApply extensionApply = getById(negative.getNegativeExtensionApplyId()); ExtensionApply apply = new ExtensionApply(); BeanUtil.copyProperties(extensionApply, apply); - apply.setApproves(extensionApproveService.list(id)); + List approves = extensionApproveService.list(negative.getNegativeExtensionApplyId()); + List list = approves.stream().map(NegativeExtensionApprove::getHandlerDepartId).distinct().map(departId -> { + return approves.stream().sorted(Comparator.comparing(NegativeExtensionApprove::getCreateTime).reversed()) + .filter(item -> departId.equals(item.getHandlerDepartId())) + .findFirst().get(); + }).toList(); + ExtensionApproveStepModel step1 = new ExtensionApproveStepModel("延期申请", "", ApproveStateEnum.approved.name(), null); + ExtensionApproveStepModel step2 = new ExtensionApproveStepModel(negative.getHandleSecondDepartName() + "专班审批", "", null, null); + ExtensionApproveStepModel step3 = new ExtensionApproveStepModel("市局专班审批", "", null, null); + 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/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java index 6c26cfa..8741ccf 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -55,7 +55,10 @@ public class NegativeQueryService { .eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), Negative::getBusinessTypeCode, param.getBusinessTypeCode()) .eq(StrUtil.isNotBlank(param.getCheckStatus()), Negative::getCheckStatus, param.getCheckStatus()) .in(!param.getCheckStatusList().isEmpty(), Negative::getCheckStatus, param.getCheckStatusList()) - .eq(StrUtil.isNotBlank(param.getIsRectifyCode()), Negative::getIsRectifyCode, param.getIsRectifyCode()); + .eq(StrUtil.isNotBlank(param.getIsRectifyCode()), Negative::getIsRectifyCode, param.getIsRectifyCode()) + .eq(StrUtil.isNotBlank(param.getSpecialSupervision()), Negative::getSpecialSupervision, param.getSpecialSupervision()) + .like(StrUtil.isNotBlank(param.getReportNumber()), Negative::getReportNumber, param.getReportNumber()) + .eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel()); if (param.getHappenTime().size() == 2) { queryWrapper.between(Negative::getHappenTime, param.getHappenTime().get(0), param.getHappenTime().get(1)); } diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java index 2e29a2a..d68e544 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -10,6 +10,7 @@ import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.flow.FlowService; @@ -23,6 +24,7 @@ import com.biutag.supervision.pojo.dto.flow.FirstDistributeData; 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; @@ -31,6 +33,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.management.relation.Role; import java.time.LocalDateTime; import java.util.*; import java.util.concurrent.atomic.AtomicReference; @@ -69,9 +72,10 @@ public class NegativeService extends ServiceImpl { private final NegativeScorePoliceService negativeScorePoliceService; + private final NegativeCountersignApplyService countersignApplyService; + public NegativeDetail get(String id, Integer workId) { Negative negative = getById(id); - List flows = negativeHistoryService.listByNegativeId(id); AtomicReference flowKey = new AtomicReference<>(negative.getFlowKey()); List files = fileService.list(id); @@ -121,8 +125,8 @@ public class NegativeService extends ServiceImpl { detail.setSignReturns(signReturnService.list(id)); } // 是否延期申请 - if (Objects.nonNull(negative.getNegativeExtensionApplyId()) && !negative.getExtensionApplyFlag()) { - detail.setExtensionApply(extensionApplyService.get(negative.getNegativeExtensionApplyId())); + if (Objects.nonNull(negative.getNegativeExtensionApplyId()) && FlowNodeEnum.VERIFY.getKey().equals(negative.getFlowKey())) { + detail.setExtensionApply(extensionApplyService.get(negative)); } // 办理剩余时长 if (StrUtil.isNotBlank(negative.getFlowKey())) { @@ -153,6 +157,8 @@ public class NegativeService extends ServiceImpl { List scorePolices = negativeScorePoliceService.list(id); vo.setScorePolices(scorePolices); } + // 单位会签 + detail.setCountersignApplys(countersignApplyService.list(id)); return detail; } @@ -169,9 +175,11 @@ public class NegativeService extends ServiceImpl { negative.setOriginId(originId); // 如果是空就生成随机的线索源 } LocalDateTime now = LocalDateTime.now(); + UserAuth user = UserContextHolder.getCurrentUser(); negative.setId(IdUtil.getSnowflakeNextIdStr()) // negative唯一标识 雪花 .setProcessingStatus(ProcessingStatusEnum.signing.name()) .setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) // 市局下发 + .setCrtDepartLevel(user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode()) ? DepartLevelEnum.SECOND.getValue() : DepartLevelEnum.FIRST.getValue()) .setCrtTime(now) .setUpdTime(now); if (Objects.nonNull(negativeDto.getInvolveProblem())) { @@ -201,7 +209,6 @@ public class NegativeService extends ServiceImpl { .setCreateTime(now); workService.save(work); // 添加一条 negative_work 数据 工作状态 - FirstDistributeData firstDistributeData = new FirstDistributeData(); BeanUtil.copyProperties(negativeDto, firstDistributeData); ActionDto actionDto = new ActionDto() diff --git a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java index 9d69c75..65f9174 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeWorkService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeWorkService.java @@ -1,6 +1,7 @@ package com.biutag.supervision.service; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -14,6 +15,8 @@ import com.biutag.supervision.util.TimeUtil; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.List; +import java.util.Objects; @Service public class NegativeWorkService extends ServiceImpl { @@ -35,6 +38,8 @@ public class NegativeWorkService extends ServiceImpl list(String negativeId) { + return list(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, negativeId)); + } } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/util/WordUtil.java b/src/main/java/com/biutag/supervision/util/WordUtil.java new file mode 100644 index 0000000..c268af9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/WordUtil.java @@ -0,0 +1,36 @@ +package com.biutag.supervision.util; + +import com.aspose.words.Document; +import com.aspose.words.License; +import com.aspose.words.SaveFormat; +import lombok.extern.slf4j.Slf4j; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; + +@Slf4j +public class WordUtil { + + public static InputStream convertDocx(InputStream is) { + getLicense(); + try(ByteArrayOutputStream f = new ByteArrayOutputStream()) { + Document doc = new Document(is); + doc.save(f, SaveFormat.DOCX); + return new ByteArrayInputStream(f.toByteArray()); + } catch (Exception e) { + throw new RuntimeException("docx转换异常:" + e.getMessage()); + } + } + + public static boolean getLicense() { + try (InputStream is = WordUtil.class.getResourceAsStream("/license/words.license.xml")){ + License aposeLic = new License(); + aposeLic.setLicense(is); + return true; + } catch (Exception e) { + throw new RuntimeException(e.getMessage()); + } + } + +} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 8d5ffff..90e7745 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -14,14 +14,14 @@ spring: password: ip12341234 data: redis: - host: 172.31.217.20 + host: 127.0.0.1 # 端口,默认为6379 - port: 30079 - password: ip1234!@#$ + port: 6379 + password: 123456 -#mybatis-plus: -# configuration: -# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl fdfs: tracker-list: #TrackerList参数,支持多个 diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 18dec79..ed6d069 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -26,11 +26,12 @@ spring: url: jdbc:dm://65.47.22.243:5236?SCHEMA=JSDZ_4GDB username: DCZD password: DCZD@2024 -# test1: -# url: jdbc:sqlserver://65.47.6.114:1433;databaseName=VisitManage_CS -# username: ck1112 -# password: CK@20241112 -# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + test1: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + url: jdbc:sqlserver://65.47.6.114:1433;databaseName=VisitManage_CS + username: ck1112 + password: CK@20241112 druid: min-evictable-idle-time-millis: 300000 test-on-borrow: false diff --git a/src/main/resources/license/words.license.xml b/src/main/resources/license/words.license.xml new file mode 100644 index 0000000..ecd46c1 --- /dev/null +++ b/src/main/resources/license/words.license.xml @@ -0,0 +1,13 @@ + + + + Aspose.Total for Java + Aspose.Words for Java + + Enterprise + 20991231 + 20991231 + 8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7 + + sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU= + diff --git a/src/main/resources/mapper/NegativeWorkMapper.xml b/src/main/resources/mapper/NegativeWorkMapper.xml index dc7df38..194ce0c 100644 --- a/src/main/resources/mapper/NegativeWorkMapper.xml +++ b/src/main/resources/mapper/NegativeWorkMapper.xml @@ -5,11 +5,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - \ No newline at end of file diff --git a/src/test/java/com/biutag/supervision/StrUtil.java b/src/test/java/com/biutag/supervision/StrUtil.java index 572ac80..2234169 100644 --- a/src/test/java/com/biutag/supervision/StrUtil.java +++ b/src/test/java/com/biutag/supervision/StrUtil.java @@ -17,8 +17,6 @@ public class StrUtil { @Test public void testSubstr() { - for (int i = 0; i < 12; i++) { - - } + System.out.println(StrUtil.class.getSimpleName()); } } diff --git a/src/test/java/com/biutag/supervision/tools/GenCodeTests.java b/src/test/java/com/biutag/supervision/tools/GenCodeTests.java index ffb05e5..882be5f 100644 --- a/src/test/java/com/biutag/supervision/tools/GenCodeTests.java +++ b/src/test/java/com/biutag/supervision/tools/GenCodeTests.java @@ -25,7 +25,7 @@ public class GenCodeTests { @Test public void genEntity() throws TemplateException, IOException { - String tableName = "risk_personal_tag"; + String tableName = "negative_countersign"; String tableSchema = "negative"; boolean genMapper = true; boolean genService = true;