Kaynağa Gözat

Merge branch 'mec_update_2021-11-02' of http://git.dayaedu.com/yonge/mec

zouxuan 4 yıl önce
ebeveyn
işleme
9be94f86e3
38 değiştirilmiş dosya ile 933 ekleme ve 258 silme
  1. 10 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ActivityUserMapperDao.java
  2. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/EmployeeInfoDao.java
  3. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysUserCashAccountLogDao.java
  4. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GoodsSellDto.java
  5. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/EmployeeInfo.java
  6. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicMemberDto.java
  7. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysUserCashAccountDetail.java
  8. 274 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysUserCashAccountLog.java
  9. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysUserCoursesAccountDetail.java
  10. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicMemberQueryInfo.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ActivityUserMapperService.java
  12. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/EmployeeInfoService.java
  13. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  14. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/SysUserCashAccountService.java
  15. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ActivityUserMapperServiceImpl.java
  16. 20 20
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  17. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  18. 6 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeInfoServiceImpl.java
  19. 9 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java
  20. 21 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java
  21. 45 97
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  22. 85 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  23. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java
  24. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysUserCashAccountServiceImpl.java
  25. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java
  26. 44 34
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  27. 3 0
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml
  28. 3 0
      mec-biz/src/main/resources/config/mybatis/EmployeeInfoMapper.xml
  29. 7 1
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  30. 6 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  31. 3 0
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  32. 180 0
      mec-biz/src/main/resources/config/mybatis/SysUserCashAccountLogMapper.xml
  33. 10 3
      mec-biz/src/main/resources/config/mybatis/SysUserCoursesAccountDetailMapper.xml
  34. 14 0
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeInfoController.java
  35. 52 52
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  36. 24 1
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java
  37. 16 10
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  38. 2 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/CourseHomeworkController.java

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

@@ -67,22 +67,22 @@ public interface ActivityUserMapperDao extends BaseDAO<Integer, ActivityUserMapp
     void batchInsert(@Param("activityUserMappers") List<ActivityUserMapper> activityUserMappers);
 
     /**
-    * @description:
+     * @description:
      * @param groupId
  * @param groupType
     * @return com.ym.mec.biz.dal.entity.ActivityUserMapper
-    * @author zx
-    * @date 2021/10/22 17:36
-    */
-    ActivityUserMapper findVipUserMapper(@Param("groupId") Long groupId, @Param("groupType") String groupType);
+     */
+    ActivityUserMapper findVipUserMapper(@Param("groupId") Long groupId,
+                                         @Param("groupType") String groupType,
+                                         @Param("studentId") Integer studentId);
 
     /**
-    * @description: 修改指导老师
+     * @description: 修改指导老师
      * @param userId
      * @param teacherId
-    * @return void
-    * @author zx
-    * @date 2021/11/1 16:21
-    */
+     * @return void
+     * @author zx
+     * @date 2021/11/1 16:21
+     */
     void updateTeacherId(@Param("userId") Integer userId, @Param("teacherId") Integer teacherId);
 }

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

@@ -7,4 +7,6 @@ import com.ym.mec.common.dal.BaseDAO;
 public interface EmployeeInfoDao extends BaseDAO<Long, EmployeeInfo> {
 
 	EmployeeInfoDto queryDetail(Long id);
+
+    EmployeeInfo findByPhone(String mobileNo);
 }

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

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

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/GoodsSellDto.java

