Browse Source

Merge branch 'master' into feature/tsjb-1.0

feature/tsjb-1.0
buaixuexideshitongxue 4 weeks ago
parent
commit
29660583e5
  1. 3
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  2. 10
      src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java
  3. 10
      src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java
  4. 11
      src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java
  5. 7
      src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java
  6. 19
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  7. 7
      src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java
  8. 4
      src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java
  9. 5
      src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java
  10. 9
      src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java
  11. 14
      src/main/java/com/biutag/supervision/pojo/vo/NegativeQueryVo.java
  12. 3
      src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java
  13. 1
      src/main/java/com/biutag/supervision/service/ModelClueService.java
  14. 31
      src/main/java/com/biutag/supervision/service/NegativeQueryService.java
  15. 4
      src/main/java/com/biutag/supervision/service/NegativeTaskService.java
  16. 8
      src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java
  17. 10
      src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java
  18. 11
      src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java
  19. 73
      src/main/java/com/biutag/supervision/util/TimeUtil.java

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

@ -70,7 +70,8 @@ public class ApplyCompletionAction implements Action {
.set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName())) .set(Negative::getCurrentProcessingObject, negative.getIsSecondHandle() ? "市局专班" : String.format("%s专班", negative.getHandleSecondDepartName()))
.set(Negative::getHandleTime, LocalDateTime.now()) .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()); .set(Negative::getVerifyTime, LocalDateTime.now())
.set(Negative::getLatestProcessTime, LocalDateTime.now());
negativeService.update(updateWrapper); negativeService.update(updateWrapper);
} }

10
src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java

@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.entity.NegativeScorePolice;
import com.biutag.supervision.pojo.entity.NegativeWork; import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.*; import com.biutag.supervision.service.*;
import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -98,6 +99,12 @@ public class ConfirmationCompletionAction implements Action {
} }
public void updateNegative(String negativeId, ConfirmationCompletionData completionData) { public void updateNegative(String negativeId, ConfirmationCompletionData completionData) {
Negative negative = negativeService.getById(negativeId);
LocalDateTime now = LocalDateTime.now();
Long firstApproveTime = negative.getFirstApproveTime() == null ? 0L : negative.getFirstApproveTime();
if (negative.getLatestProcessTime() != null) {
firstApproveTime = firstApproveTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
}
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.eq(Negative::getId, negativeId) .eq(Negative::getId, negativeId)
.set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
@ -107,7 +114,8 @@ public class ConfirmationCompletionAction implements Action {
.set(StrUtil.isNotEmpty(completionData.getReportId()),Negative::getReportId,completionData.getReportId()) .set(StrUtil.isNotEmpty(completionData.getReportId()),Negative::getReportId,completionData.getReportId())
.set(StrUtil.isNotEmpty(completionData.getReportNumber()),Negative::getReportNumber,completionData.getReportNumber()) .set(StrUtil.isNotEmpty(completionData.getReportNumber()),Negative::getReportNumber,completionData.getReportNumber())
.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) .set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey())
.set(Negative::getUpdTime, LocalDateTime.now()); .set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getFirstApproveTime, firstApproveTime);
negativeService.update(updateWrapper); negativeService.update(updateWrapper);
} }
public void doneWork(Integer workId, String negativeId) { public void doneWork(Integer workId, String negativeId) {

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

@ -14,6 +14,7 @@ import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeApproveService;
import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService; import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -44,12 +45,19 @@ public class FirstApproveReturnAction implements Action {
public void updateNegative(String negativeId, String nextFlowKey) { public void updateNegative(String negativeId, String nextFlowKey) {
Negative negative = negativeService.getById(negativeId); Negative negative = negativeService.getById(negativeId);
LocalDateTime now = LocalDateTime.now();
Long firstApproveTime = negative.getFirstApproveTime() == null ? 0L : negative.getFirstApproveTime();
if (negative.getLatestProcessTime() != null) {
firstApproveTime = firstApproveTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
}
negativeService.update(new LambdaUpdateWrapper<Negative>() negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.VERIFY.getKey() : nextFlowKey) .set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.VERIFY.getKey() : nextFlowKey)
.set(Negative::getUpdTime, LocalDateTime.now()) .set(Negative::getUpdTime, LocalDateTime.now())
// 当前处理对象 // 当前处理对象
.set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName())) .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleSecondDepartName()))
.eq(Negative::getId, negativeId)); .eq(Negative::getId, negativeId)
.set(Negative::getFirstApproveTime, firstApproveTime)
.set(Negative::getLatestProcessTime, now));
} }
public void addApprove(String negativeId, String comments, Integer workId) { public void addApprove(String negativeId, String comments, Integer workId) {

11
src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java

@ -15,6 +15,7 @@ import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeApproveService;
import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService; import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -50,17 +51,25 @@ public class SecondApproveAction implements Action {
} }
public void updateNegative(String negativeId, String nextFlowKey) { public void updateNegative(String negativeId, String nextFlowKey) {
Negative negative = negativeService.getById(negativeId);
LocalDateTime now = LocalDateTime.now();
Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime();
if (negative.getLatestProcessTime() != null) {
secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
}
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, nextFlowKey) .set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getUpdTime, LocalDateTime.now()) .set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getSecondApprovalTime, secondApprovalTime)
.eq(Negative::getId, negativeId); .eq(Negative::getId, negativeId);
Negative negative = negativeService.getById(negativeId); // Negative negative = negativeService.getById(negativeId);
if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) {
updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey())
.set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
.set(Negative::getCompleteDate, LocalDateTime.now()); .set(Negative::getCompleteDate, LocalDateTime.now());
} else { } else {
updateWrapper.set(Negative::getFlowKey, nextFlowKey) updateWrapper.set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getLatestProcessTime, now)
.set(Negative::getCurrentProcessingObject, "市局专班"); .set(Negative::getCurrentProcessingObject, "市局专班");
} }
negativeService.update(updateWrapper); negativeService.update(updateWrapper);

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

