Browse Source

fix: 优化信访投诉、案件核查导入

fit: 问题下发流程BUG修复
fit: 新增问题删除
main
wxc 1 year ago
parent
commit
a6c76f1525
  1. 15
      src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java
  2. 3
      src/main/java/com/biutag/supervision/controller/AuthController.java
  3. 38
      src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java
  4. 49
      src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java
  5. 2
      src/main/java/com/biutag/supervision/controller/system/DepartController.java
  6. 6
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  7. 8
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  8. 13
      src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java
  9. 8
      src/main/java/com/biutag/supervision/flow/action/SaveAction.java
  10. 13
      src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java
  11. 2
      src/main/java/com/biutag/supervision/pojo/domain/Blame.java
  12. 17
      src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java
  13. 38
      src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java
  14. 4
      src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java
  15. 3
      src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java
  16. 3
      src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java
  17. 15
      src/main/java/com/biutag/supervision/service/NegativeFileService.java
  18. 25
      src/main/java/com/biutag/supervision/service/NegativeService.java
  19. 19
      src/main/java/com/biutag/supervision/service/SupDepartService.java
  20. 2
      src/main/resources/mapper/NegativeWorkMapper.xml
  21. BIN
      src/main/resources/static/templates/信访投诉数据台账(模板).xlsx
  22. BIN
      src/main/resources/static/templates/案件核查问题台账(模板).xlsx

15
src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java

@ -20,4 +20,19 @@ public enum InitialPetition {
public String label; public String label;
public static String getValue(String str) {
if ("初".equals(str)) {
return THE_FIRST.getValue();
}
if ("重".equals(str)) {
return REPEAT.getValue();
}
for (InitialPetition value : values()) {
if (value.getLabel().equals(str)) {
return value.getValue();
}
}
return null;
}
} }

3
src/main/java/com/biutag/supervision/controller/AuthController.java

@ -67,6 +67,9 @@ public class AuthController {
redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), user, 24, TimeUnit.HOURS); redisTemplate.opsForValue().set(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), user, 24, TimeUnit.HOURS);
} }
} }
if (Objects.isNull(user)) {
throw new AuthException();
}
boolean superFlag = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); boolean superFlag = AppConstants.USER_TYPE_SUPER.equals(user.getUserType());
List<Menu> menus = superFlag ? menuService.listAll() : menuService.listMenuByCurrentUser(); List<Menu> menus = superFlag ? menuService.listAll() : menuService.listMenuByCurrentUser();
List<String> perms = superFlag ? List.of("*") : menuService.listPermsByCurrentUser(); List<String> perms = superFlag ? List.of("*") : menuService.listPermsByCurrentUser();

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

