| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean importQualityMonitor(MultipartFile file, QualityMonitor monitor) { |
| | | public QualityMonitor importQualityMonitor(MultipartFile file, QualityMonitor monitor) { |
| | | // 当前登录用户 |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | // 文件名称 |
| | |
| | | qualityMonitor.setWriteUserId(userId); |
| | | qualityMonitor.setExamineUserId(monitor.getExamineUserId()); |
| | | qualityMonitor.setWriteTime(LocalDateTime.now()); |
| | | qualityMonitor.setWorkflowStatus("PENDING_REVIEW"); |
| | | // 导入只生成草稿,导入的质控项目还需要补全检测标准、检测员等信息; |
| | | // 审核通知在编制人点击“提交审核”时统一发送。 |
| | | qualityMonitor.setWorkflowStatus("DRAFT"); |
| | | baseMapper.insert(qualityMonitor); |
| | | |
| | | User user = userMapper.selectById(userId); |
| | | // 消息发送 |
| | | InformationNotification info = new InformationNotification(); |
| | | // 发送人 |
| | | info.setCreateUser(user.getName()); |
| | | info.setMessageType("6"); |
| | | info.setTheme("CNAS质量监控计划审核通知"); |
| | | info.setContent(fileName + "质量监控计划待审核"); |
| | | info.setSenderId(userId); |
| | | // 接收人 |
| | | info.setConsigneeId(monitor.getExamineUserId()); |
| | | info.setJumpPath(MenuJumpPathConstants.QUALITY_MONITOR); |
| | | informationNotificationService.addInformationNotification(info); |
| | | |
| | | // 发送企业微信通知 |
| | | threadPoolTaskExecutor.execute(() -> { |
| | | // 查询发送人 |
| | | User people = userMapper.selectById(monitor.getExamineUserId()); |
| | | String message = ""; |
| | | message += "CNAS质量监控计划审核通知"; |
| | | message += "\n请去过程要求-质量监控计划"; |
| | | message += "\n" + fileName + "质量监控计划待审核"; |
| | | //发送企业微信消息通知 |
| | | try { |
| | | WxCpUtils.inform(people.getAccount(), message, null); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }); |
| | | |
| | | |
| | | List<QualityMonitorDetails> detailsUploadList = new ArrayList<>(); |
| | | |
| | |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return true; |
| | | return qualityMonitor; |
| | | } |
| | | |
| | | /** |