فهرست منبع

Merge branch 'master' of http://git.dayaedu.com/yonge/mec into online1

zouxuan 4 سال پیش
والد
کامیت
518f0ead71
73فایلهای تغییر یافته به همراه1516 افزوده شده و 516 حذف شده
  1. 11 0
      cms/src/main/java/com/ym/mec/cms/controller/queryinfo/NewsInformationQueryInfo.java
  2. 20 0
      cms/src/main/java/com/ym/mec/cms/dal/entity/SysNewsInformation.java
  3. 49 33
      cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  4. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  5. 14 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java
  6. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanDao.java
  7. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java
  8. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  9. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  10. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentServeCourseDto.java
  11. 23 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendancesDto.java
  12. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVisitDto.java
  13. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlan.java
  14. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java
  15. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java
  16. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java
  17. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionItemPlanQueryInfo.java
  18. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionQueryInfo.java
  19. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupQuitQueryInfo.java
  20. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java
  21. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherCloseQueryInfo.java
  22. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java
  23. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanService.java
  24. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentServeService.java
  25. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java
  26. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java
  27. 0 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java
  28. 130 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  29. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanConclusionServiceImpl.java
  30. 37 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java
  31. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java
  32. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionServiceImpl.java
  33. 218 212
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  34. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java
  35. 96 11
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java
  36. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java
  37. 20 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  38. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  39. 23 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  40. 67 42
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  41. 10 6
      mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml
  42. 31 4
      mec-biz/src/main/resources/config/mybatis/InspectionItemPlanMapper.xml
  43. 26 13
      mec-biz/src/main/resources/config/mybatis/InspectionMapper.xml
  44. 14 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  45. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  46. 22 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupQuitMapper.xml
  47. 44 78
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  48. 41 0
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  49. 16 1
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  50. 6 3
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  51. 2 2
      mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml
  52. 8 1
      mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml
  53. 1 1
      mec-biz/src/main/resources/config/mybatis/TeacherCourseStatisticsMapper.xml
  54. 10 0
      mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java
  55. 10 0
      mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java
  56. 4 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  57. 19 0
      mec-task/src/main/java/com/ym/mec/task/jobs/CloseStudentServiceTagTask.java
  58. 19 0
      mec-task/src/main/java/com/ym/mec/task/jobs/InspectionPlanTask.java
  59. 11 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherAttendanceController.java
  60. 92 0
      mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java
  61. 7 6
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  62. 7 3
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  63. 41 16
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  64. 11 0
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java
  65. 6 1
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java
  66. 46 9
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanConclusionController.java
  67. 33 0
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java
  68. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java
  69. 4 2
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java
  70. 15 0
      mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java
  71. 17 1
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java
  72. 17 1
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java
  73. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

+ 11 - 0
cms/src/main/java/com/ym/mec/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -27,6 +27,9 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@ApiModelProperty(value = "租客编号", required = false)
 	private Integer tenantId;
 	
+	@ApiModelProperty(value = "声部编号", required = false)
+	private Integer subjectId;
+	
 	private String clientName;
 	
 	private Date date;
@@ -94,4 +97,12 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	public void setClientName(String clientName) {
 		this.clientName = clientName;
 	}
+
+	public Integer getSubjectId() {
+		return subjectId;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
 }

+ 20 - 0
cms/src/main/java/com/ym/mec/cms/dal/entity/SysNewsInformation.java

@@ -72,6 +72,10 @@ public class SysNewsInformation {
 	private String attribute1;
 	
 	private String attribute2;
+	
+	private String subjectIdList;
+	
+	private String subjectName;
 
 	public String getLinkUrl() {
 		return linkUrl;
@@ -233,6 +237,22 @@ public class SysNewsInformation {
 		this.offlineTime = offlineTime;
 	}
 
+	public String getSubjectIdList() {
+		return subjectIdList;
+	}
+
+	public void setSubjectIdList(String subjectIdList) {
+		this.subjectIdList = subjectIdList;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 49 - 33
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -27,36 +27,41 @@
 		<result column="tenant_id_" property="tenantId" />
 		<result column="attribute1_" property="attribute1" />
 		<result column="attribute2_" property="attribute2" />
+		<result column="subject_id_list_" property="subjectIdList" />
+		<result column="subject_name_" property="subjectName" />
 	</resultMap>
 	
 	<sql id="queryCondition">
 		<where>
-			del_flag_=0 
+			sni.del_flag_=0 
 			<if test="type != null">
-				and type_ = #{type}
+				and sni.type_ = #{type}
 			</if>
 			<if test="subType != null">
-				and sub_type_ = #{subType}
+				and sni.sub_type_ = #{subType}
 			</if>
 			<if test="tenantId != null">
-				and tenant_id_ = #{tenantId}
+				and sni.tenant_id_ = #{tenantId}
 			</if>
 			<if test="status != null">
-				and status_ = #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				and sni.status_ = #{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 			<if test="title != null">
-				and title_ like '%' #{title} '%'
+				and sni.title_ like '%' #{title} '%'
 			</if>
 			<if test="search != null">
-				and title_ like '%' #{search} '%'
+				and sni.title_ like '%' #{search} '%'
+			</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
 			<if test="clientName != 'manage'">
 				<choose>
 					<when test="memo != null and memo != ''">
-						and memo_ = #{memo}
+						and sni.memo_ = #{memo}
 					</when>
 					<otherwise>
-						and (memo_ is null or memo_ = '')
+						and (sni.memo_ is null or sni.memo_ = '')
 					</otherwise>
 				</choose>
 			</if>
@@ -75,8 +80,8 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.cms.dal.entity.SysNewsInformation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_)
-		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2})
+		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_,subject_id_list_)
+		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2},#{subjectIdList})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -137,6 +142,9 @@
 			<if test="attribute2 != null">
 				attribute2_ = #{attribute2},
 			</if>
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
+			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>
@@ -148,15 +156,16 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysNewsInformation" parameterType="map">
-		SELECT * FROM sys_news_information
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_)
 		<include refid="queryCondition" />
-		order by status_ desc,order_ desc,update_time_ desc
+		group by sni.id_
+		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
 		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM sys_news_information
+		SELECT COUNT(sni.id_) FROM sys_news_information sni
 		<include refid="queryCondition" />
 	</select>
 	
@@ -177,69 +186,76 @@
 	<!-- 分页查询 -->
 	<select id="queryHomePage" resultMap="SysNewsInformation"
 		parameterType="map">
-		SELECT * FROM sys_news_information where del_flag_=0
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_) where sni.del_flag_=0
 		<if test="type != null">
-			and type_ = #{type}
+			and sni.type_ = #{type}
 		</if>
 		<if test="subType != null">
-			and sub_type_ = #{subType}
+			and sni.sub_type_ = #{subType}
 		</if>
 		<if test="status != null">
-			and status_ = #{status,
+			and sni.status_ = #{status,
 			typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 		</if>
 		<if test="title != null">
-			and title_ like '%' #{title} '%'
+			and sni.title_ like '%' #{title} '%'
 		</if>
 		<if test="search != null">
-			and title_ like '%' #{search} '%'
+			and sni.title_ like '%' #{search} '%'
 		</if>
 		<if test="tenantId != null">
-			and tenant_id_ = #{tenantId}
+			and sni.tenant_id_ = #{tenantId}
 		</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">
-					and memo_ = #{memo}
+					and sni.memo_ = #{memo}
 				</when>
 				<otherwise>
-					and (memo_ is null or memo_ = '')
+					and (sni.memo_ is null or sni.memo_ = '')
 				</otherwise>
 			</choose>
 		</if>
-		order by status_ desc,order_ desc,update_time_ desc
+		group by sni.id_
+		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryHomeCount" resultType="int">
-		SELECT COUNT(*) FROM sys_news_information where del_flag_=0
+		SELECT COUNT(sni.id_) FROM sys_news_information sni where sni.del_flag_=0
 		<if test="type != null">
-			and type_ = #{type}
+			and sni.type_ = #{type}
 		</if>
 		<if test="subType != null">
-			and sub_type_ = #{subType}
+			and sni.sub_type_ = #{subType}
 		</if>
 		<if test="status != null">
-			and status_ = #{status,
+			and sni.status_ = #{status,
 			typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 		</if>
 		<if test="title != null">
-			and title_ like '%' #{title} '%'
+			and sni.title_ like '%' #{title} '%'
 		</if>
 		<if test="search != null">
-			and title_ like '%' #{search} '%'
+			and sni.title_ like '%' #{search} '%'
 		</if>
 		<if test="tenantId != null">
-			and tenant_id_ = #{tenantId}
+			and sni.tenant_id_ = #{tenantId}
 		</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">
-					and memo_ = #{memo}
+					and sni.memo_ = #{memo}
 				</when>
 				<otherwise>
-					and (memo_ is null or memo_ = '')
+					and (sni.memo_ is null or sni.memo_ = '')
 				</otherwise>
 			</choose>
 		</if>

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -456,4 +456,14 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      */
     Set<Integer> queryStudentIdsByClassGroupId(@Param("classGroupId") Integer classGroupId,@Param("musicGroupId") String musicGroupId,
                                                @Param("groupType") GroupType groupType);
+
+    /**
+     * @describe 获取学员班级主教关联记录
+     * @author Joburgess
+     * @date 2021/1/25 0025
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.BaseMapDto>
+     */
+    List<BaseMapDto<Integer, Integer>> getStudentClassGroupBishopTeacherMap(@Param("studentIds") List<Integer> studentIds,
+                                                                            @Param("musicGroupId") String musicGroupId);
 }

+ 14 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.poi.ss.formula.functions.Index;
 
 import java.util.Collection;
+import java.util.Date;
 import java.util.List;
 import java.util.Set;
 
@@ -104,13 +105,15 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds);
     List<String> getLessThenThreeMusicGroup(@Param("organIds") Set<Integer> organIds);
 
+    List<Long> queryErrInspection(@Param("organIds") Set<Integer> organIds);
+
     int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds);
     List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds);
 
-    int countApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
+    List<Long> queryApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
 
-    int countStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
-                                   @Param("type") String type);
+    List<Long> queryStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
+                                          @Param("type") String type, @Param("firstDayOfMonth") Date firstDayOfMonth);
 
 
     /**
@@ -118,14 +121,14 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @param organIds
      * @return
      */
-    List<Long> getAttendanceError(@Param("organIds") String organIds);
+    List<Long> getAttendanceError(@Param("organIds") String organIds, @Param("firstDayOfMonth") Date firstDayOfMonth);
 
     /**
      * 获取旷课考勤
      * @param organIds
      * @return
      */
-    List<Long> getNoAttendance(@Param("organIds") String organIds);
+    List<Long> getNoAttendance(@Param("organIds") String organIds, @Param("firstDayOfMonth") Date firstDayOfMonth);
 
     /**
      * 获取老师离职申请数
@@ -162,4 +165,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @return
      */
     List<Long> queryStudentVisit(@Param("organIdsStr") String organIdsStr);
+
+    List<IndexBaseMonthData> getFinancePayData();
+
+    List<IndexBaseMonthData> getFinanceBalanceData();
+
+    List<IndexBaseMonthData> getFinanceActualData();
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/InspectionItemPlanDao.java

@@ -2,7 +2,27 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
 
 public interface InspectionItemPlanDao extends BaseDAO<Long, InspectionItemPlan> {
 
+    /**
+     * 获取当天的巡查计划
+     *
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    List<InspectionItemPlan> getStartPlan(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    /**
+     * 获取巡查日程详情
+     *
+     * @param id
+     * @return
+     */
+    InspectionItemPlan getPlanInfo(@Param("id") Long id);
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.CalenderPushDto;
 import com.ym.mec.biz.dal.dto.MusicCardDto;
 import com.ym.mec.biz.dal.dto.MusicGroupRegisterDto;
@@ -328,6 +329,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
 
     /**
      * 根据分部和教务老师查询乐团列表
+     *
      * @param educationId
      * @param organIds
      * @return
@@ -336,8 +338,24 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
 
     /**
      * 获取乐团的教学点
+     *
      * @param id
      * @return
      */
     School getMusicGroupSchool(@Param("id") String id);
+
+    /**
+     * 获取乐团主管进行中的乐团
+     *
+     * @param eduTeacherId
+     * @return
+     */
+    List<MusicGroup> getByEduTeacher(@Param("organId") Integer organId, @Param("eduTeacherId") Integer eduTeacherId, @Param("search") String search);
+
+    /**
+     * 获取进行中的乐团的教务老师
+     * @param organId
+     * @return
+     */
+    List<SysUser> getMusicGroupEduTeacher(@Param("organId") Integer organId);
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -101,6 +101,8 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
                                                            @Param("nextMonday") String nextMonday,
                                                            @Param("studentIds") List<Integer> studentIds);
 
+    List<StudentServeCourseDto> getNoCourseBeServeStudentInfo(@Param("noCourseStudentIds") List<Integer> noCourseStudentIds);
+
     /**
      * @param monday:
      * @return java.util.List<com.ym.mec.biz.dal.dto.StudentServeDto>
@@ -159,4 +161,17 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @return
      */
     List<Student> getStudentTeacher(@Param("studentIds") List<Integer> studentIds);
+
+    /**
+     * 当前服务指标已开启,但在系统中没有剩余课时,且在乐团中不是在读状态,这种用户需要关闭服务指标
+     * @return
+     */
+    List<Integer> queryCloseServiceTagIds();
+
+    /**
+     * 更新用户服务指标
+     * @param studentIds
+     * @param serviceTag
+     */
+    void updateServiceTag(@Param("studentIds") List<Integer> studentIds, @Param("serviceTag") Integer serviceTag);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -398,4 +398,11 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      * @return
      */
     List<StudentPaymentOrder> getAdaPayOrdersByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
+
+    /**
+     * 获取首页昨日支出、昨日收入(现金)、昨日收入(余额)
+     * @param organId
+     * @return
+     */
+    Map<String, BigDecimal> queryFinanceCurrentDay(@Param("organId") String organId);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentServeCourseDto.java