@ -15,6 +15,7 @@ import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.service.NegativeApproveService; import com.biutag.supervision.service.NegativeApproveService;
import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService; import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -45,12 +46,18 @@ public class SecondApproveReturnAction implements Action {
public void updateNegative(String negativeId, String nextFlowKey) { public void updateNegative(String negativeId, String nextFlowKey) {
Negative negative = negativeService.getById(negativeId); Negative negative = negativeService.getById(negativeId);
LocalDateTime now = LocalDateTime.now();
Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime();
if (negative.getLatestProcessTime() != null) {
secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
}
negativeService.update(new LambdaUpdateWrapper<Negative>() negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, nextFlowKey) .set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getUpdTime, LocalDateTime.now()) .set(Negative::getUpdTime, LocalDateTime.now())
.set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name()) .set(Negative::getProcessingStatus, ProcessingStatusEnum.processing.name())
// 当前处理对象 // 当前处理对象
.set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleThreeDepartName())) .set(Negative::getCurrentProcessingObject, String.format("%s专班", negative.getHandleThreeDepartName()))
.set(Negative::getSecondApprovalTime, secondApprovalTime)
.eq(Negative::getId, negativeId)); .eq(Negative::getId, negativeId));
} }

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

@ -370,4 +370,23 @@ public class Negative {
@Schema(description = "下发单位名字") @Schema(description = "下发单位名字")
@TableField("issuingDepartName") @TableField("issuingDepartName")
private String issuingDepartName; private String issuingDepartName;
/**
* 最后一次审批节点操作时间
*/
@TableField("latest_process_time")
private LocalDateTime latestProcessTime;
/**
* 2级审批累计时长
*/
@TableField("second_approval_time")
private Long secondApprovalTime;
/**
* 市局审批累计时长
*/
@TableField("first_approve_time")
private Long firstApproveTime;
} }

7
src/main/java/com/biutag/supervision/pojo/param/ComplaintCollection/ComplaintCollectionQueryParam.java