@@ -24,13 +24,24 @@ public class GoodsSellDto{
 	@ApiModelProperty(value = "商品销售价", required = false)
 	private BigDecimal goodsPrice = BigDecimal.ZERO;
 
+	@ApiModelProperty(value = "商品团购价", required = false)
+	private BigDecimal goodsGroupPrice = BigDecimal.ZERO;
+
 	@ApiModelProperty(value = "商品销售总价", required = false)
 	private BigDecimal totalGoodsPrice = BigDecimal.ZERO;
 
     @ApiModelProperty(value = "辅件商品列表", required = false)
     private String complementGoodsIdList;
 
-    public String getComplementGoodsIdList() {
+	public BigDecimal getGoodsGroupPrice() {
+		return goodsGroupPrice;
+	}
+
+	public void setGoodsGroupPrice(BigDecimal goodsGroupPrice) {
+		this.goodsGroupPrice = goodsGroupPrice;
+	}
+
+	public String getComplementGoodsIdList() {
         return complementGoodsIdList;
     }
 

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

@@ -134,6 +134,17 @@ public class EmployeeInfo {
 	/**  */
 	private java.util.Date updateTime;
 
+	@ApiModelProperty(value = "是否覆盖", required = false)
+	private Boolean isCover = false;
+
+	public Boolean getCover() {
+		return isCover;
+	}
+
+	public void setCover(Boolean cover) {
+		isCover = cover;
+	}
+
 	public String getHrbpName() {
 		return hrbpName;
 	}

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicMemberDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
+import io.swagger.annotations.ApiModelProperty;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -29,6 +31,17 @@ public class MusicMemberDto {
 
 	private Boolean hasNoStartCloudTeacher;
 
+	@ApiModelProperty(value = "0已过期,1即将过期,2待生效", required = false)
+	private Integer hasMember;
+
+	public Integer getHasMember() {
+		return hasMember;
+	}
+
+	public void setHasMember(Integer hasMember) {
+		this.hasMember = hasMember;
+	}
+
 	public Boolean getHasNoStartCloudTeacher() {
 		return hasNoStartCloudTeacher;
 	}

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

@@ -90,6 +90,17 @@ public class SysUserCashAccountDetail {
 
 	private String organName;
 
+	/** vip课程后台添加学员时关联的id */
+	private Long groupId;
+
+	public Long getGroupId() {
+		return groupId;
+	}
+
+	public void setGroupId(Long groupId) {
+		this.groupId = groupId;
+	}
+
 	public String getOrganName() {
 		return organName;
 	}

+ 274 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysUserCashAccountLog.java

@@ -0,0 +1,274 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.TransTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.math.BigDecimal;
+
+/**
+ * 对应数据库表(sys_user_cash_account_log):
+ */
+public class SysUserCashAccountLog {
+
+	/** 序号 */
+	@ApiModelProperty(value = "序号",required = false)
+	private Long id;
+
+	/** 用户编号 */
+	@ApiModelProperty(value = "用户编号",required = false)
+	private Integer userId;
+
+	@ApiModelProperty(value = "手机号",required = false)
+	private String phone;
+
+	@ApiModelProperty(value = "姓名",required = false)
+	private String username;
+
+	@ApiModelProperty(value = "声部",required = false)
+	private String subjectName;
+
+	/** 交易流水号 */
+	@ApiModelProperty(value = "交易流水号",required = false)
+	private String transNo;
+
+	/** 交易类型 (RECHARGE 充值,WITHDRAW 提现,PAY_FEE 缴费,REFUNDS 退费,FILL_ACCOUNT 人工补账) */
+	@ApiModelProperty(value = "交易类型",required = false)
+	private PlatformCashAccountDetailTypeEnum type;
+
+	/** 交易方式1.微信,2支付宝,3快捷*/
+	@ApiModelProperty(value = "交易方式",required = false)
+	private TransTypeEnum transType;
+
+	/** 交易状态(1,交易中;2,成功交易;-1,交易失败;) */
+	@ApiModelProperty(value = "交易状态",required = false)
+	private DealStatusEnum status;
+
+	/** 交易金额 */
+	@ApiModelProperty(value = "交易金额",required = false)
+	private BigDecimal amount;
+
+	/** 公户金额 */
+	@ApiModelProperty(value = "公户金额",required = false)
+	private BigDecimal comAmount;
+
+	/** 私户金额 */
+	@ApiModelProperty(value = "私户金额",required = false)
+	private BigDecimal perAmount;
+
+	/** 账户可用余额 */
+	@ApiModelProperty(value = "账户可用余额",required = false)
+	private BigDecimal balance;
+
+	/** 描述 */
+	@ApiModelProperty(value = "描述",required = false)
+	private String description;
+
+	/** 后台备注 */
+	@ApiModelProperty(value = "后台备注",required = false)
+	private String comment;
+
+	/** 创建时间 */
+	private java.util.Date createTime;
+
+	/** 修改时间 */
+	private java.util.Date updateTime;
+
+	private String attribute;
+
+	/** 描述 */
+	@ApiModelProperty(value = "支付渠道",required = false)
+	private String channel;
+
+	/** 备注 */
+	@ApiModelProperty(value = "平台账户号",required = false)
+	private String platformAccountNo;
+
+	private String organName;
+
+	/** vip课程后台添加学员时关联的id */
+	private Long groupId;
+
+	public Long getGroupId() {
+		return groupId;
+	}
+
+	public void setGroupId(Long groupId) {
+		this.groupId = groupId;
+	}
+
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
+	public String getPhone() {
+		return phone;
+	}
+
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	public String getAttribute() {
+		return attribute;
+	}
+
+	public void setAttribute(String attribute) {
+		this.attribute = attribute;
+	}
+
+	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 setTransNo(String transNo){
+		this.transNo = transNo;
+	}
+
+	public String getTransNo(){
+		return this.transNo;
+	}
+
+	public PlatformCashAccountDetailTypeEnum getType() {
+		return type;
+	}
+
+	public void setType(PlatformCashAccountDetailTypeEnum type) {
+		this.type = type;
+	}
+
+	public DealStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(DealStatusEnum status) {
+		this.status = status;
+	}
+
+	public BigDecimal getAmount() {
+		return amount;
+	}
+
+	public void setAmount(BigDecimal amount) {
+		this.amount = amount;
+	}
+
+	public BigDecimal getBalance() {
+		return balance;
+	}
+
+	public void setBalance(BigDecimal balance) {
+		this.balance = balance;
+	}
+
+	public void setDescription(String description){
+		this.description = description;
+	}
+
+	public String getDescription(){
+		return this.description;
+	}
+
+	public void setComment(String comment){
+		this.comment = comment;
+	}
+
+	public String getComment(){
+		return this.comment;
+	}
+
+	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;
+	}
+
+	public TransTypeEnum getTransType() {
+		return transType;
+	}
+
+	public void setTransType(TransTypeEnum transType) {
+		this.transType = transType;
+	}
+
+	public String getChannel() {
+		return channel;
+	}
+
+	public void setChannel(String channel) {
+		this.channel = channel;
+	}
+
+	public String getPlatformAccountNo() {
+		return platformAccountNo;
+	}
+
+	public void setPlatformAccountNo(String platformAccountNo) {
+		this.platformAccountNo = platformAccountNo;
+	}
+
+	public BigDecimal getComAmount() {
+		return comAmount;
+	}
+
+	public void setComAmount(BigDecimal comAmount) {
+		this.comAmount = comAmount;
+	}
+
+	public BigDecimal getPerAmount() {
+		return perAmount;
+	}
+
+	public void setPerAmount(BigDecimal perAmount) {
+		this.perAmount = perAmount;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+}

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

@@ -67,6 +67,17 @@ public class SysUserCoursesAccountDetail {
 
 	private String organName;
 
+	/** vip课程后台添加学员时关联的id */
+	private Long groupId;
+
+	public Long getGroupId() {
+		return groupId;
+	}
+
+	public void setGroupId(Long groupId) {
+		this.groupId = groupId;
+	}
+
 	public String getOrganName() {
 		return organName;
 	}

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicMemberQueryInfo.java

@@ -7,8 +7,8 @@ import java.util.Date;
 
 public class MusicMemberQueryInfo extends QueryInfo {
 
-	@ApiModelProperty(value = "0已过期,1即将过期", required = false)
-	private Integer hasMember;
+	@ApiModelProperty(value = "0已过期,1即将过期,2待生效", required = false)
+	private Integer hasMember = 0;
 
 	private String memberEndAutoQuitMusic;
 

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

@@ -67,5 +67,5 @@ public interface ActivityUserMapperService extends BaseService<Integer, Activity
     * @author zx
     * @date 2021/10/22 17:35
     */
-    ActivityUserMapper findVipUserMapper(Long groupId,String groupType);
+    ActivityUserMapper findVipUserMapper(Long groupId,String groupType,Integer studentId);
 }

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

@@ -7,4 +7,6 @@ import com.ym.mec.common.service.BaseService;
 public interface EmployeeInfoService extends BaseService<Long, EmployeeInfo> {
 
 	EmployeeInfoDto queryDetail(Long id);
+
+    EmployeeInfo findByPhone(String mobileNo);
 }

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

@@ -420,4 +420,13 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	* @date 2021/10/20 10:39
 	*/
 	HttpResponseResult buyDoubleEleven2021(BuyDoubleEleven2021Dto buyDoubleEleven2021Dto) throws Exception;
+
+	/**
+	* @description: 获取学生指定网管课的剩余课时费用
+	 * @param practiceGroupId
+	* @return java.lang.Object
+	* @author zx
+	* @date 2021/11/2 18:07
+	*/
+	Map<String,BigDecimal> getStudentSurplusCourseFee(Long practiceGroupId);
 }

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

@@ -64,7 +64,7 @@ public interface SysUserCashAccountService extends BaseService<Integer, SysUserC
 	 * @param description:
 	 * @return void
 	 */
-	void subtractFromCourseBalanceAndBalance(Integer userId, BigDecimal decimal, PlatformCashAccountDetailTypeEnum type, String description);
+	void subtractFromCourseBalanceAndBalance(Integer userId, BigDecimal decimal, PlatformCashAccountDetailTypeEnum type, String description,Long vipGroupId);
 
 	/**
 	 * 将课程余额转入到可用余额

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

@@ -47,7 +47,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
     }
 
 	@Override
-	public ActivityUserMapper findVipUserMapper(Long groupId, String groupType) {
-		return activityUserMapperDao.findVipUserMapper(groupId,groupType);
+	public ActivityUserMapper findVipUserMapper(Long groupId, String groupType,Integer studentId) {
+		return activityUserMapperDao.findVipUserMapper(groupId,groupType,studentId);
 	}
 }

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

@@ -668,7 +668,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							}
 							Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 							if(vipGroupActivityId != null){
-								ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+								ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 								if(activityUserMapper != null){
 									Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, cgtm.getUserId());
 									if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){
@@ -2794,7 +2794,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					Integer allowOnlineToOffline = 0;
 					if(Objects.nonNull(vipGroupActivity)){
 						allowOnlineToOffline = vipGroupActivity.getAllowOnlineToOffline();
-						ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP");
+						ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP",null);
 						if(activityUserMapper != null){
 							if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 								allowOnlineToOffline = vipGroupActivity.getGiveAllowOnlineToOffline();
@@ -3009,7 +3009,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				Integer allowOnlineToOffline = 0;
 				if(Objects.nonNull(vipGroupActivity)){
 					allowOnlineToOffline = vipGroupActivity.getAllowOnlineToOffline();
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP",null);
 					if(activityUserMapper != null){
 						if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 							allowOnlineToOffline = vipGroupActivity.getGiveAllowOnlineToOffline();
@@ -3463,7 +3463,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				Integer allowOnlineToOffline = 0;
 				if(Objects.nonNull(vipGroupActivity)){
 					allowOnlineToOffline = vipGroupActivity.getAllowOnlineToOffline();
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(), "VIP",null);
 					if(activityUserMapper != null){
 						if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 							allowOnlineToOffline = vipGroupActivity.getGiveAllowOnlineToOffline();
@@ -3810,7 +3810,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, teacherId, ts.getCourseScheduleId());
 							BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 							//是否是赠送课程
-							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP");
+							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP",null);
 							if(activityUserMapper != null){
 								if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 									teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -3839,7 +3839,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 							if(practiceGroup != null){
 								Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 								if(vipGroupActivityId != null){
-									ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+									ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 									if(activityUserMapper != null){
 										Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, ts.getUserId());
 										if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){
@@ -4044,7 +4044,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(byCourseSchedule, newCourseSchedule.getActualTeacherId(), newCourseSchedule.getId());
 					BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 					//是否是赠送课程
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(byCourseSchedule.getId(),"VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(byCourseSchedule.getId(),"VIP",null);
 					if(activityUserMapper != null){
 						if(byCourseSchedule.getId().equals(activityUserMapper.getGiveVipGroupId())){
 							teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -4906,24 +4906,24 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Map<String, Object> params = new HashMap<>(16);
         MapUtil.populateMap(params, queryInfo);
 
-        List<CourseScheduleEndDto> results;
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
+//        List<CourseScheduleEndDto> results;
+//		SysUser sysUser = sysUserFeignService.queryUserInfo();
+//		List<Integer> userRole = employeeDao.queryUserRole(sysUser.getId());
 		//如果当前用户只有教务老师角色,那么只能看到他所管理的课程组的信息
-		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
-			List<Long> classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
-			if(classGroupIds.size() == 0){
-				return pageInfo;
-			}
-			params.put("classGroupIds",classGroupIds);
-		}
+//		if (!sysUser.getIsSuperAdmin() && userRole.size() == 1 && userRole.contains(SysUserRole.EDUCATIONAL_TEACHER)) {
+//			List<Long> classGroupIds = classGroupDao.queryGroupClassGroupIds(sysUser.getId());
+//			if(classGroupIds.size() == 0){
+//				return pageInfo;
+//			}
+//			params.put("classGroupIds",classGroupIds);
+//		}
         int count = courseScheduleDao.endCountCourseSchedules(params);
         if(queryInfo.getIsExport() && count > 50000){
             throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
         }
 		pageInfo.setTotal(count);
 		params.put("offset", pageInfo.getOffset());
-		results = courseScheduleDao.endFindCourseSchedules(params);
+		List<CourseScheduleEndDto> results = courseScheduleDao.endFindCourseSchedules(params);
         if (!CollectionUtils.isEmpty(results)) {
             List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
             List<Integer> teacherIds=results.stream().filter(t->Objects.nonNull(t.getActualTeacherId())).map(CourseSchedule::getActualTeacherId).collect(Collectors.toList());
@@ -5131,7 +5131,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if(practiceGroup != null){
 			Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 			if(vipGroupActivityId != null){
-				ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+				ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 				if(activityUserMapper != null){
 					Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, teacherId);
 					if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){
@@ -5255,7 +5255,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					if(practiceGroup != null){
 						Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
 						if(vipGroupActivityId != null){
-							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+							ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
 							if(activityUserMapper != null){
 								Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, teacherId);
 								if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){

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

@@ -931,7 +931,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByGroupWithNotStart(vipGroupId.toString(), GroupType.VIP.getCode());
         if(!CollectionUtils.isEmpty(courseScheduleTeacherSalaries)){
             //是否是赠送课程
-            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP");
+            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP",null);
             Map<String, BigDecimal> salary = vipGroupService.countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
             for(int i=0;i<courseScheduleTeacherSalaries.size();i++){
                 if(!courseScheduleTeacherSalaries.get(i).getEnableChangeSalary()){
@@ -1413,7 +1413,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     private void createVipGroupCourseTeacherSalaries(CourseSchedule courseSchedule, List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries){
         VipGroup vipGroup = vipGroupService.get(Long.valueOf(courseSchedule.getMusicGroupId()));
         //是否是赠送课程
-        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP");
+        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(vipGroup.getId(),"VIP",null);
         for (CourseScheduleTeacherSalary courseScheduleTeacherSalary : courseScheduleTeacherSalaries) {
             Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee1(vipGroup, courseSchedule.getActualTeacherId(), courseSchedule.getId());
             BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
@@ -1465,7 +1465,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 if(practiceGroup != null){
                     Integer vipGroupActivityId = practiceGroup.getVipGroupActivityId();
                     if(vipGroupActivityId != null){
-                        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+                        ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
                         if(activityUserMapper != null){
                             Map<String, BigDecimal> map = practiceGroupService.countPracticeGroupPredictFee1(practiceGroup, courseScheduleTeacherSalary.getUserId());
                             if(practiceGroup.getId().equals(activityUserMapper.getPracticeGroupId())){

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

@@ -25,5 +25,10 @@ public class EmployeeInfoServiceImpl extends BaseServiceImpl<Long, EmployeeInfo>
 	public EmployeeInfoDto queryDetail(Long id) {
 		return employeeInfoDao.queryDetail(id);
 	}
-	
+
+    @Override
+    public EmployeeInfo findByPhone(String mobileNo) {
+		return employeeInfoDao.findByPhone(mobileNo);
+    }
+
 }

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -309,7 +309,7 @@ public class ExportServiceImpl implements ExportService {
             }
             row.setPaymentChannel(paymentChannel);
             row.setId(i);
-            row.setRepairFee(row.getRepairFee().add(row.getMaintenanceFee()).add(row.getMaintenanceProductFee()));
+            row.setRepairFee(row.getRepairFee().add(row.getMaintenanceProductFee()));
             row.setOrderAmount(row.getExpectAmount().add(row.getCouponRemitFee()));
             i++;
         }
@@ -321,11 +321,11 @@ public class ExportServiceImpl implements ExportService {
         HSSFWorkbook workbook = null;
         try {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额",
-                    "乐团课", "VIP课", "网管课", "乐理课", "考级", "维修费用", "云教练", "押金", "乐器", "教辅费用", "上门费",
+                    "乐团课", "VIP课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费",
                     "账户充值", "其它", "手续费", "到账时间",
                     "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount",  "couponRemitFee",
-                    "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "cloudTeacherFee",
+                    "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee",
                     "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee", "otherFee", "transferFee", "payTime", "musicGroupId",
                     "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
             workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);
@@ -677,7 +677,7 @@ public class ExportServiceImpl implements ExportService {
                     order.setRepairFee(order.getMaintenanceProductFee());
                     continue;
                 } else if (order.getSaleAmount().compareTo(BigDecimal.ZERO) == 0 && order.getServiceAmount().compareTo(BigDecimal.ZERO) > 0) {
-                    order.setRepairFee(order.getRepairFee().add(order.getMaintenanceFee()));
+                    order.setRepairFee(order.getRepairFee());
                     order.setCloudTeacherFee(order.getCloudTeacherFee());
                     order.setMusicalFee(BigDecimal.ZERO);
                     order.setTeachingFee(BigDecimal.ZERO);
@@ -778,7 +778,7 @@ public class ExportServiceImpl implements ExportService {
                 order.setPracticeCourseFee(practiceCourseFee);
                 order.setTheoryCourseFee(theoryCourseFee);
                 order.setDegreeFee(degreeFee);
-                order.setRepairFee(repairFee.add(maintenanceFee).add(maintenanceProductFee).add(repairFee));
+                order.setRepairFee(repairFee.add(maintenanceProductFee));
                 order.setMaintenanceFee(maintenanceFee);
                 order.setMaintenanceProductFee(maintenanceProductFee);
                 order.setLeaseFee(leaseFee);
@@ -798,11 +798,13 @@ public class ExportServiceImpl implements ExportService {
 
         HSSFWorkbook workbook = null;
         try {
-            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课", "网管课", "乐理课", "考级", "维修费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "手续费", "到账时间",
+            String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额",
+                    "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课", "网管课", "乐理课",
+                    "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "手续费", "到账时间",
                     "关联乐团ID/VIP课ID", "课程形态", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount"
                     , "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee",
-                    "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee",
+                    "musicGroupCourseFee", "vipCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee",
                     "rechargeFee", "otherFee", "transferFee", "payTime", "musicGroupId",
                     "groupType.desc", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"};
             workbook = POIUtil.exportExcel(header, body, studentPaymentOrderExportDtos);

+ 21 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java

@@ -57,7 +57,7 @@ public class GroupClassServiceImpl implements GroupClassService {
     @Autowired
     private SysUserCashAccountService sysUserCashAccountService;
     @Autowired
-    private StudentPaymentOrderDao studentPaymentOrderDao;
+    private SysUserCashAccountLogDao sysUserCashAccountLogDao;
     @Autowired
     private CoursesGroupDao coursesGroupDao;
     @Autowired
@@ -173,17 +173,30 @@ public class GroupClassServiceImpl implements GroupClassService {
             if (!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL) || practiceGroup.getCoursesExpireDate().before(now)) {
                 throw new BizException("当前课程组不可关闭");
             }
-            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE");
+            if(Objects.isNull(returnFeeDto.getAmount())){
+                throw new BizException("请确定退费金额");
+            }
+            if (Objects.nonNull(returnFeeDto.getAmount()) && returnFeeDto.getAmount().compareTo(BigDecimal.ZERO) > 0) {
+                Map<String, BigDecimal> studentSurplusCourseFee = practiceGroupService.getStudentSurplusCourseFee(groupId);
+                BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
+                if(returnFeeDto.getAmount().compareTo(suplusCourseFee) > 0){
+                    throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
+                }
+                SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+                sysUserCashAccountLog.setUserId(practiceGroup.getStudentId());
+                sysUserCashAccountLog.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+                sysUserCashAccountLog.setStatus(DealStatusEnum.SUCCESS);
+                sysUserCashAccountLog.setAmount(returnFeeDto.getAmount());
+                sysUserCashAccountLog.setAttribute(practiceGroup.getStudentId().toString());
+                sysUserCashAccountLog.setDescription("后台关闭网管课");
+                sysUserCashAccountLog.setComment(groupId.toString());
+                sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
+            }
+            ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(practiceGroup.getId(),"PRACTICE",null);
             HttpResponseResult result = quitActivityGive(activityUserMapper, returnFeeDto.getConfirmReturnActivityGive(), practiceGroup.getId(),GroupType.PRACTICE);
             if(result.getCode() != 200){
                 return result;
             }
-//            if (Objects.nonNull(refundAmount) && refundAmount.compareTo(BigDecimal.ZERO) > 0) {
-//                if (refundAmount.compareTo(orders.get(0).getExpectAmount()) > 0) {
-//                    throw new BizException("退款不可大于购买金额");
-//                }
-//                sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后台关闭网管课");
-//            }
             cleanGroupInfo(groupId.toString(), GroupType.PRACTICE);
             practiceGroup.setMemo("后台关闭网管课");
             practiceGroup.setGroupStatus(GroupStatusEnum.CANCEL);

+ 45 - 97
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -29,6 +29,8 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,47 +44,6 @@ import com.alibaba.fastjson.TypeReference;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.ChargeTypeDao;
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
-import com.ym.mec.biz.dal.dao.CooperationOrganDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
-import com.ym.mec.biz.dal.dao.GoodsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
-import com.ym.mec.biz.dal.dao.MusicGroupQuitDao;
-import com.ym.mec.biz.dal.dao.MusicGroupSchoolTermCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupSchoolTermStudentCourseDetailDao;
-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.OrganizationCloudTeacherFeeDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.SchoolDao;
-import com.ym.mec.biz.dal.dao.SporadicChargeInfoDao;
-import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.StudentInstrumentDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
-import com.ym.mec.biz.dal.dao.StudentPreRegistrationDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.StudentVisitDao;
-import com.ym.mec.biz.dal.dao.SubjectChangeDao;
-import com.ym.mec.biz.dal.dao.SubjectDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.CloseMusicGroupDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleTeachersDto;
@@ -96,48 +57,10 @@ import com.ym.mec.biz.dal.dto.StudentApplyInstrumentDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
 import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
 import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
-import com.ym.mec.biz.dal.entity.ApprovalStatus;
-import com.ym.mec.biz.dal.entity.ChargeType;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
-import com.ym.mec.biz.dal.entity.CooperationOrgan;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.ImGroup;
-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.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPurchaseList;
-import com.ym.mec.biz.dal.entity.MusicGroupQuit;
-import com.ym.mec.biz.dal.entity.MusicGroupReturnFeeDto;
-import com.ym.mec.biz.dal.entity.MusicGroupSchoolTermCourseDetail;
-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.MusicMemberDto;
-import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
-import com.ym.mec.biz.dal.entity.School;
-import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
-import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.entity.StudentInstrument;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.StudentPreRegistration;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.dal.entity.Subject;
-import com.ym.mec.biz.dal.entity.SubjectChange;
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
-import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
@@ -355,6 +278,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private StudentInstrumentDao studentInstrumentDao;
 
     @Autowired
+    private SysUserCashAccountLogDao sysUserCashAccountLogDao;
+
+    @Autowired
     private CloudTeacherOrderService cloudTeacherOrderService;
 
     @Autowired
@@ -642,17 +568,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (musicGroup == null) {
             throw new BizException("乐团信息查询失败");
         }
-        if (musicGroup.getStatus() != MusicGroupStatusEnum.PRE_APPLY) {
-            throw new BizException("操作失败:只有乐团在[{}]状态才能操作", MusicGroupStatusEnum.PRE_APPLY.getMsg());
-        }
-
-        List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
-        Map<Integer, String> receiverList = studentPreRegistrationList.stream().collect(Collectors.toMap(StudentPreRegistration::getUserId, StudentPreRegistration::getPhone));
+        if (musicGroup.getStatus() == MusicGroupStatusEnum.PRE_APPLY || musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
+            Map<Integer, String> receiverList = null;
+            if(musicGroup.getStatus() == MusicGroupStatusEnum.PRE_APPLY){
+                List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationDao.queryByMusicGroupId(musicGroupId);
+                receiverList = studentPreRegistrationList.stream().collect(Collectors.toMap(StudentPreRegistration::getUserId, StudentPreRegistration::getPhone));
+            }else {
+                receiverList = MapUtil.convertMybatisMap(studentRegistrationDao.findMapByMusicGroupId(musicGroupId, 2));
+            }
 
-        String meetingDateStr = sdf_ymdhms.format(meetingDate);
-        sysMessageService.batchSendImGroupMessage(MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
-        sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
-        return true;
+            String meetingDateStr = sdf_ymdhms.format(meetingDate);
+            sysMessageService.batchSendImGroupMessage(MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, userId + "", null, new String[]{musicGroupId}, null, meetingDateStr, address);
+            sysMessageService.batchSendMessage(MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE, receiverList, null, 1, null, null, meetingDateStr, address);
+            return true;
+        }
+        return false;
     }
 
     @Override
@@ -2491,6 +2421,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
 
             if (amount.doubleValue() > 0) {
+                SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+                sysUserCashAccountLog.setUserId(userId);
+                sysUserCashAccountLog.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+                sysUserCashAccountLog.setStatus(DealStatusEnum.SUCCESS);
+                sysUserCashAccountLog.setAmount(amount);
+                sysUserCashAccountLog.setAttribute(userId.toString());
+                sysUserCashAccountLog.setDescription("退出乐团");
+                sysUserCashAccountLog.setComment(musicGroupId);
+                sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
                 // 增加交易流水
 //                sysUserCashAccountDetailService.addCashAccountDetail(userId, amount, SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "",
 //                        PlatformCashAccountDetailTypeEnum.REFUNDS, null, SUCCESS, "退出乐团", null);
@@ -2805,6 +2744,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         if (amount.doubleValue() > 0) {
+            SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+            sysUserCashAccountLog.setUserId(userId);
+            sysUserCashAccountLog.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+            sysUserCashAccountLog.setStatus(DealStatusEnum.SUCCESS);
+            sysUserCashAccountLog.setAmount(amount);
+            sysUserCashAccountLog.setAttribute(userId.toString());
+            sysUserCashAccountLog.setDescription("退出乐团");
+            sysUserCashAccountLog.setComment(musicGroupId);
+            sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
             // 增加交易流水
 //            sysUserCashAccountDetailService.addCashAccountDetail(userId, amount, SysUserCashAccountDetailService.MUSIC_GROUP + musicGroupId, "",
 //                    PlatformCashAccountDetailTypeEnum.REFUNDS, null, SUCCESS, "退出乐团", null);
@@ -3944,14 +3892,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = musicGroupDao.queryMusicMemberList(params);
-            List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
-            String musicGroupId = dataList.get(0).getMusicGroupId();
+//            List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
+//            String musicGroupId = dataList.get(0).getMusicGroupId();
             //查询云教练订单
-            List<CloudTeacherOrder> studentCloudTeacherOrders = cloudTeacherOrderService.getStudentCloudTeacherOrders(collect,musicGroupId);
-            Map<Integer, List<CloudTeacherOrder>> studentCloudTeacherMap = studentCloudTeacherOrders.stream().collect(Collectors.groupingBy(CloudTeacherOrder::getStudentId));
-            Date date = new Date();
-            Map<Long,String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(new HashSet<>(collect),true));
-            dataList.forEach(e->{
+//            List<CloudTeacherOrder> studentCloudTeacherOrders = cloudTeacherOrderService.getStudentCloudTeacherOrders(collect,musicGroupId);
+//            Map<Integer, List<CloudTeacherOrder>> studentCloudTeacherMap = studentCloudTeacherOrders.stream().collect(Collectors.groupingBy(CloudTeacherOrder::getStudentId));
+//            Date date = new Date();
+//            Map<Long,String> cloudMap = MapUtil.convertMybatisMap(cloudTeacherOrderService.queryNoStartByUserIds(new HashSet<>(collect),true));
+            /*dataList.forEach(e->{
                 //如果会员已过期、是否有未生效的会员
                 if(e.getMembershipEndTime() == null || date.after(e.getMembershipEndTime())){
                     String s = cloudMap.get(e.getUserId().longValue());
@@ -3972,7 +3920,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                         e.setCloudTeacherAmount(cloudAmount);
                     }
                 }
-            });
+            });*/
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 85 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -149,6 +149,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     private RedisCache<String, Object> redisCache;
     @Autowired
     private LuckDrawCountService luckDrawCountService;
+    @Autowired
+    private VipGroupDao vipGroupDao;
+    @Autowired
+    private VipGroupCategoryDao vipGroupCategoryDao;
 
     private static Map<Integer, Map<Integer, List<Integer>>> schoolSubjectTeachersMap;
 
@@ -5791,4 +5795,85 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         studentPaymentOrderService.update(studentPaymentOrder);
         return BaseController.succeed(payMap);
     }
+
+    @Override
+    public Map<String, BigDecimal> getStudentSurplusCourseFee(Long practiceGroupId) {
+        if(Objects.isNull(practiceGroupId)){
+            throw new BizException("请指定课程");
+        }
+        PracticeGroup practiceGroup = practiceGroupDao.get(practiceGroupId);
+        if(Objects.isNull(practiceGroup)){
+            throw new BizException("未找到指定网管课");
+        }
+        Integer studentId = practiceGroup.getStudentId();
+        if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)){
+            throw new BizException("只有进行中的网管课可以关闭");
+        }
+        Map<String,BigDecimal> result = new HashMap<>();
+        Date now = new Date();
+        BigDecimal bigDecimal;
+        List<StudentCourseInfoDto> userCourseInfos = new ArrayList<>();
+        VipGroupCategory vipGroupCategory = null;
+        //是否关联活动
+        if(practiceGroup.getVipGroupActivityId() != null){
+            ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(practiceGroupId,"PRACTICE", studentId);
+            if(activityUserMapper != null && !activityUserMapper.getReturnFee()){
+                if(Objects.nonNull(activityUserMapper.getVipGroupId())){
+                    VipGroup group = vipGroupDao.get(activityUserMapper.getVipGroupId());
+                    vipGroupCategory = vipGroupCategoryDao.get(group.getVipGroupCategoryId().intValue());
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.VIP, activityUserMapper.getVipGroupId().toString(), studentId, null));
+                }
+                if(Objects.nonNull(activityUserMapper.getGiveVipGroupId())){
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.VIP, activityUserMapper.getGiveVipGroupId().toString(), studentId, null));
+                }
+                if(Objects.nonNull(activityUserMapper.getPracticeGroupId())){
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, activityUserMapper.getPracticeGroupId().toString(), studentId, null));
+                }
+                if(Objects.nonNull(activityUserMapper.getGivePracticeGroupId())){
+                    userCourseInfos.addAll(courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, activityUserMapper.getGivePracticeGroupId().toString(), studentId, null));
+                }
+                userCourseInfos.removeAll(Collections.singleton(null));
+            }else {
+                userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, practiceGroupId.toString(), studentId, null);
+            }
+        }else {
+            userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.PRACTICE, practiceGroupId.toString(), studentId, null);
+        }
+
+        if(!CollectionUtils.isEmpty(userCourseInfos)){
+            BigDecimal historyPrice = ZERO;
+            BigDecimal allPrice = ZERO;
+            int overNum = 0;
+            for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
+                allPrice = allPrice.add(userCourseInfo.getExpectPrice());
+                if(now.after(userCourseInfo.getStartClassTime())){
+                    overNum++;
+                    historyPrice = historyPrice.add(userCourseInfo.getOriginalPrice());
+                }
+            }
+            bigDecimal = allPrice.subtract(historyPrice);
+            if(bigDecimal.compareTo(ZERO) < 0){
+                bigDecimal = ZERO;
+            }
+            if(overNum == userCourseInfos.size()){
+                bigDecimal = ZERO;
+            }
+            result.put("suplusCourseOriginalFee", allPrice);
+        }else{
+            bigDecimal = new BigDecimal(0);
+            result.put("suplusCourseOriginalFee", bigDecimal);
+        }
+        ClassGroup classGroup = classGroupDao.findByGroupAndType(practiceGroupId.toString(), "PRACTICE");
+        if(Objects.isNull(classGroup)){
+            throw new BizException("未找到对应班级");
+        }
+
+        if(vipGroupCategory == null || vipGroupCategory.getStudentNum() <= 1){
+            bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+        }else{
+            bigDecimal = bigDecimal.multiply(new BigDecimal(0.7)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+        }
+        result.put("suplusCourseFee", bigDecimal);
+        return result;
+    }
 }

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

