Browse Source

Merge branch 'master' into feature/tsjb-1.0

# Conflicts:
#	src/main/java/com/biutag/supervision/service/complaintCollection/ComplaintCollectionServiceImpl.java
feature/tsjb-1.0
buaixuexideshitongxue 3 weeks ago
parent
commit
a942dca81e
  1. 10
      src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java
  2. 19
      src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java
  3. 9
      src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java
  4. 12
      src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java
  5. 9
      src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java
  6. 2
      src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java
  7. 4
      src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java
  8. 28
      src/main/java/com/biutag/supervision/pojo/request/modelClue/ModelCheckUntrueRequest.java
  9. 9
      src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java
  10. 5
      src/main/java/com/biutag/supervision/service/NegativeQueryService.java
  11. 6
      src/main/java/com/biutag/supervision/service/NegativeService.java
  12. 8
      src/main/java/com/biutag/supervision/service/NegativeTaskService.java
  13. 16
      src/main/java/com/biutag/supervision/util/TimeUtil.java

10
src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java

@ -8,7 +8,9 @@ import com.biutag.supervision.pojo.dto.ModelClueTaskDistribute;
import com.biutag.supervision.pojo.entity.ModelClue; import com.biutag.supervision.pojo.entity.ModelClue;
import com.biutag.supervision.pojo.model.ModelClueModel; import com.biutag.supervision.pojo.model.ModelClueModel;
import com.biutag.supervision.pojo.param.ModelClueQueryParam; import com.biutag.supervision.pojo.param.ModelClueQueryParam;
import com.biutag.supervision.pojo.request.modelClue.ModelCheckUntrueRequest;
import com.biutag.supervision.service.ModelClueService; import com.biutag.supervision.service.ModelClueService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -55,4 +57,12 @@ public class ModelClueController {
return Result.success(modelClueService.update(updateWrapper)); return Result.success(modelClueService.update(updateWrapper));
} }
@Operation(description = "查否|恢复接口")
@PostMapping("/checkUntrue")
public Result<Boolean> checkUntrue(@RequestBody ModelCheckUntrueRequest request ) {
LambdaUpdateWrapper<ModelClue> updateWrapper = new LambdaUpdateWrapper<ModelClue>()
.eq(ModelClue::getId, request.getId())
.set(ModelClue::getDistributionState, request.getDistributionState());
return Result.success(modelClueService.update(updateWrapper));
}
} }

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

@ -107,13 +107,14 @@ public class ConfirmationCompletionAction implements Action {
public void updateNegative(String negativeId, ConfirmationCompletionData completionData) { public void updateNegative(String negativeId, ConfirmationCompletionData completionData) {
Negative negative = negativeService.getById(negativeId); Negative negative = negativeService.getById(negativeId);
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Long firstApproveTime = negative.getFirstApproveTime() == null ? 0L : negative.getFirstApproveTime(); Long firstApproveTime = negative.getFirstApproveTime();
if (negative.getLatestProcessTime() != null) { // 覆盖制:每次重新计算,超时锁定则不更新
firstApproveTime = firstApproveTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); if (TimeUtil.canUpdateApproveTime(firstApproveTime) && negative.getLatestProcessTime() != null) {
firstApproveTime = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
} }
Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime(); Long secondApprovalTime = negative.getSecondApprovalTime();
if (negative.getLatestProcessTime() != null) { if (TimeUtil.canUpdateApproveTime(secondApprovalTime) && negative.getLatestProcessTime() != null) {
secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); secondApprovalTime = 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)
@ -126,11 +127,17 @@ public class ConfirmationCompletionAction implements Action {
.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey()) .set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey())
.set(Negative::getUpdTime, LocalDateTime.now()); .set(Negative::getUpdTime, LocalDateTime.now());
if ("2".equals(negative.getApprovalFlow())){ if ("2".equals(negative.getApprovalFlow())){
// 超时锁定时,不更新审批时长字段
if (TimeUtil.canUpdateApproveTime(secondApprovalTime)) {
updateWrapper.set(Negative::getSecondApprovalTime, secondApprovalTime); updateWrapper.set(Negative::getSecondApprovalTime, secondApprovalTime);
} }
}
if ("3".equals(negative.getApprovalFlow())){ if ("3".equals(negative.getApprovalFlow())){
// 超时锁定时,不更新审批时长字段
if (TimeUtil.canUpdateApproveTime(firstApproveTime)) {
updateWrapper.set(Negative::getFirstApproveTime, firstApproveTime); updateWrapper.set(Negative::getFirstApproveTime, firstApproveTime);
} }
}
negativeService.update(updateWrapper); negativeService.update(updateWrapper);
} }
public void doneWork(Integer workId, String negativeId) { public void doneWork(Integer workId, String negativeId) {

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

@ -46,9 +46,10 @@ 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(); LocalDateTime now = LocalDateTime.now();
Long firstApproveTime = negative.getFirstApproveTime() == null ? 0L : negative.getFirstApproveTime(); Long firstApproveTime = negative.getFirstApproveTime();
if (negative.getLatestProcessTime() != null) { // 覆盖制:每次重新计算,超时锁定则不更新
firstApproveTime = firstApproveTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); if (TimeUtil.canUpdateApproveTime(firstApproveTime) && negative.getLatestProcessTime() != null) {
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)
@ -56,7 +57,7 @@ public class FirstApproveReturnAction implements Action {
// 当前处理对象 // 当前处理对象
.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(TimeUtil.canUpdateApproveTime(firstApproveTime), Negative::getFirstApproveTime, firstApproveTime)
.set(Negative::getLatestProcessTime, now)); .set(Negative::getLatestProcessTime, now));
} }

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

