Procházet zdrojové kódy

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

zouxuan před 4 roky
rodič
revize
32eb47e5ac
40 změnil soubory, kde provedl 1030 přidání a 105 odebrání
  1. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  2. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java
  3. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  4. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysImComplaintDao.java
  5. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/LocalDateBigDecimalMapDto.java
  6. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherSalaryDeductReasonDto.java
  7. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCloudTeacherFee.java
  8. 136 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysImComplaint.java
  9. 17 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/DeductReasonEnum.java
  10. 35 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TeachIncomeTypeEnum.java
  11. 19 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCloudTeacherFeeQueryInfo.java
  12. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherIncomeQueryInfo.java
  13. 15 4
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java
  14. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/ExportService.java
  15. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationCloudTeacherFeeService.java
  16. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  17. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysImComplaintService.java
  18. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  19. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  20. 171 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  21. 5 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java
  22. 6 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  23. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  24. 43 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationCloudTeacherFeeServiceImpl.java
  25. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  26. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysImComplaintServiceImpl.java
  27. 12 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  28. 14 1
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  29. 28 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  30. 13 2
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  31. 73 50
      mec-biz/src/main/resources/config/mybatis/OrganizationCloudTeacherFeeMapper.xml
  32. 5 0
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  33. 43 0
      mec-biz/src/main/resources/config/mybatis/SysImComplaintMapper.xml
  34. 35 0
      mec-student/src/main/java/com/ym/mec/student/controller/SysImComplaintController.java
  35. 17 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseScheduleTeacherSalaryController.java
  36. 35 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysImComplaintController.java
  37. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  38. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  39. 75 0
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCloudTeacherFeeController.java
  40. 35 0
      mec-web/src/main/java/com/ym/mec/web/controller/SysImComplaintController.java

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -1297,7 +1297,8 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<CourseSchedule> getTeacherCourseWithClassDate(@Param("teacherId") Integer teacherId,
                                                        @Param("startDay") String startDay,
                                                        @Param("endDay") String endDay,
-                                                       @Param("courseStatus") CourseStatusEnum courseStatus);
+                                                       @Param("courseStatus") CourseStatusEnum courseStatus,
+                                                       @Param("teachIncomeType") String teachIncomeType);
 
     /**
      * @describe 查询教师课程
@@ -1832,4 +1833,13 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @return
      */
     List<CourseSchedule> getMusicGroupsHasStartCourseNum(@Param("ids") List<String> ids);
+
+    /**
+     * @describe 根据主课查询被合并的课程
+     * @author Joburgess
+     * @date 2021/5/10 0010
+     * @param courseIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     */
+    List<CourseSchedule> getBeMergeCourseWithMainCourseIds(@Param("courseIds") List<Long> courseIds);
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -544,7 +544,8 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 													@Param("startDay") String startDay,
 													@Param("endDay") String endDay,
 													@Param("startClassDay") String startClassDay,
-													@Param("courseStatus") CourseStatusEnum courseStatus);
+													@Param("courseStatus") CourseStatusEnum courseStatus,
+													@Param("teachIncomeType") String teachIncomeType);
 
 	/**
 	 * @describe 教师年度收入统计

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

@@ -503,6 +503,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 获取乐团已缴费学员数量
+     *
      * @param musicGroupId
      * @return
      */
@@ -510,9 +511,18 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 查找报名中的学员
+     *
      * @param musicGroupId
      * @param studentIds
      * @return
      */
     StudentRegistration findApplyStudent(@Param("musicGroupId") String musicGroupId, @Param("studentIds") List<Integer> studentIds);
+
+    /**
+     * 乐团全部学生退团
+     *
+     * @param musicGroupId
+     * @return
+     */
+    int quitAllStudent(@Param("musicGroupId") String musicGroupId, @Param("remark") String remark);
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysImComplaintDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.biz.dal.entity.SysImComplaint;
+
+public interface SysImComplaintDao extends BaseDAO<Long, SysImComplaint>  {
+
+	
+}

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/LocalDateBigDecimalMapDto.java

