吴羡
2 天以前 8ad863082097ffdcab4a8e7f426d344a1fe6f892
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
package com.ruoyi.personnel.service.impl;
 
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.WxCpUtils;
import com.ruoyi.framework.exception.ErrorException;
import com.ruoyi.inspect.util.HackLoopTableRenderPolicy;
import com.ruoyi.inspect.util.UserUtils;
import com.ruoyi.personnel.dto.PersonTrainingDetailedDto;
import com.ruoyi.personnel.dto.PersonTrainingDto;
import com.ruoyi.personnel.dto.PersonTrainingRecordDto;
import com.ruoyi.personnel.dto.TrainingRecordExportDto;
import com.ruoyi.personnel.excel.PersonTrainingDetailedListener;
import com.ruoyi.personnel.excel.PersonTrainingDetailedUpload;
import com.ruoyi.personnel.mapper.PersonTrainingDetailedFileMapper;
import com.ruoyi.personnel.mapper.PersonTrainingDetailedMapper;
import com.ruoyi.personnel.mapper.PersonTrainingMapper;
import com.ruoyi.personnel.mapper.PersonTrainingRecordMapper;
import com.ruoyi.personnel.pojo.PersonTraining;
import com.ruoyi.personnel.pojo.PersonTrainingDetailed;
import com.ruoyi.personnel.pojo.PersonTrainingDetailedFile;
import com.ruoyi.personnel.pojo.PersonTrainingRecord;
import com.ruoyi.personnel.service.PersonTrainingDetailedService;
import com.ruoyi.personnel.service.PersonTrainingService;
import com.ruoyi.system.mapper.UserMapper;
import com.ruoyi.system.service.InformationNotificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
 
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
 
