|
@@ -1,5 +1,6 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
@@ -1391,4 +1392,43 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Object findPracticeGroupCourseSchedules(PracticeGroupQueryInfo queryInfo) {
|
|
|
+ PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ if (Objects.isNull(queryInfo.getPracticeId())) {
|
|
|
+ throw new BizException("请指定陪练课课程");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(queryInfo.getPracticeId());
|
|
|
+ if (Objects.isNull(practiceGroup)) {
|
|
|
+ throw new BizException("指定的陪练课不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<CourseSchedule> dataList = courseScheduleDao.findGroupCourseSchedules(practiceGroup.getId(),GroupType.PRACTICE.getCode());
|
|
|
+ int count = dataList.size();
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ List<Long> courseScheduleIds = dataList.stream()
|
|
|
+ .map(courseSchedule -> courseSchedule.getId())
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ List<Map<Long, Integer>> courseSettlementMaps = courseScheduleTeacherSalaryDao.checkCoursesIsSettlement(courseScheduleIds);
|
|
|
+ Map<Long, Long> courseSettlementMap = MapUtil.convertIntegerMap(courseSettlementMaps);
|
|
|
+ dataList.forEach(courseSchedule -> {
|
|
|
+ Long isSettlement = courseSettlementMap.get(courseSchedule.getId().longValue());
|
|
|
+ if (Objects.isNull(isSettlement) || isSettlement <= 0) {
|
|
|
+ courseSchedule.setIsSettlement(0);
|
|
|
+ } else {
|
|
|
+ courseSchedule.setIsSettlement(1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("pageInfo", pageInfo);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|