Browse Source

24/10/10

main
wxc 1 year ago
parent
commit
3ddd423fff
  1. 11
      pom.xml
  2. 11
      sql/1008.sql
  3. 2
      src/main/java/com/biutag/supervision/constants/AppConstants.java
  4. 5
      src/main/java/com/biutag/supervision/controller/StatisticsController.java
  5. 11
      src/main/java/com/biutag/supervision/controller/system/DictController.java
  6. 26
      src/main/java/com/biutag/supervision/controller/system/HolidayController.java
  7. 5
      src/main/java/com/biutag/supervision/controller/system/PoliceController.java
  8. 20
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  9. 4
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  10. 8
      src/main/java/com/biutag/supervision/mapper/BusinessDepartMapper.java
  11. 8
      src/main/java/com/biutag/supervision/mapper/SupDictProblemSourceMapper.java
  12. 10
      src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java
  13. 47
      src/main/java/com/biutag/supervision/pojo/entity/BusinessDepart.java
  14. 6
      src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java
  15. 4
      src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java
  16. 31
      src/main/java/com/biutag/supervision/pojo/entity/SupDictProblemSource.java
  17. 3
      src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java
  18. 2
      src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java
  19. 23
      src/main/java/com/biutag/supervision/pojo/vo/DictProblemSourceTree.java
  20. 71
      src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java
  21. 11
      src/main/java/com/biutag/supervision/service/BusinessDepartService.java
  22. 6
      src/main/java/com/biutag/supervision/service/HolidayService.java
  23. 50
      src/main/java/com/biutag/supervision/service/SupDictProblemSourceService.java
  24. 5
      src/main/java/com/biutag/supervision/service/SupPoliceService.java
  25. 9
      src/main/resources/application-dev.yml
  26. 32
      src/main/resources/application-local.yml
  27. 2
      src/main/resources/mapper/SupPoliceMapper.xml
  28. 2
      src/test/java/com/biutag/supervision/tools/GenCodeTests.java

11
pom.xml

@ -162,10 +162,10 @@
<profiles> <profiles>
<profile> <profile>
<id>dev</id> <id>local</id>
<properties> <properties>
<!-- 环境标识,需要与配置文件的名称相对应 --> <!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>dev</profiles.active> <profiles.active>local</profiles.active>
</properties> </properties>
<activation> <activation>
@ -173,6 +173,13 @@
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
</profile> </profile>
<profile>
<id>dev</id>
<properties>
<!-- 环境标识,需要与配置文件的名称相对应 -->
<profiles.active>dev</profiles.active>
</properties>
</profile>
<profile> <profile>
<id>prod</id> <id>prod</id>
<properties> <properties>

11
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 '%副职%';

2
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 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"; public static final String USER_TYPE_SUPER = "super";

5
src/main/java/com/biutag/supervision/controller/StatisticsController.java

@ -28,7 +28,6 @@ public class StatisticsController {
private final NegativeService negativeService; private final NegativeService negativeService;
@GetMapping("flowNumberAndTodayNumber") @GetMapping("flowNumberAndTodayNumber")
public Result<Map<String, Object>> flowNumber() { public Result<Map<String, Object>> flowNumber() {
UserAuth user = UserContextHolder.getCurrentUser(); UserAuth user = UserContextHolder.getCurrentUser();
@ -40,7 +39,7 @@ public class StatisticsController {
new FlowNumber("申请延期", "delay", 0L), new FlowNumber("申请延期", "delay", 0L),
new FlowNumber("办结审批", "completedApprove", 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), new TodayNumber("累计问题", 0L),
new TodayNumber("累计办结", 0L)) new TodayNumber("累计办结", 0L))
@ -122,7 +121,7 @@ public class StatisticsController {
new FlowNumber("申请延期", "delay", delayCount), new FlowNumber("申请延期", "delay", delayCount),
new FlowNumber("办结审批", "completedApprove", completedApproveCount)) 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("今日办结", todayCompleted),
new TodayNumber("累计问题", totalNumber), new TodayNumber("累计问题", totalNumber),
new TodayNumber("累计办结", totalCompleted)) new TodayNumber("累计办结", totalCompleted))

