Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
c1cca0ba02
37 changed files with 640 additions and 387 deletions
  1. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/MenuController.java
  2. 2 0
      mec-gateway/mec-gateway-web/src/main/resources/application.yml
  3. 4 3
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  4. 12 12
      mec-web/src/main/java/com/ym/mec/web/controller/SubjectController.java
  5. 8 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupDao.java
  6. 10 1
      mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupRelationDao.java
  7. 9 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupTeacherMapperDao.java
  8. 0 9
      mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherClassFeeDao.java
  9. 9 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherDefaultMusicGroupSalaryDao.java
  10. 0 9
      mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherSalaryDao.java
  11. 3 3
      mec-web/src/main/java/com/ym/mec/web/dal/entity/ClassGroupStudentMapper.java
  12. 23 30
      mec-web/src/main/java/com/ym/mec/web/dal/entity/ClassGroupTeacherMapper.java
  13. 48 3
      mec-web/src/main/java/com/ym/mec/web/dal/entity/Organization.java
  14. 103 0
      mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherDefaultMusicGroupSalary.java
  15. 0 76
      mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherSalary.java
  16. 11 0
      mec-web/src/main/java/com/ym/mec/web/service/ClassGroupRelationService.java
  17. 17 3
      mec-web/src/main/java/com/ym/mec/web/service/ClassGroupService.java
  18. 8 0
      mec-web/src/main/java/com/ym/mec/web/service/ClassGroupTeacherMapperService.java
  19. 12 0
      mec-web/src/main/java/com/ym/mec/web/service/SubjectService.java
  20. 0 8
      mec-web/src/main/java/com/ym/mec/web/service/TeacherClassFeeService.java
  21. 8 0
      mec-web/src/main/java/com/ym/mec/web/service/TeacherDefaultMusicGroupSalaryService.java
  22. 0 8
      mec-web/src/main/java/com/ym/mec/web/service/TeacherSalaryService.java
  23. 7 1
      mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupRelationServiceImpl.java
  24. 103 57
      mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupServiceImpl.java
  25. 23 0
      mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupTeacherMapperServiceImpl.java
  26. 27 1
      mec-web/src/main/java/com/ym/mec/web/service/impl/SubjectServiceImpl.java
  27. 0 23
      mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherClassFeeServiceImpl.java
  28. 23 0
      mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java
  29. 0 23
      mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherSalaryServiceImpl.java
  30. 5 0
      mec-web/src/main/resources/config/mybatis/ClassGroupMapper.xml
  31. 19 8
      mec-web/src/main/resources/config/mybatis/ClassGroupRelationMapper.xml
  32. 35 29
      mec-web/src/main/resources/config/mybatis/ClassGroupTeacherMapperMapper.xml
  33. 18 2
      mec-web/src/main/resources/config/mybatis/OrganizationMapper.xml
  34. 0 5
      mec-web/src/main/resources/config/mybatis/StudentCourseHomeworkReplyMapper.xml
  35. 1 1
      mec-web/src/main/resources/config/mybatis/SubjectMapper.xml
  36. 91 0
      mec-web/src/main/resources/config/mybatis/TeacherDefaultMusicGroupSalaryMapper.xml
  37. 0 71
      mec-web/src/main/resources/config/mybatis/TeacherSalaryMapper.xml

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/MenuController.java

