Browse Source

fit: 新增基础数据/案件核查

perf: 完善基础数据/国家信访投诉、基础数据/公安部信访投诉
main
wxc 1 year ago
parent
commit
9cdc7d99c1
  1. 9
      sql/1014.sql
  2. 5
      src/main/java/com/biutag/supervision/config/InterceptorConfig.java
  3. 6
      src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java
  4. 9
      src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java
  5. 2
      src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java
  6. 75
      src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java
  7. 36
      src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java
  8. 5
      src/main/java/com/biutag/supervision/controller/system/DepartController.java
  9. 8
      src/main/java/com/biutag/supervision/controller/system/DictController.java
  10. 19
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  11. 15
      src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java
  12. 2
      src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java
  13. 15
      src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java
  14. 8
      src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java
  15. 59
      src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java
  16. 20
      src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintAddDto.java
  17. 10
      src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java
  18. 65
      src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java
  19. 17
      src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java
  20. 3
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  21. 2
      src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java
  22. 8
      src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java
  23. 9
      src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java
  24. 8
      src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java
  25. 20
      src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java
  26. 2
      src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java
  27. 3
      src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java
  28. 47
      src/main/java/com/biutag/supervision/service/DataCaseVerifService.java
  29. 55
      src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java
  30. 19
      src/main/java/com/biutag/supervision/service/SupDepartService.java
  31. 2
      src/main/resources/mapper/SupPoliceMapper.xml
  32. BIN
      src/main/resources/static/templates/信访投诉数据台账(模板).xlsx
  33. BIN
      src/main/resources/static/templates/案件核查问题台账(模板).xlsx
  34. 7
      src/test/java/com/biutag/supervision/StrUtil.java
  35. 2
      src/test/java/com/biutag/supervision/tools/GenCodeTests.java

9
sql/1014.sql

@ -0,0 +1,9 @@
ALTER TABLE `negative`.`sup_depart`
ADD COLUMN `first_host` tinyint DEFAULT '0' COMMENT '是否是市局主办';
ALTER TABLE `negative`.`negative`
ADD COLUMN `current_processing_object` varchar(255) COMMENT '当前处理对象';
ALTER TABLE `negative`.`sup_police`
ADD COLUMN `employment_date` datetime COMMENT '入职时间',
ADD COLUMN `police_role` varchar(255) COMMENT '角色';

5
src/main/java/com/biutag/supervision/config/InterceptorConfig.java