@ -1,17 +1,25 @@
package com.biutag.supervision.controller.data; package com.biutag.supervision.controller.data;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader; import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.exception.ExcelDataConvertException;
import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto;
import com.biutag.supervision.pojo.entity.DataCaseVerif; import com.biutag.supervision.pojo.entity.DataCaseVerif;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam;
import com.biutag.supervision.service.DataCaseVerifService; import com.biutag.supervision.service.DataCaseVerifService;
import com.biutag.supervision.service.SupDepartService;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -20,6 +28,8 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RequestMapping("data/caseVerif") @RequestMapping("data/caseVerif")
@ -29,6 +39,10 @@ public class DataCaseVerifController {
private final DataCaseVerifService dataCaseVerifService; private final DataCaseVerifService dataCaseVerifService;
private final SupDepartService departService;
private final Validator validator;
@GetMapping @GetMapping
public Result<Page<DataCaseVerif>> list(DataCaseVerifQueryParam queryParam) { public Result<Page<DataCaseVerif>> list(DataCaseVerifQueryParam queryParam) {
return Result.success(dataCaseVerifService.page(queryParam)); return Result.success(dataCaseVerifService.page(queryParam));
@ -42,9 +56,28 @@ public class DataCaseVerifController {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
} }
List<DataCaseVerifImportDto> list = new ArrayList<>(); List<DataCaseVerifImportDto> list = new ArrayList<>();
List<SupDepart> secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue()));
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataCaseVerifImportDto.class, new ReadListener<DataCaseVerifImportDto>() { ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataCaseVerifImportDto.class, new ReadListener<DataCaseVerifImportDto>() {
@Override @Override
public void invoke(DataCaseVerifImportDto data, AnalysisContext analysisContext) { public void invoke(DataCaseVerifImportDto data, AnalysisContext analysisContext) {
String secondDepartId = secondDeparts.stream()
.filter(item -> item.getShortName().equals(data.getComplainedSecondDepartName())).findFirst()
.map(SupDepart::getId).orElse("");
data.setComplainedSecondDepartId(secondDepartId);
if (StrUtil.isNotBlank(secondDepartId)) {
String complainedThirdDepartId = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, secondDepartId)
.like(SupDepart::getShortName, data.getComplainedThirdDepartName()))
.stream().findFirst().map(SupDepart::getId).orElse("");
data.setComplainedThirdDepartId(complainedThirdDepartId);
}
Set<ConstraintViolation<DataCaseVerifImportDto>> validate = validator.validate(data);
if (!validate.isEmpty()) {
String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n"));
data.setErrMsg(message);
data.setState("fail");
} else {
data.setState("success");
}
list.add(data); list.add(data);
} }
@ -54,7 +87,12 @@ public class DataCaseVerifController {
} }
}).build(); }).build();
ReadSheet sheet = EasyExcel.readSheet(0).build(); ReadSheet sheet = EasyExcel.readSheet(0).build();
try {
excelReader.read(sheet); excelReader.read(sheet);
} catch (ExcelDataConvertException e) {
log.error(e.getMessage(), e);
throw new RuntimeException("日期格式错误");
}
excelReader.close(); excelReader.close();
return Result.success(list); return Result.success(list);
} }

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

@ -1,18 +1,26 @@
package com.biutag.supervision.controller.data; package com.biutag.supervision.controller.data;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader; import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.ReadSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.constants.enums.InitialPetition;
import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto; import com.biutag.supervision.pojo.dto.DataPetitionComplaintAddDto;
import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto; import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto;
import com.biutag.supervision.pojo.entity.DataPetitionComplaint; import com.biutag.supervision.pojo.entity.DataPetitionComplaint;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam;
import com.biutag.supervision.service.DataPetitionComplaintService; import com.biutag.supervision.service.DataPetitionComplaintService;
import com.biutag.supervision.service.SupDepartService;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -21,6 +29,8 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* *
@ -35,6 +45,10 @@ public class DataPetitionComplaintController {
private final DataPetitionComplaintService dataPetitionComplaintService; private final DataPetitionComplaintService dataPetitionComplaintService;
private final SupDepartService departService;
private final Validator validator;
@GetMapping @GetMapping
public Result<Page<DataPetitionComplaint>> list(DataPetitionComplaintQueryParam queryParam) { public Result<Page<DataPetitionComplaint>> list(DataPetitionComplaintQueryParam queryParam) {
return Result.success(dataPetitionComplaintService.page(queryParam)); return Result.success(dataPetitionComplaintService.page(queryParam));
@ -47,16 +61,49 @@ public class DataPetitionComplaintController {
if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) {
throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入");
} }
List<SupDepart> secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue()));
List<DataPetitionComplaintImportDto> list = new ArrayList<>(); List<DataPetitionComplaintImportDto> list = new ArrayList<>();
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener<DataPetitionComplaintImportDto>() { ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener<DataPetitionComplaintImportDto>() {
@Override @Override
public void invoke(DataPetitionComplaintImportDto data, AnalysisContext analysisContext) { public void invoke(DataPetitionComplaintImportDto data, AnalysisContext analysisContext) {
if ("是".equals(data.getEntanglementVisitsLabel())) {
data.setEntanglementVisits(true);
}
if ("否".equals(data.getEntanglementVisitsLabel())) {
data.setEntanglementVisits(false);
}
if ("是".equals(data.getMassVisitsLabel())) {
data.setMassVisits(true);
}
if ("否".equals(data.getMassVisitsLabel())) {
data.setMassVisits(false);
}
data.setInitialPetition(InitialPetition.getValue(data.getInitialPetition()));
String secondDepartId = secondDeparts.stream()
.filter(item -> item.getShortName().equals(data.getComplainedSecondDepartName())).findFirst()
.map(SupDepart::getId).orElse("");
data.setComplainedSecondDepartId(secondDepartId);
if (StrUtil.isNotBlank(secondDepartId)) {
String complainedThirdDepartId = departService.list(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, secondDepartId)
.like(SupDepart::getShortName, data.getComplainedThirdDepartName()))
.stream().findFirst().map(SupDepart::getId).orElse("");
data.setComplainedThirdDepartId(complainedThirdDepartId);
}
Set<ConstraintViolation<DataPetitionComplaintImportDto>> validate = validator.validate(data);
if (!validate.isEmpty()) {
String message = validate.stream().map(ConstraintViolation::getMessage).collect(Collectors.joining("\n"));
data.setErrMsg(message);
data.setState("fail");
} else {
data.setState("success");
}
list.add(data); list.add(data);
} }
@Override @Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) { public void doAfterAllAnalysed(AnalysisContext analysisContext) {
} }
}).build(); }).build();
ReadSheet sheet = EasyExcel.readSheet(0).build(); ReadSheet sheet = EasyExcel.readSheet(0).build();

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