@ -2,6 +2,7 @@ package com.biutag.supervision.pojo.param.ComplaintCollection;
import com.biutag.supervision.pojo.enums.complaintCollection.ComplaintCollectionSourceTableEnum; import com.biutag.supervision.pojo.enums.complaintCollection.ComplaintCollectionSourceTableEnum;
import com.biutag.supervision.pojo.param.BasePage; import com.biutag.supervision.pojo.param.BasePage;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -112,6 +113,12 @@ public class ComplaintCollectionQueryParam extends BasePage {
private List<String> involveProblemIdList = new ArrayList<>(); private List<String> involveProblemIdList = new ArrayList<>();
@Schema(description = "录入时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private List<LocalDateTime> createTimeList = new ArrayList<>();
// @Schema(description = "部门ID集合") // @Schema(description = "部门ID集合")
// private Set<String> secondDepartIds; // private Set<String> secondDepartIds;

4
src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java

@ -117,6 +117,9 @@ public class NegativeQueryParam extends BasePage {
@TableField("issuingDepartName") @TableField("issuingDepartName")
private String issuingDepartName; private String issuingDepartName;
@Schema(description = "审批超时状态集合: city_timeout/city_normal/branch_timeout/branch_normal")
private List<String> approvalTimeoutStatus;
private UserAuth currentUser; private UserAuth currentUser;
@ -135,6 +138,7 @@ public class NegativeQueryParam extends BasePage {
target.setThreeLevelCode(this.threeLevelCode == null ? null : new ArrayList<>(this.threeLevelCode)); target.setThreeLevelCode(this.threeLevelCode == null ? null : new ArrayList<>(this.threeLevelCode));
target.setProblemSourcesCode(this.problemSourcesCode == null ? null : new ArrayList<>(this.problemSourcesCode)); target.setProblemSourcesCode(this.problemSourcesCode == null ? null : new ArrayList<>(this.problemSourcesCode));
target.setInvolveDepartIds(this.involveDepartIds == null ? null : Set.copyOf(this.involveDepartIds)); target.setInvolveDepartIds(this.involveDepartIds == null ? null : Set.copyOf(this.involveDepartIds));
target.setApprovalTimeoutStatus(this.approvalTimeoutStatus == null ? null : new ArrayList<>(this.approvalTimeoutStatus));
return target; return target;
} }

5
src/main/java/com/biutag/supervision/pojo/request/complaintCollection/ComplaintCollectionPageRequest.java

@ -82,6 +82,11 @@ public class ComplaintCollectionPageRequest extends BasePage implements ParamChe
@Schema(description = "涉嫌问题List") @Schema(description = "涉嫌问题List")
private List<String> involveProblemIdList = new ArrayList<>(); private List<String> involveProblemIdList = new ArrayList<>();
@Schema(description = "录入时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private List<LocalDateTime> createTimeList = new ArrayList<>();
@Override @Override
public void check() { public void check() {
if (CollectionUtil.isNotEmpty(discoveryTimeList)){ if (CollectionUtil.isNotEmpty(discoveryTimeList)){

9
src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeVo.java

@ -132,4 +132,13 @@ public class ExportNegativeVo {
@ExcelProperty({"","办理超时情况"}) @ExcelProperty({"","办理超时情况"})
private String handleTimeout; private String handleTimeout;
@ExcelProperty({"核办情况","分局审批时长"})
private String secondApprovalTime;
// 问题类型
@ExcelProperty({"核办情况","市局审批时长"})
private String firstApproveTime;
} }

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

@ -212,4 +212,18 @@ public class NegativeQueryVo {
@Schema(description = "二级部门ID") @Schema(description = "二级部门ID")
private String secondInvolveDepartId; private String secondInvolveDepartId;
@Schema(description = "最后一次审批节点操作时间")
@TableField("latest_process_time")
private LocalDateTime latestProcessTime;
@Schema(description = "2级审批累计时长(秒)")
@TableField("second_approval_time")
private Long secondApprovalTime;
@Schema(description = "市局审批累计时长(秒)")
@TableField("first_approve_time")
private Long firstApproveTime;
} }

3
src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java

@ -66,6 +66,9 @@ public class ComplaintCollectionResourceService extends BaseDAO {
&& param.getDiscoveryTimeList().get(1) != null) { && param.getDiscoveryTimeList().get(1) != null) {
qw.between(ComplaintCollection::getDiscoveryTime, param.getDiscoveryTimeList().get(0), param.getDiscoveryTimeList().get(1)); qw.between(ComplaintCollection::getDiscoveryTime, param.getDiscoveryTimeList().get(0), param.getDiscoveryTimeList().get(1));
} }
if (CollectionUtil.size(param.getCreateTimeList()) == 2){
qw.between(ComplaintCollection::getCreateTime, param.getCreateTimeList().get(0), param.getCreateTimeList().get(1));
}
// 来件人信息 // 来件人信息
if (StrUtil.isNotBlank(param.getPersonInfo())) { if (StrUtil.isNotBlank(param.getPersonInfo())) {
String kw = param.getPersonInfo(); String kw = param.getPersonInfo();

1
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -115,6 +115,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} }
// 手动下发 // 手动下发
@Transactional(rollbackFor = Exception.class)
public boolean distributionByManuel(ModelClueTaskDistribute taskDistribute) { public boolean distributionByManuel(ModelClueTaskDistribute taskDistribute) {
List<ModelClue> modelClues = taskDistribute.getModelClues(); List<ModelClue> modelClues = taskDistribute.getModelClues();
Model model = modelMapper.selectById(modelClues.get(0).getModelId()); Model model = modelMapper.selectById(modelClues.get(0).getModelId());

31
src/main/java/com/biutag/supervision/service/NegativeQueryService.java

@ -204,6 +204,20 @@ public class NegativeQueryService {
); );
queryWrapper.in(Negative::getProcessingStatus,List.of("completed", "approval")); queryWrapper.in(Negative::getProcessingStatus,List.of("completed", "approval"));
} }
// 审批超时查询(支持多选)
if (CollectionUtil.isNotEmpty(param.getApprovalTimeoutStatus())) {
queryWrapper.and(wrapper -> {
List<String> statuses = param.getApprovalTimeoutStatus();
for (int i = 0; i < statuses.size(); i++) {
String status = statuses.get(i);
if (i == 0) {
wrapper.and(q -> buildTimeoutCondition(q, status));
} else {
wrapper.or(q -> buildTimeoutCondition(q, status));
}
}
});
}
// 排序 // 排序
queryWrapper.orderBy("crtTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getCrtTime) queryWrapper.orderBy("crtTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getCrtTime)
.orderBy("discoveryTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getDiscoveryTime);; .orderBy("discoveryTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getDiscoveryTime);;
@ -223,4 +237,21 @@ public class NegativeQueryService {
return new Page<NegativeQueryVo>().setRecords(list).setTotal(page.getTotal()); return new Page<NegativeQueryVo>().setRecords(list).setTotal(page.getTotal());
} }
private void buildTimeoutCondition(LambdaQueryWrapper<Negative> queryWrapper, String status) {
switch (status) {
case "city_timeout":
queryWrapper.gt(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY);
break;
case "city_normal":
queryWrapper.le(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getFirstApproveTime);
break;
case "branch_timeout":
queryWrapper.gt(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY);
break;
case "branch_normal":
queryWrapper.le(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getSecondApprovalTime);
break;
}
}
} }