@@ -14,6 +14,8 @@ public class LocalDateBigDecimalMapDto {
 
     private String dateStr;
 
+    private BigDecimal subsidy = new BigDecimal("0");
+
     private BigDecimal amount;
 
     public LocalDateBigDecimalMapDto(Date date, String dateStr, BigDecimal amount) {
@@ -22,6 +24,13 @@ public class LocalDateBigDecimalMapDto {
         this.amount = amount;
     }
 
+    public LocalDateBigDecimalMapDto(Date date, String dateStr, BigDecimal subsidy, BigDecimal amount) {
+        this.date = date;
+        this.dateStr = dateStr;
+        this.subsidy = subsidy;
+        this.amount = amount;
+    }
+
     public LocalDateBigDecimalMapDto() {
     }
 
@@ -41,6 +50,14 @@ public class LocalDateBigDecimalMapDto {
         this.dateStr = dateStr;
     }
 
+    public BigDecimal getSubsidy() {
+        return subsidy;
+    }
+
+    public void setSubsidy(BigDecimal subsidy) {
+        this.subsidy = subsidy;
+    }
+
     public BigDecimal getAmount() {
         return amount;
     }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherSalaryDeductReasonDto.java

@@ -12,10 +12,16 @@ public class TeacherSalaryDeductReasonDto {
 
     private DeductReasonEnum deductReason;
 
+    private String deductReasonMsg;
+
+    private String deductReasonStrDesc;
+
     private BigDecimal amount;
 
     public TeacherSalaryDeductReasonDto(DeductReasonEnum deductReason, BigDecimal amount) {
         this.deductReason = deductReason;
+        this.deductReasonMsg = deductReason.getMsg();
+        this.deductReasonStrDesc = deductReason.getDesc();
         this.amount = amount.setScale(2, BigDecimal.ROUND_DOWN);
     }
 
@@ -34,4 +40,20 @@ public class TeacherSalaryDeductReasonDto {
     public void setAmount(BigDecimal amount) {
         this.amount = amount.setScale(2, BigDecimal.ROUND_DOWN);
     }
+
+    public String getDeductReasonMsg() {
+        return deductReasonMsg;
+    }
+
+    public void setDeductReasonMsg(String deductReasonMsg) {
+        this.deductReasonMsg = deductReasonMsg;
+    }
+
+    public String getDeductReasonStrDesc() {
+        return deductReasonStrDesc;
+    }
+
+    public void setDeductReasonStrDesc(String deductReasonStrDesc) {
+        this.deductReasonStrDesc = deductReasonStrDesc;
+    }
 }

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCloudTeacherFee.java

@@ -7,6 +7,9 @@ import java.util.Date;
 
 public class OrganizationCloudTeacherFee {
 
+    @ApiModelProperty(value = "")
+    private Integer Id;
+
     @ApiModelProperty(value = "分部id")
     private Integer organId;
 
@@ -17,6 +20,9 @@ public class OrganizationCloudTeacherFee {
 
     private Date updateTime;
 
+    @ApiModelProperty(value = "分部")
+    private String organName;
+
     public Integer getOrganId() {
         return organId;
     }
@@ -49,4 +55,19 @@ public class OrganizationCloudTeacherFee {
         this.updateTime = updateTime;
     }
 
+    public Integer getId() {
+        return Id;
+    }
+
+    public void setId(Integer id) {
+        Id = id;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
 }

+ 136 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysImComplaint.java

@@ -0,0 +1,136 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_im_complaint):
+ */
+public class SysImComplaint {
+
+	/**  */
+	private Long id;
+	
+	/** 投诉对象类型 GROUP,PERSON*/
+	private String type;
+	
+	/** 图片凭证 */
+	private String url;
+	
+	/** 描述 */
+	private String memo;
+	
+	/** 投诉人 */
+	private Integer userId;
+	
+	/** 目标id */
+	private Long targetId;
+	
+	/** 处理人 */
+	private Long operator;
+	
+	/** 处理时间 */
+	private java.util.Date operatorTime;
+	
+	/** 处理状态0待处理,1已处理 */
+	private Integer status;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setType(String type){
+		this.type = type;
+	}
+	
+	public String getType(){
+		return this.type;
+	}
+			
+	public void setUrl(String url){
+		this.url = url;
+	}
+	
+	public String getUrl(){
+		return this.url;
+	}
+			
+	public void setMemo(String memo){
+		this.memo = memo;
+	}
+	
+	public String getMemo(){
+		return this.memo;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setTargetId(Long targetId){
+		this.targetId = targetId;
+	}
+	
+	public Long getTargetId(){
+		return this.targetId;
+	}
+			
+	public void setOperator(Long operator){
+		this.operator = operator;
+	}
+	
+	public Long getOperator(){
+		return this.operator;
+	}
+			
+	public void setOperatorTime(java.util.Date operatorTime){
+		this.operatorTime = operatorTime;
+	}
+	
+	public java.util.Date getOperatorTime(){
+		return this.operatorTime;
+	}
+			
+	public void setStatus(Integer status){
+		this.status = status;
+	}
+	
+	public Integer getStatus(){
+		return this.status;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 17 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/DeductReasonEnum.java

@@ -7,18 +7,22 @@ import com.ym.mec.common.enums.BaseEnum;
  * @Date 2021/4/16 0016
  **/
 public enum DeductReasonEnum implements BaseEnum<String,DeductReasonEnum> {
-    SIGN_IN_TIME_ERR("SIGN_IN_TIME_ERR", "签到时间异常"),
-    SIGN_OUT_TIME_ERR("SIGN_OUT_TIME_ERR", "签退时间异常"),
-    GPS_ERR("GPS_ERR", "位置异常"),
-    TRAIL("TRAIL", "试用期扣减");
+    SIGN_IN_TIME_ERR("SIGN_IN_TIME_ERR", "签到时间异常", ""),
+    SIGN_OUT_TIME_ERR("SIGN_OUT_TIME_ERR", "签退时间异常", ""),
+    GPS_ERR("GPS_ERR", "位置异常", ""),
+    NOT_SETTLEMENT("NOT_SETTLEMENT", "不结算课酬", "特殊老师不结算课酬"),
+    TRAIL("TRAIL", "试用期扣减", "试用期老师课酬按正式老师的80%计算");
 
     private String code;
 
     private String msg;
 
-    DeductReasonEnum(String code, String msg) {
+    private String desc;
+
+    DeductReasonEnum(String code, String msg, String desc) {
         this.code = code;
         this.msg = msg;
+        this.desc = desc;
     }
 
     @Override
@@ -37,4 +41,12 @@ public enum DeductReasonEnum implements BaseEnum<String,DeductReasonEnum> {
     public void setMsg(String msg) {
         this.msg = msg;
     }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
 }

+ 35 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TeachIncomeTypeEnum.java

@@ -0,0 +1,35 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum TeachIncomeTypeEnum implements BaseEnum<String, TeachIncomeTypeEnum> {
+	SALARY("SALARY", "课酬"),
+	SUBSIDY("SUBSIDY", "教学点补贴"),
+	SALE_REWARD("SALE_REWARD", "销售奖励");
+
+	private String code;
+
+	private String msg;
+
+	TeachIncomeTypeEnum(String code, String msg) {
+		this.code = code;
+		this.msg = msg;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	@Override
+	public String getCode() {
+		return this.code;
+	}
+}

+ 19 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCloudTeacherFeeQueryInfo.java

@@ -0,0 +1,19 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+
+public class OrganizationCloudTeacherFeeQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "所属分部编号", required = false)
+    private String organId;
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+}

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherIncomeQueryInfo.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.page;
 
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachIncomeTypeEnum;
 import com.ym.mec.common.page.QueryInfo;
 
 /**
@@ -17,7 +18,9 @@ public class TeacherIncomeQueryInfo extends QueryInfo {
 
     private CourseStatusEnum courseStatus;
 
-    private Boolean updated;
+    private Boolean updated = false;
+
+    private String teachIncomeType;
 
     public Integer getTeacherId() {
         return teacherId;
@@ -58,4 +61,12 @@ public class TeacherIncomeQueryInfo extends QueryInfo {
     public void setUpdated(Boolean updated) {
         this.updated = updated;
     }
+
+    public String getTeachIncomeType() {
+        return teachIncomeType;
+    }
+
+    public void setTeachIncomeType(String teachIncomeType) {
+        this.teachIncomeType = teachIncomeType;
+    }
 }

+ 15 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleTeacherSalaryService.java

@@ -233,7 +233,7 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @return void
      */
     void calMusicCourseTeacherActualSalary(CourseSchedule courseSchedule, CourseScheduleTeacherSalary courseScheduleTeacherSalary,
-                                           List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange);
+                                           List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange, Boolean updated);
 
     /**
      * @describe 计算VIP课教师实际课酬
@@ -244,7 +244,7 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @return void
      */
     void calVipCourseTeacherActualSalary(CourseSchedule courseSchedule, CourseScheduleTeacherSalary courseScheduleTeacherSalary,
-                                         List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange);
+                                         List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange, Boolean updated);
 
     /**
      * @describe 计算网管课教师实际课酬
@@ -255,7 +255,7 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @return void
      */
     void calPracticeTeacherActualSalary(CourseSchedule courseSchedule, CourseScheduleTeacherSalary courseScheduleTeacherSalary,
-                                        List<TeacherAttendance> teacherAttendances, School school, Teacher teacher);
+                                        List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, Boolean updated);
 
     /**
      * @describe
@@ -264,7 +264,7 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @param teacherId: 获取教师收入总览
      * @return com.ym.mec.biz.dal.dto.TeacherIncomeReviewDto
      */
-    TeacherIncomeReviewDto getTeacherSalaryOverview(Integer teacherId);
+    TeacherIncomeReviewDto getTeacherSalaryOverview(TeacherIncomeQueryInfo queryInfo);
 
     /**
      * @describe 查询教师课酬记录
@@ -281,10 +281,21 @@ public interface CourseScheduleTeacherSalaryService extends BaseService<Long, Co
      * @date 2021/4/16 0016
      * @param year:
      * @return java.util.Map<java.lang.String,java.math.BigDecimal>
+     * 移动端全部更新后将废弃
      */
+    @Deprecated
     Map<String, Object> teacherIncomeStat(Integer teacherId, Integer year, Integer month);
 
     /**
+     * @describe 收入统计
+     * @author Joburgess
+     * @date 2021/4/16 0016
+     * @param year:
+     * @return java.util.Map<java.lang.String,java.math.BigDecimal>
+     */
+    Map<String, Object> teacherIncomeStatNew(Integer teacherId, Integer year, Integer month);
+
+    /**
      * @describe 推送查看今日收入提醒
      * @author Joburgess
      * @date 2021/4/19 0019

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.ManagerDownload;
+import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 
 import java.io.FileNotFoundException;
 import java.util.Map;
@@ -26,8 +27,8 @@ public interface ExportService {
 
     /**
      * 课表列表导出
-     * @param params
+     * @param queryInfo
      * @param managerDownload
      */
-    void superFindCourseSchedules(Map<String, Object> params, ManagerDownload managerDownload) throws FileNotFoundException;
+    void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload) throws FileNotFoundException;
 }

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

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
+import com.ym.mec.common.service.BaseService;
+
+public interface OrganizationCloudTeacherFeeService extends BaseService<Integer, OrganizationCloudTeacherFee> {
+
+    /**
+     * 新增分部云教练价格配置
+     * @param organizationCloudTeacherFee
+     * @return
+     */
+    OrganizationCloudTeacherFee add(OrganizationCloudTeacherFee organizationCloudTeacherFee);
+
+    /**
+     * 修改分部云教练价格配置
+     * @param organizationCloudTeacherFee
+     * @return
+     */
+    OrganizationCloudTeacherFee updateFee(OrganizationCloudTeacherFee organizationCloudTeacherFee);
+
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -380,4 +380,12 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      */
     PageInfo<NoClassMusicStudentDto> queryNoClassMusicStudentInfo(NoClassMusicStudentQueryInfo queryInfo);
 
+    /**
+     * 退团所有的学生
+     * @param musicGroupId
+     * @param remark
+     * @return
+     */
+    Integer quitAllStudent(String musicGroupId, String remark);
+
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysImComplaintService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.SysImComplaint;
+import com.ym.mec.common.service.BaseService;
+
+public interface SysImComplaintService extends BaseService<Long, SysImComplaint>{
+
+}

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

@@ -1221,6 +1221,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         BigDecimal originUnitPrice = new BigDecimal(0);
         CourseScheduleType courseType = null;
         for (ClassGroup classGroup : classGroupList) {
+            if(HIGH_ONLINE.equals(classGroup.getType())){
+                Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
+                if(Objects.nonNull(studentNum)&&studentNum>=6){
+                    throw new BizException("线上基础技能班班级最大人数为6人");
+                }
+            }
+
             // 1、增加班级人数
             classGroupDao.addStudentNum(classGroup);
 

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

@@ -4274,7 +4274,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 		if (updateList.size() > 0) {
             courseScheduleDao.batchUpdate(updateList);
-        }
+			List<Long> courseIds = updateList.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+			List<CourseSchedule> beMergeCourses = courseScheduleDao.getBeMergeCourseWithMainCourseIds(courseIds);
+			if(!CollectionUtils.isEmpty(beMergeCourses)){
+				beMergeCourses.forEach(c->c.setStatus(CourseStatusEnum.OVER));
+				courseScheduleDao.batchUpdate(beMergeCourses);
+			}
+		}
 
         // 更新班级已上课次
         if (classGroupIds.size() > 0) {

+ 171 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -1601,10 +1601,16 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
     @Override
     public void calMusicCourseTeacherActualSalary(CourseSchedule courseSchedule, CourseScheduleTeacherSalary courseScheduleTeacherSalary,
-                                                  List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange) {
+                                                  List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange, Boolean updated) {
 
         if(StringUtils.isNotBlank(courseScheduleTeacherSalary.getDeductionReason())&&"不结算课酬".equals(courseScheduleTeacherSalary.getDeductionReason())){
             //不结算课酬
+            if(updated){
+                List<TeacherSalaryDeductReasonDto> deductReasons = new ArrayList<>();
+                courseScheduleTeacherSalary.setActualSalary(BigDecimal.ZERO);
+                deductReasons.add(new TeacherSalaryDeductReasonDto(DeductReasonEnum.NOT_SETTLEMENT, courseScheduleTeacherSalary.getExpectSalary().abs()));
+                courseScheduleTeacherSalary.setDeductReasons(deductReasons);
+            }
             return;
         }
 
@@ -1619,7 +1625,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }
 
             teacherSalary = teacherSalary.add(subsidy);
-            teacherSalary = teacherSalary.add(subsidy);
             if(BigDecimal.ZERO.compareTo(teacherSalary)>0){
                 teacherSalary = new BigDecimal(0);
             }
@@ -1836,11 +1841,16 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
     @Override
     public void calVipCourseTeacherActualSalary(CourseSchedule courseSchedule, CourseScheduleTeacherSalary courseScheduleTeacherSalary,
-                                                List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange) {
+                                                List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, double attendanceRange, Boolean updated) {
         List<TeacherSalaryDeductReasonDto> deductReasons = new ArrayList<>();
 
         if(StringUtils.isNotBlank(courseScheduleTeacherSalary.getDeductionReason())&&"不结算课酬".equals(courseScheduleTeacherSalary.getDeductionReason())){
             //不结算课酬
+            if(updated){
+                courseScheduleTeacherSalary.setActualSalary(BigDecimal.ZERO);
+                deductReasons.add(new TeacherSalaryDeductReasonDto(DeductReasonEnum.NOT_SETTLEMENT, courseScheduleTeacherSalary.getExpectSalary().abs()));
+                courseScheduleTeacherSalary.setDeductReasons(deductReasons);
+            }
             return;
         }
         
@@ -1943,11 +1953,16 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
     @Override
     public void calPracticeTeacherActualSalary(CourseSchedule courseSchedule, CourseScheduleTeacherSalary courseScheduleTeacherSalary,
-                                               List<TeacherAttendance> teacherAttendances, School school, Teacher teacher) {
+                                               List<TeacherAttendance> teacherAttendances, School school, Teacher teacher, Boolean updated) {
         List<TeacherSalaryDeductReasonDto> deductReasons = new ArrayList<>();
 
         if(StringUtils.isNotBlank(courseScheduleTeacherSalary.getDeductionReason())&&"不结算课酬".equals(courseScheduleTeacherSalary.getDeductionReason())){
             //不结算课酬
+            if(updated){
+                courseScheduleTeacherSalary.setActualSalary(BigDecimal.ZERO);
+                deductReasons.add(new TeacherSalaryDeductReasonDto(DeductReasonEnum.NOT_SETTLEMENT, courseScheduleTeacherSalary.getExpectSalary().abs()));
+                courseScheduleTeacherSalary.setDeductReasons(deductReasons);
+            }
             return;
         }
         
@@ -2041,12 +2056,21 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     }
 
     @Override
-    public TeacherIncomeReviewDto getTeacherSalaryOverview(Integer teacherId) {
-        LocalDate nowDate = LocalDate.now();
-        LocalDate monthFirstDay = nowDate.with(TemporalAdjusters.firstDayOfMonth());
-        LocalDate monthLastDay = nowDate.with(TemporalAdjusters.lastDayOfMonth());
+    public TeacherIncomeReviewDto getTeacherSalaryOverview(TeacherIncomeQueryInfo queryInfo) {
+        if(Objects.nonNull(queryInfo)&&TeachIncomeTypeEnum.SALE_REWARD.getCode().equals(queryInfo.getTeachIncomeType())){
+            TeacherIncomeReviewDto teacherSalaryOverview = new TeacherIncomeReviewDto();
+            return teacherSalaryOverview;
+        }
 
-        TeacherIncomeReviewDto teacherSalaryOverview = courseScheduleTeacherSalaryDao.getTeacherSalaryOverview(teacherId, monthFirstDay.toString(), monthLastDay.toString(), "2021-03-01", null);
+        if(StringUtils.isBlank(queryInfo.getStartDay())){
+            LocalDate nowDate = LocalDate.now();
+            LocalDate monthFirstDay = nowDate.with(TemporalAdjusters.firstDayOfMonth());
+            LocalDate monthLastDay = nowDate.with(TemporalAdjusters.lastDayOfMonth());
+            queryInfo.setStartDay(monthFirstDay.toString());
+            queryInfo.setEndDay(monthLastDay.toString());
+        }
+
+        TeacherIncomeReviewDto teacherSalaryOverview = courseScheduleTeacherSalaryDao.getTeacherSalaryOverview(queryInfo.getTeacherId(), queryInfo.getStartDay(), queryInfo.getEndDay(), "2021-03-01", null, queryInfo.getTeachIncomeType());
         if(Objects.isNull(teacherSalaryOverview)){
             teacherSalaryOverview = new TeacherIncomeReviewDto();
         }
@@ -2054,7 +2078,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             teacherSalaryOverview.setThisMonthExpectIncome(BigDecimal.ZERO);
         }
 
-        List<CourseSchedule> teacherCourses = courseScheduleDao.getTeacherCourseWithClassDate(teacherId, monthFirstDay.toString(), monthLastDay.toString(), CourseStatusEnum.OVER);
+        List<CourseSchedule> teacherCourses = courseScheduleDao.getTeacherCourseWithClassDate(queryInfo.getTeacherId(), queryInfo.getStartDay(), queryInfo.getEndDay(), CourseStatusEnum.OVER, queryInfo.getTeachIncomeType());
         if(CollectionUtils.isEmpty(teacherCourses)){
             return teacherSalaryOverview;
         }
@@ -2063,7 +2087,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
         //课程教师课酬
         List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByCourseSchedules(courseIds);
-        List<CourseScheduleTeacherSalary> teacherSalaries = courseScheduleTeacherSalaries.stream().filter(c -> teacherId.equals(c.getUserId())).collect(Collectors.toList());
+        List<CourseScheduleTeacherSalary> teacherSalaries = courseScheduleTeacherSalaries.stream().filter(c -> queryInfo.getTeacherId().equals(c.getUserId())).collect(Collectors.toList());
         if(CollectionUtils.isEmpty(teacherSalaries)){
             return teacherSalaryOverview;
         }
@@ -2094,7 +2118,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
         //教师签到记录
         List<TeacherAttendance> allTeacherAttendances = teacherAttendanceDao.findByCourseSchedules(courseIds);
-        Map<Long, List<TeacherAttendance>> teacherCourseAttendanceMap = allTeacherAttendances.stream().filter(c->teacherId.equals(c.getTeacherId())).collect(Collectors.groupingBy(TeacherAttendance::getCourseScheduleId));
+        Map<Long, List<TeacherAttendance>> teacherCourseAttendanceMap = allTeacherAttendances.stream().filter(c->queryInfo.getTeacherId().equals(c.getTeacherId())).collect(Collectors.groupingBy(TeacherAttendance::getCourseScheduleId));
 
         //教师信息
         Set<Integer> teacherIds = teacherSalaries.stream().map(CourseScheduleTeacherSalary::getUserId).collect(Collectors.toSet());
@@ -2111,15 +2135,19 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             //教师
             Teacher teacher = idTeacherMap.get(teacherSalary.getUserId());
 
+            if(Objects.nonNull(teacherSalary.getActualSalary())){
+                continue;
+            }
+
             switch (courseSchedule.getGroupType()){
                 case MUSIC:
-                    calMusicCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, attendanceRange);
+                    calMusicCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, attendanceRange, false);
                     break;
                 case VIP:
-                    calVipCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, vipAttendanceRange);
+                    calVipCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, vipAttendanceRange, false);
                     break;
                 case PRACTICE:
-                    calPracticeTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher);
+                    calPracticeTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, false);
                     break;
             }
         }