@ -16,6 +16,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @author wxc
@ -24,6 +25,7 @@ import java.util.Objects;
@Slf4j
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new DefaultInterceptor())
@ -48,8 +50,11 @@ public class InterceptorConfig implements WebMvcConfigurer {
if (StrUtil.isBlank(authorization) || Objects.isNull(redisTemplate.opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)))) {
throw new AuthException();
}
// 更新 会话 有效期
redisTemplate.expire(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), 24, TimeUnit.HOURS);
return true;
}
}
static class ApiInterceptor implements HandlerInterceptor {

6
src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java

@ -16,7 +16,11 @@ public enum BusinessTypeEnum {
ZXGZ("专项工作", "7", "ZX"),
ABWW("安保维稳", "8", "AB"),
JAFK("治安防控", "9", "ZA"),
XZGL("行政管理", "10", "XZ");
XZGL("行政管理", "10", "XZ"),
FFJC("服务基层", "12", "FF"),
DWGL("队伍管理", "13", "DW"),
QT("其他", "14", "QT"),
;
private String label;

9
src/main/java/com/biutag/supervision/constants/enums/DataUpdateMethodEnum.java

@ -0,0 +1,9 @@
package com.biutag.supervision.constants.enums;
public enum DataUpdateMethodEnum {
// 增量更新
incremental,
// 覆盖更新
overwrite
}

2
src/main/java/com/biutag/supervision/constants/enums/DepartLevelEnum.java

@ -11,6 +11,6 @@ public enum DepartLevelEnum {
SECOND(2),
THREE(3);
private int value;
private Integer value;
}

75
src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java

@ -0,0 +1,75 @@
package com.biutag.supervision.controller.data;
import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam;
import com.biutag.supervision.service.DataCaseVerifService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RequestMapping("data/caseVerif")
@RequiredArgsConstructor
@RestController
public class DataCaseVerifController {
private final DataCaseVerifService dataCaseVerifService;
@GetMapping
public Result<Page<DataCaseVerif>> list(DataCaseVerifQueryParam queryParam) {
return Result.success(dataCaseVerifService.page(queryParam));
}
@PostMapping("import")
public Result<List<DataCaseVerifImportDto>> importExcel(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件导入中------------------------------");
String fileNameType = FileUtil.extName(file.getOriginalFilename());
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
}
List<DataCaseVerifImportDto> list = new ArrayList<>();
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataCaseVerifImportDto.class, new ReadListener<DataCaseVerifImportDto>() {
@Override
public void invoke(DataCaseVerifImportDto data, AnalysisContext analysisContext) {
list.add(data);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}
}).build();
ReadSheet sheet = EasyExcel.readSheet(0).build();
excelReader.read(sheet);
excelReader.close();
return Result.success(list);
}
@PostMapping("{dataUpdateMethod}")
public Result<Boolean> add(@RequestBody List<DataCaseVerifImportDto> body, @PathVariable String dataUpdateMethod) {
if (body.isEmpty()) {
return Result.success();
}
return Result.success(dataCaseVerifService.save(body, dataUpdateMethod));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(dataCaseVerifService.removeById(id));
}
}

36
src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java