@@ -189,21 +189,28 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
         Map<Integer, String> integerStringMap = getMap("goods", "id_", "type_", goodsIds, Integer.class, String.class);
         Map<Integer, BigDecimal> map = getMap("goods", "id_", "discount_price_", goodsIds, Integer.class, BigDecimal.class);
+        Map<Integer, BigDecimal> groupPriceMap = getMap("goods", "id_", "group_purchase_price_", goodsIds, Integer.class, BigDecimal.class);
         for (GoodsSellDto goodsSellDto : goodsSellDtos) {
             goodsSellDto.setGoodsType(integerStringMap.get(goodsSellDto.getGoodsId()));
             if (StringUtils.isNotEmpty(goodsSellDto.getComplementGoodsIdList())) {
                 goodsSellDto.setGoodsSellDtos(goodsService.queryGoodsSellDtos(goodsSellDto.getComplementGoodsIdList()));
             }
             goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
+            goodsSellDto.setGoodsGroupPrice(groupPriceMap.get(goodsSellDto.getGoodsId()));
             goodsSellDto.setTotalGoodsPrice(map.get(goodsSellDto.getGoodsId()).multiply(new BigDecimal(goodsSellDto.getGoodsNum())));
         }
         Map<Integer, List<GoodsSellDto>> goodsMap = goodsSellDtos.stream().collect(Collectors.groupingBy(GoodsSellDto::getGoodsId));
         BigDecimal amount = BigDecimal.ZERO;
