Browse Source

fix: 完善首页提醒通知待办

fit: 新增市局下发意见
main
wxc 12 months ago
parent
commit
0dccd8c7c1
  1. 7
      sql/241206.sql
  2. 18
      src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java
  3. 13
      src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java
  4. 2
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  5. 46
      src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java
  6. 2
      src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java
  7. 1
      src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java
  8. 3
      src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java
  9. 3
      src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java
  10. 9
      src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java
  11. 3
      src/main/java/com/biutag/supervision/pojo/entity/Negative.java
  12. 20
      src/main/java/com/biutag/supervision/service/AlarmNotificationService.java
  13. 3
      src/main/java/com/biutag/supervision/service/SupPoliceService.java

7
sql/241206.sql

@ -0,0 +1,7 @@
ALTER TABLE `negative`.`negative`
ADD COLUMN `first_distribute_comments` text NULL COMMENT '市局下发意见' AFTER `crt_depart_level`;
ALTER TABLE `negative`.`alarm_notification`
ADD COLUMN `notification_depart_id` varchar(40) COMMENT '被通知单位ID' AFTER `notification_depart_name`,
ADD COLUMN `request_reply` tinyint NULL DEFAULT 1 COMMENT '是否要求回复';

18
src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java

@ -0,0 +1,18 @@
package com.biutag.supervision.constants.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wxc
* @date 2024/12/7
*/
@AllArgsConstructor
public enum ReplyStateEnum {
UN_REPLIED("0"),
REPLIED("1");
@Getter
private String value;
}

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

