Browse Source

Merge remote-tracking branch 'origin/feature/0427-school' into feature/0427-school

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
zouxuan 2 years ago
parent
commit
17bd446fb4
33 changed files with 730 additions and 65 deletions
  1. 5 0
      mec-biz/pom.xml
  2. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  3. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  4. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java
  5. 13 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroup.java
  6. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/mapper/CoursePatrolEvaluationMapper.java
  7. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/mapper/CourseSchedulePlusMapper.java
  8. 20 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/CoursePatrolEvaluationWrapper.java
  9. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SchoolActivityDetailWrapper.java
  10. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SchoolActivityWrapper.java
  11. 10 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/TeachingPointWrapper.java
  12. 8 4
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupTeacherMapperService.java
  13. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CooperationOrganService.java
  14. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CoursePatrolEvaluationService.java
  15. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  16. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java
  17. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java
  18. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherService.java
  19. 34 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java
  20. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CooperationOrganServiceImpl.java
  21. 168 12
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursePatrolEvaluationServiceImpl.java
  22. 129 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  23. 22 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java
  24. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  25. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java
  26. 14 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  27. 90 11
      mec-biz/src/main/resources/config/mybatis/CoursePatrolEvaluationMapper.xml
  28. 4 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  29. 54 0
      mec-biz/src/main/resources/config/mybatis/CourseSchedulePlusMapper.xml
  30. 0 2
      mec-web/src/main/java/com/ym/mec/web/WebApplication.java
  31. 23 9
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  32. 7 4
      mec-web/src/main/java/com/ym/mec/web/controller/school/CoursePatrolEvaluationController.java
  33. 2 1
      mec-web/src/main/java/com/ym/mec/web/controller/school/SchoolActivityController.java

+ 5 - 0
mec-biz/pom.xml

@@ -68,6 +68,11 @@
 			<groupId>org.jetbrains.kotlin</groupId>
 			<artifactId>kotlin-stdlib</artifactId>
 		</dependency>
+        <dependency>
+            <groupId>com.microsvc.toolkit.config</groupId>
+            <artifactId>microsvc-config-validator</artifactId>
+            <version>1.0.0</version>
+        </dependency>
 
     </dependencies>
 </project>

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -870,4 +870,6 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     void addClassTimes(@Param("classGroupId") Integer classGroupId, @Param("num") Integer num);
 
     List<ClassGroup> queryByIds(@Param("classIds") List<Integer> classIds);
+
+    int teachingPointRemind(@Param("cooperationOrganId") Integer cooperationOrganId);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1997,6 +1997,8 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
 
     int countTeacherServeHomeworkDetailV2(@Param("param") Map<String, Object> params, @Param("courseIds") List<Long> courseIds);
 
