Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 năm trước cách đây
mục cha
commit
18af9d5bcb
26 tập tin đã thay đổi với 307 bổ sung113 xóa
  1. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupRelationDao.java
  2. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  3. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java
  4. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java
  5. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  6. 0 22
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SubjectGoodsMapper.java
  7. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  8. 0 8
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java
  9. 5 3
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  10. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupStudentFeeService.java
  11. 34 22
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  12. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  13. 73 13
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  14. 32 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupStudentFeeServiceImpl.java
  15. 3 3
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  16. 5 2
      mec-biz/src/main/resources/config/mybatis/ClassGroupRelationMapper.xml
  17. 6 2
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  18. 8 3
      mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml
  19. 4 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml
  20. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  21. 2 15
      mec-biz/src/main/resources/config/mybatis/SubjectGoodsMapperMapper.xml
  22. 1 1
      mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/RedisIdGeneratorService.java
  23. 1 1
      mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml
  24. 67 2
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  25. 11 4
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  26. 1 0
      mec-web/src/main/java/com/ym/mec/web/controller/GoodsController.java

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupRelationDao.java

@@ -16,4 +16,10 @@ public interface ClassGroupRelationDao extends BaseDAO<Integer, ClassGroupRelati
      * @return
      */
     int classGroupRelationsInsert(@Param("classGroupRelationList") List<ClassGroupRelation> classGroupRelationList);
+
+    /**
+     * 删除班级关系
+     * @param classGroupId
+     */
+    void deleteByClassId(Integer classGroupId);
 }

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

@@ -34,4 +34,10 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 	 */
 	int updateUserStatusByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId,
 			@Param("status") ClassGroupStudentStatusEnum status);
+
+	/**
+	 * 根据班级编号删除关联
+	 * @param classGroupId
+	 */
+	void deleteByClassId(Integer classGroupId);
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import java.util.Date;
+import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
@@ -31,4 +32,11 @@ public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudent
 	 * @return
 	 */
 	int updateNextPaymentDate(@Param("musicGroupId") String musicGroupId, @Param("nextPaymentDate") Date nextPaymentDate);
+
+	/**
+	 * 根据可提前缴费的天数查询即将续费的列表
+	 * @param days 可提前缴费天数
+	 * @return
+	 */
+	List<MusicGroupStudentFee> queryWillRenewList(int days);
 }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 
 import io.swagger.annotations.ApiModelProperty;