@ -46,6 +46,16 @@ public class AlarmNotificationController {
return Result.success(notificationService.pages(param));
}
/**
* 预警通知分页查询
* @param param 请求参数
* @return 预警通知分页数据
*/
@PostMapping("/pages/todo")
public Result<Page<AlarmNotification>> pageByTodo(@RequestBody AlarmParam param) {
return Result.success(notificationService.pageByTodo(param));
}
/**
* 回复内容
* @param data 数据
@ -77,9 +87,6 @@ public class AlarmNotificationController {
if(Objects.isNull(data.getAlarmTypeId())) {
return Result.failed(5000, "请选择提醒类型");
}
if(Objects.isNull(data.getNotificationDepartCode())) {
return Result.failed(5000, "请选择要提醒单位");
}
if(Objects.isNull(data.getAlarmContent())) {
return Result.failed(5000, "请填写要提醒内容");
}

2
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -95,7 +95,7 @@ public class NegativeController {
.set(Negative::getSpecialSupervision, negativeDto.getSpecialSupervision())
.set(Negative::getReportNumber, negativeDto.getReportNumber())
.set(Negative::getInvolveDepartId, negativeDto.getInvolveDepartId())
.set(Negative::getInvolveDepartName, negativeDto.getResponderName())
.set(Negative::getInvolveDepartName, negativeDto.getInvolveDepartName())
.set(Negative::getUpdUser, UserContextHolder.getCurrentUser().getNickName())
.set(Negative::getUpdTime, LocalDateTime.now());
if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) {

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

@ -39,23 +39,15 @@ public class ConfirmationCompletionAction implements Action {
public void next(ActionDto actionDto) {
ConfirmationCompletionData completionData = BeanUtil.toBean(actionDto.getData(), ConfirmationCompletionData.class);
String negativeId = actionDto.getNegativeId();
updateNegative(negativeId, completionData);
//addNegativeScorePolice(negativeId, completionData);
updateApprove(negativeId, completionData.getCompletionComment(), actionDto.getWorkId());
doneWork(actionDto.getWorkId());
// 最后更新状态
updateNegative(negativeId, completionData);
}
public void updateNegative(String negativeId, ConfirmationCompletionData completionData) {
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.eq(Negative::getId, negativeId)
.set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
.set(Negative::getVerifySituation, completionData.getVerifySituation())
.set(Negative::getVerifyFileSituation, completionData.getVerifyFileSituation())
.set(Negative::getCompleteDate, LocalDateTime.now())
.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey())
.set(Negative::getUpdTime, LocalDateTime.now());
negativeService.update(updateWrapper);
}
public void addNegativeScorePolice(String negativeId, ConfirmationCompletionData completionData) {
String formula = "%s + (1 * %s) + (1 * %s)";
@ -85,15 +77,27 @@ public class ConfirmationCompletionAction implements Action {
Negative negative = negativeService.getById(negativeId);
NegativeWork work = workService.getById(workId);
approveService.update(new LambdaUpdateWrapper<NegativeApprove>()
.set(NegativeApprove::getState, ApproveStateEnum.approved.name())
.set(NegativeApprove::getComments, comments)
.set(NegativeApprove::getHandlerDepartId, work.getDepartId())
.set(NegativeApprove::getHandlerDepartName, work.getDepartName())
.set(NegativeApprove::getHandlerUserName, user.getUserName())
.set(NegativeApprove::getHandlerName, user.getNickName())
.set(NegativeApprove::getUpdateTime, LocalDateTime.now())
.eq(NegativeApprove::getNegativeId, negativeId)
.eq(NegativeApprove::getActionKey, negative.getFlowKey()));
.eq(NegativeApprove::getNegativeId, negativeId)
.eq(NegativeApprove::getActionKey, negative.getFlowKey())
.set(NegativeApprove::getState, ApproveStateEnum.approved.name())
.set(NegativeApprove::getComments, comments)
.set(NegativeApprove::getHandlerDepartId, work.getDepartId())
.set(NegativeApprove::getHandlerDepartName, work.getDepartName())
.set(NegativeApprove::getHandlerUserName, user.getUserName())
.set(NegativeApprove::getHandlerName, user.getNickName())
.set(NegativeApprove::getUpdateTime, LocalDateTime.now()));
}
public void updateNegative(String negativeId, ConfirmationCompletionData completionData) {
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.eq(Negative::getId, negativeId)
.set(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name())
.set(Negative::getVerifySituation, completionData.getVerifySituation())
.set(Negative::getVerifyFileSituation, completionData.getVerifyFileSituation())
.set(Negative::getCompleteDate, LocalDateTime.now())
.set(Negative::getFlowKey, FlowNodeEnum.COMPLETED.getKey())
.set(Negative::getUpdTime, LocalDateTime.now());
negativeService.update(updateWrapper);
}
public void doneWork(Integer workId) {
LambdaUpdateWrapper<NegativeWork> updateWrapper = new LambdaUpdateWrapper<NegativeWork>()

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

@ -60,6 +60,8 @@ public class FirstDistributeAction implements Action {
.set(Negative::getCurrentProcessingObject, String.format("%s专班", distributeData.getDepartName()))
.set(Negative::getFirstDistributeTime, now)
.set(Negative::getUpdTime, now)
// 市局下发意见
.set(Negative::getFirstDistributeComments, distributeData.getFirstDistributeComments())
.eq(Negative::getId, negativeId);
if (TimeLimitEnum.OTHER.getValue().equals(distributeData.getTimeLimit())) {
updateWrapper.set(Negative::getMaxSignDuration, distributeData.getMaxSignDuration())

1
src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java

@ -32,7 +32,6 @@ public class SecondSignAction implements Action {
negativeService.update(new LambdaUpdateWrapper<Negative>()
.set(Negative::getFlowKey, nextFlowKey)
.set(Negative::getUpdTime, LocalDateTime.now())
.eq(Negative::getId, negativeId));
}

3
src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java

@ -189,6 +189,9 @@ public class NegativeVo {
// 单位会签ID
private Integer countersignApplyId;
// 市局下发意见
private String firstDistributeComments;
// 涉及人员
private List<Blame> blames = new ArrayList<>();

3
src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java

@ -34,4 +34,7 @@ public class FirstDistributeData {
// 最大延期时长(天)
private Integer maxExtensionDuration;
// 市局下发意见
private String firstDistributeComments;
}

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

@ -52,6 +52,12 @@ public class AlarmNotification implements Serializable {
@TableField("`notification_depart_code`")
String notificationDepartCode;
/**
* 被通知单位ID
*/
@TableField("`notification_depart_id`")
String notificationDepartId;
/**
* 被通知单位机构名称
*/
@ -148,6 +154,9 @@ public class AlarmNotification implements Serializable {
Integer del;
// 是否要求回复
private Boolean requestReply;
@TableField(exist = false)
List<AlarmFile> files;

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

@ -273,4 +273,7 @@ public class Negative {
// 创建单位层级 (默认为市局)
private Integer crtDepartLevel;
// 市局下发意见
private String firstDistributeComments;
}

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

@ -3,10 +3,15 @@ package com.biutag.supervision.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.constants.enums.ReplyStateEnum;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.mapper.AlarmNotificationMapper;
import com.biutag.supervision.pojo.entity.AlarmFile;
import com.biutag.supervision.pojo.entity.AlarmNotification;
import com.biutag.supervision.pojo.entity.BaseUser;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.model.UserModel;
import com.biutag.supervision.pojo.param.AlarmParam;
import lombok.AllArgsConstructor;
@ -50,6 +55,21 @@ public class AlarmNotificationService extends ServiceImpl<AlarmNotificationMappe
if(param.getAlarmContent() != null) {
query.like(AlarmNotification::getAlarmContent, param.getAlarmContent());
}
UserAuth user = UserContextHolder.getCurrentUser();
if (!user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()) && !AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) {
query.in(AlarmNotification::getNotificationDepartName, user.getAuthDepartIds());
}
return page(Page.of(param.getCurrent(), param.getSize()), query.orderByDesc(AlarmNotification::getAlarmTime));
}
public Page<AlarmNotification> pageByTodo(AlarmParam param) {
UserAuth user = UserContextHolder.getCurrentUser();
if (user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()) || AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) {
return new Page<AlarmNotification>().setRecords(new ArrayList<>()).setTotal(0);
}
LambdaQueryWrapper<AlarmNotification> query = new LambdaQueryWrapper<AlarmNotification>()
.in(AlarmNotification::getNotificationDepartId, user.getAuthDepartIds())
.eq(AlarmNotification::getReplyState, ReplyStateEnum.UN_REPLIED.getValue());
return page(Page.of(param.getCurrent(), param.getSize()), query.orderByDesc(AlarmNotification::getAlarmTime));
}

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

@ -67,8 +67,7 @@ public class SupPoliceService extends ServiceImpl<SupPoliceMapper, SupPolice> {
}
}
}
queryWrapper.orderByDesc("field(p.position,'副职','正职')");
queryWrapper.orderByAsc("d.level").orderByDesc("p.position").orderByDesc("p.sort_id").orderByAsc("p.person_status");
queryWrapper.orderByAsc("p.position_level").orderByDesc("p.position").orderByAsc("p.sort_id").orderByAsc("d.order_no").orderByAsc("p.person_status");
return baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
}

Loading…
Cancel
Save