+    void updateTeachingPointByClassGroupId(@Param("classGroupId") Integer classGroupId, @Param("teachingPoint") String teachingPoint);
+
     List<SummaryOfCurrentSemesterCoursesDto> getSummaryOfCurrentSemesterCourses(@Param("musicGroupIds") List<String> musicGroupIds,
                                                                                 @Param("startTerm") String startTerm,
                                                                                 @Param("endTerm") String endTerm);

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.EnumValue;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.enums.*;
@@ -45,6 +46,7 @@ public class CourseSchedule  extends BaseEntity{
         HIGH_ONLINE("HIGH_ONLINE", "线上基础技能课"),
         MUSIC_NETWORK("MUSIC_NETWORK", "乐团网管课");
 
+        @EnumValue
 		private String code;
 
 		private String msg;

+ 13 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroup.java

@@ -235,8 +235,19 @@ public class MusicGroup extends BaseEntity {
 	
 	@ApiModelProperty(value = "计费方式(缴费方为第三方或学校时,选择学员计费、老师计费)",required = false)
 	private String chargeMode;
-	
-	public String getMusicalInstrumentsProvideTime() {
+
+    @ApiModelProperty(value = "学生分布",required = false)
+    private String gradeType;
+
+    public String getGradeType() {
+        return gradeType;
+    }
+
+    public void setGradeType(String gradeType) {
+        this.gradeType = gradeType;
+    }
+
+    public String getMusicalInstrumentsProvideTime() {
 		return musicalInstrumentsProvideTime;
 	}
 

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/mapper/CoursePatrolEvaluationMapper.java

@@ -23,5 +23,6 @@ public interface CoursePatrolEvaluationMapper extends BaseMapper<CoursePatrolEva
 	 * @return List<CoursePatrolEvaluationWrapper.CoursePatrolEvaluation>
 	 */
 	List<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo> selectPage(@Param("page") IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo> page, @Param("param") CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery param);
-	
+
+    IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationStat> pageStat(@Param("page") IPage<Object> page, @Param("param") CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery query);
 }

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/mapper/CourseSchedulePlusMapper.java

@@ -0,0 +1,21 @@
+package com.ym.mec.biz.dal.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.wrapper.TeachingPointWrapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Repository
+public interface CourseSchedulePlusMapper extends BaseMapper<CourseSchedule> {
+
+    List<TeachingPointWrapper.CourseTeachingPoint> teachingPointCourse(@Param("page") IPage<TeachingPointWrapper.CourseTeachingPoint> page,
+                                                                       @Param("param") TeachingPointWrapper.TeachingPointQuery queryInfo);
+
+    List<TeachingPointWrapper.ClassTeachingPoint> teachingPointClass(@Param("page") IPage<TeachingPointWrapper.ClassTeachingPoint> page,
+                                                                     @Param("param") TeachingPointWrapper.TeachingPointQuery queryInfo);
+}

+ 20 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/CoursePatrolEvaluationWrapper.java

@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.config.validator.group.ValidGroups;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.EEvaluateProblemType;
 import com.ym.mec.biz.dal.enums.EEvaluateStatus;
 import com.ym.mec.biz.dal.enums.ESchoolActivityProgramType;
@@ -72,10 +74,14 @@ public class CoursePatrolEvaluationWrapper {
         private EEvaluateProblemType problemType;
 
         @ApiModelProperty("处理状态")
-        private Boolean handleFlag;
+        private Boolean handleStatus;
 
         @ApiModelProperty("评价状态")
         private Boolean evaluateFlag;
+
+        @ApiModelProperty("巡堂ID")
+        private Integer id;
+
         public String getKeyword() {
             return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
         }
@@ -153,7 +159,7 @@ public class CoursePatrolEvaluationWrapper {
         private Integer id;
 
         @ApiModelProperty("分部ID")
-        private String organId;
+        private Integer organId;
 
         @ApiModelProperty("分部名称")
         private String organName;
@@ -182,13 +188,19 @@ public class CoursePatrolEvaluationWrapper {
         @ApiModelProperty("课程名称")
         private String courseName;
 
+        @ApiModelProperty("课程日期")
+        private Date courseDate;
+
         /** 上课时间 */
-        @ApiModelProperty(value = "上课时间", required = false)
-        private java.util.Date startClassTime;
+        @ApiModelProperty(value = "上课时间")
+        private Date startClassTime;
 
         /** 结束时间 */
-        @ApiModelProperty(value = "结束时间", required = false)
-        private java.util.Date endClassTime;
+        @ApiModelProperty(value = "结束时间")
+        private Date endClassTime;
+
+        @ApiModelProperty(value = "课程状态")
+        private CourseStatusEnum courseStatus;
 
         @ApiModelProperty("操作用户ID")
         private Integer userId;
@@ -226,10 +238,11 @@ public class CoursePatrolEvaluationWrapper {
     public static class CoursePatrolEvaluation {
 
         @ApiModelProperty("巡堂编号")
-        @NotNull(message = "巡堂编号不能为空",groups = {Update.class})
+        @NotNull(message = "巡堂编号不能为空",groups = {ValidGroups.Update.class})
         private Integer id;
 
         @ApiModelProperty(value = "课程ID")
+        @NotNull(message = "课程ID不能为空",groups = {ValidGroups.Add.class})
         private Integer courseScheduleId;
 
         @ApiModelProperty(value = "优秀EXCELLENT、良好GOOD、合格QUALIFIED、不合格UNQUALIFIED")

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SchoolActivityDetailWrapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.config.validator.group.ValidGroups;
 import com.ym.mec.biz.dal.enums.ESchoolActivityProgramType;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -64,7 +65,7 @@ public class SchoolActivityDetailWrapper {
     public static class SchoolActivityDetail {
 
         @ApiModelProperty("活动详情编号")
-        @NotNull(message = "活动详情编号不能为空",groups = {Update.class})
+        @NotNull(message = "活动详情编号不能为空",groups = {ValidGroups.Update.class})
         private Integer id;
 
         @ApiModelProperty("合作单位ID")

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/SchoolActivityWrapper.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.config.validator.group.ValidGroups;
 import com.ym.mec.biz.dal.enums.ESchoolActivityStatus;
 import com.ym.mec.biz.dal.enums.ESchoolActivityType;
 import io.swagger.annotations.ApiModel;
@@ -103,7 +104,7 @@ public class SchoolActivityWrapper {
     public static class SchoolActivityDetail {
 
         @ApiModelProperty("活动编号")
-        @NotNull(message = "活动编号不能为空",groups = {Update.class})
+        @NotNull(message = "活动编号不能为空",groups = {ValidGroups.Update.class})
         private Integer id;
 
         @ApiModelProperty("合作单位ID")

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/TeachingPointWrapper.java

@@ -1,11 +1,15 @@
 package com.ym.mec.biz.dal.wrapper;
 
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import lombok.Data;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.util.Date;
 
 public class TeachingPointWrapper {
@@ -41,9 +45,11 @@ public class TeachingPointWrapper {
     public static class TeachingPoint{
 
 
+        @NotBlank(message = "教学点不能为空")
         @ApiModelProperty("教学点")
         private String teachingPoint;
 
+        @NotNull(message = "课程ID不能为空")
         @ApiModelProperty("班级ID")
         private Integer classGroupId;
 
@@ -55,11 +61,14 @@ public class TeachingPointWrapper {
     public static class CourseTeachingPoint {
 
         @ApiModelProperty("课程ID")
-        private Integer courseId;
+        private Long courseId;
 
         @ApiModelProperty("课程名")
         private String courseName;
 
+        @ApiModelProperty(value = "课程状态")
+        private CourseStatusEnum courseStatus;
+
         @ApiModelProperty("乐团ID")
         private Integer musicGroupId;
 

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupTeacherMapperService.java

@@ -2,10 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
 import com.ym.mec.biz.dal.dto.ClassGroupTeachersDto;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupDto;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.common.service.BaseService;
 import org.apache.ibatis.annotations.Param;
 
@@ -106,4 +103,11 @@ public interface ClassGroupTeacherMapperService extends BaseService<Long, ClassG
     * @date 2022/9/23 14:45
     */
     void checkTeachingBishop(List<ClassGroupTeacherMapper> teacherMappers);
+
+    /**
+     * 根据班级id获取班级老师
+     *
+     * @param classIds 班级id
+     */
+    Map<Integer, Teacher> getTeacherByClassIds(List<Integer> classIds);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CooperationOrganService.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
+import java.util.Map;
 
 public interface CooperationOrganService extends BaseService<Integer, CooperationOrgan> {
 
@@ -29,4 +30,10 @@ public interface CooperationOrganService extends BaseService<Integer, Cooperatio
 
     void updateCooperationEdu(List<Integer> organIds);
 
+    /**
+     * 根据合作单位id获取合作单位信息
+     *
+     * @param cooperationIds 合作单位id
+     */
+    Map<Integer,CooperationOrgan> getMapByIds(List<Integer> cooperationIds);
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CoursePatrolEvaluationService.java

@@ -40,4 +40,9 @@ public interface CoursePatrolEvaluationService extends IService<CoursePatrolEval
      */
      Boolean update(CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation);
 
+    /**
+     *  巡堂课统计列表
+     *
+     */
+    IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationStat> pageStat(IPage<Object> page, CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery query);
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -13,6 +14,7 @@ import com.ym.mec.biz.dal.school.dto.ClassesForDayDto;
 import com.ym.mec.biz.dal.school.dto.CourseStudentDto;
 import com.ym.mec.biz.dal.school.dto.DailySummaryOfClassesForTheCurrentSemesterDto;
 import com.ym.mec.biz.dal.school.dto.SummaryOfCurrentSemesterCoursesDto;
+import com.ym.mec.biz.dal.wrapper.TeachingPointWrapper;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -739,4 +741,24 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	* @date 2023/5/6 11:29
 	*/
 	List<CourseStudentDto> queryCourseStudentList(Long courseId);
+
+    /**
+     * 查询课程教学点
+     *
+     * @param queryInfo 查询条件
+     */
+    IPage<TeachingPointWrapper.CourseTeachingPoint> teachingPointCourse(TeachingPointWrapper.TeachingPointQuery queryInfo);
+
+    /**
+     * 查询班级教学点
+     *
+     */
+    IPage<TeachingPointWrapper.ClassTeachingPoint> teachingPointClass(TeachingPointWrapper.TeachingPointQuery queryInfo);
+
+    /**
+     * 设置教学点
+     *
+     * @param teachingPoint 教学点信息
+     */
+    Boolean teachingPoint(TeachingPointWrapper.TeachingPoint teachingPoint);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationService.java

@@ -88,4 +88,11 @@ public interface OrganizationService extends BaseService<Integer, Organization>
     Long add(Organization organization);
 
     List<Organization> queryAll();
+
+    /**
+     * 获取分部信息
+     *
+     * @param organIds 分部id
+     */
+    Map<Integer,Organization> getMapByIds(List<Integer> organIds);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java

@@ -192,4 +192,6 @@ public interface TeacherAttendanceService extends BaseService<Long, TeacherAtten
 	* @date 2023/5/5 09:55
 	*/
 	TeacherAttendanceDto getCourseTeacherAttendance(Long courseId);
+
+    Map<Long,TeacherAttendance> getMapByCourseIds(List<Long> courseIds);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherService.java

@@ -254,4 +254,6 @@ public interface TeacherService extends BaseService<Integer, Teacher> {
     List<BaseMapDto<Integer,String>> queryOrganList(Integer userId);
 
     PageInfo<TeacherMusicStudentOverViewDto> queryTeacherMusicStudentOverViewV2(TeacherServeQueryInfo queryInfo);
+
+    Map<Integer,Teacher> getMapByIds(List<Integer> teacherIds);
 }

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @Service
@@ -45,6 +46,8 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
     @Autowired
     private CourseScheduleDao courseScheduleDao;
 
+    @Autowired
+    private TeacherDao teacherDao;
     @Override
     public BaseDAO<Long, ClassGroupTeacherMapper> getDAO() {
         return classGroupTeacherMapperDao;
@@ -405,4 +408,35 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
             throw new BizException("主教与助教存在冲突");
         }
     }
+
+    @Override
+    public Map<Integer, Teacher> getTeacherByClassIds(List<Integer> classIds) {
+        if (CollectionUtils.isEmpty(classIds)) {
+            return new HashMap<>();
+        }
+
+        List<ClassGroupTeacherMapper> classGroupTeacherMappers = classGroupTeacherMapperDao.findByClassGroupIdsAndType(classIds,TeachTypeEnum.BISHOP.getCode());
+        if (CollectionUtils.isEmpty(classGroupTeacherMappers)) {
+            return new HashMap<>();
+        }
+        List<Integer> teacherIds = classGroupTeacherMappers.stream()
+                .map(ClassGroupTeacherMapper::getUserId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+        List<Teacher> teachers = teacherDao.findByTeacherIds(teacherIds);
+        if (CollectionUtils.isEmpty(teachers)) {
+            return new HashMap<>();
+        }
+        Map<Integer, Teacher> collect = teachers.stream().collect(Collectors.toMap(Teacher::getId, Function.identity()));
+        Map<Integer,Teacher> teacherMap = new HashMap<>();
+        for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMappers) {
+            Teacher teacher = collect.get(classGroupTeacherMapper.getUserId());
+            if (Objects.nonNull(teacher)) {
+                teacherMap.put(classGroupTeacherMapper.getClassGroupId(),teacher);
+            }
+        }
+        return teacherMap;
+    }
+
+
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CooperationOrganServiceImpl.java

@@ -9,11 +9,14 @@ import com.ym.mec.biz.service.ImGroupMemberService;
 import com.ym.mec.biz.service.ImGroupService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 @Service
 public class CooperationOrganServiceImpl extends BaseServiceImpl<Integer, CooperationOrgan>  implements CooperationOrganService {
@@ -181,4 +184,21 @@ public class CooperationOrganServiceImpl extends BaseServiceImpl<Integer, Cooper
 			}
 		}
 	}
+
+    /**
+     * 根据合作单位id获取合作单位信息
+     *
+     * @param cooperationIds 合作单位id
+     */
+    @Override
+    public Map<Integer, CooperationOrgan> getMapByIds(List<Integer> cooperationIds) {
+        if (CollectionUtils.isEmpty(cooperationIds)) {
+            return Collections.emptyMap();
+        }
+        List<CooperationOrgan> cooperationOrgans = cooperationOrganDao.getCooperationOrganByIds(cooperationIds);
+        if (CollectionUtils.isEmpty(cooperationOrgans)) {
+            return Collections.emptyMap();
+        }
+        return cooperationOrgans.stream().collect(Collectors.toMap(CooperationOrgan::getId, Function.identity()));
+    }
 }

+ 168 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursePatrolEvaluationServiceImpl.java

@@ -2,14 +2,30 @@ package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSON;
 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.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.EEvaluateStatus;
+import com.ym.mec.biz.service.*;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.date.DateUtil;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.beans.BeanUtils;
 import lombok.extern.slf4j.Slf4j;
-import com.ym.mec.biz.dal.entity.CoursePatrolEvaluation;
 import com.ym.mec.biz.dal.wrapper.CoursePatrolEvaluationWrapper;
 import com.ym.mec.biz.dal.mapper.CoursePatrolEvaluationMapper;
-import com.ym.mec.biz.service.CoursePatrolEvaluationService;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * 巡堂详情
@@ -19,15 +35,37 @@ import com.ym.mec.biz.service.CoursePatrolEvaluationService;
 @Service
 public class CoursePatrolEvaluationServiceImpl extends ServiceImpl<CoursePatrolEvaluationMapper, CoursePatrolEvaluation> implements CoursePatrolEvaluationService {
 
-	/**
+
+    @Autowired
+    private OrganizationService organizationService;
+
+    @Autowired
+    private CooperationOrganService cooperationOrganService;
+
+    @Autowired
+    private CourseScheduleService courseScheduleService;
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private TeacherService teacherService;
+
+    /**
      * 查询详情
      * @param id 详情ID
      * @return CoursePatrolEvaluation
      */
-	@Override
+    @Override
     public CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo detail(Long id) {
 
-        return null;
+        IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo> coursePatrolEvaluationInfoIPage = selectPage(new Page<>(1, 1),
+                CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery.builder().id(id.intValue()).build());
+        if (CollectionUtils.isEmpty(coursePatrolEvaluationInfoIPage.getRecords())) {
+            return null;
+        }
+        return coursePatrolEvaluationInfoIPage.getRecords().get(0);
+
     }
     
     /**
@@ -39,19 +77,89 @@ public class CoursePatrolEvaluationServiceImpl extends ServiceImpl<CoursePatrolE
     @Override
     public IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo> selectPage(IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo> page,
                                                                                   CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery query) {
-        
-        return page.setRecords(baseMapper.selectPage(page, query));
+        List<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo> coursePatrolEvaluationInfos = baseMapper.selectPage(page, query);
+
+        if (CollectionUtils.isEmpty(coursePatrolEvaluationInfos)) {
+            return page;
+        }
+        // 设置分部名称
+        // 分部ID集合
+        List<Integer> organIds = coursePatrolEvaluationInfos.stream()
+                .map(CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo::getOrganId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        Map<Integer, Organization> organizationMap = organizationService.getMapByIds(organIds);
+        // 设置合作单位名称
+
+        // 合作单位ID集合
+        List<Integer> cooperationIds = coursePatrolEvaluationInfos.stream()
+                .map(CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo::getCooperationOrganId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        Map<Integer, CooperationOrgan> cooperationOrganMap = cooperationOrganService.getMapByIds(cooperationIds);
+
+        // 设置老师信息
+
+        // 老师ID集合
+        List<Integer> teacherIds = coursePatrolEvaluationInfos.stream()
+                .map(CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo::getTeacherId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        Map<Integer, Teacher> teacherMap = teacherService.getMapByIds(teacherIds);
+
+
+        for (CoursePatrolEvaluationWrapper.CoursePatrolEvaluationInfo coursePatrolEvaluationInfo : coursePatrolEvaluationInfos) {
+            Organization organization = organizationMap.get(coursePatrolEvaluationInfo.getOrganId());
+            if (organization != null) {
+                coursePatrolEvaluationInfo.setOrganName(organization.getName());
+            }
+            CooperationOrgan cooperationOrgan = cooperationOrganMap.get(coursePatrolEvaluationInfo.getCooperationOrganId());
+            if (cooperationOrgan != null) {
+                coursePatrolEvaluationInfo.setCooperationOrganName(cooperationOrgan.getName());
+            }
+            Teacher teacher = teacherMap.get(coursePatrolEvaluationInfo.getTeacherId());
+            if (teacher != null) {
+                coursePatrolEvaluationInfo.setTeacherName(teacher.getRealName());
+                coursePatrolEvaluationInfo.setTeacherAvatar(teacher.getAvatar());
+            }
+
+            // 设置上课时间
+            coursePatrolEvaluationInfo.setStartClassTime(DateUtil.startDateAndEndTime(coursePatrolEvaluationInfo.getCourseDate(), coursePatrolEvaluationInfo.getStartClassTime()));
+            coursePatrolEvaluationInfo.setEndClassTime(DateUtil.startDateAndEndTime(coursePatrolEvaluationInfo.getCourseDate(), coursePatrolEvaluationInfo.getEndClassTime()));
+        }
+
+
+
+        return page.setRecords(coursePatrolEvaluationInfos);
     }
-	
+
     /**
      * 添加
      * @param coursePatrolEvaluation CoursePatrolEvaluationWrapper.CoursePatrolEvaluation
      * @return Boolean
      */
     @Override
-    public Boolean add(CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation) {    	
-        
-        return this.save(JSON.parseObject(coursePatrolEvaluation.jsonString(), CoursePatrolEvaluation.class));
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean add(CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation) {
+
+        // 未开始的可成不允许做巡堂评价
+        CourseSchedule courseSchedule = courseScheduleService.get(coursePatrolEvaluation.getCourseScheduleId().longValue());
+        if (courseSchedule == null) {
+            throw new BizException("课程不存在");
+        }
+        if (courseSchedule.getStatus().equals(CourseStatusEnum.NOT_START)) {
+            throw new BizException("课程未开始,不允许做巡堂评价");
+        }
+
+        CoursePatrolEvaluation evaluation = JSON.parseObject(coursePatrolEvaluation.jsonString(), CoursePatrolEvaluation.class);
+        evaluation.setCreateTime(new Date());
+        evaluation.setUpdateTime(new Date());
+        evaluation.setHandleStatus(false);
+        evaluation.setUserId(sysUserFeignService.queryUserInfo().getId());
+        return this.save(evaluation);
     }
 
     /**
@@ -60,8 +168,56 @@ public class CoursePatrolEvaluationServiceImpl extends ServiceImpl<CoursePatrolE
      * @return Boolean
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean update(CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation){
+        // 查询是否存在
+        CoursePatrolEvaluation evaluation = this.getById(coursePatrolEvaluation.getId());
+        if (evaluation == null) {
+            throw new BizException("巡堂评价不存在");
+        }
+        // 处理建议
+        if(StringUtils.isBlank(coursePatrolEvaluation.getSuggestion())) {
+            evaluation.setSuggestion(coursePatrolEvaluation.getSuggestion());
+            evaluation.setHandleStatus(true);
+        }
+
+        evaluation.setUpdateTime(new Date());
+        // 评价为合格以上 描述设置为空
+        if (coursePatrolEvaluation.getEvaluateStatus() != null) {
+            evaluation.setEvaluateStatus(coursePatrolEvaluation.getEvaluateStatus());
+            evaluation.setAttachmentUrl(coursePatrolEvaluation.getAttachmentUrl());
+            if(coursePatrolEvaluation.getEvaluateStatus().equals(EEvaluateStatus.UNQUALIFIED)) {
+                evaluation.setProblemType(coursePatrolEvaluation.getProblemType());
+                evaluation.setProblemDesc(coursePatrolEvaluation.getProblemDesc());
+            } else {
+                evaluation.setProblemType(null);
+                evaluation.setProblemDesc(null);
+            }
+        }
+
+        this.lambdaUpdate()
+                .eq(CoursePatrolEvaluation::getId, evaluation.getId())
+                .set(CoursePatrolEvaluation::getSuggestion, evaluation.getSuggestion())
+                .set(CoursePatrolEvaluation::getHandleStatus, evaluation.getHandleStatus())
+                .set(CoursePatrolEvaluation::getEvaluateStatus, evaluation.getEvaluateStatus())
+                .set(CoursePatrolEvaluation::getAttachmentUrl, evaluation.getAttachmentUrl())
+                .set(CoursePatrolEvaluation::getProblemType, evaluation.getProblemType())
+                .set(CoursePatrolEvaluation::getProblemDesc, evaluation.getProblemDesc())
+                .update();
+
+        return true;
+    }
+
+    /**
+     * 巡堂课统计列表
+     *
+     * @param page
+     * @param query
+     */
+    @Override
+    public IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationStat> pageStat(IPage<Object> page, CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery query) {
+        // 根据日期分页
+        return baseMapper.pageStat(page, query);
 
-        return this.updateById(JSON.parseObject(coursePatrolEvaluation.jsonString(), CoursePatrolEvaluation.class));       
     }
 }

+ 129 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
@@ -9,11 +10,13 @@ import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.mapper.CourseSchedulePlusMapper;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.dal.school.dto.ClassesForDayDto;
 import com.ym.mec.biz.dal.school.dto.CourseStudentDto;
 import com.ym.mec.biz.dal.school.dto.DailySummaryOfClassesForTheCurrentSemesterDto;
 import com.ym.mec.biz.dal.school.dto.SummaryOfCurrentSemesterCoursesDto;
+import com.ym.mec.biz.dal.wrapper.TeachingPointWrapper;
 import com.ym.mec.biz.event.source.CourseEventSource;
 import com.ym.mec.biz.event.source.SendSeoMessageSource;
 import com.ym.mec.biz.service.*;
@@ -176,6 +179,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
     @Autowired
 	private CourseScheduleConvertDao courseScheduleConvertDao;
 
+    @Autowired
+    private CourseSchedulePlusMapper courseSchedulePlusMapper;
+
+    @Autowired
+    private TeacherService teacherService;
+
+    @Autowired
+    private TeacherAttendanceService teacherAttendanceService;
+
     private final Logger LOGGER = LoggerFactory
             .getLogger(this.getClass());
 
@@ -450,7 +462,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if (type == CourseScheduleType.VIP) {
 			throw new BizException("暂不支持vip课加课");
 		}
-		
+
 		if(type == CourseSchedule.CourseScheduleType.HIGH){
         	type = CourseScheduleType.HIGH_ONLINE;
         }
@@ -762,7 +774,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							}
 							//基础技能提高课
 							if(type == CourseScheduleType.HIGH_ONLINE || type == CourseScheduleType.HIGH){
-								
+
 								if(StringUtils.isBlank(tdms.getSalaryRuleJson())){
 				            		throw new BizException("线上基础技能课课酬设置异常");
 				                }
@@ -4113,10 +4125,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             		if(musicGroup != null){
             			musicGroup.setFirstCourseStartTime(courseSchedule.getClassDate());
             			musicGroup.setGroupMemberNum(courseScheduleStudentPaymentDao.countStudentNum(courseSchedule.getId().intValue()));
-            			
+
             			musicGroupDao.update(musicGroup);
             		}
-            		
+
             		musicGroupIdList.add(courseSchedule.getMusicGroupId());
             	}
             }
@@ -6075,6 +6087,119 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		return listClassesForDay.get(0);
 	}
 
+
+    /**
+     * 查询课程信息
+     *
+     * @param queryInfo 查询条件
+     */
+    @Override
+    public IPage<TeachingPointWrapper.CourseTeachingPoint> teachingPointCourse(TeachingPointWrapper.TeachingPointQuery queryInfo) {
+        IPage<TeachingPointWrapper.CourseTeachingPoint> page = com.microsvc.toolkit.common.response.paging.QueryInfo.getPage(queryInfo);
+        List<TeachingPointWrapper.CourseTeachingPoint> courseTeachingPoints = courseSchedulePlusMapper
+                .teachingPointCourse(page, queryInfo);
+        if (CollectionUtils.isEmpty(courseTeachingPoints)) {
+            return page;
+        }
+
+        // 设置老师信息
+
+        // 老师ID集合
+        List<Integer> teacherIds = courseTeachingPoints.stream()
+                .map(TeachingPointWrapper.CourseTeachingPoint::getTeacherId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        Map<Integer, Teacher> teacherMap = teacherService.getMapByIds(teacherIds);
+
+        // 设置签到/签退信息
+
+        // 课程ID集合
+        List<Long> courseIds = courseTeachingPoints.stream()
+                .map(TeachingPointWrapper.CourseTeachingPoint::getCourseId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        Map<Long, TeacherAttendance> attendanceMap = teacherAttendanceService.getMapByCourseIds(courseIds);
+
+        for (TeachingPointWrapper.CourseTeachingPoint courseTeachingPoint : courseTeachingPoints) {
+
+            // 设置老师信息
+            if (courseTeachingPoint.getTeacherId() != null) {
+                Teacher teacher = teacherMap.get(courseTeachingPoint.getTeacherId());
+                if (teacher != null) {
+                    courseTeachingPoint.setTeacherName(teacher.getRealName());
+                    courseTeachingPoint.setTeacherAvatar(teacher.getAvatar());
+                }
+            }
+
+            // 设置签到/签退信息
+            TeacherAttendance attendance = attendanceMap.get(courseTeachingPoint.getCourseId());
+            if (attendance != null) {
+                courseTeachingPoint.setSignPhoto(attendance.getSignInAttachments());
+                courseTeachingPoint.setSignOutPhoto(attendance.getSignOutAttachments());
+            }
+        }
+
+        return page.setRecords(courseTeachingPoints);
+    }
+
+    @Override
+    public IPage<TeachingPointWrapper.ClassTeachingPoint> teachingPointClass(TeachingPointWrapper.TeachingPointQuery queryInfo) {
+        IPage<TeachingPointWrapper.ClassTeachingPoint> page = com.microsvc.toolkit.common.response.paging.QueryInfo.getPage(queryInfo);
+        List<TeachingPointWrapper.ClassTeachingPoint> courseTeachingPoints = courseSchedulePlusMapper
+                .teachingPointClass(page, queryInfo);
+        if (CollectionUtils.isEmpty(courseTeachingPoints)) {
+            return page;
+        }
+
+        // 班级主教信息
+
+        // 班级ID集合
+        List<Integer> classIds = courseTeachingPoints.stream()
+                .map(TeachingPointWrapper.ClassTeachingPoint::getClassGroupId)
+                .filter(Objects::nonNull)
+                .collect(Collectors.toList());
+
+        Map<Integer, Teacher> teacherMap = classGroupTeacherMapperService.getTeacherByClassIds(classIds);
+
+        for (TeachingPointWrapper.ClassTeachingPoint courseTeachingPoint : courseTeachingPoints) {
+
+            // 设置老师信息
+            if (courseTeachingPoint.getTeacherId() != null) {
+                Teacher teacher = teacherMap.get(courseTeachingPoint.getClassGroupId());
+                if (teacher != null) {
+                    courseTeachingPoint.setTeacherId(teacher.getId());
+                    courseTeachingPoint.setTeacherName(teacher.getRealName());
+                    courseTeachingPoint.setTeacherAvatar(teacher.getAvatar());
+                }
+            }
+        }
+        return page.setRecords(courseTeachingPoints);
+
+    }
+
+
+    /**
+     * 设置教学点
+     *
+     * @param teachingPoint 教学点信息
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Boolean teachingPoint(TeachingPointWrapper.TeachingPoint teachingPoint) {
+
+        ClassGroup classGroup = new ClassGroup();
+        classGroup.setId(teachingPoint.getClassGroupId());
+        classGroup.setTeachingPoint(teachingPoint.getTeachingPoint());
+        classGroupDao.update(classGroup);
+
+        // 未开始的课程修改教学点
+        courseScheduleDao.updateTeachingPointByClassGroupId(teachingPoint.getClassGroupId(), teachingPoint.getTeachingPoint());
+        return true;
+    }
+
+
 	@Override
 	public List<CourseStudentDto> queryCourseStudentList(Long courseId) {
 		List<CourseStudentDto> courseStudentDtos = studentAttendanceDao.queryCourseStudentList(courseId);

+ 22 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationServiceImpl.java

@@ -18,16 +18,15 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.EDUCATION;
@@ -220,7 +219,25 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		return organizationDao.getOrgans(null,1);
 	}
 
-	@Transactional(rollbackFor = Exception.class)
+    /**
+     * 获取分部信息
+     *
+     * @param organIds 分部id
+     */
+    @Override
+    public Map<Integer, Organization> getMapByIds(List<Integer> organIds) {
+        if (CollectionUtils.isEmpty(organIds)) {
+            return Collections.emptyMap();
+        }
+        List<Organization> organizations = organizationDao.findOrgans(organIds);
+        if (CollectionUtils.isEmpty(organizations)) {
+            return Collections.emptyMap();
+        }
+        return organizations.stream().collect(Collectors.toMap(Organization::getId, Function.identity()));
+
+    }
+
+    @Transactional(rollbackFor = Exception.class)
     public void updateOrganId(Integer userId,Integer organId){
 		Employee employee = employeeDao.get(userId);
 		String organIdList = employee.getOrganIdList();

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -36,6 +36,7 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 import static com.ym.mec.biz.dal.enums.ComplaintsStatusEnum.REPEAL;
 import static com.ym.mec.biz.dal.enums.SignInStatusEnum.*;
@@ -1164,4 +1165,17 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 	public com.ym.mec.biz.dal.school.dto.TeacherAttendanceDto getCourseTeacherAttendance(Long courseId) {
 		return null;
 	}
+
+    @Override
+    public Map<Long, TeacherAttendance> getMapByCourseIds(List<Long> courseIds) {
+        if (CollectionUtils.isEmpty(courseIds)) {
+            return Collections.emptyMap();
+        }
+        List<TeacherAttendance> attendanceList = teacherAttendanceDao.findByCourseSchedules(courseIds);
+        if (CollectionUtils.isEmpty(attendanceList)) {
+            return Collections.emptyMap();
+        }
+        return attendanceList.stream().collect(Collectors.toMap(TeacherAttendance::getCourseScheduleId, Function.identity(), (k1, k2) -> k1));
+
+    }
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -42,6 +42,7 @@ import java.time.DayOfWeek;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @Service
@@ -763,6 +764,20 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher> implem
     }
 
     @Override
+    public Map<Integer, Teacher> getMapByIds(List<Integer> teacherIds) {
+
+        if (CollectionUtils.isEmpty(teacherIds)) {
+            return Collections.emptyMap();
+        }
+        List<Teacher> teachers = teacherDao.findByTeacherIds(teacherIds);
+
+        if (CollectionUtils.isEmpty(teachers)) {
+            return Collections.emptyMap();
+        }
+        return teachers.stream().collect(Collectors.toMap(Teacher::getId, Function.identity()));
+    }
+
+    @Override
     public PageInfo<SysUserDto> queryTeacherBasicInfo(UserBasicQueryInfo queryInfo) {
         PageInfo<SysUserDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<>();

+ 14 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -158,6 +158,10 @@
             <if test="desc == null or desc == ''">
                 desc_ = NULL,
             </if>
+
+            <if test="teachingPoint != null and teachingPoint != ''">
+                teaching_point_=#{teachingPoint},
+            </if>
             update_time_ = NOW()
         </set>
         WHERE id_ = #{id} and tenant_id_ = #{tenantId}
@@ -1651,4 +1655,14 @@
         </foreach>
 
     </select>
+
+    <select id="teachingPointRemind" resultType="java.lang.Integer">
+        SELECT COUNT(0)
+        from  class_group cg
+        left join music_group mg on mg.id_ = cg.music_group_id_
+        where mg.cooperation_organ_id_ = #{cooperationOrganId}
+        and cg.del_flag_ = 0
+        and mg.del_flag_ = 0
+        and (cg.teaching_point_ is null or cg.teaching_point_ = '')
+    </select>
 </mapper>

+ 90 - 11
mec-biz/src/main/resources/config/mybatis/CoursePatrolEvaluationMapper.xml

@@ -3,22 +3,101 @@
 <mapper namespace="com.ym.mec.biz.dal.mapper.CoursePatrolEvaluationMapper">
     
     <select id="selectPage" resultType="com.ym.mec.biz.dal.wrapper.CoursePatrolEvaluationWrapper$CoursePatrolEvaluationInfo">
-		SELECT         
-        	t.*
-		FROM course_patrol_evaluation t
-        left join course_schedule cs on cs.id_ = t.course_schedule_id_
-        left join sys_user su on cs.actual_teacher_id_ = su.id_
+        SELECT t.id_
+             , mg.organ_id_             as organId
+             , mg.cooperation_organ_id_ as cooperationOrganId
+             , cs.id_                   as courseScheduleId
+             , cs.type_                 as courseType
+             , cs.name_                 as courseName
+             , cs.class_date_           as classDate
+             , cs.start_class_time_     as startClassTime
+             , cs.end_class_time_       as endClassTime
+             , cs.status_               as courseStatus
+             , cs.actual_teacher_id_    as teacherId
+             , t.user_id_               as userId
+             , t.evaluate_status_       as evaluateStatus
+             , t.problem_type_          as problemType
+             , t.problem_desc_          as problemDesc
+             , t.handle_status_         as handleStatus
+             , t.suggestion_            as suggestion
+             , t.attachment_url_        as attachmentUrl
+        FROM course_schedule cs
+            left join course_patrol_evaluation t on cs.id_ = t.course_schedule_id_
+            left join music_group mg on mg.id_ = cs.music_group_id_
+
+        <if test="param.keyword != null and param.keyword != ''">
+            left join sys_user su on cs.actual_teacher_id_ = su.id_
+        </if>
         <where>
             <if test="param.keyword != null and param.keyword != ''">
-                and (su.real_name_ like concat('%',#{param.keyword},'%')
-                or su.id_ like concat('%',#{param.keyword},'%')
-                or su.phone_ like concat('%',#{param.keyword},'%'))
+                and (su.real_name_ like concat('%', #{param.keyword}, '%')
+                or su.id_ like concat('%', #{param.keyword}, '%')
+                or su.phone_ like concat('%', #{param.keyword}, '%'))
             </if>
             <if test="param.startTime != null">
-                and cs.class_date_ &lt;= date_format(#{param.startTime},'%Y-%m-%d')
+                and cs.class_date_ &gt;= date_format(#{param.startTime}, '%Y-%m-%d')
+            </if>
+            <if test="param.endTime != null">
+                and cs.class_date_ &lt;= date_format(#{param.endTime}, '%Y-%m-%d')
+            </if>
+            <if test="param.organId != null and param.organId != ''">
+                and find_in_set(mg.organ_id_, #{param.organId})
+            </if>
+            <if test="param.cooperationOrganId != null">
+                and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
+            </if>
+            <if test="param.courseType != null">
+                and cs.type_ = #{param.courseType}
+            </if>
+            <if test="param.evaluateStatus != null">
+                and t.evaluate_status_ = #{param.evaluateStatus}
+            </if>
+            <if test="param.problemType != null">
+                and find_in_set(#{param.problemType}, t.problem_type_)
+            </if>
+            <if test="param.handleStatus != null">
+                and t.handle_status_ = #{param.handleStatus}
+            </if>
+            <if test="param.evaluateFlag != null">
+                <if test="param.evaluateFlag">
+                    and t.evaluate_status_ is not null
+                </if>
+                <if test="param.evaluateFlag == false">
+                    and t.evaluate_status_ is null
+                </if>
             </if>
+            <if test="param.id != null">
+                and t.id_ = #{param.id}
+            </if>
+        </where>
+        order by cs.start_class_time_, cs.id_
+    </select>
 
+    <select id="pageStat"
+            resultType="com.ym.mec.biz.dal.wrapper.CoursePatrolEvaluationWrapper$CoursePatrolEvaluationStat">
+        select
+            cs.class_date_ as `date`
+            ,count(distinct cs.id_) as `totalCount`
+            ,sum(distinct if(cs.type_ = 'SINGLE',1,0)) as  singleCourseCount
+            ,sum(distinct if(cs.type_ = 'MIX',1,0)) as minCourseCount
+            ,sum(distinct if(cpe.id_ is not null,1,0)) as patrolCount
+        from
+            course_schedule cs
+            left join music_group mg on mg.id_ = cs.music_group_id_
+            left join course_patrol_evaluation cpe on cpe.course_schedule_id_ = cs.id_
+        <where>
+            cs.teach_mode_ = 'OFFLINE'
+            <if test="param.startTime != null">
+                and cs.class_date_ &gt;= date_format(#{param.startTime},'%Y-%m-%d')
+            </if>
+            <if test="param.endTime != null">
+                and cs.class_date_ &lt;= date_format(#{param.endTime},'%Y-%m-%d')
+            </if>
+            <if test="param.cooperationOrganId != null">
+                and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
+            </if>
         </where>
-	</select>
-    
+        group by cs.class_date_
+        order by cs.class_date_
+    </select>
 </mapper>

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -4207,6 +4207,10 @@
         </where>
     </select>
 
+    <update id="updateTeachingPointByClassGroupId">
+        update course_schedule set teaching_point_ = #{teachingPoint} where class_group_id_ = #{classGroupId} and status_ = 'NOT_START'
+    </update>
+
     <select id="getSummaryOfCurrentSemesterCourses"
             resultType="com.ym.mec.biz.dal.school.dto.SummaryOfCurrentSemesterCoursesDto">
         select cs.type_ scheduleType,COUNT(CASE WHEN cs.status_ = 'NOT_START' THEN 1 END) subCourseNum,

+ 54 - 0
mec-biz/src/main/resources/config/mybatis/CourseSchedulePlusMapper.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE  mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ym.mec.biz.dal.mapper.CourseSchedulePlusMapper">
+
+    <select id="teachingPointCourse" resultType="com.ym.mec.biz.dal.wrapper.TeachingPointWrapper$CourseTeachingPoint">
+        select cs.id_ as courseId
+        ,cs.name_ as courseName
+        ,cs.status_ as courseStatus
+        ,mg.id_ as musicGroupId
+        ,mg.name_ as musicGroupName
+        ,cs.actual_teacher_id_ as teacherId
+        ,cs.teaching_point_ as teachingPoint
+        from course_schedule cs
+        left join music_group mg on mg.id_ = cs.music_group_id_
+        <where>
+            mg.del_flag_ = 0
+            <if test="param.cooperationOrganId != null">
+                and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
+            </if>
+            <if test="param.startTime != null">
+                and cs.class_date_ &gt;= date_format(#{param.startTime}, '%Y-%m-%d')
+            </if>
+            <if test="param.endTime != null">
+                and cs.class_date_ &lt;= date_format(#{param.endTime}, '%Y-%m-%d')
+            </if>
+            <if test="param.musicGroupId != null">
+                and cs.music_group_id_ = #{param.musicGroupId}
+            </if>
+        </where>
+
+        order by cs.class_date_ desc,cs.start_class_time_ desc,cs.id_ desc
+    </select>
+
+    <select id="teachingPointClass" resultType="com.ym.mec.biz.dal.wrapper.TeachingPointWrapper$ClassTeachingPoint">
+        select
+        cg.id_ as classGroupId
+        ,cg.name_ as classGroupName
+        ,mg.id_ as musicGroupId
+        ,mg.name_ as musicGroupName
+        ,cg.teaching_point_ as teachingPoint
+        from class_group cg
+        left join music_group mg on mg.id_ = cg.music_group_id_
+        <where>
+            and cg.del_flag_ = 0 and mg.del_flag_ = 0
+            <if test="param.musicGroupId != null" >
+                and cg.music_group_id_ = #{param.musicGroupId}
+            </if>
+            <if test="param.cooperationOrganId != null">
+                and mg.cooperation_organ_id_ = #{param.cooperationOrganId}
+            </if>
+        </where>
+        order by cg.teaching_point_ is null ,cg.id_ desc
+    </select>
+</mapper>

+ 0 - 2
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -40,8 +40,6 @@ public class WebApplication {
 
     /**
      * 注册filter
-     *
-     * @return
      */
     @Bean
     public FilterRegistrationBean<Filter> filterRegistrationBean() {

+ 23 - 9
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -1,13 +1,12 @@
 package com.ym.mec.web.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.ClassGroupDao;
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
-import com.ym.mec.biz.dal.entity.CourseScheduleStatistics;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
@@ -17,16 +16,19 @@ import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.wrapper.TeachingPointWrapper;
 import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
+import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.PageUtil;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
@@ -48,6 +50,12 @@ public class ClassGroupController extends BaseController {
     @Autowired
     private OrganizationService organizationService;
 
+    @Autowired
+    private CourseScheduleService courseScheduleService;
+
+    @Autowired
+    private ClassGroupDao classGroupDao;
+
     @ApiOperation(value = "分页查询班级列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryPage')")
@@ -428,25 +436,31 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "学校端-场地管理列表")
     @PostMapping("/teachingPointCourse")
     public HttpResponseResult<PageInfo<TeachingPointWrapper.CourseTeachingPoint>> teachingPoint(@RequestBody TeachingPointWrapper.TeachingPointQuery queryInfo) {
-        return succeed(null);
+
+        IPage<TeachingPointWrapper.CourseTeachingPoint> courseTeachingPointIPage = courseScheduleService.teachingPointCourse(queryInfo);
+
+        return succeed(PageUtil.pageInfo(courseTeachingPointIPage));
     }
 
     @ApiOperation(value = "学校端-场地设置列表")
     @PostMapping("/teachingPointClass")
     public HttpResponseResult<PageInfo<TeachingPointWrapper.ClassTeachingPoint>> teachingPointClass(@RequestBody TeachingPointWrapper.TeachingPointQuery queryInfo) {
-        return succeed(null);
+        IPage<TeachingPointWrapper.ClassTeachingPoint> classTeachingPointIPage = courseScheduleService.teachingPointClass(queryInfo);
+
+        return succeed(PageUtil.pageInfo(classTeachingPointIPage));
     }
 
     @ApiOperation(value = "学校端-场地管理红点")
     @PostMapping("/teachingPointRemind")
     public HttpResponseResult<Boolean> teachingPointRemind() {
-        return succeed(null);
+        Integer cooperationOrganId = null;
+        return succeed(classGroupDao.teachingPointRemind(cooperationOrganId) >0);
     }
 
 
     @ApiOperation(value = "学校端-场地设置")
     @PostMapping("/teachingPoint")
-    public HttpResponseResult<Boolean> teachingPointRemind(@RequestBody TeachingPointWrapper.TeachingPoint teachingPoint) {
-        return succeed(null);
+    public HttpResponseResult<Boolean> teachingPoint(@Validated @RequestBody TeachingPointWrapper.TeachingPoint teachingPoint) {
+        return succeed(courseScheduleService.teachingPoint(teachingPoint));
     }
 }

+ 7 - 4
mec-web/src/main/java/com/ym/mec/web/controller/school/CoursePatrolEvaluationController.java

@@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.microsvc.toolkit.common.response.paging.PageInfo;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.config.validator.group.ValidGroups;
 import com.ym.mec.biz.dal.entity.CoursePatrolEvaluation;
 import com.ym.mec.biz.dal.wrapper.CoursePatrolEvaluationWrapper;
 import com.ym.mec.biz.service.CoursePatrolEvaluationService;
 import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -43,7 +45,8 @@ public class CoursePatrolEvaluationController extends BaseController {
     @PostMapping("/pageStat")
     public HttpResponseResult<PageInfo<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationStat>> pageStat(@RequestBody CoursePatrolEvaluationWrapper.CoursePatrolEvaluationQuery query) {
 
-        return succeed(null);
+        IPage<CoursePatrolEvaluationWrapper.CoursePatrolEvaluationStat> page = coursePatrolEvaluationService.pageStat(QueryInfo.getPage(query), query);
+        return succeed(QueryInfo.pageInfo(page));
     }
 
 
@@ -68,17 +71,17 @@ public class CoursePatrolEvaluationController extends BaseController {
     
     @ApiOperation(value = "学校端-添加巡堂信息", notes = "巡堂详情- 传入 CoursePatrolEvaluationWrapper.CoursePatrolEvaluation")
 	@PostMapping("/save")
-	public HttpResponseResult<JSONObject> add(@Validated @RequestBody CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation) {
+	public HttpResponseResult<JSONObject> add(@Validated(value = ValidGroups.Add.class) @RequestBody CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation) {
         
         // 新增数据
-        coursePatrolEvaluationService.update(coursePatrolEvaluation);
+        coursePatrolEvaluationService.add(coursePatrolEvaluation);
         
         return succeed();
 	}
     
     @ApiOperation(value = "web-处理意见,学校端-修改", notes = "巡堂详情- 传入 CoursePatrolEvaluationWrapper.CoursePatrolEvaluation")
 	@PostMapping("/update")
-	public HttpResponseResult<JSONObject> update(@Validated(value = Update.class) @RequestBody CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation) {
+	public HttpResponseResult<JSONObject> update(@Validated(value = ValidGroups.Update.class) @RequestBody CoursePatrolEvaluationWrapper.CoursePatrolEvaluation coursePatrolEvaluation) {
         
         // 更新数据
         coursePatrolEvaluationService.update(coursePatrolEvaluation);

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/school/SchoolActivityController.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.microsvc.toolkit.common.response.paging.PageInfo;
 import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.microsvc.toolkit.config.validator.group.ValidGroups;
 import com.ym.mec.biz.dal.entity.SchoolActivity;
 import com.ym.mec.biz.dal.wrapper.SchoolActivityWrapper;
 import com.ym.mec.biz.service.SchoolActivityService;
@@ -63,7 +64,7 @@ public class SchoolActivityController extends BaseController {
     
     @ApiOperation(value = "修改", notes = "学校活动- 传入 SchoolActivityWrapper.SchoolActivity")
 	@PostMapping("/update")
-	public HttpResponseResult<JSONObject> update(@Validated(value = Update.class) @RequestBody SchoolActivityWrapper.SchoolActivityDetail schoolActivity) {
+	public HttpResponseResult<JSONObject> update(@Validated(value = ValidGroups.Update.class) @RequestBody SchoolActivityWrapper.SchoolActivityDetail schoolActivity) {
         
         return succeed();
 	}