@ -53,15 +53,19 @@ public class SecondApproveAction 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(); LocalDateTime now = LocalDateTime.now();
Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime(); Long secondApprovalTime = negative.getSecondApprovalTime();
if (negative.getLatestProcessTime() != null) { // 覆盖制:每次重新计算,超时锁定则不更新
secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); if (TimeUtil.canUpdateApproveTime(secondApprovalTime) && negative.getLatestProcessTime() != null) {
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);
// 超时锁定时,不更新审批时长字段
if (TimeUtil.canUpdateApproveTime(secondApprovalTime)) {
updateWrapper.set(Negative::getSecondApprovalTime, secondApprovalTime);
}
// 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())

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

@ -47,9 +47,10 @@ 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(); LocalDateTime now = LocalDateTime.now();
Long secondApprovalTime = negative.getSecondApprovalTime() == null ? 0L : negative.getSecondApprovalTime(); Long secondApprovalTime = negative.getSecondApprovalTime();
if (negative.getLatestProcessTime() != null) { // 覆盖制:每次重新计算,超时锁定则不更新
secondApprovalTime = secondApprovalTime + TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now); if (TimeUtil.canUpdateApproveTime(secondApprovalTime) && negative.getLatestProcessTime() != null) {
secondApprovalTime = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
} }
negativeService.update(new LambdaUpdateWrapper<Negative>() negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, nextFlowKey) .set(Negative::getFlowKey, nextFlowKey)
@ -57,7 +58,7 @@ public class SecondApproveReturnAction implements Action {
.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) .set(TimeUtil.canUpdateApproveTime(secondApprovalTime), Negative::getSecondApprovalTime, secondApprovalTime)
.eq(Negative::getId, negativeId)); .eq(Negative::getId, negativeId));
} }

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

@ -41,7 +41,7 @@ public class ModelClue {
@TableField("thing_desc") @TableField("thing_desc")
private String thingDesc; private String thingDesc;
// 状态 默认 0-未分发 1-已分发 2-已处理 // 状态 默认 0-未分发 1-已分发 2-已处理 3-查否
@TableField("distribution_state") @TableField("distribution_state")
private String distributionState; private String distributionState;

4
src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java

@ -47,4 +47,8 @@ public class NegativeHistory {
private String departName; private String departName;
@TableField(exist = false)
// 节点耗时(剔除节假日的秒数)
private Long duration;
} }

28
src/main/java/com/biutag/supervision/pojo/request/modelClue/ModelCheckUntrueRequest.java

@ -0,0 +1,28 @@
package com.biutag.supervision.pojo.request.modelClue;
import com.biutag.supervision.aop.ParamChecked;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Schema(description = "查否请求")
@Getter
@Setter
public class ModelCheckUntrueRequest implements ParamChecked {
@Schema(description = "线索id")
private String id;
@Schema(description = "变更的状态")
private String distributionState;
@Override
public void check() {
if (distributionState == null) {
throw new IllegalArgumentException("请检查要变更的状态");
}
if (id == null) {
throw new IllegalArgumentException("线索id为空");
}
}
}

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

@ -104,4 +104,13 @@ public class ExportNegativeBlameVo {
// 问题类型 // 问题类型
@ExcelProperty({"问题类型"}) @ExcelProperty({"问题类型"})
private String problemType; private String problemType;
@ExcelProperty("督察措施")
private String superviseMeasuresName;
@ExcelProperty({"禁闭时长"})
private String confinementTime;
} }

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