@@ -61,7 +61,7 @@ public class MenuController extends BaseController {
 
 
     @ApiOperation("查询用户可访问菜单树状结构")
     @ApiOperation("查询用户可访问菜单树状结构")
     @GetMapping("/findByUser")
     @GetMapping("/findByUser")
-    public Object findByUser(@RequestBody MenuQueryInfo menuQueryInfo) {
+    public Object findByUser(@RequestBody(required = false) MenuQueryInfo menuQueryInfo) {
         AuthUser user = SecurityUtils.getUser();
         AuthUser user = SecurityUtils.getUser();
         if(user != null){
         if(user != null){
             if(menuQueryInfo == null){
             if(menuQueryInfo == null){

+ 2 - 0
mec-gateway/mec-gateway-web/src/main/resources/application.yml

@@ -11,6 +11,8 @@ eureka:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
 
 
 ribbon:
 ribbon:
+  eureka:
+    enable: true
   ReadTimeout: 10000
   ReadTimeout: 10000
   SocketTimeout: 3000      
   SocketTimeout: 3000      
 
 

+ 4 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -29,8 +29,10 @@ public class ClassGroupController extends BaseController {
 
 
     @ApiOperation(value = "新增合奏班")
     @ApiOperation(value = "新增合奏班")
     @PostMapping("/addMixClass")
     @PostMapping("/addMixClass")
-    public Object addMixClass(@ApiParam(value = "班级编号,号分割", required = true) String classGroupIds) throws Exception {
-        return succeed(classGroupService.addMixClassGroup(classGroupIds));
+    public Object addMixClass(@ApiParam(value = "乐团编号", required = true) @RequestParam Integer musicGroupId,
+                              @ApiParam(value = "班级名称", required = true) String name,
+                              @ApiParam(value = "班级编号,号分割", required = true) String classGroupIds) throws Exception {
+        return succeed(classGroupService.addMixClassGroup(musicGroupId, name, classGroupIds));
     }
     }
 
 
     @ApiOperation(value = "删除班级")
     @ApiOperation(value = "删除班级")
@@ -74,5 +76,4 @@ public class ClassGroupController extends BaseController {
     }
     }
 
 
 
 
-
 }
 }

+ 12 - 12
mec-web/src/main/java/com/ym/mec/web/controller/SubjectController.java

@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 @RequestMapping("subject")
 @RequestMapping("subject")
 @Api(tags = "科目服务")
 @Api(tags = "科目服务")
@@ -21,11 +22,7 @@ public class SubjectController extends BaseController {
     @ApiOperation(value = "新增科目")
     @ApiOperation(value = "新增科目")
     @PostMapping("/add")
     @PostMapping("/add")
     public Object add(@RequestBody Subject subject){
     public Object add(@RequestBody Subject subject){
-        Subject subjectByCode = subjectService.findByCode(subject.getCode());
-        if(subjectByCode != null){
-            return failed("科目编号已存在,请核查");
-        }
-        subjectService.insert(subject);
+        subjectService.addSubject(subject);
         return succeed();
         return succeed();
     }
     }
 
 
@@ -39,15 +36,18 @@ public class SubjectController extends BaseController {
     @ApiOperation(value = "修改科目")
     @ApiOperation(value = "修改科目")
     @PutMapping("/update")
     @PutMapping("/update")
     public Object update(@RequestBody Subject subject){
     public Object update(@RequestBody Subject subject){
-        Subject subjectByCode = subjectService.findByCode(subject.getCode());
-        if(subjectByCode != null && !subjectByCode.getId().equals(subject.getId())){
-            return failed("科目编号已存在,请核查");
-        }
         subject.setUpdateTime(new Date());
         subject.setUpdateTime(new Date());
         subjectService.update(subject);
         subjectService.update(subject);
         return succeed();
         return succeed();
     }
     }
 
 
+    @ApiOperation(value = "批量修改科目")
+    @PutMapping("/batchUpdate")
+    public Object batchUpdate(@RequestBody List<Subject> subjects){
+        subjectService.batchUpdate(subjects);
+        return succeed();
+    }
+
     @ApiOperation(value = "根据科目编号查询科目")
     @ApiOperation(value = "根据科目编号查询科目")
     @GetMapping("/get/{id}")
     @GetMapping("/get/{id}")
     public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
     public Object get(@ApiParam(value = "科目编号", required = true) @PathVariable("id") Integer id){
@@ -67,9 +67,9 @@ public class SubjectController extends BaseController {
     }
     }
 
 
     @ApiOperation(value = "通过乐团编号查询乐团科目规划")
     @ApiOperation(value = "通过乐团编号查询乐团科目规划")
-    @PostMapping("/querySubByMusicGroupId")
+    @GetMapping("/querySubByMusicGroupId")
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
-    public Object findSubByMusicGroupId(@RequestBody Integer musicGroupId){
+    public Object findSubByMusicGroupId(@RequestParam Integer musicGroupId){
         return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
         return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
     }
     }
 
 
@@ -83,7 +83,7 @@ public class SubjectController extends BaseController {
     @ApiOperation(value = "通过乐团编号获取声部列表以及声部报名、缴费、计划人数")
     @ApiOperation(value = "通过乐团编号获取声部列表以及声部报名、缴费、计划人数")
     @GetMapping("/findSubApplyDetail")
     @GetMapping("/findSubApplyDetail")
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
     @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "Integer")})
-    public Object findSubApplyDetail(@RequestBody Integer musicGroupId){
+    public Object findSubApplyDetail(@RequestParam Integer musicGroupId){
         return succeed(subjectService.findSubApplyDetail(musicGroupId));
         return succeed(subjectService.findSubApplyDetail(musicGroupId));
     }
     }
 }
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupDao.java

@@ -42,8 +42,16 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
 
 
     /**
     /**
      * 查询合奏班包含子班的名字信息
      * 查询合奏班包含子班的名字信息
+     *
      * @param classGroupId
      * @param classGroupId
      * @return
      * @return
      */
      */
     ClassGroup findMixClassChildClassGroupNames(@Param("classGroupId") int classGroupId);
     ClassGroup findMixClassChildClassGroupNames(@Param("classGroupId") int classGroupId);
+
+    /**
+     * 跟班级ids查询班级信息
+     * @param ids
+     * @return
+     */
+    List<ClassGroup> findClassGroupByIds(@Param("ids") String ids);
 }
 }

+ 10 - 1
mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupRelationDao.java

@@ -2,8 +2,17 @@ package com.ym.mec.web.dal.dao;
 
 
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 public interface ClassGroupRelationDao extends BaseDAO<Integer, ClassGroupRelation> {
 public interface ClassGroupRelationDao extends BaseDAO<Integer, ClassGroupRelation> {
 
 
-	
+
+    /**
+     * 批量插入班级关联关系
+     * @param classGroupRelationList
+     * @return
+     */
+    int classGroupRelationsInsert(@Param("classGroupRelationList") List<ClassGroupRelation> classGroupRelationList);
 }
 }

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupTeacherMapperDao.java

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

+ 0 - 9
mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherClassFeeDao.java

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

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherDefaultMusicGroupSalaryDao.java

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

+ 0 - 9
mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherSalaryDao.java

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

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/dal/entity/ClassGroupStudentMapper.java

@@ -14,7 +14,7 @@ public class ClassGroupStudentMapper {
 	
 	
 	/** 班级 */
 	/** 班级 */
 	@ApiModelProperty(value = "班级编号",required = false)
 	@ApiModelProperty(value = "班级编号",required = false)
-	private Long classGroupId;
+	private int classGroupId;
 	
 	
 	/** 学生 */
 	/** 学生 */
 	@ApiModelProperty(value = "学生编号",required = false)
 	@ApiModelProperty(value = "学生编号",required = false)
@@ -43,11 +43,11 @@ public class ClassGroupStudentMapper {
 		return this.id;
 		return this.id;
 	}
 	}
 			
 			
-	public void setClassGroupId(Long classGroupId){
+	public void setClassGroupId(int classGroupId){
 		this.classGroupId = classGroupId;
 		this.classGroupId = classGroupId;
 	}
 	}
 	
 	
-	public Long getClassGroupId(){
+	public int getClassGroupId(){
 		return this.classGroupId;
 		return this.classGroupId;
 	}
 	}
 			
 			

+ 23 - 30
mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherClassFee.java → mec-web/src/main/java/com/ym/mec/web/dal/entity/ClassGroupTeacherMapper.java

@@ -1,36 +1,29 @@
 package com.ym.mec.web.dal.entity;
 package com.ym.mec.web.dal.entity;
 
 
-import com.ym.mec.web.dal.enums.TeachTypeEnum;
-import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 /**
 /**
- * 对应数据库表(teacher_class_fee):
+ * 对应数据库表(class_group_teacher_mapper):
  */
  */
-public class TeacherClassFee {
+public class ClassGroupTeacherMapper {
 
 
 	/**  */
 	/**  */
 	private Long id;
 	private Long id;
 	
 	
 	/**  */
 	/**  */
-	@ApiModelProperty(value = "乐团编号",required = false)
 	private Integer musicGroupId;
 	private Integer musicGroupId;
 	
 	
 	/**  */
 	/**  */
-	@ApiModelProperty(value = "课程组编号",required = false)
 	private Integer classGroupId;
 	private Integer classGroupId;
 	
 	
-	/**  */
-	@ApiModelProperty(value = "教师编号",required = false)
-	private Integer teacherId;
-	
-	/** 职务类型(助教、主教) */
-	@ApiModelProperty(value = "职务类型",required = false)
-	private TeachTypeEnum jobType;
+	/** 老师角色(主教、助教) */
+	private String teacherRole;
 	
 	
 	/**  */
 	/**  */
-	@ApiModelProperty(value = "教师编号",required = false)
-	private long classFee;
+	private Integer userId;
+	
+	/** 薪酬 */
+	private long salary;
 	
 	
 	/**  */
 	/**  */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
@@ -62,28 +55,28 @@ public class TeacherClassFee {
 		return this.classGroupId;
 		return this.classGroupId;
 	}
 	}
 			
 			
-	public void setTeacherId(Integer teacherId){
-		this.teacherId = teacherId;
+	public void setTeacherRole(String teacherRole){
+		this.teacherRole = teacherRole;
 	}
 	}
 	
 	
-	public Integer getTeacherId(){
-		return this.teacherId;
+	public String getTeacherRole(){
+		return this.teacherRole;
 	}
 	}
-
-	public TeachTypeEnum getJobType() {
-		return jobType;
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
 	}
 	}
-
-	public void setJobType(TeachTypeEnum jobType) {
-		this.jobType = jobType;
+	
+	public Integer getUserId(){
+		return this.userId;
 	}
 	}
-
-	public void setClassFee(long classFee){
-		this.classFee = classFee;
+			
+	public void setSalary(long salary){
+		this.salary = salary;
 	}
 	}
 	
 	
-	public long getClassFee(){
-		return this.classFee;
+	public long getSalary(){
+		return this.salary;
 	}
 	}
 			
 			
 	public void setCreateTime(java.util.Date createTime){
 	public void setCreateTime(java.util.Date createTime){

+ 48 - 3
mec-web/src/main/java/com/ym/mec/web/dal/entity/Organization.java

@@ -4,6 +4,7 @@ import com.ym.mec.web.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -23,10 +24,10 @@ public class Organization {
 	private Integer code;
 	private Integer code;
 	
 	
 	/** 创建时间 */
 	/** 创建时间 */
-	private java.util.Date createTime;
+	private Date createTime;
 	
 	
 	/** 修改时间 */
 	/** 修改时间 */
-	private java.util.Date updateTime;
+	private Date updateTime;
 	
 	
 	/** 是否删除  -1:已删除  0:正常 */
 	/** 是否删除  -1:已删除  0:正常 */
 	@ApiModelProperty(value = "是否删除  1:已删除  0:正常",required = false)
 	@ApiModelProperty(value = "是否删除  1:已删除  0:正常",required = false)
@@ -36,6 +37,18 @@ public class Organization {
 	@ApiModelProperty(value = "父节点编号",required = false)
 	@ApiModelProperty(value = "父节点编号",required = false)
 	private Integer parentOrganId;
 	private Integer parentOrganId;
 
 
+	@ApiModelProperty(value = "成立日期",required = false)
+	private Date registerDate;
+
+	@ApiModelProperty(value = "联系人",required = false)
+	private String linkman;
+
+	@ApiModelProperty(value = "联系方式",required = false)
+	private String mobile;
+
+	@ApiModelProperty(value = "地址",required = false)
+	private String address;
+
 	@ApiModelProperty(value = "子节点列表",required = false)
 	@ApiModelProperty(value = "子节点列表",required = false)
 	private List<Organization> organizations;
 	private List<Organization> organizations;
 
 
@@ -102,7 +115,39 @@ public class Organization {
 	public Integer getParentOrganId(){
 	public Integer getParentOrganId(){
 		return this.parentOrganId;
 		return this.parentOrganId;
 	}
 	}
-			
+
+	public Date getRegisterDate() {
+		return registerDate;
+	}
+
+	public void setRegisterDate(Date registerDate) {
+		this.registerDate = registerDate;
+	}
+
+	public String getLinkman() {
+		return linkman;
+	}
+
+	public void setLinkman(String linkman) {
+		this.linkman = linkman;
+	}
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

+ 103 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherDefaultMusicGroupSalary.java

@@ -0,0 +1,103 @@
+package com.ym.mec.web.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(teacher_default_music_group_salary):
+ */
+public class TeacherDefaultMusicGroupSalary {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Integer userId;
+	
+	/** 班级类型(参照 class_group表的type_字段) */
+	private String classGroupType;
+	
+	/**  */
+	private Integer subjectId;
+	
+	/** 主教薪酬 */
+	private long mainTeacherSalary;
+	
+	/** 助教薪酬 */
+	private long assistantTeacherSalary;
+	
+	/**  */
+	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 setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setClassGroupType(String classGroupType){
+		this.classGroupType = classGroupType;
+	}
+	
+	public String getClassGroupType(){
+		return this.classGroupType;
+	}
+			
+	public void setSubjectId(Integer subjectId){
+		this.subjectId = subjectId;
+	}
+	
+	public Integer getSubjectId(){
+		return this.subjectId;
+	}
+			
+	public void setMainTeacherSalary(long mainTeacherSalary){
+		this.mainTeacherSalary = mainTeacherSalary;
+	}
+	
+	public long getMainTeacherSalary(){
+		return this.mainTeacherSalary;
+	}
+			
+	public void setAssistantTeacherSalary(long assistantTeacherSalary){
+		this.assistantTeacherSalary = assistantTeacherSalary;
+	}
+	
+	public long getAssistantTeacherSalary(){
+		return this.assistantTeacherSalary;
+	}
+			
+	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);
+	}
+
+}

+ 0 - 76
mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherSalary.java

@@ -1,76 +0,0 @@
-package com.ym.mec.web.dal.entity;
-
-import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import java.math.BigDecimal;
-
-/**
- * 对应数据库表(teacher_salary):
- */
-public class TeacherSalary {
-
-	/**  */
-	private Long id;
-	
-	/**  */
-	@ApiModelProperty(value = "学员编号",required = false)
-	private Integer userId;
-	
-	/**  */
-	@ApiModelProperty(value = "科目编号",required = false)
-	private Integer subjectId;
-	
-	/** 课酬 */
-	@ApiModelProperty(value = "课酬",required = false)
-	private BigDecimal salary;
-	
-	/**  */
-	private java.util.Date createTime;
-	
-	public void setId(Long id){
-		this.id = id;
-	}
-	
-	public Long getId(){
-		return this.id;
-	}
-			
-	public void setUserId(Integer userId){
-		this.userId = userId;
-	}
-	
-	public Integer getUserId(){
-		return this.userId;
-	}
-			
-	public void setSubjectId(Integer subjectId){
-		this.subjectId = subjectId;
-	}
-	
-	public Integer getSubjectId(){
-		return this.subjectId;
-	}
-
-	public BigDecimal getSalary() {
-		return salary;
-	}
-
-	public void setSalary(BigDecimal salary) {
-		this.salary = salary;
-	}
-
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-	
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-			
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
-}

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/service/ClassGroupRelationService.java

@@ -2,7 +2,18 @@ package com.ym.mec.web.service;
 
 
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 public interface ClassGroupRelationService extends BaseService<Integer, ClassGroupRelation> {
 public interface ClassGroupRelationService extends BaseService<Integer, ClassGroupRelation> {
 
 
+
+    /**
+     * 批量插入班级关联关系
+     * @param classGroupRelationList
+     * @return
+     */
+    int classGroupRelationsInsert(List<ClassGroupRelation> classGroupRelationList);
+
 }
 }

+ 17 - 3
mec-web/src/main/java/com/ym/mec/web/service/ClassGroupService.java

@@ -2,6 +2,8 @@ package com.ym.mec.web.service;
 
 
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.entity.ClassGroup;
 import com.ym.mec.web.dal.entity.ClassGroup;
+import com.ym.mec.web.dal.entity.ClassGroupRelation;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -9,6 +11,7 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
 
     /**
     /**
      * 查询老师乐团课课程
      * 查询老师乐团课课程
+     *
      * @param teacherId
      * @param teacherId
      * @return
      * @return
      */
      */
@@ -16,13 +19,15 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
 
     /**
     /**
      * 合奏班相关班级获取
      * 合奏班相关班级获取
+     *
      * @param mixClassGroupId
      * @param mixClassGroupId
      * @return
      * @return
      */
      */
-    List<ClassGroup> findClassGroup(Integer musicGroupId,Integer mixClassGroupId);
+    List<ClassGroup> findClassGroup(Integer musicGroupId, Integer mixClassGroupId);
 
 
     /**
     /**
      * 根据乐团编号查询单技班列表
      * 根据乐团编号查询单技班列表
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
@@ -31,6 +36,7 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
 
     /**
     /**
      * 根据乐团编号查询合奏班列表
      * 根据乐团编号查询合奏班列表
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
@@ -38,6 +44,7 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
 
     /**
     /**
      * 添加单技班
      * 添加单技班
+     *
      * @param classGroup
      * @param classGroup
      * @return
      * @return
      */
      */
@@ -45,12 +52,19 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
 
     /**
     /**
      * 添加合奏班
      * 添加合奏班
+     *
      * @param classGroupIds
      * @param classGroupIds
      * @return
      * @return
      * @throws Exception
      * @throws Exception
      */
      */
-    ClassGroup addMixClassGroup(String classGroupIds) throws Exception;
-
+    ClassGroup addMixClassGroup(int musicGroupId, String name, String classGroupIds) throws Exception;
 
 
+    /**
+     * 跟班级ids查询班级信息
+     *
+     * @param ids
+     * @return
+     */
+    List<ClassGroup> findClassGroupByIds(String ids);
 
 
 }
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/ClassGroupTeacherMapperService.java

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

+ 12 - 0
mec-web/src/main/java/com/ym/mec/web/service/SubjectService.java

@@ -52,4 +52,16 @@ public interface SubjectService extends BaseService<Integer, Subject> {
      * @return
      * @return
      */
      */
     List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId);
     List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId);
+
+    /**
+     * 新增科目树状结构
+     * @param subject
+     */
+    void addSubject(Subject subject);
+
+    /**
+     * 批量修改声部
+     * @param subjects
+     */
+    void batchUpdate(List<Subject> subjects);
 }
 }

+ 0 - 8
mec-web/src/main/java/com/ym/mec/web/service/TeacherClassFeeService.java

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

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/TeacherDefaultMusicGroupSalaryService.java

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

+ 0 - 8
mec-web/src/main/java/com/ym/mec/web/service/TeacherSalaryService.java

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

+ 7 - 1
mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupRelationServiceImpl.java

@@ -9,6 +9,8 @@ import com.ym.mec.web.dal.dao.ClassGroupRelationDao;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
 import com.ym.mec.web.service.ClassGroupRelationService;
 import com.ym.mec.web.service.ClassGroupRelationService;
 
 
+import java.util.List;
+
 @Service
 @Service
 public class ClassGroupRelationServiceImpl extends BaseServiceImpl<Integer, ClassGroupRelation>  implements ClassGroupRelationService {
 public class ClassGroupRelationServiceImpl extends BaseServiceImpl<Integer, ClassGroupRelation>  implements ClassGroupRelationService {
 	
 	
@@ -19,5 +21,9 @@ public class ClassGroupRelationServiceImpl extends BaseServiceImpl<Integer, Clas
 	public BaseDAO<Integer, ClassGroupRelation> getDAO() {
 	public BaseDAO<Integer, ClassGroupRelation> getDAO() {
 		return classGroupRelationDao;
 		return classGroupRelationDao;
 	}
 	}
-	
+
+    @Override
+    public int classGroupRelationsInsert(List<ClassGroupRelation> classGroupRelationList) {
+		return classGroupRelationDao.classGroupRelationsInsert(classGroupRelationList);
+    }
 }
 }

+ 103 - 57
mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupServiceImpl.java

@@ -1,7 +1,10 @@
 package com.ym.mec.web.service.impl;
 package com.ym.mec.web.service.impl;
 
 
+import com.ym.mec.web.dal.entity.ClassGroupRelation;
 import com.ym.mec.web.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.web.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.web.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.web.dal.enums.ClassGroupStudentStatusEnum;
+import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.web.service.ClassGroupRelationService;
 import com.ym.mec.web.service.ClassGroupStudentMapperService;
 import com.ym.mec.web.service.ClassGroupStudentMapperService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -16,75 +19,118 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
 import java.util.*;
 
 
 @Service
 @Service
-public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>  implements ClassGroupService {
-	
-	@Autowired
-	private ClassGroupDao classGroupDao;
+public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup> implements ClassGroupService {
 
 
-	@Autowired
-	private ClassGroupStudentMapperService classGroupStudentMapperService;
+    @Autowired
+    private ClassGroupDao classGroupDao;
+    @Autowired
+    private ClassGroupRelationService classGroupRelationService;
 
 
-	@Override
-	public BaseDAO<Integer, ClassGroup> getDAO() {
-		return classGroupDao;
-	}
+    @Autowired
+    private ClassGroupStudentMapperService classGroupStudentMapperService;
 
 
-	@Override
+    @Override
+    public BaseDAO<Integer, ClassGroup> getDAO() {
+        return classGroupDao;
+    }
+
+    @Override
     public List<ClassGroup> findClassGroup4Teacher(Integer teacherId) {
     public List<ClassGroup> findClassGroup4Teacher(Integer teacherId) {
         return classGroupDao.findClassGroup4Teacher(teacherId);
         return classGroupDao.findClassGroup4Teacher(teacherId);
     }
     }
 
 
-	@Override
-	public List<ClassGroup> findClassGroup(Integer musicGroupId,Integer mixClassGroupId) {
-		if(null==mixClassGroupId){
-			return classGroupDao.findAllMixClassGroup(musicGroupId);
-		}else{
-			return classGroupDao.findMixClassChildClassGroup(mixClassGroupId);
-		}
-	}
+    @Override
+    public List<ClassGroup> findClassGroup(Integer musicGroupId, Integer mixClassGroupId) {
+        if (null == mixClassGroupId) {
+            return classGroupDao.findAllMixClassGroup(musicGroupId);
+        } else {
+            return classGroupDao.findMixClassChildClassGroup(mixClassGroupId);
+        }
+    }
 
 
     @Override
     @Override
     public List<ClassGroup> findAllNormalClassGroupByMusicGroupId(int musicGroupId) {
     public List<ClassGroup> findAllNormalClassGroupByMusicGroupId(int musicGroupId) {
-		return classGroupDao.findAllNormalClassGroupByMusicGroupId(musicGroupId);
+        return classGroupDao.findAllNormalClassGroupByMusicGroupId(musicGroupId);
     }
     }
 
 
-	@Override
-	public List<ClassGroup> findAllMixClassGroupByMusicGroupId(int musicGroupId) {
-		List<ClassGroup> allMixClassGroup = classGroupDao.findAllMixClassGroup(musicGroupId);
-		for (ClassGroup mixClassGroup:allMixClassGroup){
-			mixClassGroup.setClassNames(classGroupDao.findMixClassChildClassGroupNames(mixClassGroup.getId()).getName());
-		}
-		return allMixClassGroup;
-	}
+    @Override
+    public List<ClassGroup> findAllMixClassGroupByMusicGroupId(int musicGroupId) {
+        List<ClassGroup> allMixClassGroup = classGroupDao.findAllMixClassGroup(musicGroupId);
+        for (ClassGroup mixClassGroup : allMixClassGroup) {
+            mixClassGroup.setClassNames(classGroupDao.findMixClassChildClassGroupNames(mixClassGroup.getId()).getName());
+        }
+        return allMixClassGroup;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public ClassGroup addClassGroup(ClassGroup classGroup) throws Exception {
+        Date date;
+        date = new Date();
+        classGroup.setCreateTime(date);
+        classGroup.setUpdateTime(date);
+        classGroup.setType(ClassGroupTypeEnum.NORMAL);
+        String userIds = classGroup.getUserIds();
+        String[] userIdArr = userIds.split(",");
+
+        classGroup.setStudentNum(userIdArr.length);
+        Long classGroupId = this.insert(classGroup);
+
+        //2、插入班级学生关联关系
+        List<ClassGroupStudentMapper> classGroupStudentList = new ArrayList<>();
+        for (String userId : userIdArr) {
+            ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+            classGroupStudentMapper.setClassGroupId(classGroupId.intValue());
+            classGroupStudentMapper.setUserId(Integer.getInteger(userId));
+            classGroupStudentMapper.setCreateTime(date);
+            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentList.add(classGroupStudentMapper);
+        }
+        classGroupStudentMapperService.classGroupStudentsInsert(classGroupStudentList);
 
 
-	@Override
+        return classGroup;
+    }
+
+    @Override
 	@Transactional(rollbackFor = Exception.class)
 	@Transactional(rollbackFor = Exception.class)
-	public ClassGroup addClassGroup(ClassGroup classGroup) throws Exception {
-		Date date;
-		date = new Date();
-		classGroup.setCreateTime(date);
-		classGroup.setUpdateTime(date);
-		String userIds = classGroup.getUserIds();
-		String[] userIdArr = userIds.split(",");
-
-		classGroup.setStudentNum(userIdArr.length);
-		long classGroupId = this.insert(classGroup);
-		List<ClassGroupStudentMapper> classGroupStudentList = new ArrayList<>();
-		for (String userId:userIdArr) {
-			ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
-			classGroupStudentMapper.setClassGroupId(classGroupId);
-			classGroupStudentMapper.setUserId(Integer.getInteger(userId));
-			classGroupStudentMapper.setCreateTime(date);
-			classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
-			classGroupStudentList.add(classGroupStudentMapper);
-		}
-		classGroupStudentMapperService.classGroupStudentsInsert(classGroupStudentList);
-
-		return classGroup;
-	}
-
-	@Override
-	public ClassGroup addMixClassGroup(String classGroupIds) throws Exception {
-		return null;
-	}
+	public ClassGroup addMixClassGroup(int musicGroupId,String name, String classGroupIds) throws Exception {
+        Date date;
+        date = new Date();
+
+        List<ClassGroup> classGroups = findClassGroupByIds(classGroupIds);
+        int studentNum = 0; //学生数
+        String subjectIds = "";
+        for (ClassGroup classGroup : classGroups) {
+            studentNum += classGroup.getStudentNum();
+            subjectIds += subjectIds.isEmpty() ? classGroup.getSubjectIdList() : "," + classGroup.getSubjectIdList();
+        }
+
+        //1、插入班级
+        ClassGroup classGroup = new ClassGroup();
+        classGroup.setMusicGroupId(musicGroupId);
+        classGroup.setSubjectIdList(subjectIds);
+        classGroup.setName(name);
+        classGroup.setType(ClassGroupTypeEnum.MIX);
+        classGroup.setCreateTime(date);
+        classGroup.setUpdateTime(date);
+        Long classGroupId = this.insert(classGroup);
+
+        //2、插入班级关联关系
+        List<ClassGroupRelation> classGroupRelationList = new ArrayList<>();
+        for (ClassGroup cGroup : classGroups) {
+            ClassGroupRelation classGroupRelation = new ClassGroupRelation();
+            classGroupRelation.setClassGroupId(classGroupId.intValue());
+            classGroupRelation.setSubClassGroupId(cGroup.getId());
+            classGroupRelation.setCreateTime(date);
+            classGroupRelationList.add(classGroupRelation);
+        }
+		classGroupRelationService.classGroupRelationsInsert(classGroupRelationList);
+        return classGroup;
+    }
+
+    @Override
+    public List<ClassGroup> findClassGroupByIds(String ids) {
+        return classGroupDao.findClassGroupByIds(ids);
+    }
+
 }
 }

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupTeacherMapperServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.web.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.ClassGroupTeacherMapperDao;
+import com.ym.mec.web.dal.entity.ClassGroupTeacherMapper;
+import com.ym.mec.web.service.ClassGroupTeacherMapperService;
+
+@Service
+public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupTeacherMapper>  implements ClassGroupTeacherMapperService {
+	
+	@Autowired
+	private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
+
+	@Override
+	public BaseDAO<Long, ClassGroupTeacherMapper> getDAO() {
+		return classGroupTeacherMapperDao;
+	}
+	
+}

+ 27 - 1
mec-web/src/main/java/com/ym/mec/web/service/impl/SubjectServiceImpl.java

@@ -12,9 +12,10 @@ import com.ym.mec.web.dal.page.SubjectQueryInfo;
 import com.ym.mec.web.service.SubjectService;
 import com.ym.mec.web.service.SubjectService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 
+import java.util.Date;
 import java.util.List;
 import java.util.List;
-import java.util.stream.Collectors;
 
 
 @Service
 @Service
 public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  implements SubjectService {
 public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  implements SubjectService {
@@ -67,6 +68,31 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject>  imple
 		return subApplyDetail;
 		return subApplyDetail;
 	}
 	}
 
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void addSubject(Subject subject) {
+		subjectDao.insert(subject);
+		List<Subject> subjects = subject.getSubjects();
+		if(subjects != null && subjects.size() > 0){
+			subjects.forEach(e->{
+				e.setParentSubjectId(subject.getId());
+				subjectDao.insert(e);
+			});
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void batchUpdate(List<Subject> subjects) {
+		if(subjects != null && subjects.size() > 0){
+			Date date = new Date();
+			subjects.forEach(e->{
+				e.setUpdateTime(date);
+				subjectDao.update(e);
+			});
+		}
+	}
+
 	private Subject getTree(Subject sub,YesOrNoEnum yesOrNoEnum){
 	private Subject getTree(Subject sub,YesOrNoEnum yesOrNoEnum){
 		//得到根节点对象
 		//得到根节点对象
 		//获取子节点list
 		//获取子节点list

+ 0 - 23
mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherClassFeeServiceImpl.java

@@ -1,23 +0,0 @@
-package com.ym.mec.web.service.impl;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.web.dal.dao.TeacherClassFeeDao;
-import com.ym.mec.web.dal.entity.TeacherClassFee;
-import com.ym.mec.web.service.TeacherClassFeeService;
-
-@Service
-public class TeacherClassFeeServiceImpl extends BaseServiceImpl<Long, TeacherClassFee>  implements TeacherClassFeeService {
-	
-	@Autowired
-	private TeacherClassFeeDao teacherClassFeeDao;
-
-	@Override
-	public BaseDAO<Long, TeacherClassFee> getDAO() {
-		return teacherClassFeeDao;
-	}
-	
-}

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.web.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.TeacherDefaultMusicGroupSalaryDao;
+import com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary;
+import com.ym.mec.web.service.TeacherDefaultMusicGroupSalaryService;
+
+@Service
+public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<Long, TeacherDefaultMusicGroupSalary>  implements TeacherDefaultMusicGroupSalaryService {
+	
+	@Autowired
+	private TeacherDefaultMusicGroupSalaryDao teacherDefaultMusicGroupSalaryDao;
+
+	@Override
+	public BaseDAO<Long, TeacherDefaultMusicGroupSalary> getDAO() {
+		return teacherDefaultMusicGroupSalaryDao;
+	}
+	
+}

+ 0 - 23
mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherSalaryServiceImpl.java

@@ -1,23 +0,0 @@
-package com.ym.mec.web.service.impl;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.web.dal.dao.TeacherSalaryDao;
-import com.ym.mec.web.dal.entity.TeacherSalary;
-import com.ym.mec.web.service.TeacherSalaryService;
-
-@Service
-public class TeacherSalaryServiceImpl extends BaseServiceImpl<Long, TeacherSalary>  implements TeacherSalaryService {
-	
-	@Autowired
-	private TeacherSalaryDao teacherSalaryDao;
-
-	@Override
-	public BaseDAO<Long, TeacherSalary> getDAO() {
-		return teacherSalaryDao;
-	}
-	
-}

+ 5 - 0
mec-web/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -164,4 +164,9 @@
         LEFT JOIN class_group cg ON cgr.sub_class_group_id_=cg.id_
         LEFT JOIN class_group cg ON cgr.sub_class_group_id_=cg.id_
         WHERE cgr.class_group_id_=#{classGroupId} AND del_flag_='0'
         WHERE cgr.class_group_id_=#{classGroupId} AND del_flag_='0'
     </select>
     </select>
+
+    <!-- 根据ids查询班级列表 -->
+    <select id="findClassGroupByIds" resultMap="ClassGroup">
+        SELECT * FROM class_group WHERE FIND_IN_SET(id_,#{ids})
+    </select>
 </mapper>
 </mapper>

+ 19 - 8
mec-web/src/main/resources/config/mybatis/ClassGroupRelationMapper.xml

@@ -15,13 +15,15 @@
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="ClassGroupRelation">
     <select id="get" resultMap="ClassGroupRelation">
-		SELECT * FROM class_group_relation WHERE id_ = #{id} 
-	</select>
+        SELECT * FROM class_group_relation WHERE id_ = #{id}
+    </select>
 
 
     <!-- 全查询 -->
     <!-- 全查询 -->
     <select id="findAll" resultMap="ClassGroupRelation">
     <select id="findAll" resultMap="ClassGroupRelation">
-		SELECT * FROM class_group_relation ORDER BY id_
-	</select>
+        SELECT *
+        FROM class_group_relation
+        ORDER BY id_
+    </select>
 
 
     <!-- 向数据库增加一条记录 -->
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.ClassGroupRelation" useGeneratedKeys="true"
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.ClassGroupRelation" useGeneratedKeys="true"
@@ -51,8 +53,8 @@
 
 
     <!-- 根据主键删除一条记录 -->
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
     <delete id="delete">
-		DELETE FROM class_group_relation WHERE id_ = #{id} 
-	</delete>
+        DELETE FROM class_group_relation WHERE id_ = #{id}
+    </delete>
 
 
     <!-- 分页查询 -->
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroupRelation" parameterType="map">
     <select id="queryPage" resultMap="ClassGroupRelation" parameterType="map">
@@ -62,6 +64,15 @@
 
 
     <!-- 查询当前表的总记录数 -->
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM class_group_relation
-	</select>
+        SELECT COUNT(*)
+        FROM class_group_relation
+    </select>
+
+    <!-- 班级关系批量插入 -->
+    <insert id="classGroupRelationsInsert" parameterType="java.util.List">
+        INSERT INTO class_group_relation (id_,class_group_id_,sub_class_group_id_,create_time_)
+        <foreach collection="classGroupRelationList" item="item" index="index" separator=",">
+            (#{item.id},#{item.classGroupId},#{item.subClassGroupId},#{item.createTime})
+        </foreach>
+    </insert>
 </mapper>
 </mapper>

+ 35 - 29
mec-web/src/main/resources/config/mybatis/TeacherClassFeeMapper.xml → mec-web/src/main/resources/config/mybatis/ClassGroupTeacherMapperMapper.xml

@@ -1,84 +1,90 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
 <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
-<mapper namespace="com.ym.mec.web.dal.dao.TeacherClassFeeDao">
+<mapper namespace="com.ym.mec.web.dal.dao.ClassGroupTeacherMapperDao">
 
 
-	<resultMap type="com.ym.mec.web.dal.entity.TeacherClassFee"
-		id="TeacherClassFee">
+	<resultMap type="com.ym.mec.web.dal.entity.ClassGroupTeacherMapper"
+		id="ClassGroupTeacherMapper">
 		<result column="id_" property="id" />
 		<result column="id_" property="id" />
 		<result column="music_group_id_" property="musicGroupId" />
 		<result column="music_group_id_" property="musicGroupId" />
 		<result column="class_group_id_" property="classGroupId" />
 		<result column="class_group_id_" property="classGroupId" />
-		<result column="teacher_id_" property="teacherId" />
-		<result column="job_type_" property="jobType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-		<result column="class_fee_" property="classFee" />
+		<result column="teacher_role_" property="teacherRole" />
+		<result column="user_id_" property="userId" />
+		<result column="salary_" property="salary" />
 		<result column="create_time_" property="createTime" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
 	</resultMap>
 
 
 	<!-- 根据主键查询一条记录 -->
 	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="TeacherClassFee">
-		SELECT * FROM
-		teacher_class_fee WHERE id_ = #{id}
+	<select id="get" resultMap="ClassGroupTeacherMapper">
+		SELECT *
+		FROM class_group_teacher_mapper WHERE id_ = #{id}
 	</select>
 	</select>
 
 
 	<!-- 全查询 -->
 	<!-- 全查询 -->
-	<select id="findAll" resultMap="TeacherClassFee">
-		SELECT * FROM teacher_class_fee
-		ORDER BY id_
+	<select id="findAll" resultMap="ClassGroupTeacherMapper">
+		SELECT * FROM
+		class_group_teacher_mapper ORDER BY id_
 	</select>
 	</select>
 
 
 	<!-- 向数据库增加一条记录 -->
 	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.web.dal.entity.TeacherClassFee"
+	<insert id="insert" parameterType="com.ym.mec.web.dal.entity.ClassGroupTeacherMapper"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 			AS ID FROM DUAL </selectKey> -->
-		INSERT INTO teacher_class_fee
-		(id_,music_group_id_,class_group_id_,teacher_id_,job_type_,class_fee_,create_time_,update_time_)
-		VALUES(#{id},#{musicGroupId},#{classGroupId},#{teacherId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{classFee},now(),now)
+		INSERT INTO class_group_teacher_mapper
+		(id_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_)
+		VALUES(#{id},#{musicGroupId},#{classGroupId},#{teacherRole},#{userId},#{salary},#{createTime},#{updateTime})
 	</insert>
 	</insert>
 
 
 	<!-- 根据主键查询一条记录 -->
 	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.web.dal.entity.TeacherClassFee">
-		UPDATE teacher_class_fee
+	<update id="update" parameterType="com.ym.mec.web.dal.entity.ClassGroupTeacherMapper">
+		UPDATE class_group_teacher_mapper
 		<set>
 		<set>
-			<if test="jobType != null">
-				job_type_ = #{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			<if test="userId != null">
+				user_id_ = #{userId},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
 			</if>
 			</if>
 			<if test="classGroupId != null">
 			<if test="classGroupId != null">
 				class_group_id_ = #{classGroupId},
 				class_group_id_ = #{classGroupId},
 			</if>
 			</if>
-			<if test="teacherId != null">
-				teacher_id_ = #{teacherId},
+			<if test="salary != null">
+				salary_ = #{salary},
 			</if>
 			</if>
 			<if test="updateTime != null">
 			<if test="updateTime != null">
 				update_time_ = #{updateTime},
 				update_time_ = #{updateTime},
 			</if>
 			</if>
-			<if test="classFee != null">
-				class_fee_ = #{classFee},
+			<if test="teacherRole != null">
+				teacher_role_ = #{teacherRole},
 			</if>
 			</if>
 			<if test="musicGroupId != null">
 			<if test="musicGroupId != null">
 				music_group_id_ = #{musicGroupId},
 				music_group_id_ = #{musicGroupId},
 			</if>
 			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
 		</set>
 		</set>
 		WHERE id_ = #{id}
 		WHERE id_ = #{id}
 	</update>
 	</update>
 
 
 	<!-- 根据主键删除一条记录 -->
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete">
 	<delete id="delete">
-		DELETE FROM teacher_class_fee WHERE id_ =
-		#{id}
+		DELETE FROM class_group_teacher_mapper WHERE
+		id_ = #{id}
 	</delete>
 	</delete>
 
 
 	<!-- 分页查询 -->
 	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="TeacherClassFee"
+	<select id="queryPage" resultMap="ClassGroupTeacherMapper"
 		parameterType="map">
 		parameterType="map">
-		SELECT * FROM teacher_class_fee ORDER BY id_
+		SELECT * FROM class_group_teacher_mapper ORDER BY id_
 		<include refid="global.limit" />
 		<include refid="global.limit" />
 	</select>
 	</select>
 
 
 	<!-- 查询当前表的总记录数 -->
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM
 		SELECT COUNT(*) FROM
-		teacher_class_fee
+		class_group_teacher_mapper
 	</select>
 	</select>
 </mapper>
 </mapper>

+ 18 - 2
mec-web/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -14,6 +14,10 @@
         <result column="update_time_" property="updateTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="parent_organ_id_" property="parentOrganId"/>
         <result column="parent_organ_id_" property="parentOrganId"/>
+        <result column="register_date_" property="registerDate"/>
+        <result column="linkman_" property="linkman"/>
+        <result column="mobile_" property="mobile"/>
+        <result column="address_" property="address"/>
     </resultMap>
     </resultMap>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
@@ -34,8 +38,8 @@
         SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
         SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
         </selectKey>
         </selectKey>
         -->
         -->
-        INSERT INTO organization (id_,name_,code_,create_time_,update_time_,del_flag_,parent_organ_id_)
-        VALUES(#{id},#{name},#{code},now(),now(),#{delFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{parentOrganId})
+        INSERT INTO organization (id_,name_,code_,create_time_,update_time_,del_flag_,parent_organ_id_,register_date_,linkman_,mobile_,address_)
+        VALUES(#{id},#{name},#{code},now(),now(),#{delFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{parentOrganId},#{registerDate},#{linkman},#{mobile},#{address})
     </insert>
     </insert>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
@@ -57,6 +61,18 @@
             <if test="name != null">
             <if test="name != null">
                 name_ = #{name},
                 name_ = #{name},
             </if>
             </if>
+            <if test="registerDate != null">
+                register_date_ = #{registerDate},
+            </if>
+            <if test="linkman != null">
+                linkman_ = #{linkman},
+            </if>
+            <if test="mobile != null">
+                mobile_ = #{mobile},
+            </if>
+            <if test="address != null">
+                address_ = #{address},
+            </if>
         </set>
         </set>
         WHERE id_ = #{id}
         WHERE id_ = #{id}
     </update>
     </update>

+ 0 - 5
mec-web/src/main/resources/config/mybatis/StudentCourseHomeworkReplyMapper.xml

@@ -36,11 +36,6 @@
     <!-- 向数据库增加一条记录 -->
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentCourseHomeworkReply" useGeneratedKeys="true"
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentCourseHomeworkReply" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
             keyColumn="id" keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
         INSERT INTO student_course_homework_reply
         INSERT INTO student_course_homework_reply
         (id_,student_course_homework_id_,user_id_,content_,create_time_,parent_id_)
         (id_,student_course_homework_id_,user_id_,content_,create_time_,parent_id_)
         VALUES(#{id},#{studentCourseHomeworkId},#{userId},#{content},now(),#{parentId})
         VALUES(#{id},#{studentCourseHomeworkId},#{userId},#{content},now(),#{parentId})

+ 1 - 1
mec-web/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -63,7 +63,7 @@
 
 
     <!-- 根据主键删除一条记录 -->
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
     <delete id="delete">
-		DELETE FROM subject WHERE id_ = #{id} 
+		DELETE FROM subject WHERE id_ = #{id} AND parent_subject_id_ = #{id}
 	</delete>
 	</delete>
 
 
     <!-- 分页查询 -->
     <!-- 分页查询 -->

+ 91 - 0
mec-web/src/main/resources/config/mybatis/TeacherDefaultMusicGroupSalaryMapper.xml

@@ -0,0 +1,91 @@
+<?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.web.dal.dao.TeacherDefaultMusicGroupSalaryDao">
+
+	<resultMap type="com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary"
+		id="TeacherDefaultMusicGroupSalary">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="class_group_type_" property="classGroupType" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="main_teacher_salary_" property="mainTeacherSalary" />
+		<result column="assistant_teacher_salary_" property="assistantTeacherSalary" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="TeacherDefaultMusicGroupSalary">
+		SELECT * FROM teacher_default_music_group_salary WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="TeacherDefaultMusicGroupSalary">
+		SELECT * FROM
+		teacher_default_music_group_salary ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert"
+		parameterType="com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO teacher_default_music_group_salary
+		(id_,user_id_,class_group_type_,subject_id_,main_teacher_salary_,assistant_teacher_salary_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{classGroupType},#{subjectId},#{mainTeacherSalary},#{assistantTeacherSalary},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update"
+		parameterType="com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary">
+		UPDATE teacher_default_music_group_salary
+		<set>
+			<if test="subjectId != null">
+				subject_id_ = #{subjectId},
+			</if>
+			<if test="userId != null">
+				user_id_ = #{userId},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="classGroupType != null">
+				class_group_type_ = #{classGroupType},
+			</if>
+			<if test="mainTeacherSalary != null">
+				main_teacher_salary_ = #{mainTeacherSalary},
+			</if>
+			<if test="assistantTeacherSalary != null">
+				assistant_teacher_salary_ = #{assistantTeacherSalary},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM
+		teacher_default_music_group_salary WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="TeacherDefaultMusicGroupSalary"
+		parameterType="map">
+		SELECT * FROM teacher_default_music_group_salary ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM
+		teacher_default_music_group_salary
+	</select>
+</mapper>

+ 0 - 71
mec-web/src/main/resources/config/mybatis/TeacherSalaryMapper.xml

@@ -1,71 +0,0 @@
-<?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.web.dal.dao.TeacherSalaryDao">
-
-    <resultMap type="com.ym.mec.web.dal.entity.TeacherSalary" id="TeacherSalary">
-        <result column="id_" property="id"/>
-        <result column="user_id_" property="userId"/>
-        <result column="subject_id_" property="subjectId"/>
-        <result column="salary_" property="salary"/>
-        <result column="create_time_" property="createTime"/>
-    </resultMap>
-
-    <!-- 根据主键查询一条记录 -->
-    <select id="get" resultMap="TeacherSalary">
-		SELECT * FROM teacher_salary WHERE id_ = #{id} 
-	</select>
-
-    <!-- 全查询 -->
-    <select id="findAll" resultMap="TeacherSalary">
-		SELECT * FROM teacher_salary ORDER BY id_
-	</select>
-
-    <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.ym.mec.web.dal.entity.TeacherSalary" useGeneratedKeys="true" keyColumn="id"
-            keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
-        INSERT INTO teacher_salary (id_,user_id_,subject_id_,salary_,create_time_)
-        VALUES(#{id},#{userId},#{subjectId},#{salary},#{createTime})
-    </insert>
-
-    <!-- 根据主键查询一条记录 -->
-    <update id="update" parameterType="com.ym.mec.web.dal.entity.TeacherSalary">
-        UPDATE teacher_salary
-        <set>
-            <if test="subjectId != null">
-                subject_id_ = #{subjectId},
-            </if>
-            <if test="userId != null">
-                user_id_ = #{userId},
-            </if>
-            <if test="salary != null">
-                salary_ = #{salary},
-            </if>
-        </set>
-        WHERE id_ = #{id}
-    </update>
-
-    <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-		DELETE FROM teacher_salary WHERE id_ = #{id} 
-	</delete>
-
-    <!-- 分页查询 -->
-    <select id="queryPage" resultMap="TeacherSalary" parameterType="map">
-        SELECT * FROM teacher_salary ORDER BY id_
-        <include refid="global.limit"/>
-    </select>
-
-    <!-- 查询当前表的总记录数 -->
-    <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM teacher_salary
-	</select>
-</mapper>