@@ -103,6 +104,17 @@ public class Goods {
 	/** 修改时间 */
 	private java.util.Date updateTime;
 
+	@ApiModelProperty(value = "商品类型", required = false)
+	private GoodsType type;
+
+	public GoodsType getType() {
+		return type;
+	}
+
+	public void setType(GoodsType type) {
+		this.type = type;
+	}
+
 	public String getComplementGoodsIdList() {
 		return complementGoodsIdList;
 	}

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -75,7 +75,7 @@ public class StudentRegistration {
     private YesOrNoEnum paymentStatus;
 
     @ApiModelProperty(value = "班级id", hidden = true)
-    private Integer ClassGroupId;
+    private Integer classGroupId;
 
     @ApiModelProperty(value = "零时课程费用", hidden = true)
     private BigDecimal temporaryCourseFee;
@@ -217,11 +217,11 @@ public class StudentRegistration {
     }
 
     public Integer getClassGroupId() {
-        return ClassGroupId;
+        return classGroupId;
     }
 
     public void setClassGroupId(Integer classGroupId) {
-        ClassGroupId = classGroupId;
+        this.classGroupId = classGroupId;
     }
 
     public String getName() {

+ 0 - 22
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SubjectGoodsMapper.java

@@ -14,9 +14,6 @@ public class SubjectGoodsMapper {
 	/**  */
 	private Long id;
 
-	@ApiModelProperty(value = "组织编号", required = false)
-	private Integer organId;
-
 	/**  */
 	@ApiModelProperty(value = "科目编号", required = false)
 	private String subjectId;
@@ -25,9 +22,6 @@ public class SubjectGoodsMapper {
 	@ApiModelProperty(value = "商品编号", required = false)
 	private Integer goodsId;
 
-	@ApiModelProperty(value = "商品类型", required = false)
-	private GoodsType type;
-
 	@ApiModelProperty(value = "删除标记,删除时传true,其他传null", required = false)
 	private boolean delFlag = false;
 
@@ -53,14 +47,6 @@ public class SubjectGoodsMapper {
 		return this.id;
 	}
 
-	public Integer getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(Integer organId) {
-		this.organId = organId;
-	}
-
 	public void setSubjectId(String subjectId) {
 		this.subjectId = subjectId;
 	}
@@ -77,14 +63,6 @@ public class SubjectGoodsMapper {
 		return this.goodsId;
 	}
 
-	public GoodsType getType() {
-		return type;
-	}
-
-	public void setType(GoodsType type) {
-		this.type = type;
-	}
-
 	public void setCreateTime(java.util.Date createTime) {
 		this.createTime = createTime;
 	}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -171,4 +171,16 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @return
      */
     List<ClassGroup> findNoClassSubjects(String musicGroupId);
+
+    /**
+     * 删除单技班级
+     * @param classGroupId
+     */
+    void delSingle(Integer classGroupId);
+
+    /**
+     * 删除合奏班级
+     * @param classGroupId
+     */
+    void delMix(Integer classGroupId);
 }

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

@@ -8,12 +8,4 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 public interface ClassGroupStudentMapperService extends BaseService<Long, ClassGroupStudentMapper> {
-
-    /**
-     * 批量插入班级关联的学生
-     * @param classGroupStudentMapperList
-     * @return
-     */
-    int classGroupStudentsInsert(@Param("classGroupStudentMapperList") List<ClassGroupStudentMapper> classGroupStudentMapperList);
-
 }

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

@@ -2,8 +2,11 @@ package com.ym.mec.biz.service;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
-import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.dto.MusicCardDto;
+import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 import com.ym.mec.common.page.PageInfo;
@@ -75,10 +78,9 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 	 *  续费
 	 * @param musicGroupId 乐团编号
 	 * @param userId 用户编号
-	 * @param amount 缴费金额
 	 * @return
 	 */
-	boolean renew(String musicGroupId, Integer userId, double amount);
+	Map renew(String musicGroupId, Integer userId);
 
 	/**
 	 * 获取乐团列表

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

@@ -5,4 +5,10 @@ import com.ym.mec.common.service.BaseService;
 
 public interface MusicGroupStudentFeeService extends BaseService<Long, MusicGroupStudentFee> {
 
+	/**
+	 * 刷新续费状态
+	 * @return
+	 */
+	boolean refreshPaymentFeeStatus();
+
 }

+ 34 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1,9 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
@@ -17,13 +14,11 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
-import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.math.BigDecimal;
 import java.time.Instant;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
@@ -42,7 +37,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private ClassGroupRelationService classGroupRelationService;
     @Autowired
-    private ClassGroupStudentMapperService classGroupStudentMapperService;
+    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
+    @Autowired
+    private ClassGroupRelationDao classGroupRelationDao;
     @Autowired
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
     @Autowired
@@ -52,8 +49,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private StudentRegistrationService studentRegistrationService;
     @Autowired
-    private ClassGroupTeacherSalaryService classGroupTeacherSalaryService;
-    @Autowired
     private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 
     @Override
@@ -98,8 +93,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Override
     @Transactional(rollbackFor = Exception.class)
     public ClassGroup addClassGroup(ClassGroup classGroup) throws Exception {
-        Date date;
-        date = new Date();
+        Date date = new Date();
         classGroup.setCreateTime(date);
         classGroup.setUpdateTime(date);
         classGroup.setType(ClassGroupTypeEnum.NORMAL);
@@ -107,25 +101,25 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         String[] userIdArr = userIds.split(",");
 
         classGroup.setStudentNum(userIdArr.length);
-        Long classGroupId = this.insert(classGroup);
+        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.setClassGroupId(classGroup.getId());
+            classGroupStudentMapper.setUserId(Integer.parseInt(userId));
             classGroupStudentMapper.setCreateTime(date);
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
             classGroupStudentList.add(classGroupStudentMapper);
             StudentRegistration studentRegistration = new StudentRegistration();
-            studentRegistration.setClassGroupId(classGroupId.intValue());
+            studentRegistration.setClassGroupId(classGroup.getId());
             studentRegistration.setUserId(Integer.getInteger(userId));
             studentRegistration.setMusicGroupId(classGroup.getMusicGroupId());
             studentRegistrationService.updateByUserIdAndMusicGroupId(studentRegistration);
         }
 
-        classGroupStudentMapperService.classGroupStudentsInsert(classGroupStudentList);
+        classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentList);
 
         return classGroup;
     }
@@ -152,13 +146,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         classGroup.setType(ClassGroupTypeEnum.MIX);
         classGroup.setCreateTime(date);
         classGroup.setUpdateTime(date);
-        Long classGroupId = this.insert(classGroup);
+        insert(classGroup);
 
         //2、插入班级关联关系
         List<ClassGroupRelation> classGroupRelationList = new ArrayList<>();
         for (ClassGroup cGroup : classGroups) {
             ClassGroupRelation classGroupRelation = new ClassGroupRelation();
-            classGroupRelation.setClassGroupId(classGroupId.intValue());
+            classGroupRelation.setClassGroupId(classGroup.getId());
             classGroupRelation.setSubClassGroupId(cGroup.getId());
             classGroupRelation.setCreateTime(date);
             classGroupRelationList.add(classGroupRelation);
@@ -182,12 +176,12 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             highClassGroup.setCreateTime(date);
             highClassGroup.setUpdateTime(date);
             highClassGroup.setType(ClassGroupTypeEnum.HIGH);
-            Long classGroupId = this.insert(highClassGroup);
+            insert(highClassGroup);
 
             //2、插入班级关联老师
             ClassGroupTeacherMapper classGroupTeacherMapper = new ClassGroupTeacherMapper();
             classGroupTeacherMapper.setMusicGroupId(highClassGroup.getUserId());
-            classGroupTeacherMapper.setClassGroupId(classGroupId.intValue());
+            classGroupTeacherMapper.setClassGroupId(highClassGroup.getId());
             classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
             classGroupTeacherMapper.setUserId(highClassGroup.getUserId());
             classGroupTeacherMapper.setCreateTime(date);
@@ -207,7 +201,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
                     Date classDate = Date.from(instant);
 
-                    courseSchedule.setClassGroupId(classGroupId.intValue());
+                    courseSchedule.setClassGroupId(highClassGroup.getUserId());
                     courseSchedule.setStatus(CourseStatusEnum.NOT_START);
                     courseSchedule.setClassDate(classDate);
                     courseSchedule.setStartClassTime(highClassGroup.getStartClassTime());
@@ -420,7 +414,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         classGroupStudentMapper.setUserId(userId);
         classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
         classGroupStudentMapper.setCreateTime(date);
-        classGroupStudentMapperService.insert(classGroupStudentMapper);
+        classGroupStudentMapperDao.insert(classGroupStudentMapper);
         return classGroup;
     }
 
@@ -428,4 +422,22 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     public List<ClassGroup> findNoClassSubjects(String musicGroupId) {
         return classGroupDao.findNoClassSubjects(musicGroupId);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delSingle(Integer classGroupId) {
+        //删除学员班级关联关系
+        classGroupStudentMapperDao.deleteByClassId(classGroupId);
+        //删除班级
+        classGroupDao.delete(classGroupId);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delMix(Integer classGroupId) {
+        //删除班级关系
+        classGroupRelationDao.deleteByClassId(classGroupId);
+        //删除合奏班
+        classGroupDao.delete(classGroupId);
+    }
 }

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

@@ -21,9 +21,4 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 	public BaseDAO<Long, ClassGroupStudentMapper> getDAO() {
 		return classGroupStudentMapperDao;
 	}
-
-    @Override
-    public int classGroupStudentsInsert(List<ClassGroupStudentMapper> classGroupStudentMapperList) {
-		return classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMapperList);
-    }
 }

