From d363825af3be85712f6b705abf56d5bc7d663eda Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Mon, 4 Nov 2024 19:14:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=94=BB=E5=83=8F=E3=80=81=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=94=BB=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervision/SupervisionApplication.java | 2 + .../enums/CaseVerifProblemNatureEnum.java | 1 + .../ProfileDepartController.java | 8 +++- .../controller/system/DepartController.java | 8 +++- .../com/biutag/supervision/job/DepartJob.java | 42 +++++++++++++++++ .../mapper/NegativeBlameMapper.java | 5 +++ .../mapper/ProfileDepartMapper.java | 4 ++ .../mapper/SupDepartPoliceSizeMapper.java | 8 ++++ .../supervision/mapper/SupPoliceMapper.java | 5 +++ .../pojo/entity/SupDepartPoliceSize.java | 27 +++++++++++ .../service/SupDepartPoliceSizeService.java | 11 +++++ .../supervision/service/SupDepartService.java | 31 ++++++++++++- src/main/resources/application-local.yml | 6 +-- .../resources/mapper/ProfileDepartMapper.xml | 17 +++++++ .../SupervisionApplicationTests.java | 45 ++++++++++++++----- .../supervision/tools/GenCodeTests.java | 2 +- 16 files changed, 203 insertions(+), 19 deletions(-) create mode 100644 src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java create mode 100644 src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java diff --git a/src/main/java/com/biutag/supervision/SupervisionApplication.java b/src/main/java/com/biutag/supervision/SupervisionApplication.java index 6095661..f010b8f 100644 --- a/src/main/java/com/biutag/supervision/SupervisionApplication.java +++ b/src/main/java/com/biutag/supervision/SupervisionApplication.java @@ -2,8 +2,10 @@ package com.biutag.supervision; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; +@EnableAsync @EnableScheduling @SpringBootApplication public class SupervisionApplication { diff --git a/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java index 9714240..55ce40a 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/CaseVerifProblemNatureEnum.java @@ -16,4 +16,5 @@ public enum CaseVerifProblemNatureEnum { @Getter private String laebl; + } 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 c0202ec..1a32eaa 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -43,7 +43,6 @@ public class ProfileDepartController { private final SupDepartService departService; private final SupPoliceService policeService; private final NegativeService negativeService; - private final NegativeBlameService negativeBlameService; private final BusinessDepartService businessDepartService; @GetMapping @@ -81,7 +80,14 @@ public class ProfileDepartController { profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonType()) || PersonTypeEnum.xj.getValue().equals(item.getPersonType())).count()); List list = negativeService.list(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) + .between(Negative::getCrtTime, beginTime, endTime) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); + List negativeIds = list.stream().map(Negative::getId).toList(); + int negativePoliceSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); + profileDepart.getDepartInfo().setNegativePoliceSize(negativePoliceSize); + int negativeAuxSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); + profileDepart.getDepartInfo().setNegativeAuxSize(negativeAuxSize); + profileDepart.getNegativeInfo().setSize(list.size()); int jcjBusinessSize = businessDepartService.list(new LambdaQueryWrapper() diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartController.java b/src/main/java/com/biutag/supervision/controller/system/DepartController.java index 3d8ae14..031e174 100644 --- a/src/main/java/com/biutag/supervision/controller/system/DepartController.java +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; 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.enums.DepartLevelEnum; import com.biutag.supervision.pojo.Result; @@ -51,7 +52,10 @@ public class DepartController { supDepart.setId(String.valueOf(NumberUtil.nullToZero(departService.getMaxId()) + 1)); supDepart.setLevel(parent.getLevel() + 1); supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); - return Result.success(departService.save(supDepart)); + departService.save(supDepart); + String pathTrace = departService.getPathTrace(supDepart); + departService.update(new LambdaUpdateWrapper().eq(SupDepart::getId, supDepart.getId()).set(SupDepart::getPathTrace, pathTrace)); + return Result.success(); } @PutMapping @@ -65,6 +69,8 @@ public class DepartController { SupDepart parent = departService.getById(supDepart.getPid()); supDepart.setLevel(parent.getLevel() + 1); supDepart.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); + String pathTrace = departService.getPathTrace(supDepart); + supDepart.setPathTrace(pathTrace); return Result.success(departService.updateById(supDepart)); } diff --git a/src/main/java/com/biutag/supervision/job/DepartJob.java b/src/main/java/com/biutag/supervision/job/DepartJob.java index 02473f9..756657e 100644 --- a/src/main/java/com/biutag/supervision/job/DepartJob.java +++ b/src/main/java/com/biutag/supervision/job/DepartJob.java @@ -1,13 +1,55 @@ package com.biutag.supervision.job; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.service.SupDepartPoliceSizeService; +import com.biutag.supervision.service.SupDepartService; +import jakarta.annotation.PostConstruct; +import lombok.RequiredArgsConstructor; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; +import java.util.List; + /** * @author wxc * @date 2024/11/4 */ +@RequiredArgsConstructor @Component public class DepartJob { + private final SupDepartService departService; + + private final SupDepartPoliceSizeService departPoliceSizeService; + + + @PostConstruct + public void init() { +// updateDepartPath(); + } + + @Async + public void updateDepartPath() { + List departs = departService.list(); + departs.forEach(item -> { + String pathTrace = departService.getPathTrace(item); + if (!pathTrace.equals(item.getPathTrace())) { + departService.update(new LambdaUpdateWrapper().eq(SupDepart::getId, item.getId()).set(SupDepart::getPathTrace, pathTrace)); + } + }); + + } + + @Async + public void updatePoliceSize() { + List departs = departService.list(); + departs.forEach(item -> { + String pathTrace = departService.getPathTrace(item); + if (!pathTrace.equals(item.getPathTrace())) { + departService.update(new LambdaUpdateWrapper().eq(SupDepart::getId, item.getId()).set(SupDepart::getPathTrace, pathTrace)); + } + }); + } } diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java index 7a60f0b..d5b38f6 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeBlameMapper.java @@ -2,7 +2,12 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.biutag.supervision.pojo.entity.NegativeBlame; +import org.apache.ibatis.annotations.Select; + +import java.util.List; public interface NegativeBlameMapper extends BaseMapper { + + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java index afd1aa7..84fbce5 100644 --- a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.model.DepartNegativeModel; +import org.apache.ibatis.annotations.Select; import java.util.Date; import java.util.List; @@ -20,4 +21,7 @@ public interface ProfileDepartMapper { List selectPoliceTop10(String departId, Date beginTime, Date endTime); List selectProblemType(String departId, Date beginTime, Date endTime); + + int countByNegativeIdsAndPersonTypes(List negativeIds, List personTypes); + } diff --git a/src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java new file mode 100644 index 0000000..2b5a0ae --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDepartPoliceSizeMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDepartPoliceSize; + +public interface SupDepartPoliceSizeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java index 780dec6..1b374ca 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java @@ -7,9 +7,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.entity.SupPolice; import com.biutag.supervision.pojo.model.PoliceModel; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; public interface SupPoliceMapper extends BaseMapper { Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java new file mode 100644 index 0000000..54b2ba4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java @@ -0,0 +1,27 @@ +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 java.time.LocalDateTime; + +@Setter +@Getter +public class SupDepartPoliceSize { + + // + @TableId(value = "depart_id") + private String departId; + + // 民警人数 + @TableField("police_size") + private Integer policeSize; + + // 协警人数 + @TableField("aux_size") + private Integer auxSize; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java b/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java new file mode 100644 index 0000000..d8bd4b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupDepartPoliceSize; +import com.biutag.supervision.mapper.SupDepartPoliceSizeMapper; +import org.springframework.stereotype.Service; + +@Service +public class SupDepartPoliceSizeService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDepartService.java b/src/main/java/com/biutag/supervision/service/SupDepartService.java index fc75311..8905553 100644 --- a/src/main/java/com/biutag/supervision/service/SupDepartService.java +++ b/src/main/java/com/biutag/supervision/service/SupDepartService.java @@ -14,11 +14,13 @@ import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.DepartQueryParam; import com.biutag.supervision.pojo.param.DepartTreeListParam; import com.biutag.supervision.pojo.vo.DepartTree; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.*; +@Slf4j @Service public class SupDepartService extends ServiceImpl { @@ -259,7 +261,7 @@ public class SupDepartService extends ServiceImpl { * @param childMap * @return */ - private static DepartTree buildTreeRecursive(DepartTree node, Map> childMap) { + public static DepartTree buildTreeRecursive(DepartTree node, Map> childMap) { List children = childMap.get(node.getId()); if (children != null) { node.getChildren().addAll(children.stream() @@ -269,5 +271,32 @@ public class SupDepartService extends ServiceImpl { return node; } + /** + * 获取部门的 pathTrace + * @param depart + * @return + */ + public String getPathTrace(SupDepart depart) { + List pathTrace = new ArrayList<>(); + buildPathTraceRecursive(depart, pathTrace); + return "/" + String.join("/", pathTrace) + "/"; + } + + public void buildPathTraceRecursive(SupDepart depart, List pathTrace) { + pathTrace.add(0, depart.getId()); + if (AppConstants.ROOT_DEPART_ID.equals(depart.getId())) { + return; + } + if (AppConstants.ROOT_DEPART_ID.equals(depart.getPid())) { + pathTrace.add(0, AppConstants.ROOT_DEPART_ID); + } else { + SupDepart parent = getById(depart.getPid()); + if (Objects.isNull(parent)) { + log.warn("该部门[{} {}]的父级ID不存在,请核实", depart.getName(), depart.getId()); + return; + } + buildPathTraceRecursive(parent, pathTrace); + } + } } 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 c405103..11e3084 100644 --- a/src/main/resources/mapper/ProfileDepartMapper.xml +++ b/src/main/resources/mapper/ProfileDepartMapper.xml @@ -88,4 +88,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by value desc + + \ No newline at end of file diff --git a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java index e056ff1..f5d9be4 100644 --- a/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java +++ b/src/test/java/com/biutag/supervision/SupervisionApplicationTests.java @@ -1,15 +1,18 @@ package com.biutag.supervision; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.service.SupDepartService; import com.github.tobato.fastdfs.service.FastFileStorageClient; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.scheduling.TaskScheduler; -import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.scheduling.config.ScheduledTaskRegistrar; -import org.springframework.scheduling.support.CronTrigger; -import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; @SpringBootTest class SupervisionApplicationTests { @@ -23,18 +26,36 @@ class SupervisionApplicationTests { @Autowired private TaskScheduler taskScheduler; + @Autowired + SupDepartService departService; + @Test void contextLoads() { - ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); - scheduler.setPoolSize(5); - scheduler.setThreadNamePrefix("scheduled-task-"); - scheduler.initialize(); - Runnable runnable = () -> { - System.out.println("Executing task at " + LocalDateTime.now()); - }; - taskRegistrar.setTaskScheduler(scheduler); - taskRegistrar.addTriggerTask(runnable, new CronTrigger("0 2 * * * ?")); + List departs = departService.list(); + departs.forEach(item -> { + String pathTrace = getPathTrace(item); + if (!pathTrace.equals(item.getPathTrace())) { + departService.update(new LambdaUpdateWrapper().eq(SupDepart::getId, item.getId()).set(SupDepart::getPathTrace, pathTrace)); + } + }); + } + + public String getPathTrace(SupDepart depart) { + List pathTrace = new ArrayList<>(); + buildPathTraceRecursive(depart, pathTrace); + return "/" + String.join("/", pathTrace) + "/"; + } + public void buildPathTraceRecursive(SupDepart depart, List pathTrace) { + pathTrace.add(0, depart.getId()); + if (AppConstants.ROOT_DEPART_ID.equals(depart.getId())) { + return; + } + if (AppConstants.ROOT_DEPART_ID.equals(depart.getPid())) { + pathTrace.add(0, AppConstants.ROOT_DEPART_ID); + } else { + buildPathTraceRecursive(departService.getById(depart.getPid()), pathTrace); + } } } diff --git a/src/test/java/com/biutag/supervision/tools/GenCodeTests.java b/src/test/java/com/biutag/supervision/tools/GenCodeTests.java index dd001a2..4e98c1b 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 = "rpc_infringer_result"; + String tableName = "sup_depart_police_size"; String tableSchema = "negative"; boolean genMapper = true; boolean genService = true; From ea17405eeb39217f5c7075f67c9c57decfff1ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Tue, 5 Nov 2024 18:24:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=A1=E8=AE=BF=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E5=90=8E=E7=AB=AF1.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataPetitionComplaint12337Controller.java | 81 +++++ .../DataPetitionComplaintViewController.java | 81 +++-- .../datav/DataScreenController.java | 45 +++ .../mapper/DataPetition12337Mapper.java | 12 + .../mapper/DataPetitionComplaintMapper.java | 9 +- ...taDataPetitionComplainDistribute12337.java | 38 +++ .../pojo/entity/DataCaseVerif.java | 4 + .../pojo/entity/DataPetition12337.java | 297 ++++++++++++------ .../pojo/param/DataCaseVerifQueryParam.java | 2 + .../pojo/vo/DataPetition12337Vo.java | 173 ++++++++++ .../service/DataCaseVerifService.java | 1 + .../service/DataPetition12337Service.java | 105 +++++++ .../service/DataPetition12337ServiceImpl.java | 22 -- .../service/DataPetitionComplaintService.java | 14 +- .../service/DataScreenService.java | 18 ++ 15 files changed, 759 insertions(+), 143 deletions(-) create mode 100644 src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java create mode 100644 src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java create mode 100644 src/main/java/com/biutag/supervision/pojo/dto/DataDataPetitionComplainDistribute12337.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337Vo.java create mode 100644 src/main/java/com/biutag/supervision/service/DataPetition12337Service.java delete mode 100644 src/main/java/com/biutag/supervision/service/DataPetition12337ServiceImpl.java create mode 100644 src/main/java/com/biutag/supervision/service/DataScreenService.java diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java new file mode 100644 index 0000000..0c5a382 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java @@ -0,0 +1,81 @@ +package com.biutag.supervision.controller.data; + + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute; +import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute12337; +import com.biutag.supervision.pojo.entity.DataPetition12337; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; +import com.biutag.supervision.pojo.vo.DataPetition12337Vo; +import com.biutag.supervision.service.DataPetition12337Service; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Slf4j +@RequiredArgsConstructor +@RequestMapping("data/petitionComplaint12337") +@RestController +public class DataPetitionComplaint12337Controller { + + + private final DataPetition12337Service dataPetition12337Service; + + + /** + * 12337 分页列表 + * @param queryParam + * @return + */ + @GetMapping + public Result> list(DataPetitionComplaintQueryParam queryParam) { + Page dataPetition12337Page = dataPetition12337Service.page(queryParam); + Page dataPetition12337VoPage =null; + // 获取分页内容并转换为 DataPetition12337Vo 对象 + if ( dataPetition12337Page !=null ){ + List records = dataPetition12337Page.getRecords(); + ArrayList voList = new ArrayList<>(); + for (DataPetition12337 oneRecord : records) { + DataPetition12337Vo dataPetition12337Vo = new DataPetition12337Vo(); + BeanUtils.copyProperties(oneRecord,dataPetition12337Vo); + voList.add(dataPetition12337Vo); + } + dataPetition12337VoPage = new Page<>(dataPetition12337Page.getCurrent(), dataPetition12337Page.getSize(), dataPetition12337Page.getTotal()); + dataPetition12337VoPage.setRecords(voList); + } + + return Result.success(dataPetition12337VoPage); + } + + + /** + * 删除 + * @param id + * @return + */ + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + return Result.success(dataPetition12337Service.removeById(id)); + } + + /** + * 下发 + */ + @PostMapping("distribute") + public Result distribute(@RequestBody DataDataPetitionComplainDistribute12337 dataDistribute) { + return Result.success(dataPetition12337Service.distribution(dataDistribute)); + } + + + + + + +} diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java b/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java index 6b0ff92..d6b689c 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataPetitionComplaintViewController.java @@ -1,29 +1,30 @@ package com.biutag.supervision.controller.datav; -import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.biutag.supervision.constants.enums.DepartGroupEnum; import com.biutag.supervision.constants.enums.RepeatEnum; import com.biutag.supervision.mapper.DataPetitionComplaintMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.CaseVerifDepart; -import com.biutag.supervision.pojo.entity.DataPetitionComplaint; import com.biutag.supervision.pojo.vo.RecentMailTrendByDayVo; import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo; import com.biutag.supervision.service.DataPetitionComplaintService; import lombok.RequiredArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; -import java.math.BigDecimal; import java.time.LocalDate; +import java.time.YearMonth; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** @@ -40,7 +41,6 @@ public class DataPetitionComplaintViewController { /** * 信访数据大屏统计 - * * @param beginTime * @param endTime * @return @@ -78,17 +78,13 @@ public class DataPetitionComplaintViewController { } /** - * 信访数据大屏信访趋势统计 + * 信访数据大屏信访趋势统计(按日) */ @GetMapping("/getRecentlyMailTrendByDay") - public Result getRecentlyMailTrendByDay(@RequestParam Integer sourcesCode, - @RequestParam Integer days, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime - ) { + public Result getRecentlyMailTrendByDay(@RequestParam Integer sourcesCode, @RequestParam Integer days, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { JSONObject jsonObject = new JSONObject(); // 库中的数据 2024/10/24 22 - List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByDay(sourcesCode, days, endTime); + List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByDay(sourcesCode, days, endTime); ArrayList dayList = new ArrayList<>(); ArrayList totalList = new ArrayList<>(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd"); @@ -115,17 +111,21 @@ public class DataPetitionComplaintViewController { } - + /** + * 信访数据大屏信访趋势统计(按月) + * + * @param sourcesCode + * @param year + * @return + */ @GetMapping("/getRecentlyMailTrendMonth") - public Result getRecentlyMailTrendByMonth(@RequestParam Integer sourcesCode, - @RequestParam Integer year - ) { + public Result getRecentlyMailTrendByMonth(@RequestParam Integer sourcesCode, @RequestParam Integer year) { JSONObject jsonObject = new JSONObject(); List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByMonth(sourcesCode, String.valueOf(year)); ArrayList monthList = new ArrayList<>(); ArrayList totalList = new ArrayList<>(); for (RecentMailTrendByMonthVo recentMailTrendByMonthVo : recentMailTrendVoList) { - monthList.add(recentMailTrendByMonthVo.getMonthTime().substring(recentMailTrendByMonthVo.getMonthTime().indexOf("-")+1)); + monthList.add(recentMailTrendByMonthVo.getMonthTime().substring(recentMailTrendByMonthVo.getMonthTime().indexOf("-") + 1)); totalList.add(recentMailTrendByMonthVo.getTotal()); } jsonObject.fluentPut("monthList", monthList); @@ -134,7 +134,50 @@ public class DataPetitionComplaintViewController { } - + /** + * 信访数据大屏12337信访趋势统计(按月) + * + * @param year + * @return + */ + @GetMapping("/getRecentlyMailTrendByMonth12337") + public Result getRecentlyMailTrendByMonth12337(@RequestParam Integer year) { + JSONObject jsonObject = new JSONObject(); + List recentMailTrendVoList = dataPetitionComplaintService.getRecentlyMailTrendByMonth12337(String.valueOf(year)); + ArrayList monthList = new ArrayList<>(); + ArrayList totalList = new ArrayList<>(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); + // 要展示到的月份 从那个月开始 + YearMonth endMonth = YearMonth.of(year, 12); + YearMonth startMonth = YearMonth.of(year, 1); + for (RecentMailTrendByMonthVo recentMailTrendByMonthVo : recentMailTrendVoList) { + YearMonth trendMonth = YearMonth.parse(recentMailTrendByMonthVo.getMonthTime(), formatter); + while (startMonth.isBefore(trendMonth)) { + String res = startMonth.format(formatter); + monthList.add(res); // 添加到monthList + totalList.add("0"); // 插入没有数据的月份,总数为0 + startMonth = startMonth.plusMonths(1); + } + String res = trendMonth.format(formatter); + monthList.add(res); + totalList.add(recentMailTrendByMonthVo.getTotal()); + startMonth = trendMonth.plusMonths(1); + } + // 添加从最后一个有数据的月份到当前月份的缺失月份 + while (!startMonth.isAfter(endMonth)) { + String res = startMonth.format(formatter); + monthList.add(res); // 添加到monthList + totalList.add("0"); // 插入没有数据的月份,总数为0 + startMonth = startMonth.plusMonths(1); + } + // 截取月份 + List monthOnlyList = monthList.stream() + .map(date -> date.substring(date.indexOf('-') + 1)) + .collect(Collectors.toList()); + jsonObject.fluentPut("monthList", monthOnlyList); + jsonObject.fluentPut("totalList", totalList); + return Result.success(jsonObject); + } } diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java b/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java new file mode 100644 index 0000000..1d089c7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java @@ -0,0 +1,45 @@ +package com.biutag.supervision.controller.datav; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.service.DataScreenService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +/** + * @author: sh + * @date: 20224/11/5 + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("datav/dataScreen") +public class DataScreenController { + + + private final DataScreenService dataScreenService; + + + /** + * todo 获取地图数据 + */ + @GetMapping("/mapData") + public Result>> mapData(@RequestParam Map params) { + if (params.isEmpty()) { + return Result.success(dataScreenService.mapData()); + } else { + String deptId = params.get("id").toString(); +// return Result.success(dataScreenService.mapCountyData(deptId)); + } + return null; + } + +} diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java index 98ee9cd..ed46983 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java @@ -2,6 +2,10 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.biutag.supervision.pojo.entity.DataPetition12337; +import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * @author 舒云 @@ -11,6 +15,14 @@ import com.biutag.supervision.pojo.entity.DataPetition12337; */ public interface DataPetition12337Mapper extends BaseMapper { + + @Select("SELECT DATE_FORMAT(dpc.discover_time, '%Y-%m') AS monthTime, COUNT(*) total " + + " FROM data_petition_12337 dpc " + + " WHERE YEAR(dpc.discover_time) = #{year} " + + " GROUP BY monthTime " + + " ORDER BY monthTime asc;") + List selectRecentlyMailTrendByMonth12337(String year); + } diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java index 1562724..673d0b9 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetitionComplaintMapper.java @@ -15,6 +15,7 @@ public interface DataPetitionComplaintMapper extends BaseMapper selectEntanglementMail(Integer id, int isEntanglement, Date beginTime, Date endTime); + List selectEntanglementMail(Integer id, int isEntanglement, Date beginTime, Date endTime); @Select("SELECT sd.id, sd.short_name label,count(*) value " + @@ -83,8 +85,6 @@ public interface DataPetitionComplaintMapper extends BaseMapper selectRecentlyMailTrendByDay(Integer sourcesCode, String frontDay, String currentDay); - - @Select("SELECT DATE_FORMAT(dpc.discovery_time, '%Y-%m') AS monthTime, COUNT(*) total " + "FROM data_petition_complaint dpc " + "WHERE YEAR(dpc.discovery_time) = #{year} " + @@ -95,4 +95,5 @@ public interface DataPetitionComplaintMapper extends BaseMapper data = new ArrayList<>(); + + // 办理时限 + @NotBlank + private String timeLimit; + + // 最大签收时长(天) + private Integer maxSignDuration; + + // 最大办理时长(天) + private Integer maxHandleDuration; + + // 最大延期时长(天) + private Integer maxExtensionDuration; + + // 审批流程 + @NotBlank + private String approvalFlow; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java b/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java index 3fab562..540d044 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java @@ -71,4 +71,8 @@ public class DataCaseVerif { // 分发状态 private String distributionState; + // 是否属实 + @TableField("is_real") + private Integer isReal; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java b/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java index 7840ed0..fcc5db6 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java @@ -3,9 +3,11 @@ package com.biutag.supervision.pojo.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.time.LocalDateTime; /** * @@ -17,488 +19,593 @@ public class DataPetition12337 implements Serializable { /** * 唯一编号 */ - @TableId - private String only_id; + @TableId(value = "only_id") + private String onlyId; /** * 外网线索编号 */ - private String external_id; + @TableField(value = "external_id") + private String externalId; /** * 内网线索编号 */ - private String inner_id; + @TableField(value = "inner_id") + private String innerId; /** * 单机版线索编号 */ - private String stand_alone; + @TableField(value = "stand_alone") + private String standAlone; /** * 信息受理登记时间 */ - private String discover_time; + @TableField(value = "discover_time") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoverTime; /** * 线索来源 */ - private String letter_source; + @TableField(value = "letter_source") + private String letterSource; /** * 举报人姓名 */ + @TableField(value = "name") private String name; /** * 手机号码 */ + @TableField(value = "phone") private String phone; /** * 身份证号 */ - private String id_code; + @TableField(value = "id_code") + private String idCode; /** * 举报人(省) */ - private String reporter_provincial; + @TableField(value = "reporter_provincial") + private String reporterProvincial; /** * 举报人(市) */ - private String reporter_city; + @TableField(value = "reporter_city") + private String reporterCity; /** * 举报人(县) */ - private String reporter_county; + @TableField(value = "reporter_county") + private String reporterCounty; /** * 现住地详址 */ + @TableField(value = "address") private String address; /** * 是否政法干警 */ - private String is_law_police; + @TableField(value = "is_law_police") + private String isLawPolice; /** * 被举报人姓名 */ - private String reported_name; + @TableField(value = "reported_name") + private String reportedName; /** * 所属系统 */ - private String belong_system; + @TableField(value = "belong_system") + private String belongSystem; /** * 人员类别 */ - private String person_type; + @TableField(value = "person_type") + private String personType; /** * 被举报人所在地(省) */ - private String reported_provincial; + @TableField(value = "reported_provincial") + private String reportedProvincial; /** * 被举报人所在地(市) */ - private String reported_city; + @TableField(value = "reported_city") + private String reportedCity; /** * 被举报人所在地(县) */ - private String reported_county; + @TableField(value = "reported_county") + private String reportedCounty; /** * 单位名称 */ - private String org_name; + @TableField(value = "org_name") + private String orgName; /** * 单位所属层级 */ - private String org_level; + @TableField(value = "org_level") + private String orgLevel; /** * 具体职务 */ - private String job_name; + @TableField(value = "job_name") + private String jobName; /** * 职级 */ - private String job_level; + @TableField(value = "job_level") + private String jobLevel; /** * 被举报单位名称 */ - private String reported_org_name; + @TableField(value = "reported_org_name") + private String reportedOrgName; /** * 被举报单位所属系统 */ - private String reported_org_belong; + @TableField(value = "reported_org_belong") + private String reportedOrgBelong; /** * 被举报单位所在地(省) */ - private String reported_org_provincial; + @TableField(value = "reported_org_provincial") + private String reportedOrgProvincial; /** * 被举报单位所在地(市) */ - private String reported_org_city; + @TableField(value = "reported_org_city") + private String reportedOrgCity; /** * 被举报单位所在地(县) */ - private String reported_org_county; + @TableField(value = "reported_org_county") + private String reportedOrgCounty; /** * 被举报单位单位所属层级 */ - private String reported_org_level; + @TableField(value = "reported_org_level") + private String reportedOrgLevel; /** * 涉嫌违纪问题项目 */ - private String against_pro_project; + @TableField(value = "against_pro_project") + private String againstProProject; /** * 涉嫌贪污贿赂类犯罪 */ - private String corruption_guilt; + @TableField(value = "corruption_guilt") + private String corruptionGuilt; /** * 涉嫌渎职类犯罪 */ - private String omission_guilt; + @TableField(value = "omission_guilt") + private String omissionGuilt; /** * 涉嫌侵犯公民人身权利类犯罪 */ - private String invade_entitlement_guilt; + @TableField(value = "invade_entitlement_guilt") + private String invadeEntitlementGuilt; /** * 涉嫌侵犯财产类犯罪 */ - private String invade_finance_guilt; + @TableField(value = "invade_finance_guilt") + private String invadeFinanceGuilt; /** * 其他 */ - private String other_guilt; + @TableField(value = "other_guilt") + private String otherGuilt; /** * 顽瘴痼疾项目 */ - private String hard_pro_project; + @TableField(value = "hard_pro_project") + private String hardProProject; /** * 涉嫌违纪违法事项 */ - private String wjwf_project; + @TableField(value = "wjwf_project") + private String wjwfProject; /** * 转办时间 */ - private String pass_time; + @TableField(value = "pass_time") + private String passTime; /** * 转办单位 */ - private String pass_org; + @TableField(value = "pass_org") + private String passOrg; /** * 核查时间 */ - private String review_time; + @TableField(value = "review_time") + private String reviewTime; /** * 核查单位 */ - private String review_org; + @TableField(value = "review_org") + private String reviewOrg; /** * 核查人 */ - private String review_person_name; + @TableField(value = "review_person_name") + private String reviewPersonName; /** * 核查人联系方式 */ - private String review_person_phone; + @TableField(value = "review_person_phone") + private String reviewPersonPhone; /** * 被核查人类别 */ - private String reviewed_person_type; + @TableField(value = "reviewed_person_type") + private String reviewedPersonType; /** * 被核查人是否属于领导班子成员 */ - private String reviewed_person_isleader; + @TableField(value = "reviewed_person_isleader") + private String reviewedPersonIsleader; /** * 是否核查完结 */ - private String reviewed_isover; + @TableField(value = "reviewed_isover") + private String reviewedIsover; /** * 核查简要情况 */ - private String review_des; + @TableField(value = "review_des") + private String reviewDes; /** * 办理结果 */ - private String process_result; + @TableField(value = "process_result") + private String processResult; /** * 是否进行线索初核 */ - private String is_first_view; + @TableField(value = "is_first_view") + private String isFirstView; /** * 核查组组长 */ - private String review_leader; + @TableField(value = "review_leader") + private String reviewLeader; /** * (核查组组长)联系方式 */ - private String review_leader_phone; + @TableField(value = "review_leader_phone") + private String reviewLeaderPhone; /** * 初核情况 */ - private String first_view_des; + @TableField(value = "first_view_des") + private String firstViewDes; /** * 是否立案审查调查 */ - private String is_register_case; + @TableField(value = "is_register_case") + private String isRegisterCase; /** * 立案审查调查情况 */ - private String register_case_des; + @TableField(value = "register_case_des") + private String registerCaseDes; /** * 是否处分处理 */ - private String is_punish; + @TableField(value = "is_punish") + private String isPunish; /** * 处理结论形态 */ - private String process_res_type; + @TableField(value = "process_res_type") + private String processResType; /** * 处理结论结果 */ - private String process_res_des; + @TableField(value = "process_res_des") + private String processResDes; /** * 处分处理情况 */ - private String punish_des; + @TableField(value = "punish_des") + private String punishDes; /** * 是否适用自查从宽政策 */ - private String is_tolerant; + @TableField(value = "is_tolerant") + private String isTolerant; /** * 是否办结 */ - private String is_over; + @TableField(value = "is_over") + private String isOver; /** * 联系时间 */ - private String contact_time; + @TableField(value = "contact_time") + private String contactTime; /** * 联系单位 */ - private String contact_org; + @TableField(value = "contact_org") + private String contactOrg; /** * 联系人 */ - private String contact_person_name; + @TableField(value = "contact_person_name") + private String contactPersonName; /** * 联系方式 */ - private String contact_type; + @TableField(value = "contact_type") + private String contactType; /** * 与举报人联系沟通详情 */ - private String contact_reporter_des; + @TableField(value = "contact_reporter_des") + private String contactReporterDes; /** * 超期未反馈原因 */ - private String overtime_reason; + @TableField(value = "overtime_reason") + private String overtimeReason; /** * 是否申请异议 */ - private String is_dissent; + @TableField(value = "is_dissent") + private String isDissent; /** * 目标省份 */ - private String aim_provincial; + @TableField(value = "aim_provincial") + private String aimProvincial; /** * 申请人 */ - private String apply_person_name; + @TableField(value = "apply_person_name") + private String applyPersonName; /** * 联系方式 */ - private String apply_person_phone; + @TableField(value = "apply_person_phone") + private String applyPersonPhone; /** * 申请原因 */ - private String apply_reason; + @TableField(value = "apply_reason") + private String applyReason; /** * 异议处理方式 */ - private String dissent_handle; + @TableField(value = "dissent_handle") + private String dissentHandle; /** * 处理说明 */ - private String dissent_handle_explain; + @TableField(value = "dissent_handle_explain") + private String dissentHandleExplain; /** * 是否存在附件 */ - private String is_annex; + @TableField(value = "is_annex") + private String isAnnex; /** * 附件文件名 */ - private String annex_name; + @TableField(value = "annex_name") + private String annexName; /** * 线索举报时间 */ - private String report_time; + @TableField(value = "report_time") + private String reportTime; /** * 导入时间 */ - private String enter_time; + @TableField(value = "enter_time") + private String enterTime; /** * 分发时间 */ - private String distribute_time; + @TableField(value = "distribute_time") + private String distributeTime; /** * 是否违纪违法线索 */ - private String is_against_clue; + @TableField(value = "is_against_clue") + private String isAgainstClue; /** * 是否涉法涉诉线索 */ - private String is_appeal_clue; + @TableField(value = "is_appeal_clue") + private String isAppealClue; /** * 是否范围外线索 */ - private String is_overround_clue; + @TableField(value = "is_overround_clue") + private String isOverroundClue; /** * 是否无效线索 */ - private String is_invalid_clue; + @TableField(value = "is_invalid_clue") + private String isInvalidClue; /** * 是否重点线索 */ - private String is_important_clue; + @TableField(value = "is_important_clue") + private String isImportantClue; /** * 线索是否重复 */ - private String is_repeat_clue; + @TableField(value = "is_repeat_clue") + private String isRepeatClue; /** * 重复线索组别 */ - private String repeat_clue_type; + @TableField(value = "repeat_clue_type") + private String repeatClueType; /** * 线索是否进行了机筛 */ - private String is_machine; + @TableField(value = "is_machine") + private String isMachine; /** * 机筛线索时间 */ - private String machine_tme; + @TableField(value = "machine_tme") + private String machineTme; /** * 线索是否经过人工筛查 */ - private String is_person; + @TableField(value = "is_person") + private String isPerson; /** * 人工筛查线索时间 */ - private String person_time; + @TableField(value = "person_time") + private String personTime; /** * 是否关注线索 */ - private String is_care; + @TableField(value = "is_care") + private String isCare; /** * 关注时间 */ - private String care_time; + @TableField(value = "care_time") + private String careTime; /** * 操作时间 */ - private String handle_time; + @TableField(value = "handle_time") + private String handleTime; /** * 二级机构id */ - private String second_depart_id; + @TableField(value = "second_depart_id") + private String secondDepartId; /** * 二级机构名字 */ - private String second_depart_name; + @TableField(value = "second_depart_name") + private String secondDepartName; /** * 三级机构id */ - private String third_depart_id; + @TableField(value = "third_depart_id") + private String thirdDepartId; /** * 三级机构简称 */ - private String third_depart_name; + @TableField(value = "third_depart_name") + private String thirdDepartName; + + + /** + * 下发状态 + */ + @TableField(value = "distributionState") + private String distributionState; + @TableField(exist = false) private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java index 84ffd85..107119e 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java @@ -20,4 +20,6 @@ public class DataCaseVerifQueryParam extends BasePage { private String thingDesc; private String distributionState; + + private String checkStatus; // 是否属实 } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337Vo.java b/src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337Vo.java new file mode 100644 index 0000000..ba6763a --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337Vo.java @@ -0,0 +1,173 @@ +package com.biutag.supervision.pojo.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * + * @TableName data_petition_12337 + */ +@Data +public class DataPetition12337Vo implements Serializable { + /** + * 唯一编号 + */ + private String onlyId; + + + + /** + * 信息受理登记时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoverTime; + + /** + * 线索来源 + */ + private String letterSource; + + /** + * 举报人姓名 + */ + private String name; + + /** + * 手机号码 + */ + private String phone; + + /** + * 身份证号 + */ + private String idCode; + + /** + * 现住地详址 + */ + private String address; + + + + /** + * 被举报人姓名 + */ + private String reportedName; + + + + /** + * 人员类别 + */ + private String personType; + + + + /** + * 单位名称 + */ + private String orgName; + + + /** + * 具体职务 + */ + private String jobName; + + + + /** + * 被举报单位名称 + */ + private String reportedOrgName; + + + + /** + * 涉嫌违纪问题项目 + */ + private String againstProProject; + + /** + * 涉嫌贪污贿赂类犯罪 + */ + private String corruptionGuilt; + + /** + * 涉嫌渎职类犯罪 + */ + private String omissionGuilt; + + /** + * 涉嫌侵犯公民人身权利类犯罪 + */ + private String invadeEntitlementGuilt; + + /** + * 涉嫌侵犯财产类犯罪 + */ + private String invadeFinanceGuilt; + + /** + * 其他 + */ + private String otherGuilt; + + /** + * 顽瘴痼疾项目 + */ + private String hardProProject; + + /** + * 涉嫌违纪违法事项 + */ + private String wjwfProject; + + + + /** + * 办理结果 + */ + private String processResult; + + + /** + * 是否办结 + */ + private String isOver; + + /** + * 二级机构id + */ + private String secondDepartId; + + /** + * 二级机构名字 + */ + private String secondDepartName; + + /** + * 三级机构id + */ + private String thirdDepartId; + + /** + * 三级机构简称 + */ + private String thirdDepartName; + + /** + * 下发状态 + */ + private String distributionState; + + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java index 0ce6268..f036883 100644 --- a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java +++ b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java @@ -32,6 +32,7 @@ public class DataCaseVerifService extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.like(StrUtil.isNotBlank(queryParam.getOriginId()), DataCaseVerif::getOriginId, queryParam.getOriginId()) .like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataCaseVerif::getThingDesc, queryParam.getThingDesc()) + .eq(StrUtil.isNotBlank(queryParam.getCheckStatus()), DataCaseVerif::getIsReal, queryParam.getCheckStatus()) .eq(StrUtil.isNotBlank(queryParam.getDistributionState()), DataCaseVerif::getDistributionState, queryParam.getDistributionState()) .orderByDesc(DataCaseVerif::getCreateTime); return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); diff --git a/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java b/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java new file mode 100644 index 0000000..1714a62 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DataPetition12337Service.java @@ -0,0 +1,105 @@ +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.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.DistributionStateEnum; +import com.biutag.supervision.constants.enums.HostLevelEnums; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.mapper.DataPetition12337Mapper; +import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute; +import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute12337; +import com.biutag.supervision.pojo.dto.NegativeDto; +import com.biutag.supervision.pojo.entity.DataPetition12337; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +/** + * @author 舒云 + * @description 针对表【data_petition_12337】的数据库操作Service实现 + * @createDate 2024-11-04 10:50:37 + */ +@Service +@RequiredArgsConstructor +public class DataPetition12337Service extends ServiceImpl { + private final NegativeService negativeService; + + public Page page(DataPetitionComplaintQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(queryParam.getOriginId()), DataPetition12337::getOnlyId, queryParam.getOriginId()) + .like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataPetition12337::getWjwfProject, queryParam.getThingDesc()) + // 按创建时间倒序排序 + .orderByDesc(DataPetition12337::getDiscoverTime); + // 如果 discoveryTime 有两个值(表示时间范围),则添加范围查询条件 + if (queryParam.getDiscoveryTime().size() == 2) { + queryWrapper.between(DataPetition12337::getDiscoverTime, queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); + } + + // 如果 responderKey 和 responderValue 都不为空,则根据 responderKey 匹配相应的字段 + if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { + switch (queryParam.getResponderKey()) { + case "name": + queryWrapper.like(DataPetition12337::getName, queryParam.getResponderValue()); + break; + case "phone": + queryWrapper.like(DataPetition12337::getPhone, queryParam.getResponderValue()); + break; + } + } + return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + } + + + /** + * 下发 + * @param dataDistribute + * @return + */ + public boolean distribution(DataDataPetitionComplainDistribute12337 dataDistribute) { + dataDistribute.getData().forEach(item -> { + NegativeDto negativeDto = new NegativeDto(); + negativeDto.setOriginId(item.getOnlyId()); + negativeDto.setDiscoveryTime(item.getDiscoverTime()); + negativeDto.setProblemSourcesCode("24"); + negativeDto.setProblemSources("12337信访"); +// negativeDto.setBusinessTypeCode(BusinessTypeEnum.ABWW); +// negativeDto.setBusinessTypeName(); + negativeDto.setResponderName(item.getName()); + negativeDto.setContactPhone(item.getPhone()); + negativeDto.setThingDesc(item.getWjwfProject()); + String departId; + String departName; + if (StrUtil.isBlank(item.getThirdDepartId())) { + departId = item.getSecondDepartId(); + departName = item.getSecondDepartName(); + } else { + departId = item.getThirdDepartId(); + departName = item.getThirdDepartName(); + } + negativeDto.setInvolveDepartId(departId); + negativeDto.setInvolveDepartName(departName); + negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue()); + + negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow()); + negativeDto.setDepartId(departId); + negativeDto.setDepartName(departName); + negativeDto.setTimeLimit(dataDistribute.getTimeLimit()); + negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration()); + negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration()); + negativeDto.setMaxExtensionDuration(dataDistribute.getMaxExtensionDuration()); + negativeDto.setCaseNumber(item.getOnlyId()); + negativeService.save(negativeDto); + update(new LambdaUpdateWrapper().eq(DataPetition12337::getOnlyId, item.getOnlyId()) + .set(DataPetition12337::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); + }); + return true; + } +} + + + + diff --git a/src/main/java/com/biutag/supervision/service/DataPetition12337ServiceImpl.java b/src/main/java/com/biutag/supervision/service/DataPetition12337ServiceImpl.java deleted file mode 100644 index 9550876..0000000 --- a/src/main/java/com/biutag/supervision/service/DataPetition12337ServiceImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.biutag.supervision.service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.mapper.DataPetition12337Mapper; -import com.biutag.supervision.pojo.entity.DataPetition12337; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -/** - * @author 舒云 - * @description 针对表【data_petition_12337】的数据库操作Service实现 - * @createDate 2024-11-04 10:50:37 - */ -@Service -@RequiredArgsConstructor -public class DataPetition12337ServiceImpl extends ServiceImpl { - -} - - - - diff --git a/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java b/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java index 20ae48a..727579d 100644 --- a/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java +++ b/src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java @@ -164,18 +164,18 @@ public class DataPetitionComplaintService extends ServiceImpl tangleQueryWrapper = new QueryWrapper<>(); tangleQueryWrapper.eq("entanglement_visits", 1); tangleQueryWrapper.between("discovery_time", beginTime, endTime); Long tangleMail = dataPetitionComplaintMapper.selectCount(tangleQueryWrapper); - // 集访 1:集 2:不集 + // 集访 1:集 0:不集 QueryWrapper massQueryWrapper = new QueryWrapper<>(); massQueryWrapper.eq("mass_visits", 1); massQueryWrapper.between("discovery_time", beginTime, endTime); Long massMail = dataPetitionComplaintMapper.selectCount(massQueryWrapper); // 总数 - long totalMail = countryMail+policeMail+5534+total12337; + long totalMail = countryMail+policeMail+total12337; JSONObject overview = new JSONObject() // 信访总数(起) @@ -224,9 +224,17 @@ public class DataPetitionComplaintService extends ServiceImpl getRecentlyMailTrendByMonth(Integer sourcesCode, String year) { List recentMailTrendVos = dataPetitionComplaintMapper.selectRecentlyMailTrendByMonth(MailTrendSourcesEnum.getMappedCodeByCode(sourcesCode), year); return recentMailTrendVos; } + + + public List getRecentlyMailTrendByMonth12337(String year) { + List recentMailTrendVos = + dataPetition12337Mapper.selectRecentlyMailTrendByMonth12337(year); + return recentMailTrendVos; + } } diff --git a/src/main/java/com/biutag/supervision/service/DataScreenService.java b/src/main/java/com/biutag/supervision/service/DataScreenService.java new file mode 100644 index 0000000..0d599d5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/DataScreenService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@RequiredArgsConstructor +@Service +public class DataScreenService extends ServiceImpl { + + + public List> mapData() { + return null; + } +} From 18b268c241b891100030f7e7dc12542551431c49 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Tue, 5 Nov 2024 18:28:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=94=BB=E5=83=8F=E3=80=81=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=94=BB=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/enums/PersonTypeEnum.java | 7 +++ .../ProfileDepartController.java | 31 ++++++++----- .../ProfilePoliceController.java | 21 +++++++-- .../com/biutag/supervision/job/DepartJob.java | 21 ++++----- .../mapper/ProfileDepartMapper.java | 5 ++- .../supervision/mapper/SupPoliceMapper.java | 2 - .../supervision/pojo/domain/NegativeInfo.java | 9 ++-- .../pojo/entity/SupDepartPoliceSize.java | 9 ++-- .../service/SupDepartPoliceSizeService.java | 22 ++++++++- .../supervision/service/SupPoliceService.java | 8 ++-- .../resources/mapper/ProfileDepartMapper.xml | 45 ++++++++++++------- 11 files changed, 121 insertions(+), 59 deletions(-) diff --git a/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java index c0bd005..95163f9 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java @@ -3,6 +3,8 @@ package com.biutag.supervision.constants.enums; import lombok.AllArgsConstructor; import lombok.Getter; +import java.util.List; + /** * @author wxc * @date 2024/11/1 @@ -18,4 +20,9 @@ public enum PersonTypeEnum { xj("5", "协警"); private String value; private String label; + + public static List getAuxPersonType() { + return List.of(works.getValue(), aux.getValue(), clerk.getValue(), xj.getValue()); + } + } 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 1a32eaa..7ff5656 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -73,33 +73,39 @@ public class ProfileDepartController { List polices = policeService.listAllByDepartId(departId); profileDepart.getDepartInfo().setMainRole(polices.stream().filter(item -> "正职".equals(item.getPosition())).findFirst().map(SupPolice::getName).orElse(null)); profileDepart.getDepartInfo().setDeputyRole(polices.stream().filter(item -> "副职".equals(item.getPosition())).map(SupPolice::getName).toList()); - // 民警数量 - profileDepart.getDepartInfo().setPoliceSize(polices.stream().filter(item -> PersonTypeEnum.police.getValue().equals(item.getPersonType())).count()); - - // 协警辅警数量 - profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonType()) || PersonTypeEnum.xj.getValue().equals(item.getPersonType())).count()); List list = negativeService.list(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) .between(Negative::getCrtTime, beginTime, endTime) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); List negativeIds = list.stream().map(Negative::getId).toList(); - int negativePoliceSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); + int negativePoliceSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.police.getValue())); profileDepart.getDepartInfo().setNegativePoliceSize(negativePoliceSize); - int negativeAuxSize = profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); + int negativeAuxSize = negativeIds.isEmpty() ? 0 : profileDepartMapper.countByNegativeIdsAndPersonTypes(negativeIds, List.of(PersonTypeEnum.aux.getValue(), PersonTypeEnum.xj.getValue())); profileDepart.getDepartInfo().setNegativeAuxSize(negativeAuxSize); profileDepart.getNegativeInfo().setSize(list.size()); - int jcjBusinessSize = businessDepartService.list(new LambdaQueryWrapper() + int jcj110BusinessSize = businessDepartService.list(new LambdaQueryWrapper() .between(BusinessDepart::getDate, beginTime, endTime) .eq(BusinessDepart::getBusinessType, BusinessTypeEnum.JCJ_110.getValue()) .eq(BusinessDepart::getDepartId, departId)) .stream().mapToInt(BusinessDepart::getNumber).sum(); - int jcjSize = negativeService.list(new LambdaQueryWrapper() + int jcj110Size = negativeService.list(new LambdaQueryWrapper() .between(Negative::getCrtTime, 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(); + int jcj122BusinessSize = businessDepartService.list(new LambdaQueryWrapper() + .between(BusinessDepart::getDate, beginTime, endTime) + .eq(BusinessDepart::getBusinessType, BusinessTypeEnum.JCJ_122.getValue()) + .eq(BusinessDepart::getDepartId, departId)) + .stream().mapToInt(BusinessDepart::getNumber).sum(); + int jcj122Size = negativeService.list(new LambdaQueryWrapper() + .between(Negative::getCrtTime, 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(); + int zfbaBusinessSize = businessDepartService.list(new LambdaQueryWrapper() .between(BusinessDepart::getDate, beginTime, endTime) .eq(BusinessDepart::getBusinessType, BusinessTypeEnum.ZFBA.getValue()) @@ -110,7 +116,10 @@ public class ProfileDepartController { .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue()) .eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); - profileDepart.getNegativeInfo().setJcjSize(jcjSize).setJcjBusinessSize(jcjBusinessSize).setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); + profileDepart.getNegativeInfo().setJcj110Size(jcj110Size).setJcj110BusinessSize(jcj110BusinessSize) + .setJcj122Size(jcj122Size) + .setJcj122BusinessSize(jcj122BusinessSize) + .setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); // 问题来源占比 Map> problemSourcesGroup = list.stream().collect(Collectors.groupingBy(Negative::getProblemSourcesCode)); List problemSourcesList = problemSourcesGroup.keySet().stream().map(key -> new PieItem(Optional.ofNullable(ProblemSourcesEnum.get(key)).map(ProblemSourcesEnum::getLabel).orElse(key), problemSourcesGroup.get(key).size())).toList(); @@ -137,7 +146,7 @@ public class ProfileDepartController { profileDepart.setProblemTypeRadarIndicator(problemTypeRadarIndicator); profileDepart.setProblemTypeRadarData(problemTypeRadarData); // 突出问题排名 - profileDepart.setProblemTypeBarList(problemTypeBarList); + profileDepart.setProblemTypeBarList(profileDepartMapper.selectThirdProblemType(departId, beginTime, endTime)); return Result.success(profileDepart); } 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 9dc3e40..8ad6492 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java @@ -76,7 +76,7 @@ public class ProfilePoliceController { ProfilePolice profilePolice = new ProfilePolice(); profilePolice.setPoliceInfo(policeService.getByIdCode(idCode)); - int jcjBusinessSize = businessPoliceService.list(new LambdaQueryWrapper() + int jcj110BusinessSize = businessPoliceService.list(new LambdaQueryWrapper() .between(BusinessPolice::getDate, beginTime, endTime) .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.JCJ_110.getValue()) .eq(BusinessPolice::getEmpNo, profilePolice.getPoliceInfo().getEmpNo()) @@ -84,11 +84,24 @@ public class ProfilePoliceController { .stream().mapToInt(BusinessPolice::getNumber).sum(); Set negativeIds = negativeBlameService.list(new LambdaQueryWrapper().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()); - int jcjSize = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() + int jcj110Size = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() .between(Negative::getCrtTime, 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(); + int jcj122BusinessSize = businessPoliceService.list(new LambdaQueryWrapper() + .between(BusinessPolice::getDate, beginTime, endTime) + .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.JCJ_122.getValue()) + .eq(BusinessPolice::getEmpNo, profilePolice.getPoliceInfo().getEmpNo()) + .eq(BusinessPolice::getPoliceName, profilePolice.getPoliceInfo().getName())) + .stream().mapToInt(BusinessPolice::getNumber).sum(); + + int jcj122Size = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() + .between(Negative::getCrtTime, 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(); + int zfbaBusinessSize = businessPoliceService.list(new LambdaQueryWrapper() .between(BusinessPolice::getDate, beginTime, endTime) .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.ZFBA.getValue()) @@ -100,7 +113,9 @@ public class ProfilePoliceController { .eq(Negative::getBusinessTypeCode, BusinessTypeEnum.ZFBA.getValue()) .in(Negative::getId, negativeIds) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))).size(); - profilePolice.getNegativeInfo().setJcjBusinessSize(jcjBusinessSize).setJcjSize(jcjSize).setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); + profilePolice.getNegativeInfo().setJcj110BusinessSize(jcj110BusinessSize).setJcj110Size(jcj110Size) + .setJcj122BusinessSize(jcj122BusinessSize).setJcj122Size(jcj122Size) + .setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); List list = negativeIds.isEmpty() ? new ArrayList<>() : negativeService.list(new LambdaQueryWrapper() .between(Negative::getCrtTime, beginTime, endTime) diff --git a/src/main/java/com/biutag/supervision/job/DepartJob.java b/src/main/java/com/biutag/supervision/job/DepartJob.java index 756657e..7fae51e 100644 --- a/src/main/java/com/biutag/supervision/job/DepartJob.java +++ b/src/main/java/com/biutag/supervision/job/DepartJob.java @@ -1,12 +1,13 @@ package com.biutag.supervision.job; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.service.SupDepartPoliceSizeService; import com.biutag.supervision.service.SupDepartService; -import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.List; @@ -23,12 +24,6 @@ public class DepartJob { private final SupDepartPoliceSizeService departPoliceSizeService; - - @PostConstruct - public void init() { -// updateDepartPath(); - } - @Async public void updateDepartPath() { List departs = departService.list(); @@ -41,14 +36,14 @@ public class DepartJob { } - @Async + /** + * 1个小时 + */ + @Scheduled(fixedRate = 1000 * 60 * 60) public void updatePoliceSize() { - List departs = departService.list(); + List departs = departService.list(new LambdaQueryWrapper().eq(SupDepart::getLevel, 3)); departs.forEach(item -> { - String pathTrace = departService.getPathTrace(item); - if (!pathTrace.equals(item.getPathTrace())) { - departService.update(new LambdaUpdateWrapper().eq(SupDepart::getId, item.getId()).set(SupDepart::getPathTrace, pathTrace)); - } + departPoliceSizeService.saveOrUpdate(item.getId()); }); } diff --git a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java index 84fbce5..71a2ee3 100644 --- a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.dto.common.PieItem; import com.biutag.supervision.pojo.model.DepartNegativeModel; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.Date; @@ -22,6 +23,8 @@ public interface ProfileDepartMapper { List selectProblemType(String departId, Date beginTime, Date endTime); - int countByNegativeIdsAndPersonTypes(List negativeIds, List personTypes); + List selectThirdProblemType(String departId, Date beginTime, Date endTime); + + int countByNegativeIdsAndPersonTypes(@Param("negativeIds") List negativeIds, @Param("personTypes") List personTypes); } diff --git a/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java index 1b374ca..97f4148 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupPoliceMapper.java @@ -15,6 +15,4 @@ public interface SupPoliceMapper extends BaseMapper { Page queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); - - } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java index 3dc642e..05eb1f1 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java @@ -14,9 +14,12 @@ import lombok.experimental.Accessors; public class NegativeInfo { private long size; - // 接处警 - private Integer jcjBusinessSize; - private Integer jcjSize; + // 110接处警 + private Integer jcj110BusinessSize; + private Integer jcj110Size; + // 122接处警 + private Integer jcj122BusinessSize; + private Integer jcj122Size; // 执法办案 private Integer zfbaBusinessSize; private Integer zfbaSize; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java index 54b2ba4..360d7a7 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDepartPoliceSize.java @@ -1,13 +1,12 @@ 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 SupDepartPoliceSize { @@ -18,10 +17,10 @@ public class SupDepartPoliceSize { // 民警人数 @TableField("police_size") - private Integer policeSize; + private Long policeSize; // 协警人数 @TableField("aux_size") - private Integer auxSize; + private Long auxSize; } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java b/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java index d8bd4b4..ce04a58 100644 --- a/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java +++ b/src/main/java/com/biutag/supervision/service/SupDepartPoliceSizeService.java @@ -1,11 +1,31 @@ package com.biutag.supervision.service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.pojo.entity.SupDepartPoliceSize; +import com.biutag.supervision.constants.enums.PersonTypeEnum; import com.biutag.supervision.mapper.SupDepartPoliceSizeMapper; +import com.biutag.supervision.pojo.entity.SupDepartPoliceSize; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + +@RequiredArgsConstructor @Service public class SupDepartPoliceSizeService extends ServiceImpl { + private final SupDepartService departService; + + private final SupPoliceService policeService; + + public boolean saveOrUpdate(String departId) { + List departChildrenIds = departService.getAllNodeIds(departId); + List list = new ArrayList<>(departChildrenIds); + list.add(departId); + long policeSize = policeService.countByOrgIdsAndPersonTypes(list, List.of(PersonTypeEnum.police.getValue())); + long auxSize = policeService.countByOrgIdsAndPersonTypes(list, PersonTypeEnum.getAuxPersonType()); + SupDepartPoliceSize departPoliceSize = new SupDepartPoliceSize().setDepartId(departId).setPoliceSize(policeSize).setAuxSize(auxSize); + return saveOrUpdate(departPoliceSize); + } + } diff --git a/src/main/java/com/biutag/supervision/service/SupPoliceService.java b/src/main/java/com/biutag/supervision/service/SupPoliceService.java index 7c7d7e7..333bf19 100644 --- a/src/main/java/com/biutag/supervision/service/SupPoliceService.java +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -76,12 +76,12 @@ public class SupPoliceService extends ServiceImpl { return exists(new LambdaQueryWrapper().in(SupPolice::getOrgId, orgIds)); } - public Boolean ge(String empNo) { - return exists(new LambdaQueryWrapper().in(SupPolice::getEmpNo, empNo)); - } - public Boolean existsByIdCode(String idCode) { return exists(new LambdaQueryWrapper().in(SupPolice::getIdCode, idCode)); } + public long countByOrgIdsAndPersonTypes(List orgIds, List personTypes) { + return count(new LambdaQueryWrapper().in(SupPolice::getOrgId, orgIds).in(SupPolice::getPersonType, personTypes)); + } + } diff --git a/src/main/resources/mapper/ProfileDepartMapper.xml b/src/main/resources/mapper/ProfileDepartMapper.xml index 11e3084..7f80074 100644 --- a/src/main/resources/mapper/ProfileDepartMapper.xml +++ b/src/main/resources/mapper/ProfileDepartMapper.xml @@ -11,22 +11,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" count( n.id ) verify_size FROM ( - SELECT - d.id depart_id, - d1.short_name parent_depart_name, - d.short_name depart_name, - sum( CASE WHEN p.person_type = '1' THEN 1 ELSE 0 END ) police_size, - sum( CASE WHEN p.person_type = '3' OR p.person_type = '5' THEN 1 ELSE 0 END ) aux_size + SELECT + d.id depart_id, + d1.short_name parent_depart_name, + d.short_name depart_name, + p.police_size, + p.aux_size FROM - sup_depart d + sup_depart d LEFT JOIN sup_depart d1 ON d.pid = d1.id - LEFT JOIN sup_police p ON p.org_id = d.id + LEFT JOIN sup_depart_police_size p ON p.depart_id = d.id WHERE - d.LEVEL = 3 - GROUP BY - d.id, - d1.short_name, - d.short_name + d.LEVEL = 3 ) d LEFT JOIN negative n ON n.involveDepartId = d.depart_id AND n.checkStatus IN ( '1', '2' ) @@ -88,9 +84,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by value desc - SELECT - count( p.id ) + pr.`threeLevelContent` name, + count( DISTINCT n.id ) value + FROM + negative_problem_relation pr + LEFT JOIN negative_blame nb ON pr.blameId = nb.blameId + 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} + GROUP BY + pr.`threeLevelContent` + having value > 0 + order by value desc + + + From 762ae181f9ad56a7bfdcfdb6021fd35279125842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E7=88=B1=E5=AD=A6=E4=B9=A0=E7=9A=84=E7=9F=B3?= =?UTF-8?q?=E5=90=8C=E5=AD=A6?= <2936013465@qq.com> Date: Tue, 5 Nov 2024 18:45:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=A1=E8=AE=BF=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E5=90=8E=E7=AB=AF1.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datav/DataScreenController.java | 5 ++- .../service/DataScreenService.java | 36 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java b/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java index 1d089c7..321a693 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataScreenController.java @@ -1,7 +1,6 @@ package com.biutag.supervision.controller.datav; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.service.DataScreenService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; @@ -25,7 +24,7 @@ import java.util.Map; public class DataScreenController { - private final DataScreenService dataScreenService; +// private final DataScreenService dataScreenService; /** @@ -34,7 +33,7 @@ public class DataScreenController { @GetMapping("/mapData") public Result>> mapData(@RequestParam Map params) { if (params.isEmpty()) { - return Result.success(dataScreenService.mapData()); +// return Result.success(dataScreenService.mapData()); } else { String deptId = params.get("id").toString(); // return Result.success(dataScreenService.mapCountyData(deptId)); diff --git a/src/main/java/com/biutag/supervision/service/DataScreenService.java b/src/main/java/com/biutag/supervision/service/DataScreenService.java index 0d599d5..126ea00 100644 --- a/src/main/java/com/biutag/supervision/service/DataScreenService.java +++ b/src/main/java/com/biutag/supervision/service/DataScreenService.java @@ -1,18 +1,18 @@ -package com.biutag.supervision.service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@RequiredArgsConstructor -@Service -public class DataScreenService extends ServiceImpl { - - - public List> mapData() { - return null; - } -} +//package com.biutag.supervision.service; +// +//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +//import lombok.RequiredArgsConstructor; +//import org.springframework.stereotype.Service; +// +//import java.util.List; +//import java.util.Map; +// +//@RequiredArgsConstructor +//@Service +//public class DataScreenService extends ServiceImpl { +// +// +// public List> mapData() { +// return null; +// } +//}