From 690e513987676e10935e17aa26aff2007349bf96 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Thu, 7 Nov 2024 21:03:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/1107.sql | 15 +++++++ .../common/validation/AddGroup.java | 8 ++++ .../common/validation/EditGroup.java | 8 ++++ .../supervision/constants/AppConstants.java | 2 +- .../controller/StatisticsController.java | 4 +- .../ProfileDepartController.java | 10 ++--- .../ProfilePoliceController.java | 12 ++--- .../controller/work/NegativeController.java | 12 +++-- .../com/biutag/supervision/job/DepartJob.java | 45 +++++++++++++++++-- .../mapper/DepartNegativeRateMapper.java | 8 ++++ .../supervision/pojo/domain/NegativeVo.java | 6 +++ .../supervision/pojo/domain/PoliceAuth.java | 2 +- .../supervision/pojo/dto/NegativeDto.java | 31 ++++++++----- .../pojo/entity/DepartNegativeRate.java | 32 +++++++++++++ .../pojo/entity/NegSourceAuthority.java | 2 +- .../supervision/pojo/entity/Negative.java | 12 +++++ .../pojo/entity/NegativeProblemRelation.java | 2 - .../pojo/entity/SupDictProblemSource.java | 4 +- .../pojo/entity/SupDictProblemType.java | 2 +- .../supervision/pojo/model/UserAuth.java | 2 +- .../pojo/param/NegativeQueryParam.java | 3 ++ .../supervision/pojo/vo/DictContentTree.java | 2 +- .../pojo/vo/DictProblemSourceTree.java | 4 +- .../supervision/service/BaseUserService.java | 2 +- .../service/DepartNegativeRateService.java | 11 +++++ .../supervision/service/ModelClueService.java | 18 ++++---- .../service/NegSourceAuthorityService.java | 2 +- .../service/NegativeQueryService.java | 10 +++++ .../service/NegativeTaskService.java | 4 +- .../service/SupDictProblemSourceService.java | 6 +-- src/main/resources/application-local.yml | 6 +-- .../resources/mapper/ProfileDepartMapper.xml | 8 ++-- .../resources/mapper/ProfilePoliceMapper.xml | 4 +- .../supervision/tools/GenCodeTests.java | 2 +- 34 files changed, 234 insertions(+), 67 deletions(-) create mode 100644 sql/1107.sql create mode 100644 src/main/java/com/biutag/supervision/common/validation/AddGroup.java create mode 100644 src/main/java/com/biutag/supervision/common/validation/EditGroup.java create mode 100644 src/main/java/com/biutag/supervision/mapper/DepartNegativeRateMapper.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java create mode 100644 src/main/java/com/biutag/supervision/service/DepartNegativeRateService.java diff --git a/sql/1107.sql b/sql/1107.sql new file mode 100644 index 0000000..7118eb6 --- /dev/null +++ b/sql/1107.sql @@ -0,0 +1,15 @@ +CREATE TABLE `depart_negative_rate` ( + `depart_id` varchar(40) NOT NULL, + `month` varchar(7) NOT NULL COMMENT '月份', + `incidence_rate` double(10,4) DEFAULT NULL COMMENT '问题发生率', + `incidence_factor` double(10,4) DEFAULT NULL COMMENT '问题发生率系数', + `incidence_rate_tied` double(10,4) DEFAULT NULL COMMENT '单位平均问题发生率', + PRIMARY KEY (`depart_id`,`month`) USING BTREE +) ENGINE=InnoDB COMMENT='单位问题发生率'; + + +ALTER TABLE `negative`.`negative` + ADD COLUMN `verify_situation` varchar(255) COMMENT '核查办理情况'; + +ALTER TABLE `negative`.`negative` + ADD COLUMN `verify_file_situation` varchar(255) COMMENT '佐证材料情况'; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/common/validation/AddGroup.java b/src/main/java/com/biutag/supervision/common/validation/AddGroup.java new file mode 100644 index 0000000..3be19b8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/common/validation/AddGroup.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.common.validation; + +/** + * @author wxc + * @date 2024/11/7 + */ +public interface AddGroup { +} diff --git a/src/main/java/com/biutag/supervision/common/validation/EditGroup.java b/src/main/java/com/biutag/supervision/common/validation/EditGroup.java new file mode 100644 index 0000000..c1dc093 --- /dev/null +++ b/src/main/java/com/biutag/supervision/common/validation/EditGroup.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.common.validation; + +/** + * @author wxc + * @date 2024/11/7 + */ +public interface EditGroup { +} diff --git a/src/main/java/com/biutag/supervision/constants/AppConstants.java b/src/main/java/com/biutag/supervision/constants/AppConstants.java index 366f384..8fdbdb4 100644 --- a/src/main/java/com/biutag/supervision/constants/AppConstants.java +++ b/src/main/java/com/biutag/supervision/constants/AppConstants.java @@ -7,7 +7,7 @@ public class AppConstants { // 单位 public static final String DICT_CONTENT_ROOT_PARENT_CODE = "-1"; - public static final Integer DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = -1; + public static final String DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = "-1"; // 管理员类型类型(超级管理员) public static final String USER_TYPE_SUPER = "super"; diff --git a/src/main/java/com/biutag/supervision/controller/StatisticsController.java b/src/main/java/com/biutag/supervision/controller/StatisticsController.java index 57a635f..bced766 100644 --- a/src/main/java/com/biutag/supervision/controller/StatisticsController.java +++ b/src/main/java/com/biutag/supervision/controller/StatisticsController.java @@ -64,7 +64,9 @@ public class StatisticsController { }) ); long delayCount = negativeService.count(new LambdaUpdateWrapper() - .eq(Negative::getExtensionApplyFlag, false) + .and(query -> { + query.eq(Negative::getExtensionApplyFlag, false).or().gt(Negative::getExtensionDays, 0); + }) .in(!user.getAuthSources().isEmpty(), Negative::getProblemSourcesCode, user.getAuthSources()) .and(nonAdminAuth, query -> { query.in(Negative::getHandleSecondDepartId, user.getAuthDepartIds()).or() diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java index 4f5bd32..520ce52 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -75,7 +75,7 @@ public class ProfileDepartController { profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList()); List list = negativeService.list(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); List negativeIds = list.stream().map(Negative::getId).toList(); int negativePoliceSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); @@ -91,7 +91,7 @@ public class ProfileDepartController { .eq(BusinessDepart::getDepartId, departId)) .stream().mapToInt(BusinessDepart::getNumber).sum(); int jcj110Size = negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_110.getValue()) .eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); @@ -101,7 +101,7 @@ public class ProfileDepartController { .eq(BusinessDepart::getDepartId, departId)) .stream().mapToInt(BusinessDepart::getNumber).sum(); int jcj122Size = negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_122.getValue()) .eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); @@ -112,7 +112,7 @@ public class ProfileDepartController { .eq(BusinessDepart::getDepartId, departId)) .stream().mapToInt(BusinessDepart::getNumber).sum(); int zfbaSize = negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue()) .eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); @@ -161,7 +161,7 @@ public class ProfileDepartController { long value = negativeService.count(new LambdaQueryWrapper() .eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())) - .apply(" DATE_FORMAT(crtTime, '%Y年%m月') = '" + month + "'")); + .apply(" DATE_FORMAT(DiscoveryTime, '%Y年%m月') = '" + month + "'")); values.add(value); } JSONObject jsonObject = new JSONObject().fluentPut("months", months).fluentPut("values", values); diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java index 8ad6492..375326a 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java @@ -85,7 +85,7 @@ public class ProfilePoliceController { Set negativeIds = negativeBlameService.list(new LambdaQueryWrapper().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()); int jcj110Size = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_110.getValue()) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); @@ -97,7 +97,7 @@ public class ProfilePoliceController { .stream().mapToInt(BusinessPolice::getNumber).sum(); int jcj122Size = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.JCJ_122.getValue()) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); @@ -109,7 +109,7 @@ public class ProfilePoliceController { .eq(BusinessPolice::getPoliceName, profilePolice.getPoliceInfo().getName())) .stream().mapToInt(BusinessPolice::getNumber).sum(); int zfbaSize = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue()) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); @@ -118,7 +118,7 @@ public class ProfilePoliceController { .setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); List list = negativeIds.isEmpty() ? new ArrayList<>() : negativeService.list(new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); // 问题来源占比 @@ -159,7 +159,7 @@ public class ProfilePoliceController { return Result.success(new Page().setRecords(new ArrayList<>()).setTotal(0)); } Page pageData = negativeService.page(page, new LambdaQueryWrapper() - .between(Negative::getCrtTime, beginTime, endTime) + .between(Negative::getDiscoveryTime, beginTime, endTime) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); return Result.success(pageData); @@ -178,7 +178,7 @@ public class ProfilePoliceController { long value = negativeIds.isEmpty() ? 0 : negativeService.count(new LambdaQueryWrapper() .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue())) - .apply(" DATE_FORMAT(crtTime, '%Y年%m月') = '" + month + "'")); + .apply(" DATE_FORMAT(DiscoveryTime, '%Y年%m月') = '" + month + "'")); values.add(value); } JSONObject jsonObject = new JSONObject().fluentPut("months", months).fluentPut("values", values); diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java index 9c8a534..54dd3c1 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -4,6 +4,8 @@ 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.plugins.pagination.Page; +import com.biutag.supervision.common.validation.AddGroup; +import com.biutag.supervision.common.validation.EditGroup; import com.biutag.supervision.flow.FlowService; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.NegativeDetail; @@ -16,8 +18,10 @@ import com.biutag.supervision.pojo.vo.NegativeQueryVo; import com.biutag.supervision.service.NegativeQueryService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeTaskService; +import com.biutag.supervision.util.JSON; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -46,12 +50,12 @@ public class NegativeController { } @PostMapping - public Result add(@Valid @RequestBody NegativeDto negativeDto) { + public Result add(@Validated(AddGroup.class) @RequestBody NegativeDto negativeDto) { return Result.success(negativeService.save(negativeDto)); } @PutMapping - public Result update(@Valid @RequestBody NegativeDto negativeDto) { + public Result update(@Validated(EditGroup.class) @RequestBody NegativeDto negativeDto) { if (StrUtil.isBlank(negativeDto.getId())) { throw new RuntimeException("数据异常,请系统联系管理员【问题ID为空】"); } @@ -62,7 +66,7 @@ public class NegativeController { .set(Negative::getBusinessTypeCode, negativeDto.getBusinessTypeCode()) .set(Negative::getBusinessTypeName, negativeDto.getBusinessTypeName()) .set(Negative::getCaseNumber, negativeDto.getCaseNumber()) - .set(Negative::getInvolveProblem, negativeDto.getInvolveProblem()) + .set(Negative::getInvolveProblem, JSON.toJSONString(negativeDto.getInvolveProblem())) .set(Negative::getPoliceType, negativeDto.getPoliceType()) .set(Negative::getPoliceTypeName, negativeDto.getPoliceTypeName()) .set(Negative::getDiscoveryTime, negativeDto.getDiscoveryTime()) @@ -70,6 +74,8 @@ public class NegativeController { .set(Negative::getResponderName, negativeDto.getResponderName()) .set(Negative::getContactPhone, negativeDto.getContactPhone()) .set(Negative::getThingDesc, negativeDto.getThingDesc()) + .set(Negative::getSpecialSupervision, negativeDto.getSpecialSupervision()) + .set(Negative::getReportNumber, negativeDto.getReportNumber()) .set(Negative::getUpdTime, LocalDateTime.now()); negativeService.update(updateWrapper); return Result.success(); diff --git a/src/main/java/com/biutag/supervision/job/DepartJob.java b/src/main/java/com/biutag/supervision/job/DepartJob.java index a64e019..60419de 100644 --- a/src/main/java/com/biutag/supervision/job/DepartJob.java +++ b/src/main/java/com/biutag/supervision/job/DepartJob.java @@ -1,15 +1,21 @@ package com.biutag.supervision.job; +import cn.hutool.core.util.NumberUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.enums.InspectCaseEnum; +import com.biutag.supervision.pojo.entity.BusinessDepart; +import com.biutag.supervision.pojo.entity.DepartNegativeRate; +import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.SupDepart; -import com.biutag.supervision.service.SupDepartPoliceSizeService; -import com.biutag.supervision.service.SupDepartService; +import com.biutag.supervision.service.*; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; /** @@ -24,6 +30,12 @@ public class DepartJob { private final SupDepartPoliceSizeService departPoliceSizeService; + private final DepartNegativeRateService departNegativeRateService; + + private final BusinessDepartService businessDepartService; + + private final NegativeService negativeService; + @Async public void updateDepartPath() { List departs = departService.list(); @@ -37,9 +49,9 @@ public class DepartJob { } /** - * 1个小时 + * 每天更新一次 */ -// @Scheduled(fixedRate = 1000 * 60 * 60) + @Scheduled(cron = "0 0 0 * * ?") public void updatePoliceSize() { List departs = departService.list(new LambdaQueryWrapper().eq(SupDepart::getLevel, 3)); departs.forEach(item -> { @@ -47,4 +59,29 @@ public class DepartJob { }); } + + /** + * 每月1-10号零点更新 + */ + @Scheduled(cron = "0 0 1 * * ?") + public void updateDepartNegativeRate() { + String month = "2024-10"; + List departs = departService.list(new LambdaQueryWrapper().eq(SupDepart::getLevel, 3)); + LocalDateTime beginTime = LocalDateTime.of(2024, 10, 1, 0, 0, 0); + LocalDateTime endTime = LocalDateTime.of(2024, 10, 31, 0, 0, 0); + List list = departs.stream().map(depart -> { + DepartNegativeRate rate = new DepartNegativeRate(); + rate.setMonth(month); + rate.setDepartId(depart.getId()); + + int sum = businessDepartService.list(new LambdaQueryWrapper().between(BusinessDepart::getDate, beginTime, endTime) + .eq(BusinessDepart::getDepartId, depart.getId())).stream().mapToInt(BusinessDepart::getNumber).sum(); + long count = negativeService.count(new LambdaQueryWrapper().between(Negative::getDiscoveryTime, beginTime, endTime) + .eq(Negative::getInvolveDepartId, depart.getId()) + .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); + rate.setIncidenceRate(sum == 0 ? 0 : NumberUtil.div(count, sum)); + return rate; + }).toList(); + departNegativeRateService.saveOrUpdateBatch(list); + } } diff --git a/src/main/java/com/biutag/supervision/mapper/DepartNegativeRateMapper.java b/src/main/java/com/biutag/supervision/mapper/DepartNegativeRateMapper.java new file mode 100644 index 0000000..892f3b1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DepartNegativeRateMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.DepartNegativeRate; + +public interface DepartNegativeRateMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java index bebabb4..66da6da 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java @@ -172,6 +172,12 @@ public class NegativeVo { private String caseNumber; + // 专项督察 + private String specialSupervision; + + // 通报期数 + private String reportNumber; + // 涉及人员 private List blames = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java index d477eef..0357303 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java @@ -13,6 +13,6 @@ public class PoliceAuth { private List departs; - private List sources; + private List sources; } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java index 1a2d7b3..c45dba9 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java @@ -1,5 +1,7 @@ package com.biutag.supervision.pojo.dto; +import com.biutag.supervision.common.validation.AddGroup; +import com.biutag.supervision.common.validation.EditGroup; import com.biutag.supervision.pojo.vo.FileVo; import com.fasterxml.jackson.annotation.JsonFormat; import jakarta.validation.constraints.NotBlank; @@ -16,6 +18,7 @@ import java.util.Map; @Getter public class NegativeDto { + @NotBlank(message = "问题来源不能为空", groups = {EditGroup.class}) private String id; private String originId; @@ -24,24 +27,24 @@ public class NegativeDto { private LocalDateTime happenTime; // 问题发现时间 - @NotNull + @NotNull(groups = {AddGroup.class, EditGroup.class}) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") private LocalDateTime discoveryTime; // 问题来源 - @NotBlank(message = "问题来源不能为空") + @NotBlank(message = "问题来源不能为空", groups = {AddGroup.class, EditGroup.class}) private String problemSourcesCode; // 问题来源 - @NotBlank(message = "问题来源不能为空") + @NotBlank(message = "问题来源不能为空", groups = {AddGroup.class, EditGroup.class}) private String problemSources; // 业务类别 - @NotBlank(message = "业务类别不能为空") + @NotBlank(message = "业务类别不能为空", groups = {AddGroup.class, EditGroup.class}) private String businessTypeCode; // 业务类别名称 - @NotBlank(message = "业务类别不能为空") + @NotBlank(message = "业务类别不能为空", groups = {AddGroup.class, EditGroup.class}) private String businessTypeName; private String policeTypeName; @@ -59,7 +62,7 @@ public class NegativeDto { private String contactPhone; // 简要描述 - @NotBlank(message = "简要描述不能为空") + @NotBlank(message = "简要描述不能为空", groups = {AddGroup.class, EditGroup.class}) private String thingDesc; private List thingFiles = new ArrayList<>(); @@ -69,21 +72,21 @@ public class NegativeDto { // 涉及单位 private String involveDepartId; - @NotBlank(message = "主办层级不能为空") + @NotBlank(message = "主办层级不能为空", groups = {AddGroup.class}) private String hostLevel; // 办理时限 - @NotBlank(message = "办理时限不能为空") + @NotBlank(message = "办理时限不能为空", groups = {AddGroup.class}) private String timeLimit; // 审批流程 - @NotBlank(message = "审批流程不能为空") + @NotBlank(message = "审批流程不能为空", groups = {AddGroup.class}) private String approvalFlow; - @NotBlank(message = "指定具体办理单位不能为空") + @NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class}) private String departId; - @NotBlank(message = "指定具体办理单位不能为空") + @NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class}) private String departName; // 最大签收时长(天) @@ -98,4 +101,10 @@ public class NegativeDto { // 涉及案件/警情编号 private String caseNumber; + // 专项督察 + private String specialSupervision; + + // 通报期数 + private String reportNumber; + } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java b/src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java new file mode 100644 index 0000000..860224e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DepartNegativeRate.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class DepartNegativeRate { + + // + @TableId + private String departId; + + // 月份 + @TableId + private String month; + + // 问题发生率 + @TableField("incidence_rate") + private Double incidenceRate; + + // 问题发生率系数 + @TableField("incidence_factor") + private Double incidenceFactor; + + // 单位平均问题发生率 + @TableField("incidence_rate_tied") + private Double incidenceRateTied; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java b/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java index 202376f..7440624 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegSourceAuthority.java @@ -16,6 +16,6 @@ public class NegSourceAuthority { private String idCode; // 可查看的来源 - private Integer source; + private String source; } \ 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 73239d0..2c5fb37 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -252,4 +252,16 @@ public class Negative { // 当前处理对象 private String currentProcessingObject; + // 专项督察 + private String specialSupervision; + + // 通报期数 + private String reportNumber; + + // 核查办理情况 + private String verifySituation; + + // 佐证材料情况 + private String verifyFileSituation; + } \ 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 2c2ce88..dae2ebc 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java @@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Getter; import lombok.Setter; -import java.time.LocalDateTime; - @Setter @Getter public class NegativeProblemRelation { diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java index 11ec2b4..41919dc 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java @@ -14,11 +14,11 @@ public class SupDictProblemSource { // @TableId(value = "id", type = IdType.AUTO) - private Integer id; + private String id; // @TableField("parent_id") - private Integer parentId; + private String parentId; // @TableField("label") diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java index a5e7048..efc7ab9 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemType.java @@ -14,7 +14,7 @@ import java.time.LocalDateTime; public class SupDictProblemType { @TableId(type = IdType.AUTO) - private Integer id; + private String id; // 类型名称 @TableField("name") diff --git a/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java index 2915246..14a828c 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java +++ b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java @@ -28,7 +28,7 @@ public class UserAuth implements Serializable { private List roleCodes; // 权限(问题来源) - private List authSources; + private List authSources; private List authDepartIds; 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 8ca3e67..3b2c3ac 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -53,4 +53,7 @@ public class NegativeQueryParam extends BasePage { private String handleDepartId; + // 是否延期 + private Boolean extensionFlag; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java index 49ebec1..c695d64 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictContentTree.java @@ -12,7 +12,7 @@ import java.util.List; @Getter public class DictContentTree { - private Integer id; + private String id; // 类型名称 private String name; diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java index b6a0203..f8d1845 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java @@ -10,9 +10,9 @@ import java.util.List; @Getter public class DictProblemSourceTree { - private Integer id; + private String id; - private Integer parentId; + private String parentId; private String label; diff --git a/src/main/java/com/biutag/supervision/service/BaseUserService.java b/src/main/java/com/biutag/supervision/service/BaseUserService.java index a1dd2f1..e6d3360 100644 --- a/src/main/java/com/biutag/supervision/service/BaseUserService.java +++ b/src/main/java/com/biutag/supervision/service/BaseUserService.java @@ -75,8 +75,8 @@ public class BaseUserService extends ServiceImpl { BaseUser baseUser = new BaseUser(); BeanUtils.copyProperties(userDto, baseUser); baseUser.setUpdateTime(LocalDateTime.now()); + roleUserService.remove(userDto.getUserId()); if (!userDto.getRoleIds().isEmpty()) { - roleUserService.remove(userDto.getUserId()); roleUserService.saveBatch(userDto.getRoleIds().stream().map(roleId -> { BaseRoleUser baseRoleUser = new BaseRoleUser(); baseRoleUser.setUserId(userDto.getUserId()); diff --git a/src/main/java/com/biutag/supervision/service/DepartNegativeRateService.java b/src/main/java/com/biutag/supervision/service/DepartNegativeRateService.java new file mode 100644 index 0000000..c60a1ff --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DepartNegativeRateService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.DepartNegativeRate; +import com.biutag.supervision.mapper.DepartNegativeRateMapper; +import org.springframework.stereotype.Service; + +@Service +public class DepartNegativeRateService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index dc5063e..078952a 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -129,6 +129,14 @@ public class ModelClueService extends ServiceImpl { @Transactional(rollbackFor = Exception.class) public boolean distribution(List modelClues, Model model, String taskName, List thingFiles) { LocalDateTime now = LocalDateTime.now(); + ModelClueTask modelClueTask = new ModelClueTask(); + modelClueTask.setTaskName(taskName); + modelClueTask.setModelId(model.getId()); + modelClueTask.setSize(modelClues.size()); + modelClueTask.setDistributionTime(now); + // 下发方式 + modelClueTask.setDistributionMethod(model.getDistributionMethod()); + modelClueTaskService.save(modelClueTask); modelClues.forEach(item -> { if (Objects.isNull(item.getInvolveDepartId())) { throw new RuntimeException("涉及单位不能为空..."); @@ -176,16 +184,10 @@ public class ModelClueService extends ServiceImpl { item.setDistributionState(DistributionStateEnum.DISTRIBUTED.getValue()); item.setUpdateTime(LocalDateTime.now()); item.setNegativeId(negative.getId()); + item.setTaskId(modelClueTask.getId()); updateById(item); }); - ModelClueTask modelClueTask = new ModelClueTask(); - modelClueTask.setTaskName(taskName); - modelClueTask.setModelId(model.getId()); - modelClueTask.setSize(modelClues.size()); - modelClueTask.setDistributionTime(now); - // 下发方式 - modelClueTask.setDistributionMethod(model.getDistributionMethod()); - modelClueTaskService.save(modelClueTask); + return true; } diff --git a/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java b/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java index 325504f..695d7e4 100644 --- a/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java +++ b/src/main/java/com/biutag/supervision/service/NegSourceAuthorityService.java @@ -14,7 +14,7 @@ import java.util.List; public class NegSourceAuthorityService extends ServiceImpl { @Transactional(rollbackFor = Exception.class) - public boolean save(String idCode, List sources) { + public boolean save(String idCode, List sources) { remove(new LambdaQueryWrapper().eq(NegSourceAuthority::getIdCode, idCode)); if (sources.isEmpty()) { return true; diff --git a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java index 87186fe..9f750c1 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -100,6 +100,16 @@ public class NegativeQueryService { queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); } } + // 是否延期 + if (Objects.nonNull(param.getExtensionFlag())) { + if (param.getExtensionFlag()) { + queryWrapper.and(query -> { + query.eq(Negative::getExtensionApplyFlag, false).or().gt(Negative::getExtensionDays, 0); + }); + } else { + queryWrapper.eq(Negative::getExtensionApplyFlag, true).or().isNull(Negative::getExtensionDays); + } + } Page page = negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); long l = System.currentTimeMillis(); List list = page.getRecords().stream().map(item -> { diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index 2755ca8..c7cc2b7 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -62,7 +62,7 @@ public class NegativeTaskService extends ServiceImpl data, String negativeTaskId) { + public void updateExcel(List data, String negativeTaskId) { List list = data.stream().map(item -> { ExportNegativeVo vo = new ExportNegativeVo(); BeanUtils.copyProperties(item, vo); @@ -81,7 +81,7 @@ public class NegativeTaskService extends ServiceImpl().eq(NegativeTask::getId, negativeTaskId) + update(new LambdaUpdateWrapper().eq(NegativeTask::getId, negativeTaskId) .set(NegativeTask::getStatus, NegativeTaskStatusEnum.SUCCESS.getValue()) .set(NegativeTask::getFilePath, filePath) .set(NegativeTask::getUpdTime, LocalDateTime.now())); diff --git a/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java index a42b981..bf2da8e 100644 --- a/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java @@ -19,14 +19,14 @@ public class SupDictProblemSourceService extends ServiceImpl buildTree() { List dictProblemSources = list(new LambdaQueryWrapper().orderByAsc(SupDictProblemSource::getSort)); - Map> childMap = new HashMap<>(); + Map> childMap = new HashMap<>(); List tree = new ArrayList<>(); for (SupDictProblemSource dictProblemSource : dictProblemSources) { DictProblemSourceTree node = new DictProblemSourceTree(); BeanUtils.copyProperties(dictProblemSource, node); List children = childMap.computeIfAbsent(node.getParentId(), k -> new ArrayList<>()); children.add(node); - Integer parentId = node.getParentId(); + String parentId = node.getParentId(); if (AppConstants.DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE.equals(parentId)) { tree.add(node); } @@ -37,7 +37,7 @@ public class SupDictProblemSourceService extends ServiceImpl> childMap) { + private static DictProblemSourceTree buildTreeRecursive(DictProblemSourceTree node, Map> childMap) { List children = childMap.get(node.getId()); if (children != null) { node.getChildren().addAll(children.stream() diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 506acbc..7c967c0 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -19,9 +19,9 @@ spring: 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/mapper/ProfileDepartMapper.xml b/src/main/resources/mapper/ProfileDepartMapper.xml index 875d291..643aa35 100644 --- a/src/main/resources/mapper/ProfileDepartMapper.xml +++ b/src/main/resources/mapper/ProfileDepartMapper.xml @@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) d LEFT JOIN negative n ON n.involveDepartId = d.depart_id AND n.checkStatus IN ( '1', '2' ) - AND n.crtTime BETWEEN #{beginTime} AND #{endTime} + AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime} LEFT JOIN negative_blame nb ON n.id = nb.negativeId WHERE 1 = 1 @@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN negative_blame nb ON p.id_code = nb.blameIdCode LEFT JOIN negative n ON nb.negativeId = n.id AND n.checkStatus IN ( '1', '2' ) - AND n.crtTime BETWEEN #{beginTime} AND #{endTime} + AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime} WHERE p.org_id = #{departId} and n.id is not null GROUP BY p.name, @@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN negative n ON n.id = nb.negativeId AND n.checkStatus IN ( '1', '2' ) AND n.involveDepartId = #{departId} - AND n.crtTime BETWEEN #{beginTime} AND #{endTime} + AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime} WHERE pt.`level` = 1 GROUP BY @@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN negative n ON n.id = nb.negativeId AND n.checkStatus IN ( '1', '2' ) AND n.involveDepartId = #{departId} - AND n.crtTime BETWEEN #{beginTime} AND #{endTime} + AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime} where pr.`threeLevelContent` is not null GROUP BY diff --git a/src/main/resources/mapper/ProfilePoliceMapper.xml b/src/main/resources/mapper/ProfilePoliceMapper.xml index 57ea08b..1ca925c 100644 --- a/src/main/resources/mapper/ProfilePoliceMapper.xml +++ b/src/main/resources/mapper/ProfilePoliceMapper.xml @@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN negative_blame nb ON p.id_code = nb.blameIdCode LEFT JOIN negative n ON nb.negativeId = n.id AND n.checkStatus IN ( '1', '2' ) - AND n.crtTime BETWEEN #{beginTime} AND #{endTime} + AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime} WHERE 1 = 1 @@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN negative_blame nb ON pr.blameId = nb.blameId AND nb.blameIdCode = #{idCode} LEFT JOIN negative n ON n.id = nb.negativeId AND n.checkStatus IN ( '1', '2' ) - AND n.crtTime BETWEEN #{beginTime} AND #{endTime} + AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime} WHERE pt.`level` = 1 GROUP BY diff --git a/src/test/java/com/biutag/supervision/tools/GenCodeTests.java b/src/test/java/com/biutag/supervision/tools/GenCodeTests.java index 4f5b4ef..b542460 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 = "file_class"; + String tableName = "depart_negative_rate"; String tableSchema = "negative"; boolean genMapper = true; boolean genService = true;