Browse Source

fit: 优化完善

master
wxc 4 months ago
parent
commit
80c6cab898
  1. 16
      src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java
  2. 84
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  3. 125
      src/main/java/com/biutag/supervision/flow/action/SaveAction.java
  4. 9
      src/main/java/com/biutag/supervision/flow/action/ThreeSignReturnAction.java
  5. 4
      src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java
  6. 2
      src/main/resources/mapper/DataPetition12337Mapper.xml

16
src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java

@ -2,23 +2,22 @@ package com.biutag.supervision.controller.books;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.metadata.data.ImageData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.*;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*;
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.param.NegativeQueryParam;
import com.biutag.supervision.pojo.vo.*;
import com.biutag.supervision.service.*;
import com.biutag.supervision.util.DownloadAndZip;
import com.biutag.supervision.util.ImgUtils;
import dm.jdbc.util.StringUtil;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
@ -28,11 +27,12 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.*;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@ -254,6 +254,10 @@ public class NegativeBookController {
item.setVerificationMobile(handlePolices.stream()
.filter(handlePolice -> StrUtil.isNotBlank(handlePolice.getName())).map(VerifyData.HandlePolice::getMobile).collect(Collectors.joining("、")));
}
// 核查时间
if (Objects.nonNull(item.getVerifyTime())) {
item.setReviewTime(item.getVerifyTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")));
}
// 是否核查完结
item.setVerifiedIsover(overProcessings.contains(item.getProcessingStatus()) ? "核查完结" : null);
// 是否处分处理

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

@ -69,7 +69,8 @@ public class ApplyCompletionAction implements Action {
// 当前处理对象
.set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName()))
.set(Negative::getHandleTime, LocalDateTime.now())
.set(Negative::getHandleTimeout, Objects.isNull(remainingDuration) || remainingDuration >= 0 ? 0 : -remainingDuration);
.set(Negative::getHandleTimeout, Objects.isNull(remainingDuration) || remainingDuration >= 0 ? 0 : -remainingDuration)
.set(Negative::getVerifyTime, LocalDateTime.now());
negativeService.update(updateWrapper);
}
@ -79,20 +80,37 @@ public class ApplyCompletionAction implements Action {
.eq(Negative::getId, negative.getId())
.set(Negative::getUpdTime, now)
.set(Negative::getCheckStatus, verifyData.getCheckStatus())
.set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc())
.set(Negative::getCheckStatusName, verifyData.getCheckStatusName())
.set(Negative::getIsRectifyCode, verifyData.getIsRectifyCode())
.set(Negative::getIsRectifyName, verifyData.getIsRectifyName())
.set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc())
.set(Negative::getAccountabilityTarget, verifyData.getAccountabilityTarget())
.set(Negative::getCaseNumber, verifyData.getCaseNumber())
.set(Negative::getRectifyDesc, verifyData.getRectifyDesc())
.set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId())
.set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason())
.set(Negative::getInvolveDepartName, departService.getById(verifyData.getInvolveDepartId()).getShortName())
.set(Negative::getResolveSituation, verifyData.getResolveSituation())
.set(Negative::getResolveStatus, verifyData.getResolveStatus())
.set(Negative::getVisitingLeaderName, verifyData.getVisitingLeaderName())
.set(Negative::getVisitingLeaderEmpNo, verifyData.getVisitingLeaderEmpNo());
// 属实
if (InspectCaseEnum.isItTure(verifyData.getCheckStatus())) {
updateWrapper
.set(Negative::getIsRectifyCode, verifyData.getIsRectifyCode())
.set(Negative::getIsRectifyName, verifyData.getIsRectifyName())
.set(Negative::getRectifyDesc, verifyData.getRectifyDesc())
.set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason());
// 未整改
if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) {
updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays());
}
}
// 不属实
else {
updateWrapper
.set(Negative::getIsRectifyCode, null)
.set(Negative::getIsRectifyName, null)
.set(Negative::getRectifyDesc, null)
.set(Negative::getUnrectifyReason, null)
.set(Negative::getRectifyRestrictionDays, null);
}
// 经办人
if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices().stream().filter(item -> StrUtil.isNotBlank(item.getName())).toList())) {
updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices()));
@ -108,10 +126,6 @@ public class ApplyCompletionAction implements Action {
} else {
throw new RuntimeException("涉及单位请选择二级或三级单位");
}
// 未整改
if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) {
updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays());
}
negativeService.update(updateWrapper);
if (!verifyData.getBlames().isEmpty()) {
@ -125,36 +139,36 @@ public class ApplyCompletionAction implements Action {
List<NegativeBlame> negativeBlames = blames.stream().map(item -> {
NegativeBlame negativeBlame = new NegativeBlame();
BeanUtil.copyProperties(item, negativeBlame);
if (CollectionUtil.isNotEmpty(item.getHandleResultCode())) {
negativeBlame.setHandleResultCode(String.join(",", item.getHandleResultCode()));
}
List<VerifyData.BlameLeader> blameLeaders = verifyData.getBlameLeaders().stream()
.filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode()))
.toList();
if(!blameLeaders.isEmpty()) {
BeanUtil.copyProperties(blameLeaders.get(0), negativeBlame);
if (CollectionUtil.isNotEmpty(blameLeaders.get(0).getLeadHandleResultCode())) {
negativeBlame.setLeadHandleResultCode(String.join(",", blameLeaders.get(0).getLeadHandleResultCode()));
}
}
negativeBlame
.setBlameId(IdUtil.getSnowflakeNextIdStr())
.setNegativeId(negative.getId())
.setCrtTime(now)
.setUpdTime(now);
if (CollectionUtil.isNotEmpty(item.getHandleResultCode())) {
negativeBlame.setHandleResultCode(String.join(",", item.getHandleResultCode()));
// 属实
if (InspectCaseEnum.isItTure(verifyData.getCheckStatus())) {
if (CollectionUtil.isNotEmpty(item.getHandleResultCode())) {
negativeBlame.setHandleResultCode(String.join(",", item.getHandleResultCode()));
}
List<VerifyData.BlameLeader> blameLeaders = verifyData.getBlameLeaders().stream()
.filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode()))
.toList();
if(!blameLeaders.isEmpty()) {
BeanUtil.copyProperties(blameLeaders.get(0), negativeBlame);
if (CollectionUtil.isNotEmpty(blameLeaders.get(0).getLeadHandleResultCode())) {
negativeBlame.setLeadHandleResultCode(String.join(",", blameLeaders.get(0).getLeadHandleResultCode()));
}
}
problemRelations.addAll(item.getProblems().stream().filter(problem -> StrUtil.isNotBlank(problem.getOneLevelCode())).map(problem -> {
NegativeProblemRelation problemRelation = new NegativeProblemRelation();
BeanUtil.copyProperties(problem, problemRelation);
problemRelation.setId(IdUtil.fastSimpleUUID());
problemRelation.setBlameId(negativeBlame.getBlameId());
problemRelation.setNegativeId(negative.getId());
return problemRelation;
}).toList());
} else {
negativeBlame.setHandleResultCode(null).setLeadHandleResultCode(null);
}
problemRelations.addAll(item.getProblems().stream().filter(problem -> StrUtil.isNotBlank(problem.getOneLevelCode())).map(problem -> {
NegativeProblemRelation problemRelation = new NegativeProblemRelation();
BeanUtil.copyProperties(problem, problemRelation);
problemRelation.setId(IdUtil.fastSimpleUUID());
problemRelation.setBlameId(negativeBlame.getBlameId());
problemRelation.setNegativeId(negative.getId());
return problemRelation;
}).toList());
return negativeBlame;
}).toList();
// 先删除
@ -164,6 +178,7 @@ public class ApplyCompletionAction implements Action {
// 新增涉及人员问题类型
// 先删除
negativeProblemRelationService.remove(negative.getId());
if (!problemRelations.isEmpty()) {
// 新增
negativeProblemRelationService.saveBatch(problemRelations);
@ -175,7 +190,6 @@ public class ApplyCompletionAction implements Action {
// 新增
fileService.saveBatch(verifyData.getFiles(), negative.getId());
}
}
public void addApprove(Negative negative) {

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

@ -1,29 +1,13 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.constants.enums.InspectCaseEnum;
import com.biutag.supervision.constants.enums.IsRectifyEnum;
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.NegativeProblemRelation;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.service.*;
import com.biutag.supervision.util.JSON;
import com.biutag.supervision.service.NegativeService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 核查办理-保存
*/
@ -33,114 +17,13 @@ public class SaveAction implements Action {
private final NegativeService negativeService;
private final NegativeBlameService negativeBlameService;
private final NegativeProblemRelationService negativeProblemRelationService;
private final NegativeFileService fileService;
private final SupDepartService departService;
private final ApplyCompletionAction applyCompletionAction;
@Override
public void next(ActionDto actionDto) {
VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class);
updateNegative(actionDto.getNegativeId(), verifyData);
}
public void updateNegative(String negativeId, VerifyData verifyData) {
if (StrUtil.isBlank(verifyData.getInvolveDepartId())) {
throw new RuntimeException("涉及单位不能为空!");
}
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.eq(Negative::getId, negativeId)
.set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getCaseNumber, verifyData.getCaseNumber())
.set(Negative::getCheckStatus, verifyData.getCheckStatus())
.set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc())
.set(Negative::getRectifyDesc, verifyData.getRectifyDesc())
.set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason())
.set(Negative::getCheckStatusName, verifyData.getCheckStatusName())
.set(Negative::getResolveSituation, verifyData.getResolveSituation())
.set(Negative::getResolveStatus, verifyData.getResolveStatus())
.set(Negative::getVisitingLeaderName, verifyData.getVisitingLeaderName())
.set(Negative::getVisitingLeaderEmpNo, verifyData.getVisitingLeaderEmpNo());
// 经办人
if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices().stream().filter(item -> StrUtil.isNotBlank(item.getName())).toList())) {
updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices()));
}
// 涉及单位
SupDepart depart = departService.getById(verifyData.getInvolveDepartId());
updateWrapper.set(Negative::getInvolveDepartId, verifyData.getInvolveDepartId())
.set(Negative::getInvolveDepartName, depart.getShortName());
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) {
updateWrapper.set(Negative::getSecondInvolveDepartId, depart.getId())
.set(Negative::getThreeInvolveDepartId, null);
} else if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) {
updateWrapper.set(Negative::getSecondInvolveDepartId, depart.getPid())
.set(Negative::getThreeInvolveDepartId, depart.getId());
} else {
throw new RuntimeException("涉及单位请选择二级或三级单位");
}
// 核查情况是否属实
if (InspectCaseEnum.isItTure(verifyData.getCheckStatus())) {
updateWrapper.set(Negative::getIsRectifyCode, verifyData.getIsRectifyCode())
.set(Negative::getIsRectifyName, verifyData.getIsRectifyName())
.set(Negative::getAccountabilityTarget, verifyData.getAccountabilityTarget());
// 未整改
if (IsRectifyEnum.NOT.getValue().equals(verifyData.getIsRectifyCode())) {
updateWrapper.set(Negative::getRectifyRestrictionDays, verifyData.getRectifyRestrictionDays());
}
}
negativeService.update(updateWrapper);
/**
* 如果涉及不为空则先删除原有数据再新增
*/
negativeBlameService.remove(negativeId);
negativeProblemRelationService.remove(negativeId);
if (!verifyData.getBlames().isEmpty()) {
List<NegativeProblemRelation> problemRelations = new ArrayList<>();
List<NegativeBlame> negativeBlames = verifyData.getBlames().stream().map(item -> {
NegativeBlame negativeBlame = new NegativeBlame();
BeanUtil.copyProperties(item, negativeBlame);
if (CollectionUtil.isNotEmpty(item.getHandleResultCode())) {
negativeBlame.setHandleResultCode(String.join(",", item.getHandleResultCode()));
} else {
negativeBlame.setHandleResultCode(null);
}
VerifyData.BlameLeader blameLeader = verifyData.getBlameLeaders().stream()
.filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode())).findFirst().orElse(null);
if (Objects.nonNull(blameLeader)) {
BeanUtil.copyProperties(blameLeader, negativeBlame);
if (CollectionUtil.isNotEmpty(blameLeader.getLeadHandleResultCode())) {
negativeBlame.setLeadHandleResultCode(String.join(",", blameLeader.getLeadHandleResultCode()));
} else {
negativeBlame.setLeadHandleResultCode(null);
}
}
negativeBlame.setNegativeId(negativeId)
.setBlameId(IdUtil.getSnowflakeNextIdStr())
.setCrtTime(LocalDateTime.now())
.setUpdTime(LocalDateTime.now());
problemRelations.addAll(item.getProblems().stream().map(problem -> {
NegativeProblemRelation problemRelation = new NegativeProblemRelation();
BeanUtil.copyProperties(problem, problemRelation);
problemRelation.setId(IdUtil.fastSimpleUUID());
problemRelation.setBlameId(negativeBlame.getBlameId());
problemRelation.setNegativeId(negativeId);
return problemRelation;
}).toList());
return negativeBlame;
}).toList();
// 新增涉及人员
negativeBlameService.saveBatch(negativeBlames);
// 新增涉及人员问题类型
if (!problemRelations.isEmpty()) {
negativeProblemRelationService.saveBatch(problemRelations);
}
}
fileService.remove(negativeId);
fileService.saveBatch(verifyData.getFiles(), negativeId);
Negative negative = negativeService.getById(actionDto.getNegativeId());
applyCompletionAction.updateNegative(negative, verifyData);
}
}

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