@@ -2152,6 +2180,13 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
 
+
+        if(Objects.nonNull(queryInfo)&&TeachIncomeTypeEnum.SALE_REWARD.getCode().equals(queryInfo.getTeachIncomeType())){
+            pageInfo.setTotal(0);
+            pageInfo.setRows(Collections.EMPTY_LIST);
+            return pageInfo;
+        }
+
         int count = courseScheduleDao.countTeacherCourse(params);
         pageInfo.setTotal(count);
         params.put("offset", pageInfo.getOffset());
@@ -2217,13 +2252,13 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
                 switch (courseSchedule.getGroupType()){
                     case MUSIC:
-                        calMusicCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, attendanceRange);
+                        calMusicCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, attendanceRange, queryInfo.getUpdated());
                         break;
                     case VIP:
-                        calVipCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, vipAttendanceRange);
+                        calVipCourseTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, vipAttendanceRange, queryInfo.getUpdated());
                         break;
                     case PRACTICE:
-                        calPracticeTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher);
+                        calPracticeTeacherActualSalary(courseSchedule, teacherSalary, teacherAttendances, school, teacher, queryInfo.getUpdated());
                         break;
                 }
 
@@ -2326,6 +2361,12 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }
         }
 
+        for (LocalDateBigDecimalMapDto localDateBigDecimalMapDto : monthIncomeMapList) {
+            if(BigDecimal.ZERO.compareTo(localDateBigDecimalMapDto.getAmount())>0){
+                localDateBigDecimalMapDto.setAmount(BigDecimal.ZERO);
+            }
+        }
+
         monthIncomeMapList.sort(Comparator.comparing(LocalDateBigDecimalMapDto::getDate));
 
         BigDecimal reduce = monthIncomeMapList.stream().map(LocalDateBigDecimalMapDto::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -2338,6 +2379,118 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     }
 
     @Override