11
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.dto.DictTypeDto;
import com.biutag.supervision.pojo.entity.SupDictData; import com.biutag.supervision.pojo.entity.SupDictData;
import com.biutag.supervision.pojo.entity.SupDictType; import com.biutag.supervision.pojo.entity.SupDictType;
import com.biutag.supervision.pojo.vo.DictContentTree; import com.biutag.supervision.pojo.vo.DictProblemSourceTree;
import com.biutag.supervision.service.SupDictContentService;
import com.biutag.supervision.service.SupDictDataService; import com.biutag.supervision.service.SupDictDataService;
import com.biutag.supervision.service.SupDictProblemSourceService;
import com.biutag.supervision.service.SupDictTypeService; import com.biutag.supervision.service.SupDictTypeService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -27,6 +27,8 @@ public class DictController {
private final SupDictDataService dictDataService; private final SupDictDataService dictDataService;
private final SupDictProblemSourceService dictProblemSourceService;
@GetMapping @GetMapping
public Result<Page<SupDictType>> page(Page<SupDictType> page, String dictName) { public Result<Page<SupDictType>> page(Page<SupDictType> page, String dictName) {
LambdaQueryWrapper<SupDictType> queryWrapper = new LambdaQueryWrapper<SupDictType>() LambdaQueryWrapper<SupDictType> queryWrapper = new LambdaQueryWrapper<SupDictType>()
@ -71,4 +73,9 @@ public class DictController {
.orderByAsc(SupDictData::getDictSort))); .orderByAsc(SupDictData::getDictSort)));
} }
@GetMapping("problemSource")
public Result<List<DictProblemSourceTree>> listProblemSource() {
return Result.success(dictProblemSourceService.buildTree());
}
} }

26
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<Holiday>> list(@PathVariable Integer year) {
return Result.success(holidayService.list(year));
}
}

5
src/main/java/com/biutag/supervision/controller/system/PoliceController.java

@ -53,6 +53,11 @@ public class PoliceController {
return Result.success(policeService.listAllByDepartId(departId)); return Result.success(policeService.listAllByDepartId(departId));
} }
@GetMapping("{departId}/leader")
public Result<List<SupPolice>> leader(@PathVariable String departId) {
return Result.success(policeService.listLeaderByDepartId(departId));
}
@GetMapping("auth/{idCode}") @GetMapping("auth/{idCode}")
public Result<PoliceAuth> auth(@PathVariable String idCode) { public Result<PoliceAuth> auth(@PathVariable String idCode) {
PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList()) PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList())

20
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -1,5 +1,6 @@
package com.biutag.supervision.controller.work; package com.biutag.supervision.controller.work;
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.flow.FlowService; import com.biutag.supervision.flow.FlowService;
import com.biutag.supervision.pojo.Result; 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.ActionDto;
import com.biutag.supervision.pojo.dto.NegativeDto; import com.biutag.supervision.pojo.dto.NegativeDto;
import com.biutag.supervision.pojo.param.NegativeQueryParam; 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.pojo.vo.NegativeQueryVo;
import com.biutag.supervision.service.NegativeQueryService; import com.biutag.supervision.service.NegativeQueryService;
import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeService;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("negative") @RequestMapping("negative")
@RestController @RestController
@ -46,4 +53,17 @@ public class NegativeController {
return Result.success(flowService.execute(action)); return Result.success(flowService.execute(action));
} }
@PostMapping("export")
public void export(NegativeQueryParam queryParam, HttpServletResponse response) throws IOException {
queryParam.setSize(10000);
queryParam.setCurrent(1);
Page<NegativeQueryVo> page = negativeQueryService.page(queryParam);
List<ExportNegativeVo> 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);
}
} }

4
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.ActionDto;
import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.vo.FileVo;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import jakarta.validation.Validator; import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -17,7 +16,6 @@ import org.springframework.stereotype.Component;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
@ -46,7 +44,7 @@ public class ApplyCompletionAction implements Action {
@Override @Override
public void next(ActionDto actionDto) { public void next(ActionDto actionDto) {
VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class);
validator.validate(verifyData); //validator.validate(verifyData);
// 新增审批数据 // 新增审批数据
Negative negative = negativeService.getById(actionDto.getNegativeId()); Negative negative = negativeService.getById(actionDto.getNegativeId());
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData, negative); updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData, negative);

8
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<BusinessDepart> {
}

8
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<SupDictProblemSource> {
}

10
src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java

@ -8,9 +8,7 @@ import lombok.Setter;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@Setter @Setter
@Getter @Getter
@ -185,6 +183,7 @@ public class VerifyData {
@Setter @Setter
@Getter @Getter
public static class Problem { public static class Problem {
@NotBlank @NotBlank
private String oneLevelCode; private String oneLevelCode;
@ -196,6 +195,13 @@ public class VerifyData {
@NotBlank @NotBlank
private String twoLevelContent; private String twoLevelContent;
@NotBlank
private String threeLevelCode;
@NotBlank
private String threeLevelContent;
} }
} }

47
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;
}

6
src/main/java/com/biutag/supervision/pojo/entity/NegativeProblemRelation.java

@ -39,4 +39,10 @@ public class NegativeProblemRelation {
@TableField("twoLevelContent") @TableField("twoLevelContent")
private String twoLevelContent; private String twoLevelContent;
@TableField("threeLevelCode")
private String threeLevelCode;
@TableField("threeLevelContent")
private String threeLevelContent;
} }

