|
|
@@ -172,9 +172,12 @@ public class IotRyImproveDailyReportServiceImpl implements IotRyImproveDailyRepo
|
|
|
}
|
|
|
// 更新
|
|
|
IotRyImproveDailyReportDO updateObj = BeanUtils.toBean(updateReqVO, IotRyImproveDailyReportDO.class);
|
|
|
- // 提交 待审批
|
|
|
- updateObj.setStatus(1);
|
|
|
- updateObj.setAuditStatus(10);
|
|
|
+ if (!"Y".equals(updateReqVO.getModifyFlag())) {
|
|
|
+ // 日报管理员修改日报 不修改状态 不审批
|
|
|
+ // 提交 待审批
|
|
|
+ updateObj.setStatus(1);
|
|
|
+ updateObj.setAuditStatus(10);
|
|
|
+ }
|
|
|
iotRyImproveDailyReportMapper.updateById(updateObj);
|
|
|
|
|
|
// 更新生成动态明细 先删除 再新增
|
|
|
@@ -194,64 +197,67 @@ public class IotRyImproveDailyReportServiceImpl implements IotRyImproveDailyRepo
|
|
|
|
|
|
// 钉钉 站内信 提醒项目部人员审批
|
|
|
// 查找当前登录人的上级项目部审批人 发送审批通知
|
|
|
- DataPermissionUtils.executeIgnore(() -> {
|
|
|
- // 伊拉克项目部公共账号 填报 在当前部门内部查找 具有 审批权限 ‘项目部日报审批RY’ ‘项目部日报审批RYXJ’ 的人员
|
|
|
- Set<Long> projectIds = new HashSet<>();
|
|
|
- projectIds.add(dept.getId());
|
|
|
- List<AdminUserDO> receivedMsgUsers = adminUserService.getUserListByDeptIds(projectIds);
|
|
|
- if (CollUtil.isNotEmpty(receivedMsgUsers)) {
|
|
|
- Set<Long> userIds = new HashSet<>();
|
|
|
- receivedMsgUsers.forEach(user -> {
|
|
|
- userIds.add(user.getId());
|
|
|
- });
|
|
|
- RoleDO role = roleService.getRoleByCode("项目部日报审批RY");
|
|
|
- RoleDO xjRole = roleService.getRoleByCode("项目部日报审批RYXJ");
|
|
|
- if (ObjUtil.isNotEmpty(role) || ObjUtil.isNotEmpty(xjRole)) {
|
|
|
- Set<Long> roleIds = new HashSet<>();
|
|
|
- if (ObjUtil.isNotEmpty(role)) {
|
|
|
- roleIds.add(role.getId());
|
|
|
- }
|
|
|
- if (ObjUtil.isNotEmpty(xjRole)) {
|
|
|
- roleIds.add(xjRole.getId());
|
|
|
- }
|
|
|
- List<UserRoleDO> userRoles = userRoleMapper.selectListByRoleIds(roleIds);
|
|
|
- if (CollUtil.isNotEmpty(userRoles)) {
|
|
|
- // 提取有审批角色的所有用户ID(去重+空值过滤)
|
|
|
- Set<Long> roleUserIds = userRoles.stream()
|
|
|
- .map(UserRoleDO::getUserId)
|
|
|
- .filter(Objects::nonNull) // 过滤空userId
|
|
|
- .collect(Collectors.toSet());
|
|
|
- // 计算两个集合的交集,得到最终目标用户ID
|
|
|
- Set<Long> targetUserIds = userIds.stream()
|
|
|
- .filter(roleUserIds::contains)
|
|
|
- .collect(Collectors.toSet());
|
|
|
- if (CollUtil.isNotEmpty(targetUserIds)) {
|
|
|
- Map<Long, AdminUserRespDTO> users = adminUserApi.getUserMap(targetUserIds);
|
|
|
- if (CollUtil.isNotEmpty(users)) {
|
|
|
- String msgTitle = updateObj.getTitle();
|
|
|
- CountDownLatch latch = new CountDownLatch(users.size());
|
|
|
- String finalMsgTitle = msgTitle;
|
|
|
- String constant = PmsConstants.RY_IMPROVE_DAILY_REPORT_APPROVAL;
|
|
|
- users.forEach((userId, user) -> {
|
|
|
- pmsThreadPoolTaskExecutor.execute(() -> {
|
|
|
- try {
|
|
|
- String mobile = user.getMobile();
|
|
|
- // 没有手机号也可以发送站内信消息
|
|
|
- if (StrUtil.isNotBlank(finalMsgTitle)) {
|
|
|
- pmsMessage.sendMessage(updateObj.getId(), finalMsgTitle, constant,
|
|
|
- userId, mobile);
|
|
|
+ // 日报管理员修改日报 不修改状态 不审批
|
|
|
+ if (!"Y".equals(updateReqVO.getModifyFlag())) {
|
|
|
+ DataPermissionUtils.executeIgnore(() -> {
|
|
|
+ // 伊拉克项目部公共账号 填报 在当前部门内部查找 具有 审批权限 ‘项目部日报审批RY’ ‘项目部日报审批RYXJ’ 的人员
|
|
|
+ Set<Long> projectIds = new HashSet<>();
|
|
|
+ projectIds.add(dept.getId());
|
|
|
+ List<AdminUserDO> receivedMsgUsers = adminUserService.getUserListByDeptIds(projectIds);
|
|
|
+ if (CollUtil.isNotEmpty(receivedMsgUsers)) {
|
|
|
+ Set<Long> userIds = new HashSet<>();
|
|
|
+ receivedMsgUsers.forEach(user -> {
|
|
|
+ userIds.add(user.getId());
|
|
|
+ });
|
|
|
+ RoleDO role = roleService.getRoleByCode("项目部日报审批RY");
|
|
|
+ RoleDO xjRole = roleService.getRoleByCode("项目部日报审批RYXJ");
|
|
|
+ if (ObjUtil.isNotEmpty(role) || ObjUtil.isNotEmpty(xjRole)) {
|
|
|
+ Set<Long> roleIds = new HashSet<>();
|
|
|
+ if (ObjUtil.isNotEmpty(role)) {
|
|
|
+ roleIds.add(role.getId());
|
|
|
+ }
|
|
|
+ if (ObjUtil.isNotEmpty(xjRole)) {
|
|
|
+ roleIds.add(xjRole.getId());
|
|
|
+ }
|
|
|
+ List<UserRoleDO> userRoles = userRoleMapper.selectListByRoleIds(roleIds);
|
|
|
+ if (CollUtil.isNotEmpty(userRoles)) {
|
|
|
+ // 提取有审批角色的所有用户ID(去重+空值过滤)
|
|
|
+ Set<Long> roleUserIds = userRoles.stream()
|
|
|
+ .map(UserRoleDO::getUserId)
|
|
|
+ .filter(Objects::nonNull) // 过滤空userId
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ // 计算两个集合的交集,得到最终目标用户ID
|
|
|
+ Set<Long> targetUserIds = userIds.stream()
|
|
|
+ .filter(roleUserIds::contains)
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ if (CollUtil.isNotEmpty(targetUserIds)) {
|
|
|
+ Map<Long, AdminUserRespDTO> users = adminUserApi.getUserMap(targetUserIds);
|
|
|
+ if (CollUtil.isNotEmpty(users)) {
|
|
|
+ String msgTitle = updateObj.getTitle();
|
|
|
+ CountDownLatch latch = new CountDownLatch(users.size());
|
|
|
+ String finalMsgTitle = msgTitle;
|
|
|
+ String constant = PmsConstants.RY_IMPROVE_DAILY_REPORT_APPROVAL;
|
|
|
+ users.forEach((userId, user) -> {
|
|
|
+ pmsThreadPoolTaskExecutor.execute(() -> {
|
|
|
+ try {
|
|
|
+ String mobile = user.getMobile();
|
|
|
+ // 没有手机号也可以发送站内信消息
|
|
|
+ if (StrUtil.isNotBlank(finalMsgTitle)) {
|
|
|
+ pmsMessage.sendMessage(updateObj.getId(), finalMsgTitle, constant,
|
|
|
+ userId, mobile);
|
|
|
+ }
|
|
|
+ } finally {
|
|
|
+ latch.countDown();
|
|
|
}
|
|
|
- } finally {
|
|
|
- latch.countDown();
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|