@ -84,7 +84,7 @@ public class DepartController {
@GetMapping("second") @GetMapping("second")
public Result<List<DepartTree>> seconds() { public Result<List<DepartTree>> seconds() {
List<SupDepart> supDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND_CATEGORY.getValue(), DepartLevelEnum.SECOND.getValue())); List<SupDepart> supDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND_CATEGORY.getValue(), DepartLevelEnum.SECOND.getValue()));
return Result.success(departService.buildTree(supDeparts)); return Result.success(departService.buildTreeBySecond(supDeparts));
} }
@GetMapping("firstHost") @GetMapping("firstHost")

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

@ -29,7 +29,6 @@ public class NegativeController {
private final NegativeTaskService negativeTaskService; private final NegativeTaskService negativeTaskService;
@GetMapping @GetMapping
public Result<Page<NegativeQueryVo>> list(NegativeQueryParam queryParam) { public Result<Page<NegativeQueryVo>> list(NegativeQueryParam queryParam) {
return Result.success(negativeQueryService.page(queryParam)); return Result.success(negativeQueryService.page(queryParam));
@ -61,4 +60,9 @@ public class NegativeController {
return Result.success(); return Result.success();
} }
@DeleteMapping("{id}")
public Result<Boolean> remove(@PathVariable String id) {
return Result.success(negativeService.remove(id));
}
} }

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

@ -114,16 +114,10 @@ public class ApplyCompletionAction implements Action {
} }
} }
if (!verifyData.getFiles().isEmpty()) { if (!verifyData.getFiles().isEmpty()) {
List<NegativeFile> files = verifyData.getFiles().stream().map(item -> {
NegativeFile file = new NegativeFile();
BeanUtil.copyProperties(item, file);
file.setNegtiveId(negativeId);
return file;
}).toList();
// 先删除 // 先删除
fileService.remove(negativeId); fileService.remove(negativeId);
// 新增 // 新增
fileService.saveBatch(files); fileService.saveBatch(verifyData.getFiles(), negativeId);
} }
aproveService.remove(negativeId); aproveService.remove(negativeId);

13
src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java

@ -18,6 +18,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 市局 退回整改 * 市局 退回整改
@ -74,11 +75,15 @@ public class FirstApproveReturnAction implements Action {
} }
public void addWork(String negativeId, String roleCode) { public void addWork(String negativeId, String roleCode) {
NegativeWork work = workService.getOne(new LambdaQueryWrapper<NegativeWork>() List<NegativeWork> works = workService.list(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId) .eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)); .eq(NegativeWork::getRoleCode, roleCode)
work.setUpdateTime(LocalDateTime.now()) .orderByDesc(NegativeWork::getCreateTime));
if (works.isEmpty()) {
throw new RuntimeException("数据异常,请联系管理员:无二级机构工作流程数据");
}
works.get(0).setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name()); .setStatus(WorkStatusEnum.todo.name());
workService.updateById(work); workService.updateById(works.get(0));
} }
} }

8
src/main/java/com/biutag/supervision/flow/action/SaveAction.java