@ -1,5 +1,6 @@
package com.biutag.supervision.controller.data;
import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
@ -7,21 +8,25 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam;
import com.biutag.supervision.service.DataPetitionComplaintService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author wxc
* @date
*/
@Slf4j
@RequiredArgsConstructor
@RequestMapping("data/petitionComplaint")
@ -32,13 +37,14 @@ public class DataPetitionComplaintController {
@GetMapping
public Result<Page<DataPetitionComplaint>> list(DataPetitionComplaintQueryParam queryParam) {
return Result.success(dataPetitionComplaintService.page(Page.of(queryParam.getCurrent(), queryParam.getSize())));
return Result.success(dataPetitionComplaintService.page(queryParam));
}
@PostMapping("import")
public Result<List<DataPetitionComplaintImportDto>> importExcel(@RequestPart("file") MultipartFile file) throws IOException {
log.info("文件导入中------------------------------");
if (!file.getOriginalFilename().toLowerCase().endsWith(".xls") && !file.getOriginalFilename().toLowerCase().endsWith(".xlsx")) {
String fileNameType = FileUtil.extName(file.getOriginalFilename());
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
}
List<DataPetitionComplaintImportDto> list = new ArrayList<>();
@ -59,21 +65,17 @@ public class DataPetitionComplaintController {
return Result.success(list);
}
@PostMapping
public Result<Void> add(@RequestBody List<DataPetitionComplaintImportDto> body) {
if (body.isEmpty()) {
@PostMapping()
public Result<Boolean> add(@RequestBody DataPetitionComplaintAddDto body) {
if (body.getData().isEmpty()) {
return Result.success();
}
LocalDateTime now = LocalDateTime.now();
List<DataPetitionComplaint> list = body.stream().map(item -> {
DataPetitionComplaint data = new DataPetitionComplaint();
BeanUtils.copyProperties(item, data);
data.setCrtTime(now);
data.setUpdTime(now);
return data;
}).toList();
dataPetitionComplaintService.saveBatch(list);
return Result.success();
return Result.success(dataPetitionComplaintService.save(body));
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(dataPetitionComplaintService.removeById(id));
}
}

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

@ -87,6 +87,11 @@ public class DepartController {
return Result.success(departService.buildTree(supDeparts));
}
@GetMapping("firstHost")
public Result<List<DepartTree>> firstHost() {
return Result.success(departService.buildTreeByFirstHost());
}
@GetMapping("{departId}/children")
public Result<List<SupDepart>> children(@PathVariable String departId) {
return Result.success(departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, departId).orderByAsc(SupDepart::getOrderNo)));

8
src/main/java/com/biutag/supervision/controller/system/DictController.java

@ -16,6 +16,7 @@ import com.biutag.supervision.service.SupDictTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
@RequiredArgsConstructor
@ -42,6 +43,13 @@ public class DictController {
return Result.success(dictTypeService.save(dictType));
}
@PutMapping
public Result<Boolean> update(@RequestBody DictTypeDto dictType) {
SupDictType supDictType = new SupDictType();
BeanUtil.copyProperties(dictType, supDictType);
supDictType.setUpdateTime(LocalDateTime.now());
return Result.success(dictTypeService.updateById(supDictType));
}
@GetMapping("{dictType}/dictData")
public Result<Page<SupDictData>> list(Page<SupDictData> page, @PathVariable String dictType) {
return Result.success(dictDataService.page(page, new LambdaQueryWrapper<SupDictData>()

19
src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
@ -49,13 +50,11 @@ public class ApplyCompletionAction implements Action {
Negative negative = negativeService.getById(actionDto.getNegativeId());
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData, negative);
doneWork(actionDto.getWorkId());
if (!ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow()) || !negative.getIsSecondHandle()) {
addWork(actionDto.getNegativeId(), actionDto.getWorkId(),
// 是否是本级办理
negative.getIsSecondHandle() ? RoleCodeEnum.FIRST_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(),
negative);
}
}
public void updateNegative(String negativeId, String nextFlowKey, VerifyData verifyData, Negative negative) {
LocalDateTime now = LocalDateTime.now();
@ -154,17 +153,27 @@ public class ApplyCompletionAction implements Action {
public void addWork(String negativeId, Integer workId, String roleCode, Negative negative) {
NegativeWork currentWork = workService.getById(workId);
SupDepart depart = departService.getById(currentWork.getDepartId());
String parentDepartId;
String parentDepartName;
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) {
parentDepartId = AppConstants.ROOT_DEPART_ID;
parentDepartName = AppConstants.ROOT_DEPART_NAME;
} else {
SupDepart parentDepart = departService.getById(depart.getPid());
parentDepartId = parentDepart.getId();
parentDepartName = parentDepart.getShortName();
}
workService.remove(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.eq(NegativeWork::getDepartId, parentDepart.getId()));
.eq(NegativeWork::getDepartId, parentDepartId));
NegativeWork work = new NegativeWork()
.setNegativeId(negativeId)
.setRoleCode(roleCode)
.setDepartId(parentDepart.getId())
.setDepartName(parentDepart.getName())
.setDepartId(parentDepartId)
.setDepartName(parentDepartName)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())

15
src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java

@ -39,20 +39,25 @@ public class FirstDistributeAction implements Action {
public void next(ActionDto actionDto) {
FirstDistributeData firstDistributeData = BeanUtil.toBean(actionDto.getData(), FirstDistributeData.class);
validator.validate(firstDistributeData);
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), firstDistributeData);
SupDepart depart = departService.getById(firstDistributeData.getDepartId());
// 三级单位办理
boolean thirdHandling = DepartLevelEnum.THREE.getValue().equals(depart.getLevel());
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), firstDistributeData, thirdHandling);
doneWork(actionDto.getWorkId());
addWork(actionDto.getNegativeId(),
HostLevelEnums.THREE.getValue().equals(firstDistributeData.getHostLevel()) ? RoleCodeEnum.THREE_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(),
thirdHandling ? RoleCodeEnum.THREE_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(),
firstDistributeData.getDepartId(), firstDistributeData.getDepartName());
}
public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData) {
public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData, boolean thirdHandling) {
LocalDateTime now = LocalDateTime.now();
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.set(Negative::getHostLevel, distributeData.getHostLevel())
.set(Negative::getTimeLimit, distributeData.getTimeLimit())
.set(Negative::getApprovalFlow, distributeData.getApprovalFlow())
// 当前处理对象
.set(Negative::getCurrentProcessingObject, String.format("%s专班", distributeData.getDepartName()))
.set(Negative::getFirstDistributeTime, now)
.set(Negative::getUpdTime, now)
.eq(Negative::getId, negativeId);
@ -66,7 +71,7 @@ public class FirstDistributeAction implements Action {
.set(Negative::getMaxHandleDuration, timeLimitEnum.getMaxHandleDuration())
.set(Negative::getMaxExtensionDuration, timeLimitEnum.getMaxExtensionDuration());
}
if (HostLevelEnums.THREE.getValue().equals(distributeData.getHostLevel())) {
if (thirdHandling) {
SupDepart parentDepart = departService.getParentDepart(distributeData.getDepartId());
updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.THREE_SIGN.getKey())
.set(Negative::getHandleSecondDepartId, parentDepart.getId())

2
src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java

@ -43,6 +43,8 @@ public class SecondDistributeAction implements Action {
.set(Negative::getHandleThreeDepartName, secondDistributeData.getDepartName())
.set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getUpdTime, LocalDateTime.now())
// 当前处理对象
.set(Negative::getCurrentProcessingObject, String.format("%s专班", secondDistributeData.getDepartName()))
.eq(Negative::getId, negativeId));
}