@@ -22,6 +22,8 @@ public class StudentServeCourseDto {
 
     private String musicGroupId;
 
+    private Long classGroupId;
+
     private CourseSchedule.CourseScheduleType type;
 
     private Integer actualTeacherId;
@@ -96,6 +98,14 @@ public class StudentServeCourseDto {
         this.musicGroupId = musicGroupId;
     }
 
+    public Long getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Long classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+
     public CourseSchedule.CourseScheduleType getType() {
         return type;
     }

+ 23 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendancesDto.java

@@ -2,10 +2,7 @@ package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.TeacherAttendance;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.SignInStatusEnum;
-import com.ym.mec.biz.dal.enums.SignOutStatusEnum;
-import com.ym.mec.biz.dal.enums.TeachTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 
 import io.swagger.annotations.ApiModelProperty;
 
@@ -16,6 +13,9 @@ public class TeacherAttendancesDto {
     @ApiModelProperty(value = "老师名",required = false)
 	private String teacherName;
 
+    @ApiModelProperty(value = "工作性质(兼职 PART_JOB、全职FULL_JOB)", required = false)
+    private JobNatureEnum jobNature;
+
     private TeachTypeEnum teacherRole;
     
     private TeacherAttendance teacherAttendance = new TeacherAttendance();
@@ -70,6 +70,25 @@ public class TeacherAttendancesDto {
     @ApiModelProperty(value = "签退时间",required = false)
     private Date signOutTime;
 
+    @ApiModelProperty(value = "申述处理状态",required = false)
+    private ComplaintsStatusEnum complaintsStatus;
+
+    public ComplaintsStatusEnum getComplaintsStatus() {
+        return complaintsStatus;
+    }
+
+    public void setComplaintsStatus(ComplaintsStatusEnum complaintsStatus) {
+        this.complaintsStatus = complaintsStatus;
+    }
+
+    public JobNatureEnum getJobNature() {
+        return jobNature;
+    }
+
+    public void setJobNature(JobNatureEnum jobNature) {
+        this.jobNature = jobNature;
+    }
+
     public String getOrganName() {
         return organName;
     }

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVisitDto.java

@@ -1,9 +1,11 @@
 package com.ym.mec.biz.dal.dto;
 
 /**
- * 老师访
+ * 老师访数
  */
 public class TeacherVisitDto {
+    private Integer organId;
+
     private Integer teacherId;
 
     private String month;
@@ -33,4 +35,12 @@ public class TeacherVisitDto {
     public void setMonth(String month) {
         this.month = month;
     }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/InspectionItemPlan.java

@@ -127,6 +127,9 @@ public class InspectionItemPlan {
     @ApiModelProperty(value = "打卡范围")
     private Integer attendanceRange;
 
+    @ApiModelProperty(value = "乐团主管名字")
+    private String realName;
+
     public Long getId() {
         return id;
     }
@@ -302,4 +305,12 @@ public class InspectionItemPlan {
     public void setAttendanceRange(Integer attendanceRange) {
         this.attendanceRange = attendanceRange;
     }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
 }

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -38,7 +38,11 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
 
     MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课"),
     VIP_GROUP_COURSE("VIP_GROUP_COURSE","VIP课"),
-    PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课");
+    PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课"),
+
+    FINANCE_PAY("FINANCE_PAY","财务支出"),
+    FINANCE_BALANCE_AMOUNT("FINANCE_BALANCE_AMOUNT","余额收入"),
+    FINANCE_AMOUNT("FINANCE_AMOUNT","现金收入");
 
     private String code;
 

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -162,7 +162,8 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     SMS_PAYMENT_CREATE("SMS_PAYMENT_CREATE","缴费项目创建提醒"),
     SMS_GOODS_REPERTORY_WARN("SMS_GOODS_REPERTORY_WARN","商品库存预警"),
     SMS_REPAIR_SEND_COMPLETED("SMS_REPAIR_SEND_COMPLETED","乐器维修完成邮寄"),
-    SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE("SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE","乐团家长会通知");
+    SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE("SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE","乐团家长会通知"),
+    SMS_INSPECTION_NOTICE("SMS_INSPECTION_NOTICE","巡查日程提醒");
 
 
 

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java

@@ -15,7 +15,8 @@ public enum SporadicChargeTypeEnum implements BaseEnum<Integer, SporadicChargeTy
     MUSIC_UPKEEP(10,"乐保服务"),
     OTHER(11,"其他"),
     DOUBLE_ELEVEN2020(12,"2020双十一活动"),
-    HIGH_ONLINE_ACTIVITY(13,"网基课活动");
+    HIGH_ONLINE_ACTIVITY(13,"网基课活动"),
+    PRACTICE_GROUP_BUY(14,"关心包");
 
     private Integer code;
 

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionItemPlanQueryInfo.java

@@ -38,6 +38,9 @@ public class InspectionItemPlanQueryInfo extends QueryInfo {
 
     private Date endTime;
 
+    @ApiModelProperty(value = "ids",required = false)
+    private String ids;
+
     public Date getStartTime() {
         return startTime;
     }
@@ -125,4 +128,12 @@ public class InspectionItemPlanQueryInfo extends QueryInfo {
     public void setStatus(Integer status) {
         this.status = status;
     }
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/InspectionQueryInfo.java

@@ -23,6 +23,9 @@ public class InspectionQueryInfo extends QueryInfo {
 
     private Date endTime;
 
+    @ApiModelProperty(value = "ids",required = false)
+    private String ids;
+
 	public String getOrganId() {
 		return organId;
 	}
@@ -70,4 +73,12 @@ public class InspectionQueryInfo extends QueryInfo {
     public void setEndTime(Date endTime) {
         this.endTime = endTime;
     }
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupQuitQueryInfo.java

@@ -0,0 +1,16 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class MusicGroupQuitQueryInfo extends QueryInfo {
+
+    private String ids;
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java

@@ -53,6 +53,17 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "分部")
     private String organId;
 
+    @ApiModelProperty(value = "courseScheduleStudentPaymentId")
+    private String ids;
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
+
     public Long getCourseScheduleId() {
         return courseScheduleId;
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherCloseQueryInfo.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.page;
 
+import com.ym.mec.biz.dal.enums.JobNatureEnum;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -37,6 +38,17 @@ public class TeacherCloseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "分部")
     private String organId;
 
+    @ApiModelProperty(value = "工作性质(兼职 PART_JOB、全职FULL_JOB)", required = false)
+    private JobNatureEnum jobNature;
+
+    public JobNatureEnum getJobNature() {
+        return jobNature;
+    }
+
+    public void setJobNature(JobNatureEnum jobNature) {
+        this.jobNature = jobNature;
+    }
+
     public String getTeacherAttendanceId() {
         return teacherAttendanceId;
     }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java

@@ -23,4 +23,10 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
      */
     List<IndexErrInfoDto> getRemindMatterData(String organIds);
 
+    /**
+     * 是否有提醒事项
+     * @param organIds
+     * @return
+     */
+    Map<String,Boolean> hasIndexErrData(String organIds);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/InspectionItemPlanService.java

@@ -5,6 +5,8 @@ import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface InspectionItemPlanService extends BaseService<Long, InspectionItemPlan> {
 
     /**
@@ -26,6 +28,13 @@ public interface InspectionItemPlanService extends BaseService<Long, InspectionI
      * @return
      */
     InspectionItemPlan updatePlan(InspectionItemPlan inspectionItemPlan);
+
+
+    /**
+     * 推送有开始的巡查日程
+     * @return
+     */
+    List<InspectionItemPlan> pushNotice();
 }
 
 

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentServeService.java

@@ -53,4 +53,8 @@ public interface StudentServeService {
      */
     Set<Integer> getStudentWithCourse(Long courseId);
 
+    /**
+     * 更新学生服务指标
+     */
+    void closeStudentServiceTag();
 }

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

@@ -2,6 +2,8 @@ package com.ym.mec.biz.service;
 
 import java.text.ParseException;
 
+import org.springframework.http.ResponseEntity;
+
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.page.StudentQueryInfo;
 import com.ym.mec.common.page.PageInfo;

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

@@ -160,13 +160,13 @@ public interface TeacherAttendanceService extends BaseService<Long, TeacherAtten
 	 * @param courseScheduleId
 	 * @param content
 	 */
-	void addComplaints(Long courseScheduleId, String content,String url);
+	void addComplaints(Long courseScheduleId, String content,String url,Integer userId);
 
 	/**
 	 * 撤销考勤申述
 	 * @param courseScheduleId
 	 */
-	void repealComplaints(Long courseScheduleId);
+	void repealComplaints(Long courseScheduleId,Integer userId);
 
 	/**
 	 * 获取教师申述列表

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

@@ -1,20 +1,14 @@
 package com.ym.mec.biz.service.impl;
 
-import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.ClassGroupTeachersDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.service.*;
-import com.ym.mec.common.constant.CommonConstants;
 import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.entity.ImGroupMember;
-import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.collection.MapUtil;
-import com.ym.mec.util.date.DateUtil;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;

+ 130 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -195,6 +195,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		saveData(indexBaseMonthDataDao.getGroupCourseData(month, GroupType.VIP), month, IndexDataType.VIP_GROUP_COURSE);
 		saveData(indexBaseMonthDataDao.getGroupCourseData(month, GroupType.PRACTICE), month, IndexDataType.PRACTICE_GROUP_COURSE);
 
+		//财务数据
+//		saveData(indexBaseMonthDataDao.getFinancePayData(),month,IndexDataType.FINANCE_PAY);
+//		saveData(indexBaseMonthDataDao.getFinanceBalanceData(),month,IndexDataType.FINANCE_BALANCE_AMOUNT);
+//		saveData(indexBaseMonthDataDao.getFinanceActualData(),month,IndexDataType.FINANCE_AMOUNT);
+
 		return result;
 	}
 
@@ -323,6 +328,9 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexErrInfoDto> oneChild = new ArrayList<>();
 
 		oneChild.add(new IndexErrInfoDto(IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE, IndexErrorType.HIGH_CLASS_STUDENT_LESS_THAN_THREE.getMsg(), indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds), indexBaseMonthDataDao.getLessThenThreeMusicGroup(organIds)));
+		List<Long> errInspection = indexBaseMonthDataDao.queryErrInspection(organIds);
+		oneChild.add(new IndexErrInfoDto(IndexErrorType.MUSIC_PATROL_ITEM, IndexErrorType.MUSIC_PATROL_ITEM.getMsg(),errInspection.size(), errInspection));
+
 		one.setNum(oneChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 		one.setResult(oneChild);
 		all.add(one);
@@ -333,10 +341,16 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		two.setDesc(IndexErrorType.STUDENT_INFO.getMsg());
 		List<IndexErrInfoDto> twoChild = new ArrayList<>();
 
+
+		Date firstDayOfMonth = DateUtil.getFirstDayOfMonth(DateUtil.addMonths(date, -1));
+
 		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds), indexBaseMonthDataDao.getNoPaymentMusicGroup(organIds)));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), indexBaseMonthDataDao.countApplyForQuitGroupNum(organIds),  null));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode()), null));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode()), null));
+		List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
+		List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),firstDayOfMonth);
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), attendanceInfo));
+		List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),null);
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), attendanceInfo1));
 		two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 		two.setResult(twoChild);
 		all.add(two);
@@ -347,10 +361,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		three.setDesc(IndexErrorType.TEACHER_INFO.getMsg());
 		List<IndexErrInfoDto> threeChild = new ArrayList<>();
 
-		List<Long> attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr);
+		List<Long> attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,firstDayOfMonth);
 		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError.size(), attendanceError));
 
-		List<Long> noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr);
+		List<Long> noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,firstDayOfMonth);
 		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance.size(), noAttendance));
 
 		List<Long> teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr);
@@ -358,7 +372,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
 		List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
-		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), null));
+		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), lowTeacherSalary));
 
 		List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
 		threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem.size(), inspectionItem));
@@ -407,4 +421,114 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		result.add(indexErrInfoDto);
 		return result;
 	}
+
+	@Override
+	public Map<String,Boolean> hasIndexErrData(String organIdsStr) {
+		Map<String,Boolean> resultMap = new HashMap<>();
+		Set<Integer> organIds = null;
+		if(StringUtils.isNotBlank(organIdsStr)){
+			organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
+		}
+		Date date = new Date();
+		boolean flag = false;
+		int countLessThenThreeClassGroupNum = indexBaseMonthDataDao.countLessThenThreeClassGroupNum(organIds);
+		if(countLessThenThreeClassGroupNum > 0){
+			flag = true;
+		}
+		if(!flag){
+			List<Long> errInspection = indexBaseMonthDataDao.queryErrInspection(organIds);
+			if(errInspection.size() > 0){
+				flag = true;
+			}
+		}
+		Date firstDayOfMonth = DateUtil.getFirstDayOfMonth(DateUtil.addMonths(date, -1));
+		if(!flag){
+			int countNoPaymentStudentNum = indexBaseMonthDataDao.countNoPaymentStudentNum(organIds);
+			if(countNoPaymentStudentNum > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
+			if(quitGroupNum.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),firstDayOfMonth);
+			if(attendanceInfo.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),null);
+			if(attendanceInfo1.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,firstDayOfMonth);
+			if(attendanceError.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,firstDayOfMonth);
+			if(noAttendance.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr);
+			if(teacherLeave.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
+			List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
+			if(lowTeacherSalary.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
+			if(inspectionItem.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> inspectionItemPlan = indexBaseMonthDataDao.queryInspectionItemPlan(organIdsStr);
+			if(inspectionItemPlan.size() > 0){
+				flag = true;
+			}
+		}
+		if(!flag){
+			List<Long> studentVisit = indexBaseMonthDataDao.queryStudentVisit(organIdsStr);
+			if(studentVisit.size() > 0){
+				flag = true;
+			}
+		}
+		resultMap.put("indexErrData",flag);
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			throw new BizException("用户信息获取失败");
+		}
+		//当前用户是否是分部经理
+		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+		//获取关联的乐团列表
+		List<String> musicGroupIds = musicGroupDao.queryIdsByEduIdAndOrganIds(userRole.contains(3)?sysUser.getId():null,organIdsStr);
+		String configValue1 = sysConfigDao.findConfigValue("push_create_payment_calender");
+		date = new Date();
+		String format = DateUtil.format(date, DateUtil.DEFAULT_PATTERN);
+		if(musicGroupIds.size() > 0){
+			List<Long> calenderIds = musicGroupPaymentCalenderDao.queryEndIds(configValue1, format,musicGroupIds);
+			if(calenderIds.size() > 0){
+				resultMap.put("indexErrData",true);
+			}else {
+				resultMap.put("remindMatterData",false);
+			}
+		}
+		return resultMap;
+	}
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanConclusionServiceImpl.java

@@ -121,7 +121,7 @@ public class InspectionItemPlanConclusionServiceImpl extends BaseServiceImpl<Lon
         if (courseSchedules.size() > 0) {
             return courseSchedules;
         }
-        courseSchedules = courseScheduleDao.getMusicGroupCourseInfo(plan.getMusicGroupId(), plan.getPlanStart(), plan.getPlanEnd());
+        courseSchedules = courseScheduleDao.getMusicGroupCourseInfo(plan.getMusicGroupId(), DateUtil.trunc(plan.getPlanStart()), DateUtil.getLastTimeWithDay(plan.getPlanStart()));
         return courseSchedules;
     }
 

+ 37 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemPlanServiceImpl.java

@@ -2,24 +2,23 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.CheckItemDto;
-import com.ym.mec.biz.dal.entity.Inspection;
-import com.ym.mec.biz.dal.entity.InspectionItem;
-import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.biz.service.InspectionItemPlanService;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -37,6 +36,10 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
     private InspectionItemPlanConclusionDao inspectionItemPlanConclusionDao;
     @Autowired
     private SysConfigDao sysConfigDao;
+    @Autowired
+    private SysMessageService sysMessageService;
+    @Autowired
+    private SchoolDao schoolDao;
 
     @Override
     public BaseDAO<Long, InspectionItemPlan> getDAO() {
@@ -85,14 +88,17 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
             throw new BizException("日程时间不能晚于工作周期结束时间");
         }
         //获取乐团教学点的GPS信息
-        School school = musicGroupDao.getMusicGroupSchool(inspectionItemPlan.getMusicGroupId());
+        MusicGroup musicGroup = musicGroupDao.get(inspectionItemPlan.getMusicGroupId());
+        School school = schoolDao.get(musicGroup.getSchoolId());
 
         inspectionItemPlan.setOrganId(inspectionItem.getOrganId());
+        inspectionItemPlan.setCooperationOrganId(musicGroup.getCooperationOrganId());
         inspectionItemPlan.setInspectionId(inspectionItem.getInspectionId());
         inspectionItemPlan.setSchoolGps(school.getLongitudeLatitude());
         inspectionItemPlan.setSubmitedGps("");
         inspectionItemPlan.setMemo("");
         inspectionItemPlan.setStatus(0);
+        inspectionItemPlan.setConclusionStatus(0);
         inspectionItemPlan.setCreateTime(nowDate);
         inspectionItemPlan.setUpdateTime(nowDate);
         inspectionItemPlanDao.insert(inspectionItemPlan);
@@ -128,8 +134,11 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
         }
         //获取乐团教学点的GPS信息
         if (oldPlan.getStatus().equals(0)) { //未提交的修改
-            School school = musicGroupDao.getMusicGroupSchool(inspectionItemPlan.getMusicGroupId());
+            //获取乐团教学点的GPS信息
+            MusicGroup musicGroup = musicGroupDao.get(inspectionItemPlan.getMusicGroupId());
+            School school = schoolDao.get(musicGroup.getSchoolId());
             inspectionItemPlan.setInspectionId(inspectionItem.getInspectionId());
+            inspectionItemPlan.setCooperationOrganId(musicGroup.getCooperationOrganId());
             inspectionItemPlan.setSchoolGps(school.getLongitudeLatitude());
             inspectionItemPlan.setSubmitedGps("");
             inspectionItemPlan.setMemo("");
@@ -139,6 +148,26 @@ public class InspectionItemPlanServiceImpl extends BaseServiceImpl<Long, Inspect
         inspectionItemPlanDao.update(inspectionItemPlan);
         return inspectionItemPlan;
     }
+
+    @Override
+    public List<InspectionItemPlan> pushNotice() {
+        Date nowDate = new Date();
+        Date startTime = DateUtil.getFirstDayOfMonth(nowDate);
+        Date endTime = DateUtil.getLastTimeWithDay(DateUtil.getLastDayOfMonth(nowDate));
+        List<InspectionItemPlan> startPlans = inspectionItemPlanDao.getStartPlan(startTime,endTime);
+        Set<Integer> userIds = startPlans.stream().map(InspectionItemPlan::getUserId).collect(Collectors.toSet());
+        //发送推送信息
+        Map<Integer, String> userMap = new HashMap<>();
+        for (Integer userId : userIds) {
+            userMap.put(userId, userId.toString());
+        }
+
+        String baseApiUrl = sysConfigDao.findConfigValue(SysConfigService.EDU_TEACHER_BASE_URL);
+        String pushUrl = baseApiUrl + "/#/musicInspection";
+        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_INSPECTION_NOTICE,
+                userMap, null, 0, "8?" + pushUrl, "EDU_TEACHER");
+        return startPlans;
+    }
 }
 
 

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionItemServiceImpl.java

@@ -54,6 +54,7 @@ public class InspectionItemServiceImpl extends BaseServiceImpl<Long, InspectionI
                 if (row.getItem().equals(InspectionItemEnum.INSPECT)) continue;
                 for (TeacherVisitDto teacherVisitCount : teacherVisitCounts) {
                     if (teacherVisitCount.getTeacherId().equals(row.getUserId()) &&
+                            teacherVisitCount.getOrganId().equals(row.getOrganId()) &&
                             DateUtil.dateToString(row.getMonth(), "yyyy-MM").equals(teacherVisitCount.getMonth())
                     ) {
                         row.setSubmittedTimes(teacherVisitCount.getNum());

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/InspectionServiceImpl.java

@@ -60,7 +60,11 @@ public class InspectionServiceImpl extends BaseServiceImpl<Long, Inspection> imp
     @Transactional(rollbackFor = Exception.class)
     public List<Inspection> add(List<Inspection> inspections, Integer operationUserId) {
         Date nowDate = new Date();
+        Date month = DateUtil.getFirstDayOfMonth(nowDate);
         for (Inspection inspection : inspections) {
+            if(inspection.getMonth().before(month)){
+                throw new BizException("工作周期不能早于当前月份");
+            }
             inspection.setOperation(operationUserId);
             inspection.setCreateTime(nowDate);
             inspection.setUpdateTime(nowDate);
@@ -86,10 +90,14 @@ public class InspectionServiceImpl extends BaseServiceImpl<Long, Inspection> imp
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Inspection updateInspection(Inspection inspection, Integer operationUserId) {
+        Date nowDate = new Date();
+        Date month = DateUtil.getFirstDayOfMonth(nowDate);
+        if(inspection.getMonth().before(month)){
+            throw new BizException("工作周期不能早于当前月份");
+        }
         if (inspection.getInspectionItems() == null || inspection.getInspectionItems().size() <= 0) {
             throw new BizException("任务事项不能为空");
         }
-        Date nowDate = new Date();
         Inspection oldInspection = inspectionDao.get(inspection.getId());
         if (oldInspection == null) {
             throw new BizException("巡查任务不存在,请核查");

+ 218 - 212
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -102,6 +102,7 @@ import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
+import org.springframework.util.Assert;
 
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
@@ -243,7 +244,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private SubjectDao subjectDao;
     @Autowired
     private SysUserCashAccountDao sysUserCashAccountDao;
-    
+
     @Autowired
     private StudentPreRegistrationDao studentPreRegistrationDao;
 
@@ -376,112 +377,112 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-	public boolean preRegister(StudentPreRegistration studentPreRegistration) {
-
-		String musicGroupId = studentPreRegistration.getMusicGroupId();
-
-		// 查询乐团状态
-		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团信息查询失败");
-		}
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-			throw new BizException("乐团当前状态不能预报名");
-		}
-
-		StudentPreRegistration originRegistration = studentPreRegistrationDao.queryByMusicGroupIdAndPhone(studentPreRegistration.getPhone(), musicGroupId);
-		if (originRegistration != null) {
-			throw new BizException("您已预报名成功,请勿重复提交资料");
-		}
-		Date date = new Date();
-
-		// 判断用户是否存在
-		SysUser user = sysUserFeignService.queryUserByMobile(studentPreRegistration.getPhone());
-		if (user == null || user.getId() == null) {
-			user = new SysUser();
-			user.setPhone(studentPreRegistration.getPhone());
-			user.setUsername(studentPreRegistration.getUserName());
-			user.setOrganId(musicGroup.getOrganId());
-			user.setUserType("STUDENT");
-			user.setCreateTime(date);
-			user.setUpdateTime(date);
-			// 注册账户信息
-			HttpResponseResult<Integer> result = sysUserFeignService.addUser(user);
-
-			Integer userId = result.getData();
-			user.setId(userId);
-
-			Student student = new Student();
-			student.setUserId(userId);
-			student.setCreateTime(date);
-			student.setUpdateTime(date);
-			student.setIsNewUser(true);
-			studentDao.insert(student);
-			sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
-		}
-
-		studentPreRegistration.setCreateTime(date);
-		studentPreRegistration.setUserId(user.getId());
-
-		studentPreRegistrationDao.insert(studentPreRegistration);
-		
-		// 添加成员
-		imGroupMemberService.join(Long.parseLong(musicGroupId), user.getId(), null, false);
-
-		return true;
-	}
-
-	@Override
-	public boolean finishPreApply(String musicGroupId, boolean isCheckStudentNum) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团信息查询失败");
-		}
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-			throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
-		}
-		if (isCheckStudentNum) {
-			// 查询乐团已报名人数
-			List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
-			if (studentPreRegistrationList == null || studentPreRegistrationList.size() < 120) {
-				throw new BizException("操作失败:报名人数没有达到120人");
-			}
-		}
-		musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
-		musicGroup.setUpdateTime(new Date());
-		musicGroupDao.update(musicGroup);
-		
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		if(sysUser == null || sysUser.getId() == null){
-			throw new BizException("请重新登录");
-		}
-		
-		//记录操作日志
-		musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(预报名 -> 准备创建缴费)", sysUser.getId(), ""));
-		
-		return true;
-	}
-
-	@Override
-	public boolean sendParentMeetingNotice(Integer userId, String musicGroupId, Date meetingDate, String address) {
-		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-		if (musicGroup == null) {
-			throw new BizException("乐团信息查询失败");
-		}
-		if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-			throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
-		}
-		
-		List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
-		Map<Integer,String> receiverList = studentPreRegistrationList.stream().collect(Collectors.toMap(StudentPreRegistration :: getUserId, StudentPreRegistration :: getPhone));
-		
-		String meetingDateStr = sdf_ymdhms.format(meetingDate);
-		sysMessageService.batchSendImGroupMessage(MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
-		sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
-		return true;
-	}
-
-	@Override
+    public boolean preRegister(StudentPreRegistration studentPreRegistration) {
+
+        String musicGroupId = studentPreRegistration.getMusicGroupId();
+
+        // 查询乐团状态
+        MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团信息查询失败");
+        }
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
+            throw new BizException("乐团当前状态不能预报名");
+        }
+
+        StudentPreRegistration originRegistration = studentPreRegistrationDao.queryByMusicGroupIdAndPhone(studentPreRegistration.getPhone(), musicGroupId);
+        if (originRegistration != null) {
+            throw new BizException("您已预报名成功,请勿重复提交资料");
+        }
+        Date date = new Date();
+
+        // 判断用户是否存在
+        SysUser user = sysUserFeignService.queryUserByMobile(studentPreRegistration.getPhone());
+        if (user == null || user.getId() == null) {
+            user = new SysUser();
+            user.setPhone(studentPreRegistration.getPhone());
+            user.setUsername(studentPreRegistration.getUserName());
+            user.setOrganId(musicGroup.getOrganId());
+            user.setUserType("STUDENT");
+            user.setCreateTime(date);
+            user.setUpdateTime(date);
+            // 注册账户信息
+            HttpResponseResult<Integer> result = sysUserFeignService.addUser(user);
+
+            Integer userId = result.getData();
+            user.setId(userId);
+
+            Student student = new Student();
+            student.setUserId(userId);
+            student.setCreateTime(date);
+            student.setUpdateTime(date);
+            student.setIsNewUser(true);
+            studentDao.insert(student);
+            sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
+        }
+
+        studentPreRegistration.setCreateTime(date);
+        studentPreRegistration.setUserId(user.getId());
+
+        studentPreRegistrationDao.insert(studentPreRegistration);
+
+        // 添加成员
+        imGroupMemberService.join(Long.parseLong(musicGroupId), user.getId(), null, false);
+
+        return true;
+    }
+
+    @Override
+    public boolean finishPreApply(String musicGroupId, boolean isCheckStudentNum) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团信息查询失败");
+        }
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
+            throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
+        }
+        if (isCheckStudentNum) {
+            // 查询乐团已报名人数
+            List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
+            if (studentPreRegistrationList == null || studentPreRegistrationList.size() < 120) {
+                throw new BizException("操作失败:报名人数没有达到120人");
+            }
+        }
+        musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
+        musicGroup.setUpdateTime(new Date());
+        musicGroupDao.update(musicGroup);
+
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null || sysUser.getId() == null) {
+            throw new BizException("请重新登录");
+        }
+
+        //记录操作日志
+        musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(预报名 -> 准备创建缴费)", sysUser.getId(), ""));
+
+        return true;
+    }
+
+    @Override
+    public boolean sendParentMeetingNotice(Integer userId, String musicGroupId, Date meetingDate, String address) {
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if (musicGroup == null) {
+            throw new BizException("乐团信息查询失败");
+        }
+        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
+            throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
+        }
+
+        List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
+        Map<Integer, String> receiverList = studentPreRegistrationList.stream().collect(Collectors.toMap(StudentPreRegistration::getUserId, StudentPreRegistration::getPhone));
+
+        String meetingDateStr = sdf_ymdhms.format(meetingDate);
+        sysMessageService.batchSendImGroupMessage(MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
+        sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.SMS_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
+        return true;
+    }
+
+    @Override
     @Transactional(rollbackFor = Exception.class)
     public Map sporadicPay(SporadicPayDto sporadicPayDto) throws Exception {
         //获取收费项价格
@@ -547,7 +548,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentPaymentOrder.setVersion(0);
         BigDecimal balance = BigDecimal.ZERO;
         if (sporadicPayDto.getUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
-            if (chargeInfo.getChargeType().getCode().equals(9) || chargeInfo.getChargeType().getCode().equals(13)) {
+            if (chargeInfo.getChargeType().getCode().equals(9) ||
+                    chargeInfo.getChargeType().getCode().equals(13) ||
+                    chargeInfo.getChargeType().getCode().equals(14)) {
                 throw new BizException(chargeInfo.getChargeType().getMsg() + "不支持余额支付");
             }
             SysUserCashAccount userCashAccount = sysUserCashAccountService.get(userId);
@@ -1089,8 +1092,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         });
         if (waringSubjectIds.size() > 0) {
             List<Subject> waringSubjects = subjectDao.findBySubjectIds(waringSubjectIds);
-            String waringSubjectStr  = waringSubjects.stream().map(Subject::getName).collect(Collectors.joining(","));
-            throw new BizException(waringSubjectStr+"存在学生,不能删除");
+            String waringSubjectStr = waringSubjects.stream().map(Subject::getName).collect(Collectors.joining(","));
+            throw new BizException(waringSubjectStr + "存在学生,不能删除");
         }
 
         if (musicGroup.getStatus() == MusicGroupStatusEnum.DRAFT || musicGroup.getStatus() == MusicGroupStatusEnum.AUDIT_FAILED) {
@@ -1183,13 +1186,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         List<ClassGroup> classGroups = classGroupDao.queryClassGroups(musicGroupId, "MUSIC");
         for (ClassGroup classGroup : classGroups) {
             //获取班级关联的老师列表
-            Set<Integer> teacherIds = classGroupTeacherMapperDao.queryTeacherIdsByClassGroupId(classGroup.getId(),null,null);
+            Set<Integer> teacherIds = classGroupTeacherMapperDao.queryTeacherIdsByClassGroupId(classGroup.getId(), null, null);
             //获取班级关联的学员列表
-            Set<Integer> studentIds = classGroupStudentMapperDao.queryStudentIdsByClassGroupId(classGroup.getId(),null,null);
+            Set<Integer> studentIds = classGroupStudentMapperDao.queryStudentIdsByClassGroupId(classGroup.getId(), null, null);
             //创建IM群组
             classGroupService.addImGroup(classGroup, new ArrayList<>(studentIds), new ArrayList<>(teacherIds));
         }
-        imUserFriendService.refreshGroupImUserFriend(musicGroupId,GroupType.MUSIC);
+        imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
         //给老师发送乐团成立通知
         Map<Integer, String> map = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(musicGroupDao.queryTeacherIdMap(musicGroupId))), HashMap.class);
         if (map != null && map.size() > 0) {
@@ -1272,20 +1275,20 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "审核通过(审核中 -> 预报名)", sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.PRE_APPLY);
         musicGroupDao.update(musicGroup);
-        
+
         // 创建群
         imGroupService.create(Long.parseLong(musicGroupId), null, "乐团预报名", null, musicGroup.getName(), musicGroup.getName(), null, GroupType.MUSIC.getCode());
-        
-        Map<Integer,String> userRoleMap = new HashMap<Integer, String>();
-        
-        if(musicGroup.getTeamTeacherId() != null){
-        	userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
+
+        Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
+
+        if (musicGroup.getTeamTeacherId() != null) {
+            userRoleMap.put(musicGroup.getTeamTeacherId(), "运营主管");
         }
-        if(musicGroup.getEducationalTeacherId() != null){
-        	userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
+        if (musicGroup.getEducationalTeacherId() != null) {
+            userRoleMap.put(musicGroup.getEducationalTeacherId(), "乐团主管");
         }
-        if(musicGroup.getDirectorUserId() != null){
-        	userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
+        if (musicGroup.getDirectorUserId() != null) {
+            userRoleMap.put(musicGroup.getDirectorUserId(), "乐队指导");
         }
         // 添加成员
         imGroupMemberService.join(Long.parseLong(musicGroupId), userRoleMap);
@@ -1658,8 +1661,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     }
 
     @Override
-	public boolean extensionPreApplyExpireDate(String musicGroupId, Date expireDate) {
-    	SysUser sysUser = sysUserFeignService.queryUserInfo();
+    public boolean extensionPreApplyExpireDate(String musicGroupId, Date expireDate) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             throw new BizException("用户信息获取失败");
         }
@@ -1683,9 +1686,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupDao.update(musicGroup);
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "延长预报名时间", sysUser.getId(), ""));
         return true;
-	}
+    }
 
-	@Override
+    @Override
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public boolean applyQuitMusicGroup(String musicGroupId, String reason) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -1752,9 +1755,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup == null) {
             throw new BizException("乐团不存在");
         }
-		if (musicGroupQuit.getStatus() != ApprovalStatus.PROCESSING) {
-			throw new BizException("当前状态下不能取消");
-		}
+        if (musicGroupQuit.getStatus() != ApprovalStatus.PROCESSING) {
+            throw new BizException("当前状态下不能取消");
+        }
         musicGroupQuit.setStatus(ApprovalStatus.CANCELED);
         musicGroupQuit.setReason(reason);
         musicGroupQuit.setQuitDate(new Date());
@@ -1771,6 +1774,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public boolean approveQuitMusicGroup(Long id, ApprovalStatus status, String reason, boolean isRefundCourseFee, boolean isRefundInstrumentFee,
                                          boolean isRefundTeachingAssistantsFee) {
+
         MusicGroupQuit musicGroupQuit = musicGroupQuitDao.get(id);
         if (musicGroupQuit == null) {
             throw new BizException("数据不存在");
@@ -1789,12 +1793,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("申请失败,乐团状态[已取消]或[已暂停]");
         }
 
-		// 有进行中的课程不能退团
-		List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
-				"UNDERWAY", userId);
-		if (courseScheduleList != null && courseScheduleList.size() > 0) {
-			throw new BizException("退团失败,存在[进行中]的课程");
-		}
+        // 有进行中的课程不能退团
+        List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
+                "UNDERWAY", userId);
+        if (courseScheduleList != null && courseScheduleList.size() > 0) {
+            throw new BizException("退团失败,存在[进行中]的课程");
+        }
 
         musicGroupQuit.setStatus(status);
         musicGroupQuit.setReason(reason);
@@ -1833,7 +1837,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             studentRegistrationDao.update(studentRegistration);
 
             //更新服务指标、运营指标
-            int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
+            /*int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
             if (remainCourseNum == 0) {
                 Student student = studentDao.get(userId);
                 if (student == null) {
@@ -1844,31 +1848,31 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 student.setOperatingTempTag(0);
                 student.setUpdateTime(date);
                 studentDao.update(student);
-            }
+            }*/
 
             //删除进行中加学生,且在审批中或拒绝的缴费
             List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
-            if(paymentCalenderIdList != null && paymentCalenderIdList.size() > 0){
-            	musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+            if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
+                musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
             }
-            
+
             //查询未交费的项目
             List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
-            
-			for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-				MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
-				if (mgpc != null) {
-					if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-						musicGroupPaymentCalenderDao.delete(mgpc.getId());
-					} else {
-						// 缴费项目预计人数减一
-						mgpc.setExpectNum(mgpc.getExpectNum() - 1);
-						mgpc.setUpdateTime(date);
-						musicGroupPaymentCalenderDao.update(mgpc);
-					}
-				}
-				musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
-			}
+
+            for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
+                MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+                if (mgpc != null) {
+                    if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
+                        musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                    } else {
+                        // 缴费项目预计人数减一
+                        mgpc.setExpectNum(mgpc.getExpectNum() - 1);
+                        mgpc.setUpdateTime(date);
+                        musicGroupPaymentCalenderDao.update(mgpc);
+                    }
+                }
+                musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
+            }
             //删除用户购买的课程记录
             musicGroupPaymentStudentCourseDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
 
@@ -1881,11 +1885,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 musicGroupSubjectPlan.setUpdateTime(date);
                 musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
             }
-            
-            if(currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL){
-            	return true;
+
+            if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
+                return true;
             }
-            
+
             if (isRefundCourseFee) {
                 // 退课程费用
                 amount = amount.add(surplusCourseFee);
@@ -1894,7 +1898,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
 
             if (studentPaymentOrder != null) {
-            	List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
+                List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
 
                 SubjectChange studentLastChange = null;
                 if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
@@ -1930,7 +1934,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 }
             }
 
-            
+
             if (amount.doubleValue() > 0) {
                 // 增加交易流水
                 sysUserCashAccountDetailService.addCashAccountDetail(userId, amount, SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "",
@@ -1957,12 +1961,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             throw new BizException("退团失败,乐团状态[已取消]或[已暂停]");
         }
 
-		// 有进行中的课程不能退团
-		List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
-				"UNDERWAY", userId);
-		if (courseScheduleList != null && courseScheduleList.size() > 0) {
-			throw new BizException("退团失败,存在[进行中]的课程");
-		}
+        // 有进行中的课程不能退团
+        List<CourseSchedule> courseScheduleList = courseScheduleDao.findMusicGroupCourseSchedulesWithStudent(musicGroupId, GroupType.MUSIC.getCode(),
+                "UNDERWAY", userId);
+        if (courseScheduleList != null && courseScheduleList.size() > 0) {
+            throw new BizException("退团失败,存在[进行中]的课程");
+        }
 
         courseScheduleStudentPaymentService.updateCourseActualPrice(Arrays.asList(musicGroupId), Arrays.asList(userId), GroupType.MUSIC);
 
@@ -1970,7 +1974,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
         if (studentRegistration == null) {
             throw new BizException("用户注册信息不存在");
-		}
+        }
 
         Date date = new Date();
 
@@ -2008,7 +2012,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentRegistrationDao.update(studentRegistration);
 
         //更新服务指标、运营指标
-        int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
+        /*int remainCourseNum = courseScheduleStudentPaymentDao.countStudentNotStartCourseNumWithCourseType(userId, null);
         if (remainCourseNum == 0) {
             Student student = studentDao.get(userId);
             if (student == null) {
@@ -2019,34 +2023,34 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             student.setOperatingTempTag(0);
             student.setUpdateTime(date);
             studentDao.update(student);
-        }
+        }*/
 
         //删除进行中加学生,且在审批中或拒绝的缴费
         List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
-        if(paymentCalenderIdList != null && paymentCalenderIdList.size() > 0){
-        	musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+        if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
+            musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
         }
-        
+
         //查询未交费的项目
         List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
-        
-		for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-			MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
-			if (mgpc != null) {
-				if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-					musicGroupPaymentCalenderDao.delete(mgpc.getId());
-				} else {
-					// 缴费项目预计人数减一
-					mgpc.setExpectNum(mgpc.getExpectNum() - 1);
-					mgpc.setUpdateTime(date);
-					musicGroupPaymentCalenderDao.update(mgpc);
-				}
-			}
-			musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
-		}
+
+        for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
+            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+            if (mgpc != null) {
+                if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
+                    musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                } else {
+                    // 缴费项目预计人数减一
+                    mgpc.setExpectNum(mgpc.getExpectNum() - 1);
+                    mgpc.setUpdateTime(date);
+                    musicGroupPaymentCalenderDao.update(mgpc);
+                }
+            }
+            musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
+        }
         //删除用户购买的课程记录
         musicGroupPaymentStudentCourseDetailDao.deleteByUserIdAndMusicGroupId(userId, musicGroupId);