@ -70,7 +70,10 @@ public class NegativeQueryService {
// 案件编号 // 案件编号
.like(StrUtil.isNotBlank(param.getCaseNumber()), Negative::getCaseNumber, param.getCaseNumber()) .like(StrUtil.isNotBlank(param.getCaseNumber()), Negative::getCaseNumber, param.getCaseNumber())
// 内容 // 内容
.like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) // .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc())
.and(StrUtil.isNotBlank(param.getThingDesc()), (qw) -> {
qw.like(Negative::getThingDesc, param.getThingDesc()).or().like(Negative::getCheckStatusDesc, param.getThingDesc());
})
// 问题来源 // 问题来源
.in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode()) .in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode())
// 业务类型 // 业务类型

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

@ -129,6 +129,12 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (StrUtil.isNotBlank(vo.getProblemSourcesCode())) { if (StrUtil.isNotBlank(vo.getProblemSourcesCode())) {
vo.setFileClasses(fileClassService.list(vo.getProblemSourcesCode())); vo.setFileClasses(fileClassService.list(vo.getProblemSourcesCode()));
} }
// 计算每个节点的用时(剔除节假日)
for (int i = 0; i < flows.size(); i++) {
LocalDateTime currentTime = flows.get(i).getCrtTime();
LocalDateTime previousTime = i == 0 ? negative.getCrtTime() : flows.get(i - 1).getCrtTime();
flows.get(i).setDuration(TimeUtil.calculateWorkdayDuration(previousTime, currentTime));
}
NegativeDetail detail = new NegativeDetail() NegativeDetail detail = new NegativeDetail()
.setNegative(vo) .setNegative(vo)
.setActionHistory(flows) .setActionHistory(flows)

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

@ -63,6 +63,8 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
private final NegativeBlameService blameService; private final NegativeBlameService blameService;
private final ConfinementService confinementService;
public Page<NegativeTask> page(NegativeTaskQueryParam param) { public Page<NegativeTask> page(NegativeTaskQueryParam param) {
LambdaQueryWrapper<NegativeTask> queryWrapper = new LambdaQueryWrapper<NegativeTask>() LambdaQueryWrapper<NegativeTask> queryWrapper = new LambdaQueryWrapper<NegativeTask>()
@ -203,7 +205,11 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
if(AccountabilityTargetEnum.PERSONAL_AND_DEPARTMENT.getLabel().equals(blameVo.getAccountabilityTarget())){ if(AccountabilityTargetEnum.PERSONAL_AND_DEPARTMENT.getLabel().equals(blameVo.getAccountabilityTarget())){
blameVo.setAccountabilityTarget(BlameType.personal.name().equals(negativeBlame.getType())?"涉及个人": "涉及单位"); blameVo.setAccountabilityTarget(BlameType.personal.name().equals(negativeBlame.getType())?"涉及个人": "涉及单位");
} }
String confinementId = negativeBlame.getConfinementId();
Confinement confinement = confinementService.getById(confinementId);
if (confinement != null) {
blameVo.setConfinementTime(confinement.getConfinementTime());
}
blameVoList.add(blameVo); blameVoList.add(blameVo);
} }
vo.setFirstApproveTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getFirstApproveTime()))); vo.setFirstApproveTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getFirstApproveTime())));

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

@ -18,6 +18,18 @@ public class TimeUtil {
// 一天86400秒 // 一天86400秒
public static final Long SECONDS_OF_A_DAY = 86400L; public static final Long SECONDS_OF_A_DAY = 86400L;
// 超时锁定阈值(秒),超过此值则不再更新审批时长
public static final Long APPROVAL_LOCK_THRESHOLD = SECONDS_OF_A_DAY;
/**
* 判断审批时长是否可以更新
* @param currentDuration 当前审批时长null表示尚未开始计时
* @return true=可以更新false=已锁定不可更新>=86400秒
*/
public static boolean canUpdateApproveTime(Long currentDuration) {
return currentDuration == null || currentDuration < APPROVAL_LOCK_THRESHOLD;
}
/** /**
* *
* @param beginTime * @param beginTime
@ -176,9 +188,9 @@ public class TimeUtil {
long limit = SECONDS_OF_A_DAY; // 86400秒 = 1天 long limit = SECONDS_OF_A_DAY; // 86400秒 = 1天
long diff = limit - usedSeconds; // diff > 0 表示剩余时间,diff < 0 表示超出时间 long diff = limit - usedSeconds; // diff > 0 表示剩余时间,diff < 0 表示超出时间
if (diff >= 0) { if (diff >= 0) {
return "未超时/用时:" + formatDuration(usedSeconds); return "未超时";
} else { } else {
return "已超时/用时:" + formatDuration(usedSeconds); return "已超时";
} }
} }

Loading…
Cancel
Save