This commit is contained in:
苏竹红
2024-06-04 18:13:21 +08:00
parent 66c8099c94
commit 976571b072
8 changed files with 30 additions and 9 deletions

View File

@@ -1,5 +1,9 @@
package com.cool.store.utils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
/**
* @author zhangchenbiao
* @FileName: NumberConverter
@@ -30,5 +34,20 @@ public class NumberConverter {
}
return result;
}
public static Float convertMath(String mathExpression) {
BigDecimal bd = null;
try {
if (StringUtil.isEmpty(mathExpression)){
return null;
}
bd = new BigDecimal(mathExpression);
bd = bd.setScale(1, RoundingMode.HALF_UP);
return bd.floatValue();
}catch (Exception e){
return null;
}
}
}

View File

@@ -20,7 +20,7 @@
<result column="assessment_num" jdbcType="INTEGER" property="assessmentNum"/>
<result column="assessment_total_num" jdbcType="INTEGER" property="assessmentTotalNum"/>
<result column="theoretical_exam_status" jdbcType="TINYINT" property="theoreticalExamStatus"/>
<result column="theoretical_exam_score" jdbcType="INTEGER" property="theoreticalExamScore"/>
<result column="theoretical_exam_score" jdbcType="FLOAT" property="theoreticalExamScore"/>
<result column="practical_exam_status" jdbcType="TINYINT" property="practicalExamStatus"/>
<result column="practical_exam_score" jdbcType="INTEGER" property="practicalExamScore"/>
<result column="assessment_status" jdbcType="TINYINT" property="assessmentStatus"/>

View File

@@ -105,7 +105,7 @@ public class EmployeeTrainingDO {
* 理论考试分值
*/
@Column(name = "theoretical_exam_score")
private Integer theoreticalExamScore;
private Float theoreticalExamScore;
/**
* 实操考试状态 0-未开始 1-合格 2-不合格

View File

@@ -84,7 +84,7 @@ public class AssessmentUserTrainingVO {
* 理论考试分值
*/
@ApiModelProperty("理论考试分值")
private Integer theoreticalExamScore;
private Float theoreticalExamScore;
/**
* 实操考试分值

View File

@@ -130,7 +130,7 @@ public class EmployeeTrainingDetailVO {
* 理论考试分值
*/
@ApiModelProperty("理论考试分值")
private Integer theoreticalExamScore;
private Float theoreticalExamScore;
/**
* 实操考试状态 0-未开始 1-合格 2-不合格

View File

@@ -55,7 +55,7 @@ public class EmployeeTrainingVO {
private Integer theoreticalExamStatus;
@ApiModelProperty("理论考试分值")
private Integer theoreticalExamScore;
private Float theoreticalExamScore;
@ApiModelProperty("实操考试状态 0-未开始 1-合格 2-不合格")
private Integer practicalExamStatus;

View File

@@ -18,6 +18,7 @@ import com.cool.store.enums.video.UploadTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.request.*;
import com.cool.store.service.*;
import com.cool.store.utils.NumberConverter;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.vod.SmallVideoParam;
@@ -199,7 +200,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
employeeTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingVO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
if(!employeeTrainingVO.getTheoreticalExamScore().equals(employeeTrainingDO.getTheoreticalExamScore())
|| !employeeTrainingVO.getTheoreticalExamStatus().equals(employeeTrainingDO.getTheoreticalExamStatus())){
@@ -501,7 +502,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
assessmentUserTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
assessmentUserTrainingVO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
assessmentUserTrainingVO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
if(!assessmentUserTrainingVO.getTheoreticalExamScore().equals(employeeTrainingDO.getTheoreticalExamScore())
|| !assessmentUserTrainingVO.getTheoreticalExamStatus().equals(employeeTrainingDO.getTheoreticalExamStatus())){
@@ -644,7 +645,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingDO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
}
}

View File

@@ -21,6 +21,7 @@ import com.cool.store.response.xfsgFirstOderListResponse;
import com.cool.store.service.*;
import com.cool.store.service.impl.CommonService;
import com.cool.store.utils.CoolDateUtils;
import com.cool.store.utils.NumberConverter;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.StringUtils;
import com.cool.store.utils.poi.constant.Constants;
@@ -486,7 +487,7 @@ public class XxlJobHandler {
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? NumberConverter.convertMath(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingDO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
}