15
src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java

@ -18,6 +18,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.Objects;
/**
* 三级机构问题退回
@ -88,9 +89,23 @@ public class ThreeSignReturnAction implements Action {
public void addWork(String negativeId, String roleCode) {
NegativeWork work = workService.getOne(new LambdaQueryWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, negativeId).eq(NegativeWork::getRoleCode, roleCode));
if (Objects.nonNull(work)) {
work.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.updateById(work);
} else {
Negative negative = negativeService.getById(negativeId);
work = new NegativeWork()
.setNegativeId(negativeId)
.setRoleCode(roleCode)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.save(work);
}
}
}

8
src/main/java/com/biutag/supervision/mapper/DataCaseVerifMapper.java

@ -0,0 +1,8 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
public interface DataCaseVerifMapper extends BaseMapper<DataCaseVerif> {
}

59
src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java

@ -0,0 +1,59 @@
package com.biutag.supervision.pojo.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Schema(description = "案件核查")
@Setter
@Getter
public class DataCaseVerifImportDto {
// 信件编号
@ExcelProperty({"问题基本信息", "案件编号"})
private String originId;
// 登记时间
@ExcelProperty({"问题基本信息", "受理时间"})
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm")
private LocalDateTime discoveryTime;
// 登记时间
@ExcelProperty({"问题基本信息", "问题发生时间"})
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm")
private LocalDateTime happenTime;
@ExcelProperty({"问题基本信息", "问题来源"})
private String problemSources;
// 投诉人
@ExcelProperty({"问题基本信息", "投诉人"})
private String responderName;
// 投诉人电话
@ExcelProperty({"问题基本信息", "投诉人电话"})
private String contactPhone;
@ExcelProperty({"问题基本信息", "业务类别"})
private String businessTypeName;
@ExcelProperty({"问题基本信息", "涉嫌问题"})
private String involveProblem;
@ExcelProperty({"问题基本信息", "涉及警种"})
private String policeTypeName;
// 被投诉机构
@ExcelProperty({"问题基本信息", "涉及单位"})
private String complainedDepartName;
// 具体内容
@ExcelProperty({"问题基本信息", "具体内容"})
private String thingDesc;
}

20
src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintAddDto.java

@ -0,0 +1,20 @@
package com.biutag.supervision.pojo.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Setter
@Getter
public class DataPetitionComplaintAddDto {
// 更新方式
private String dataUpdateMethod;
// 来源
private String problemSourcesCode;
List<DataPetitionComplaintImportDto> data = new ArrayList<>();
}

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

@ -1,5 +1,6 @@
package com.biutag.supervision.pojo.dto.flow;
import com.baomidou.mybatisplus.annotation.TableField;
import com.biutag.supervision.pojo.vo.FileVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
@ -69,6 +70,13 @@ public class VerifyData {
@NotBlank
private String policeTypeCode;
@NotBlank
private String ivPersonType;
// 人员属性
@NotBlank
private String ivPersonTypeCode;
// 核查情况code
@NotBlank
private String inspectCaseCode;
@ -77,6 +85,8 @@ public class VerifyData {
@NotBlank
private String inspectCaseName;
// 督察措施
@NotBlank
private String superviseMeasuresCode;

65
src/main/java/com/biutag/supervision/pojo/entity/DataCaseVerif.java

@ -0,0 +1,65 @@
package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
public class DataCaseVerif {
// 样本源头编号
@TableId(value = "originId")
private String originId;
// 问题发现时间
@TableField("discovery_time")
@JsonFormat(pattern = "YYYY-MM-dd HH:mm")
private LocalDateTime discoveryTime;
// 问题发生时间
@TableField("happen_time")
@JsonFormat(pattern = "YYYY-MM-dd HH:mm")
private LocalDateTime happenTime;
// 问题来源
@TableField("problem_sources")
private String problemSources;
// 投诉人姓名
@TableField("responder_name")
private String responderName;
// 投诉人电话
@TableField("responder_phone")
private String responderPhone;
// 业务类型
@TableField("business_type_name")
private String businessTypeName;
// 涉及问题
@TableField("involve_problem")
private String involveProblem;
// 涉及警种
@TableField("police_type_name")
private String policeTypeName;
// 涉及单位
@TableField("involve_depart_name")
private String involveDepartName;
// 事情简述
@TableField("thing_desc")
private String thingDesc;
//
@TableField("create_time")
private LocalDateTime createTime;
}

17
src/main/java/com/biutag/supervision/pojo/entity/DataPetitionComplaint.java

@ -15,11 +15,8 @@ import java.time.LocalDateTime;
@Getter
public class DataPetitionComplaint {
@TableId(type = IdType.AUTO)
private Integer id;
// 信件编号
@TableId
private String originId;
// 投诉渠道
@ -31,7 +28,7 @@ public class DataPetitionComplaint {
private String acceptanceLevel;
// 登记时间
private LocalDateTime discovery_time;
private LocalDateTime discoveryTime;
// 投诉人
@TableField("responder_name")
@ -88,13 +85,11 @@ public class DataPetitionComplaint {
@TableField("involve_depart_name")
private String involveDepartName;
private LocalDateTime createTime;
//
@TableField("crt_time")
private LocalDateTime crtTime;
private LocalDateTime updateTime;
//
@TableField("upd_time")
private LocalDateTime updTime;
// 来源
private String problemSourcesCode;
}

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

@ -248,4 +248,7 @@ public class Negative {
// 办理超时(秒)
private Long handleTimeout;
// 当前处理对象
private String currentProcessingObject;
}

2
src/main/java/com/biutag/supervision/pojo/entity/SupDepart.java

@ -79,4 +79,6 @@ public class SupDepart {
@TableField("updated_at")
private String updatedAt;
private Boolean firstHost;
}

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

@ -2,6 +2,7 @@ package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
@ -135,4 +136,11 @@ public class SupPolice {
// 学历
private String education;
// 入职日期
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private LocalDateTime employmentDate;
// 警员角色
private String policeRole;
}

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

@ -1,9 +1,12 @@
package com.biutag.supervision.pojo.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
public class PoliceModel {
@ -95,4 +98,10 @@ public class PoliceModel {
private String updatedAt;
@JsonFormat(pattern="yyyy-MM-dd")
private LocalDateTime employmentDate;
// 警员角色
private String policeRole;
}

8
src/main/java/com/biutag/supervision/pojo/param/DataCaseVerifQueryParam.java

@ -0,0 +1,8 @@
package com.biutag.supervision.pojo.param;
/**
* @author wxc
* @date 2024/10/15
*/
public class DataCaseVerifQueryParam extends BasePage {
}