@ -10,8 +10,11 @@ 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.Negative; import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.NegativeFile;
import com.biutag.supervision.pojo.entity.NegativeProblemRelation; import com.biutag.supervision.pojo.entity.NegativeProblemRelation;
import com.biutag.supervision.pojo.vo.FileVo;
import com.biutag.supervision.service.NegativeBlameService; import com.biutag.supervision.service.NegativeBlameService;
import com.biutag.supervision.service.NegativeFileService;
import com.biutag.supervision.service.NegativeProblemRelationService; import com.biutag.supervision.service.NegativeProblemRelationService;
import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -33,6 +36,8 @@ public class SaveAction implements Action {
private final NegativeProblemRelationService negativeProblemRelationService; private final NegativeProblemRelationService negativeProblemRelationService;
private final NegativeFileService fileService;
@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);
@ -43,6 +48,7 @@ public class SaveAction implements Action {
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.set(Negative::getUpdTime, LocalDateTime.now()) .set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name())
.set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc())
.eq(Negative::getId, negativeId); .eq(Negative::getId, negativeId);
updateWrapper.set(Negative::getCheckStatus, verifyData.getCheckStatus()) updateWrapper.set(Negative::getCheckStatus, verifyData.getCheckStatus())
.set(Negative::getCheckStatusName, verifyData.getCheckStatusName()); .set(Negative::getCheckStatusName, verifyData.getCheckStatusName());
@ -86,6 +92,8 @@ public class SaveAction implements Action {
negativeProblemRelationService.saveBatch(problemRelations); negativeProblemRelationService.saveBatch(problemRelations);
} }
} }
fileService.remove(negativeId);
fileService.saveBatch(verifyData.getFiles(), negativeId);
} }
} }

13
src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java

@ -19,6 +19,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 二级机构 退回整改 * 二级机构 退回整改
@ -76,10 +77,16 @@ public class SecondApproveReturnAction implements Action {
} }
public void addWork(String negativeId, String roleCode) { public void addWork(String negativeId, String roleCode) {
NegativeWork work = workService.getOne(new LambdaQueryWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, negativeId).eq(NegativeWork::getRoleCode, roleCode)); List<NegativeWork> works = workService.list(new LambdaQueryWrapper<NegativeWork>()
work.setUpdateTime(LocalDateTime.now()) .eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.orderByDesc(NegativeWork::getCreateTime));
if (works.isEmpty()) {
throw new RuntimeException("数据异常,请联系管理员:无三级机构工作流程数据");
}
works.get(0).setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name()); .setStatus(WorkStatusEnum.todo.name());
workService.updateById(work); workService.updateById(works.get(0));
} }
} }

2
src/main/java/com/biutag/supervision/pojo/domain/Blame.java

@ -115,6 +115,8 @@ public class Blame {
// 责任领导 // 责任领导
private String leadName; private String leadName;
private String leadEmpNo;
// 责任领导身份证 // 责任领导身份证
private String leadIdCode; private String leadIdCode;

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

@ -3,6 +3,7 @@ package com.biutag.supervision.pojo.dto;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -48,12 +49,24 @@ public class DataCaseVerifImportDto {
private String policeTypeName; private String policeTypeName;
// 被投诉机构 // 被投诉机构
@ExcelProperty({"问题基本信息", "涉及单位"}) @ExcelProperty({"问题基本信息", "涉及单位(二级机构)"})
private String complainedDepartName; private String complainedSecondDepartName;
// 被投诉机构
@ExcelProperty({"问题基本信息", "涉及单位(三级机构)"})
private String complainedThirdDepartName;
@NotBlank(message = "涉及二级机构为空或与系统未匹配上")
private String complainedSecondDepartId;
private String complainedThirdDepartId;
// 具体内容 // 具体内容
@ExcelProperty({"问题基本信息", "具体内容"}) @ExcelProperty({"问题基本信息", "具体内容"})
@NotBlank(message = "具体内容为空")
private String thingDesc; private String thingDesc;
private String state;
private String errMsg;
} }

38
src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java

@ -1,8 +1,10 @@
package com.biutag.supervision.pojo.dto; package com.biutag.supervision.pojo.dto;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -27,8 +29,7 @@ public class DataPetitionComplaintImportDto {
// 登记时间 // 登记时间
@ExcelProperty({"信访基本信息", "登记时间"}) @ExcelProperty({"信访基本信息", "登记时间"})
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") private String discoveryTime;
private LocalDateTime discoveryTime;
// 投诉人 // 投诉人
@ExcelProperty({"信访基本信息", "投诉人"}) @ExcelProperty({"信访基本信息", "投诉人"})
@ -40,26 +41,51 @@ public class DataPetitionComplaintImportDto {
// 初重信访 // 初重信访
@ExcelProperty({"信访基本信息", "初重信访"}) @ExcelProperty({"信访基本信息", "初重信访"})
@NotBlank(message = "初重信访为空或值描述不准确")
private String initialPetition; private String initialPetition;
// 缠访闹访 // 缠访闹访
@ExcelProperty({"信访基本信息", "缠访闹访"}) @ExcelProperty({"信访基本信息", "缠访闹访"})
private String entanglementVisits; private String entanglementVisitsLabel;
private Boolean entanglementVisits;
// 群众集访 // 群众集访
@ExcelProperty({"信访基本信息", "群众集访"}) @ExcelProperty({"信访基本信息", "群众集访"})
private String massVisits; private String massVisitsLabel;
private Boolean massVisits;
// 涉嫌问题
@ExcelProperty({"信访基本信息", "涉嫌问题"})
private String involveProblem;
// 业务类别
@ExcelProperty({"信访基本信息", "业务类别"})
private String businessTypeName;
// 被投诉机构 // 被投诉机构
@ExcelProperty({"信访基本信息", "被投诉机构"}) @ExcelProperty({"信访基本信息", "被投诉二级机构"})
private String complainedSecondDepartName; private String complainedSecondDepartName;
@ExcelProperty({"信访基本信息", "被投诉机构"}) @NotBlank(message = "被投诉二级机构为空或与系统未匹配上")
private String complainedSecondDepartId;
//
@ExcelProperty({"信访基本信息", "被投诉所队"})
private String complainedThirdDepartName; private String complainedThirdDepartName;
private String complainedThirdDepartId;
private String complainedDepartId;
// 具体内容 // 具体内容
@ExcelProperty({"信访基本信息", "具体内容"}) @ExcelProperty({"信访基本信息", "具体内容"})
@NotBlank(message = "具体内容为空")
private String thingDesc; private String thingDesc;
private String state;
private String errMsg;
} }

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

@ -143,6 +143,10 @@ public class VerifyData {
@NotBlank @NotBlank
private String leadName; private String leadName;
// 责任领导警号
@NotBlank
private String leadEmpNo;
// 责任领导身份证 // 责任领导身份证
@NotBlank @NotBlank
private String leadIdCode; private String leadIdCode;

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

@ -149,6 +149,9 @@ public class NegativeBlame {
@TableField("leadName") @TableField("leadName")
private String leadName; private String leadName;
// 领导警号
private String leadEmpNo;
// 责任领导身份证 // 责任领导身份证
@TableField("leadIdCode") @TableField("leadIdCode")
private String leadIdCode; private String leadIdCode;

3
src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java

@ -84,4 +84,7 @@ public class NegativeWorkModel {
private String handleThreeDepartName; private String handleThreeDepartName;
// 涉嫌问题
private String involveProblem;
} }

15
src/main/java/com/biutag/supervision/service/NegativeFileService.java

@ -1,9 +1,11 @@
package com.biutag.supervision.service; package com.biutag.supervision.service;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.NegativeFile; import com.biutag.supervision.pojo.entity.NegativeFile;
import com.biutag.supervision.mapper.NegativeFileMapper; import com.biutag.supervision.mapper.NegativeFileMapper;
import com.biutag.supervision.pojo.vo.FileVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -19,4 +21,17 @@ public class NegativeFileService extends ServiceImpl<NegativeFileMapper, Negativ
return remove(new LambdaQueryWrapper<NegativeFile>().eq(NegativeFile::getNegtiveId, negativeId)); return remove(new LambdaQueryWrapper<NegativeFile>().eq(NegativeFile::getNegtiveId, negativeId));
} }
public boolean saveBatch(List<FileVo> fileVos, String negativeId) {
if (fileVos.isEmpty()) {
return false;
}
List<NegativeFile> files = fileVos.stream().map(item -> {
NegativeFile file = new NegativeFile();
BeanUtil.copyProperties(item, file);
file.setNegtiveId(negativeId);
return file;
}).toList();
return saveBatch(files);
}
} }