+    public Map<String, Object> teacherIncomeStatNew(Integer teacherId, Integer year, Integer month) {
+        if(Objects.isNull(year)){
+            year = LocalDate.now().get(ChronoField.YEAR);
+        }
+
+        Map<String, Object> result = new HashMap<>();
+        result.put("total", BigDecimal.ZERO);
+
+        LocalDate minDate = LocalDate.of(2021, 3, 1);
+        LocalDate startDate = LocalDate.of(year, Objects.isNull(month)?1:month, 1);
+
+        if(year<=2021&&Objects.isNull(month)){
+            startDate = startDate.withMonth(3);
+        }
+
+        List<Map<String, Object>> data = new ArrayList<>();
+
+        Map<String, Object> salaryResult = new HashMap<>();
+        salaryResult.put("desc", "课酬");
+        salaryResult.put("amount", BigDecimal.ZERO);
+        salaryResult.put("data", Collections.emptyList());
+
+        Map<String, Object> subsidyResult = new HashMap<>();
+        subsidyResult.put("desc", "教学点补贴");
+        subsidyResult.put("amount", BigDecimal.ZERO);
+        subsidyResult.put("data", Collections.emptyList());
+
+        Map<String, Object> saleRewardResult = new HashMap<>();
+        saleRewardResult.put("desc", "销售奖励");
+        saleRewardResult.put("amount", BigDecimal.ZERO);
+        saleRewardResult.put("data", Collections.emptyList());
+
+        data.add(salaryResult);
+        data.add(subsidyResult);
+        data.add(saleRewardResult);
+
+        result.put("data", data);
+
+        if(startDate.compareTo(minDate)<0){
+            return result;
+        }
+
+        List<LocalDateBigDecimalMapDto> monthIncomeMapList = courseScheduleTeacherSalaryDao.teacherIncomeStat(teacherId, year, month);
+
+//        if(CollectionUtils.isEmpty(monthIncomeMapList)){
+//            return result;
+//        }
+
+        if(Objects.isNull(month)){
+            Set<String> months = monthIncomeMapList.stream().map(e -> DateUtil.dateToString(e.getDate(), "yyyy-MM")).collect(Collectors.toSet());
+
+            LocalDate now = LocalDate.now();
+            now = now.plusMonths(-1);
+            DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            while (startDate.compareTo(now)<=0&&year.equals(startDate.get(ChronoField.YEAR))){
+                String dateStr = dateFormatter.format(startDate);
+                if(!months.contains(dateStr)){
+                    monthIncomeMapList.add(new LocalDateBigDecimalMapDto(Date.from(startDate.atStartOfDay(DateUtil.zoneId).toInstant()), dateStr, BigDecimal.ZERO));
+                }
+                startDate = startDate.plusMonths(1);
+            }
+        }else{
+            Set<String> dates = monthIncomeMapList.stream().map(e -> DateUtil.dateToString(e.getDate(), "yyyy-MM-dd")).collect(Collectors.toSet());
+
+            Integer oldMonth = Objects.isNull(month)?new Integer(1):month;
+            while (oldMonth.equals(startDate.get(ChronoField.MONTH_OF_YEAR))){
+                String dateStr = DateUtil.dateFormatter.format(startDate);
+                if(!dates.contains(dateStr)){
+                    monthIncomeMapList.add(new LocalDateBigDecimalMapDto(Date.from(startDate.atStartOfDay(DateUtil.zoneId).toInstant()), dateStr, BigDecimal.ZERO));
+                }
+                startDate = startDate.plusDays(1);
+            }
+        }
+
+        monthIncomeMapList.sort(Comparator.comparing(LocalDateBigDecimalMapDto::getDate));
+
+        List<LocalDateBigDecimalMapDto> subsidyList = new ArrayList<>();
+        List<LocalDateBigDecimalMapDto> saleRewardList = new ArrayList<>();
+        for (LocalDateBigDecimalMapDto localDateBigDecimalMapDto : monthIncomeMapList) {
+            if(localDateBigDecimalMapDto.getAmount().compareTo(BigDecimal.ZERO)<0){
+                localDateBigDecimalMapDto.setSubsidy(localDateBigDecimalMapDto.getSubsidy().subtract(localDateBigDecimalMapDto.getAmount().abs()));
+                localDateBigDecimalMapDto.setAmount(BigDecimal.ZERO);
+            }
+
+            LocalDateBigDecimalMapDto subsidyData = new LocalDateBigDecimalMapDto();
+            BeanUtils.copyProperties(localDateBigDecimalMapDto, subsidyData);
+            subsidyData.setAmount(subsidyData.getSubsidy());
+            subsidyList.add(subsidyData);
+
+            LocalDateBigDecimalMapDto saleRewardData = new LocalDateBigDecimalMapDto();
+            BeanUtils.copyProperties(localDateBigDecimalMapDto, saleRewardData);
+            saleRewardData.setAmount(BigDecimal.ZERO);
+            saleRewardList.add(saleRewardData);
+        }
+
+        BigDecimal reduce = monthIncomeMapList.stream().map(LocalDateBigDecimalMapDto::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+        BigDecimal subsidy = monthIncomeMapList.stream().map(LocalDateBigDecimalMapDto::getSubsidy).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+        result.put("total", reduce.add(subsidy));
+        salaryResult.put("amount", reduce);
+        salaryResult.put("data", monthIncomeMapList);
+
+        subsidyResult.put("amount", subsidy);
+        subsidyResult.put("data", subsidyList);
+
+        saleRewardResult.put("data", saleRewardList);
+
+        return result;
+    }
+
+    @Override
     public void todayIncomeRemind() {
         List<Integer> teacherIds = courseScheduleTeacherSalaryDao.getTodayHasCourseTeacherIds();
         if(CollectionUtils.isEmpty(teacherIds)){

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -7,7 +7,9 @@ import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
+import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.ExportService;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.common.exception.BizException;
@@ -55,7 +57,7 @@ public class ExportServiceImpl implements ExportService {
     @Autowired
     private ReplacementInstrumentActivityDao replacementInstrumentActivityDao;
     @Autowired
-    private CourseScheduleDao courseScheduleDao;
+    private CourseScheduleService courseScheduleService;
 
     @Override
     @Async
@@ -723,8 +725,8 @@ public class ExportServiceImpl implements ExportService {
     }
 
     @Override
-    public void superFindCourseSchedules(Map<String, Object> params, ManagerDownload managerDownload) throws FileNotFoundException {
-        List<CourseScheduleEndDto> rows = courseScheduleDao.endFindCourseSchedules(params);
+    public void superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo, ManagerDownload managerDownload) throws FileNotFoundException {
+        List<CourseScheduleEndDto> rows = courseScheduleService.endFindCourseSchedules(queryInfo).getRows();
         for (CourseScheduleEndDto row : rows) {
             row.setIsComplaints(StringUtils.equals(row.getIsComplaints(), "1") ? "有" : "无");
         }

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

@@ -559,8 +559,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			//服务指标异常
 			Map<String, Object> params = new HashMap<>();
 			LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
-			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
+			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue()).plusDays(-7);
+			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue()).plusDays(-7);
 			params.put("organIds", organIds);
 			params.put("monday",monDayDate.toString());
 			params.put("sunday",sunDayDate.toString());
@@ -702,8 +702,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			//服务指标异常
 			Map<String, Object> params = new HashMap<>();
 			LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
-			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
+			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue()).plusDays(-7);
+			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue()).plusDays(-7);
 			params.put("organIds", organIds);
 			params.put("monday",monDayDate.toString());
 			params.put("sunday",sunDayDate.toString());
@@ -988,8 +988,8 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		if(!flag4){
 			Map<String, Object> params = new HashMap<>();
 			LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
-			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
-			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
+			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue()).plusDays(-7);
+			LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue()).plusDays(-7);
 			params.put("organIds", organIds);
 			params.put("monday",monDayDate.toString());
 			params.put("sunday",sunDayDate.toString());

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

