Compare commits

..

No commits in common. 'fe766a4b3ec62f181206d24107aba0e02b004b4e' and '17ed15f08e362adb62ae79a0619833b6e3b82169' have entirely different histories.

  1. 4
      src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java
  2. 2
      src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java
  3. 2
      src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java
  4. 2
      src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java
  5. 8
      src/main/java/com/biutag/supervision/pojo/entity/NegativeHistory.java
  6. 6
      src/main/java/com/biutag/supervision/service/MailBoxCaptureService.java
  7. 10
      src/main/java/com/biutag/supervision/service/NegativeQueryService.java
  8. 10
      src/main/java/com/biutag/supervision/service/NegativeService.java
  9. 4
      src/main/java/com/biutag/supervision/service/NegativeTaskService.java
  10. 72
      src/main/java/com/biutag/supervision/util/TimeUtil.java

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

@ -121,7 +121,7 @@ public class ConfirmationCompletionAction implements Action {
// 只有超过24小时工作日才记录
if (negative.getLatestProcessTime() != null) {
long newDuration = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
if (newDuration >= TimeUtil.getApprovalLockThreshold("branch")) {
if (newDuration >= TimeUtil.SECONDS_OF_A_DAY) {
updateWrapper.set(Negative::getSecondApprovalTime, newDuration);
}
}
@ -130,7 +130,7 @@ public class ConfirmationCompletionAction implements Action {
// 只有超过24小时工作日才记录
if (negative.getLatestProcessTime() != null) {
long newDuration = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
if (newDuration >= TimeUtil.getApprovalLockThreshold("city")) {
if (newDuration >= TimeUtil.SECONDS_OF_A_DAY) {
updateWrapper.set(Negative::getFirstApproveTime, newDuration);
}
}

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

@ -51,7 +51,7 @@ public class FirstApproveReturnAction implements Action {
// 只有超过24小时工作日才记录
if (negative.getLatestProcessTime() != null) {
long newDuration = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
if (newDuration >= TimeUtil.getApprovalLockThreshold("city")) {
if (newDuration >= TimeUtil.SECONDS_OF_A_DAY) {
newFirstApproveTime = newDuration;
}
}

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

@ -60,7 +60,7 @@ public class SecondApproveAction implements Action {
// 只有超过24小时工作日才记录
if (negative.getLatestProcessTime() != null) {
long newDuration = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
if (newDuration >= TimeUtil.getApprovalLockThreshold("branch")) {
if (newDuration >= TimeUtil.SECONDS_OF_A_DAY) {
updateWrapper.set(Negative::getSecondApprovalTime, newDuration);
}
}

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

@ -52,7 +52,7 @@ public class SecondApproveReturnAction implements Action {
// 只有超过24小时工作日才记录
if (negative.getLatestProcessTime() != null) {
long newDuration = TimeUtil.calculateWorkdayDuration(negative.getLatestProcessTime(), now);
if (newDuration >= TimeUtil.getApprovalLockThreshold("branch")) {
if (newDuration >= TimeUtil.SECONDS_OF_A_DAY) {
newSecondApprovalTime = newDuration;
}
}

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

@ -51,12 +51,4 @@ public class NegativeHistory {
// 节点耗时(剔除节假日的秒数)
private Long duration;
@TableField(exist = false)
private String departId;
@TableField(exist = false)
// 部门level
private Integer departLevel;
}

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

@ -618,9 +618,9 @@ public class MailBoxCaptureService {
dto.setCrtTime(mail.getMailTime());
dto.setProblemSourcesCode(ProblemSourcesEnum.JZXX.getValue());
dto.setProblemSources(ProblemSourcesEnum.JZXX.getLabel());
// 业务类型(执法办案
dto.setBusinessTypeCode(BusinessTypeEnum.ZFBA.getValue());
dto.setBusinessTypeName(BusinessTypeEnum.ZFBA.getLabel());
// 业务类型(其他
dto.setBusinessTypeCode(BusinessTypeEnum.QT.getValue());
dto.setBusinessTypeName(BusinessTypeEnum.QT.getLabel());
// 追责对象(涉及个人)
dto.setAccountabilityTarget(AccountabilityTargetEnum.PERSONAL.getValue());
// 反映人信息

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

@ -259,20 +259,18 @@ public class NegativeQueryService {
}
private void buildTimeoutCondition(LambdaQueryWrapper<Negative> queryWrapper, String status) {
Long cityThreshold = TimeUtil.getApprovalLockThreshold("city");
Long branchThreshold = TimeUtil.getApprovalLockThreshold("branch");
switch (status) {
case "city_timeout":
queryWrapper.gt(Negative::getFirstApproveTime, cityThreshold);
queryWrapper.gt(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY);
break;
case "city_normal":
queryWrapper.le(Negative::getFirstApproveTime, cityThreshold).or().isNull(Negative::getFirstApproveTime);
queryWrapper.le(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getFirstApproveTime);
break;
case "branch_timeout":
queryWrapper.gt(Negative::getSecondApprovalTime, branchThreshold);
queryWrapper.gt(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY);
break;
case "branch_normal":
queryWrapper.le(Negative::getSecondApprovalTime, branchThreshold).or().isNull(Negative::getSecondApprovalTime);
queryWrapper.le(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getSecondApprovalTime);
break;
}
}

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

@ -134,19 +134,11 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (StrUtil.isNotBlank(vo.getProblemSourcesCode())) {
vo.setFileClasses(fileClassService.list(vo.getProblemSourcesCode()));
}
// 计算每个节点的用时(剔除节假日),并回填部门ID 最多十几条记录 对性能影响不大,直接查
// 计算每个节点的用时(剔除节假日)
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));
if (StrUtil.isNotBlank(flows.get(i).getDepartName())) {
String departName = flows.get(i).getDepartName();
SupDepart depart = departService.getOne(new LambdaQueryWrapper<SupDepart>().and(wrapper -> wrapper.eq(SupDepart::getName, departName).or().eq(SupDepart::getShortName, departName)).last("LIMIT 1"));
if (Objects.nonNull(depart)) {
flows.get(i).setDepartId(depart.getId());
flows.get(i).setDepartLevel(depart.getLevel());
}
}
}
NegativeDetail detail = new NegativeDetail()
.setNegative(vo)

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

@ -225,8 +225,8 @@ public class NegativeTaskService extends ServiceImpl<NegativeTaskMapper, Negativ
fillBlameAndLeaderAges(blameVo);
blameVoList.add(blameVo);
}
vo.setFirstApproveTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getFirstApproveTime()), "city", true));
vo.setSecondApprovalTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getSecondApprovalTime()), "branch", true));
vo.setFirstApproveTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getFirstApproveTime())));
vo.setSecondApprovalTime(TimeUtil.getTimeoutStatus(NumberUtil.nullToZero(item.getSecondApprovalTime())));
return vo;
}).toList();
}

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

