diff --git a/sql/241206.sql b/sql/241206.sql new file mode 100644 index 0000000..5379b8e --- /dev/null +++ b/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 '是否要求回复'; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ReplyStateEnum.java new file mode 100644 index 0000000..9ed9621 --- /dev/null +++ b/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; +} diff --git a/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java b/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java index e81ad46..18ad74d 100644 --- a/src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java +++ b/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> 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, "请填写要提醒内容"); } diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeController.java index 9c66090..f4edbca 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeController.java +++ b/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())) { diff --git a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java index 68b8716..fc4bfdf 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java +++ b/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 updateWrapper = new LambdaUpdateWrapper() - .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() - .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 updateWrapper = new LambdaUpdateWrapper() + .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 updateWrapper = new LambdaUpdateWrapper() diff --git a/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java b/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java index 2e0cefd..7384514 100644 --- a/src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java +++ b/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()) diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java index 0468684..000c290 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondSignAction.java @@ -32,7 +32,6 @@ public class SecondSignAction implements Action { negativeService.update(new LambdaUpdateWrapper() .set(Negative::getFlowKey, nextFlowKey) .set(Negative::getUpdTime, LocalDateTime.now()) - .eq(Negative::getId, negativeId)); } diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java index fa379e4..51a3867 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java +++ b/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 blames = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java b/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java index cd1ca8f..431f283 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/flow/FirstDistributeData.java @@ -34,4 +34,7 @@ public class FirstDistributeData { // 最大延期时长(天) private Integer maxExtensionDuration; + // 市局下发意见 + private String firstDistributeComments; + } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java b/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java index 702907e..1735cd8 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java +++ b/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 files; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java index 1862ed1..5d55040 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -273,4 +273,7 @@ public class Negative { // 创建单位层级 (默认为市局) private Integer crtDepartLevel; + // 市局下发意见 + private String firstDistributeComments; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java b/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java index 2752428..c8eb66a 100644 --- a/src/main/java/com/biutag/supervision/service/AlarmNotificationService.java +++ b/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 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().setRecords(new ArrayList<>()).setTotal(0); + } + LambdaQueryWrapper query = new LambdaQueryWrapper() + .in(AlarmNotification::getNotificationDepartId, user.getAuthDepartIds()) + .eq(AlarmNotification::getReplyState, ReplyStateEnum.UN_REPLIED.getValue()); return page(Page.of(param.getCurrent(), param.getSize()), query.orderByDesc(AlarmNotification::getAlarmTime)); } diff --git a/src/main/java/com/biutag/supervision/service/SupPoliceService.java b/src/main/java/com/biutag/supervision/service/SupPoliceService.java index 8156bed..8e995e7 100644 --- a/src/main/java/com/biutag/supervision/service/SupPoliceService.java +++ b/src/main/java/com/biutag/supervision/service/SupPoliceService.java @@ -67,8 +67,7 @@ public class SupPoliceService extends ServiceImpl { } } } - 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); }