@@ -1351,8 +1351,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, SUCCESS, "取消乐团", null);
         }*/
         //获取当前乐团所有已报名学员
+        List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
         if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
-            List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
             if (registrations != null && registrations.size() > 0) {
                 Map<Integer, String> map = new HashMap<>(registrations.size());
                 registrations.forEach(e -> {
@@ -1362,6 +1362,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                         map, null, 0, "1", "STUDENT", musicGroup.getName(), sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
             }
         }
+        //将学生退团
+        if (registrations.size() > 0 && studentRegistrationService.quitAllStudent(musicGroup.getId(), "退团(乐团关闭)") <= 0) {
+            throw new BizException("处理学生退团失败,请重试");
+        }
         //记录建团日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "取消乐团", sysUser.getId(), ""));
         Set<Integer> roleIds = new HashSet<>(1);
@@ -2970,6 +2974,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //删除未上课表
         courseScheduleDao.logicDeleteCourseSchedulesByMusicGroupID(musicGroup.getId());
 
+        //将学生退团
+        List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroup.getId(), null);
+        if (registrations.size() > 0 && studentRegistrationService.quitAllStudent(musicGroup.getId(), "退团(乐团关闭)") <= 0) {
+            throw new BizException("处理学生退团失败,请重试");
+        }
+
         //统计变更学员数
         groupEventSource.musicGroupStudentChangeEvent(closeMusicGroupDto.getMusicGroupId(), StudentMusicGroupStatusEnum.QUIT, null);
 

