Commit c3042b48 by 叶立庆

Merge remote-tracking branch 'origin/v5.5.0' into v5.5.0

2 parents 5c1272d0 ab383d4f
...@@ -223,6 +223,7 @@ public class LearningCenterCourseService { ...@@ -223,6 +223,7 @@ public class LearningCenterCourseService {
if (staff != null) { if (staff != null) {
x.setUserName(staff.getName()); x.setUserName(staff.getName());
x.setPhone(staff.getMobilePhone()); x.setPhone(staff.getMobilePhone());
x.setEmpStatus(staff.getZzStatus());
//设置部门信息 //设置部门信息
BeiSenOrganization department = departmentMap.get(staff.getOIdDepartmentId()); BeiSenOrganization department = departmentMap.get(staff.getOIdDepartmentId());
if (department != null) { if (department != null) {
...@@ -294,7 +295,7 @@ public class LearningCenterCourseService { ...@@ -294,7 +295,7 @@ public class LearningCenterCourseService {
//计算本月学习时长占比 //计算本月学习时长占比
if (lastMonthDuration.compareTo(BigDecimal.ZERO) > 0) { if (lastMonthDuration.compareTo(BigDecimal.ZERO) > 0) {
//计算本月学习时长占比 = 本月学习时长 / 上月学习时长 -1 * 100%, 四舍五入保留2位小数 //计算本月学习时长占比 = 本月学习时长 / 上月学习时长 -1 * 100%, 四舍五入保留2位小数
BigDecimal monHourRatio = monthDuration.divide(lastMonthDuration).subtract(BigDecimal.ONE).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP); BigDecimal monHourRatio = monthDuration.divide(lastMonthDuration, 3, RoundingMode.HALF_UP).subtract(BigDecimal.ONE).multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP);
res.setMonHourRatio(monHourRatio); res.setMonHourRatio(monHourRatio);
} else { } else {
res.setMonHourRatio(null); res.setMonHourRatio(null);
...@@ -539,7 +540,7 @@ public class LearningCenterCourseService { ...@@ -539,7 +540,7 @@ public class LearningCenterCourseService {
StudyDurationDetail studyDurationDetail = ranks.get(i); StudyDurationDetail studyDurationDetail = ranks.get(i);
Integer rowUserId = studyDurationDetail.getUserId(); Integer rowUserId = studyDurationDetail.getUserId();
//将学习时长 从单位秒转为小时,四舍五入,保留2位小时 //将学习时长 从单位秒转为小时,四舍五入,保留2位小时
studyDurationDetail.setDuration(studyDurationDetail.getDuration().divide(new BigDecimal(3600), 2, RoundingMode.HALF_UP)); studyDurationDetail.setDuration(studyDurationDetail.getDuration().divide(new BigDecimal(3600), 1, RoundingMode.HALF_UP));
if (employeeMap.containsKey(rowUserId)) { if (employeeMap.containsKey(rowUserId)) {
//设置用户名称,只展示第一个字符,后续字符全部使用*代替 //设置用户名称,只展示第一个字符,后续字符全部使用*代替
studyDurationDetail.setUserName(desensitizeUserName(employeeMap.get(rowUserId).getName())); studyDurationDetail.setUserName(desensitizeUserName(employeeMap.get(rowUserId).getName()));
......
...@@ -18,6 +18,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -18,6 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
import javax.validation.groups.Default; import javax.validation.groups.Default;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -103,6 +105,11 @@ public class LearningCenterPersonCourseService { ...@@ -103,6 +105,11 @@ public class LearningCenterPersonCourseService {
if (CollUtil.isNotEmpty(bytes)) { if (CollUtil.isNotEmpty(bytes)) {
course.setPlanCourseType(bytes.contains(CourseTypeEnum.REQUIRED.getType()) ? CourseTypeEnum.REQUIRED.getType() : CourseTypeEnum.OPTIONAL.getType()); course.setPlanCourseType(bytes.contains(CourseTypeEnum.REQUIRED.getType()) ? CourseTypeEnum.REQUIRED.getType() : CourseTypeEnum.OPTIONAL.getType());
} }
// 进度不为null或者0
if (ObjectUtil.isNotNull(course.getProcess()) && course.getProcess().compareTo(BigDecimal.ZERO) > 0) {
// 乘100%,四舍五入,不保留小数
course.setProcess(course.getProcess().multiply(new BigDecimal(100)).setScale(0, RoundingMode.HALF_UP));
}
}); });
return page; return page;
......
...@@ -133,7 +133,11 @@ public class LearningCenterTrainingPlanService { ...@@ -133,7 +133,11 @@ public class LearningCenterTrainingPlanService {
return page; return page;
} }
List<BeiSenEmployeeDTO> beiSenEmployeeDTOS = result.getList().stream().map(item -> BeanUtil.copyProperties(item, BeiSenEmployeeDTO.class)).collect(Collectors.toList()); List<BeiSenEmployeeDTO> beiSenEmployeeDTOS = result.getList().stream().map(item -> {
BeiSenEmployeeDTO beiSenEmployeeDTO = BeanUtil.copyProperties(item, BeiSenEmployeeDTO.class);
beiSenEmployeeDTO.setOldDepartmentId(item.getOIdDepartmentId());
return beiSenEmployeeDTO;
}).collect(Collectors.toList());
// 查询部门信息 // 查询部门信息
Map<Integer, BeiSenOrganization> orgMap = new HashMap<>(); Map<Integer, BeiSenOrganization> orgMap = new HashMap<>();
...@@ -151,10 +155,10 @@ public class LearningCenterTrainingPlanService { ...@@ -151,10 +155,10 @@ public class LearningCenterTrainingPlanService {
List<String> jobPostIds = beiSenEmployeeDTOS.stream().filter(x -> StringUtils.isNotBlank(x.getOIdJobPostId())).map(BeiSenEmployeeDTO::getOIdJobPostId).distinct().collect(Collectors.toList()); List<String> jobPostIds = beiSenEmployeeDTOS.stream().filter(x -> StringUtils.isNotBlank(x.getOIdJobPostId())).map(BeiSenEmployeeDTO::getOIdJobPostId).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(jobPostIds)) { if (CollectionUtils.isNotEmpty(jobPostIds)) {
Example jpExample = new Example(BeiSenJobPost.class); Example jpExample = new Example(BeiSenJobPost.class);
jpExample.createCriteria().andIn("id", jobPostIds).andEqualTo("stdIsDeleted", false); jpExample.createCriteria().andIn("oId", jobPostIds).andEqualTo("stdIsDeleted", false);
List<BeiSenJobPost> jpList = beiSenJobPostMapper.selectByExample(jpExample); List<BeiSenJobPost> jpList = beiSenJobPostMapper.selectByExample(jpExample);
if (CollectionUtils.isNotEmpty(jpList)) { if (CollectionUtils.isNotEmpty(jpList)) {
jpMap = jpList.stream().collect(Collectors.toMap(BeiSenJobPost::getId, jobPost -> jobPost, (jobPost1, jobPost2) -> jobPost1)); jpMap = jpList.stream().collect(Collectors.toMap(BeiSenJobPost::getOId, jobPost -> jobPost, (jobPost1, jobPost2) -> jobPost1));
} }
} }
for (BeiSenEmployeeDTO beiSenEmployeeDTO : beiSenEmployeeDTOS) { for (BeiSenEmployeeDTO beiSenEmployeeDTO : beiSenEmployeeDTOS) {
......
...@@ -470,7 +470,7 @@ public class PadLearningCenterService { ...@@ -470,7 +470,7 @@ public class PadLearningCenterService {
.orElseGet(ArrayList::new).stream() .orElseGet(ArrayList::new).stream()
.filter(course -> Objects.equals(learningCenterTrainingPlanPerson.getExamLevelId(), course.getExamLevelId())) .filter(course -> Objects.equals(learningCenterTrainingPlanPerson.getExamLevelId(), course.getExamLevelId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (CollUtil.isEmpty(courses) || courses.stream().allMatch(course -> Objects.equals(CourseTypeEnum.OPTIONAL.getType(), course.getType()))) { if (CollUtil.isEmpty(courses) || courses.stream().allMatch(course -> Objects.equals(CourseTypeEnum.OPTIONAL.getType().intValue(), course.getType()))) {
return response; return response;
} }
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</sql> </sql>
<select id="listCoursePageInfo" resultMap="CoursePageMap" parameterType="cn.com.glsx.dj.riskmanage.dto.learningcenter.CourseSearchDTO" > <select id="listCoursePageInfo" resultMap="CoursePageMap" parameterType="cn.com.glsx.dj.riskmanage.dto.learningcenter.CourseSearchDTO" >
select bc.id, bc.title, bc.course_file_type, bc.total_duration, bc.course_status, select bc.id, bc.title, bc.course_file_type,round(bc.total_duration) as total_duration, bc.course_status,
cc.category_name as categoryName, ccr.category_id as categoryId, ccr.parent_id as parentId, cc.category_name as categoryName, ccr.category_id as categoryId, ccr.parent_id as parentId,
bo.name as organizationName, bc.learn_total, bc.total_star, bc.beisen_created_by, bc.beisen_created_time bo.name as organizationName, bc.learn_total, bc.total_star, bc.beisen_created_by, bc.beisen_created_time
from dj_beisen_course bc from dj_beisen_course bc
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
from dj_car_life_learning_center_course_category main from dj_car_life_learning_center_course_category main
left join dj_car_life_learning_center_course_category child on main.id = child.parent_id and child.deleted_flag = 'N' left join dj_car_life_learning_center_course_category child on main.id = child.parent_id and child.deleted_flag = 'N'
where main.deleted_flag = 'N' and main.parent_id = 0 where main.deleted_flag = 'N' and main.parent_id = 0
order by main.id asc, child.id asc
</select> </select>
<update id="deleteByCategoryId"> <update id="deleteByCategoryId">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!