包头考试bug修复
This commit is contained in:
parent
82fb9f2f64
commit
9fe7221a86
@ -106,4 +106,10 @@ public class ReturnTrainingDetail implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "考试成绩")
|
@ApiModelProperty(value = "考试成绩")
|
||||||
private BigDecimal score;
|
private BigDecimal score;
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "考试记录id")
|
||||||
|
private Long recordId;
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "是否合格:1合格0不合格")
|
||||||
|
private Integer isPass;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,5 +60,5 @@ public interface ReturnTrainingApplicationMapper extends BaseMapper<ReturnTraini
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@MapKey("id")
|
@MapKey("id")
|
||||||
Map<String, Object> getQualifierWorker(@Param("list") List<Long> collect);
|
Map<Long, Object> getQualifierWorker(@Param("list") List<Long> collect);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
<select id="getQualifierWorker" resultType="java.util.Map">
|
<select id="getQualifierWorker" resultType="java.util.Map">
|
||||||
select
|
select
|
||||||
t.id
|
t.id
|
||||||
,count(distinct etr.worker_card) qualifier_num
|
,count(distinct etr.worker_card) qualifierNum
|
||||||
from return_training_application t
|
from return_training_application t
|
||||||
join exam_train_record etr on etr.application_id=t.id
|
join exam_train_record etr on etr.application_id=t.id
|
||||||
where t.id in
|
where t.id in
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
,du.device_unit_name as work_area_name
|
,du.device_unit_name as work_area_name
|
||||||
,if(a.person_type=1,wt.type_name,c.department_name) as post_work_type_name
|
,if(a.person_type=1,wt.type_name,c.department_name) as post_work_type_name
|
||||||
,etr.score
|
,etr.score
|
||||||
|
,etr.id as record_id
|
||||||
|
,etr.is_pass
|
||||||
from return_training_detail t
|
from return_training_detail t
|
||||||
join return_training_application rta on rta.id=t.application_id
|
join return_training_application rta on rta.id=t.application_id
|
||||||
left join exam_train_record etr on etr.application_id=rta.id and etr.worker_card=t.id_card
|
left join exam_train_record etr on etr.application_id=rta.id and etr.worker_card=t.id_card
|
||||||
@ -24,6 +26,8 @@
|
|||||||
,du.device_unit_name as work_area_name
|
,du.device_unit_name as work_area_name
|
||||||
,if(a.person_type=1,wt.type_name,c.department_name) as post_work_type_name
|
,if(a.person_type=1,wt.type_name,c.department_name) as post_work_type_name
|
||||||
,etr.score
|
,etr.score
|
||||||
|
,etr.id as record_id
|
||||||
|
,etr.is_pass
|
||||||
from return_training_detail t
|
from return_training_detail t
|
||||||
join return_training_application rta on rta.id=t.application_id
|
join return_training_application rta on rta.id=t.application_id
|
||||||
left join exam_train_record etr on etr.application_id=rta.id and etr.worker_card=t.id_card
|
left join exam_train_record etr on etr.application_id=rta.id and etr.worker_card=t.id_card
|
||||||
|
|||||||
@ -1,24 +1,27 @@
|
|||||||
package com.zhgd.xmgl.modules.baotou.service.impl;
|
package com.zhgd.xmgl.modules.baotou.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import com.zhgd.xmgl.modules.baotou.entity.ConstructionPlanLedger;
|
||||||
import com.zhgd.xmgl.modules.baotou.entity.ConstructionPlanLedgerFile;
|
import com.zhgd.xmgl.modules.baotou.entity.ConstructionPlanLedgerFile;
|
||||||
import com.zhgd.xmgl.modules.baotou.mapper.ConstructionPlanLedgerFileMapper;
|
import com.zhgd.xmgl.modules.baotou.mapper.ConstructionPlanLedgerFileMapper;
|
||||||
import com.zhgd.xmgl.modules.baotou.service.IConstructionPlanLedgerFileService;
|
import com.zhgd.xmgl.modules.baotou.service.IConstructionPlanLedgerFileService;
|
||||||
import org.springframework.stereotype.Service;
|
import com.zhgd.xmgl.modules.baotou.service.IConstructionPlanLedgerService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import com.zhgd.xmgl.util.PageUtil;
|
import com.zhgd.xmgl.util.PageUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.zhgd.xmgl.util.RefUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.zhgd.xmgl.util.RefUtil;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 施工方案台账附件
|
* @Description: 施工方案台账附件
|
||||||
* @author: pds
|
* @author: pds
|
||||||
@ -29,6 +32,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
public class ConstructionPlanLedgerFileServiceImpl extends ServiceImpl<ConstructionPlanLedgerFileMapper, ConstructionPlanLedgerFile> implements IConstructionPlanLedgerFileService {
|
public class ConstructionPlanLedgerFileServiceImpl extends ServiceImpl<ConstructionPlanLedgerFileMapper, ConstructionPlanLedgerFile> implements IConstructionPlanLedgerFileService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConstructionPlanLedgerFileMapper constructionPlanLedgerFileMapper;
|
private ConstructionPlanLedgerFileMapper constructionPlanLedgerFileMapper;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IConstructionPlanLedgerService constructionPlanLedgerService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<ConstructionPlanLedgerFile> queryPageList(HashMap<String, Object> param) {
|
public IPage<ConstructionPlanLedgerFile> queryPageList(HashMap<String, Object> param) {
|
||||||
@ -59,6 +65,10 @@ public class ConstructionPlanLedgerFileServiceImpl extends ServiceImpl<Construct
|
|||||||
public void add(ConstructionPlanLedgerFile constructionPlanLedgerFile) {
|
public void add(ConstructionPlanLedgerFile constructionPlanLedgerFile) {
|
||||||
constructionPlanLedgerFile.setId(null);
|
constructionPlanLedgerFile.setId(null);
|
||||||
baseMapper.insert(constructionPlanLedgerFile);
|
baseMapper.insert(constructionPlanLedgerFile);
|
||||||
|
|
||||||
|
constructionPlanLedgerService.update(null, new LambdaUpdateWrapper<ConstructionPlanLedger>()
|
||||||
|
.set(ConstructionPlanLedger::getSchemeAttachment, constructionPlanLedgerFile.getSchemeAttachment())
|
||||||
|
.eq(ConstructionPlanLedger::getId, constructionPlanLedgerFile.getConstructionPlanLedgerId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -70,9 +70,9 @@ public class ReturnTrainingApplicationServiceImpl extends ServiceImpl<ReturnTrai
|
|||||||
|
|
||||||
private List<ReturnTrainingApplication> dealList(List<ReturnTrainingApplication> list) {
|
private List<ReturnTrainingApplication> dealList(List<ReturnTrainingApplication> list) {
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
Map<String, Object> passMap = baseMapper.getQualifierWorker(list.stream().map(o -> o.getId()).collect(Collectors.toList()));
|
Map<Long, Object> passMap = baseMapper.getQualifierWorker(list.stream().map(o -> o.getId()).collect(Collectors.toList()));
|
||||||
list.forEach(o -> {
|
list.forEach(o -> {
|
||||||
o.setQualifierNum(Optional.ofNullable(passMap.get(o.getId())).map(m -> Convert.toInt(m)).orElse(0));
|
o.setQualifierNum(Optional.ofNullable(passMap.get(o.getId())).map(m -> Convert.toInt(((Map) m).get("qualifierNum"))).orElse(0));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import com.zhgd.jeecg.common.execption.OpenAlertException;
|
|||||||
import com.zhgd.xmgl.modules.baotou.entity.ReturnTrainingDetail;
|
import com.zhgd.xmgl.modules.baotou.entity.ReturnTrainingDetail;
|
||||||
import com.zhgd.xmgl.modules.baotou.mapper.ReturnTrainingDetailMapper;
|
import com.zhgd.xmgl.modules.baotou.mapper.ReturnTrainingDetailMapper;
|
||||||
import com.zhgd.xmgl.modules.baotou.service.IReturnTrainingDetailService;
|
import com.zhgd.xmgl.modules.baotou.service.IReturnTrainingDetailService;
|
||||||
|
import com.zhgd.xmgl.util.MapUtil;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -47,6 +49,10 @@ public class ReturnTrainingDetailServiceImpl extends ServiceImpl<ReturnTrainingD
|
|||||||
|
|
||||||
private QueryWrapper<ReturnTrainingDetail> getQueryWrapper(HashMap<String, Object> param) {
|
private QueryWrapper<ReturnTrainingDetail> getQueryWrapper(HashMap<String, Object> param) {
|
||||||
QueryWrapper<ReturnTrainingDetail> queryWrapper = QueryGenerator.initPageQueryWrapper(ReturnTrainingDetail.class, param, true);
|
QueryWrapper<ReturnTrainingDetail> queryWrapper = QueryGenerator.initPageQueryWrapper(ReturnTrainingDetail.class, param, true);
|
||||||
|
Object applicationIdList = param.get("applicationIdList");
|
||||||
|
if (applicationIdList != null) {
|
||||||
|
queryWrapper.lambda().in(ReturnTrainingDetail::getApplicationId, applicationIdList);
|
||||||
|
}
|
||||||
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(ReturnTrainingDetail::getId));
|
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(ReturnTrainingDetail::getId));
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,7 @@ public class ExamTrainRecordController {
|
|||||||
@PostMapping(value = "/page")
|
@PostMapping(value = "/page")
|
||||||
public Result<IPage<ExamTrainRecordVo>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
public Result<IPage<ExamTrainRecordVo>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||||
QueryWrapper<ExamTrainRecordVo> queryWrapper = QueryGenerator.initPageQueryWrapper(ExamTrainRecordVo.class, map, true);
|
QueryWrapper<ExamTrainRecordVo> queryWrapper = QueryGenerator.initPageQueryWrapper(ExamTrainRecordVo.class, map, true);
|
||||||
|
queryWrapper.lambda().eq(ExamTrainRecordVo::getSubmit, 1);
|
||||||
Page<ExamTrainRecord> page = PageUtil.getPage(map);
|
Page<ExamTrainRecord> page = PageUtil.getPage(map);
|
||||||
IPage<ExamTrainRecordVo> pageList = examTrainRecordService.pageList(page, queryWrapper);
|
IPage<ExamTrainRecordVo> pageList = examTrainRecordService.pageList(page, queryWrapper);
|
||||||
return Result.success(pageList);
|
return Result.success(pageList);
|
||||||
|
|||||||
@ -16,8 +16,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.zhgd.annotation.OperLog;
|
import com.zhgd.annotation.OperLog;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.xmgl.modules.baotou.entity.ReturnTrainingApplication;
|
import com.zhgd.xmgl.modules.baotou.entity.ReturnTrainingApplication;
|
||||||
|
import com.zhgd.xmgl.modules.baotou.entity.ReturnTrainingDetail;
|
||||||
import com.zhgd.xmgl.modules.baotou.entity.WorkerAdmission;
|
import com.zhgd.xmgl.modules.baotou.entity.WorkerAdmission;
|
||||||
import com.zhgd.xmgl.modules.baotou.service.IReturnTrainingApplicationService;
|
import com.zhgd.xmgl.modules.baotou.service.IReturnTrainingApplicationService;
|
||||||
|
import com.zhgd.xmgl.modules.baotou.service.IReturnTrainingDetailService;
|
||||||
import com.zhgd.xmgl.modules.baotou.service.IWorkerAdmissionService;
|
import com.zhgd.xmgl.modules.baotou.service.IWorkerAdmissionService;
|
||||||
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.*;
|
||||||
@ -77,6 +79,9 @@ public class ExamWorkerController {
|
|||||||
private IExamTrainRecordService examTrainRecordService;
|
private IExamTrainRecordService examTrainRecordService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExamQuestionBankService examQuestionBankService;
|
private IExamQuestionBankService examQuestionBankService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IReturnTrainingDetailService returnTrainingDetailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询我的教育培训记录
|
* 查询我的教育培训记录
|
||||||
@ -245,11 +250,20 @@ public class ExamWorkerController {
|
|||||||
@OperLog(operModul = "考试记录管理", operType = "", operDesc = "批量下载试卷")
|
@OperLog(operModul = "考试记录管理", operType = "", operDesc = "批量下载试卷")
|
||||||
@ApiOperation(value = "批量下载试卷", notes = "批量下载试卷", httpMethod = "GET")
|
@ApiOperation(value = "批量下载试卷", notes = "批量下载试卷", httpMethod = "GET")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "recordIds", value = "记录ID(多个,分割)", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "recordIds", value = "记录ID(多个,分割)", paramType = "query", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "idType", value = "1复工或专项培训", paramType = "query", required = false, dataType = "String"),
|
||||||
})
|
})
|
||||||
@GetMapping(value = "/batch/downloadPaper")
|
@GetMapping(value = "/batch/downloadPaper")
|
||||||
public Result batchDownloadPaper(@RequestParam HashMap<String, Object> param) {
|
public Result batchDownloadPaper(@RequestParam HashMap<String, Object> param) {
|
||||||
List<String> recordIds = StrUtil.split(MapUtils.getString(param, "recordIds"), ",");
|
//复工或专项培训
|
||||||
|
List<String> recordIds;
|
||||||
|
if (Objects.equals(MapUtils.getString(param, "idType"), 1)) {
|
||||||
|
param.put("applicationIdList", StrUtil.split(MapUtils.getString(param, "recordIds"), ","));
|
||||||
|
List<ReturnTrainingDetail> details = returnTrainingDetailService.queryList(param);
|
||||||
|
recordIds = details.stream().map(returnTrainingDetail -> returnTrainingDetail.getRecordId() + "").collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
recordIds = StrUtil.split(MapUtils.getString(param, "recordIds"), ",");
|
||||||
|
}
|
||||||
if (CollUtil.isEmpty(recordIds)) {
|
if (CollUtil.isEmpty(recordIds)) {
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,4 +185,7 @@ public class ExamTrainRecord implements Serializable {
|
|||||||
private Integer applicationType;
|
private Integer applicationType;
|
||||||
@ApiModelProperty(value = "1是试卷最新批次答题记录")
|
@ApiModelProperty(value = "1是试卷最新批次答题记录")
|
||||||
private Integer isNewBatch;
|
private Integer isNewBatch;
|
||||||
|
@ApiModelProperty(value = "1交卷0未交卷")
|
||||||
|
private Integer submit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,5 +58,11 @@ public interface ExamTrainRecordMapper extends BaseMapper<ExamTrainRecord> {
|
|||||||
|
|
||||||
ExamTrainRecordVo queryById(String recordId);
|
ExamTrainRecordVo queryById(String recordId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新同个试卷不同批次为旧批次
|
||||||
|
*
|
||||||
|
* @param idCard
|
||||||
|
* @param paperId
|
||||||
|
*/
|
||||||
void updateOldBatch(@Param("idCard") String idCard, @Param("paperId") String paperId);
|
void updateOldBatch(@Param("idCard") String idCard, @Param("paperId") String paperId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -233,7 +233,7 @@
|
|||||||
left join worker_type wt on wt.id = ti.worker_type_id
|
left join worker_type wt on wt.id = ti.worker_type_id
|
||||||
left join enterprise_info ei on ei.id=wi.enterprise_id
|
left join enterprise_info ei on ei.id=wi.enterprise_id
|
||||||
left join (select * from worker_certificate group by worker_id) wc on wi.id = wc.worker_id
|
left join (select * from worker_certificate group by worker_id) wc on wi.id = wc.worker_id
|
||||||
where es.type = 3
|
where es.type = 3 and ec.submit = 1
|
||||||
group by wi.id
|
group by wi.id
|
||||||
) a
|
) a
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
@ -310,6 +310,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateOldBatch">
|
<update id="updateOldBatch">
|
||||||
update exam_train_record set is_new_batch=0 where worker_card=#{idCard} and exam_paper_id = #{paperId}
|
update exam_train_record set is_new_batch=0 where worker_card=#{idCard} and exam_paper_id = #{paperId} and
|
||||||
|
is_new_batch = 1
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.zhgd.xmgl.modules.exam.service.impl;
|
package com.zhgd.xmgl.modules.exam.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
@ -129,7 +130,30 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
}
|
}
|
||||||
Long paperId = examAnswerQuestionList.get(0).getTrainRecordId();
|
Long paperId = examAnswerQuestionList.get(0).getTrainRecordId();
|
||||||
Long applicationId = examAnswerQuestionList.get(0).getApplicationId();
|
Long applicationId = examAnswerQuestionList.get(0).getApplicationId();
|
||||||
ExamTrainRecord r = this.getOne(new LambdaQueryWrapper<ExamTrainRecord>().eq(ExamTrainRecord::getWorkerCard, card).eq(ExamTrainRecord::getExamPaperId, paperId).eq(ExamTrainRecord::getApplicationId, applicationId));
|
List<ExamTrainRecord> rs = baseMapper.selectList(new LambdaQueryWrapper<ExamTrainRecord>()
|
||||||
|
.eq(ExamTrainRecord::getWorkerCard, card)
|
||||||
|
.eq(ExamTrainRecord::getApplicationId, applicationId));
|
||||||
|
ExamTrainRecord notSubmit = rs.stream().filter(o -> Objects.equals(o.getSubmit(), 0)).sorted((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime())).findFirst().map(o -> o).orElse(null);
|
||||||
|
if (notSubmit == null) {
|
||||||
|
throw new OpenAlertException("您已提交试卷");
|
||||||
|
}
|
||||||
|
ExamTrainRecord submit = rs.stream().filter(o -> Objects.equals(o.getSubmit(), 1) && Objects.equals(o.getIsNewBatch(), 1)).sorted((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime())).findFirst().map(o -> o).orElse(null);
|
||||||
|
if (submit == null) {
|
||||||
|
submit = new ExamTrainRecord();
|
||||||
|
BeanUtil.copyProperties(notSubmit, submit);
|
||||||
|
submit.setSubmit(1);
|
||||||
|
submit.setIsNewBatch(1);
|
||||||
|
} else {
|
||||||
|
//删除未提交的试卷
|
||||||
|
examTrainRecordService.remove(new LambdaQueryWrapper<ExamTrainRecord>()
|
||||||
|
.eq(ExamTrainRecord::getWorkerCard, card)
|
||||||
|
.eq(ExamTrainRecord::getApplicationId, applicationId)
|
||||||
|
.eq(ExamTrainRecord::getSubmit, 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
submit.setStartExamTime(notSubmit.getStartExamTime());
|
||||||
|
submit.setExamCount(submit.getExamCount() + 1);
|
||||||
|
submit.setQuestions(notSubmit.getQuestions());
|
||||||
ExamPaper examPaper = examPaperService.getById(paperId);
|
ExamPaper examPaper = examPaperService.getById(paperId);
|
||||||
BigDecimal score = BigDecimal.ZERO;
|
BigDecimal score = BigDecimal.ZERO;
|
||||||
BigDecimal totalScore = BigDecimal.ZERO;
|
BigDecimal totalScore = BigDecimal.ZERO;
|
||||||
@ -143,26 +167,27 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
score = NumberUtil.add(score, NumberUtil.div(question.getScore(), 2, 2));
|
score = NumberUtil.add(score, NumberUtil.div(question.getScore(), 2, 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r.setSelectOptions(StrUtil.join(",", examAnswerQuestionList.stream().map(examAnswerQuestion -> examAnswerQuestion.getAnswer() != null ? examAnswerQuestion.getAnswer() : "").collect(Collectors.toList())));
|
submit.setSelectOptions(StrUtil.join(",", examAnswerQuestionList.stream().map(examAnswerQuestion -> examAnswerQuestion.getAnswer() != null ? examAnswerQuestion.getAnswer() : "").collect(Collectors.toList())));
|
||||||
r.setExamNum(1);
|
submit.setExamNum(1);
|
||||||
r.setScore(score);
|
submit.setScore(score);
|
||||||
r.setIsPass(NumberUtil.isGreaterOrEqual(score, examPaper.getPassLine()) ? 1 : 0);
|
submit.setIsPass(NumberUtil.isGreaterOrEqual(score, examPaper.getPassLine()) ? 1 : 0);
|
||||||
long duration = DateUtil.between(r.getStartExamTime(), new Date(), DateUnit.SECOND) * 1000;
|
long duration = DateUtil.between(submit.getStartExamTime(), new Date(), DateUnit.SECOND) * 1000;
|
||||||
r.setDuration(DateUtil.formatBetween(duration));
|
submit.setDuration(DateUtil.formatBetween(duration));
|
||||||
r.setTotalScore(totalScore);
|
submit.setTotalScore(totalScore);
|
||||||
this.updateById(r);
|
baseMapper.updateOldBatch(submit.getWorkerCard(), examPaper.getId() + "");
|
||||||
|
this.updateById(submit);
|
||||||
ExamSubject subject = examSubjectService.getById(examPaper.getSubjectId());
|
ExamSubject subject = examSubjectService.getById(examPaper.getSubjectId());
|
||||||
if (Objects.equals(r.getIsPass(), 1)) {
|
if (Objects.equals(submit.getIsPass(), 1)) {
|
||||||
//违章再教育合格:下发门禁
|
//违章再教育合格:下发门禁
|
||||||
//复工培训合格:下发门禁,自动修改成入场
|
//复工培训合格:下发门禁,自动修改成入场
|
||||||
if (Objects.equals(subject.getType(), 2) || Objects.equals(subject.getType(), 1) && Objects.equals(r.getIsReEducation(), 1)) {
|
if (Objects.equals(subject.getType(), 2) || Objects.equals(subject.getType(), 1) && Objects.equals(submit.getIsReEducation(), 1)) {
|
||||||
// HashMap<String, Object> map = new HashMap<>(16);
|
// HashMap<String, Object> map = new HashMap<>(16);
|
||||||
// map.put("id", examTrainRecord.getWorkerId());
|
// map.put("id", examTrainRecord.getWorkerId());
|
||||||
// map.put("deductScore", 100);
|
// map.put("deductScore", 100);
|
||||||
// workerInfoService.updateScoreSendAuth(map);
|
// workerInfoService.updateScoreSendAuth(map);
|
||||||
List<WorkerInfo> infos = workerInfoService.selectWorkerInfoList(new MapBuilder<String, Object>()
|
List<WorkerInfo> infos = workerInfoService.selectWorkerInfoList(new MapBuilder<String, Object>()
|
||||||
.put("id", r.getWorkerId())
|
.put("id", submit.getWorkerId())
|
||||||
.put("projectSn", r.getProjectSn())
|
.put("projectSn", submit.getProjectSn())
|
||||||
.build()).getRecords();
|
.build()).getRecords();
|
||||||
if (CollUtil.isNotEmpty(infos)) {
|
if (CollUtil.isNotEmpty(infos)) {
|
||||||
WorkerInfo workerInfo = infos.get(0);
|
WorkerInfo workerInfo = infos.get(0);
|
||||||
@ -177,8 +202,8 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//入场培训不合格通知给办证人,重考次数用完再提示
|
//入场培训不合格通知给办证人,重考次数用完再提示
|
||||||
if (Objects.equals(subject.getType(), 1) && r.getExamCount() > examPaper.getRetakeNum()) {
|
if (Objects.equals(subject.getType(), 1) && submit.getExamCount() > examPaper.getRetakeNum()) {
|
||||||
String workerCard = r.getWorkerCard();
|
String workerCard = submit.getWorkerCard();
|
||||||
List<Long> admissionIds = workerAdmissionDetailService.list(new LambdaQueryWrapper<WorkerAdmissionDetail>()
|
List<Long> admissionIds = workerAdmissionDetailService.list(new LambdaQueryWrapper<WorkerAdmissionDetail>()
|
||||||
.eq(WorkerAdmissionDetail::getIdCard, workerCard)
|
.eq(WorkerAdmissionDetail::getIdCard, workerCard)
|
||||||
).stream().map(WorkerAdmissionDetail::getWorkerAdmissionId).distinct().collect(Collectors.toList());
|
).stream().map(WorkerAdmissionDetail::getWorkerAdmissionId).distinct().collect(Collectors.toList());
|
||||||
@ -187,11 +212,11 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
.in(WorkerAdmission::getId, admissionIds)).stream().map(WorkerAdmission::getCertificateIssuingPerson).distinct().collect(Collectors.toList());
|
.in(WorkerAdmission::getId, admissionIds)).stream().map(WorkerAdmission::getCertificateIssuingPerson).distinct().collect(Collectors.toList());
|
||||||
noticeService.addUsersNotice(certificateIssuingPersons, "入场培训不合格通知",
|
noticeService.addUsersNotice(certificateIssuingPersons, "入场培训不合格通知",
|
||||||
StrUtil.format("{}(身份证号:{}),参加考试科目为{},试题名称为{},入场培训不合格",
|
StrUtil.format("{}(身份证号:{}),参加考试科目为{},试题名称为{},入场培训不合格",
|
||||||
r.getWorkerName(), r.getWorkerCard(), subject.getName(), examPaper.getName()), "10");
|
submit.getWorkerName(), submit.getWorkerCard(), subject.getName(), examPaper.getName()), "10");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r;
|
return submit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -321,6 +346,7 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
.eq(ExamTrainRecord::getWorkerCard, idCard)
|
.eq(ExamTrainRecord::getWorkerCard, idCard)
|
||||||
.eq(ExamTrainRecord::getExamPaperId, paper.getId())
|
.eq(ExamTrainRecord::getExamPaperId, paper.getId())
|
||||||
.eq(ExamTrainRecord::getApplicationId, applicationId)
|
.eq(ExamTrainRecord::getApplicationId, applicationId)
|
||||||
|
.eq(ExamTrainRecord::getSubmit, 1)
|
||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
);
|
);
|
||||||
if (trainRecord == null) {
|
if (trainRecord == null) {
|
||||||
@ -335,22 +361,27 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
trainRecord = baseMapper.selectOne(new LambdaQueryWrapper<ExamTrainRecord>()
|
trainRecord = baseMapper.selectOne(new LambdaQueryWrapper<ExamTrainRecord>()
|
||||||
.eq(ExamTrainRecord::getWorkerCard, idCard)
|
.eq(ExamTrainRecord::getWorkerCard, idCard)
|
||||||
.eq(ExamTrainRecord::getExamPaperId, examPaperId)
|
.eq(ExamTrainRecord::getExamPaperId, examPaperId)
|
||||||
.eq(ExamTrainRecord::getApplicationId, examPaperId)
|
.eq(ExamTrainRecord::getApplicationId, applicationId)
|
||||||
|
.eq(ExamTrainRecord::getSubmit, 1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trainRecord != null) {
|
if (trainRecord != null) {
|
||||||
if (trainRecord.getExamCount() > paper.getRetakeNum()) {
|
if (trainRecord.getExamCount() > paper.getRetakeNum()) {
|
||||||
throw new OpenAlertException("您已没有考试的次数!");
|
throw new OpenAlertException("您已没有考试的次数!");
|
||||||
}
|
}
|
||||||
this.setQuestionsIf(paper, trainRecord);
|
}
|
||||||
trainRecord.setStartExamTime(new Date());
|
// if (trainRecord != null) {
|
||||||
trainRecord.setExamCount(trainRecord.getExamCount() + 1);
|
// if (trainRecord.getExamCount() > paper.getRetakeNum()) {
|
||||||
trainRecord.setFromType(fromType);
|
// throw new OpenAlertException("您已没有考试的次数!");
|
||||||
baseMapper.updateById(trainRecord);
|
// }
|
||||||
baseMapper.update(trainRecord, new LambdaUpdateWrapper<ExamTrainRecord>().set(ExamTrainRecord::getIsPass, null).eq(ExamTrainRecord::getId, trainRecord.getId()));
|
// this.setQuestionsIf(paper, trainRecord);
|
||||||
typeName = trainRecord.getWorkerType();
|
// trainRecord.setStartExamTime(new Date());
|
||||||
} else {
|
// trainRecord.setExamCount(trainRecord.getExamCount() + 1);
|
||||||
|
// trainRecord.setFromType(fromType);
|
||||||
|
// baseMapper.updateById(trainRecord);
|
||||||
|
// baseMapper.update(trainRecord, new LambdaUpdateWrapper<ExamTrainRecord>().set(ExamTrainRecord::getIsPass, null).eq(ExamTrainRecord::getId, trainRecord.getId()));
|
||||||
|
// typeName = trainRecord.getWorkerType();
|
||||||
|
// } else {
|
||||||
Long id;
|
Long id;
|
||||||
String wn;
|
String wn;
|
||||||
String teamName;
|
String teamName;
|
||||||
@ -393,10 +424,11 @@ public class ExamTrainRecordServiceImpl extends ServiceImpl<ExamTrainRecordMappe
|
|||||||
trainRecord.setFromType(fromType);
|
trainRecord.setFromType(fromType);
|
||||||
trainRecord.setApplicationId(Long.valueOf(applicationId));
|
trainRecord.setApplicationId(Long.valueOf(applicationId));
|
||||||
trainRecord.setApplicationType(applicationType);
|
trainRecord.setApplicationType(applicationType);
|
||||||
trainRecord.setIsNewBatch(1);
|
trainRecord.setIsNewBatch(0);
|
||||||
baseMapper.updateOldBatch(idCard, examPaperId);
|
trainRecord.setSubmit(0);
|
||||||
|
// baseMapper.updateOldBatch(idCard, examPaperId);
|
||||||
baseMapper.insert(trainRecord);
|
baseMapper.insert(trainRecord);
|
||||||
}
|
// }
|
||||||
|
|
||||||
ExamScanCode scanCode = new ExamScanCode();
|
ExamScanCode scanCode = new ExamScanCode();
|
||||||
scanCode.setExamPaperId(paper.getId());
|
scanCode.setExamPaperId(paper.getId());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user