bug修改

This commit is contained in:
pengjie 2024-05-23 23:27:51 +08:00
parent 5515b91376
commit 0f2d08e1dc
4 changed files with 16 additions and 11 deletions

View File

@ -76,7 +76,7 @@ public class ExamTrain implements Serializable {
*/ */
@Excel(name = "时长(小时)", width = 15) @Excel(name = "时长(小时)", width = 15)
@ApiModelProperty(value = "时长(小时)") @ApiModelProperty(value = "时长(小时)")
private String duration; private Integer duration;
/** /**
* 实施单位 * 实施单位
*/ */

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService; import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.exam.entity.ExamCourseRecord; import com.zhgd.xmgl.modules.exam.entity.ExamCourseRecord;
import com.zhgd.xmgl.modules.exam.entity.ExamPaper;
import com.zhgd.xmgl.modules.exam.entity.ExamTrain; import com.zhgd.xmgl.modules.exam.entity.ExamTrain;
import com.zhgd.xmgl.modules.exam.entity.ExamTrainRecord; import com.zhgd.xmgl.modules.exam.entity.ExamTrainRecord;
import com.zhgd.xmgl.modules.exam.mapper.ExamTrainMapper; import com.zhgd.xmgl.modules.exam.mapper.ExamTrainMapper;
@ -76,12 +77,12 @@ public class ExamTrainServiceImpl extends ServiceImpl<ExamTrainMapper, ExamTrain
@Override @Override
public boolean saveInfo(ExamTrain examTrain) { public boolean saveInfo(ExamTrain examTrain) {
List<ExamTrainRecord> recordList = examTrain.getExamTrainRecordList(); List<ExamTrainRecord> recordList = examTrain.getExamTrainRecordList();
Integer passLine = 0;
if (examTrain.getExamPaperId() != null) { if (examTrain.getExamPaperId() != null) {
passLine = examPaperService.getById(examTrain.getExamPaperId()).getPassLine(); ExamPaper examPaper = examPaperService.getById(examTrain.getExamPaperId());
examTrain.setPassLine(examPaper.getPassLine());
examTrain.setDuration(examPaper.getDuration());
} }
UserInfo user = SecurityUtils.getUser(); UserInfo user = SecurityUtils.getUser();
examTrain.setPassLine(passLine);
examTrain.setCreateBy(user.getUserId().toString()); examTrain.setCreateBy(user.getUserId().toString());
examTrain.setWorkerNum(recordList.size()); examTrain.setWorkerNum(recordList.size());
boolean flag = this.save(examTrain); boolean flag = this.save(examTrain);

View File

@ -956,6 +956,9 @@
<if test="teamName != null and teamName != ''"> <if test="teamName != null and teamName != ''">
and e.team_name like CONCAT(CONCAT('%', #{teamName}), '%') and e.team_name like CONCAT(CONCAT('%', #{teamName}), '%')
</if> </if>
<if test="departmentTeamName != null and departmentTeamName != ''">
and e.team_name like CONCAT(CONCAT('%', #{departmentTeamName}), '%')
</if>
<if test="enterpriseId != null and enterpriseId != ''"> <if test="enterpriseId != null and enterpriseId != ''">
and e.enterprise_id = #{enterpriseId} and e.enterprise_id = #{enterpriseId}
</if> </if>
@ -993,8 +996,8 @@
) tp2 ON e.id = tp2.department_id ) tp2 ON e.id = tp2.department_id
LEFT JOIN enterprise_info b ON e.enterprise_id = b.id LEFT JOIN enterprise_info b ON e.enterprise_id = b.id
WHERE e.project_sn = #{projectSn} WHERE e.project_sn = #{projectSn}
<if test="teamName != null and teamName != ''"> <if test="departmentTeamName != null and departmentTeamName != ''">
and e.team_name like CONCAT(CONCAT('%', #{teamName}), '%') and e.department_name like CONCAT(CONCAT('%', #{departmentTeamName}), '%')
</if> </if>
<if test="enterpriseId != null and enterpriseId != ''"> <if test="enterpriseId != null and enterpriseId != ''">
and e.enterprise_id = #{enterpriseId} and e.enterprise_id = #{enterpriseId}

View File

@ -2,6 +2,7 @@ package com.zhgd.xmgl.task;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zhgd.xmgl.modules.exam.entity.*; import com.zhgd.xmgl.modules.exam.entity.*;
import com.zhgd.xmgl.modules.exam.service.*; import com.zhgd.xmgl.modules.exam.service.*;
@ -75,14 +76,14 @@ public class ExamTask {
if (examTrainRecordList.get(i1).getScore() == null) { if (examTrainRecordList.get(i1).getScore() == null) {
ExamNotice exist = examNoticeService.getOne(Wrappers.<ExamNotice>lambdaQuery().eq(ExamNotice::getWorkerId, examTrainRecordList.get(i1).getWorkerId()) ExamNotice exist = examNoticeService.getOne(Wrappers.<ExamNotice>lambdaQuery().eq(ExamNotice::getWorkerId, examTrainRecordList.get(i1).getWorkerId())
.eq(ExamNotice::getRecordId, examTrainRecordList.get(i1).getId()) .eq(ExamNotice::getRecordId, examTrainRecordList.get(i1).getId())
.eq(ExamNotice::getContent, "参加安全教育培训")); .eq(ExamNotice::getType, 1));
if (exist == null) { if (exist == null) {
WorkerInfo workerInfo = workerInfoService.getById(examTrainRecordList.get(i1).getWorkerId()); WorkerInfo workerInfo = workerInfoService.getById(examTrainRecordList.get(i1).getWorkerId());
ExamNotice examNotice = new ExamNotice(); ExamNotice examNotice = new ExamNotice();
examNotice.setWorkerId(examTrainRecordList.get(i1).getWorkerId().toString()); examNotice.setWorkerId(examTrainRecordList.get(i1).getWorkerId().toString());
examNotice.setWorkerName(examTrainRecordList.get(i1).getWorkerName()); examNotice.setWorkerName(examTrainRecordList.get(i1).getWorkerName());
examNotice.setType(1); examNotice.setType(1);
examNotice.setContent("参加安全教育培训"); examNotice.setContent(StrUtil.format("参加《{}》安全教育培训", examTrainList.get(j).getName()));
examNotice.setProjectSn(list.get(i).getProjectSn()); examNotice.setProjectSn(list.get(i).getProjectSn());
examNotice.setEnterpriseId(workerInfo.getEnterpriseId()); examNotice.setEnterpriseId(workerInfo.getEnterpriseId());
examNotice.setRecordId(examTrainRecordList.get(i1).getId()); examNotice.setRecordId(examTrainRecordList.get(i1).getId());
@ -96,14 +97,14 @@ public class ExamTask {
if (examCourseRecords.get(i2).getNumber() == null || examCourseRecords.get(i2).getNumber() == 0) { if (examCourseRecords.get(i2).getNumber() == null || examCourseRecords.get(i2).getNumber() == 0) {
ExamNotice exist = examNoticeService.getOne(Wrappers.<ExamNotice>lambdaQuery().eq(ExamNotice::getWorkerId, examCourseRecords.get(i2).getWorkerId()) ExamNotice exist = examNoticeService.getOne(Wrappers.<ExamNotice>lambdaQuery().eq(ExamNotice::getWorkerId, examCourseRecords.get(i2).getWorkerId())
.eq(ExamNotice::getRecordId, examCourseRecords.get(i2).getId()) .eq(ExamNotice::getRecordId, examCourseRecords.get(i2).getId())
.eq(ExamNotice::getContent, "参加安全教育课程学习")); .eq(ExamNotice::getType, 2));
if (exist == null) { if (exist == null) {
WorkerInfo workerInfo = workerInfoService.getById(examCourseRecords.get(i2).getWorkerId()); WorkerInfo workerInfo = workerInfoService.getById(examCourseRecords.get(i2).getWorkerId());
ExamNotice examNotice = new ExamNotice(); ExamNotice examNotice = new ExamNotice();
examNotice.setWorkerId(examCourseRecords.get(i2).getWorkerId().toString()); examNotice.setWorkerId(examCourseRecords.get(i2).getWorkerId().toString());
examNotice.setWorkerName(examCourseRecords.get(i2).getWorkerName()); examNotice.setWorkerName(examCourseRecords.get(i2).getWorkerName());
examNotice.setType(1); examNotice.setType(2);
examNotice.setContent("参加安全教育课程学习"); examNotice.setContent(StrUtil.format("参加《{}》安全教育课程学习", examTrainList.get(j).getName()));
examNotice.setProjectSn(list.get(i).getProjectSn()); examNotice.setProjectSn(list.get(i).getProjectSn());
examNotice.setEnterpriseId(workerInfo.getEnterpriseId()); examNotice.setEnterpriseId(workerInfo.getEnterpriseId());
examNotice.setRecordId(examCourseRecords.get(i2).getId()); examNotice.setRecordId(examCourseRecords.get(i2).getId());