/**
 * <p>
 * 培训计划 服务实现类
 * </p>
 *
 * @author
 * @since 2024-10-11 01:11:49
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class PersonTrainingServiceImpl extends ServiceImpl<PersonTrainingMapper, PersonTraining> implements PersonTrainingService {
 
    @Autowired
    private PersonTrainingDetailedService personTrainingDetailedService;
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private PersonTrainingDetailedMapper personTrainingDetailedMapper;
    @Autowired
    private PersonTrainingRecordMapper personTrainingRecordMapper;
    @Autowired
    private PersonTrainingDetailedFileMapper personTrainingDetailedFileMapper;
    @Resource
    private InformationNotificationService informationNotificationService;
    @Resource
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    @Value("${file.path}")
    private String imgUrl;
 
    @Value("${wordUrl}")
    private String wordUrl;
 
    @Override
    public IPage<PersonTrainingDto> personTrainingSelect(Page page, String compilerName, String departmentId) {
 
        return baseMapper.personTrainingSelect(page, compilerName, departmentId);
    }
 
    @Override
    public void personTrainingImport(MultipartFile file, PersonTraining training) {
        if (file == null || file.isEmpty()) {
            throw new ErrorException("请选择导入文件");
        }
        if (training == null || StringUtils.isBlank(training.getPlanYear())) {
            throw new ErrorException("请选择计划年份");
        }
        if (training.getReviewerId() == null) {
            throw new ErrorException("请选择审核人");
        }
        String originalFilename = file.getOriginalFilename();
        if (StringUtils.isBlank(originalFilename)) {
            throw new ErrorException("文件名不能为空");
        }
 
        Integer userId = SecurityUtils.getUserId().intValue();
        // 年度计划父级新增数据
        PersonTraining personSupervisePlan = new PersonTraining();
        String fileName = originalFilename.contains(".")
                ? originalFilename.substring(0, originalFilename.lastIndexOf("."))
                : originalFilename;
        personSupervisePlan.setFileName(fileName);
        personSupervisePlan.setPlanYear(training.getPlanYear());
        personSupervisePlan.setCompilerId(userId);
        personSupervisePlan.setReviewerId(training.getReviewerId());
        personSupervisePlan.setCompilationDate(LocalDateTime.now());
        baseMapper.insert(personSupervisePlan);
 
        // 年度计划详情 新增
        try {
            PersonTrainingDetailedListener personSupervisePlanDetailsListener = new PersonTrainingDetailedListener(personTrainingDetailedService);
            personSupervisePlanDetailsListener.setPlanId(personSupervisePlan.getId());
            EasyExcel.read(file.getInputStream(), PersonTrainingDetailedUpload.class, personSupervisePlanDetailsListener).sheet().doRead();
        } catch (IOException e) {
            throw new ErrorException("读取导入文件失败,请检查文件格式");
        }
 
        User user = userMapper.selectById(userId);
        // 消息发送(接收人为选定的审核人)
        InformationNotification info = new InformationNotification();
        info.setCreateUser(user != null ? user.getName() : "");
        info.setMessageType("6");
        info.setTheme("CNAS培训计划审核通知");
        info.setContent("您有一条培训计划待审核");
        info.setSenderId(userId);
        info.setConsigneeId(training.getReviewerId());
        info.setJumpPath(MenuJumpPathConstants.PERSONNEL);
        informationNotificationService.addInformationNotification(info);
 
        // 发送企业微信通知(接收人不存在或发送失败不影响导入流程)
        threadPoolTaskExecutor.execute(() -> {
            User personnel = userMapper.selectById(training.getReviewerId());
            if (personnel == null || StringUtils.isBlank(personnel.getAccount())) {
                return;
            }
            String message = "";
            message += "CNAS培训计划审核通知";
            message += "\n请去资源管理-人员-培训计划填写";
            message += "\n" + fileName + "的培训计划待审核";
            try {
                WxCpUtils.inform(personnel.getAccount(), message, null);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }
 
    @Override
    public void personTrainingDelete(Integer id) {
        if (id == null) {
            throw new ErrorException("缺少计划id");
        }
        List<PersonTrainingDetailed> details = personTrainingDetailedService.list(Wrappers.<PersonTrainingDetailed>lambdaQuery()
                .eq(PersonTrainingDetailed::getPlanId, id));
        if (!details.isEmpty()) {
            List<Integer> detailIds = details.stream().map(PersonTrainingDetailed::getId).collect(Collectors.toList());
            // 连同明细下的培训记录、附件一起删除,避免留下孤儿数据
            personTrainingRecordMapper.delete(Wrappers.<PersonTrainingRecord>lambdaQuery()
                    .in(PersonTrainingRecord::getCourseId, detailIds));
            personTrainingDetailedFileMapper.delete(Wrappers.<PersonTrainingDetailedFile>lambdaQuery()
                    .in(PersonTrainingDetailedFile::getTrainingDetailedId, detailIds));
            personTrainingDetailedService.remove(Wrappers.<PersonTrainingDetailed>lambdaQuery()
                    .eq(PersonTrainingDetailed::getPlanId, id));
        }
        baseMapper.deleteById(id);
    }
 
    @Override
    public void reviewAnnualPersonnelTraining(PersonTraining training) {
        if (training == null || training.getId() == null) {
            throw new ErrorException("缺少计划id");
        }
        if (!Integer.valueOf(1).equals(training.getReviewerStatus()) && !Integer.valueOf(2).equals(training.getReviewerStatus())) {
            throw new ErrorException("审核结果不正确");
        }
        PersonTraining old = baseMapper.selectById(training.getId());
        if (old == null) {
            throw new ErrorException("培训计划不存在或已被删除");
        }
        if (Integer.valueOf(1).equals(old.getReviewerStatus())) {
            throw new ErrorException("该计划已审核通过,请勿重复审核");
        }
        boolean passed = Integer.valueOf(1).equals(training.getReviewerStatus());
        if (passed && training.getApproverId() == null) {
            throw new ErrorException("请选择批准人");
        }
 
        baseMapper.update(null, Wrappers.<PersonTraining>lambdaUpdate()
                .eq(PersonTraining::getId, training.getId())
                .set(PersonTraining::getApproverId, passed ? training.getApproverId() : null)
                .set(PersonTraining::getAuditDate, LocalDateTime.now())
                .set(PersonTraining::getAuditRemarks, training.getAuditRemarks())
                .set(PersonTraining::getReviewerStatus, training.getReviewerStatus()));
 
        // 只有审核通过才通知批准人
        if (!passed) {
            return;
        }
        Integer userId = SecurityUtils.getUserId().intValue();
        User user = userMapper.selectById(userId);
        InformationNotification info = new InformationNotification();
        info.setCreateUser(user != null ? user.getName() : "");
        info.setMessageType("6");
        info.setTheme("CNAS培训计划审核通知");
        info.setContent("您有一条培训计划待批准");
        info.setSenderId(userId);
        info.setConsigneeId(training.getApproverId());
        info.setJumpPath(MenuJumpPathConstants.PERSONNEL);
        informationNotificationService.addInformationNotification(info);
 
        // 发送企业微信通知
        threadPoolTaskExecutor.execute(() -> {
            User personnel = userMapper.selectById(training.getApproverId());
            if (personnel == null || StringUtils.isBlank(personnel.getAccount())) {
                return;
            }
            String message = "";
            message += "CNAS培训计划批准通知";
            message += "\n请去资源管理-人员-培训计划填写";
            message += "\n" + old.getFileName() + "的培训计划待批准";
            try {
                WxCpUtils.inform(personnel.getAccount(), message, null);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }
 
    @Override
    public void approveAnnualPersonnelTraining(PersonTraining training) {
        if (training == null || training.getId() == null) {
            throw new ErrorException("缺少计划id");
        }
        if (!Integer.valueOf(1).equals(training.getApprovalStatus()) && !Integer.valueOf(2).equals(training.getApprovalStatus())) {
            throw new ErrorException("批准结果不正确");
        }
        PersonTraining old = baseMapper.selectById(training.getId());
        if (old == null) {
            throw new ErrorException("培训计划不存在或已被删除");
        }
        if (!Integer.valueOf(1).equals(old.getReviewerStatus())) {
            throw new ErrorException("该计划尚未审核通过,不能批准");
        }
        if (Integer.valueOf(1).equals(old.getApprovalStatus())) {
            throw new ErrorException("该计划已批准,请勿重复操作");
        }
        LambdaUpdateWrapper<PersonTraining> wrapper = Wrappers.<PersonTraining>lambdaUpdate()
                .eq(PersonTraining::getId, training.getId())
                .set(PersonTraining::getApprovalDate, LocalDateTime.now())
                .set(PersonTraining::getApprovalRemarks, training.getApprovalRemarks())
                .set(PersonTraining::getApprovalStatus, training.getApprovalStatus());
        baseMapper.update(new PersonTraining(), wrapper);
    }
 
    /**
     * 导出人员培训计划
     * @param id
     * @param response
     */
    @Override
    public void exportPersonTraining(Integer id, HttpServletResponse response) {
 
        if (id == null) {
            throw new ErrorException("缺少计划id");
        }
        // 查询详情
        PersonTraining personTraining = baseMapper.selectById(id);
        if (personTraining == null) {
            throw new ErrorException("培训计划不存在或已被删除");
        }
 
        //获取编制人的签名地址
        User compiler = userMapper.selectById(personTraining.getCompilerId());
        String writeUrl = compiler != null ? compiler.getSignatureUrl() : null;
        if (StringUtils.isBlank(writeUrl)) {
            throw new ErrorException("编制人未上传签名,暂无法导出");
        }
        if (!new File(imgUrl + "/" + writeUrl).exists()) {
            throw new ErrorException("编制人的签名图片不存在,请重新上传签名");
        }
 
        //获取审核人的签名地址
        String examineUrl = null;
        if (personTraining.getReviewerId() != null) {
            User reviewer = userMapper.selectById(personTraining.getReviewerId());
            examineUrl = reviewer != null ? reviewer.getSignatureUrl() : null;
            if (StringUtils.isBlank(examineUrl)) {
                throw new ErrorException("审核人未上传签名,暂无法导出");
            }
            if (!new File(imgUrl + "/" + examineUrl).exists()) {
                throw new ErrorException("审核人的签名图片不存在,请重新上传签名");
            }
        }
 
        //获取批准人的签名地址
        String ratifyUrl = null;
        if (personTraining.getApproverId() != null) {
            User approver = userMapper.selectById(personTraining.getApproverId());
            ratifyUrl = approver != null ? approver.getSignatureUrl() : null;
            if (StringUtils.isBlank(ratifyUrl)) {
                throw new ErrorException("批准人未上传签名,暂无法导出");
            }
            if (!new File(imgUrl + "/" + ratifyUrl).exists()) {
                throw new ErrorException("批准人的签名图片不存在,请重新上传签名");
            }
        }
 
        // 查询详情
        List<PersonTrainingDetailedDto> detailedDtos = personTrainingDetailedMapper.selectTrainingList(id);
 
        int index = 1;
        for (PersonTrainingDetailedDto detailedDto : detailedDtos) {
            detailedDto.setTrainingDateString(detailedDto.getTrainingDate());
            detailedDto.setIndex(index);
            index++;
        }
 
        // 获取路径
        InputStream inputStream = this.getClass().getResourceAsStream("/static/person-training.docx");
        String finalExamineUrl = examineUrl;
        String finalRatifyUrl = ratifyUrl;
        Configure configure = Configure.builder()
                .bind("trainingDetailedList", new HackLoopTableRenderPolicy())
                .build();
        XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(
                new HashMap<String, Object>() {{
                    put("year", personTraining.getPlanYear());
                    put("trainingDetailedList", detailedDtos);
                    put("writeUrl", StringUtils.isNotBlank(writeUrl) ? Pictures.ofLocal(imgUrl + "/" + writeUrl).create() : null);
                    put("examineUrl", StringUtils.isNotBlank(finalExamineUrl) ? Pictures.ofLocal(imgUrl + "/" + finalExamineUrl).create() : null);
                    put("ratifyUrl", StringUtils.isNotBlank(finalRatifyUrl) ? Pictures.ofLocal(imgUrl + "/" + finalRatifyUrl).create() : null);
                    put("writeDateUrl", personTraining.getCompilationDate() != null ?
                            Pictures.ofStream(DateImageUtil.createDateImage(personTraining.getCompilationDate())).create() : null);
                    put("examineDateUrl", personTraining.getAuditDate() != null ?
                            Pictures.ofStream(DateImageUtil.createDateImage(personTraining.getAuditDate())).create() : null);
                    put("ratifyDateUrl", personTraining.getApprovalDate() != null ?
                            Pictures.ofStream(DateImageUtil.createDateImage(personTraining.getApprovalDate())).create() : null);
                }});
        try {
            response.setContentType("application/msword");
            String fileName = URLEncoder.encode(
                    "人员培训计划导出", "UTF-8");
            response.setHeader("Content-disposition",
                    "attachment;filename=" + fileName + ".docx");
            OutputStream os = response.getOutputStream();
            template.write(os);
            os.flush();
            os.close();
            inputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException("导出失败");
        }
 
    }
 
    /**
     * 导出人员培训与考核记录
     * @param id
     * @param response
     */
    @Override
    public void exportPersonTrainingRecord(Integer id, HttpServletResponse response) {
        if (id == null) {
            throw new ErrorException("缺少培训明细id");
        }
        // 查询人员培训明细
        PersonTrainingDetailedDto detailedDto = personTrainingDetailedMapper.selectTrainingDetail(id);
        if (detailedDto == null) {
            throw new ErrorException("培训记录不存在或已被删除");
        }
 
        // 生成培训老师签名(未配置签名时用透明图片兜底,模板里的图片占位不能为 null)
        detailedDto.setTrainingLecturerRender(UserUtils.orTransparentPicture(
                StringUtils.isNotBlank(detailedDto.getTrainingLecturerSignatureUrl())
                        ? Pictures.ofLocal(imgUrl + "/" + detailedDto.getTrainingLecturerSignatureUrl()).create() : null));
 
        // 查询培训的人员
        List<PersonTrainingRecordDto> recordDtos = personTrainingRecordMapper.selectListByTrainingDetailedId(id);
 
        List<TrainingRecordExportDto> exportDtoList = new ArrayList<>();
        TrainingRecordExportDto exportDto = new TrainingRecordExportDto();
 
        int count = 0;
        for (PersonTrainingRecordDto recordDto : recordDtos) {
            switch (count) {
                case 0:
                    exportDto.setUserNameRender1(UserUtils.orTransparentPicture(StringUtils.isNotBlank(recordDto.getSignatureUrl())
                            ? Pictures.ofLocal(imgUrl + "/" + recordDto.getSignatureUrl()).create() : null));
                    exportDto.setDepartment1(recordDto.getDepartment());
                    exportDto.setExaminationResults1(recordDto.getExaminationResults());
                    count ++;
                    break;
                case 1:
                    exportDto.setUserNameRender2(UserUtils.orTransparentPicture(StringUtils.isNotBlank(recordDto.getSignatureUrl())
                            ? Pictures.ofLocal(imgUrl + "/" + recordDto.getSignatureUrl()).create() : null));
                    exportDto.setDepartment2(recordDto.getDepartment());
                    exportDto.setExaminationResults2(recordDto.getExaminationResults());
                    exportDtoList.add(exportDto);
                    exportDto = new TrainingRecordExportDto();
                    count = 0;
                    break;
            }
        }
        // 只有单数条记录时,最后一行才有数据;偶数条时 exportDto 是空对象,不能加进表格
        if (count != 0) {
            exportDtoList.add(exportDto);
        }
 
        // 质量负责人(未签名时用透明图片兜底)
        String assessmentUserUrl = null;
        if (detailedDto.getAssessmentUserId() != null) {
            User assessmentUser = userMapper.selectById(detailedDto.getAssessmentUserId());
            if (assessmentUser != null) {
                assessmentUserUrl = assessmentUser.getSignatureUrl();
            }
        }
 
 
        // 获取路径
        InputStream inputStream = this.getClass().getResourceAsStream("/static/person-training-record.docx");
        Configure configure = Configure.builder()
                .bind("trainingRecordsList", new HackLoopTableRenderPolicy())
                .build();
        String finalAssessmentUserUrl = assessmentUserUrl;
        XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(
                new HashMap<String, Object>() {{
                    put("trainingDetail", detailedDto);
                    put("trainingRecordsList", exportDtoList);
                    put("assessmentUserUrl", UserUtils.orTransparentPicture(StringUtils.isNotBlank(finalAssessmentUserUrl)
                            ? Pictures.ofLocal(imgUrl + "/" + finalAssessmentUserUrl).create() : null));
                }});
        try {
            response.setContentType("application/msword");
            String fileName = URLEncoder.encode(
                    "培训与考核记录导出", "UTF-8");
            response.setHeader("Content-disposition",
                    "attachment;filename=" + fileName + ".docx");
            OutputStream os = response.getOutputStream();
            template.write(os);
            os.flush();
            os.close();
            inputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException("导出失败");
        }
 
 
    }
 
    /**
     * 人员培训详情附件新增
     * @param trainingDetailedId
     * @param file
     * @return
     */
    @Override
    public boolean uploadTrainingDetailedFile(Integer trainingDetailedId, MultipartFile file) {
        if (trainingDetailedId == null) {
            throw new ErrorException("缺少验收id");
        }
 
        String urlString;
        String pathName;
        String path;
        String filename = file.getOriginalFilename();
        String contentType = file.getContentType();
        PersonTrainingDetailedFile detailedFile = new PersonTrainingDetailedFile();
        detailedFile.setTrainingDetailedId(trainingDetailedId);
        detailedFile.setFileName(filename);
        if (contentType != null && contentType.startsWith("image/")) {
            // 是图片
            path = imgUrl;
            detailedFile.setType(1);
        } else {
            // 是文件
            path = wordUrl;
            detailedFile.setType(2);
        }
        try {
            File realpath = new File(path);
            if (!realpath.exists()) {
                realpath.mkdirs();
            }
            pathName = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmmss")) + "_" + file.getOriginalFilename();
            urlString = realpath + "/" + pathName;
            file.transferTo(new File(urlString));
            detailedFile.setFileUrl(pathName);
            personTrainingDetailedFileMapper.insert(detailedFile);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("附件上传错误");
            return false;
        }
    }
 
    /**
     * 查询今年人员培训信息
     * @return
     */
    @Override
    public List<PersonTrainingDetailed> getThisYearTrainingDetailed() {
        return personTrainingDetailedMapper.getThisYearTrainingDetailed();
    }
}