25
src/main/java/com/biutag/supervision/service/NegativeService.java

@ -7,6 +7,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.constants.AppConstants;
@ -24,7 +25,6 @@ import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.util.JSON; import com.biutag.supervision.util.JSON;
import com.biutag.supervision.util.SpringUtil; import com.biutag.supervision.util.SpringUtil;
import com.biutag.supervision.util.TimeUtil; import com.biutag.supervision.util.TimeUtil;
import jakarta.validation.ValidationException;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -259,4 +259,27 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
return originId; return originId;
} }
@Transactional(rollbackFor = Exception.class)
public boolean remove(String id) {
removeById(id);
negativeHistoryService.removeById(id);
// 工作表
workService.remove(new LambdaQueryWrapper<NegativeWork>().eq(NegativeWork::getNegativeId, id));
// 收藏表
favService.remove(new LambdaQueryWrapper<NegativeFav>().eq(NegativeFav::getNegativeId, id));
// 事件详情描述表
thingFileService.remove(new LambdaQueryWrapper<NegativeThingFile>().eq(NegativeThingFile::getNegativeId, id));
// 涉及人员
blameService.remove(id);
// 核查附件
fileService.remove(new LambdaQueryWrapper<NegativeFile>().eq(NegativeFile::getNegtiveId, id));
// 签收退回
signReturnService.remove(new LambdaQueryWrapper<NegativeSignReturn>().eq(NegativeSignReturn::getNegativeId, id));
// 申请延期
extensionApplyService.remove(new LambdaQueryWrapper<NegativeExtensionApply>().eq(NegativeExtensionApply::getNegativeId, id));
// 审批
approveService.remove(new LambdaQueryWrapper<NegativeApprove>().eq(NegativeApprove::getNegativeId, id));
return true;
}
} }

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

@ -109,6 +109,25 @@ public class SupDepartService extends ServiceImpl<SupDepartMapper, SupDepart> {
List<SupDepart> departs = listByEnabled(); List<SupDepart> departs = listByEnabled();
return buildTree(departs); return buildTree(departs);
} }
public List<DepartTree> buildTreeBySecond(List<SupDepart> departs) {
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 (AppConstants.ROOT_DEPART_ID.equals(node.getPid())) {
tree.add(node);
}
}
for (DepartTree node : tree) {
buildTreeRecursive(node, childMap);
}
return tree;
}
public List<DepartTree> buildTree(List<SupDepart> departs) { public List<DepartTree> buildTree(List<SupDepart> departs) {
Map<String, List<DepartTree>> childMap = new HashMap<>(); Map<String, List<DepartTree>> childMap = new HashMap<>();
List<DepartTree> tree = new ArrayList<>(); List<DepartTree> tree = new ArrayList<>();

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

@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select w.id, w.negative_id, w.depart_id work_depart_id, n.originId, n.happenTime, n.discoveryTime, n.problemSources, n.thingDesc, n.contactPhone, select w.id, w.negative_id, w.depart_id work_depart_id, n.originId, n.happenTime, n.discoveryTime, n.problemSources, n.thingDesc, n.contactPhone,
n.responderName, n.businessTypeCode, n.businessTypeName, n.policeTypeName, n.policeType, n.involveDepartName, n.involveDepartId, n.processing_status, n.responderName, n.businessTypeCode, n.businessTypeName, n.policeTypeName, n.policeType, n.involveDepartName, n.involveDepartId, n.processing_status,
n.flow_key, n.first_distribute_time, n.max_sign_duration, n.max_handle_duration, n.extension_days, n.flow_key, n.first_distribute_time, n.max_sign_duration, n.max_handle_duration, n.extension_days,
n.handle_second_depart_id, n.handle_second_depart_name, n.handle_three_depart_id, n.handle_three_depart_name n.handle_second_depart_id, n.handle_second_depart_name, n.handle_three_depart_id, n.handle_three_depart_name, n.involveProblem
from negative_work w from negative_work w
left join negative n on w.negative_id = n.id left join negative n on w.negative_id = n.id
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}

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

Binary file not shown.

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

Binary file not shown.
Loading…
Cancel
Save