@ -101,21 +101,22 @@ public class ThreeSignReturnAction implements Action {
public void addWork(String negativeId, boolean secondFlag) {
String roleCode = secondFlag ? RoleCodeEnum.SECOND_ADMIN.getCode() : RoleCodeEnum.FIRST_ADMIN.getCode();
Negative negative = negativeService.getById(negativeId);
String departId = secondFlag ? negative.getHandleSecondDepartId() : AppConstants.ROOT_DEPART_ID;
String departName = secondFlag ? negative.getHandleSecondDepartName() : AppConstants.ROOT_DEPART_NAME;
NegativeWork work = workService.getOne(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getDepartId, negative.getHandleSecondDepartId())
.eq(NegativeWork::getDepartId, departId)
.eq(NegativeWork::getRoleCode, roleCode));
if (Objects.nonNull(work)) {
work.setUpdateTime(LocalDateTime.now())
.setStatus(WorkStatusEnum.todo.name());
workService.updateById(work);
} else {
work = new NegativeWork()
.setNegativeId(negativeId)
.setRoleCode(roleCode)
.setDepartId(secondFlag ? negative.getHandleSecondDepartId() : AppConstants.ROOT_DEPART_ID)
.setDepartName(secondFlag ? negative.getHandleSecondDepartName() : AppConstants.ROOT_DEPART_NAME)
.setDepartId(departId)
.setDepartName(departName)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())

4
src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java

@ -256,6 +256,10 @@ public class DataPetition12337ExportVo implements Serializable {
@ExcelProperty("核查时间")
private String reviewTime;
// 核查时间
@ExcelIgnore
private LocalDateTime verifyTime;
/**
* 核查单位
*/

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

@ -168,7 +168,7 @@
<select id="queryPageExport" resultType="com.biutag.supervision.pojo.vo.DataPetition12337ExportVo">
SELECT
p.*, n.handle_second_depart_name, n.handle_polices, n.check_status_desc, n.checkStatus, n.checkStatusName, n.id, n.processing_status,
n.accountability_target, n.handle_result12337, n.handle_result12337_group
n.accountability_target, n.handle_result12337, n.handle_result12337_group, n.verify_time
FROM
data_petition_12337 p left join negative n on p.only_id = n.originId
${ew.getCustomSqlSegment}

Loading…
Cancel
Save