+ 43 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationCloudTeacherFeeServiceImpl.java

@@ -0,0 +1,43 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.OrganizationCloudTeacherFeeDao;
+import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
+import com.ym.mec.biz.service.OrganizationCloudTeacherFeeService;
+import com.ym.mec.common.dal.BaseDAO;
+
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class OrganizationCloudTeacherFeeServiceImpl extends BaseServiceImpl<Integer, OrganizationCloudTeacherFee> implements OrganizationCloudTeacherFeeService {
+
+    @Autowired
+    private OrganizationCloudTeacherFeeDao organizationCloudTeacherFeeDao;
+
+    @Override
+    public BaseDAO<Integer, OrganizationCloudTeacherFee> getDAO() {
+        return organizationCloudTeacherFeeDao;
+    }
+
+    @Override
+    public OrganizationCloudTeacherFee add(OrganizationCloudTeacherFee organizationCloudTeacherFee) {
+        OrganizationCloudTeacherFee old = organizationCloudTeacherFeeDao.getByOrganId(organizationCloudTeacherFee.getOrganId());
+        if (old != null) {
+            throw new BizException("分部配置已存在,不能重复添加");
+        }
+        organizationCloudTeacherFeeDao.insert(organizationCloudTeacherFee);
+        return organizationCloudTeacherFee;
+    }
+
+    @Override
+    public OrganizationCloudTeacherFee updateFee(OrganizationCloudTeacherFee organizationCloudTeacherFee) {
+        OrganizationCloudTeacherFee old = organizationCloudTeacherFeeDao.get(organizationCloudTeacherFee.getId());
+        if (old == null || !old.getOrganId().equals(organizationCloudTeacherFee.getOrganId())) {
+            throw new BizException("分部不能修改,请核查");
+        }
+        organizationCloudTeacherFeeDao.update(organizationCloudTeacherFee);
+        return organizationCloudTeacherFee;
+    }
+}

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

@@ -1789,4 +1789,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public Integer quitAllStudent(String musicGroupId, String remark) {
+        return studentRegistrationDao.quitAllStudent(musicGroupId,remark);
+    }
 }

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysImComplaintServiceImpl.java

@@ -0,0 +1,21 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.SysImComplaintDao;
+import com.ym.mec.biz.dal.entity.SysImComplaint;
+import com.ym.mec.biz.service.SysImComplaintService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SysImComplaintServiceImpl extends BaseServiceImpl<Long, SysImComplaint> implements SysImComplaintService {
+
+	@Autowired
+	private SysImComplaintDao sysImComplaintDao;
+
+	@Override
+	public BaseDAO<Long, SysImComplaint> getDAO() {
+		return sysImComplaintDao;
+	}
+}

+ 12 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -657,10 +657,18 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 			teacherAttendance.setTeacherId(teacherAttendanceInfo.getTeacherId());
 			teacherAttendance.setCreateTime(date);
 		}
-		teacherAttendance.setSignInTime(date);
-		teacherAttendance.setSignInStatus(teacherAttendanceInfo.getSignInStatus());
-		teacherAttendance.setSignOutTime(date);
-		teacherAttendance.setSignOutStatus(teacherAttendanceInfo.getSignOutStatus());
+
+		if(Objects.isNull(teacherAttendance.getSignInStatus())||teacherAttendance.getSignInStatus().equals(YesOrNoEnum.NO)){
+			int advanceSignMinutes = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES));
+			Date add20Minutes = DateUtil.addMinutes(courseSchedule.getStartClassTime(), advanceSignMinutes * -1);
+			teacherAttendance.setSignInTime(add20Minutes);
+			teacherAttendance.setSignInStatus(teacherAttendanceInfo.getSignInStatus());
+		}
+
+		if(Objects.isNull(teacherAttendance.getSignOutStatus())||teacherAttendance.getSignOutStatus().equals(YesOrNoEnum.NO)) {
+			teacherAttendance.setSignOutTime(courseSchedule.getEndClassTime());
+			teacherAttendance.setSignOutStatus(teacherAttendanceInfo.getSignOutStatus());
+		}
 
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		StringBuilder remark=new StringBuilder("补签到,");

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

@@ -460,12 +460,25 @@
     </select>
 
     <select id="findAllClassGroupByMusicGroup" resultMap="ClassGroup">
-        SELECT * FROM class_group cg
+        SELECT
+            cg.id_,
+            cg.group_type_,
+            cg.music_group_id_,
+            cg.subject_id_list_,
+            cg.group_name_,
+            cg.name_,
+            cg.expect_student_num_,
+            COUNT(CASE cgsm.status_ WHEN 'NORMAL' THEN cgsm.user_id_ END) student_num_,
+            cg.type_,
+            cg.update_time_, cg.lock_flag_, cg.del_flag_, cg.total_class_times_, cg.current_class_times_, cg.img_, cg.create_time_, cg.memo_
+        FROM class_group cg
+        LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
         WHERE cg.music_group_id_=#{musicGroupId} AND del_flag_ = '0'
         AND cg.group_type_='MUSIC'
         <if test="classGroupType != null">
             AND cg.type_ = #{classGroupType}
         </if>
+        GROUP BY cg.id_
     </select>
 
     <select id="queryTeacherIds" resultType="java.lang.Integer">

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

@@ -3751,15 +3751,24 @@
         FROM
             course_schedule cs
             LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
+            LEFT JOIN school s ON cs.schoole_id_=s.id_
         WHERE
             ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
             AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
             AND csts.user_id_ = #{teacherId}
-            AND cs.class_date_ BETWEEN #{startDay} AND #{endDay}
+            <if test="startDay!=null and startDay!=''">
+                AND cs.class_date_ &gt;= #{startDay}
+            </if>
+            <if test="endDay!=null and endDay!=''">
+                AND cs.class_date_ &lt;= #{endDay}
+            </if>
             <if test="courseStatus!=null">
                 AND cs.status_ = #{courseStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="teachIncomeType!=null and teachIncomeType=='SUBSIDY'">
+                AND IF(csts.settlement_time_ IS NULL, s.subsidy_ IS NOT NULL AND s.subsidy_>0, csts.subsidy_ IS NOT NULL AND csts.subsidy_>0)
+            </if>
     </select>
 
     <sql id="queryTeacherCourseCondition">
@@ -3780,6 +3789,9 @@
             <if test="courseStatus!=null">
                 AND cs.status_ = #{courseStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="teachIncomeType!=null and teachIncomeType=='SUBSIDY'">
+                AND IF(csts.settlement_time_ IS NULL, s.subsidy_ IS NOT NULL AND s.subsidy_>0, csts.subsidy_ IS NOT NULL AND csts.subsidy_>0)
+            </if>
         </where>
     </sql>
 
@@ -3789,6 +3801,7 @@
         FROM
             course_schedule cs
             LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