20
src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java

@ -2,8 +2,28 @@ 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;
@Setter
@Getter
public class DataPetitionComplaintQueryParam extends BasePage {
// 来源
private String problemSourcesCode;
private String responderKey;
private String responderValue;
private String originId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private List<Date> discoveryTime = new ArrayList<>();
private String thingDesc;
}

2
src/main/java/com/biutag/supervision/pojo/vo/DepartTree.java

@ -36,4 +36,6 @@ public class DepartTree {
private boolean hasChildren = false;
private Boolean firstHost;
}

3
src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java

@ -179,4 +179,7 @@ public class NegativeQueryVo {
// 办理超时(秒)
private Long handleTimeout;
// 当前处理对象
private String currentProcessingObject;
}

47
src/main/java/com/biutag/supervision/service/DataCaseVerifService.java

@ -0,0 +1,47 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.constants.enums.DataUpdateMethodEnum;
import com.biutag.supervision.mapper.DataCaseVerifMapper;
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto;
import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
@Service
public class DataCaseVerifService extends ServiceImpl<DataCaseVerifMapper, DataCaseVerif> {
public Page<DataCaseVerif> page(DataCaseVerifQueryParam queryParam) {
LambdaQueryWrapper<DataCaseVerif> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.orderByDesc(DataCaseVerif::getCreateTime);
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
public boolean save(List<DataCaseVerifImportDto> list, String dataUpdateMethod) {
LocalDateTime now = LocalDateTime.now();
int index = 0;
for (DataCaseVerifImportDto dto : list) {
index++;
boolean exists = exists(new LambdaQueryWrapper<DataCaseVerif>().eq(DataCaseVerif::getOriginId, dto.getOriginId()));
// 增量更新
if (DataUpdateMethodEnum.incremental.name().equals(dataUpdateMethod) && exists) {
throw new RuntimeException(String.format("第%s条数据的案件编号已存在,请核实", index));
}
DataCaseVerif data = new DataCaseVerif();
BeanUtils.copyProperties(dto, data);
data.setCreateTime(now);
saveOrUpdate(data);
}
return true;
}
}

55
src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java

@ -1,10 +1,18 @@
package com.biutag.supervision.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.constants.enums.DataUpdateMethodEnum;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.mapper.DataPetitionComplaintMapper;
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@ -12,12 +20,53 @@ import java.time.LocalDateTime;
@Service
public class DataPetitionComplaintService extends ServiceImpl<DataPetitionComplaintMapper, DataPetitionComplaint> {
public Page<DataPetitionComplaint> page(DataPetitionComplaintQueryParam queryParam) {
LambdaQueryWrapper<DataPetitionComplaint> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataPetitionComplaint::getProblemSourcesCode, queryParam.getProblemSourcesCode())
.like(StrUtil.isNotBlank(queryParam.getOriginId()), DataPetitionComplaint::getOriginId, queryParam.getOriginId())
.like(StrUtil.isNotBlank(queryParam.getThingDesc()), DataPetitionComplaint::getThingDesc, queryParam.getThingDesc())
.orderByDesc(DataPetitionComplaint::getCreateTime);
if (queryParam.getDiscoveryTime().size() == 2) {
queryWrapper.between(DataPetitionComplaint::getDiscoveryTime, queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1));
}
if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) {
switch (queryParam.getResponderKey()) {
case "name":
queryWrapper.like(DataPetitionComplaint::getResponderName, queryParam.getResponderValue());
break;
case "phone":
queryWrapper.like(DataPetitionComplaint::getResponderPhone, queryParam.getResponderValue());
break;
}
}
return page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
public boolean save(DataPetitionComplaintDto dto) {
DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint();
BeanUtil.copyProperties(dto, dataPetitionComplaint);
dataPetitionComplaint.setCrtTime(LocalDateTime.now());
dataPetitionComplaint.setUpdTime(LocalDateTime.now());
dataPetitionComplaint.setCreateTime(LocalDateTime.now());
dataPetitionComplaint.setUpdateTime(LocalDateTime.now());
return save(dataPetitionComplaint);
}
public boolean save(DataPetitionComplaintAddDto body) {
LocalDateTime now = LocalDateTime.now();
int index = 0;
for (DataPetitionComplaintImportDto dto : body.getData()) {
index++;
boolean exists = exists(new LambdaQueryWrapper<DataPetitionComplaint>().eq(DataPetitionComplaint::getOriginId, dto.getOriginId()));
// 增量更新
if (DataUpdateMethodEnum.incremental.name().equals(body.getDataUpdateMethod()) && exists) {
throw new RuntimeException(String.format("第%s条数据的信件编号已存在,请核实", index));
}
DataPetitionComplaint data = new DataPetitionComplaint();
BeanUtils.copyProperties(dto, data);
data.setCreateTime(now);
data.setUpdateTime(now);
data.setProblemSourcesCode(body.getProblemSourcesCode());
saveOrUpdate(data);
}
return true;
}
}