+        BigDecimal groupAmount = BigDecimal.ZERO;
         for (Integer id : goodsIds) {
             GoodsSellDto goodsSellDto = goodsMap.get(id).get(0);
             amount = amount.add(goodsSellDto.getTotalGoodsPrice());
+            groupAmount = groupAmount.add(goodsSellDto.getGoodsGroupPrice());
         }
         amount = amount.subtract(studentGoodsSell.getMarketAmount());
+        if(amount.compareTo(groupAmount) < 0){
+            throw new BizException("操作失败:该金额减免后商品价格不可低于商品团购价");
+        }
         if (amount.signum() < 0) {
             throw new BizException("操作失败:订单金额异常");
         }

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

@@ -256,7 +256,7 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
     }
 
     @Override
-    public void subtractFromCourseBalanceAndBalance(Integer userId, BigDecimal decimal, PlatformCashAccountDetailTypeEnum type, String description) {
+    public void subtractFromCourseBalanceAndBalance(Integer userId, BigDecimal decimal, PlatformCashAccountDetailTypeEnum type, String description,Long vipGroupId) {
         SysUserCashAccount cashAccount = sysUserCashAccountDao.getLocked(userId);
         if (cashAccount == null) {
             throw new BizException("用户[{}]现金账户不存在", userId);
@@ -298,6 +298,7 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
         sysUserCoursesAccountDetail.setType(type);
         sysUserCoursesAccountDetail.setUpdateTime(date);
         sysUserCoursesAccountDetail.setCreateTime(date);
+        sysUserCoursesAccountDetail.setGroupId(vipGroupId);
         sysUserCoursesAccountDetailDao.insert(sysUserCoursesAccountDetail);
 
         if(changeMoney.compareTo(BigDecimal.ZERO)==0){
@@ -317,6 +318,7 @@ public class SysUserCashAccountServiceImpl extends BaseServiceImpl<Integer, SysU
         detail.setType(type);
         detail.setUpdateTime(date);
         detail.setUserId(userId);
+        detail.setGroupId(vipGroupId);
         sysUserCashAccountDetailDao.insert(detail);
     }
 

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

@@ -140,7 +140,7 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 					// 批量修改课程课酬
 					List<CourseScheduleTeacherSalary> list = new ArrayList<CourseScheduleTeacherSalary>();
 
-					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(Long.parseLong(updateTeacherSalaryList.get(0).getMusicGroupId()),"VIP");
+					ActivityUserMapper activityUserMapper = activityUserMapperDao.findVipUserMapper(Long.parseLong(updateTeacherSalaryList.get(0).getMusicGroupId()),"VIP",null);
 					for (CourseScheduleTeacherSalary ts : updateTeacherSalaryList) {
 						//课酬调整后不能更新课酬
 						if(!ts.getEnableChangeSalary()){

+ 44 - 34
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -85,6 +85,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     @Autowired
 	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
     @Autowired
+	private SysUserCashAccountLogDao sysUserCashAccountLogDao;
+    @Autowired
 	private ClassGroupTeacherSalaryDao classGroupTeacherSalaryDao;
     @Autowired
 	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
@@ -979,7 +981,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 					vipGroupApplyBaseInfoDto.getUserId(), null);
 			BigDecimal teacherSalary = costInfo.get("offlineTeacherSalary");
 			//是否是赠送课程
-			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(),"VIP");
+			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroupApplyBaseInfoDto.getId(),"VIP",null);
 			if(activityUserMapper != null){
 				if(vipGroupApplyBaseInfoDto.getId().equals(activityUserMapper.getGiveVipGroupId())){
 					teacherSalary = costInfo.get("giveOfflineTeacherSalary");
@@ -2263,7 +2265,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
 
 			//是否是赠送课程
-			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 			if(activityUserMapper != null){
 				if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 					giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
@@ -3105,14 +3107,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 //		sysUserCashAccountService.updateBalance(studentId, amount);
 //		SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
-//		SysUserCashAccountDetail sysUserCashAccountDetail = new SysUserCashAccountDetail();
-//		sysUserCashAccountDetail.setUserId(studentId);
-//		sysUserCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
-//		sysUserCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-//		sysUserCashAccountDetail.setAmount(amount);
-//		sysUserCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
-//		sysUserCashAccountDetail.setAttribute(studentId.toString());
-//		sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
+		//记录日志
+		SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+		sysUserCashAccountLog.setUserId(studentId);
+		sysUserCashAccountLog.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+		sysUserCashAccountLog.setStatus(DealStatusEnum.SUCCESS);
+		sysUserCashAccountLog.setAmount(amount);
+		sysUserCashAccountLog.setAttribute(studentId.toString());
+		sysUserCashAccountLog.setDescription("VIP退课");
+		sysUserCashAccountLog.setComment(vipGroupId.toString());
+		sysUserCashAccountLog.setGroupId(vipGroupId);
+		sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
 
 		classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
 		classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
@@ -3347,7 +3352,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 			BigDecimal teacherSalary = salaryMap.get("offlineTeacherSalary");
 			//是否是赠送课程
-			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+			ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 			if(activityUserMapper != null){
 				if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 					teacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -3593,16 +3598,19 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		studentApplyRefundsDao.update(studentApplyRefunds);
 		switch (studentApplyRefunds.getStatus()) {
 			case DONE:
-				sysUserCashAccountService.updateBalance(studentApplyRefunds.getUserId(), studentApplyRefunds.getActualAmount());
-				SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentApplyRefunds.getUserId().intValue());
-				SysUserCashAccountDetail sysUserCashAccountDetail = new SysUserCashAccountDetail();
-				sysUserCashAccountDetail.setUserId(studentApplyRefunds.getUserId());
-				sysUserCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
-				sysUserCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-				sysUserCashAccountDetail.setAmount(amount);
-				sysUserCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
-				sysUserCashAccountDetail.setAttribute(studentApplyRefunds.getId().toString());
-				sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
+//				sysUserCashAccountService.updateBalance(studentApplyRefunds.getUserId(), studentApplyRefunds.getActualAmount());
+//				SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentApplyRefunds.getUserId().intValue());
+				//记录日志
+				SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+				sysUserCashAccountLog.setUserId(studentApplyRefunds.getUserId());
+				sysUserCashAccountLog.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+				sysUserCashAccountLog.setStatus(DealStatusEnum.SUCCESS);
+				sysUserCashAccountLog.setAmount(amount);
+				sysUserCashAccountLog.setAttribute(studentApplyRefunds.getUserId().toString());
+				sysUserCashAccountLog.setDescription("VIP退课审核");
+				sysUserCashAccountLog.setComment(id.toString());
+				sysUserCashAccountLog.setGroupId(id);
+				sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
 
 				ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(studentPaymentOrder.getClassGroupId(),
 						studentPaymentOrder.getUserId());
@@ -3802,16 +3810,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			if(null==studentPaymentOrder){
 				throw new BizException("无法停止课程,需要全部学员退学后,才能停止,请先操作学员退学。");
 			}
-			sysUserCashAccountService.updateBalance(userId.intValue(),studentSurplusClassFees.get(userId));
-			SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId.intValue());
-			SysUserCashAccountDetail sysUserCashAccountDetail=new SysUserCashAccountDetail();
-			sysUserCashAccountDetail.setUserId(userId.intValue());
-			sysUserCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
-			sysUserCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-			sysUserCashAccountDetail.setAmount(studentSurplusClassFees.get(userId));
-			sysUserCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
-			sysUserCashAccountDetail.setAttribute(studentPaymentOrder.getOrderNo());
-			sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
+//			sysUserCashAccountService.updateBalance(userId.intValue(),studentSurplusClassFees.get(userId));
+//			SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId.intValue());
+			SysUserCashAccountLog sysUserCashAccountLog = new SysUserCashAccountLog();
+			sysUserCashAccountLog.setUserId(userId.intValue());
+			sysUserCashAccountLog.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+			sysUserCashAccountLog.setStatus(DealStatusEnum.SUCCESS);
+			sysUserCashAccountLog.setAmount(studentSurplusClassFees.get(userId));
+			sysUserCashAccountLog.setAttribute(studentPaymentOrder.getOrderNo());
+			sysUserCashAccountLog.setDescription("VIP课关闭");
+			sysUserCashAccountLog.setComment(vipGroupId.toString());
+			sysUserCashAccountLog.setGroupId(vipGroupId);
+			sysUserCashAccountLogDao.insert(sysUserCashAccountLog);
 		}
 
 		vipGroup.setStatus(VipGroupStatusEnum.CANCEL);
@@ -4037,7 +4047,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<String, BigDecimal> map = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 		BigDecimal offlineTeacherSalary = map.get("offlineTeacherSalary");
 		//是否是赠送课程
-		ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+		ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 		if(activityUserMapper != null){
 			if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 				offlineTeacherSalary = map.get("giveOfflineTeacherSalary");
@@ -4181,7 +4191,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				Map<String, BigDecimal> salaryMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId(), null);
 				BigDecimal offlineTeacherSalary = salaryMap.get("offlineTeacherSalary");
 				//是否是赠送课程
-				ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP");
+				ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(),"VIP",null);
 				if(activityUserMapper != null){
 					if(vipGroup.getId().equals(activityUserMapper.getGiveVipGroupId())){
 						offlineTeacherSalary = salaryMap.get("giveOfflineTeacherSalary");
@@ -4282,7 +4292,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				surplusCoursesPrice = surplusCoursesPrice.multiply(discount).setScale(0,BigDecimal.ROUND_CEILING);
 			}
 
-			sysUserCashAccountService.subtractFromCourseBalanceAndBalance(studentId,surplusCoursesPrice.setScale(0,BigDecimal.ROUND_CEILING),PlatformCashAccountDetailTypeEnum.PAY_FEE, "后台添加学员金额扣减");
+			sysUserCashAccountService.subtractFromCourseBalanceAndBalance(studentId,surplusCoursesPrice.setScale(0,BigDecimal.ROUND_CEILING),PlatformCashAccountDetailTypeEnum.PAY_FEE, "后台添加学员金额扣减",vipGroupId);
 
 			List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
 

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

@@ -198,6 +198,9 @@
 		<if test="groupType == 'PRACTICE'">
 			AND (practice_group_id_ = #{groupId} OR give_practice_group_id_ = #{groupId})
 		</if>
+		<if test="studentId != null">
+			AND user_id_ = #{studentId}
+		</if>
 		LIMIT 1
 	</select>
 </mapper>

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

@@ -220,4 +220,7 @@
 		left join sys_user u on u.id_ = ei.operator_id_
         <include refid="queryPageMap"/>
 	</select>
+    <select id="findByPhone" resultMap="EmployeeInfo">
+		SELECT * FROM employee_info WHERE mobile_no_ = #{mobileNo}
+	</select>
 </mapper>

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

@@ -518,7 +518,13 @@
 
 	<sql id="getEduHomeworkListCondition">
 		<where>
-			EXISTS (SELECT user_id_ FROM student_registration sr LEFT JOIN music_group mg ON mg.id_=sr.music_group_id_ WHERE sr.user_id_ = eer.user_id_ AND sr.music_group_status_='NORMAL' AND mg.status_ = 'PROGRESS' AND mg.transaction_teacher_id_=#{transactionTeacherId})
+			EXISTS (SELECT user_id_ FROM student_registration sr
+			LEFT JOIN music_group mg ON mg.id_=sr.music_group_id_
+			WHERE sr.user_id_ = eer.user_id_ AND sr.music_group_status_='NORMAL'
+			AND mg.status_ = 'PROGRESS' AND mg.transaction_teacher_id_=#{transactionTeacherId})
+			<if test="search != null and search != ''">
+				AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_ = #{search})
+			</if>
 			<if test="startTime!=null">
 				AND DATE_FORMAT(ee.create_time_, "%Y-%m-%d") &gt;= DATE_FORMAT(#{startTime}, "%Y-%m-%d")
 			</if>

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

@@ -257,6 +257,9 @@
             <if test="organId != null">
                 AND FIND_IN_SET(organ_id_,#{organId})
             </if>
+            <if test="cooperationOrganId != null">
+                AND cooperation_organ_id_ = #{cooperationOrganId}
+            </if>
             <if test="musicGroupName != null and musicGroupName != ''">
                 AND (name_ LIKE CONCAT('%',#{musicGroupName},'%') OR id_ LIKE CONCAT('%',#{musicGroupName},'%'))
             </if>
@@ -905,10 +908,11 @@
         <result property="phone" column="phone_"/>
         <result property="courseViewType" column="course_view_type_"/>
         <result property="membershipEndTime" column="membership_end_time_"/>
+        <result property="hasMember" column="has_member_"/>
     </resultMap>
     <select id="queryMusicMemberList" resultMap="MusicMemberDto">
         SELECT sr.user_id_,su.username_,su.phone_,o.name_ organ_name_,mg.name_ music_group_name_,mg.course_view_type_,
-        DATEDIFF(sr.membership_end_time_,NOW()) member_day_,sr.music_group_id_,MAX(sv.visit_time_) visit_time_,sr.membership_end_time_
+        DATEDIFF(sr.membership_end_time_,NOW()) member_day_,sr.music_group_id_,MAX(sv.visit_time_) visit_time_,sr.membership_end_time_,#{hasMember} has_member_
         FROM student_registration sr
         LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_
         LEFT JOIN sys_user su ON su.id_ = sr.user_id_
@@ -938,7 +942,7 @@
             </if>
             <if test="hasMember != null">
                 <if test="hasMember == 0">
-                    AND cto.id_ IS NULL AND (sr.membership_end_time_ IS NULL OR sr.membership_end_time_ &lt; NOW())
+                    AND (sr.membership_end_time_ IS NULL OR sr.membership_end_time_ &lt; NOW()) AND cto.id_ IS NULL
                 </if>
                 <if test="hasMember == 1">
                     AND cto.id_ IS NULL AND DATEDIFF(sr.membership_end_time_,NOW()) &lt;= #{memberEndAutoQuitMusic} AND sr.membership_end_time_ > NOW()

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

@@ -500,6 +500,9 @@
             mg.transaction_teacher_id_ = #{transactionTeacherId}
             AND mg.status_ = "PROGRESS"
             AND sr.music_group_status_='NORMAL'
+            <if test="search != null and search != ''">
+                AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.id_ = #{search})
+            </if>
             <if test="startTime!=null">
                 AND cs.class_date_ &gt;= DATE_FORMAT(#{startTime}, "%Y-%m-%d")
             </if>

+ 180 - 0
mec-biz/src/main/resources/config/mybatis/SysUserCashAccountLogMapper.xml

@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.SysUserCashAccountLogDao">
+
+    <resultMap type="com.ym.mec.biz.dal.entity.SysUserCashAccountLog" id="SysUserCashAccountLog">
+        <result column="id_" property="id"/>
+        <result column="user_id_" property="userId"/>
+        <result column="phone_" property="phone"/>
+        <result column="username_" property="username"/>
+        <result column="subject_name_" property="subjectName"/>
+        <result column="trans_no_" property="transNo"/>
+        <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="trans_type_" property="transType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="amount_" property="amount"/>
+        <result column="com_amount_" property="comAmount"/>
+        <result column="per_amount_" property="perAmount"/>
+        <result column="balance_" property="balance"/>
+        <result column="description_" property="description"/>
+        <result column="comment_" property="comment"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <result column="attribute1_" property="attribute"/>
+        <result column="channel_" property="channel"/>
+        <result column="organ_name_" property="organName"/>
+        <result column="platform_account_no_" property="platformAccountNo"/>
+    </resultMap>
+
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="SysUserCashAccountLog">
+        SELECT * FROM sys_user_cash_account_log WHERE id_ = #{id}
+    </select>
+
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="SysUserCashAccountLog">
+        SELECT *
+        FROM sys_user_cash_account_log
+        ORDER BY id_
+    </select>
+
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysUserCashAccountLog" useGeneratedKeys="true"
+            keyColumn="id" keyProperty="id">
+        INSERT INTO sys_user_cash_account_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!=null">id_,</if>
+            <if test="userId!=null">user_id_,</if>
+            <if test="transNo!=null">trans_no_,</if>
+            <if test="type!=null">type_,</if>
+            <if test="transType!=null">trans_type_,</if>
+            <if test="status!=null">status_,</if>
+            <if test="amount!=null">amount_,</if>
+            <if test="comAmount!=null">com_amount_,</if>
+            <if test="perAmount!=null">per_amount_,</if>
+            <if test="balance!=null">balance_,</if>
+            <if test="description!=null">description_,</if>
+            <if test="comment!=null">comment_,</if>
+            create_time_,
+            update_time_,
+            <if test="attribute!=null">attribute1_,</if>
+            <if test="channel!=null">channel_,</if>
+            <if test="platformAccountNo!=null">platform_account_no_,</if>
+        </trim>
+        VALUES
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!=null">#{id},</if>
+            <if test="userId!=null">#{userId},</if>
+            <if test="transNo!=null">#{transNo},</if>
+            <if test="type!=null">#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},</if>
+            <if test="transType!=null">#{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},</if>
+            <if test="status!=null">#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},</if>
+            <if test="amount!=null">#{amount},</if>
+            <if test="comAmount!=null">#{comAmount},</if>
+            <if test="perAmount!=null">#{perAmount},</if>
+            <if test="balance!=null">#{balance},</if>
+            <if test="description!=null">#{description},</if>
+            <if test="comment!=null">#{comment},</if>
+            NOW(),
+            NOW(),
+            <if test="attribute!=null">#{attribute},</if>
+            <if test="channel!=null">#{channel},</if>
+            <if test="platformAccountNo!=null">#{platformAccountNo},</if>
+        </trim>
+    </insert>
+
+    <!-- 根据主键查询一条记录 -->
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysUserCashAccountLog">
+        UPDATE sys_user_cash_account_log
+        <set>
+            <if test="status != null">
+                status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="balance != null">
+                balance_ = #{balance},
+            </if>
+            <if test="comment != null">
+                comment_ = #{comment},
+            </if>
+                update_time_ = NOW(),
+            <if test="amount != null">
+                amount_ = #{amount},
+            </if>
+            <if test="comAmount != null">
+                com_amount_ = #{comAmount},
+            </if>
+            <if test="perAmount != null">
+                per_amount_ = #{perAmount},
+            </if>
+            <if test="description != null">
+                description_ = #{description},
+            </if>
+            <if test="transNo != null">
+                trans_no_ = #{transNo},
+            </if>
+            <if test="type != null">
+                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="transType != null">
+                trans_type_ = #{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="attribute != null">
+                attribute1_ = #{attribute},
+            </if>
+            <if test="channel != null">
+                channel_ = #{channel},
+            </if>
+            <if test="platformAccountNo != null">
+                platform_account_no_ = #{platformAccountNo},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
+
+    <!-- 根据主键删除一条记录 -->
+    <delete id="delete">
+        DELETE FROM sys_user_cash_account_log WHERE id_ = #{id}
+    </delete>
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="SysUserCashAccountLog" parameterType="map">
+        SELECT * FROM sys_user_cash_account_log
+        <where>
+            <if test="userId != null">
+                user_id_ = #{userId}
+            </if>
+            <if test="search != null and search != ''">
+                AND create_time_ LIKE CONCAT(#{search},'%')
+            </if>
+            <if test="channel != null ">
+                AND channel_ NOT IN (#{channel}) OR channel_ IS NULL
+            </if>
+        </where>
+        ORDER BY id_ DESC
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*) FROM sys_user_cash_account_log
+        <where>
+            <if test="userId != null">
+                user_id_ = #{userId}
+            </if>
+            <if test="search != null and search != ''">
+                AND create_time_ LIKE CONCAT(#{search},'%')
+            </if>
+            <if test="channel != null ">
+                AND channel_ NOT IN (#{channel}) OR channel_ IS NULL
+            </if>
+        </where>
+    </select>
+
+</mapper>

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

@@ -26,6 +26,7 @@
 		<result column="channel_" property="channel" />
 		<result column="organ_name_" property="organName" />
 		<result column="platform_account_no_" property="platformAccountNo" />
+		<result column="group_id_" property="groupId" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -40,9 +41,12 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysUserCoursesAccountDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO sys_user_courses_account_detail (id_,user_id_,trans_no_,type_,trans_type_,status_,amount_,balance_,description_,comment_,attribute1_,channel_,platform_account_no_,create_time_,update_time_)
-		VALUES(#{id},#{userId},#{transNo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		       #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{balance},#{description},#{comment},#{attribute1},#{channel},#{platformAccountNo},NOW(),NOW())
+		INSERT INTO sys_user_courses_account_detail (id_,user_id_,trans_no_,type_,trans_type_,status_,amount_,balance_,
+		                                             description_,comment_,attribute1_,channel_,platform_account_no_,create_time_,update_time_,group_id_)
+		VALUES(#{id},#{userId},#{transNo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		       #{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		       #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{balance},#{description},
+		       #{comment},#{attribute1},#{channel},#{platformAccountNo},NOW(),NOW(),#{groupId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -52,6 +56,9 @@
 			<if test="status != null">
 				status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 			</if>
+			<if test="groupId != null">
+				group_id_ = #{groupId},
+			</if>
 			<if test="balance != null">
 				balance_ = #{balance},
 			</if>

+ 14 - 0
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeInfoController.java

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiOperation;
 import java.util.Date;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -45,6 +46,19 @@ public class EmployeeInfoController extends BaseController {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 		}
+        EmployeeInfo info = employeeInfoService.findByPhone(employeeInfo.getMobileNo());
+		if(info != null && !employeeInfo.getCover()){
+		    if(employeeInfo.getCover()){
+                employeeInfo.setOperatorId(sysUser.getId());
+                Date date = new Date();
+                employeeInfo.setUpdateTime(date);
+                employeeInfo.setCreateTime(date);
+                employeeInfoService.update(employeeInfo);
+                return succeed();
+            }else {
+                return failed(HttpStatus.PARTIAL_CONTENT,"该手机号已在系统中,是否更新原有数据");
+            }
+        }
 		employeeInfo.setOperatorId(sysUser.getId());
     	Date date = new Date();
     	employeeInfo.setUpdateTime(date);

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

@@ -147,7 +147,7 @@ public class ExportController extends BaseController {
     private MusicGroupService musicGroupService;
 
     @ApiOperation(value = "乐团列表导出")
-    @RequestMapping("export/musicGroup")
+    @PostMapping("export/musicGroup")
     @PreAuthorize("@pcs.hasPermissions('export/musicGroup')")
     public void exportMusicGroup(HttpServletResponse response, MusicGroupQueryInfo queryInfo) throws IOException {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
@@ -174,7 +174,7 @@ public class ExportController extends BaseController {
         OutputStream outputStream = response.getOutputStream();
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团编号", "乐团名称","合作单位", "乐团状态",
-                    "收费模式","收费类型","乐团主管","运营主管","成团人数", "在读人数", "申请时间", "成团时间", "清单状态"}, new String[]{
+                    "收费模式","收费类型","乐团主管","成团人数", "在读人数", "申请时间", "成团时间", "清单状态"}, new String[]{
                     "organName", "id", "name","cooperationOrganName", "status.msg", "courseViewType.msg","chargeTypeName",
                     "educationalTeacherName", "teamTeacherName", "groupMemberNum","payNum"
                     ,"createTime","updateTime","hasVerifyMusicalList?'已确认':'未确认'"}, rows);
@@ -198,22 +198,37 @@ public class ExportController extends BaseController {
         }
     }
 
-    @ApiOperation(value = "2021双十一学员购买详情")
-    @RequestMapping("export/doubleEleven2021OrderDetail")
-    @PreAuthorize("@pcs.hasPermissions('export/doubleEleven2021OrderDetail')")
-    public void doubleEleven2021OrderDetail(HttpServletResponse response,DoubleEleven2021QueryInfo queryInfo) throws IOException {
+    @ApiOperation(value = "21年暑期考级活动统计页面详情导出")
+    @PostMapping("export/statisticsDetail")
+    @PreAuthorize("@pcs.hasPermissions('export/statisticsDetail')")
+    public void statisticsDetail(HttpServletResponse response, ChildrenReserveQueryInfo queryInfo) throws IOException {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            throw new BizException("用户信息获取失败");
+        }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+            throw new BizException("用户所在分部异常");
+        }else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                throw new BizException("非法请求");
+            }
+        }
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        List<DoubleEleven2021OrderDetailDto> rows = vipGroupActivityService.doubleEleven2021OrderDetail(queryInfo).getRows();
+        List<ChildrenStatisticsDetailDto> rows = childrenDayReserveService.exportStatisticsDetail(queryInfo);
         if(rows.size() < 1){
-            throw new BizException("没有可导出数据");
-        }
+           throw new BizException("没有可导出数据");
+       }
         OutputStream outputStream = response.getOutputStream();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员姓名","订单号", "交易金额",
-                    "交易时间", "订单创建时间", "购买课程", "赠送会员"}, new String[]{
-                    "userId", "username", "orderNo","amount", "payTime", "createTime","type",
-                    "giveMember==0?'否':'是'"}, rows);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "合作单位", "乐团","学员编号", "学员姓名", "手机号","声部","所在班级","指导老师", "是否预约", "器乐等级", "乐理等级", "是否购买VIP","是否购买乐理课"}, new String[]{
+                    "organName", "cooperationOrganName", "musicGroupName","userId", "username", "phone","subjectName",
+                    "currentClass", "realName", "isReserve == true ?'是':'否'","gradeLeave"
+                    ,"theoryLevel","buyVipFlag == true ?'是':'否'","buyTheoryCourseFlag == true ?'是':'否'"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attac:wq" +
                     "hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");
@@ -234,22 +249,22 @@ public class ExportController extends BaseController {
         }
     }
 
-    @ApiOperation(value = "分部2021双11活动统计导出")
-    @RequestMapping("export/organDoubleEleven2021Statis")
-    @PreAuthorize("@pcs.hasPermissions('export/organDoubleEleven2021Statis')")
-    public void organDoubleEleven2021Statis(HttpServletResponse response,Integer organId,String order, String sort) throws IOException {
-        List<DoubleEleven2021Dto> rows = vipGroupActivityService.organDoubleEleven2021Statis(order, sort,organId);
+    @ApiOperation(value = "2021双十一学员购买详情")
+    @RequestMapping("export/doubleEleven2021OrderDetail")
+    @PreAuthorize("@pcs.hasPermissions('export/doubleEleven2021OrderDetail')")
+    public void doubleEleven2021OrderDetail(HttpServletResponse response,DoubleEleven2021QueryInfo queryInfo) throws IOException {
+        queryInfo.setPage(1);
+        queryInfo.setRows(49999);
+        List<DoubleEleven2021OrderDetailDto> rows = vipGroupActivityService.doubleEleven2021OrderDetail(queryInfo).getRows();
         if(rows.size() < 1){
             throw new BizException("没有可导出数据");
         }
         OutputStream outputStream = response.getOutputStream();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "总成交金额","总购买人数", "人均购买金额",
-                    "20节1v1成交金额", "20节1v1成交人数", "40节1v1成交金额", "40节1v1成交人数", "20节1v2成交金额", "20节1v2成交人数",
-                    "40节1v2成交金额", "40节1v2成交人数", "乐理课成交金额", "乐理课成交人数", "赠送会员人数"}, new String[]{
-                    "organName", "totalBuyAmount", "totalBuyNum","avgBuyAmount", "vip1V120Amount", "vip1V120Num","vip1V140Amount",
-                    "vip1V140Num", "vip1V220Amount", "vip1V220Num","vip1V240Amount"
-                    ,"vip1V240Num","musicTheoryAmount","musicTheoryNum","giveMemberNum"}, rows);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员姓名","订单号", "交易金额",
+                    "交易时间", "订单创建时间", "购买课程", "赠送会员"}, new String[]{
+                    "userId", "username", "orderNo","amount", "payTime", "createTime","type",
+                    "giveMember==0?'否':'是'"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attac:wq" +
                     "hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");
@@ -270,37 +285,22 @@ public class ExportController extends BaseController {
         }
     }
 
-    @ApiOperation(value = "21年暑期考级活动统计页面详情导出")
-    @PostMapping("export/statisticsDetail")
-    @PreAuthorize("@pcs.hasPermissions('export/statisticsDetail')")
-    public void statisticsDetail(HttpServletResponse response, ChildrenReserveQueryInfo queryInfo) throws IOException {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
-            throw new BizException("用户信息获取失败");
-        }
-        Employee employee = employeeDao.get(sysUser.getId());
-        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-            queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
-            throw new BizException("用户所在分部异常");
-        }else {
-            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
-                throw new BizException("非法请求");
-            }
-        }
-        queryInfo.setPage(1);
-        queryInfo.setRows(49999);
-        List<ChildrenStatisticsDetailDto> rows = childrenDayReserveService.exportStatisticsDetail(queryInfo);
+    @ApiOperation(value = "分部2021双11活动统计导出")
+    @RequestMapping("export/organDoubleEleven2021Statis")
+    @PreAuthorize("@pcs.hasPermissions('export/organDoubleEleven2021Statis')")
+    public void organDoubleEleven2021Statis(HttpServletResponse response,Integer organId,String order, String sort) throws IOException {
+        List<DoubleEleven2021Dto> rows = vipGroupActivityService.organDoubleEleven2021Statis(order, sort,organId);
         if(rows.size() < 1){
-           throw new BizException("没有可导出数据");
-       }
+            throw new BizException("没有可导出数据");
+        }
         OutputStream outputStream = response.getOutputStream();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "合作单位", "乐团","学员编号", "学员姓名", "手机号","声部","所在班级","指导老师", "是否预约", "器乐等级", "乐理等级", "是否购买VIP","是否购买乐理课"}, new String[]{
-                    "organName", "cooperationOrganName", "musicGroupName","userId", "username", "phone","subjectName",
-                    "currentClass", "realName", "isReserve == true ?'是':'否'","gradeLeave"
-                    ,"theoryLevel","buyVipFlag == true ?'是':'否'","buyTheoryCourseFlag == true ?'是':'否'"}, rows);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "总成交金额","总购买人数", "人均购买金额",
+                    "20节1v1成交金额", "20节1v1成交人数", "40节1v1成交金额", "40节1v1成交人数", "20节1v2成交金额", "20节1v2成交人数",
+                    "40节1v2成交金额", "40节1v2成交人数", "乐理课成交金额", "乐理课成交人数", "赠送会员人数"}, new String[]{
+                    "organName", "totalBuyAmount", "totalBuyNum","avgBuyAmount", "vip1V120Amount", "vip1V120Num","vip1V140Amount",
+                    "vip1V140Num", "vip1V220Amount", "vip1V220Num","vip1V240Amount"
+                    ,"vip1V240Num","musicTheoryAmount","musicTheoryNum","giveMemberNum"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attac:wq" +
                     "hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");

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

@@ -77,7 +77,6 @@ public class MusicGroupQuitController extends BaseController {
     private CloudTeacherOrderDao cloudTeacherOrderDao;
     @Autowired
     private TeacherDao teacherDao;
-    
     @Autowired
     private EmployeeDao employeeDao;
 
@@ -260,6 +259,30 @@ public class MusicGroupQuitController extends BaseController {
         return succeed(musicGroupService.approveQuitMusicGroup(roleIds, musicGroupQuit));
     }
 
+    @ApiOperation(value = "批量退团")
+    @PostMapping("/batchQuitMusicGroup")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupQuit/batchQuitMusicGroup')")
+    public HttpResponseResult batchQuitMusicGroup(@RequestBody List<MusicGroupQuit> musicGroupQuits) throws Exception {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		List<Integer> roleIds = new ArrayList<Integer>();
+		if(sysUser.getIsSuperAdmin() == true) {
+			roleIds.add(SysUserRole.SECTION_MANAGER);
+			roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
+		} else {
+			roleIds = employeeDao.queryUserRole(sysUser.getId());
+		}
+		if (!(roleIds.contains(SysUserRole.SECTION_MANAGER) || roleIds.contains(SysUserRole.EDUCATIONAL_TEACHER))) {
+			throw new BizException("未经授权,不能操作");
+		}
+        for (MusicGroupQuit musicGroupQuit : musicGroupQuits) {
+            musicGroupService.approveQuitMusicGroup(roleIds, musicGroupQuit);
+        }
+        return succeed();
+    }
+
     @ApiOperation(value = "一键退团")
     @PostMapping("/directQuitMusicGroup")
     @PreAuthorize("@pcs.hasPermissions('musicGroupQuit/directQuitMusicGroup')")

+ 16 - 10
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -115,17 +115,17 @@ public class PracticeGroupManageController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-            Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-                queryInfo.setOrganId(employee.getOrganIdList());
-            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-                return failed("用户所在分部异常");
-            } else {
-                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-                    return failed("非法请求");
-                }
+        Employee employee = employeeDao.get(sysUser.getId());
+        if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            queryInfo.setOrganId(employee.getOrganIdList());
+        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+            return failed("用户所在分部异常");
+        } else {
+            List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                return failed("非法请求");
             }
+        }
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
 
@@ -205,4 +205,10 @@ public class PracticeGroupManageController extends BaseController {
         applyBaseInfoDto.setMemo("指导老师申请网管课");
         return practiceGroupService.createPracticeGroup(practiceGroupApplyDto);
     }
+
+    @ApiOperation(value = "获取学生指定网管课的剩余课时费用")
+    @GetMapping(value = "/getStudentSurplusCourseFee")
+    public Object getStudentSurplusCourseFee(Long practiceGroupId){
+        return succeed(practiceGroupService.getStudentSurplusCourseFee(practiceGroupId));
+    }
 }

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/CourseHomeworkController.java

@@ -80,12 +80,14 @@ public class CourseHomeworkController extends BaseController {
         if(!extra){
             CourseHomework courseHomework = courseHomeworkService.get(homeworkId);
             if(Objects.nonNull(courseHomework)){
+                result.put("title", courseHomework.getTitle());
                 result.put("content", courseHomework.getContent());
             }
             result.put("data", studentCourseHomeworkService.findStudentCourseHomeworkByCourse(null, homeworkId,userName));
         }else{
             ExtracurricularExercises extracurricularExercises = extracurricularExercisesService.get(homeworkId);
             if(Objects.nonNull(extracurricularExercises)){
+                result.put("title", extracurricularExercises.getTitle());
                 result.put("content", extracurricularExercises.getContent());
             }
             result.put("data", extracurricularExercisesReplyService.findExtraExerciseStudents(homeworkId,userName));