From 3ddd423fffb7cc33e3b3a1c5b6eb3a64538cafe5 Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Thu, 10 Oct 2024 15:42:57 +0800 Subject: [PATCH] 24/10/10 --- pom.xml | 11 ++- sql/1008.sql | 11 +++ .../supervision/constants/AppConstants.java | 2 + .../controller/StatisticsController.java | 5 +- .../controller/system/DictController.java | 11 ++- .../controller/system/HolidayController.java | 26 +++++++ .../controller/system/PoliceController.java | 5 ++ .../controller/work/NegativeController.java | 20 ++++++ .../flow/action/ApplyCompletionAction.java | 4 +- .../mapper/BusinessDepartMapper.java | 8 +++ .../mapper/SupDictProblemSourceMapper.java | 8 +++ .../supervision/pojo/dto/flow/VerifyData.java | 10 ++- .../pojo/entity/BusinessDepart.java | 47 ++++++++++++ .../pojo/entity/NegativeProblemRelation.java | 6 ++ .../pojo/entity/NegativeSignReturn.java | 4 +- .../pojo/entity/SupDictProblemSource.java | 31 ++++++++ .../supervision/pojo/entity/SupPolice.java | 3 + .../supervision/pojo/model/PoliceModel.java | 2 + .../pojo/vo/DictProblemSourceTree.java | 23 ++++++ .../supervision/pojo/vo/ExportNegativeVo.java | 71 +++++++++++++++++++ .../service/BusinessDepartService.java | 11 +++ .../supervision/service/HolidayService.java | 6 ++ .../service/SupDictProblemSourceService.java | 50 +++++++++++++ .../supervision/service/SupPoliceService.java | 5 ++ src/main/resources/application-dev.yml | 9 ++- src/main/resources/application-local.yml | 32 +++++++++ src/main/resources/application.yml | 2 +- src/main/resources/mapper/SupPoliceMapper.xml | 2 +- .../supervision/tools/GenCodeTests.java | 2 +- 29 files changed, 407 insertions(+), 20 deletions(-) create mode 100644 sql/1008.sql create mode 100644 src/main/java/com/biutag/supervision/controller/system/HolidayController.java create mode 100644 src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java create mode 100644 src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java create mode 100644 src/main/java/com/biutag/supervision/service/BusinessDepartService.java create mode 100644 src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java create mode 100644 src/main/resources/application-local.yml diff --git a/pom.xml b/pom.xml index c38d8cf..a15f23e 100644 --- a/pom.xml +++ b/pom.xml @@ -162,10 +162,10 @@ - dev + local - dev + local @@ -173,6 +173,13 @@ true + + dev + + + dev + + prod diff --git a/sql/1008.sql b/sql/1008.sql new file mode 100644 index 0000000..b751754 --- /dev/null +++ b/sql/1008.sql @@ -0,0 +1,11 @@ +ALTER TABLE `negative`.`negative_problem_relation` + ADD COLUMN `threeLevelCode` varchar(255) NULL AFTER `twoLevelContent`, +ADD COLUMN `threeLevelContent` varchar(255) NULL AFTER `threeLevelCode`; + + +ALTER TABLE `negative`.`sup_police` + ADD COLUMN `position` varchar(255); + +update sup_police set position = '正职' where job like '%正职%'; + +update sup_police set position = '副职' where job like '%副职%'; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/constants/AppConstants.java b/src/main/java/com/biutag/supervision/constants/AppConstants.java index 45b3c59..1b50ddf 100644 --- a/src/main/java/com/biutag/supervision/constants/AppConstants.java +++ b/src/main/java/com/biutag/supervision/constants/AppConstants.java @@ -7,6 +7,8 @@ public class AppConstants { // 部门 public static final String DICT_CONTENT_ROOT_PARENT_CODE = "-1"; + public static final Integer DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE = -1; + // 管理员类型类型(超级管理员) public static final String USER_TYPE_SUPER = "super"; diff --git a/src/main/java/com/biutag/supervision/controller/StatisticsController.java b/src/main/java/com/biutag/supervision/controller/StatisticsController.java index a9d5a1d..6a52ef4 100644 --- a/src/main/java/com/biutag/supervision/controller/StatisticsController.java +++ b/src/main/java/com/biutag/supervision/controller/StatisticsController.java @@ -28,7 +28,6 @@ public class StatisticsController { private final NegativeService negativeService; - @GetMapping("flowNumberAndTodayNumber") public Result> flowNumber() { UserAuth user = UserContextHolder.getCurrentUser(); @@ -40,7 +39,7 @@ public class StatisticsController { new FlowNumber("申请延期", "delay", 0L), new FlowNumber("办结审批", "completedApprove", 0L)) ); - data.put("todayNumber", List.of(new TodayNumber("今日办结", 0L), + data.put("todayNumber", List.of(new TodayNumber("今日问题", 0L), new TodayNumber("今日办结", 0L), new TodayNumber("累计问题", 0L), new TodayNumber("累计办结", 0L)) @@ -122,7 +121,7 @@ public class StatisticsController { new FlowNumber("申请延期", "delay", delayCount), new FlowNumber("办结审批", "completedApprove", completedApproveCount)) ); - data.put("todayNumber", List.of(new TodayNumber("今日办结", todayNumber), + data.put("todayNumber", List.of(new TodayNumber("今日问题", todayNumber), new TodayNumber("今日办结", todayCompleted), new TodayNumber("累计问题", totalNumber), new TodayNumber("累计办结", totalCompleted)) diff --git a/src/main/java/com/biutag/supervision/controller/system/DictController.java b/src/main/java/com/biutag/supervision/controller/system/DictController.java index e1b117b..6c554f9 100644 --- a/src/main/java/com/biutag/supervision/controller/system/DictController.java +++ b/src/main/java/com/biutag/supervision/controller/system/DictController.java @@ -9,9 +9,9 @@ import com.biutag.supervision.pojo.dto.DictDataDto; import com.biutag.supervision.pojo.dto.DictTypeDto; import com.biutag.supervision.pojo.entity.SupDictData; import com.biutag.supervision.pojo.entity.SupDictType; -import com.biutag.supervision.pojo.vo.DictContentTree; -import com.biutag.supervision.service.SupDictContentService; +import com.biutag.supervision.pojo.vo.DictProblemSourceTree; import com.biutag.supervision.service.SupDictDataService; +import com.biutag.supervision.service.SupDictProblemSourceService; import com.biutag.supervision.service.SupDictTypeService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -27,6 +27,8 @@ public class DictController { private final SupDictDataService dictDataService; + private final SupDictProblemSourceService dictProblemSourceService; + @GetMapping public Result> page(Page page, String dictName) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() @@ -71,4 +73,9 @@ public class DictController { .orderByAsc(SupDictData::getDictSort))); } + @GetMapping("problemSource") + public Result> listProblemSource() { + return Result.success(dictProblemSourceService.buildTree()); + } + } diff --git a/src/main/java/com/biutag/supervision/controller/system/HolidayController.java b/src/main/java/com/biutag/supervision/controller/system/HolidayController.java new file mode 100644 index 0000000..0e234b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/HolidayController.java @@ -0,0 +1,26 @@ +package com.biutag.supervision.controller.system; + +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Holiday; +import com.biutag.supervision.service.HolidayService; +import lombok.RequiredArgsConstructor; +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.List; + +@RequiredArgsConstructor +@RequestMapping("holiday") +@RestController +public class HolidayController { + + private final HolidayService holidayService; + + @GetMapping("{year}") + public Result> list(@PathVariable Integer year) { + return Result.success(holidayService.list(year)); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java index 1fd457b..57a450a 100644 --- a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java @@ -53,6 +53,11 @@ public class PoliceController { return Result.success(policeService.listAllByDepartId(departId)); } + @GetMapping("{departId}/leader") + public Result> leader(@PathVariable String departId) { + return Result.success(policeService.listLeaderByDepartId(departId)); + } + @GetMapping("auth/{idCode}") public Result auth(@PathVariable String idCode) { PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList()) diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java index 3d078b4..56bba15 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -1,5 +1,6 @@ package com.biutag.supervision.controller.work; +import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.flow.FlowService; import com.biutag.supervision.pojo.Result; @@ -7,13 +8,19 @@ import com.biutag.supervision.pojo.domain.NegativeDetail; import com.biutag.supervision.pojo.dto.ActionDto; import com.biutag.supervision.pojo.dto.NegativeDto; import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.pojo.vo.ExportNegativeVo; import com.biutag.supervision.pojo.vo.NegativeQueryVo; import com.biutag.supervision.service.NegativeQueryService; import com.biutag.supervision.service.NegativeService; +import jakarta.servlet.http.HttpServletResponse; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; +import java.io.IOException; +import java.util.List; + @RequiredArgsConstructor @RequestMapping("negative") @RestController @@ -46,4 +53,17 @@ public class NegativeController { return Result.success(flowService.execute(action)); } + @PostMapping("export") + public void export(NegativeQueryParam queryParam, HttpServletResponse response) throws IOException { + queryParam.setSize(10000); + queryParam.setCurrent(1); + Page page = negativeQueryService.page(queryParam); + List list = page.getRecords().stream().map(item -> { + ExportNegativeVo vo = new ExportNegativeVo(); + BeanUtils.copyProperties(item, vo); + return vo; + }).toList(); + EasyExcel.write(response.getOutputStream(), ExportNegativeVo.class).inMemory(Boolean.TRUE).sheet("问题台账").doWrite(list); + } + } diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java index d5eb7cd..bc14213 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -8,7 +8,6 @@ import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.pojo.dto.ActionDto; import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.entity.*; -import com.biutag.supervision.pojo.vo.FileVo; import com.biutag.supervision.service.*; import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; @@ -17,7 +16,6 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Objects; /** @@ -46,7 +44,7 @@ public class ApplyCompletionAction implements Action { @Override public void next(ActionDto actionDto) { VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); - validator.validate(verifyData); + //validator.validate(verifyData); // 新增审批数据 Negative negative = negativeService.getById(actionDto.getNegativeId()); updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData, negative); diff --git a/src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java new file mode 100644 index 0000000..a07e594 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BusinessDepart; + +public interface BusinessDepartMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java new file mode 100644 index 0000000..835c3ca --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemSource; + +public interface SupDictProblemSourceMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java index 9a0d024..2d77109 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java @@ -8,9 +8,7 @@ import lombok.Setter; import java.time.LocalDateTime; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; @Setter @Getter @@ -185,6 +183,7 @@ public class VerifyData { @Setter @Getter public static class Problem { + @NotBlank private String oneLevelCode; @@ -196,6 +195,13 @@ public class VerifyData { @NotBlank private String twoLevelContent; + + @NotBlank + private String threeLevelCode; + + @NotBlank + private String threeLevelContent; + } } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java new file mode 100644 index 0000000..a48e11c --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java @@ -0,0 +1,47 @@ +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 BusinessDepart { + + // + @TableId(value = "id") + private Integer id; + + // 日期(天) + @TableField("date") + private String date; + + // 单位ID + @TableField("depart_id") + private String departId; + + // 单位名称 + @TableField("depart_name") + private String departName; + + // 业务类型 + @TableField("business_type") + private String businessType; + + // 业务类型名称 + @TableField("business_type_name") + private String businessTypeName; + + // 业务量 + @TableField("number") + private Integer number; + + // 创建时间 + @TableField("create_time") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java index 2ede19e..2c2ce88 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java @@ -39,4 +39,10 @@ public class NegativeProblemRelation { @TableField("twoLevelContent") private String twoLevelContent; + @TableField("threeLevelCode") + private String threeLevelCode; + + @TableField("threeLevelContent") + private String threeLevelContent; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java index a2f7447..dec841a 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.entity; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import lombok.Getter; @@ -13,8 +14,7 @@ import java.time.LocalDateTime; @Getter public class NegativeSignReturn { - // - @TableId + @TableId(type = IdType.AUTO) private Integer id; // diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java new file mode 100644 index 0000000..11ec2b4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java @@ -0,0 +1,31 @@ +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 SupDictProblemSource { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("parent_id") + private Integer parentId; + + // + @TableField("label") + private String label; + + // + @TableField("sort") + private Integer sort; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java index 5b21b83..b389b99 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java @@ -120,4 +120,7 @@ public class SupPolice { @TableField("person_status") private String personStatus; + // 职位 正职 副职 + private String position; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java index 855afbc..44d3cc7 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java @@ -75,4 +75,6 @@ public class PoliceModel { private String departShortName; + private String position; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java new file mode 100644 index 0000000..b6a0203 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class DictProblemSourceTree { + + private Integer id; + + private Integer parentId; + + private String label; + + private Integer sort; + + private List children = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java new file mode 100644 index 0000000..5b266b8 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java @@ -0,0 +1,71 @@ +package com.biutag.supervision.pojo.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class ExportNegativeVo { + + @ExcelProperty("样本源头编号") + private String originId; + + // 问题发生时间 + @ExcelProperty("问题发生时间") + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime happenTime; + + // 问题发现时间 + @ExcelProperty("问题发现时间") + @JsonFormat(pattern = "YYYY-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 问题来源 + @ExcelProperty("问题来源") + private String problemSources; + + // 业务类别名称 + @ExcelProperty("业务类别") + private String businessTypeName; + + // 涉嫌问题 JSON + @ExcelProperty("涉嫌问题") + private String involveProblem; + + // 简要描述 + @ExcelProperty("简要描述") + private String thingDesc; + + // 反映人姓名 + @ExcelProperty("投诉反映人") + private String responderName; + + // 联系电话 + @ExcelProperty("联系电话") + private String contactPhone; + + // 涉及警种名称 + @ExcelProperty("涉及警种") + private String policeTypeName; + + // 涉及单位名称 + @ExcelProperty("涉及单位") + private String involveDepartName; + + // 办理状态 + @ExcelProperty("办理状态") + private String processingStatus; + + // 办理单位 二级 + @ExcelProperty("办理单位") + private String handleSecondDepartName; + + // 办理单位 三级 + @ExcelProperty("办理单位") + private String handleThreeDepartName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/BusinessDepartService.java b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java new file mode 100644 index 0000000..6e1dd82 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/BusinessDepartService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.BusinessDepart; +import com.biutag.supervision.mapper.BusinessDepartMapper; +import org.springframework.stereotype.Service; + +@Service +public class BusinessDepartService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/HolidayService.java b/src/main/java/com/biutag/supervision/service/HolidayService.java index 2dfb0e6..fc1a66f 100644 --- a/src/main/java/com/biutag/supervision/service/HolidayService.java +++ b/src/main/java/com/biutag/supervision/service/HolidayService.java @@ -1,5 +1,6 @@ package com.biutag.supervision.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.mapper.HolidayMapper; @@ -9,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Objects; @Slf4j @@ -18,6 +20,10 @@ public class HolidayService extends ServiceImpl { private final RedisTemplate redisTemplate; + public List list(Integer year) { + return list(new LambdaQueryWrapper().eq(Holiday::getYear, year)); + } + public boolean isHoliday(String date) { long l = System.currentTimeMillis(); Boolean result = (Boolean) redisTemplate.opsForValue().get(String.format("holiday:%s", date)); diff --git a/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java new file mode 100644 index 0000000..a42b981 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.mapper.SupDictProblemSourceMapper; +import com.biutag.supervision.pojo.entity.SupDictProblemSource; +import com.biutag.supervision.pojo.vo.DictProblemSourceTree; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class SupDictProblemSourceService extends ServiceImpl { + + public List buildTree() { + List dictProblemSources = list(new LambdaQueryWrapper().orderByAsc(SupDictProblemSource::getSort)); + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDictProblemSource dictProblemSource : dictProblemSources) { + DictProblemSourceTree node = new DictProblemSourceTree(); + BeanUtils.copyProperties(dictProblemSource, node); + List children = childMap.computeIfAbsent(node.getParentId(), k -> new ArrayList<>()); + children.add(node); + Integer parentId = node.getParentId(); + if (AppConstants.DICT_PROBLEM_SOURCE_ROOT_PARENT_CODE.equals(parentId)) { + tree.add(node); + } + } + for (DictProblemSourceTree node : tree) { + buildTreeRecursive(node, childMap); + } + return tree; + } + + private static DictProblemSourceTree buildTreeRecursive(DictProblemSourceTree node, Map> childMap) { + List children = childMap.get(node.getId()); + if (children != null) { + node.getChildren().addAll(children.stream() + .map(childNode -> buildTreeRecursive(childNode, childMap)) + .toList()); + } + return node; + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupPoliceService.java b/src/main/java/com/biutag/supervision/service/SupPoliceService.java index aced720..5063964 100644 --- a/src/main/java/com/biutag/supervision/service/SupPoliceService.java +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -62,4 +62,9 @@ public class SupPoliceService extends ServiceImpl { return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds)); } + public List listLeaderByDepartId(String departId) { + List departIds = departService.listAndChildrenIds(List.of(departId)); + return list(new LambdaQueryWrapper().in(SupPolice::getOrgId, departIds).isNotNull(SupPolice::getPhone)); + } + } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 1b57321..75fde56 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -14,10 +14,13 @@ spring: password: ip12341234 data: redis: - host: 127.0.0.1 + host: 172.31.217.20 # 端口,默认为6379 - port: 6379 - password: 123456 + port: 31707 + # 数据库索引 + database: 1 + # 连接超时时间 + timeout: 10s fdfs: tracker-list: #TrackerList参数,支持多个 diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml new file mode 100644 index 0000000..1b57321 --- /dev/null +++ b/src/main/resources/application-local.yml @@ -0,0 +1,32 @@ +spring: + datasource: + dynamic: + datasource: + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/negative?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + slave: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/open-platform?serverTimezone=GMT%2B8 + username: root + password: ip12341234 + data: + redis: + host: 127.0.0.1 + # 端口,默认为6379 + port: 6379 + password: 123456 + +fdfs: + tracker-list: #TrackerList参数,支持多个 + - 172.31.217.20:32060 + preview-url: http://172.31.217.20:31664 + +springdoc: + group-configs: + - group: 'plugin' + paths-to-match: + - '/api/plugin/**' + - '/login' \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ea2bee6..2da8be4 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -44,4 +44,4 @@ fdfs: knife4j: setting: - language: zh_cn \ No newline at end of file + language: zh_cn diff --git a/src/main/resources/mapper/SupPoliceMapper.xml b/src/main/resources/mapper/SupPoliceMapper.xml index 793b6dc..5648c02 100644 --- a/src/main/resources/mapper/SupPoliceMapper.xml +++ b/src/main/resources/mapper/SupPoliceMapper.xml @@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"