19
src/main/java/com/biutag/supervision/service/SupDepartService.java

@ -160,6 +160,25 @@ public class SupDepartService extends ServiceImpl<SupDepartMapper, SupDepart> {
return tree;
}
public List<DepartTree> buildTreeByFirstHost() {
List<SupDepart> departs = listByEnabled();
Map<String, List<DepartTree>> childMap = new HashMap<>();
List<DepartTree> tree = new ArrayList<>();
for (SupDepart depart : departs) {
DepartTree node = new DepartTree();
BeanUtils.copyProperties(depart, node);
List<DepartTree> children = childMap.computeIfAbsent(node.getPid(), k -> new ArrayList<>());
children.add(node);
if (node.getFirstHost()) {
tree.add(node);
}
}
for (DepartTree node : tree) {
buildTreeRecursive(node, childMap);
}
return tree;
}
private static DepartTree buildTreeRecursive(DepartTree node, Map<String, List<DepartTree>> childMap) {
List<DepartTree> children = childMap.get(node.getId());
if (children != null) {

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

@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.name depart_name, d.short_name depart_short_name, d1.short_name parent_depart_short_name
from sup_police p
left join sup_depart d on p.org_id = d.id
left join sup_depart d1 on d.pid = d1.id
left join sup_depart d1 on d.pid = d1.id and d1.level = 2
${ew.getCustomSqlSegment}
</select>

BIN
src/main/resources/static/templates/信访投诉数据台账(模板).xlsx

Binary file not shown.

BIN
src/main/resources/static/templates/案件核查问题台账(模板).xlsx

Binary file not shown.

7
src/test/java/com/biutag/supervision/StrUtil.java

@ -1,5 +1,7 @@
package com.biutag.supervision;
import cn.hutool.core.io.FileTypeUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ResourceUtil;
import com.biutag.supervision.util.JSON;
import com.fasterxml.jackson.databind.JsonNode;
@ -13,7 +15,8 @@ public class StrUtil {
@Test
public void testSubstr() {
JsonNode jsonNode = JSON.readTree("[{\"dictType\":\"suspectProblem\",\"dictLabel\":\"执法规范不满意\",\"dictValue\":\"24\"}]");
System.out.println(jsonNode);
String type = FileUtil.extName("1.xls");
System.out.println(type);
}
}

2
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 = "negative_task";
String tableName = "data_case_verif";
String tableSchema = "negative";
boolean genMapper = true;
boolean genService = true;

Loading…
Cancel
Save