@ -4,9 +4,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.biutag.supervision.constants.enums.FlowNodeEnum;
import com.biutag.supervision.pojo.entity.SupDictData;
import com.biutag.supervision.service.HolidayService;
import com.biutag.supervision.service.SupDictDataService;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
@ -53,46 +51,7 @@ public class TimeUtil {
* @return true=可以更新false=已锁定不可更新>=86400秒
*/
public static boolean canUpdateApproveTime(Long currentDuration) {
return canUpdateApproveTime(currentDuration, null);
}
/**
* 判断审批时长是否可以更新
* @param currentDuration 当前审批时长null表示尚未开始计时
* @param dictValue 审批超时字典值branch=分局审批city=市局审批
* @return true=可以更新false=已锁定不可更新
*/
public static boolean canUpdateApproveTime(Long currentDuration, String dictValue) {
Long threshold = getApprovalLockThreshold(dictValue);
return currentDuration == null || currentDuration < threshold;
}
/**
* 读取审批超时锁定阈值
* @param dictValue 字典值branch=分局审批city=市局审批
* @return 阈值秒数读取失败时按默认值返回
*/
public static Long getApprovalLockThreshold(String dictValue) {
if (StrUtil.isBlank(dictValue)) {
return APPROVAL_LOCK_THRESHOLD;
}
try {
SupDictData dictData = SpringUtil.getBean(SupDictDataService.class)
.get("spscTime", dictValue);
if (dictData != null && StrUtil.isNotBlank(dictData.getDictValue())) {
long days = Long.parseLong(dictData.getDictValue());
return days * SECONDS_OF_A_DAY;
}
} catch (Exception e) {
// 字典读取失败时使用默认值,不影响流程
}
if ("city".equals(dictValue)) {
return 3L * SECONDS_OF_A_DAY;
}
if ("branch".equals(dictValue)) {
return 2L * SECONDS_OF_A_DAY;
}
return APPROVAL_LOCK_THRESHOLD;
return currentDuration == null || currentDuration < APPROVAL_LOCK_THRESHOLD;
}
/**
@ -259,33 +218,4 @@ public class TimeUtil {
}
}
/**
* 判断指定审批时长是否超时按审批层级阈值
* @param usedSeconds 已用审批时长
* @param dictValue 审批超时字典值branch=分局审批city=市局审批
* @return 未超时/已超时
*/
public static String getTimeoutStatus(long usedSeconds, String dictValue) {
return getTimeoutStatus(usedSeconds, dictValue, false);
}
/**
* 判断指定审批时长是否超时按审批层级阈值
* @param usedSeconds 已用审批时长
* @param dictValue 审批超时字典值branch=分局审批city=市局审批
* @param detail 是否展示超时明细
* @return 未超时 已超时/超时xx天xx时xx分
*/
public static String getTimeoutStatus(long usedSeconds, String dictValue, boolean detail) {
Long threshold = getApprovalLockThreshold(dictValue);
long diff = threshold - usedSeconds;
if (diff >= 0) {
return "未超时";
}
if (detail) {
return "已超时/超时" + formatDuration(-diff);
}
return "已超时";
}
}

Loading…
Cancel
Save