diff --git a/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java b/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java index e958976..8de6cca 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java +++ b/src/main/java/com/biutag/supervision/constants/enums/InitialPetition.java @@ -20,4 +20,19 @@ public enum InitialPetition { 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; + } + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/controller/AuthController.java b/src/main/java/com/biutag/supervision/controller/AuthController.java index 55b570b..695e60b 100644 --- a/src/main/java/com/biutag/supervision/controller/AuthController.java +++ b/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); } } + if (Objects.isNull(user)) { + throw new AuthException(); + } boolean superFlag = AppConstants.USER_TYPE_SUPER.equals(user.getUserType()); List menus = superFlag ? menuService.listAll() : menuService.listMenuByCurrentUser(); List perms = superFlag ? List.of("*") : menuService.listPermsByCurrentUser(); diff --git a/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java index 3821bbc..0d05d9c 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java @@ -1,17 +1,25 @@ package com.biutag.supervision.controller.data; import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelReader; import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.exception.ExcelDataConvertException; import com.alibaba.excel.read.listener.ReadListener; 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.biutag.supervision.constants.enums.DepartLevelEnum; 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.entity.SupDepart; import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; 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.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -20,6 +28,8 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; @Slf4j @RequestMapping("data/caseVerif") @@ -29,6 +39,10 @@ public class DataCaseVerifController { private final DataCaseVerifService dataCaseVerifService; + private final SupDepartService departService; + + private final Validator validator; + @GetMapping public Result> list(DataCaseVerifQueryParam queryParam) { return Result.success(dataCaseVerifService.page(queryParam)); @@ -42,9 +56,28 @@ public class DataCaseVerifController { throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); } List list = new ArrayList<>(); + List secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue())); ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataCaseVerifImportDto.class, new ReadListener() { @Override 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().eq(SupDepart::getPid, secondDepartId) + .like(SupDepart::getShortName, data.getComplainedThirdDepartName())) + .stream().findFirst().map(SupDepart::getId).orElse(""); + data.setComplainedThirdDepartId(complainedThirdDepartId); + } + Set> 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); } @@ -54,7 +87,12 @@ public class DataCaseVerifController { } }).build(); ReadSheet sheet = EasyExcel.readSheet(0).build(); - excelReader.read(sheet); + try { + excelReader.read(sheet); + } catch (ExcelDataConvertException e) { + log.error(e.getMessage(), e); + throw new RuntimeException("日期格式错误"); + } excelReader.close(); return Result.success(list); } diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java index 10e1848..83e049b 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java @@ -1,18 +1,26 @@ package com.biutag.supervision.controller.data; import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; 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.core.conditions.query.LambdaQueryWrapper; 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.dto.DataPetitionComplaintAddDto; import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto; 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.service.DataPetitionComplaintService; +import com.biutag.supervision.service.SupDepartService; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -21,6 +29,8 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.ArrayList; 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 SupDepartService departService; + + private final Validator validator; + @GetMapping public Result> list(DataPetitionComplaintQueryParam queryParam) { return Result.success(dataPetitionComplaintService.page(queryParam)); @@ -47,16 +61,49 @@ public class DataPetitionComplaintController { if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); } + List secondDeparts = departService.listByLevel(List.of(DepartLevelEnum.SECOND.getValue())); + List list = new ArrayList<>(); ExcelReader excelReader = EasyExcel.read(file.getInputStream(), DataPetitionComplaintImportDto.class, new ReadListener() { @Override 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().eq(SupDepart::getPid, secondDepartId) + .like(SupDepart::getShortName, data.getComplainedThirdDepartName())) + .stream().findFirst().map(SupDepart::getId).orElse(""); + data.setComplainedThirdDepartId(complainedThirdDepartId); + } + Set> 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); } @Override public void doAfterAllAnalysed(AnalysisContext analysisContext) { - } }).build(); ReadSheet sheet = EasyExcel.readSheet(0).build(); diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartController.java b/src/main/java/com/biutag/supervision/controller/system/DepartController.java index e600aaf..0f1376d 100644 --- a/src/main/java/com/biutag/supervision/controller/system/DepartController.java +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -84,7 +84,7 @@ public class DepartController { @GetMapping("second") public Result> seconds() { List 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") diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java index 4b9a703..eda9da7 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java @@ -29,7 +29,6 @@ public class NegativeController { private final NegativeTaskService negativeTaskService; - @GetMapping public Result> list(NegativeQueryParam queryParam) { return Result.success(negativeQueryService.page(queryParam)); @@ -61,4 +60,9 @@ public class NegativeController { return Result.success(); } + @DeleteMapping("{id}") + public Result remove(@PathVariable String id) { + return Result.success(negativeService.remove(id)); + } + } diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java index fae62d4..daf0866 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -114,16 +114,10 @@ public class ApplyCompletionAction implements Action { } } if (!verifyData.getFiles().isEmpty()) { - List files = verifyData.getFiles().stream().map(item -> { - NegativeFile file = new NegativeFile(); - BeanUtil.copyProperties(item, file); - file.setNegtiveId(negativeId); - return file; - }).toList(); // 先删除 fileService.remove(negativeId); // 新增 - fileService.saveBatch(files); + fileService.saveBatch(verifyData.getFiles(), negativeId); } aproveService.remove(negativeId); diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java index 0663c010..6e4b102 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java @@ -18,6 +18,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import java.time.LocalDateTime; +import java.util.List; /** * 市局 退回整改 @@ -74,11 +75,15 @@ public class FirstApproveReturnAction implements Action { } public void addWork(String negativeId, String roleCode) { - NegativeWork work = workService.getOne(new LambdaQueryWrapper() + List works = workService.list(new LambdaQueryWrapper() .eq(NegativeWork::getNegativeId, negativeId) - .eq(NegativeWork::getRoleCode, roleCode)); - work.setUpdateTime(LocalDateTime.now()) + .eq(NegativeWork::getRoleCode, roleCode) + .orderByDesc(NegativeWork::getCreateTime)); + if (works.isEmpty()) { + throw new RuntimeException("数据异常,请联系管理员:无二级机构工作流程数据"); + } + works.get(0).setUpdateTime(LocalDateTime.now()) .setStatus(WorkStatusEnum.todo.name()); - workService.updateById(work); + workService.updateById(works.get(0)); } } diff --git a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java index aae0e83..a5a9b2d 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java +++ b/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.entity.Negative; 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.vo.FileVo; import com.biutag.supervision.service.NegativeBlameService; +import com.biutag.supervision.service.NegativeFileService; import com.biutag.supervision.service.NegativeProblemRelationService; import com.biutag.supervision.service.NegativeService; import lombok.RequiredArgsConstructor; @@ -33,6 +36,8 @@ public class SaveAction implements Action { private final NegativeProblemRelationService negativeProblemRelationService; + private final NegativeFileService fileService; + @Override public void next(ActionDto actionDto) { VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); @@ -43,6 +48,7 @@ public class SaveAction implements Action { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .set(Negative::getUpdTime, LocalDateTime.now()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) + .set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc()) .eq(Negative::getId, negativeId); updateWrapper.set(Negative::getCheckStatus, verifyData.getCheckStatus()) .set(Negative::getCheckStatusName, verifyData.getCheckStatusName()); @@ -86,6 +92,8 @@ public class SaveAction implements Action { negativeProblemRelationService.saveBatch(problemRelations); } } + fileService.remove(negativeId); + fileService.saveBatch(verifyData.getFiles(), negativeId); } } diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java index 7958156..cd7afeb 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java @@ -19,6 +19,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import java.time.LocalDateTime; +import java.util.List; /** * 二级机构 退回整改 @@ -76,10 +77,16 @@ public class SecondApproveReturnAction implements Action { } public void addWork(String negativeId, String roleCode) { - NegativeWork work = workService.getOne(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, negativeId).eq(NegativeWork::getRoleCode, roleCode)); - work.setUpdateTime(LocalDateTime.now()) + List works = workService.list(new LambdaQueryWrapper() + .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()); - workService.updateById(work); + workService.updateById(works.get(0)); } } diff --git a/src/main/java/com/biutag/supervision/pojo/domain/Blame.java b/src/main/java/com/biutag/supervision/pojo/domain/Blame.java index ebc208d..a2e6f96 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/Blame.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/Blame.java @@ -115,6 +115,8 @@ public class Blame { // 责任领导 private String leadName; + private String leadEmpNo; + // 责任领导身份证 private String leadIdCode; diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java index 9a6bb6a..f8d6941 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/DataCaseVerifImportDto.java +++ b/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.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Getter; import lombok.Setter; @@ -48,12 +49,24 @@ public class DataCaseVerifImportDto { private String policeTypeName; // 被投诉机构 - @ExcelProperty({"问题基本信息", "涉及单位"}) - private String complainedDepartName; + @ExcelProperty({"问题基本信息", "涉及单位(二级机构)"}) + private String complainedSecondDepartName; + // 被投诉机构 + @ExcelProperty({"问题基本信息", "涉及单位(三级机构)"}) + private String complainedThirdDepartName; + + @NotBlank(message = "涉及二级机构为空或与系统未匹配上") + private String complainedSecondDepartId; + + private String complainedThirdDepartId; // 具体内容 @ExcelProperty({"问题基本信息", "具体内容"}) + @NotBlank(message = "具体内容为空") private String thingDesc; + private String state; + + private String errMsg; } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java index e2aaf2b..e9d5bcb 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/DataPetitionComplaintImportDto.java @@ -1,8 +1,10 @@ package com.biutag.supervision.pojo.dto; import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; import lombok.Getter; import lombok.Setter; @@ -27,8 +29,7 @@ public class DataPetitionComplaintImportDto { // 登记时间 @ExcelProperty({"信访基本信息", "登记时间"}) - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") - private LocalDateTime discoveryTime; + private String discoveryTime; // 投诉人 @ExcelProperty({"信访基本信息", "投诉人"}) @@ -40,26 +41,51 @@ public class DataPetitionComplaintImportDto { // 初重信访 @ExcelProperty({"信访基本信息", "初重信访"}) + @NotBlank(message = "初重信访为空或值描述不准确") private String initialPetition; // 缠访闹访 @ExcelProperty({"信访基本信息", "缠访闹访"}) - private String entanglementVisits; + private String entanglementVisitsLabel; + + private Boolean entanglementVisits; // 群众集访 @ExcelProperty({"信访基本信息", "群众集访"}) - private String massVisits; + private String massVisitsLabel; + + private Boolean massVisits; + + // 涉嫌问题 + @ExcelProperty({"信访基本信息", "涉嫌问题"}) + private String involveProblem; + + // 业务类别 + @ExcelProperty({"信访基本信息", "业务类别"}) + private String businessTypeName; // 被投诉机构 - @ExcelProperty({"信访基本信息", "被投诉机构"}) + @ExcelProperty({"信访基本信息", "被投诉二级机构"}) private String complainedSecondDepartName; - @ExcelProperty({"信访基本信息", "被投诉机构"}) + @NotBlank(message = "被投诉二级机构为空或与系统未匹配上") + private String complainedSecondDepartId; + + // + @ExcelProperty({"信访基本信息", "被投诉所队"}) private String complainedThirdDepartName; + private String complainedThirdDepartId; + + private String complainedDepartId; + // 具体内容 @ExcelProperty({"信访基本信息", "具体内容"}) + @NotBlank(message = "具体内容为空") private String thingDesc; + private String state; + + private String errMsg; } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java index 7f25987..9abac1a 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/VerifyData.java @@ -143,6 +143,10 @@ public class VerifyData { @NotBlank private String leadName; + // 责任领导警号 + @NotBlank + private String leadEmpNo; + // 责任领导身份证 @NotBlank private String leadIdCode; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java index 421115d..6106e46 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeBlame.java @@ -149,6 +149,9 @@ public class NegativeBlame { @TableField("leadName") private String leadName; + // 领导警号 + private String leadEmpNo; + // 责任领导身份证 @TableField("leadIdCode") private String leadIdCode; diff --git a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java index 8764bf9..d61117f 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/NegativeWorkModel.java @@ -84,4 +84,7 @@ public class NegativeWorkModel { private String handleThreeDepartName; + // 涉嫌问题 + private String involveProblem; + } diff --git a/src/main/java/com/biutag/supervision/service/NegativeFileService.java b/src/main/java/com/biutag/supervision/service/NegativeFileService.java index 341c8a8..665ef40 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeFileService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeFileService.java @@ -1,9 +1,11 @@ package com.biutag.supervision.service; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.pojo.entity.NegativeFile; import com.biutag.supervision.mapper.NegativeFileMapper; +import com.biutag.supervision.pojo.vo.FileVo; import org.springframework.stereotype.Service; import java.util.List; @@ -19,4 +21,17 @@ public class NegativeFileService extends ServiceImpl().eq(NegativeFile::getNegtiveId, negativeId)); } + public boolean saveBatch(List fileVos, String negativeId) { + if (fileVos.isEmpty()) { + return false; + } + List files = fileVos.stream().map(item -> { + NegativeFile file = new NegativeFile(); + BeanUtil.copyProperties(item, file); + file.setNegtiveId(negativeId); + return file; + }).toList(); + return saveBatch(files); + } + } diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java index e202436..eb0bda2 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeService.java +++ b/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.RandomUtil; 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.extension.service.impl.ServiceImpl; 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.SpringUtil; import com.biutag.supervision.util.TimeUtil; -import jakarta.validation.ValidationException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -259,4 +259,27 @@ public class NegativeService extends ServiceImpl { return originId; } + @Transactional(rollbackFor = Exception.class) + public boolean remove(String id) { + removeById(id); + negativeHistoryService.removeById(id); + // 工作表 + workService.remove(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, id)); + // 收藏表 + favService.remove(new LambdaQueryWrapper().eq(NegativeFav::getNegativeId, id)); + // 事件详情描述表 + thingFileService.remove(new LambdaQueryWrapper().eq(NegativeThingFile::getNegativeId, id)); + // 涉及人员 + blameService.remove(id); + // 核查附件 + fileService.remove(new LambdaQueryWrapper().eq(NegativeFile::getNegtiveId, id)); + // 签收退回 + signReturnService.remove(new LambdaQueryWrapper().eq(NegativeSignReturn::getNegativeId, id)); + // 申请延期 + extensionApplyService.remove(new LambdaQueryWrapper().eq(NegativeExtensionApply::getNegativeId, id)); + // 审批 + approveService.remove(new LambdaQueryWrapper().eq(NegativeApprove::getNegativeId, id)); + return true; + } + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/SupDepartService.java b/src/main/java/com/biutag/supervision/service/SupDepartService.java index b8c5d84..d7d307d 100644 --- a/src/main/java/com/biutag/supervision/service/SupDepartService.java +++ b/src/main/java/com/biutag/supervision/service/SupDepartService.java @@ -109,6 +109,25 @@ public class SupDepartService extends ServiceImpl { List departs = listByEnabled(); return buildTree(departs); } + + public List buildTreeBySecond(List departs) { + Map> childMap = new HashMap<>(); + List tree = new ArrayList<>(); + for (SupDepart depart : departs) { + DepartTree node = new DepartTree(); + BeanUtils.copyProperties(depart, node); + List 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 buildTree(List departs) { Map> childMap = new HashMap<>(); List tree = new ArrayList<>(); diff --git a/src/main/resources/mapper/NegativeWorkMapper.xml b/src/main/resources/mapper/NegativeWorkMapper.xml index 1125f8a..99e667f 100644 --- a/src/main/resources/mapper/NegativeWorkMapper.xml +++ b/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, 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.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 left join negative n on w.negative_id = n.id ${ew.getCustomSqlSegment} diff --git a/src/main/resources/static/templates/信访投诉数据台账(模板).xlsx b/src/main/resources/static/templates/信访投诉数据台账(模板).xlsx index a92c687..56008b1 100644 Binary files a/src/main/resources/static/templates/信访投诉数据台账(模板).xlsx and b/src/main/resources/static/templates/信访投诉数据台账(模板).xlsx differ diff --git a/src/main/resources/static/templates/案件核查问题台账(模板).xlsx b/src/main/resources/static/templates/案件核查问题台账(模板).xlsx index a65f850..ea83085 100644 Binary files a/src/main/resources/static/templates/案件核查问题台账(模板).xlsx and b/src/main/resources/static/templates/案件核查问题台账(模板).xlsx differ