4
src/main/java/com/biutag/supervision/service/NegativeTaskService.java

@ -3,6 +3,7 @@ package com.biutag.supervision.service;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
@ -24,6 +25,7 @@ import com.biutag.supervision.pojo.vo.ExportNegativeBlameLeaderVo;
import com.biutag.supervision.pojo.vo.ExportNegativeBlameVo; import com.biutag.supervision.pojo.vo.ExportNegativeBlameVo;
import com.biutag.supervision.pojo.vo.ExportNegativeVo; import com.biutag.supervision.pojo.vo.ExportNegativeVo;
import com.biutag.supervision.pojo.vo.NegativeQueryVo; import com.biutag.supervision.pojo.vo.NegativeQueryVo;
import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
@ -204,6 +206,8 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
blameVoList.add(blameVo); blameVoList.add(blameVo);
} }
vo.setFirstApproveTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getFirstApproveTime())));
vo.setSecondApprovalTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getSecondApprovalTime())));
return vo; return vo;
}).toList(); }).toList();
} }

8
src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java

@ -421,7 +421,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
collectionUpdateParam.setStatus("1"); collectionUpdateParam.setStatus("1");
// 更新初核 // 更新初核
if (complaint.getGwf2() == null ) { if (complaint.getGwf2() == null ) {
LocalDateTime discoveryTime = complaint.getDiscoveryTime(); LocalDateTime discoveryTime = complaint.getCreateTime();
long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY;
long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds);
String initialReviewStatus = (remainingAtInitial < 0) ? String initialReviewStatus = (remainingAtInitial < 0) ?
@ -786,7 +786,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
ComplaintCollection complaintCollection = complaintCollectionList.get(0); ComplaintCollection complaintCollection = complaintCollectionList.get(0);
// 有附件 + 有核查情况 = 初核 // 有附件 + 有核查情况 = 初核
if (StrUtil.isBlank(complaintCollection.getGwf2()) && request.getCheckStatusCode() != null && CollectionUtil.isNotEmpty(request.getFiles())) { if (StrUtil.isBlank(complaintCollection.getGwf2()) && request.getCheckStatusCode() != null && CollectionUtil.isNotEmpty(request.getFiles())) {
LocalDateTime discoveryTime = complaintCollection.getDiscoveryTime(); LocalDateTime discoveryTime = complaintCollection.getCreateTime();
long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY;
long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds);
String initialReviewStatus = (remainingAtInitial < 0) ? String initialReviewStatus = (remainingAtInitial < 0) ?
@ -830,7 +830,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
complaintCollectionQueryParam.setId(request.getComplaintId()); complaintCollectionQueryParam.setId(request.getComplaintId());
List<ComplaintCollection> complaintCollectionList = complaintCollectionResourceService.query(complaintCollectionQueryParam); List<ComplaintCollection> complaintCollectionList = complaintCollectionResourceService.query(complaintCollectionQueryParam);
ComplaintCollection complaintCollection = complaintCollectionList.get(0); ComplaintCollection complaintCollection = complaintCollectionList.get(0);
LocalDateTime discoveryTime = complaintCollection.getDiscoveryTime(); LocalDateTime discoveryTime = complaintCollection.getCreateTime();
long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY; long maxSeconds = CHECK_LIMIT_DAYS * TimeUtil.SECONDS_OF_A_DAY;
long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds); long remainingAtInitial = TimeUtil.getRemainingDuration(discoveryTime, LocalDateTime.now(), maxSeconds);
String initialReviewStatus = (remainingAtInitial < 0) ? String initialReviewStatus = (remainingAtInitial < 0) ?
@ -1309,7 +1309,7 @@ public class ComplaintCollectionServiceImpl implements ComplaintCollectionServic
if (dto == null || StrUtil.isBlank(dto.getId())) { if (dto == null || StrUtil.isBlank(dto.getId())) {
return; return;
} }
LocalDateTime discoveryTime = dto.getDiscoveryTime(); LocalDateTime discoveryTime = dto.getCreateTime();
if (discoveryTime == null) { if (discoveryTime == null) {
dto.setRemainingDuration(null); dto.setRemainingDuration(null);
return; return;

10
src/main/java/com/biutag/supervision/service/datav/DatavServiceImpl.java

@ -421,15 +421,16 @@ public class DatavServiceImpl implements DatavService {
negativeQueryParam.setProblemSourcesCode(List.of(SPDC.getValue())); negativeQueryParam.setProblemSourcesCode(List.of(SPDC.getValue()));
negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime())); negativeQueryParam.setCrtTime(List.of(request.getBeginTime(), request.getEndTime()));
List<Negative> negatives = negativeResourceService.query(negativeQueryParam); List<Negative> negatives = negativeResourceService.query(negativeQueryParam);
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
// 使用统一的问责次数统计口径,便于核对大屏与导出逻辑差异 // 使用统一的问责次数统计口径,便于核对大屏与导出逻辑差异
AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives);
VideoSuperviseCountVo overview = new VideoSuperviseCountVo(); VideoSuperviseCountVo overview = new VideoSuperviseCountVo();
overview.setTotal(negatives.size()); overview.setTotal(negatives.size());
overview.setCompletionProblem((long) completedList.size()); overview.setCompletionProblem((long) completedList.size());
overview.setDiscoverProblem((long) ssList.size()); overview.setDiscoverProblem((long) njssList.size());
overview.setRelativeOrg(accountabilityCountResult.newUnitCount()); overview.setRelativeOrg(accountabilityCountResult.newUnitCount());
overview.setRelativePer(accountabilityCountResult.newPersonTotalCount()); overview.setRelativePer(accountabilityCountResult.newPersonTotalCount());
JSONObject data = new JSONObject().fluentPut("overview", overview); JSONObject data = new JSONObject().fluentPut("overview", overview);
@ -449,14 +450,15 @@ public class DatavServiceImpl implements DatavService {
for (SupDepart fxsj : fxsjDw) { for (SupDepart fxsj : fxsjDw) {
List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode); List<Negative> negatives = negativeMapper.getNegativeListData(fxsj.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
// 使用统一的问责次数统计口径,便于核对大屏与导出逻辑差异 // 使用统一的问责次数统计口径,便于核对大屏与导出逻辑差异
AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives);
VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo(); VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo();
videoSuperviseMapIconVo.setName(fxsj.getShortName()); videoSuperviseMapIconVo.setName(fxsj.getShortName());
videoSuperviseMapIconVo.setDepartId(fxsj.getId()); videoSuperviseMapIconVo.setDepartId(fxsj.getId());
videoSuperviseMapIconVo.setDiscoverProblem(ssList.size()); videoSuperviseMapIconVo.setDiscoverProblem(njssList.size());
videoSuperviseMapIconVo.setCompletionProblem(completedList.size()); videoSuperviseMapIconVo.setCompletionProblem(completedList.size());
videoSuperviseMapIconVo.setRelativeOrg(Math.toIntExact(accountabilityCountResult.newUnitCount())); videoSuperviseMapIconVo.setRelativeOrg(Math.toIntExact(accountabilityCountResult.newUnitCount()));
videoSuperviseMapIconVo.setRelativePer(Math.toIntExact(accountabilityCountResult.newPersonTotalCount())); videoSuperviseMapIconVo.setRelativePer(Math.toIntExact(accountabilityCountResult.newPersonTotalCount()));

11
src/main/java/com/biutag/supervision/service/subDatav/SubDatavServiceImpl.java

@ -471,15 +471,16 @@ public class SubDatavServiceImpl implements SubDatavService {
@Override @Override
public Result<JSONObject> getSubOneAllVideoSuperviseCount(SubDataVRequest request) { public Result<JSONObject> getSubOneAllVideoSuperviseCount(SubDataVRequest request) {
List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), List.of(SPDC.getValue())); List<Negative> negatives = negativeMapper.getNegativeListData(request.getDepartId(), request.getBeginTime(), request.getEndTime(), List.of(SPDC.getValue()));
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
List<Negative> njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
// 与 DatavServiceImpl 保持一致:按“有效问题 + 多处理结果拆分 + negativeId/对象/处理结果去重”的口径统计。 // 与 DatavServiceImpl 保持一致:按“有效问题 + 多处理结果拆分 + negativeId/对象/处理结果去重”的口径统计。
AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives);
VideoSuperviseCountVo overview = new VideoSuperviseCountVo(); VideoSuperviseCountVo overview = new VideoSuperviseCountVo();
overview.setTotal(negatives.size()); overview.setTotal(negatives.size());
overview.setCompletionProblem((long) completedList.size()); overview.setCompletionProblem((long) completedList.size());
overview.setDiscoverProblem((long) ssList.size()); overview.setDiscoverProblem((long) njssList.size());
overview.setRelativeOrg(accountabilityCountResult.newUnitCount()); overview.setRelativeOrg(accountabilityCountResult.newUnitCount());
overview.setRelativePer(accountabilityCountResult.newPersonTotalCount()); overview.setRelativePer(accountabilityCountResult.newPersonTotalCount());
JSONObject data = new JSONObject().fluentPut("overview", overview); JSONObject data = new JSONObject().fluentPut("overview", overview);
@ -503,15 +504,15 @@ public class SubDatavServiceImpl implements SubDatavService {
List<Negative> negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), proCode); List<Negative> negatives = negativeMapper.getNegativeListData(pcs.getId(), request.getBeginTime(), request.getEndTime(), proCode);
List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList(); // List<Negative> ssList = negatives.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList(); List<Negative> completedList = negatives.stream().filter(item -> ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).toList();
// 与 DatavServiceImpl 保持一致:按“有效问题 + 多处理结果拆分 + negativeId/对象/处理结果去重”的口径统计。 // 与 DatavServiceImpl 保持一致:按“有效问题 + 多处理结果拆分 + negativeId/对象/处理结果去重”的口径统计。
AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives); AccountabilityCountUtil.AccountabilityCountResult accountabilityCountResult = accountabilityCountUtil.buildAccountabilityCountResult(negatives);
List<Negative> njssList = completedList.stream().filter(one -> CheckStatusEnum.TRUE_SET.contains(one.getCheckStatusCode()) || CheckStatusEnum.PART_TRUE_SET.contains(one.getCheckStatusCode())).toList();
VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo(); VideoSuperviseMapIconVo videoSuperviseMapIconVo = new VideoSuperviseMapIconVo();
videoSuperviseMapIconVo.setName(pcs.getShortName()); videoSuperviseMapIconVo.setName(pcs.getShortName());
videoSuperviseMapIconVo.setDepartId(pcs.getId()); videoSuperviseMapIconVo.setDepartId(pcs.getId());
videoSuperviseMapIconVo.setDiscoverProblem(ssList.size()); videoSuperviseMapIconVo.setDiscoverProblem(njssList.size());
videoSuperviseMapIconVo.setCompletionProblem(completedList.size()); videoSuperviseMapIconVo.setCompletionProblem(completedList.size());
videoSuperviseMapIconVo.setRelativeOrg(Math.toIntExact(accountabilityCountResult.newUnitCount())); videoSuperviseMapIconVo.setRelativeOrg(Math.toIntExact(accountabilityCountResult.newUnitCount()));
videoSuperviseMapIconVo.setRelativePer(Math.toIntExact(accountabilityCountResult.newPersonTotalCount())); videoSuperviseMapIconVo.setRelativePer(Math.toIntExact(accountabilityCountResult.newPersonTotalCount()));

73
src/main/java/com/biutag/supervision/util/TimeUtil.java

@ -109,4 +109,77 @@ public class TimeUtil {
public static String formatDate(Date date) { public static String formatDate(Date date) {
return new SimpleDateFormat("yyyy年MM月dd日").format(date); return new SimpleDateFormat("yyyy年MM月dd日").format(date);
} }
/**
* 计算两个时间之间的工作日时长
* @param beginTime 开始时间
* @param endTime 结束时间
* @return 工作日时长
*/
public static long calculateWorkdayDuration(LocalDateTime beginTime, LocalDateTime endTime) {
if (Objects.isNull(beginTime) || Objects.isNull(endTime)) {
return 0;
}
HolidayService holidayService = SpringUtil.getBean(HolidayService.class);
long duration = 0;
for (LocalDateTime time = beginTime; time.isBefore(endTime.with(LocalTime.MAX)); time = time.plusDays(1)) {
if (holidayService.isHoliday(DatePattern.NORM_DATE_FORMATTER.format(time))) {
continue;
}
if (beginTime.toLocalDate().equals(endTime.toLocalDate())) {
duration += ChronoUnit.SECONDS.between(beginTime, endTime);
} else if (time.equals(beginTime)) {
duration += ChronoUnit.SECONDS.between(time, time.with(LocalTime.MAX));
} else if (time.toLocalDate().equals(endTime.toLocalDate())) {
duration += ChronoUnit.SECONDS.between(time.with(LocalTime.MIN), endTime);
} else {
duration += SECONDS_OF_A_DAY;
}
}
return duration;
}
/**
* 将秒数格式化为时分秒字符串
* @param seconds 秒数
* @return 时分秒字符串2时30分15秒15分30秒45秒
*/
public static String formatDuration(long seconds) {
if (seconds <= 0) {
return "0";
}
// 秒
if (seconds < 60) {
return seconds + "秒";
}
// 分钟
if (seconds < 3600) {
return (seconds / 60) + "分" + (seconds % 60) + "秒";
}
// 小时
if (seconds < 86400) {
return (seconds / 3600) + "时" + ((seconds % 3600) / 60) + "分";
}
// 天
return (seconds / 86400) + "天" + ((seconds % 86400) / 3600) + "时";
}
/**
* 判断指定时长是否超时 1 天为边界
* @param usedSeconds 已用时长例如从任务开始到现在的总耗时
* @return 格式"未超时/剩余时分秒" "已超时/超出时分秒"
* 剩余/超出时长通过 {@link #formatDuration(long)} 格式化
*/
public static String getTimeoutStatus(long usedSeconds) {
long limit = SECONDS_OF_A_DAY; // 86400秒 = 1天
long diff = limit - usedSeconds; // diff > 0 表示剩余时间,diff < 0 表示超出时间
if (diff >= 0) {
return "未超时/用时:" + formatDuration(usedSeconds);
} else {
return "已超时/用时:" + formatDuration(usedSeconds);
}
}
} }

Loading…
Cancel
Save