+            LEFT JOIN school s ON cs.schoole_id_=s.id_
         <include refid="queryTeacherCourseCondition"></include>
         ORDER BY cs.class_date_ DESC,cs.start_class_time_ DESC,cs.id_ DESC
         <include refid="global.limit" />
@@ -3800,6 +3813,20 @@
         FROM
         course_schedule cs
         LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
+        LEFT JOIN school s ON cs.schoole_id_=s.id_
         <include refid="queryTeacherCourseCondition"></include>
     </select>
+
+    <select id="getBeMergeCourseWithMainCourseIds" resultMap="CourseSchedule">
+        SELECT
+        <include refid="resultSql" />
+        FROM
+        course_schedule cs
+        WHERE
+            cs.new_course_id_ != cs.id_
+            AND cs.new_course_id_ IN
+            <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+                #{courseId}
+            </foreach>
+    </select>
 </mapper>

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

@@ -1082,7 +1082,17 @@
     <select id="getTeacherSalaryOverview" resultType="com.ym.mec.biz.dal.dto.TeacherIncomeReviewDto">
 		SELECT
 			SUM(csts.actual_salary_) totalIncome,
-			SUM((CASE DATE_FORMAT(cs.class_date_, '%Y-%m') WHEN DATE_FORMAT(#{startDay}, '%Y-%m') THEN csts.expect_salary_ + IF(s.subsidy_ IS NULL, 0, s.subsidy_) ELSE 0 END)) thisMonthExpectIncome
+			SUM((CASE WHEN 1=1
+					<if test="startClassDay!=null and startClassDay!=''">
+			    		AND cs.class_date_ &gt;= #{startDay}
+					</if>
+					<if test="endDay!=null and endDay!=''">
+						AND cs.class_date_ &lt;= #{endDay}
+					</if>
+			    	<if test="teachIncomeType!=null and teachIncomeType=='SUBSIDY'">
+						AND IF(csts.settlement_time_ IS NULL, s.subsidy_ IS NOT NULL AND s.subsidy_>0, csts.subsidy_ IS NOT NULL AND csts.subsidy_>0)
+					</if>
+			    THEN csts.expect_salary_ + IF(s.subsidy_ IS NULL, 0, s.subsidy_) ELSE 0 END)) thisMonthExpectIncome
 		FROM
 			course_schedule_teacher_salary csts
 			LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_
@@ -1110,7 +1120,8 @@
 				DATE_FORMAT( cs.class_date_, '%Y-%m-%d' ) date,
 				DATE_FORMAT( cs.class_date_, '%Y-%m-%d' ) dateStr,
 			</if>
-			SUM( csts.actual_salary_ ) amount
+		    SUM(csts.subsidy_) subsidy,
+			SUM( csts.actual_salary_ - csts.subsidy_ ) amount
 		FROM
 			course_schedule_teacher_salary csts
 				LEFT JOIN course_schedule cs ON csts.course_schedule_id_ = cs.id_

+ 73 - 50
mec-biz/src/main/resources/config/mybatis/OrganizationCloudTeacherFeeMapper.xml

@@ -3,62 +3,85 @@
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.OrganizationCloudTeacherFeeDao">
 
-	<resultMap type="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee" id="OrganizationCloudTeacherFee">
-		<result column="organ_id_" property="organId" />
-		<result column="price_" property="price" />
-		<result column="create_time_" property="createTime" />
-		<result column="update_time_" property="updateTime" />
-	</resultMap>
+    <resultMap type="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee" id="OrganizationCloudTeacherFee">
+        <id column="id_" property="id"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="price_" property="price"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="organName" property="organName"/>
+    </resultMap>
 
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="OrganizationCloudTeacherFee">
-		SELECT * FROM
-		organization_cloud_teacher_fee WHERE organ_id_ = #{id}
-	</select>
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="OrganizationCloudTeacherFee">
+        SELECT *
+        FROM organization_cloud_teacher_fee
+        WHERE id_ = #{id}
+    </select>
 
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="OrganizationCloudTeacherFee">
-		SELECT * FROM organization_cloud_teacher_fee
-		ORDER BY id_
-	</select>
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="OrganizationCloudTeacherFee">
+        SELECT *
+        FROM organization_cloud_teacher_fee
+        ORDER BY id_
+    </select>
 
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee"
-		useGeneratedKeys="true" keyColumn="id_" keyProperty="id">
-		INSERT INTO organization_cloud_teacher_fee
-		(organ_id_, price_,  create_time_, update_time_)
-		VALUES(#{organId},#{price},NOW(),NOW())
-	</insert>
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee"
+            useGeneratedKeys="true" keyColumn="id_" keyProperty="id">
+        INSERT INTO organization_cloud_teacher_fee
+            (organ_id_, price_, create_time_, update_time_)
+        VALUES (#{organId}, #{price}, NOW(), NOW())
+    </insert>
 
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee">
-		UPDATE organization_cloud_teacher_fee
-		<set>
-			<if test="price != null">
-				price_ = #{price},
-			</if>
-			update_time_=NOW()
-		</set>
-		WHERE organ_id_ = #{organId}
-	</update>
+    <!-- 根据主键查询一条记录 -->
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee">
+        UPDATE organization_cloud_teacher_fee
+        <set>
+            <if test="price != null">
+                price_ = #{price},
+            </if>
+            update_time_=NOW()
+        </set>
+        WHERE id_ = #{id}
+    </update>
 
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete">
-		DELETE FROM organization_cloud_teacher_fee WHERE id_ = #{id}
-	</delete>
+    <!-- 根据主键删除一条记录 -->
+    <delete id="delete">
+        DELETE
+        FROM organization_cloud_teacher_fee
+        WHERE id_ = #{id}
+    </delete>
 
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="OrganizationCloudTeacherFee" parameterType="map">
-		SELECT * FROM organization_cloud_teacher_fee ORDER BY id_
-		<include refid="global.limit" />
-	</select>
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="OrganizationCloudTeacherFee" parameterType="map">
+        SELECT octf.*,o.name_ organName FROM organization_cloud_teacher_fee octf
+        LEFT JOIN organization o ON octf.organ_id_ = o.id_
+        <include refid="queryPageSql"/>
+        <include refid="global.limit"/>
+    </select>
 
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM organization_cloud_teacher_fee
-	</select>
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*) FROM organization_cloud_teacher_fee octf
+        LEFT JOIN organization o on octf.organ_id_ = o.id_
+        <include refid="queryPageSql"/>
+    </select>
 
-	<select id="getByOrganId" resultMap="OrganizationCloudTeacherFee">
-		SELECT * FROM organization_cloud_teacher_fee WHERE organ_id_ = #{organId}
-	</select>
+    <sql id="queryPageSql">
+        <where>
+            <if test="organId != null">
+                AND FIND_IN_SET(octf.organ_id_,#{organId})
+            </if>
+            <if test="search != null">
+                AND (octf.organ_id_ =#{search} OR o.name_ LIKE CONCAT('%',#{search},'%'))
+            </if>
+        </where>
+    </sql>
+
+    <select id="getByOrganId" resultMap="OrganizationCloudTeacherFee">
+        SELECT *
+        FROM organization_cloud_teacher_fee
+        WHERE organ_id_ = #{organId}
+    </select>
 </mapper>

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -986,4 +986,9 @@
         </foreach>
         LIMIT 1
     </select>
+
+    <update id="quitAllStudent">
+        UPDATE student_registration SET music_group_status_ = 'QUIT',remark_=#{remark} WHERE music_group_id_ = #{musicGroupId}
+        AND music_group_status_ IN ('APPLY','NORMAL')
+    </update>
 </mapper>

+ 43 - 0
mec-biz/src/main/resources/config/mybatis/SysImComplaintMapper.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.SysImComplaintDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.SysImComplaint" id="SysImComplaint">
+		<result column="id_" property="id" />
+		<result column="type_" property="type" />
+		<result column="url_" property="url" />
+		<result column="memo_" property="memo" />
+		<result column="user_id_" property="userId" />
+		<result column="target_id_" property="targetId" />
+		<result column="operator_" property="operator" />
+		<result column="operator_time_" property="operatorTime" />
+		<result column="status_" property="status" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysImComplaint">
+		SELECT * FROM sys_im_complaint
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysImComplaint" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO sys_im_complaint (type_,url_,memo_,user_id_,target_id_,operator_,operator_time_,status_,create_time_,update_time_)
+		VALUES(#{type},#{url},#{memo},#{userId},#{targetId},#{operator},#{operatorTime},#{status},NOW(),NOW())
+	</insert>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysImComplaint" parameterType="map">
+		SELECT * FROM sys_im_complaint <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM sys_im_complaint
+	</select>
+</mapper>

+ 35 - 0
mec-student/src/main/java/com/ym/mec/student/controller/SysImComplaintController.java

@@ -0,0 +1,35 @@
+package com.ym.mec.student.controller;
+
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.SysImComplaint;
+import com.ym.mec.biz.service.SysImComplaintService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RequestMapping("sysImComplaint")
+@Api(tags = "im投诉服务")
+@RestController
+public class SysImComplaintController extends BaseController {
+
+    @Autowired
+    private SysImComplaintService sysImComplaintService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public Object getOrgans(SysImComplaint sysImComplaint) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        sysImComplaint.setUserId(sysUser.getId());
+        return succeed(sysImComplaintService.insert(sysImComplaint));
+    }
+}

+ 17 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseScheduleTeacherSalaryController.java

@@ -84,12 +84,17 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
 
     @ApiOperation(value = "获取教师收入总览")
     @GetMapping("/getTeacherSalaryOverview")
-    public HttpResponseResult getTeacherSalaryOverview(){
+    public HttpResponseResult getTeacherSalaryOverview(TeacherIncomeQueryInfo queryInfo){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        return succeed(courseScheduleTeacherSalaryService.getTeacherSalaryOverview(sysUser.getId()));
+        queryInfo.setTeacherId(sysUser.getId());
+        queryInfo.setCourseStatus(CourseStatusEnum.OVER);
+//        if(StringUtils.isBlank(queryInfo.getStartDay())){
+//            queryInfo.setStartDay("2021-03-01");
+//        }
+        return succeed(courseScheduleTeacherSalaryService.getTeacherSalaryOverview(queryInfo));
     }
 
     @ApiOperation(value = "查询教师课酬记录")
@@ -117,4 +122,14 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
         return succeed(courseScheduleTeacherSalaryService.teacherIncomeStat(sysUser.getId(), year, month));
     }
 
+    @ApiOperation(value = "收入统计")
+    @GetMapping("/teacherIncomeStatNew")
+    public HttpResponseResult teacherIncomeStatNew(Integer year, Integer month){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        return succeed(courseScheduleTeacherSalaryService.teacherIncomeStatNew(sysUser.getId(), year, month));
+    }
+
 }

+ 35 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysImComplaintController.java

@@ -0,0 +1,35 @@
+package com.ym.mec.teacher.controller;
+
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.SysImComplaint;
+import com.ym.mec.biz.service.SysImComplaintService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RequestMapping("sysImComplaint")
+@Api(tags = "im投诉服务")
+@RestController
+public class SysImComplaintController extends BaseController {
+
+    @Autowired
+    private SysImComplaintService sysImComplaintService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public Object getOrgans(SysImComplaint sysImComplaint) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        sysImComplaint.setUserId(sysUser.getId());
+        return succeed(sysImComplaintService.insert(sysImComplaint));
+    }
+}

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

@@ -321,7 +321,7 @@ public class CourseScheduleController extends BaseController {
     public Object queryCourseScheduleComplaintsDetail(Long courseScheduleComplaintsId){
     	CourseScheduleComplaints complaints = courseScheduleComplaintsService.get(courseScheduleComplaintsId);
     	if(complaints == null){
-    		return failed("参数输入不正确");
+    		return failed("对应课程已做出调整");
     	}
     	
     	SysUser user = sysUserFeignService.queryUserById(complaints.getUserId());

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

@@ -894,7 +894,7 @@ public class ExportController extends BaseController {
         managerDownload.setCreateTime(nowDate);
         managerDownload.setUpdateTime(nowDate);
         managerDownloadDao.insert(managerDownload);
-        exportService.superFindCourseSchedules(params, managerDownload);
+        exportService.superFindCourseSchedules(queryInfo, managerDownload);
         return succeed(fileName+"导出申请已提交,请到【报表中心-下载列表查看】");
     }
 

+ 75 - 0
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCloudTeacherFeeController.java

@@ -0,0 +1,75 @@
+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.entity.Employee;
+import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
+import com.ym.mec.biz.dal.page.OrganizationCloudTeacherFeeQueryInfo;
+import com.ym.mec.biz.service.OrganizationCloudTeacherFeeService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.List;
+
+@RequestMapping("organizationCloudTeacherFee")
+@Api(tags = "分部云教练价格配置服务")
+@RestController
+public class OrganizationCloudTeacherFeeController extends BaseController {
+
+    @Autowired
+    private OrganizationCloudTeacherFeeService organizationCloudTeacherFeeService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
+
+    @ApiOperation(value = "分页查询分部列表")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('organizationCloudTeacherFee/queryPage')")
+    public HttpResponseResult<PageInfo<OrganizationCloudTeacherFee>> queryPage(OrganizationCloudTeacherFeeQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+            return failed("用户所在分部异常");
+        } else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                return failed("非法请求");
+            }
+        }
+        return succeed(organizationCloudTeacherFeeService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "新增分部配置")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('organizationCloudTeacherFee/add')")
+    public HttpResponseResult<OrganizationCloudTeacherFee> add(OrganizationCloudTeacherFee organizationCloudTeacherFee) {
+        return succeed(organizationCloudTeacherFeeService.add(organizationCloudTeacherFee));
+    }
+
+    @ApiOperation(value = "修改分部配置")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('organizationCloudTeacherFee/update')")
+    public HttpResponseResult<OrganizationCloudTeacherFee> update(OrganizationCloudTeacherFee organizationCloudTeacherFee) {
+        return succeed(organizationCloudTeacherFeeService.updateFee(organizationCloudTeacherFee));
+    }
+
+}

+ 35 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysImComplaintController.java

@@ -0,0 +1,35 @@
+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.entity.SysImComplaint;
+import com.ym.mec.biz.service.SysImComplaintService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RequestMapping("sysImComplaint")
+@Api(tags = "im投诉服务")
+@RestController
+public class SysImComplaintController extends BaseController {
+
+    @Autowired
+    private SysImComplaintService sysImComplaintService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public Object getOrgans(SysImComplaint sysImComplaint) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        sysImComplaint.setUserId(sysUser.getId());
+        return succeed(sysImComplaintService.insert(sysImComplaint));
+    }
+}