From 1f615c867c03ed82d83b5f709d7239859fb6bd4a Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Sun, 3 Nov 2024 16:05:43 +0800 Subject: [PATCH] =?UTF-8?q?fit:=20=E5=8D=95=E4=BD=8D=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E7=94=BB=E5=83=8F=E3=80=81=E4=B8=AA=E4=BA=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E7=94=BB=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/enums/InspectCaseEnum.java | 8 +- .../ProfileDepartController.java | 87 ++++++++-- .../ProfilePoliceController.java | 155 ++++++++++++++++++ .../mapper/ProfileDepartMapper.java | 2 + .../mapper/ProfilePoliceMapper.java | 19 +++ .../supervision/pojo/domain/NegativeInfo.java | 23 +++ .../pojo/domain/ProfileDepart.java | 18 +- .../pojo/domain/ProfilePolice.java | 23 +++ .../supervision/pojo/dto/common/BarItem.java | 18 ++ .../pojo/model/PoliceNegativeModel.java | 29 ++++ .../pojo/param/DepartPoliceQueryParam.java | 24 +++ .../resources/mapper/ProfileDepartMapper.xml | 21 ++- .../resources/mapper/ProfilePoliceMapper.xml | 48 ++++++ .../java/com/biutag/supervision/StrUtil.java | 8 +- 14 files changed, 447 insertions(+), 36 deletions(-) create mode 100644 src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java create mode 100644 src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java create mode 100644 src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java create mode 100644 src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java create mode 100644 src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java create mode 100644 src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java create mode 100644 src/main/java/com/biutag/supervision/pojo/param/DepartPoliceQueryParam.java create mode 100644 src/main/resources/mapper/ProfilePoliceMapper.xml diff --git a/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java b/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java index 9a20161..6d12901 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/InspectCaseEnum.java @@ -13,16 +13,12 @@ public enum InspectCaseEnum { // 部分属实 PARTIALLY_TRUE("2"), // 不属实 - FALSE("3"), - - NOT_VERIFIED("4"), - - OTHER("5"); + FALSE("3"); private String value; public static boolean isItTure(String value) { - return StrUtil.isNotBlank(value) && !OTHER.getValue().equals(value); + return StrUtil.isNotBlank(value); } } 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 5cea706..8a2f75e 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfileDepartController.java @@ -1,32 +1,33 @@ package com.biutag.supervision.controller.sensitivePerception; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.BusinessTypeEnum; import com.biutag.supervision.constants.enums.InspectCaseEnum; import com.biutag.supervision.constants.enums.PersonTypeEnum; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.mapper.ProfileDepartMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.ProfileDepart; -import com.biutag.supervision.pojo.entity.Negative; -import com.biutag.supervision.pojo.entity.NegativeBlame; -import com.biutag.supervision.pojo.entity.SupDepart; -import com.biutag.supervision.pojo.entity.SupPolice; +import com.biutag.supervision.pojo.dto.common.BarItem; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.model.DepartNegativeModel; import com.biutag.supervision.pojo.param.DepartNegativeQueryParam; -import com.biutag.supervision.service.NegativeBlameService; -import com.biutag.supervision.service.NegativeService; -import com.biutag.supervision.service.SupDepartService; -import com.biutag.supervision.service.SupPoliceService; +import com.biutag.supervision.service.*; import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Date; -import java.util.List; -import java.util.Objects; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; /** * 单位/个人画像 @@ -42,7 +43,7 @@ public class ProfileDepartController { private final SupDepartService departService; private final SupPoliceService policeService; private final NegativeService negativeService; - private final NegativeBlameService blameService; + private final BusinessDepartService businessDepartService; @GetMapping public Result> list(DepartNegativeQueryParam param) { @@ -57,7 +58,13 @@ public class ProfileDepartController { } @GetMapping("{departId}") - public Result profile(@PathVariable String departId, Date beginTime, Date endTime) { + public Result profile(@PathVariable String departId, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginTime, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) { + if (Objects.isNull(beginTime)) { + beginTime = DateUtil.parse("1949", "YYYY"); + } + if (Objects.isNull(endTime)) { + endTime = new Date(); + } ProfileDepart profileDepart = new ProfileDepart(); SupDepart depart = departService.getById(departId); profileDepart.getDepartInfo() @@ -71,11 +78,61 @@ public class ProfileDepartController { // 协警辅警数量 profileDepart.getDepartInfo().setAuxSize(polices.stream().filter(item -> PersonTypeEnum.aux.getValue().equals(item.getPersonStatus()) || PersonTypeEnum.xj.getValue().equals(item.getPersonStatus())).count()); - long negativeSize = negativeService.count(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) + List list = negativeService.list(new LambdaQueryWrapper().eq(Negative::getInvolveDepartId, departId) .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); - profileDepart.getNegativeInfo().setSize(negativeSize); + profileDepart.getNegativeInfo().setSize(list.size()); + int jcjBusinessSize = 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() + .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 zfbaBusinessSize = businessDepartService.list(new LambdaQueryWrapper() + .between(BusinessDepart::getDate, beginTime, endTime) + .eq(BusinessDepart::getBusinessType, BusinessTypeEnum.ZFBA.getValue()) + .eq(BusinessDepart::getDepartId, departId)) + .stream().mapToInt(BusinessDepart::getNumber).sum(); + int zfbaSize = negativeService.list(new LambdaQueryWrapper() + .between(Negative::getCrtTime, 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(); + profileDepart.getNegativeInfo().setJcjSize(jcjSize).setJcjBusinessSize(jcjBusinessSize).setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); + // 问题来源占比 + Map> problemSourcesGroup = list.stream().collect(Collectors.groupingBy(Negative::getProblemSourcesCode)); + List problemSourcesList = problemSourcesGroup.keySet().stream().map(key -> new PieItem(ProblemSourcesEnum.get(key).getLabel(), problemSourcesGroup.get(key).size())).toList(); + profileDepart.setProblemSourcesList(problemSourcesList); + // 业务类型占比 + Map> businessTypeGroup = list.stream().collect(Collectors.groupingBy(Negative::getBusinessTypeCode)); + List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(BusinessTypeEnum.get(key).getLabel(), businessTypeGroup.get(key).size())).toList(); + profileDepart.setBusinessTypeList(businessTypeList); + // 个人问题排名 + List policeBarList = profileDepartMapper.selectPoliceTop10(departId, beginTime, endTime); + profileDepart.setPoliceBarList(policeBarList); return Result.success(profileDepart); } + @GetMapping("{departId}/month") + public Result listByMonth(@PathVariable String departId) { + LocalDate now = LocalDate.now(); + List months = new ArrayList<>(); + List values = new ArrayList<>(); + for (int i = 11; i >= 0; i--) { + String month = now.minusMonths(i).format(DateTimeFormatter.ofPattern("yyyy年MM月")); + months.add(month); + 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 + "'")); + values.add(value); + } + JSONObject jsonObject = new JSONObject().fluentPut("months", months).fluentPut("values", values); + return Result.success(jsonObject); + } + } diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java new file mode 100644 index 0000000..94018c9 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ProfilePoliceController.java @@ -0,0 +1,155 @@ +package com.biutag.supervision.controller.sensitivePerception; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.BusinessTypeEnum; +import com.biutag.supervision.constants.enums.InspectCaseEnum; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.mapper.ProfilePoliceMapper; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.domain.ProfileDepart; +import com.biutag.supervision.pojo.domain.ProfilePolice; +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.BusinessDepart; +import com.biutag.supervision.pojo.entity.BusinessPolice; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeBlame; +import com.biutag.supervision.pojo.model.PoliceNegativeModel; +import com.biutag.supervision.pojo.param.DepartPoliceQueryParam; +import com.biutag.supervision.service.*; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 单位/个人画像 + * @author wxc + * @date 2024/10/31 + */ +@RequiredArgsConstructor +@RequestMapping("profile/police") +@RestController +public class ProfilePoliceController { + + private final ProfilePoliceMapper profilePoliceMapper; + private final SupPoliceService policeService; + + private final BusinessPoliceService businessPoliceService; + + private final NegativeBlameService negativeBlameService; + private final NegativeService negativeService; + + + @GetMapping + public Result> list(DepartPoliceQueryParam param) { + Date beginTime = DateUtil.parse("1949", "YYYY"); + Date endTime = new Date(); + if (Objects.nonNull(param.getCrtTime()) && !param.getCrtTime().isEmpty()) { + beginTime = param.getCrtTime().get(0); + endTime = param.getCrtTime().get(1); + } + Page page = profilePoliceMapper.queryPoliceNegative(Page.of(param.getCurrent(), param.getSize()), beginTime, endTime, param.getName(),param.getEmpNo(), param.getDepartId()); + return Result.success(page); + } + + @GetMapping("{idCode}") + public Result profile(@PathVariable String idCode, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginTime, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) { + if (Objects.isNull(beginTime)) { + beginTime = DateUtil.parse("1949", "YYYY"); + } + if (Objects.isNull(endTime)) { + endTime = new Date(); + } + ProfilePolice profilePolice = new ProfilePolice(); + profilePolice.setPoliceInfo(policeService.getByIdCode(idCode)); + + int jcjBusinessSize = businessPoliceService.list(new LambdaQueryWrapper() + .between(BusinessPolice::getDate, beginTime, endTime) + .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.JCJ_110.getValue()) + .eq(BusinessPolice::getPoliceIdCode, idCode)) + .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() + .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 zfbaBusinessSize = businessPoliceService.list(new LambdaQueryWrapper() + .between(BusinessPolice::getDate, beginTime, endTime) + .eq(BusinessPolice::getBusinessType, BusinessTypeEnum.ZFBA.getValue()) + .eq(BusinessPolice::getPoliceIdCode, idCode)) + .stream().mapToInt(BusinessPolice::getNumber).sum(); + int zfbaSize = negativeIds.isEmpty() ? 0 : negativeService.list(new LambdaQueryWrapper() + .between(Negative::getCrtTime, 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(); + profilePolice.getNegativeInfo().setJcjBusinessSize(jcjBusinessSize).setJcjSize(jcjSize).setZfbaBusinessSize(zfbaBusinessSize).setZfbaSize(zfbaSize); + + List list = negativeIds.isEmpty() ? new ArrayList<>() : 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()))); + // 问题来源占比 + Map> problemSourcesGroup = list.stream().collect(Collectors.groupingBy(Negative::getProblemSourcesCode)); + List problemSourcesList = problemSourcesGroup.keySet().stream().map(key -> new PieItem(ProblemSourcesEnum.get(key).getLabel(), problemSourcesGroup.get(key).size())).toList(); + profilePolice.setProblemSourcesList(problemSourcesList); + // 业务类型占比 + Map> businessTypeGroup = list.stream().collect(Collectors.groupingBy(Negative::getBusinessTypeCode)); + List businessTypeList = businessTypeGroup.keySet().stream().map(key -> new PieItem(BusinessTypeEnum.get(key).getLabel(), businessTypeGroup.get(key).size())).toList(); + profilePolice.setBusinessTypeList(businessTypeList); + return Result.success(profilePolice); + } + + @GetMapping("{idCode}/negative") + public Result> profile(@PathVariable String idCode, Page page, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginTime, @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) { + if (Objects.isNull(beginTime)) { + beginTime = DateUtil.parse("1949", "YYYY"); + } + if (Objects.isNull(endTime)) { + endTime = new Date(); + } + Set negativeIds = negativeBlameService.list(new LambdaQueryWrapper().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()); + if (negativeIds.isEmpty()) { + return Result.success(new Page().setRecords(new ArrayList<>()).setTotal(0)); + } + Page pageData = negativeService.page(page, new LambdaQueryWrapper() + .between(Negative::getCrtTime, beginTime, endTime) + .in(Negative::getId, negativeIds) + .in(Negative::getCheckStatus, List.of(InspectCaseEnum.TRUE.getValue(), InspectCaseEnum.PARTIALLY_TRUE.getValue()))); + return Result.success(pageData); + } + + @GetMapping("{idCode}/month") + public Result listByMonth(@PathVariable String idCode) { + LocalDate now = LocalDate.now(); + List months = new ArrayList<>(); + List values = new ArrayList<>(); + Set negativeIds = negativeBlameService.list(new LambdaQueryWrapper().eq(NegativeBlame::getBlameIdCode, idCode)).stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()); + + for (int i = 11; i >= 0; i--) { + String month = now.minusMonths(i).format(DateTimeFormatter.ofPattern("yyyy年MM月")); + months.add(month); + 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 + "'")); + values.add(value); + } + JSONObject jsonObject = new JSONObject().fluentPut("months", months).fluentPut("values", values); + return Result.success(jsonObject); + } + +} diff --git a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java index 64c761e..498511f 100644 --- a/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/ProfileDepartMapper.java @@ -1,6 +1,7 @@ package com.biutag.supervision.mapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.dto.common.BarItem; import com.biutag.supervision.pojo.model.DepartNegativeModel; import java.util.Date; @@ -16,4 +17,5 @@ public interface ProfileDepartMapper { int getNegativePoliceSize(List idCodes); + List selectPoliceTop10(String departId, Date beginTime, Date endTime); } diff --git a/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java b/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java new file mode 100644 index 0000000..21f1e3d --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/ProfilePoliceMapper.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.model.DepartNegativeModel; +import com.biutag.supervision.pojo.model.PoliceNegativeModel; + +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/1 + */ +public interface ProfilePoliceMapper { + + Page queryPoliceNegative(Page page, Date beginTime, Date endTime, String name, String empNo, String departId); + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java new file mode 100644 index 0000000..3dc642e --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeInfo.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.domain; + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +/** + * @author wxc + * @date 2024/11/3 + */ +@Setter +@Getter +@Accessors(chain = true) +public class NegativeInfo { + + private long size; + // 接处警 + private Integer jcjBusinessSize; + private Integer jcjSize; + // 执法办案 + private Integer zfbaBusinessSize; + private Integer zfbaSize; +} diff --git a/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java index 9b4b389..5140cc1 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/ProfileDepart.java @@ -1,9 +1,12 @@ package com.biutag.supervision.pojo.domain; +import com.biutag.supervision.pojo.dto.common.BarItem; +import com.biutag.supervision.pojo.dto.common.PieItem; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; +import java.util.ArrayList; import java.util.List; /** @@ -16,7 +19,9 @@ public class ProfileDepart { private DepartInfo departInfo = new DepartInfo(); private NegativeInfo negativeInfo = new NegativeInfo(); - + private List problemSourcesList = new ArrayList<>(); + private List businessTypeList = new ArrayList<>(); + private List policeBarList = new ArrayList<>(); @Setter @Getter @@ -37,16 +42,5 @@ public class ProfileDepart { private Integer negativeAuxSize; } - @Setter - @Getter - public static class NegativeInfo { - private long size; - // 接处警 - private Integer jcjBusinessSize; - private Integer jcjSize; - // 执法办案 - private Integer zfbaBusinessSize; - private Integer jfbaSize; - } } diff --git a/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java b/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java new file mode 100644 index 0000000..a4901ab --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/domain/ProfilePolice.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.domain; + +import com.biutag.supervision.pojo.dto.common.PieItem; +import com.biutag.supervision.pojo.entity.SupPolice; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/3 + */ +@Setter +@Getter +public class ProfilePolice { + + private SupPolice policeInfo = new SupPolice(); + private NegativeInfo negativeInfo = new NegativeInfo(); + private List problemSourcesList = new ArrayList<>(); + private List businessTypeList = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java b/src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java new file mode 100644 index 0000000..9256e7f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/common/BarItem.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.dto.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/10/29 + */ +@Setter +@Getter +@AllArgsConstructor +public class BarItem { + + private String label; + private Integer value; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java new file mode 100644 index 0000000..07a40b1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java @@ -0,0 +1,29 @@ +package com.biutag.supervision.pojo.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDate; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class PoliceNegativeModel { + + private String name; + private String empNo; + private String IdCode; + private String position; + // 入职日期 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate employmentDate; + + // 查实问题数 + private Integer verifySize; + private String departName; + private String parentDepartName; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartPoliceQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartPoliceQueryParam.java new file mode 100644 index 0000000..0b37ad8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartPoliceQueryParam.java @@ -0,0 +1,24 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/11/1 + */ +@Setter +@Getter +public class DepartPoliceQueryParam extends BasePage { + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List crtTime = new ArrayList<>(); + private String name; + private String empNo; + private String departId; +} diff --git a/src/main/resources/mapper/ProfileDepartMapper.xml b/src/main/resources/mapper/ProfileDepartMapper.xml index de021f6..cf77e97 100644 --- a/src/main/resources/mapper/ProfileDepartMapper.xml +++ b/src/main/resources/mapper/ProfileDepartMapper.xml @@ -33,11 +33,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" d1.short_name, d.short_name ORDER BY - d1.order_no + verify_police_size desc, d1.order_no + + \ No newline at end of file diff --git a/src/main/resources/mapper/ProfilePoliceMapper.xml b/src/main/resources/mapper/ProfilePoliceMapper.xml new file mode 100644 index 0000000..d2c6210 --- /dev/null +++ b/src/main/resources/mapper/ProfilePoliceMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + \ No newline at end of file diff --git a/src/test/java/com/biutag/supervision/StrUtil.java b/src/test/java/com/biutag/supervision/StrUtil.java index 9435bfc..2d872cf 100644 --- a/src/test/java/com/biutag/supervision/StrUtil.java +++ b/src/test/java/com/biutag/supervision/StrUtil.java @@ -1,5 +1,6 @@ package com.biutag.supervision; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileTypeUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.resource.ResourceUtil; @@ -9,14 +10,17 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; import java.net.URL; +import java.time.LocalDate; import java.util.List; public class StrUtil { @Test public void testSubstr() { + LocalDate now = LocalDate.now(); + for (int i = 0; i < 12; i++) { - String type = FileUtil.extName("1.xls"); - System.out.println(type); + System.out.println(now.minusMonths(i)); + } } }