-        
+
         BigDecimal amount = new BigDecimal(0);
 
         // 判断乐器是否是租赁
@@ -2056,11 +2060,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             musicGroupSubjectPlan.setUpdateTime(date);
             musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
         }
-        
-        if(currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL){
-        	return true;
+
+        if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
+            return true;
         }
-        
+
         if (isRefundCourseFee) {
             // 退课程费用
             amount = amount.add(surplusCourseFee);
@@ -2069,7 +2073,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
 
         if (studentPaymentOrder != null) {
-        	List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
+            List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
 
             SubjectChange studentLastChange = null;
             if (isRefundInstrumentFee || isRefundTeachingAssistantsFee) {
@@ -2105,7 +2109,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        
+
         if (amount.doubleValue() > 0) {
             // 增加交易流水
             sysUserCashAccountDetailService.addCashAccountDetail(userId, amount, SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "",
@@ -2269,7 +2273,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
             //如果是进行中加学员
             MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderDao.get(calenderDetail.getMusicGroupPaymentCalenderId());
-            if(paymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
+            if (paymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT) {
                 studentRegistration.setPaymentStatus(YES);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                 studentRegistrationDao.update(studentRegistration);
@@ -2303,7 +2307,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             List<StudentPaymentOrderDetail> paymentOrderDetails = new ArrayList<>();
             List<MusicGroupPaymentCalenderCourseSettings> courseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderDetail.getMusicGroupPaymentCalenderId());
             //跨团合班没有settings
-            if(courseSettings.size() == 0){
+            if (courseSettings.size() == 0) {
                 List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(paymentCalender.getBatchNo(), userId);
                 for (MusicGroupPaymentCalenderStudentDetail studentDetail : studentDetails) {
                     StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
@@ -2314,7 +2318,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
                     paymentOrderDetails.add(studentPaymentOrderDetail);
                 }
-            }else {
+            } else {
                 courseSettings.forEach(e -> {
                     StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
                     studentPaymentOrderDetail.setType(OrderDetailTypeEnum.valueOf(e.getCourseType().getCode()));
@@ -2325,7 +2329,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     paymentOrderDetails.add(studentPaymentOrderDetail);
                 });
             }
-            studentPaymentOrderDetailService.batchAdd(paymentOrderDetails);
+            if (paymentOrderDetails.size() > 0) {
+                studentPaymentOrderDetailService.batchAdd(paymentOrderDetails);
+            }
 
             //缴费
             SysUserCashAccountDetail paymentDetail = new SysUserCashAccountDetail();
@@ -2381,9 +2387,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (courseSchedule == null) {
             throw new BizException("课程信息不存在");
         }
-        
-        if(salary == null){
-        	throw new BizException("请设置老师课酬");
+
+        if (salary == null) {
+            throw new BizException("请设置老师课酬");
         }
 
         if ("all".equals(scope)) {
@@ -2515,7 +2521,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         Integer teamTeacherId = newMusicGroup.getTeamTeacherId();
         Integer educationalTeacherId = newMusicGroup.getEducationalTeacherId();
-        
+
         Integer oldDirectorUserId = oldMusicGroup.getDirectorUserId();
         if (oldDirectorUserId == null) {
             oldDirectorUserId = teamTeacherId;
@@ -2530,14 +2536,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         quitUserIdList.add(oldMusicGroup.getEducationalTeacherId());
         quitUserIdList.add(oldDirectorUserId);
 
-        Map<Integer,String> userRoleMap = new HashMap<Integer, String>();
+        Map<Integer, String> userRoleMap = new HashMap<Integer, String>();
         userRoleMap.put(directorUserId, "乐队指导");
         userRoleMap.put(educationalTeacherId, "乐团主管");
         userRoleMap.put(teamTeacherId, "运营主管");
 
         classGroups.forEach(e -> {
-        	imGroupMemberService.quit(e.getId().longValue(), quitUserIdList);
-        	imGroupMemberService.join(e.getId().longValue(), userRoleMap);
+            imGroupMemberService.quit(e.getId().longValue(), quitUserIdList);
+            imGroupMemberService.join(e.getId().longValue(), userRoleMap);
         });
     }
 
@@ -2565,7 +2571,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             //如果已生成课表,那么修改未上课时教学点
             courseScheduleDao.updateCourseScheduleSchool("MUSIC", musicGroupId, musicGroup.getSchoolId());
         }
-        if(group.getStatus() == MusicGroupStatusEnum.PROGRESS){
+        if (group.getStatus() == MusicGroupStatusEnum.PROGRESS) {
             updateTeamTeacher(group, musicGroup);
         }
 
@@ -2593,8 +2599,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (subFeeSettingDto.getMusicGroupPaymentEntities() != null && subFeeSettingDto.getMusicGroupPaymentEntities().size() > 0) {
             musicGroupPaymentEntitiesDao.batchAdd(subFeeSettingDto.getMusicGroupPaymentEntities(), musicGroupId);
         }
-        if(group.getStatus() == MusicGroupStatusEnum.PROGRESS){
-            imUserFriendService.refreshGroupImUserFriend(musicGroupId,GroupType.MUSIC);
+        if (group.getStatus() == MusicGroupStatusEnum.PROGRESS) {
+            imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
         }
         //记录操作日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "修改乐团基本信息数据", sysUser.getId(), JSONObject.toJSONString(subFeeSettingDto)));
@@ -2806,7 +2812,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             hasUsers.add(studentRegistration.getUserId());
             newRegs.add(studentRegistration);
         }
-        if(registerIds.size() >0 && newRegs.size()<=0){
+        if (registerIds.size() > 0 && newRegs.size() <= 0) {
             throw new BizException("添加的学员,乐团已存在");
         }
         studentRegistrations = newRegs;
@@ -2879,7 +2885,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //有进行中的课不能关闭乐团
         Integer underwayCourseNum = courseScheduleDao.getUnderwayCourseNum(musicGroup.getId(), GroupType.MUSIC, CourseStatusEnum.UNDERWAY);
-        if(underwayCourseNum >0){
+        if (underwayCourseNum > 0) {
             throw new BizException("乐团有进行的课程,不能关闭");
         }
         musicGroup.setStatus(MusicGroupStatusEnum.CLOSE);

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java

@@ -110,7 +110,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
                 if (!appendCourseBalance) {
                     throw new BizException("增加用户课程余额失败");
                 }
-            } else if (info.getChargeType().getCode() == 9 || info.getChargeType().getCode() == 13) { //零星收费账户充值,网基课活动
+            } else if (info.getChargeType().getCode() == 9 || info.getChargeType().getCode() == 13 || info.getChargeType().getCode() == 14) { //零星收费账户充值,网基课活动,关心包
                 sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getActualAmount(), PlatformCashAccountDetailTypeEnum.RECHARGE, "零星收费"+info.getChargeType().getMsg(), studentPaymentOrder.getTransNo());
             } else if (info.getOrganId().equals(42) && info.getChargeType().equals(SporadicChargeTypeEnum.LEVEL)) {
                 degreeRegistrationService.updateStatus(studentPaymentOrder);

+ 96 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java

@@ -1,15 +1,15 @@
 package com.ym.mec.biz.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.StudentServeCourseDto;
-import com.ym.mec.biz.dal.dto.StudentServeCourseHomeworkDto;
-import com.ym.mec.biz.dal.dto.StudentServeDto;
-import com.ym.mec.biz.dal.dto.StudentServiceHomeworkDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.TeachModeEnum;
+import com.ym.mec.biz.dal.enums.TeachTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.service.StudentServeService;
+import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.ArrayUtils;
@@ -47,6 +47,12 @@ public class StudentServeServiceImpl implements StudentServeService {
     private StudentExtracurricularExercisesSituationDao studentExtracurricularExercisesSituationDao;
     @Autowired
     private StudentServeService studentServeService;
+    @Autowired
+    private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
+    @Autowired
+    private SysConfigService sysConfigService;
+    @Autowired
+    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -307,6 +313,26 @@ public class StudentServeServiceImpl implements StudentServeService {
         LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
         Date nextMonday = Date.from(sunDayDate.plusDays(1).atStartOfDay(DateUtil.zoneId).toInstant());
 
+        Set<String> holidayDays = new HashSet<>();
+        SysConfig holidaySetting = sysConfigService.findByParamName(SysConfigService.HOLIDAY_SETTING);
+        if(Objects.nonNull(holidaySetting)&&StringUtils.isNotBlank(holidaySetting.getParanValue())){
+            holidayDays = new HashSet<>(JSON.parseArray(holidaySetting.getParanValue(), String.class));
+        }
+        LocalDate everyDay=monDayDate;
+        boolean weekInHoliday = true;
+        while (everyDay.compareTo(sunDayDate)<=0){
+            if(!holidayDays.contains(everyDay.toString())){
+                weekInHoliday = false;
+                break;
+            }
+            everyDay = everyDay.plusDays(1);
+        }
+
+        if(weekInHoliday){
+            studentExtracurricularExercisesSituationDao.deleteByMonday(monDayDate.toString(), studentIds);
+            return;
+        }
+
 //        int weekServiceNum = studentExtracurricularExercisesSituationDao.countWeekServiceNum(monDayDate.toString());
 //        if(weekServiceNum>0&&CollectionUtils.isEmpty(studentIds)){
 //            return;
@@ -318,6 +344,14 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
         Map<Integer, List<StudentServeCourseDto>> studentCourseMap = studentFutureCourseInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
 
+        Set<Integer> haveCourseBeServeStudentIds = studentCourseMap.keySet();
+        List<Integer> allServeStudentIds = studentDao.getServeStudentIds();
+        Set<Integer> noCourseServeStudentIds = allServeStudentIds.stream().filter(id -> !haveCourseBeServeStudentIds.contains(id)).collect(Collectors.toSet());
+        List<StudentServeCourseDto> noCourseBeServeStudentInfo = new ArrayList<>();
+        if(!CollectionUtils.isEmpty(noCourseServeStudentIds)){
+            noCourseBeServeStudentInfo = studentDao.getNoCourseBeServeStudentInfo(new ArrayList<>(noCourseServeStudentIds));
+        }
+
         List<StudentExtracurricularExercisesSituation> results=new ArrayList<>();
 
         for (Map.Entry<Integer, List<StudentServeCourseDto>> studentCourseMapEntry : studentCourseMap.entrySet()) {
@@ -411,8 +445,12 @@ public class StudentServeServiceImpl implements StudentServeService {
 
                 Map<Integer, Integer> teacherNumMap = new HashMap<>();
                 for (String groupId : groupCourseInfo.keySet()) {
-                    CourseSchedule studentHistoryLastCourse = courseScheduleStudentPaymentDao.getStudentHistoryLastCourse(studentCourseMapEntry.getKey(), monDayDate.toString(), groupId, CourseSchedule.CourseScheduleType.SINGLE);
-                    Integer teacherId = Objects.isNull(studentHistoryLastCourse)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():studentHistoryLastCourse.getActualTeacherId();
+                    Integer teacherId = null;
+                    List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(studentCourseMapEntry.getKey()), groupId);
+                    if(!CollectionUtils.isEmpty(studentTeacherIdList)){
+                        teacherId = studentTeacherIdList.get(0).getValue();
+                    }
+                    teacherId = Objects.isNull(teacherId)?studentCourseMapEntry.getValue().get(0).getLeadTeacherId():teacherId;
                     if(Objects.isNull(teacherId)){
                         continue;
                     }
@@ -468,16 +506,48 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
         }
 
-        if(!CollectionUtils.isEmpty(results)){
+        Map<Integer, Set<String>> noCourseStudentMusicIdsMap = noCourseBeServeStudentInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId, Collectors.mapping(StudentServeCourseDto::getMusicGroupId, Collectors.toSet())));
+        Map<Integer, List<StudentServeCourseDto>> noCourseStudentCourseMap = noCourseBeServeStudentInfo.stream().collect(Collectors.groupingBy(StudentServeCourseDto::getStudentId));
+        for (Map.Entry<Integer, Set<String>> noCourseStudentMusicIdsMapEntry : noCourseStudentMusicIdsMap.entrySet()) {
+            Map<Integer, Integer> teacherNumMap = new HashMap<>();
+            for (String groupId : noCourseStudentMusicIdsMapEntry.getValue()) {
+                Integer teacherId = null;
+                List<BaseMapDto<Integer, Integer>> studentTeacherIdList = classGroupStudentMapperDao.getStudentClassGroupBishopTeacherMap(Arrays.asList(noCourseStudentMusicIdsMapEntry.getKey()), groupId);
+                if(!CollectionUtils.isEmpty(studentTeacherIdList)){
+                    teacherId = studentTeacherIdList.get(0).getValue();
+                }
+                teacherId = Objects.isNull(teacherId)?noCourseStudentCourseMap.get(noCourseStudentMusicIdsMapEntry.getKey()).get(0).getLeadTeacherId():teacherId;
+                if(Objects.isNull(teacherId)){
+                    continue;
+                }
+
+                if(!teacherNumMap.containsKey(teacherId)){
+                    teacherNumMap.put(teacherId, 1);
+                }else{
+                    teacherNumMap.put(teacherId, teacherNumMap.get(teacherId)+1);
+                }
 
-            if(CollectionUtils.isEmpty(studentIds)){
-                studentIds = results.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
             }
 
+            for (Map.Entry<Integer, Integer> teacherNumMapEntry : teacherNumMap.entrySet()) {
+                StudentExtracurricularExercisesSituation studentExtracurricularExercisesSituation=new StudentExtracurricularExercisesSituation(noCourseStudentMusicIdsMapEntry.getKey(),
+                        teacherNumMapEntry.getKey(),
+                        nowDate.get(DateUtil.weekFields.weekOfYear()),
+                        DateUtil.stringToDate(monDayDate.toString(), "yyyy-MM-dd"), DateUtil.stringToDate(sunDayDate.toString(), "yyyy-MM-dd"),
+                        "EXERCISE", null);
+                studentExtracurricularExercisesSituation.setExpectExercisesNum(teacherNumMapEntry.getValue());
+                results.add(studentExtracurricularExercisesSituation);
+            }
+        }
+
+        if(!CollectionUtils.isEmpty(results)){
+            List<Integer> allStudentIds = new ArrayList<>();
+            allStudentIds = results.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toList());
+
             Map<Integer, List<StudentServeCourseHomeworkDto>> studentHomeworkMap=new HashMap<>();
             Map<Integer, List<ExtracurricularExercisesReply>> studentExercisesMap=new HashMap<>();
 
-            List<StudentServeCourseHomeworkDto> allStudentHomeworks = studentCourseHomeworkDao.findStudentHomeworkWithCourseDateRange(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(studentIds));
+            List<StudentServeCourseHomeworkDto> allStudentHomeworks = studentCourseHomeworkDao.findStudentHomeworkWithCourseDateRange(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(allStudentIds));
             List<StudentServeCourseHomeworkDto> studentHomeworksTmp =new ArrayList<>();
             for (StudentServeCourseHomeworkDto studentHomework : allStudentHomeworks) {
                 LocalDate courseStartLocalDate = LocalDateTime.ofInstant(studentHomework.getCourseStartTime().toInstant(), DateUtil.zoneId).toLocalDate();
@@ -506,7 +576,7 @@ public class StudentServeServiceImpl implements StudentServeService {
             }
 
 
-            List<ExtracurricularExercisesReply> allStudentExercises = extracurricularExercisesReplyDao.getStudentExercisesWithTimeZone(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(studentIds));
+            List<ExtracurricularExercisesReply> allStudentExercises = extracurricularExercisesReplyDao.getStudentExercisesWithTimeZone(monDayDate.toString(), sunDayDate.toString(), new ArrayList<>(allStudentIds));
             if(!CollectionUtils.isEmpty(allStudentExercises)){
                 studentExercisesMap = allStudentExercises.stream().collect(Collectors.groupingBy(ExtracurricularExercisesReply::getUserId));
             }
@@ -857,4 +927,19 @@ public class StudentServeServiceImpl implements StudentServeService {
         }
         return serviceWithCourse.stream().map(StudentExtracurricularExercisesSituation::getStudentId).collect(Collectors.toSet());
     }
+
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void closeStudentServiceTag() {
+        /**
+         * 当前服务指标已开启,但在系统中没有剩余课时,且在乐团中不是在读状态,这种用户需要关闭服务指标
+         */
+        //获取需要关闭服务指标的学员
+        List<Integer> studentIds = studentDao.queryCloseServiceTagIds();
+        if(studentIds.size() > 0){
+            studentDao.updateServiceTag(studentIds,0);
+        }
+    }
 }

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

@@ -8,7 +8,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -31,6 +33,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 
 	@Autowired
 	private StudentDao studentDao;
+	@Autowired
+	private CourseScheduleDao courseScheduleDao;
 	
 	@Autowired
 	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
@@ -167,4 +171,5 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 	public void batchUpdateAdviser(Integer teacherId,String studentIds) {
 		studentDao.batchUpdateAdviser(teacherId,studentIds);
 	}
+
 }

+ 20 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -29,6 +29,7 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.ComplaintsStatusEnum.REPEAL;
+import static com.ym.mec.biz.dal.enums.JobNatureEnum.PART_TIME;
 import static com.ym.mec.biz.dal.enums.SignInStatusEnum.*;
 
 @Service
@@ -710,13 +711,8 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public synchronized void addComplaints(Long courseScheduleId, String content,String url) {
-		SysUser user = sysUserFeignService.queryUserInfo();
-		if(Objects.isNull(user)){
-			throw new BizException("请登录");
-		}
-		TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(user.getId().longValue(), courseScheduleId);
-
+	public void addComplaints(Long courseScheduleId, String content,String url,Integer userId) {
+		TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(userId.longValue(), courseScheduleId);
 		CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
 		if(courseSchedule == null){
 			throw new BizException("课程不存在");
@@ -724,7 +720,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		if(teacherAttendance == null){
 			teacherAttendance = new TeacherAttendance();
 			teacherAttendance.setMusicGroupId(courseSchedule.getMusicGroupId());
-			teacherAttendance.setTeacherId(user.getId());
+			teacherAttendance.setTeacherId(userId);
 			teacherAttendance.setClassGroupId(courseSchedule.getClassGroupId());
 			teacherAttendance.setGroupType(courseSchedule.getGroupType());
 			teacherAttendance.setCourseScheduleId(courseScheduleId);
@@ -732,11 +728,21 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		}else if(teacherAttendance.getComplaintsStatus() != null && teacherAttendance.getComplaintsStatus() != REPEAL){
             throw new BizException("请勿重复提交考勤申述");
         }
-		//如果课程时间在两天前
+		Teacher teacher = teacherDao.get(userId);
 		Date date = new Date();
-        int i = DateUtil.daysBetween(courseSchedule.getClassDate(), DateUtil.stringToDate(DateUtil.format(date,DateUtil.DEFAULT_PATTERN),DateUtil.DEFAULT_PATTERN));
-        if(i > 1){
-			throw new BizException("超出可申述时间");
+		if(teacher.getJobNature() == PART_TIME){
+			//获取上课时间下个月5号
+			date = DateUtil.addDays(DateUtil.getFirstDayOfMonth(DateUtil.addMonths(courseSchedule.getClassDate(), 1)), 5);
+			int i = DateUtil.daysBetween(date,new Date());
+			if(i > 0){
+				throw new BizException("超出可申述时间");
+			}
+		}else {
+			//如果课程时间在两天前
+			int i = DateUtil.daysBetween(courseSchedule.getClassDate(), DateUtil.stringToDate(DateUtil.format(date,DateUtil.DEFAULT_PATTERN),DateUtil.DEFAULT_PATTERN));
+			if(i > 1){
+				throw new BizException("超出可申述时间");
+			}
 		}
 		teacherAttendance.setIsComplaints(1);
 		teacherAttendance.setComplaintsStatus(ComplaintsStatusEnum.WAIT);
@@ -748,12 +754,8 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void repealComplaints(Long courseScheduleId) {
-		SysUser user = sysUserFeignService.queryUserInfo();
-		if(Objects.isNull(user)){
-			throw new BizException("请登录");
-		}
-		TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(user.getId().longValue(), courseScheduleId);
+	public void repealComplaints(Long courseScheduleId,Integer userId) {
+		TeacherAttendance teacherAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(userId.longValue(), courseScheduleId);
 		if(teacherAttendance == null){
 			throw new BizException("考勤信息不存在");
 		}

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1377,9 +1377,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			classGroup.setStudentNum(classGroup.getStudentNum()+num);
 		}
 
-//		Integer studentPaymentNum=studentPaymentOrderDao.countStudentPaymentNum(vipGroupId.toString());
+		Integer studentPaymentNum=studentPaymentOrderDao.countStudentPaymentNum(vipGroupId.toString());
 
-		Integer studentPaymentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
+//		Integer studentPaymentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
 
 		if(studentPaymentNum.equals(classGroup.getExpectStudentNum())&&updateVipStatus){
 			classGroup.setStudentNum(studentPaymentNum);
@@ -2140,6 +2140,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			surplusCourseFee=surplusCourseFee.add(coursePrices.get(i));
 		}
 		if(!CollectionUtils.isEmpty(courseScheduleStudentPaymentList)){
+			studentDao.updateStudentServiceTag(studentRecoverInfo.getUserId(), null, YesOrNoEnum.YES.getCode());
 			courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPaymentList);
 		}
 		sysUserCashAccountService.appendCourseBalance(studentRecoverInfo.getUserId(), surplusCourseFee.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE, "学生复学扣除课程余额");

+ 23 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -610,4 +610,27 @@
             </if>
         </where>
     </sql>
+    <select id="getStudentClassGroupBishopTeacherMap" resultType="com.ym.mec.biz.dal.dto.BaseMapDto">
+        SELECT
+        cgsm.user_id_ 'key',
+        cgtm.user_id_ 'value'
+        FROM
+            class_group_student_mapper cgsm
+            LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+            LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
+        WHERE
+        ( cg.del_flag_ IS NULL OR cg.del_flag_ = 0 )
+        AND cg.type_ IN ( 'NORMAL')
+        AND cgtm.teacher_role_ = 'BISHOP'
+        AND cgsm.status_='NORMAL'
+        <if test="musicGroupId!=null and musicGroupId!=''">
+            AND cgsm.music_group_id_ = #{musicGroupId}
+        </if>
+        <if test="studentIds!=null and studentIds.size()>0">
+            AND cgsm.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 67 - 42
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -439,50 +439,42 @@
 
 	<select id="countLessThenThreeClassGroupNum" resultType="int">
 		SELECT COUNT(t.id_) FROM (
-			SELECT
-			DISTINCT cg.id_
-			FROM
-			class_group cg
-			LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
-			LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
-			WHERE
-			cg.type_ = 'HIGH'
-			AND mg.status_ = 'PROGRESS'
-			AND cgsm.status_ = 'NORMAL'
-			<if test="organIds!=null and organIds.size()>0">
-				AND mg.organ_id_ IN
-				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-					#{organId}
-				</foreach>
-			</if>
-			GROUP BY
-			cg.id_
-			HAVING
-			COUNT( DISTINCT cgsm.user_id_ )&lt;3
+		SELECT cg.id_ FROM
+		class_group cg
+		LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
+		LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+		WHERE
+		cg.type_ IN ('HIGH','HIGH_ONLINE')
+		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY cg.id_
+		HAVING
+		COUNT(CASE WHEN cgsm.status_ = 'NORMAL' THEN 1 ELSE NULL END) &lt; 3
 		) t
 	</select>
 
     <select id="getLessThenThreeMusicGroup" resultType="java.lang.String">
-		SELECT
-			cg.music_group_id_
-		FROM
-			class_group cg
-			LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
-			LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+		SELECT cg.music_group_id_ FROM
+		class_group cg
+		LEFT JOIN class_group_student_mapper cgsm ON cg.id_ = cgsm.class_group_id_
+		LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
 		WHERE
-			cg.type_ = 'HIGH'
-		  	AND mg.status_ = 'PROGRESS'
-			AND cgsm.status_ = 'NORMAL'
-			<if test="organIds!=null and organIds.size()>0">
-				AND mg.organ_id_ IN
-				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-					#{organId}
-				</foreach>
-			</if>
-		GROUP BY
-			cg.id_
+		cg.type_ IN ('HIGH','HIGH_ONLINE')
+		AND mg.status_ = 'PROGRESS' AND cg.del_flag_ = 0
+		<if test="organIds!=null and organIds.size()>0">
+			AND mg.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+		GROUP BY cg.id_
 		HAVING
-			COUNT( DISTINCT cgsm.user_id_ )&lt;3
+		COUNT(CASE WHEN cgsm.status_ = 'NORMAL' THEN 1 ELSE NULL END) &lt; 3
 	</select>
 
 	<select id="countNoPaymentStudentNum" resultType="int">
@@ -523,8 +515,8 @@
 			</if>
 	</select>
 
-	<select id="countApplyForQuitGroupNum" resultType="int">
-		SELECT COUNT(mgq.id_) FROM music_group_quit mgq
+	<select id="queryApplyForQuitGroupNum" resultType="java.lang.Long">
+		SELECT mgq.id_ FROM music_group_quit mgq
 			LEFT JOIN music_group mg ON mgq.music_group_id_=mg.id_
 		WHERE mg.status_='PROGRESS'
 		  AND mgq.status_='PROCESSING'
@@ -536,9 +528,9 @@
 		</if>
 	</select>
 
-	<select id="countStudentAttendanceInfo" resultType="java.lang.Integer">
+	<select id="queryStudentAttendanceInfo" resultType="java.lang.Long">
 		SELECT
-			COUNT( DISTINCT cssp.user_id_ )
+			DISTINCT cssp.user_id_
 		FROM
 			course_schedule_student_payment cssp
 			LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
@@ -551,6 +543,9 @@
 			<if test="type!=null and type=='TRUANT'">
 				(sa.status_ = 'TRUANT' OR sa.id_ IS NULL)
 			</if>
+			<if test="firstDayOfMonth != null">
+				AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
+			</if>
 			<if test="organIds!=null and organIds.size()>0">
 				AND cs.organ_id_ IN
 				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
@@ -566,6 +561,9 @@
 		<if test="organIds != null and organIds != ''">
 			AND FIND_IN_SET(cs.organ_id_,#{organIds})
 		</if>
+		<if test="firstDayOfMonth != null">
+			AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
+		</if>
 	</select>
 	<select id="getNoAttendance" resultType="java.lang.Long">
 		SELECT DISTINCT ta.id_ FROM teacher_attendance ta
@@ -574,6 +572,9 @@
 		<if test="organIds != null and organIds != ''">
 			AND FIND_IN_SET(cs.organ_id_,#{organIds})
 		</if>
+		<if test="firstDayOfMonth != null">
+			AND cs.class_date_ >= DATE_FORMAT(#{firstDayOfMonth},'%Y-%m-%d')
+		</if>
 	</select>
 	<select id="queryTeacherLeave" resultType="java.lang.Long">
 		SELECT DISTINCT tlr.id_ FROM teacher_leave_record tlr
@@ -613,4 +614,28 @@
 			AND FIND_IN_SET(ii.organ_id_,#{organIdsStr})
 		</if>
 	</select>
+
+    <select id="queryErrInspection" resultType="java.lang.Long">
+		SELECT
+			id_
+		FROM
+			inspection_item_plan
+		WHERE
+			conclusion_status_ = 1
+		<if test="organIds!=null and organIds.size()>0">
+			AND organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
+		</if>
+	</select>
+	<select id="getFinancePayData"  resultMap="IndexBaseMonthData">
+
+	</select>
+	<select id="getFinanceBalanceData" resultMap="IndexBaseMonthData">
+
+	</select>
+	<select id="getFinanceActualData" resultMap="IndexBaseMonthData">
+
+	</select>
 </mapper>

+ 10 - 6
mec-biz/src/main/resources/config/mybatis/InspectionItemMapper.xml

@@ -11,7 +11,7 @@
         <result column="item_" property="item" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="times_" property="times"/>
         <result column="planned_times_" property="plannedTimes"/>
-        <result column="submitted_times" property="submittedTimes"/>
+        <result column="submitted_times_" property="submittedTimes"/>
         <result column="memo_" property="memo"/>
         <result column="operation_" property="operation"/>
         <result column="create_time_" property="createTime"/>
@@ -22,7 +22,7 @@
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
-        id_, inspection_id_, organ_id_, user_id_, item_, times_, planned_times_, submitted_times,
+        id_, inspection_id_, organ_id_, user_id_, item_, times_, planned_times_, submitted_times_,
         memo_, operation_, create_time_, update_time_
     </sql>
     <select id="get" parameterType="java.lang.Long" resultMap="InspectionItem">
@@ -41,7 +41,7 @@
             useGeneratedKeys="true">
         <!--@mbg.generated-->
         insert into inspection_item (inspection_id_, organ_id_, user_id_, item_, times_, planned_times_,
-        submitted_times, memo_, operation_, create_time_, update_time_)
+        submitted_times_, memo_, operation_, create_time_, update_time_)
         values (#{inspectionId}, #{organId}, #{userId}, #{item,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{times}, #{plannedTimes},
         #{submittedTimes}, #{memo}, #{operation}, #{createTime}, #{updateTime})
@@ -69,7 +69,7 @@
                 planned_times_ = #{plannedTimes},
             </if>
             <if test="submittedTimes != null">
-                submitted_times = #{submittedTimes},
+                submitted_times_ = #{submittedTimes},
             </if>
             <if test="memo != null">
                 memo_ = #{memo},
@@ -141,7 +141,8 @@
         </foreach>
     </update>
     <delete id="deleteByInspectionId">
-        DELETE FROM inspection_item
+        DELETE
+        FROM inspection_item
         WHERE inspection_id_ = #{InspectionId}
     </delete>
 
@@ -152,7 +153,7 @@
         LEFT JOIN organization o ON o.id_=ii.organ_id_
         LEFT JOIN sys_user su ON su.id_ = ii.user_id_
         <include refid="queryPageSql"/>
-        ORDER BY ii.id_
+        ORDER BY i.month_ DESC ,ii.id_ DESC
         <include refid="global.limit"/>
     </select>
 
@@ -174,6 +175,9 @@
             <if test="operation != null">
                 AND ii.operation_ = #{operation}
             </if>
+            <if test="ids != null">
+                AND FIND_IN_SET(ii.id_,#{ids})
+            </if>
             <if test="startTime != null">
                 AND i.month_ >= #{startTime}
             </if>

+ 31 - 4
mec-biz/src/main/resources/config/mybatis/InspectionItemPlanMapper.xml

@@ -24,6 +24,7 @@
         <result column="cooperationName" property="cooperationName"/>
         <result column="musicGroupName" property="musicGroupName"/>
         <result column="organName" property="organName"/>
+        <result column="realName" property="realName"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
@@ -31,7 +32,7 @@
         music_group_id_, school_gps_, submited_gps_, submited_time_, memo_, conclusion_status_, status_, create_time_,
         update_time_
     </sql>
-    <select id="get" parameterType="java.lang.Long" resultMap="InspectionItemPlan" >
+    <select id="get" parameterType="java.lang.Long" resultMap="InspectionItemPlan">
         <!--@mbg.generated-->
         select
         <include refid="Base_Column_List"/>
@@ -51,7 +52,7 @@
         music_group_id_, school_gps_, submited_gps_, submited_time_, memo_, conclusion_status_, status_,
         create_time_, update_time_)
         values (#{inspectionId}, #{itemId}, #{userId}, #{planStart}, #{planEnd}, #{organId},#{cooperationOrganId},
-        #{musicGroupId}, #{schoolGps}, #{submitedGps}, #{submitedTime}, #{memo}, #{status},
+        #{musicGroupId}, #{schoolGps}, #{submitedGps}, #{submitedTime}, #{memo},#{conclusionStatus},#{status},
         #{createTime}, #{updateTime})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlan">
@@ -112,7 +113,9 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="InspectionItemPlan" parameterType="map">
-        SELECT iip.*,o.name_ organName,co.name_ cooperationName,mg.name_ musicGroupName FROM inspection_item_plan iip
+        SELECT iip.*,su.real_name_ realName,o.name_ organName,co.name_ cooperationName,mg.name_ musicGroupName FROM
+        inspection_item_plan iip
+        LEFT JOIN sys_user su ON su.id_ = iip.user_id_
         LEFT JOIN organization o ON o.id_=iip.organ_id_
         LEFT JOIN cooperation_organ co ON co.id_=iip.cooperation_organ_id_
         LEFT JOIN music_group mg ON mg.id_ = iip.music_group_id_
@@ -146,7 +149,7 @@
                 AND iip.music_group_id_ = #{musicGroupId}
             </if>
             <if test="conclusionStatus != null">
-                AND iip.conclusion_status = #{conclusionStatus}
+                AND iip.conclusion_status_ = #{conclusionStatus}
             </if>
             <if test="status !=null">
                 AND iip.status_ = #{status}
@@ -157,6 +160,9 @@
             <if test='hasSubmit != null and hasSubmit.toString()=="0".toString()'>
                 AND iip.status_ = 0
             </if>
+            <if test="ids != null">
+                AND FIND_IN_SET(iip.id_,#{ids})
+            </if>
             <if test="startTime != null">
                 AND iip.plan_start_ >= #{startTime}
             </if>
@@ -166,6 +172,27 @@
             <if test="search != null">
                 AND mg.name_ LIKE CONCAT('%', #{search}, '%')
             </if>
+            <if test="ids != null and ids != ''">
+                AND FIND_IN_SET(iip.id_,#{ids})
+            </if>
         </where>
     </sql>
+
+    <select id="getStartPlan" resultMap="InspectionItemPlan">
+        <![CDATA[
+        SELECT *
+        FROM inspection_item_plan
+        WHERE plan_start_ >= #{startTime}
+          AND plan_start_ <= #{endTime}
+        ]]></select>
+
+    <select id="getPlanInfo" resultMap="InspectionItemPlan">
+        SELECT iip.*, su.real_name_ realName, o.name_ organName, co.name_ cooperationName, mg.name_ musicGroupName
+        FROM inspection_item_plan iip
+                 LEFT JOIN sys_user su ON su.id_ = iip.user_id_
+                 LEFT JOIN organization o ON o.id_ = iip.organ_id_
+                 LEFT JOIN cooperation_organ co ON co.id_ = iip.cooperation_organ_id_
+                 LEFT JOIN music_group mg ON mg.id_ = iip.music_group_id_
+        WHERE iip.id_ = #{id}
+    </select>
 </mapper>

+ 26 - 13
mec-biz/src/main/resources/config/mybatis/InspectionMapper.xml

@@ -14,7 +14,8 @@
         <result column="update_time_" property="updateTime"/>
         <result column="organName" property="organName"/>
         <result column="userName" property="userName"/>
-        <collection property="inspectionItems" ofType="com.ym.mec.biz.dal.entity.InspectionItem" resultMap="com.ym.mec.biz.dal.dao.InspectionItemDao.InspectionItem"/>
+        <collection property="inspectionItems" columnPrefix="ie_" ofType="com.ym.mec.biz.dal.entity.InspectionItem"
+                    resultMap="com.ym.mec.biz.dal.dao.InspectionItemDao.InspectionItem"/>
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
@@ -28,17 +29,14 @@
         where id_ = #{id}
     </select>
     <delete id="delete" parameterType="java.lang.Long">
-        <!--@mbg.generated-->
-        delete from inspection
+        delete
+        from inspection
         where id_ = #{id}
     </delete>
     <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.Inspection"
             useGeneratedKeys="true">
-        <!--@mbg.generated-->
-        insert into inspection (organ_id_, user_id_, month_, operation_, create_time_, update_time_
-        )
-        values (#{organId}, #{userId}, #{month}, #{operation}, #{createTime}, #{updateTime}
-        )
+        insert into inspection (organ_id_, user_id_, month_, operation_, create_time_, update_time_)
+        values (#{organId}, #{userId}, #{month}, #{operation}, #{createTime}, #{updateTime})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Inspection">
         <!--@mbg.generated-->
@@ -75,7 +73,7 @@
         LEFT JOIN organization o ON o.id_=i.organ_id_
         LEFT JOIN sys_user su ON su.id_ = i.user_id_
         <include refid="queryPageSql"/>
-        ORDER BY i.id_
+            ORDER BY i.month_ DESC, i.id_ DESC
         <include refid="global.limit"/>
     </select>
 
@@ -105,10 +103,25 @@
         </where>
     </sql>
     <select id="getInfo" resultMap="Inspection">
-        SELECT i.*,ii.*, o.name_ organName,su.real_name_ userName FROM inspection i
-        LEFT JOIN organization o ON o.id_ = i.organ_id_
-        LEFT JOIN sys_user su ON su.id_ = i.user_id_
-        LEFT JOIN inspection_item ii ON ii.inspection_id_ = i.id_
+        SELECT i.*,
+               ii.id_              ie_id_,
+               ii.inspection_id_   ie_inspection_id_,
+               ii.organ_id_        ie_organ_id_,
+               ii.user_id_         ie_user_id_,
+               ii.item_            ie_item_,
+               ii.times_           ie_times_,
+               ii.planned_times_   ie_planned_times_,
+               ii.submitted_times_ ie_submitted_times_,
+               ii.memo_            ie_memo_,
+               ii.operation_       ie_operation_,
+               ii.create_time_     ie_create_time_,
+               ii.update_time_     ie_update_time_,
+               o.name_             organName,
+               su.real_name_       userName
+        FROM inspection i
+                 LEFT JOIN organization o ON o.id_ = i.organ_id_
+                 LEFT JOIN sys_user su ON su.id_ = i.user_id_
+                 LEFT JOIN inspection_item ii ON ii.inspection_id_ = i.id_
         WHERE i.id_ = #{id}
     </select>
 </mapper>

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

@@ -646,4 +646,18 @@
         LEFT JOIN school s ON s.id_=mg.school_id_
         WHERE mg.id_ = #{id}
     </select>
+    <select id="getByEduTeacher" resultMap="MusicGroup">
+        SELECT * FROM music_group WHERE organ_id_ = #{organId}
+        AND educational_teacher_id_ = #{eduTeacherId} AND status_ = 'PROGRESS'
+        <if test="search != null">
+            AND name_ LIKE CONCAT('%',#{search},'%')
+        </if>
+    </select>
+
+    <select id="getMusicGroupEduTeacher" resultMap="com.ym.mec.biz.dal.dao.TeacherDao.SysUser">
+        SELECT su.* FROM music_group mg
+        LEFT JOIN sys_user su ON su.id_ = mg.educational_teacher_id_
+        WHERE mg.organ_id_ = #{organId} AND status_ = 'PROGRESS' AND mg.educational_teacher_id_ >0
+        GROUP BY su.id_
+    </select>
 </mapper>

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml

@@ -387,7 +387,7 @@
 	<select id="queryNoPaymentTotalAmount" resultType="java.util.Map">
 		SELECT mgpcd.user_id_ 'key',SUM(mgpcd.expect_amount_) 'value' FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
-		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.music_group_id_ = #{musicGroupId} AND mgpc.status_ IN ('OPEN','OVER','PAID')
+		WHERE mgpc.batch_no_ IS NULL AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpc.music_group_id_ = #{musicGroupId} AND mgpc.status_ IN ('OPEN','OVER','PAID')
 		GROUP BY mgpcd.user_id_
 	</select>
 

+ 22 - 6
mec-biz/src/main/resources/config/mybatis/MusicGroupQuitMapper.xml

@@ -13,8 +13,13 @@
         <result column="create_time_" property="createTime"/>
         <result column="reason_" property="reason"/>
         <result column="user_comment_" property="userComment"/>
-        <result column="status_" property="status"
-                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <association property="musicGroup" javaType="com.ym.mec.biz.dal.entity.MusicGroup">
+            <result column="music_group_name_" property="name"/>
+        </association>
+        <association property="user" javaType="com.ym.mec.auth.api.entity.SysUser">
+            <result column="username_" property="username"/>
+        </association>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -34,8 +39,6 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupQuit"
             useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-        <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
-            AS ID FROM DUAL </selectKey> -->
         INSERT INTO music_group_quit
         (id_,user_id_,music_group_id_,join_date_,quit_date_,create_time_,reason_,user_comment_,status_)
         VALUES(#{id},#{userId},#{musicGroupId},#{joinDate},#{quitDate},#{createTime},#{reason},#{userComment},
@@ -87,14 +90,27 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="MusicGroupQuit" parameterType="map">
-        SELECT * FROM music_group_quit ORDER BY id_
+        SELECT mgq.*,mg.name_ music_group_name_,su.username_
+        FROM music_group_quit mgq
+        LEFT JOIN sys_user su ON su.id_ = mgq.user_id_
+        LEFT JOIN music_group mg ON mg.id_ = mgq.music_group_id_
+        <include refid="queryPageSql"/>
+        ORDER BY id_
         <include refid="global.limit"/>
     </select>
+    <sql id="queryPageSql">
+        <where>
+            <if test="ids != null and ids != ''">
+                FIND_IN_SET(mgq.id_,#{ids})
+            </if>
+        </where>
+    </sql>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM music_group_quit
+        FROM music_group_quit mgq
+        <include refid="queryPageSql"/>
     </select>
     <select id="countMusicGroupQuitNum" resultType="int">
         SELECT COUNT(*)

+ 44 - 78
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -493,98 +493,64 @@
         LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
         left join sys_user tu on tu.id_ = cs.actual_teacher_id_
         left join organization o on o.id_ = cs.organ_id_
+        <include refid="findStudentAttendanceSql"/>
+        ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
+        <include refid="global.limit"/>
+    </select>
+    <sql id="findStudentAttendanceSql">
         <where>
-        	<if test="courseScheduleId != null">
-        		cssp.course_schedule_id_ = #{courseScheduleId}
-        	</if>
-        	<if test="search != null">
-        		and cssp.course_schedule_id_ = #{search}
-        	</if>
-        	<if test="studentID != null">
-        		and cssp.user_id_ = #{studentID}
-        	</if>
-        	<if test="startDateOfCourse != null">
-        		and cs.class_date_ &gt;= #{startDateOfCourse}
-        	</if>
-        	<if test="endDateOfCourse != null">
-        		and cs.class_date_ &lt;= #{endDateOfCourse}
-        	</if>
-        	<if test="courseScheduleType != null">
-        		and cs.type_ = #{courseScheduleType}
-        	</if>
-        	<if test="teacherId != null">
-        		and cs.actual_teacher_id_ = #{teacherId}
-        	</if>
-        	<if test="courseStatus != null">
-        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
+            <if test="courseScheduleId != null">
+                cssp.course_schedule_id_ = #{courseScheduleId}
+            </if>
+            <if test="search != null">
+                and cssp.course_schedule_id_ = #{search}
+            </if>
+            <if test="studentID != null">
+                and cssp.user_id_ = #{studentID}
+            </if>
+            <if test="startDateOfCourse != null">
+                and cs.class_date_ &gt;= #{startDateOfCourse}
+            </if>
+            <if test="endDateOfCourse != null">
+                and cs.class_date_ &lt;= #{endDateOfCourse}
+            </if>
+            <if test="courseScheduleType != null">
+                and cs.type_ = #{courseScheduleType}
+            </if>
+            <if test="teacherId != null">
+                and cs.actual_teacher_id_ = #{teacherId}
+            </if>
+            <if test="courseStatus != null">
+                and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="status != null">
                 and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
                 <if test="status.code == 'TRUANT'">
                     OR sa.id_ IS NULL
                 </if>
                 )
-        	</if>
-        	<if test="groupType != null">
-        		and cssp.group_type_ = #{groupType}
-        	</if>
-        	<if test="musicGroupId != null">
-        		and cssp.music_group_id_ = #{musicGroupId}
-        	</if>
+            </if>
+            <if test="groupType != null">
+                and cssp.group_type_ = #{groupType}
+            </if>
+            <if test="musicGroupId != null">
+                and cssp.music_group_id_ = #{musicGroupId}
+            </if>
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(cs.organ_id_,#{organId})
             </if>
+            <if test="ids != null and ids != ''">
+                AND FIND_IN_SET(cssp.id_,#{ids})
+            </if>
         </where>
-        ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
-        <include refid="global.limit"/>
-    </select>
+    </sql>
     
     <select id="countStudentAttendance" resultType="java.lang.Integer">
         SELECT count(cssp.id_) 
-        FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
+        FROM course_schedule_student_payment cssp
+        left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
         left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
-        <where>
-        	<if test="courseScheduleId != null">
-        		cssp.course_schedule_id_ = #{courseScheduleId}
-        	</if>
-        	<if test="search != null">
-        		and cssp.course_schedule_id_ = #{search}
-        	</if>
-        	<if test="studentID != null">
-        		and cssp.user_id_ = #{studentID}
-        	</if>
-        	<if test="startDateOfCourse != null">
-        		and cs.class_date_ &gt;= #{startDateOfCourse}
-        	</if>
-        	<if test="endDateOfCourse != null">
-        		and cs.class_date_ &lt;= #{endDateOfCourse}
-        	</if>
-        	<if test="courseScheduleType != null">
-        		and cs.type_ = #{courseScheduleType}
-        	</if>
-        	<if test="teacherId != null">
-        		and cs.actual_teacher_id_ = #{teacherId}
-        	</if>
-        	<if test="courseStatus != null">
-        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
-        		and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-                <if test="status.code == 'TRUANT'">
-                    OR sa.id_ IS NULL
-                </if>
-                )
-        	</if>
-        	<if test="groupType != null">
-        		and cssp.group_type_ = #{groupType}
-        	</if>
-        	<if test="musicGroupId != null">
-        		and cssp.music_group_id_ = #{musicGroupId}
-        	</if>
-            <if test="organId != null and organId != ''">
-                AND FIND_IN_SET(cs.organ_id_,#{organId})
-            </if>
-        </where>
+        <include refid="findStudentAttendanceSql"/>
     </select>
     <select id="findByCourseId" resultMap="StudentAttendance">
         SELECT * FROM student_attendance WHERE course_schedule_id_=#{courseId}

+ 41 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -218,6 +218,12 @@
     <update id="batchUpdateAdviser">
       UPDATE student s SET s.teacher_id_ = #{teacherId},s.update_time_ = NOW() WHERE FIND_IN_SET(s.user_id_,#{studentIds})
     </update>
+    <update id="updateServiceTag">
+        UPDATE student SET service_tag_ = #{serviceTag},update_time_ = NOW() WHERE user_id_ IN
+        <foreach collection="studentIds" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </update>
 
     <resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
         <result column="organ_name_" property="organName"/>
@@ -477,6 +483,7 @@
         <result column="course_schedule_id_" property="courseScheduleId"/>
         <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="music_group_id_" property="musicGroupId"/>
+        <result column="class_group_id_" property="classGroupId"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="actual_teacher_id_" property="actualTeacherId"/>
         <result column="course_start_time_" property="courseStartTime"/>
@@ -490,6 +497,7 @@
             cs.id_ course_schedule_id_,
             cs.group_type_,
             cs.music_group_id_,
+            cs.class_group_id_,
             CASE cs.type_ WHEN 'TRAINING_SINGLE' THEN 'SINGLE' WHEN 'TRAINING_MIX' THEN 'MIX' ELSE cs.type_ END type_,
             cs.actual_teacher_id_,
             CONCAT(cs.class_date_, ' ', cs.start_class_time_) course_start_time_,
@@ -513,6 +521,29 @@
         ORDER BY cssp.user_id_,course_start_time_
     </select>
 
+    <select id="getNoCourseBeServeStudentInfo" resultMap="StudentServeCourseDto">
+        SELECT
+            sr.user_id_ student_id_,
+            stu.teacher_id_ lead_teacher_id_,
+            'MUSIC' group_type_,
+            sr.music_group_id_
+        FROM
+            student_registration sr
+            LEFT JOIN student stu ON sr.user_id_ = stu.user_id_
+            LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
+        WHERE
+            mg.del_flag_ = 0
+            AND mg.organ_id_ IS NOT NULL
+            AND mg.status_ = 'PROGRESS'
+            AND sr.music_group_status_ = 'NORMAL'
+            <if test="noCourseStudentIds!=null and noCourseStudentIds.size()>0">
+                AND sr.user_id_ IN
+                <foreach collection="noCourseStudentIds" item="noCourseStudentId" open="(" close=")" separator=",">
+                    #{noCourseStudentId}
+                </foreach>
+            </if>
+    </select>
+
     <select id="getStudentNames" resultType="string">
         SELECT username_ FROM sys_user WHERE id_ IN
         <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
@@ -576,4 +607,14 @@
             #{studentId}
         </foreach>
     </select>
+    <select id="queryCloseServiceTagIds" resultType="java.lang.Integer">
+        SELECT s.user_id_ FROM student s
+        LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
+        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+        LEFT JOIN student_registration sr ON sr.user_id_ = s.user_id_
+        LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_
+        WHERE s.service_tag_ = 1
+        GROUP BY s.user_id_ HAVING COUNT(CASE WHEN cs.status_ = 'NOT_START' THEN 1 ELSE NULL END) = 0
+        AND COUNT(CASE WHEN sr.music_group_status_ = 'NORMAL' AND mg.status_ = 'PROGRESS' THEN 1 ELSE NULL END) = 0;
+    </select>
 </mapper>

+ 16 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -416,7 +416,7 @@
         <![CDATA[ AND create_time_ <= ]]> #{beforeTime}
     </select>
     <select id="countStudentPaymentNum" resultType="int">
-        select count(1)
+        select count(DISTINCT user_id_)
         from student_payment_order
         where music_group_id_ = #{musicGroupId}
           AND status_ = 'SUCCESS'
@@ -871,4 +871,19 @@
     <select id="getAdaPayOrdersByTime" resultMap="StudentPaymentOrder"><![CDATA[
         SELECT * FROM student_payment_order WHERE pay_time_ >= #{startTime} AND pay_time_ <= #{endTime} AND payment_channel_='ADAPAY' AND status_ ='SUCCESS']]>
     </select>
+    <select id="queryFinanceCurrentDay" resultType="java.util.Map">
+        SELECT * FROM (SELECT SUM(fe.amount_) pay FROM financial_expenditure fe
+        WHERE DATE_FORMAT(fe.create_time_,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d') AND del_flag_ = 0
+            <if test="organId != null and organId != ''">
+                FIND_IN_SET(fe.organ_id_,#{organId})
+            </if>
+            ) a,
+        (SELECT SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN spo.balance_payment_amount_ ELSE 0 END) balance_amount_,
+        SUM(CASE WHEN spo.payment_channel_ = 'BALANCE' THEN 0 ELSE spo.actual_amount_ END) actual_amount_
+        FROM student_payment_order spo
+        WHERE DATE_FORMAT(spo.pay_time_,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d') AND spo.status_ = 'SUCCESS'
+        <if test="organId != null and organId != ''">
+            FIND_IN_SET(spo.organ_id_,#{organId})
+        </if>) b
+    </select>
 </mapper>

+ 6 - 3
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -536,7 +536,9 @@
     </update>
 
     <select id="queryStudentNum" resultType="map">
-        SELECT count(distinct sr.user_id_) total_num_,sum(case when sr.create_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) new_num_,sum(case when sr.music_group_status_ = 'QUIT' and sr.update_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) quit_num_
+        SELECT count(distinct sr.user_id_) total_num_,
+               sum(case when sr.create_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) new_num_,
+               sum(case when sr.music_group_status_ = 'QUIT' and sr.update_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) quit_num_
         FROM student_registration sr left join music_group mg on sr.music_group_id_ = mg.id_
         where mg.organ_id_ not in (36,38)
    		<if test="organId != null">
@@ -707,9 +709,10 @@
     </select>
 
     <select id="getUserGroups" resultMap="UserGroupDto">
-        SELECT DISTINCT sr.user_id_, mg.id_ group_id_, mg.name_ group_name_ FROM student_registration sr
+        SELECT DISTINCT sr.user_id_, mg.id_ group_id_, mg.name_ group_name_
+        FROM student_registration sr
         LEFT JOIN music_group mg ON sr.music_group_id_=mg.id_
-        WHERE sr.payment_status_=2 AND sr.user_id_ IN
+        WHERE sr.payment_status_=2 AND sr.music_group_status_ = 'NORMAL' AND sr.user_id_ IN
         <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
             #{userId}
         </foreach>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/StudentVisitMapper.xml

@@ -182,7 +182,7 @@
         </foreach>
     </select>
     <select id="getTeacherVisitCount" resultType="com.ym.mec.biz.dal.dto.TeacherVisitDto">
-        SELECT teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
+        SELECT organ_id_ organId, teacher_id_ teacherId,date_format(visit_time_, '%Y-%m') month, COUNT(*) num
         FROM student_visit
         WHERE teacher_id_ IN
         <foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">
@@ -191,6 +191,6 @@
         AND visit_time_ >= #{startTime}
         <![CDATA[AND visit_time_ <= #{endTime}
         ]]>
-        GROUP BY teacher_id_,date_format(visit_time_, '%Y-%m')
+        GROUP BY organ_id_, teacher_id_,date_format(visit_time_, '%Y-%m')
     </select>
 </mapper>

+ 8 - 1
mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml

@@ -233,12 +233,14 @@
         <result column="course_schedule_status_" property="courseScheduleStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="course_schedule_name_" property="courseScheduleName"/>
         <result column="teacher_name_" property="teacherName"/>
+        <result column="job_nature_" property="jobNature" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="organ_name_" property="organName"/>
         <result column="teacher_id_" property="teacherId"/>
         <result column="sign_in_status_" property="signInStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="sign_out_status_" property="signOutStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="sign_in_time_" property="signInTime"/>
         <result column="sign_out_time_" property="signOutTime"/>
+        <result column="complaints_status_" property="complaintsStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="remark_" property="remark"/>
         <result column="course_schedule_id_" property="courseScheduleId"/>
     </resultMap>
@@ -311,6 +313,9 @@
             <if test="teacherAttendanceId != null and teacherAttendanceId != ''">
                 AND FIND_IN_SET(ta.id_,#{teacherAttendanceId})
             </if>
+            <if test="jobNature != null">
+                AND t.job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         </where>
     </sql>
 
@@ -334,11 +339,12 @@
         cs.class_date_,cs.start_class_time_,cs.end_class_time_,cs.type_ course_schedule_type_,
         IF(ta.sign_in_status_ IS NULL,3,ta.sign_in_status_) sign_in_status_,
         IF(ta.sign_out_status_ IS NULL,3,ta.sign_out_status_) sign_out_status_,
-        ta.sign_in_time_,ta.sign_out_time_,ta.remark_,o.name_ organ_name_
+        ta.sign_in_time_,ta.sign_out_time_,ta.remark_,o.name_ organ_name_,t.job_nature_,ta.complaints_status_
         FROM course_schedule_teacher_salary csts
         LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
         LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = csts.course_schedule_id_ AND ta.teacher_id_ = csts.user_id_
         LEFT JOIN sys_user su ON su.id_ = csts.user_id_
+        LEFT JOIN teacher t ON t.id_ = csts.user_id_
         LEFT JOIN organization o ON o.id_ = cs.organ_id_
         <include refid="queryTeacherAttendancesCondition"/>
         ORDER BY cs.class_date_ ASC,cs.start_class_time_ ASC
@@ -357,6 +363,7 @@
         LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
         LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = csts.course_schedule_id_ AND ta.teacher_id_ = csts.user_id_
         LEFT JOIN sys_user su ON su.id_ = csts.user_id_
+        LEFT JOIN teacher t ON t.id_ = csts.user_id_
         <include refid="queryTeacherAttendancesCondition"/>
     </select>
 

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/TeacherCourseStatisticsMapper.xml

@@ -123,7 +123,7 @@
                 AND tcs.user_id_ = #{userId}
             </if>
             <if test="lowSalary != null">
-                AND tcs.low_salary_ = #{lowSalary}
+                AND tcs.low_salary = #{lowSalary}
             </if>
             <if test="minSalary != null">
                 AND tcs.expect_total_salary_ &gt; #{minSalary}

+ 10 - 0
mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java

@@ -149,4 +149,14 @@ public interface TaskRemoteService {
 	//首页数据统计
 	@GetMapping("task/countIndexBaseData")
 	void countIndexBaseData();
+
+	//巡查日程提醒
+	@GetMapping("task/inspectionPlan")
+	void inspectionPlan();
+
+	/**
+	 * 关闭学员服务指标
+	 */
+	@GetMapping("task/closeStudentServiceTag")
+    void closeStudentServiceTag();
 }

+ 10 - 0
mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java

@@ -190,4 +190,14 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 	public void countIndexBaseData() {
 		logger.info("首页数据统计失败");
 	}
+
+	@Override
+	public void inspectionPlan() {
+		logger.info("巡查日程提醒提送失败");
+	}
+
+	@Override
+	public void closeStudentServiceTag() {
+		logger.info("学员服务指标关闭失败");
+	}
 }

+ 4 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -324,7 +324,7 @@ public class StudentOrderController extends BaseController {
 
     //    @Scheduled(cron = "0/30 * * * * ?")
     @GetMapping("/setSuccessStatus")
-    public HttpResponseResult setSuccessStatus() throws Exception {
+    public HttpResponseResult setSuccessStatus(String orderNo) throws Exception {
 //        if (!profiles.equals("dev")) {
 //            return failed("非法操作");
 //        }
@@ -332,6 +332,9 @@ public class StudentOrderController extends BaseController {
 
         String[] statusArr = {"0", "1", "7"};
         for (StudentPaymentOrder payingOrder : payingOrders) {
+            if(StringUtils.isNotBlank(orderNo)&&!orderNo.equals(payingOrder.getOrderNo())){
+                continue;
+            }
             Map<String, String> rpMap = new HashMap<>();
             rpMap.put("tradeState", "1");
             rpMap.put("remarks", "模拟支付成功");

+ 19 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/CloseStudentServiceTagTask.java

@@ -0,0 +1,19 @@
+package com.ym.mec.task.jobs;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CloseStudentServiceTagTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.closeStudentServiceTag();
+	}
+}

+ 19 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/InspectionPlanTask.java

@@ -0,0 +1,19 @@
+package com.ym.mec.task.jobs;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class InspectionPlanTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.inspectionPlan();
+	}
+}

+ 11 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherAttendanceController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.TeacherAttendanceService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -70,14 +71,22 @@ public class TeacherAttendanceController extends BaseController {
     @ApiOperation(value = "提交考勤申述")
     @PostMapping("/addComplaints")
     public Object addComplaints(Long courseScheduleId,String content,String url){
-        teacherAttendanceService.addComplaints(courseScheduleId,content,url);
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(user)){
+            throw new BizException("请登录");
+        }
+        teacherAttendanceService.addComplaints(courseScheduleId,content,url,user.getId());
         return succeed();
     }
 
     @ApiOperation(value = "撤销考勤申述")
     @PostMapping("/repealComplaints")
     public Object repealComplaints(Long courseScheduleId){
-        teacherAttendanceService.repealComplaints(courseScheduleId);
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(user)){
+            throw new BizException("请登录");
+        }
+        teacherAttendanceService.repealComplaints(courseScheduleId,user.getId());
         return succeed();
     }
 }

+ 92 - 0
mec-util/src/main/java/com/ym/mec/util/excel/POIUtil.java

@@ -795,4 +795,96 @@ public class POIUtil {
 		return workbook;
 	}
 
+	/**
+	 * 将数据集dataset导出到fileName文件中
+	 *
+	 * @param headColumns  导出文件的列名
+	 * @param fieldColumns
+	 * @param dataset      数据源
+	 * @return
+	 * @throws IOException
+	 * @throws NoSuchMethodException
+	 * @throws InvocationTargetException
+	 * @throws IllegalAccessException
+	 */
+	public static <T> HSSFWorkbook multipleHeaderExportExcel(List<String[]> headers, String[] fieldColumns, List<T> dataset) throws IOException, IllegalAccessException,
+			InvocationTargetException, NoSuchMethodException {
+		if (headers == null || headers.size()<=0) {
+			throw new UtilException("excel列名不能为空");
+		}
+		if (dataset == null) {
+			throw new UtilException("数据集不能为空");
+		}
+		/*if (dataset.size() > MAX_DATA_SIZE) {
+			throw new UtilException("数据集太大,不能导出.最大数据集不能超过" + MAX_DATA_SIZE);
+		}*/
+		HSSFWorkbook workbook = new HSSFWorkbook();
+		HSSFCellStyle style = workbook.createCellStyle(); // 获取单元格样式
+		/************** 设置单元格样式 *************/
+		style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); // 垂直
+		style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 水平
+		style.setWrapText(true);
+		HSSFFont font = workbook.createFont();
+		font.setColor(HSSFFont.COLOR_NORMAL);
+		font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+		style.setFont(font);
+
+		HSSFSheet sheet = workbook.createSheet(); // 创建sheet
+		// 设置表头
+		// 创建第一行
+		HSSFCell cell = null;
+		int k =0;
+		for (String[] headColumns : headers) {
+			HSSFRow row1 = sheet.createRow(k);
+			for (int i = 0; i < headColumns.length; i++) {
+				// 创建列
+				cell = row1.createCell(i);
+				// 定义单元格为字符串类型
+				cell.setCellType(HSSFCell.CELL_TYPE_STRING);
+				// 设置单元格的样式
+				cell.setCellStyle(style);
+				// 设置单元格的值
+				cell.setCellValue(headColumns[i]);
+			}
+			k++;
+		}
+
+		HSSFRow row = null;
+		// 添加数据
+		T data = null;
+		Object obj = null;
+		StandardEvaluationContext context = null;
+		for (int i = 1; i <= dataset.size(); i++) {
+			data = dataset.get(i - 1);
+			if (data != null) {
+
+				context = new StandardEvaluationContext(data);
+				row = sheet.createRow(i+headers.size()-1);
+				for (int j = 0; j < fieldColumns.length; j++) {
+					cell = row.createCell(j);
+					try {
+						if(data instanceof Map) {
+							obj = PropertyUtils.getNestedProperty(data, fieldColumns[j]);
+						}else {
+							obj = expressionParser.parseExpression(fieldColumns[j]).getValue(context);
+						}
+						if (obj instanceof Date) {
+							obj = sdf.format(obj);
+						}
+
+					} catch (Exception e) {
+						LOGGER.warn(e.getMessage());
+						obj = null;
+					}
+					if (obj != null) {
+						cell.setCellValue(obj.toString());
+					} else {
+						cell.setCellValue("");
+					}
+				}
+			}
+		}
+		return workbook;
+	}
+
 }

+ 7 - 6
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -196,16 +196,17 @@ public class EmployeeController extends BaseController {
     @ApiOperation(value = "获取维修技师")
     @GetMapping("/findTechnician")
     @PreAuthorize("@pcs.hasPermissions('employee/findTechnician')")
-    public HttpResponseResult findTechnician(){
+    public HttpResponseResult findTechnician(String organIds){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = new String();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        if (!sysUser.getIsSuperAdmin()) {
-            Employee employee = employeeService.get(sysUser.getId());
-            if (StringUtils.isEmpty(organIds)) {
-                organIds=employee.getOrganIdList();
+        if(StringUtils.isEmpty(organIds)){
+            if (!sysUser.getIsSuperAdmin()) {
+                Employee employee = employeeService.get(sysUser.getId());
+                if (StringUtils.isEmpty(organIds)) {
+                    organIds=employee.getOrganIdList();
+                }
             }
         }
         return succeed(employeeService.findByRole("37",organIds));

+ 7 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -345,9 +345,9 @@ public class ExportController extends BaseController {
         List rows = teacherAttendanceService.queryTeacherAttendances(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "老师编号", "老师姓名", "课程编号", "课程名称", "上课日期",
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "老师编号", "老师姓名", "工作性质", "课程编号", "课程名称", "上课日期",
                     "课程开始时间", "课程结束时间", "课程类型", "签到时间", "签到状态", "签退时间", "签退状态", "备注"}, new String[]{
-                    "organName", "teacherId", "teacherName", "courseScheduleId", "courseScheduleName", "classDate",
+                    "organName", "teacherId", "teacherName", "jobNature.msg", "courseScheduleId", "courseScheduleName", "classDate",
                     "startClassTime", "endClassTime", "courseScheduleType.msg", "signInTime", "signInStatus.msg", "signOutTime", "signOutStatus.msg",
                     "remark"}, rows);
             response.setContentType("application/octet-stream");
@@ -1126,7 +1126,9 @@ public class ExportController extends BaseController {
                 } else {
                     if(row.getChargeType() != null && SporadicChargeTypeEnum.LEVEL.getCode().equals(row.getChargeType())){
                         row.setDegreeFee(row.getActualAmount());
-                    }else {
+                    }else if(row.getChargeType() != null && SporadicChargeTypeEnum.PRACTICE_GROUP_BUY.getCode().equals(row.getChargeType())){
+                        row.setPracticeCourseFee(row.getActualAmount());
+                    } else {
                         row.setOtherFee(row.getActualAmount());
                     }                }
                 if (row.getChargeType() != null) {
@@ -2258,6 +2260,8 @@ public class ExportController extends BaseController {
                 } else {
                     if(row.getChargeType() != null && SporadicChargeTypeEnum.LEVEL.getCode().equals(row.getChargeType())){
                         row.setDegreeFee(row.getActualAmount());
+                    }else if(row.getChargeType() != null && SporadicChargeTypeEnum.PRACTICE_GROUP_BUY.getCode().equals(row.getChargeType())){
+                        row.setPracticeCourseFee(row.getActualAmount());
                     }else {
                         row.setOtherFee(row.getActualAmount());
                     }

+ 41 - 16
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -8,6 +8,7 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import java.math.BigDecimal;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
@@ -99,6 +100,8 @@ public class IndexController extends BaseController {
 		Map<String, Object> incomeExpendMap = sysUserCashAccountDetailDao.queryStatisticsWithCurrentMonth(organId);
 		
 		Map<String, Object> incomeMap = studentPaymentOrderDao.queryIncomeStatisticsWithCurrentMonth(organId);
+
+		Map<String, BigDecimal> financeDatas = studentPaymentOrderDao.queryFinanceCurrentDay(organId);
 		
 		ModelMap model = new ModelMap();
 		model.put("musicDatas", musicDatas);
@@ -111,73 +114,95 @@ public class IndexController extends BaseController {
 		model.put("demoGroupNum", demoGroupNum);
 		model.put("incomeExpendMap", incomeExpendMap);
 		model.put("incomeMap", incomeMap);
-
+		model.put("financeDatas", financeDatas);
 		return succeed(model);
 	}
 
 	@GetMapping("/newIndex")
-	public HttpResponseResult newIndex(String dataTypes, String organIds, Integer year){
+	public HttpResponseResult newIndex(String dataTypes, String organId, Integer year){
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		if (!sysUser.getIsSuperAdmin()) {
+			Employee employee = employeeService.get(sysUser.getId());
+			if (StringUtils.isBlank(organId)) {
+				organId = employee.getOrganIdList();
+			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
+				return failed("用户所在分部异常");
+			}else {
+				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+				if(!list.containsAll(Arrays.asList(organId.split(",")))){
+					return failed("非法请求");
+				}
+			}
+		}
+		return succeed(indexService.getIndexBaseData(dataTypes , organId, year));
+	}
+
+	@GetMapping("/hasIndexErrData")
+	public HttpResponseResult hasIndexErrData(String organId){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
 		if (!sysUser.getIsSuperAdmin()) {
 			Employee employee = employeeService.get(sysUser.getId());
-			if (StringUtils.isBlank(organIds)) {
-				organIds = employee.getOrganIdList();
+			if (StringUtils.isBlank(organId)) {
+				organId = employee.getOrganIdList();
 			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
 				return failed("用户所在分部异常");
 			}else {
 				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-				if(!list.containsAll(Arrays.asList(organIds.split(",")))){
+				if(!list.containsAll(Arrays.asList(organId.split(",")))){
 					return failed("非法请求");
 				}
 			}
 		}
-		return succeed(indexService.getIndexBaseData(dataTypes , organIds, year));
+		return succeed(indexService.hasIndexErrData(organId));
 	}
 
 	@GetMapping("/getIndexErrData")
-	public HttpResponseResult getIndexErrData(String organIds){
+	public HttpResponseResult getIndexErrData(String organId){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
 		if (!sysUser.getIsSuperAdmin()) {
 			Employee employee = employeeService.get(sysUser.getId());
-			if (StringUtils.isBlank(organIds)) {
-				organIds = employee.getOrganIdList();
+			if (StringUtils.isBlank(organId)) {
+				organId = employee.getOrganIdList();
 			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
 				return failed("用户所在分部异常");
 			}else {
 				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-				if(!list.containsAll(Arrays.asList(organIds.split(",")))){
+				if(!list.containsAll(Arrays.asList(organId.split(",")))){
 					return failed("非法请求");
 				}
 			}
 		}
-		return succeed(indexService.getIndexErrData(organIds));
+		return succeed(indexService.getIndexErrData(organId));
 	}
 
 	@GetMapping("/getRemindMatterData")
-	public HttpResponseResult getRemindMatterData(String organIds){
+	public HttpResponseResult getRemindMatterData(String organId){
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
 		if (!sysUser.getIsSuperAdmin()) {
 			Employee employee = employeeService.get(sysUser.getId());
-			if (StringUtils.isBlank(organIds)) {
-				organIds = employee.getOrganIdList();
+			if (StringUtils.isBlank(organId)) {
+				organId = employee.getOrganIdList();
 			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
 				return failed("用户所在分部异常");
 			}else {
 				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-				if(!list.containsAll(Arrays.asList(organIds.split(",")))){
+				if(!list.containsAll(Arrays.asList(organId.split(",")))){
 					return failed("非法请求");
 				}
 			}
 		}
-		return succeed(indexService.getRemindMatterData(organIds));
+		return succeed(indexService.getRemindMatterData(organId));
 	}
 }

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/controller/InspectionController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.page.InspectionQueryInfo;
@@ -31,6 +32,8 @@ public class InspectionController extends BaseController {
     private EmployeeDao employeeDao;
     @Resource
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
 
     @ApiOperation(value = "添加巡查任务")
     @PostMapping("/add")
@@ -92,4 +95,12 @@ public class InspectionController extends BaseController {
         return succeed(inspectionService.getInfo(id));
     }
 
+
+    @ApiOperation(value = "获取分部进行中乐团的乐团主管")
+    @GetMapping("/getMusicGroupEduTeacher")
+    @PreAuthorize("@pcs.hasPermissions('inspection/getMusicGroupEduTeacher')")
+    public HttpResponseResult<List<SysUser>> getMusicGroupEduTeacher(Integer organId) {
+        return succeed(musicGroupDao.getMusicGroupEduTeacher(organId));
+    }
+
 }

+ 6 - 1
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemController.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.InspectionItem;
@@ -47,7 +48,7 @@ public class InspectionItemController extends BaseController {
     }
 
     @ApiOperation(value = "巡查任务事项列表")
-    @GetMapping("/queryPage")
+    @RequestMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('inspectionItem/queryPage')")
     public HttpResponseResult<PageInfo<InspectionItem>> queryPage(InspectionQueryInfo queryInfo) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -67,6 +68,10 @@ public class InspectionItemController extends BaseController {
                 }
             }
         }
+        List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+        if (!userRole.contains(SysUserRole.SECTION_MANAGER) && !sysUser.getIsSuperAdmin()) {
+            queryInfo.setUserId(sysUser.getId());
+        }
         return succeed(inspectionItemService.getPageList(queryInfo));
     }
 }

+ 46 - 9
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanConclusionController.java

@@ -1,20 +1,19 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.OperatingReport;
+import com.ym.mec.biz.dal.dao.InspectionItemPlanDao;
+import com.ym.mec.biz.dal.entity.InspectionItemPlan;
 import com.ym.mec.biz.service.InspectionItemPlanConclusionService;
 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.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.ss.util.CellRangeAddressList;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -30,6 +29,8 @@ import java.util.*;
 public class InspectionItemPlanConclusionController extends BaseController {
     @Autowired
     private InspectionItemPlanConclusionService InspectionItemPlanConclusionService;
+    @Autowired
+    private InspectionItemPlanDao inspectionItemPlanDao;
 
     @ApiOperation(value = "获取日程的巡查结果")
     @GetMapping("/getPlanConclusion")
@@ -64,17 +65,53 @@ public class InspectionItemPlanConclusionController extends BaseController {
                 });
             });
 
-            List<String> bodyList = new ArrayList<>();
+            List<String> bodyList = new LinkedList<>();
             conclusions.get(0).forEach((key, vak) -> {
                 bodyList.add(key);
             });
+            InspectionItemPlan planInfo = inspectionItemPlanDao.getPlanInfo(planId);
+            String dateTime = DateUtil.dateToString(planInfo.getPlanStart(), "yyyy-MM-dd") + " " + DateUtil.dateToString(planInfo.getPlanStart(), "HH:mm") + "~" + DateUtil.dateToString(planInfo.getPlanEnd(), "HH:mm");
+            String[] header = {"所属分部", planInfo.getOrganName(), "", "合作单位", planInfo.getCooperationName(), "", "巡查乐团", planInfo.getMusicGroupName(), "", "", "", "", "", "", "", ""};
+            String[] header1 = {"乐团主管", planInfo.getRealName(), "", "巡查时间", dateTime, "", "提交时间", DateUtil.dateToString(planInfo.getSubmitedTime(), "yyyy-MM-dd HH:mm"), "", "", "", "", "", "", ""};
+            String[] header2 = {"处理方式", planInfo.getMemo(), "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
+            String[] header3 = {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
+            String[] header4 = {"巡查项目", "课前管理", "", "", "", "", "课中管理", "", "", "", "", "", "", "课后管理", "", ""};
+            String[] header5 = {"", "老师是否提前准备板书(本课内容、作业)", "老师是否佩戴工牌", "老师是否仪容仪表整洁", "老师是否携带乐器", "老师是否携带教学资料、设备", "老师是否合理安排学员座位", "乐器箱包、书包是否摆放整齐", "课堂纪律是否保持良好", "老师是否全程站立教学", "老师是否全程使用节拍器或教学音频", "是否发现学员需要更换新乐器", "老师是否将上课照片/视频发送到声部群", "老师是否保持教室环境卫生", "老师是否关好所有电源、门窗", "老师是否有序组织学员放学"};
+
+            List<String[]> headers = new LinkedList<>();
+            headers.add(header);
+            headers.add(header1);
+            headers.add(header2);
+            headers.add(header3);
+            headers.add(header4);
+            headers.add(header5);
+
             String[] body = bodyList.toArray(new String[bodyList.size()]);
 
-            String[] header = {"老师", "老师是否提前准备板书(本课内容、作业)", "老师是否佩戴工牌", "老师是否仪容仪表整洁", "老师是否携带乐器", "老师是否携带教学资料、设备", "老师是否合理安排学员座位", "乐器箱包、书包是否摆放整齐", "课堂纪律是否保持良好", "老师是否全程站立教学", "老师是否全程使用节拍器或教学音频", "是否发现学员需要更换新乐器", "老师是否将上课照片/视频发送到声部群", "老师是否保持教室环境卫生", "老师是否关好所有电源、门窗", "老师是否有序组织学员放学"};
-            HSSFWorkbook workbook = POIUtil.exportExcel(header, body, conclusions);
+
+            HSSFWorkbook workbook = POIUtil.multipleHeaderExportExcel(headers, body, conclusions);
+            //合并单元格处理
+            CellRangeAddressList cellRangeAddressList = new CellRangeAddressList();
+            cellRangeAddressList.addCellRangeAddress(0, 1, 0, 2);
+            cellRangeAddressList.addCellRangeAddress(0, 4, 0, 5);
+            cellRangeAddressList.addCellRangeAddress(0, 7, 0, 8);
+            cellRangeAddressList.addCellRangeAddress(1, 1, 1, 2);
+            cellRangeAddressList.addCellRangeAddress(1, 4, 1, 5);
+            cellRangeAddressList.addCellRangeAddress(1, 7, 1, 8);
+            cellRangeAddressList.addCellRangeAddress(2, 1, 2, 2);
+            cellRangeAddressList.addCellRangeAddress(2, 3, 2, 8);
+            cellRangeAddressList.addCellRangeAddress(3, 0, 3, 15);
+            cellRangeAddressList.addCellRangeAddress(4, 0, 5, 0);
+            cellRangeAddressList.addCellRangeAddress(4, 1, 4, 5);
+            cellRangeAddressList.addCellRangeAddress(4, 6, 4, 12);
+            cellRangeAddressList.addCellRangeAddress(4, 13, 4, 15);
+
+            for (CellRangeAddress cellRangeAddress : cellRangeAddressList.getCellRangeAddresses()) {
+                workbook.getSheetAt(0).addMergedRegion(cellRangeAddress);
+            }
 
             response.setContentType("application/octet-stream");
-            response.setHeader("Content-Disposition", "attachment;filename=cooperationOrgan-" + DateUtil.getDate(new Date()) + ".xls");
+            response.setHeader("Content-Disposition", "attachment;filename=conclusion-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
             outputStream = response.getOutputStream();
             workbook.write(outputStream);

+ 33 - 0
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanController.java

@@ -3,9 +3,11 @@ package com.ym.mec.web.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Inspection;
 import com.ym.mec.biz.dal.entity.InspectionItemPlan;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.InspectionItemPlanQueryInfo;
 import com.ym.mec.biz.service.InspectionItemPlanService;
 import com.ym.mec.common.controller.BaseController;
@@ -33,6 +35,8 @@ public class InspectionItemPlanController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private EmployeeDao employeeDao;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
 
     @ApiOperation(value = "添加巡查任务事项日程")
     @PostMapping("/add")
@@ -85,4 +89,33 @@ public class InspectionItemPlanController extends BaseController {
         }
         return succeed(inspectionItemPlanService.queryPage(queryInfo));
     }
+
+
+    @ApiOperation(value = "修改处理信息")
+    @PostMapping("/updateMemo")
+    @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/updateMemo')")
+    public HttpResponseResult<InspectionItemPlan> updateMemo(Long id, String memo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        InspectionItemPlan inspectionItemPlan = inspectionItemPlanService.get(id);
+        inspectionItemPlan.setMemo(memo);
+        inspectionItemPlan.setUpdateTime(new Date());
+        inspectionItemPlanService.update(inspectionItemPlan);
+        return succeed(inspectionItemPlan);
+    }
+
+
+    @ApiOperation(value = "获取乐团主管的乐团")
+    @GetMapping("/getMusicGroup")
+    @PreAuthorize("@pcs.hasPermissions('inspectionItemPlan/getMusicGroup')")
+    public HttpResponseResult<List<MusicGroup>> getMusicGroup(Integer organId, String search) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        return succeed(musicGroupDao.getByEduTeacher(organId, sysUser.getId(), search));
+    }
+
 }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupController.java

@@ -105,7 +105,7 @@ public class MusicGroupController extends BaseController {
 	}
 
 	@ApiOperation(value = "分页查询乐团列表")
-	@GetMapping("/queryPage")
+	@RequestMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('musicGroup/queryPage')")
 	public Object queryPage(MusicGroupQueryInfo queryInfo) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();

+ 4 - 2
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java

@@ -1,10 +1,12 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.page.MusicGroupQuitQueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 
+import org.springframework.beans.factory.FactoryBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -38,9 +40,9 @@ public class MusicGroupQuitController extends BaseController {
 	private SysUserFeignService sysUserFeignService;
 
 	@ApiOperation(value = "分页查询")
-	@GetMapping("/queryPage")
+	@RequestMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupQuit/queryPage')")
-	public HttpResponseResult queryPage(QueryInfo queryInfo) throws Exception {
+	public HttpResponseResult queryPage(MusicGroupQuitQueryInfo queryInfo) throws Exception {
 		return succeed(musicGroupQuitService.queryPage(queryInfo));
 	}
 

+ 15 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -91,12 +91,21 @@ public class TaskController extends BaseController {
 	@Autowired
 	private IndexBaseMonthDataService indexBaseMonthDataService;
 
+	@Autowired
+	private InspectionItemPlanService inspectionItemPlanService;
+
 	@GetMapping(value = "/autoAffirmReceiveTask")
 	// 自动确认收货
 	public void affirmReceive(){
 		studentGoodsSellService.affirmReceive(null);
 	}
 
+	@GetMapping(value = "/closeStudentServiceTag")
+	// 关闭指定学员服务指标
+	public void closeStudentServiceTag(){
+		studentServeService.closeStudentServiceTag();
+	}
+
 	@GetMapping(value = "/pushWaitSendMessageTask")
 	// 每天9点推送前一天22点之后的推送消息
 	public void pushWaitSendMessageTask(){
@@ -325,4 +334,10 @@ public class TaskController extends BaseController {
 	public void countIndexBaseData(String month){
 		indexBaseMonthDataService.indexBaseDataTask(month);
 	}
+
+	//乐团巡查计划当日9:00
+	@GetMapping("/inspectionPlan")
+	public void inspectionPlan(){
+		inspectionItemPlanService.pushNotice();
+	}
 }

+ 17 - 1
mec-web/src/main/java/com/ym/mec/web/controller/TeacherAttendanceController.java

@@ -44,7 +44,7 @@ public class TeacherAttendanceController extends BaseController {
     }
 
     @ApiOperation(value = "获取教师考勤记录")
-    @PostMapping("/queryTeacherAttendances")
+    @RequestMapping("/queryTeacherAttendances")
     @PreAuthorize("@pcs.hasPermissions('teacherAttendance/queryTeacherAttendances')")
     public Object queryTeacherAttendances(TeacherCloseQueryInfo queryInfo){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -128,4 +128,20 @@ public class TeacherAttendanceController extends BaseController {
         teacherAttendanceService.rejectTeacherAttendanceComplaints(teacherAttendanceId,content);
         return succeed();
     }
+
+    @ApiOperation(value = "提交考勤申述")
+    @PostMapping("/addComplaints")
+    @PreAuthorize("@pcs.hasPermissions('teacherAttendance/addComplaints')")
+    public Object addComplaints(Long courseScheduleId,String content,String url,Integer userId){
+        teacherAttendanceService.addComplaints(courseScheduleId,content,url,userId);
+        return succeed();
+    }
+
+    @ApiOperation(value = "撤销考勤申述")
+    @PostMapping("/repealComplaints")
+    @PreAuthorize("@pcs.hasPermissions('teacherAttendance/addComplaints')")
+    public Object repealComplaints(Long courseScheduleId,Integer userId){
+        teacherAttendanceService.repealComplaints(courseScheduleId,userId);
+        return succeed();
+    }
 }

+ 17 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
 
 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.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
@@ -10,6 +11,7 @@ import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.VipGroupStatusEnum;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
@@ -51,6 +53,8 @@ public class VipGroupManageController extends BaseController {
     private TeacherDao teacherDao;
     @Autowired
     private EmployeeDao employeeDao;
+    @Autowired
+    private ClassGroupDao classGroupDao;
 
     @Autowired
     private StudentApplyRefundsService studentApplyRefundsService;
@@ -70,8 +74,8 @@ public class VipGroupManageController extends BaseController {
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/update')")
     public HttpResponseResult update(VipGroup vipGroup){
+        VipGroup oldVipGroup = vipGroupService.get(vipGroup.getId());
         if(Objects.nonNull(vipGroup.getCoursesExpireDate())){
-            VipGroup oldVipGroup = vipGroupService.get(vipGroup.getId());
             if(Objects.isNull(oldVipGroup)){
                 throw new BizException("此课程组不存在");
             }
@@ -79,6 +83,18 @@ public class VipGroupManageController extends BaseController {
                 throw new BizException("此课程组状态暂不支持修改");
             }
         }
+        if(Objects.isNull(oldVipGroup.getVipGroupActivityId())){
+            if(VipGroupStatusEnum.PROGRESS.equals(vipGroup.getStatus())&&oldVipGroup.getStatus().getCode()>VipGroupStatusEnum.PROGRESS.getCode()){
+                throw new BizException("此课程组状态暂不支持修改");
+            }
+            ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(oldVipGroup.getId().toString(), ClassGroupTypeEnum.VIP.getCode());
+            if(Objects.isNull(classGroup)){
+                throw new BizException("课程信息错误");
+            }
+            if(classGroup.getStudentNum()<3){
+                throw new BizException("班级人数未达到3人");
+            }
+        }
         vipGroupService.update(vipGroup);
         return succeed();
     }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/student/StudentAttendanceController.java

@@ -64,7 +64,7 @@ public class StudentAttendanceController extends BaseController {
     }
 
     @ApiOperation(value = "获取某节课学生签到列表")
-    @GetMapping("/findStudentAttendance")
+    @RequestMapping("/findStudentAttendance")
     @PreAuthorize("@pcs.hasPermissions('studentAttendance/findStudentAttendance')")
     public Object findStudentAttendance(StudentAttendanceQueryInfo queryInfo){
     	SysUser sysUser = sysUserFeignService.queryUserInfo();