|
@@ -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;
|
|
@@ -25,6 +26,7 @@ import com.ym.mec.im.ImFeignService;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
+import io.swagger.models.auth.In;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -46,6 +48,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
@Autowired
|
|
|
private SubjectDao subjectDao;
|
|
|
@Autowired
|
|
|
+ private OrganizationDao organizationDao;
|
|
|
+ @Autowired
|
|
|
private TeacherService teacherService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
@@ -1371,6 +1375,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
dataList = practiceGroupDao.findAllByOrgan(params);
|
|
|
if(dataList != null && dataList.size() > 0){
|
|
|
List<Integer> subjectIds = dataList.stream().map(practiceGroup -> practiceGroup.getSubjectId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Integer> organIds = dataList.stream().map(practiceGroup -> practiceGroup.getOrganId()).distinct().collect(Collectors.toList());
|
|
|
List<String> practiceGroupIds = dataList.stream().map(e -> String.valueOf(e.getId())).distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<ClassGroup> classGroupsByVipGroups = classGroupDao
|
|
@@ -1382,10 +1387,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
|
Map<String,Long> totalClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalCourseScheduleNum(practiceGroupIds,GroupType.PRACTICE.getCode()));
|
|
|
Map<String,Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(practiceGroupIds,GroupType.PRACTICE.getCode()));
|
|
|
//声部名称列表
|
|
|
- List<Map<Long, String>> subjectNames = subjectDao.findBySubjecIds(StringUtils.join(subjectIds, ","));
|
|
|
- Map<Long, String> map = MapUtil.convertMybatisMap(subjectNames);
|
|
|
+ Map<Long, String> subjectNames = MapUtil.convertMybatisMap(subjectDao.findBySubjecIds(StringUtils.join(subjectIds, ",")));
|
|
|
+ Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds, ",")));
|
|
|
dataList.forEach(e -> {
|
|
|
- e.setSubjectName(map.get(e.getSubjectId().intValue()));
|
|
|
+ e.setSubjectName(subjectNames.get(e.getSubjectId().intValue()));
|
|
|
+ e.setOrganName(organNames.get(e.getOrganId()));
|
|
|
ClassGroup classGroup = vipGroupClassGroupMap.get(e.getId().toString());
|
|
|
if(Objects.nonNull(classGroup)){
|
|
|
e.setStudentNum(classGroup.getStudentNum());
|
|
@@ -1404,4 +1410,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;
|
|
|
+ }
|
|
|
+
|
|
|
}
|