|
|
@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.module.pms.constant.PmsConstants;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.depttype.vo.IotDeptTypePageReqVO;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotdevicecategorytemplateattrs.vo.IotDeviceProperty;
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.iotprojecttask.vo.IotProjectTaskPageReqVO;
|
|
|
@@ -744,8 +745,30 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
dailyReport.setOpinion(updateReqVO.getOpinion());
|
|
|
if (SupplierAuditStatusEnum.REJECT.getStatus().equals(updateReqVO.getAuditStatus())) {
|
|
|
dailyReport.setStatus(0);
|
|
|
- } else {
|
|
|
-
|
|
|
+ // 审批拒绝后需要向 日报填报人 发送消息提醒 每个队伍暂时只有1人 随机取1人
|
|
|
+ Long deptId = dailyReport.getDeptId();
|
|
|
+ Long taskId = dailyReport.getTaskId();
|
|
|
+ DeptDO dept = deptService.getDept(deptId);
|
|
|
+ // 消息标题
|
|
|
+ String msgTitle = dept.getName();
|
|
|
+ if (ObjUtil.isNotEmpty(taskId)) {
|
|
|
+ IotProjectTaskDO task = iotProjectTaskMapper.selectById(taskId);
|
|
|
+ msgTitle = StrUtil.join("-", msgTitle, task.getWellName());
|
|
|
+ }
|
|
|
+ // 查询当前部门 deptId 部门下的人员
|
|
|
+ Set<Long> deptIds = new HashSet<>();
|
|
|
+ deptIds.add(deptId);
|
|
|
+ List<AdminUserDO> users = adminUserService.getUserListByDeptIds(deptIds);
|
|
|
+ if (CollUtil.isNotEmpty(users)) {
|
|
|
+ AdminUserDO user = users.get(0);
|
|
|
+ String mobile = user.getMobile();
|
|
|
+ String finalMsgTitle = msgTitle;
|
|
|
+ if (StrUtil.isNotBlank(mobile) && StrUtil.isNotBlank(finalMsgTitle)) {
|
|
|
+ pmsThreadPoolTaskExecutor.execute(() -> {
|
|
|
+ pmsMessage.sendMessage(dailyReport.getId(), finalMsgTitle, PmsConstants.RY_DAILY_REPORT, user.getId(), mobile);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
// 更新瑞恒日报审核状态
|
|
|
iotRyDailyReportMapper.updateById(dailyReport);
|