+ 73 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1,14 +1,52 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.*;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ym.mec.biz.dal.dao.ChargeTypeDao;
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
+import com.ym.mec.biz.dal.dao.SchoolDao;
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.MusicCardDto;
-import com.ym.mec.biz.dal.dto.MusicGroupsDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
-import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentEntities;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
 import com.ym.mec.biz.service.MusicGroupService;
+import com.ym.mec.biz.service.PayService;
 import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupMember;
@@ -19,13 +57,6 @@ import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.collection.MapUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.*;
-import java.util.stream.Collectors;
 
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
@@ -65,6 +96,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 	@Autowired
 	private SysUserCashAccountService sysUserCashAccountService;
 	
+    @Autowired
+    private PayService payService;
+	
 	@Override
 	public BaseDAO<String, MusicGroup> getDAO() {
 		return musicGroupDao;
@@ -277,8 +311,34 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 	}
 
 	@Override
-	public boolean renew(String musicGroupId, Integer userId, double amount) {
-		return true;
+	public Map renew(String musicGroupId, Integer userId) {
+
+		MusicGroup musicGroup = this.get(musicGroupId);
+		if (musicGroup == null) {
+			throw new BizException("乐团不存在");
+		}
+
+		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+
+		if (musicGroupStudentFee == null) {
+			throw new BizException("个人信息不存在");
+		}
+		// 判断当前是否是续费状态
+		if (musicGroupStudentFee.getPaymentStatus() != PaymentStatus.NON_PAYMENT) {
+			throw new BizException("已缴费");
+		}
+
+		BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
+		if (amount == null || amount.doubleValue() == 0) {
+			amount = musicGroupStudentFee.getCourseFee();
+		}
+
+		try {
+			return payService.getPayMap(amount, idGeneratorService.generatorId("payment") + "", "https://pay.dayaedu.com/api/yqpay/notify",
+					"http://dev.dayaedu.com", "测试订单", "测试订单");
+		} catch (Exception e) {
+			throw new BizException("调用支付接口出错", e);
+		}
 	}
 
 	@Override

+ 32 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupStudentFeeServiceImpl.java

@@ -1,23 +1,52 @@
 package com.ym.mec.biz.service.impl;
 
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
+import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.service.MusicGroupStudentFeeService;
 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 MusicGroupStudentFeeServiceImpl extends BaseServiceImpl<Long, MusicGroupStudentFee> implements MusicGroupStudentFeeService {
 	
 	@Autowired
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
+	
+	@Autowired
+	private SysConfigDao sysConfigDao;
 
 	@Override
 	public BaseDAO<Long, MusicGroupStudentFee> getDAO() {
 		return musicGroupStudentFeeDao;
 	}
+
+	@Override
+	public boolean refreshPaymentFeeStatus() {
+		
+		int days = 7;
+		
+		SysConfig sysConfig = sysConfigDao.findByParamName("refresh_payment_status_early_days");
+		if(sysConfig != null){
+			days = Integer.parseInt(sysConfig.getParanValue());
+		}
+		
+		List<MusicGroupStudentFee> musicGroupStudentFeeList = musicGroupStudentFeeDao.queryWillRenewList(days);
+		
+		for(MusicGroupStudentFee musicGroupStudentFee : musicGroupStudentFeeList){
+			
+		}
+		
+		//int i = DateUtil.daysBetween(new Date(), musicGroupStudentFee.getNextPaymentDate());
+		//e.setRenewStatus(i < 8 ? 0 : 1);
+		
+		return true;
+	}
 	
 }

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

@@ -9,6 +9,7 @@
         <result column="id_" property="id"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="subject_id_list_" property="subjectIdList"/>
+        <result column="subject_name_" property="subjectName"/>
         <result column="name_" property="name"/>
         <result column="student_num_" property="studentNum"/>
         <result column="create_time_" property="createTime"/>
@@ -171,8 +172,7 @@
     <!-- 根据乐团id获取单技班信息 -->
     <select id="findAllNormalClassGroupByMusicGroupId" resultMap="ClassGroup">
         SELECT
-        cg.*,
-        (SELECT group_concat(sb.name_) FROM subject sb WHERE FIND_IN_SET(sb.id_,cg.subject_id_list_)) AS subject_name
+        cg.*, (SELECT group_concat(sb.name_) FROM subject sb WHERE FIND_IN_SET(sb.id_,cg.subject_id_list_)) AS subject_name_
         FROM
         class_group cg
         WHERE cg.music_group_id_=#{musicGroupId} AND cg.type_='NORMAL' AND cg.del_flag_='0'
@@ -417,7 +417,7 @@
         (SELECT cgr.sub_class_group_id_ FROM class_group_relation cgr
         LEFT JOIN class_group cg ON cg.id_ = cgr.class_group_id_
         WHERE cg.music_group_id_ = #{musicGroupId})
-        AND cg.music_group_id_ = #{musicGroupId}
+        AND cg.music_group_id_ = #{musicGroupId} AND type_ = 'NORMAL'
     </select>
 
     <!-- 增加实际学生人数 -->

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

@@ -55,6 +55,9 @@
     <delete id="delete">
         DELETE FROM class_group_relation WHERE id_ = #{id}
     </delete>
+    <delete id="deleteByClassId">
+        DELETE FROM class_group_relation WHERE class_group_id_ = #{classGroupId}
+    </delete>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroupRelation" parameterType="map">
@@ -70,9 +73,9 @@
 
     <!-- 班级关系批量插入 -->
     <insert id="classGroupRelationsInsert" parameterType="java.util.List">
-        INSERT INTO class_group_relation (id_,class_group_id_,sub_class_group_id_,create_time_)
+        INSERT INTO class_group_relation (class_group_id_,sub_class_group_id_,create_time_) VALUES
         <foreach collection="classGroupRelationList" item="item" index="index" separator=",">
-            (#{item.id},#{item.classGroupId},#{item.subClassGroupId},#{item.createTime})
+            (#{item.classGroupId},#{item.subClassGroupId},now())
         </foreach>
     </insert>
 </mapper>

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

@@ -52,6 +52,9 @@
     <delete id="delete">
 		DELETE FROM class_group_student_mapper WHERE id_ = #{id} 
 	</delete>
+    <delete id="deleteByClassId">
+        DELETE FROM class_group_student_mapper WHERE class_group_id_ = #{classGroupId}
+    </delete>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroupStudentMapper" parameterType="map">
@@ -66,9 +69,10 @@
 
     <!-- 班级学生批量插入 -->
     <insert id="classGroupStudentsInsert" parameterType="java.util.List">
-        INSERT INTO class_group_student_mapper (id_,class_group_id_,user_id_,status_,create_time_)
+        INSERT INTO class_group_student_mapper (class_group_id_,user_id_,status_,create_time_)
+        VALUES
         <foreach collection="classGroupStudentMapperList" item="item" index="index" separator=",">
-            (#{item.id},#{item.classGroupId},#{item.userId},#{item.status},#{item.createTime})
+            (#{item.classGroupId},#{item.userId},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now())
         </foreach>
     </insert>
     

+ 8 - 3
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -29,6 +29,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="complement_goods_id_list_" property="complementGoodsIdList"/>
+        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -45,9 +46,10 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Goods" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO goods
-        (id_,goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,sell_count_,market_price_,discount_price_,group_purchase_price_,brief_,desc_,is_new_,is_top_,status_,memo_,publish_time_,complement_goods_id_list_,update_time_,create_time_)
-        VALUES(#{id},#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{sellCount},#{marketPrice},#{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
-        #{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{memo},#{publishTime},#{complementGoodsIdList},now(),now())
+        (goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,sell_count_,market_price_,discount_price_,group_purchase_price_,brief_,desc_,is_new_,is_top_,status_,memo_,publish_time_,complement_goods_id_list_,update_time_,create_time_,type_)
+        VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{sellCount},#{marketPrice},#{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
+        #{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        #{memo},#{publishTime},#{complementGoodsIdList},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -63,6 +65,9 @@
             <if test="isTop != null">
                 is_top_ = #{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
+            <if test="type != null">
+                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
             <if test="sn != null">
                 sn_ = #{sn},
             </if>

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

@@ -110,4 +110,8 @@
     <update id="updateNextPaymentDate" parameterType="map">
         update music_group_student_fee_ set next_payment_date_ = #{nextPaymentDate},update_time_ = now() WHERE music_group_id_ = #{musicGroupId}
     </update>
+
+    <select id="queryWillRenewList" resultMap="MusicGroupStudentFee">
+        SELECT * FROM music_group_student_fee_ WHERE payment_status_ = 'PAID_COMPLETED' and date_add(now(), interval #{days} day) >= next_payment_date_
+    </select>
 </mapper>

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

@@ -245,7 +245,7 @@
     </select>
 
     <update id="updateByUserIdAndMusicGroupId" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
-        UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_ = #{musicGroupId}
+        UPDATE student_registration SET class_group_id_ = #{studentRegistration.classGroupId} WHERE user_id_ = #{studentRegistration.userId} AND music_group_id_ = #{studentRegistration.musicGroupId}
     </update>
     
     <select id="queryStudentInfo" resultMap="StudentInfo">

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

@@ -8,9 +8,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.entity.SubjectGoodsMapper" id="SubjectGoodsMapper">
         <result column="id_" property="id"/>
-        <result column="organ_id_" property="organId"/>
         <result column="subject_id_" property="subjectId"/>
-        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
         <result column="goods_id_" property="goodsId"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
@@ -29,13 +27,8 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SubjectGoodsMapper" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
-        INSERT INTO subject_plan_goods_mapper (id_,organ_id_,subject_id_,goods_id_,type_,create_time_,update_time_)
-        VALUES(#{id},#{organId},#{subjectId},#{goodsId},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),now())
+        INSERT INTO subject_plan_goods_mapper (subject_id_,goods_id_,create_time_,update_time_)
+        VALUES(#{subjectId},#{goodsId},now(),now())
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -45,12 +38,6 @@
             <if test="subjectId != null">
                 subject_id_ = #{subjectId},
             </if>
-            <if test="organId != null">
-                organ_id_ = #{organId},
-            </if>
-            <if test="type != null">
-                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            </if>
             <if test="updateTime != null">
                 update_time_ = #{updateTime},
             </if>

+ 1 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/RedisIdGeneratorService.java

@@ -60,7 +60,7 @@ public class RedisIdGeneratorService implements IdGeneratorService {
 		try {
 			ValueOperations<String, Object> valueOper = redisTemplate.opsForValue();
 			Long index = valueOper.increment(key, 1);
-			orderId = prefix.concat(String.format("%1$03d", index)); // 补位操作 保证满足3位
+			orderId = prefix.concat(String.format("%1$05d", index)); // 补位操作 保证满足3位
 		} catch (Exception ex) {
 			log.error("分布式订单号生成失败异常。。。。。", ex);
 		} finally {

+ 1 - 1
mec-education/src/main/resources/mapper/StudentAttendanceMapper.xml

@@ -23,7 +23,7 @@
             resultType="com.ym.mec.education.resp.AttendClassResp">
 
      SELECT
-	s.music_group_id_,s.class_group_id_,s.user_id_,s.teacher_id_,s.current_class_times_,s.status_,g.name_,g.total_class_times_,g.type_,g.teach_mode_,u.real_name_,c.name_ as courseName,c.class_date_,c.start_class_time_,c.end_class_time_
+	s.music_group_id_,s.class_group_id_,s.user_id_,s.teacher_id_,s.current_class_times_,s.status_,g.name_,g.total_class_times_,g.type_,c.teach_mode_,u.real_name_,c.name_ as courseName,c.class_date_,c.start_class_time_,c.end_class_time_
     FROM
 	student_attendance s
     LEFT JOIN course_schedule c

+ 67 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.student.controller;
 
-import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -15,6 +13,7 @@ import javax.annotation.Resource;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -23,8 +22,22 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.RegisterPayDto;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
@@ -34,6 +47,7 @@ import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.string.IdWorker;
 
 @RequestMapping("musicGroup")
@@ -57,6 +71,9 @@ public class MusicGroupController extends BaseController {
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
     private PayService payService;
+    
+    @Autowired
+    private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 
     @ApiOperation("获取学生所在乐团列表")
     @GetMapping(value = "/queryUserMusicGroups")
@@ -119,6 +136,54 @@ public class MusicGroupController extends BaseController {
         return succeed(studentRegistration);
     }
 
+    @ApiOperation(value = "查询续费信息")
+    @GetMapping("/queryRenewInfo")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+	public HttpResponseResult queryRenewInfo(String musicGroupId) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		Integer userId = sysUser.getId();
+		MusicGroup musicGroup = musicGroupService.get(musicGroupId);
+		if (musicGroup == null) {
+			return failed("乐团不存在");
+		}
+		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
+
+		if (musicGroupStudentFee == null) {
+			throw new BizException("个人信息不存在");
+		}
+		if (musicGroupStudentFee.getPaymentStatus() != PaymentStatus.NON_PAYMENT) {
+			throw new BizException("已缴费");
+		}
+
+		BigDecimal amount = musicGroupStudentFee.getTemporaryCourseFee();
+		if (amount == null || amount.doubleValue() == 0) {
+			amount = musicGroupStudentFee.getCourseFee();
+		}
+		ModelMap model = new ModelMap();
+		model.put("musicGroup", musicGroup);
+		model.put("amount", amount);
+
+		return succeed(model);
+	}
+
+    @ApiOperation(value = "续费")
+    @GetMapping("/renew")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+	public HttpResponseResult renew(String musicGroupId) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		Integer userId = sysUser.getId();
+		return succeed(musicGroupService.renew(musicGroupId, userId));
+	}
+
+    @ApiOperation(value = "退团")
+    @GetMapping("/quitMusicGroup")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+	public HttpResponseResult quitMusicGroup(String musicGroupId) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		Integer userId = sysUser.getId();
+		return succeed(musicGroupService.quitMusicGroup(musicGroupId, userId));
+	}
+
 
     @ApiOperation(value = "乐团报名支付")
     @PostMapping("/pay")

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

@@ -49,10 +49,17 @@ public class ClassGroupController extends BaseController {
         return succeed(classGroupService.addHighClassGroup(highClassGroupDtoList));
     }
 
-    @ApiOperation(value = "删除班级")
-    @PostMapping("/del/{id}")
-    public Object del(@ApiParam(value = "班级编号", required = true) @PathVariable("id") Integer id) {
-        classGroupService.delete(id);
+    @ApiOperation(value = "删除单技班")
+    @PostMapping("/delSingle")
+    public Object delSingle(Integer classGroupId) {
+        classGroupService.delSingle(classGroupId);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除合奏班")
+    @PostMapping("/delMix")
+    public Object delMix(Integer classGroupId) {
+        classGroupService.delMix(classGroupId);
         return succeed();
     }
 

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

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;