4
src/main/java/com/biutag/supervision/pojo/entity/NegativeSignReturn.java

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.entity; package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter; import lombok.Getter;
@ -13,8 +14,7 @@ import java.time.LocalDateTime;
@Getter @Getter
public class NegativeSignReturn { public class NegativeSignReturn {
// @TableId(type = IdType.AUTO)
@TableId
private Integer id; private Integer id;
// //

31
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;
}

3
src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java

@ -120,4 +120,7 @@ public class SupPolice {
@TableField("person_status") @TableField("person_status")
private String personStatus; private String personStatus;
// 职位 正职 副职
private String position;
} }

2
src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java

@ -75,4 +75,6 @@ public class PoliceModel {
private String departShortName; private String departShortName;
private String position;
} }

23
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<DictProblemSourceTree> children = new ArrayList<>();
}

71
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;
}

11
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<BusinessDepartMapper, BusinessDepart> {
}

6
src/main/java/com/biutag/supervision/service/HolidayService.java

@ -1,5 +1,6 @@
package com.biutag.supervision.service; 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.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.mapper.HolidayMapper; 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.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@Slf4j @Slf4j
@ -18,6 +20,10 @@ public class HolidayService extends ServiceImpl<HolidayMapper, Holiday> {
private final RedisTemplate<Object, Object> redisTemplate; private final RedisTemplate<Object, Object> redisTemplate;
public List<Holiday> list(Integer year) {
return list(new LambdaQueryWrapper<Holiday>().eq(Holiday::getYear, year));
}
public boolean isHoliday(String date) { public boolean isHoliday(String date) {
long l = System.currentTimeMillis(); long l = System.currentTimeMillis();
Boolean result = (Boolean) redisTemplate.opsForValue().get(String.format("holiday:%s", date)); Boolean result = (Boolean) redisTemplate.opsForValue().get(String.format("holiday:%s", date));

50
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<SupDictProblemSourceMapper, SupDictProblemSource> {
public List<DictProblemSourceTree> buildTree() {
List<SupDictProblemSource> dictProblemSources = list(new LambdaQueryWrapper<SupDictProblemSource>().orderByAsc(SupDictProblemSource::getSort));
Map<Integer, List<DictProblemSourceTree>> childMap = new HashMap<>();
List<DictProblemSourceTree> tree = new ArrayList<>();
for (SupDictProblemSource dictProblemSource : dictProblemSources) {
DictProblemSourceTree node = new DictProblemSourceTree();
BeanUtils.copyProperties(dictProblemSource, node);
List<DictProblemSourceTree> 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<Integer, List<DictProblemSourceTree>> childMap) {
List<DictProblemSourceTree> children = childMap.get(node.getId());
if (children != null) {
node.getChildren().addAll(children.stream()
.map(childNode -> buildTreeRecursive(childNode, childMap))
.toList());
}
return node;
}
}

5
src/main/java/com/biutag/supervision/service/SupPoliceService.java

@ -62,4 +62,9 @@ public class SupPoliceService extends ServiceImpl<SupPoliceMapper, SupPolice> {
return list(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getOrgId, departIds)); return list(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getOrgId, departIds));
} }
public List<SupPolice> listLeaderByDepartId(String departId) {
List<String> departIds = departService.listAndChildrenIds(List.of(departId));
return list(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getOrgId, departIds).isNotNull(SupPolice::getPhone));
}
} }

9
src/main/resources/application-dev.yml

@ -14,10 +14,13 @@ spring:
password: ip12341234 password: ip12341234
data: data:
redis: redis:
host: 127.0.0.1 host: 172.31.217.20
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 31707
password: 123456 # 数据库索引
database: 1
# 连接超时时间
timeout: 10s
fdfs: fdfs:
tracker-list: #TrackerList参数,支持多个 tracker-list: #TrackerList参数,支持多个

32
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'

2
src/main/resources/mapper/SupPoliceMapper.xml

@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.biutag.supervision.mapper.SupPoliceMapper"> <mapper namespace="com.biutag.supervision.mapper.SupPoliceMapper">
<select id="queryPage" resultType="com.biutag.supervision.pojo.model.PoliceModel"> <select id="queryPage" resultType="com.biutag.supervision.pojo.model.PoliceModel">
select p.id, p.name, p.emp_no, p.id_code, p.job, p.mobile, p.person_status, p.org_id, d.name depart_name, d.short_name depart_short_name select p.id, p.name, p.emp_no, p.id_code, p.position, p.mobile, p.person_status, p.org_id, d.name depart_name, d.short_name depart_short_name
from sup_police p from sup_police p
left join sup_depart d on p.org_id = d.id left join sup_depart d on p.org_id = d.id
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}

2
src/test/java/com/biutag/supervision/tools/GenCodeTests.java

@ -25,7 +25,7 @@ public class GenCodeTests {
@Test @Test
public void genEntity() throws TemplateException, IOException { public void genEntity() throws TemplateException, IOException {
String tableName = "model_class"; String tableName = "business_depart";
String tableSchema = "negative"; String tableSchema = "negative";
boolean genMapper = true; boolean genMapper = true;
boolean genService = true; boolean genService = true;

Loading…
Cancel
Save