Browse Source

Merge remote-tracking branch 'origin/master'

main
不爱学习的石同学 12 months ago
parent
commit
24bf283451
  1. 5
      sql/20241217.sql
  2. 6
      src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java
  3. 9
      src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java
  4. 20
      src/main/java/com/biutag/supervision/job/Job.java
  5. 9
      src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java
  6. 3
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  7. 1
      src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java
  8. 3
      src/main/java/com/biutag/supervision/service/AlarmNotificationService.java
  9. 2
      src/main/resources/mapper/ProfilePoliceMapper.xml
  10. 3
      src/main/resources/mapper/RiskPersonalMapper.xml
  11. BIN
      src/main/resources/static/templates/《处理反馈表》.doc

5
sql/20241217.sql

@ -0,0 +1,5 @@
ALTER TABLE `negative`.`negative`
ADD COLUMN `handle_time` datetime NULL COMMENT '申请办结时间' AFTER `handle_timeout`;
ALTER TABLE `negative`.`alarm_notification`
ADD COLUMN `reply_limit` int NULL COMMENT '通知回复时限' AFTER `request_reply`;

6
src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java

@ -6,10 +6,12 @@ import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.AlarmFile;
import com.biutag.supervision.pojo.entity.AlarmNotification;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.enums.NotificationType;
import com.biutag.supervision.pojo.param.AlarmParam;
import com.biutag.supervision.service.AlarmNotificationService;
import com.biutag.supervision.service.ProblemSourceService;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -36,6 +38,8 @@ public class AlarmNotificationController {
private final AlarmNotificationService notificationService;
private final SupDepartService departService;
/**
* 预警通知分页查询
* @param param 请求参数
@ -92,6 +96,8 @@ public class AlarmNotificationController {
}
String alarmType = Optional.ofNullable(NotificationType.contains(data.getAlarmTypeId()))
.orElseThrow(() -> new RuntimeException("未知提醒类型"));
SupDepart depart = departService.getById(data.getNotificationDepartId());
data.setNotificationDepartName(depart.getShortName());
data.setAlarmTime(LocalDateTime.now());
data.setAlarmType(alarmType);
data.setReplyState(0);

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

@ -11,6 +11,7 @@ import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.VerifyData;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.service.*;
import com.biutag.supervision.util.TimeUtil;
import jakarta.validation.Validator;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@ -55,13 +56,17 @@ public class ApplyCompletionAction implements Action {
// 是否是本级办理
negative.getIsSecondHandle() ? RoleCodeEnum.FIRST_ADMIN.getCode() : RoleCodeEnum.SECOND_ADMIN.getCode(),
negative);
addApprove(negative);
Long remainingDuration = TimeUtil.getRemainingDuration(negative.getFirstDistributeTime(), negative.getMaxSignDuration(), negative.getMaxHandleDuration(), negative.getExtensionDays(), negative.getFlowKey());
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.eq(Negative::getId, actionDto.getNegativeId())
.set(Negative::getFlowKey, negative.getIsSecondHandle() ? FlowNodeEnum.FIRST_APPROVE.getKey() : FlowNodeEnum.SECOND_APPROVE.getKey())
// 当前处理对象
.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::getHandleTimeout, Objects.isNull(remainingDuration) || remainingDuration >= 0 ? 0 : -remainingDuration);
negativeService.update(updateWrapper);
}

20
src/main/java/com/biutag/supervision/job/Job.java

@ -1,5 +1,6 @@
package com.biutag.supervision.job;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
@ -17,6 +18,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static com.biutag.supervision.util.TimeUtil.SECONDS_OF_A_DAY;
@RequiredArgsConstructor
@Component
public class Job {
@ -63,19 +66,20 @@ public class Job {
}
// 更新办理超时
// @Scheduled(fixedRate = 600000)
@Scheduled(fixedRate = 600000)
public void updateHandleTimeout() {
List<Negative> list = negativeService.list(new LambdaQueryWrapper<Negative>()
.isNotNull(Negative::getCompleteDate)
.isNotNull(Negative::getCrtTime)
.isNull(Negative::getFlowKey));
.isNotNull(Negative::getMaxHandleDuration)
.isNotNull(Negative::getMaxExtensionDuration)
.eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
.isNull(Negative::getHandleTimeout));
list.forEach(item -> {
long remainingDuration = TimeUtil.getRemainingDuration(item.getCrtTime(), item.getCompleteDate(), 3 * 24 * 60 * 60L);
if (remainingDuration < 0) {
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getHandleTimeout, -remainingDuration)
.eq(Negative::getId, item.getId()));
}
long remainingDuration = TimeUtil.getRemainingDuration(item.getCrtTime(), item.getCompleteDate(), NumberUtil.mul(item.getMaxHandleDuration(), SECONDS_OF_A_DAY).longValue()) + NumberUtil.mul(item.getMaxExtensionDuration(), SECONDS_OF_A_DAY).longValue();
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getHandleTimeout, remainingDuration >= 0 ? 0: -remainingDuration)
.eq(Negative::getId, item.getId()));
});
}

9
src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java

@ -46,12 +46,6 @@ public class AlarmNotification implements Serializable {
@TableField("`alarm_type`")
String alarmType;
/**
* 被通知单位机构代码
*/
@TableField("`notification_depart_code`")
String notificationDepartCode;
/**
* 被通知单位ID
*/
@ -160,4 +154,7 @@ public class AlarmNotification implements Serializable {
@TableField(exist = false)
List<AlarmFile> files;
// 通知回复时限
private Integer replyLimit;
}

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

@ -252,6 +252,9 @@ public class Negative {
// 办理超时(秒)
private Long handleTimeout;
// 申请办结时间
private LocalDateTime handleTime;
// 当前处理对象
private String currentProcessingObject;

1
src/main/java/com/biutag/supervision/pojo/model/PoliceNegativeModel.java

@ -29,6 +29,7 @@ public class PoliceNegativeModel {
// 查实问题数
private Integer verifySize;
private String departName;
private String departId;
private String parentDepartName;
private BigDecimal score;

3
src/main/java/com/biutag/supervision/service/AlarmNotificationService.java

@ -49,9 +49,6 @@ public class AlarmNotificationService extends ServiceImpl<AlarmNotificationMappe
if(param.getReplyState() != null && param.getReplyState() != -1) {
query.eq(AlarmNotification::getReplyState, param.getReplyState());
}
if(param.getNotificationDepartCode() != null) {
query.eq(AlarmNotification::getNotificationDepartCode, param.getNotificationDepartCode());
}
if(param.getAlarmContent() != null) {
query.like(AlarmNotification::getAlarmContent, param.getAlarmContent());
}

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

@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.employment_date,
p.person_type,
d.short_name depart_name,
d.id depart_id,
d1.short_name parent_depart_name,
count( DISTINCT n.negative_id ) verify_size,
pc.score
@ -47,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.position,
p.person_type,
d.short_name,
d.id,
d1.short_name,
pc.score
ORDER BY

3
src/main/resources/mapper/RiskPersonalMapper.xml

@ -13,7 +13,8 @@
p.mobile_number,
p.tags,
p.risk_score,
p.control_depart_name
p.control_depart_name,
p.control_depart_id
FROM
risk_personal p
<choose>

BIN
src/main/resources/static/templates/《处理反馈表》.doc

Binary file not shown.
Loading…
Cancel
Save