| | |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.deepoove.poi.data.Pictures; |
| | | import com.ruoyi.common.constant.MenuJumpPathConstants; |
| | | import com.ruoyi.common.core.domain.entity.InformationNotification; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | | import com.ruoyi.common.utils.DateImageUtil; |
| | |
| | | * 培训计划 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @author |
| | | * @since 2024-10-11 01:11:49 |
| | | */ |
| | | @Service |
| | |
| | | info.setSenderId(userId); |
| | | // 接收人 |
| | | info.setConsigneeId(training.getApproverId()); |
| | | info.setJumpPath("a6-personnel"); |
| | | info.setJumpPath(MenuJumpPathConstants.PERSONNEL); |
| | | informationNotificationService.addInformationNotification(info); |
| | | |
| | | // 发送企业微信通知 |
| | |
| | | info.setSenderId(userId); |
| | | // 接收人 |
| | | info.setConsigneeId(training.getApproverId()); |
| | | info.setJumpPath("a6-personnel"); |
| | | info.setJumpPath(MenuJumpPathConstants.PERSONNEL); |
| | | informationNotificationService.addInformationNotification(info); |
| | | |
| | | // 发送企业微信通知 |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |
| | |
| | | // 查询人员培训明细 |
| | | PersonTrainingDetailedDto detailedDto = personTrainingDetailedMapper.selectTrainingDetail(id); |
| | | |
| | | // 生成培训老师签名 |
| | | detailedDto.setTrainingLecturerRender(StringUtils.isNotBlank(detailedDto.getTrainingLecturerSignatureUrl()) |
| | | ? Pictures.ofLocal(imgUrl + "/" + detailedDto.getTrainingLecturerSignatureUrl()).create() : null); |
| | | |
| | | // 查询培训的人员 |
| | | List<PersonTrainingRecordDto> recordDtos = personTrainingRecordMapper.selectListByTrainingDetailedId(id); |
| | | |
| | |
| | | for (PersonTrainingRecordDto recordDto : recordDtos) { |
| | | switch (count) { |
| | | case 0: |
| | | exportDto.setUserName1(recordDto.getUserName()); |
| | | exportDto.setUserNameRender1(StringUtils.isNotBlank(recordDto.getSignatureUrl()) |
| | | ? Pictures.ofLocal(imgUrl + "/" + recordDto.getSignatureUrl()).create() : null); |
| | | exportDto.setDepartment1(recordDto.getDepartment()); |
| | | exportDto.setExaminationResults1(recordDto.getExaminationResults()); |
| | | count ++; |
| | | break; |
| | | case 1: |
| | | exportDto.setUserName2(recordDto.getUserName()); |
| | | exportDto.setUserNameRender2(StringUtils.isNotBlank(recordDto.getSignatureUrl()) |
| | | ? Pictures.ofLocal(imgUrl + "/" + recordDto.getSignatureUrl()).create() : null); |
| | | exportDto.setDepartment2(recordDto.getDepartment()); |
| | | exportDto.setExaminationResults2(recordDto.getExaminationResults()); |
| | | exportDtoList.add(exportDto); |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |