zouxuan 3 سال پیش
والد
کامیت
2341b2d1e5
17فایلهای تغییر یافته به همراه598 افزوده شده و 355 حذف شده
  1. 6 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CalenderMemberDto.java
  2. 144 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentBaseCalender.java
  3. 1 12
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDto.java
  4. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicRepairDto.java
  5. 15 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  6. 0 4
      mec-biz/src/main/java/com/ym/mec/biz/service/CalenderMemberService.java
  7. 25 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderBaseService.java
  8. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  9. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  10. 62 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPaymentCalenderServiceImpl.java
  11. 68 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderCourseSettingsServiceImpl.java
  12. 177 303
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  13. 0 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupTrainPlanServiceImpl.java
  14. 49 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicRepairPaymentCalenderServiceImpl.java
  15. 2 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  16. 12 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  17. 1 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

+ 6 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CalenderMemberDto.java

@@ -1,28 +1,26 @@
 package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.enums.PeriodEnum;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
 
 import static com.ym.mec.biz.dal.enums.PeriodEnum.MONTH;
 
 public class CalenderMemberDto {
-    //会员周期
+    @ApiModelProperty(value = "会员周期", required = false)
     private PeriodEnum periodEnum = MONTH;
 
-    //会员数量
+    @ApiModelProperty(value = "会员数量", required = false)
     private Integer memberNum = 1 ;
 
-    //会员现价
+    @ApiModelProperty(value = "会员现价", required = false)
     private BigDecimal actualAmount = BigDecimal.ZERO;
 
-    //会员原价
-    private BigDecimal originalAmount = BigDecimal.ZERO;
-
-    //会员等级编号
+    @ApiModelProperty(value = "会员等级编号", required = false)
     private Integer memberRankSettingId = 1;
 
-    //是否可选
+    @ApiModelProperty(value = "是否可选", required = false)
     private Boolean optionalFlag = false;
 
     public PeriodEnum getPeriodEnum() {
@@ -49,14 +47,6 @@ public class CalenderMemberDto {
         this.actualAmount = actualAmount;
     }
 
-    public BigDecimal getOriginalAmount() {
-        return originalAmount;
-    }
-
-    public void setOriginalAmount(BigDecimal originalAmount) {
-        this.originalAmount = originalAmount;
-    }
-
     public Integer getMemberRankSettingId() {
         return memberRankSettingId;
     }

+ 144 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentBaseCalender.java

@@ -0,0 +1,144 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class MusicGroupPaymentBaseCalender {
+
+	@ApiModelProperty(value = "乐团编号", required = true)
+	private String musicGroupId;
+
+	private MusicGroup musicGroup;
+
+	private Integer musicGroupOrganizationCourseSettingId;
+
+	@ApiModelProperty(value = "学校缴费、个人缴费", required = true)
+	private PayUserType payUserType;
+
+	@ApiModelProperty(value = "缴费类型", required = true)
+	private PaymentType paymentType;
+
+	@ApiModelProperty(value = "缴费开始时间", required = true)
+	private Date startPaymentDate;
+
+	@ApiModelProperty(value = "缴费截止时间", required = true)
+	private Date deadlinePaymentDate;
+
+	@ApiModelProperty(value = "备注", required = true)
+	private String memo;
+
+	@ApiModelProperty(value = "批次号", required = false)
+	private String batchNo;
+
+	@ApiModelProperty(value = "会员相关缴费信息", required = false)
+	private CalenderMemberDto calenderMember;
+
+	@ApiModelProperty(value = "乐保信息", required = false)
+	private MusicRepairDto musicRepair;
+
+	@ApiModelProperty(value = "乐团课程信息", required = false)
+	private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList;
+
+	public MusicRepairDto getMusicRepair() {
+		return musicRepair;
+	}
+
+	public void setMusicRepair(MusicRepairDto musicRepair) {
+		this.musicRepair = musicRepair;
+	}
+
+	public MusicGroup getMusicGroup() {
+		return musicGroup;
+	}
+
+	public void setMusicGroup(MusicGroup musicGroup) {
+		this.musicGroup = musicGroup;
+	}
+
+	public Date getStartPaymentDate() {
+		return startPaymentDate;
+	}
+
+	public void setStartPaymentDate(Date startPaymentDate) {
+		this.startPaymentDate = startPaymentDate;
+	}
+
+	public Date getDeadlinePaymentDate() {
+		return deadlinePaymentDate;
+	}
+
+	public void setDeadlinePaymentDate(Date deadlinePaymentDate) {
+		this.deadlinePaymentDate = deadlinePaymentDate;
+	}
+
+	public CalenderMemberDto getCalenderMember() {
+		return calenderMember;
+	}
+
+	public void setCalenderMember(CalenderMemberDto calenderMember) {
+		this.calenderMember = calenderMember;
+	}
+
+	public String getMusicGroupId() {
+		return musicGroupId;
+	}
+
+	public void setMusicGroupId(String musicGroupId) {
+		this.musicGroupId = musicGroupId;
+	}
+
+	public Integer getMusicGroupOrganizationCourseSettingId() {
+		return musicGroupOrganizationCourseSettingId;
+	}
+
+	public void setMusicGroupOrganizationCourseSettingId(Integer musicGroupOrganizationCourseSettingId) {
+		this.musicGroupOrganizationCourseSettingId = musicGroupOrganizationCourseSettingId;
+	}
+
+	public PayUserType getPayUserType() {
+		return payUserType;
+	}
+
+	public void setPayUserType(PayUserType payUserType) {
+		this.payUserType = payUserType;
+	}
+
+	public PaymentType getPaymentType() {
+		return paymentType;
+	}
+
+	public void setPaymentType(PaymentType paymentType) {
+		this.paymentType = paymentType;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public List<MusicGroupPaymentCalenderCourseSettings> getMusicGroupPaymentCalenderCourseSettingsList() {
+		return musicGroupPaymentCalenderCourseSettingsList;
+	}
+
+	public void setMusicGroupPaymentCalenderCourseSettingsList(List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList) {
+		this.musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderCourseSettingsList;
+	}
+
+	public String getBatchNo() {
+		return batchNo;
+	}
+
+	public void setBatchNo(String batchNo) {
+		this.batchNo = batchNo;
+	}
+}

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

@@ -34,7 +34,7 @@ public class MusicGroupPaymentCalenderDto {
 	private String attribute2;
 
 	private String studentIds;
-	
+
 	private String batchNo;
 
 	private Boolean mergeClassFlag = false;
@@ -43,17 +43,6 @@ public class MusicGroupPaymentCalenderDto {
 
 	private BigDecimal masterTotalPrice = BigDecimal.ZERO;
 
-	//会员缴费相关信息
-	private CalenderMemberDto calenderMember;
-
-	public CalenderMemberDto getCalenderMember() {
-		return calenderMember;
-	}
-
-	public void setCalenderMember(CalenderMemberDto calenderMember) {
-		this.calenderMember = calenderMember;
-	}
-
 	//会员有效期(月)
 	private Integer memberValidDate;
 

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicRepairDto.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class MusicRepairDto {
+
+    @ApiModelProperty(value = "年限", required = false)
+    private BigDecimal num;
+
+    @ApiModelProperty(value = "团购价", required = false)
+    private BigDecimal actualAmount;
+
+    public BigDecimal getNum() {
+        return num;
+    }
+
+    public void setNum(BigDecimal num) {
+        this.num = num;
+    }
+
+    public BigDecimal getActualAmount() {
+        return actualAmount;
+    }
+
+    public void setActualAmount(BigDecimal actualAmount) {
+        this.actualAmount = actualAmount;
+    }
+}

+ 15 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
+import com.ym.mec.biz.dal.enums.PeriodEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
@@ -12,6 +13,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.common.enums.BaseEnum;
 
+import static com.ym.mec.biz.dal.enums.PeriodEnum.MONTH;
+
 /**
  * 对应数据库表(music_group_payment_calender):
  */
@@ -140,7 +143,7 @@ public class MusicGroupPaymentCalender {
 	@ApiModelProperty(value = "审核意见", required = false)
 	private String auditMemo;
 
-	private Boolean isGiveMusicNetwork;
+	private Boolean isGiveMusicNetwork = false;
 	
 	private String rejectReason;
 
@@ -166,6 +169,9 @@ public class MusicGroupPaymentCalender {
 	@ApiModelProperty(value = "课程展现形式",required = false)
 	private CourseViewTypeEnum courseViewType;
 
+	//会员周期
+	private PeriodEnum memberPeriod = MONTH;
+
 	//会员有效期(月)
 	private Integer memberValidDate;
 
@@ -181,6 +187,14 @@ public class MusicGroupPaymentCalender {
 	//会员等级名称
 	private String memberRankSettingName;
 
+	public PeriodEnum getMemberPeriod() {
+		return memberPeriod;
+	}
+
+	public void setMemberPeriod(PeriodEnum memberPeriod) {
+		this.memberPeriod = memberPeriod;
+	}
+
 	public String getMemberRankSettingName() {
 		return memberRankSettingName;
 	}

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

@@ -1,4 +0,0 @@
-package com.ym.mec.biz.service;
-
-public interface CalenderMemberService {
-}

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderBaseService.java

@@ -0,0 +1,25 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+
+public interface MusicGroupPaymentCalenderBaseService {
+
+    /**
+    * @description: 缴费项目组件
+     * @param baseCalender
+    * @return void
+    * @author zx
+    * @date 2021/12/21 11:37
+    */
+    void createComponent(MusicGroupPaymentBaseCalender baseCalender);
+
+    /**
+    * @description: 校验缴费项目金额,是否需要审核
+     * @param baseCalender
+    * @return void
+    * @author zx
+    * @date 2021/12/21 11:37
+    */
+    MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender);
+}

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

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import java.util.List;
 import java.util.Set;
 
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
@@ -22,10 +23,10 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 
 	/**
 	 * 创建缴费信息
-	 * @param musicGroupPaymentCalenderDto
+	 * @param musicGroupPaymentBaseCalender
 	 * @return
 	 */
-	String create1(MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto);
+	String create1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender);
 	
 	/**
 	 * 获取明细

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

@@ -1055,7 +1055,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             throw new BizException("用户机构信息异常");
         }
         Date now = new Date();
-		String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_BEFOR_COURSE_START_TIME_RANGE_VIP, user.getTenantId());
+		String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP, user.getTenantId());
 		String courseBeforeBufferTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_BEFORE_BUFFER_TIME, user.getTenantId());
 		String courseAfterBufferTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_AFTER_BUFFER_TIME, user.getTenantId());
         Map<String, Object> result = new HashMap<>(7);
@@ -1067,8 +1067,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		result.put("advanceLeaveHours", advanceLeaveHours);
         result.put("earliestTimeForLeave", Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.EARLIEST_TIME_FOR_LEAVE)));
-        result.put("joinRoomBeforeTime",StringUtils.isEmpty(configValue)?0:Integer.parseInt(configValue));
-		result.put("courseBeforeBufferTime", StringUtils.isEmpty(courseBeforeBufferTime)?5:Integer.parseInt(courseBeforeBufferTime));
+        result.put("joinRoomBeforeTime",StringUtils.isEmpty(courseBeforeBufferTime)?10:Integer.parseInt(courseBeforeBufferTime));
+		result.put("courseBeforeBufferTime", StringUtils.isEmpty(courseBeforeBufferTime)?10:Integer.parseInt(courseBeforeBufferTime));
 		result.put("courseAfterBufferTime", StringUtils.isEmpty(courseAfterBufferTime)?10:Integer.parseInt(courseAfterBufferTime));
 //		List<Integer> quitClassGroupIds=classGroupStudentMapperDao.findClassGroupIdByUserAndCourseDateAndStatus(user.getId(),classDate, ClassGroupStudentStatusEnum.QUIT.getCode());
         List<CourseScheduleDto> studentCourseSchedulesWithDate = courseScheduleDao.getStudentCourseSchedulesWithDate(classDate, user.getId().longValue(), null);

+ 62 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPaymentCalenderServiceImpl.java

@@ -0,0 +1,62 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.MemberFeeSettingDao;
+import com.ym.mec.biz.dal.dto.CalenderMemberDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
+import com.ym.mec.biz.dal.entity.MemberFeeSetting;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.enums.PeriodEnum;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderBaseService;
+import com.ym.mec.common.exception.BizException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.math.BigDecimal;
+
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
+
+public class MemberPaymentCalenderServiceImpl implements MusicGroupPaymentCalenderBaseService {
+
+    @Autowired
+    private MemberFeeSettingDao memberFeeSettingDao;
+
+    @Override
+    public void createComponent(MusicGroupPaymentBaseCalender baseCalender) {
+
+    }
+
+    @Override
+    public MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        CalenderMemberDto calenderMember = baseCalender.getCalenderMember();
+        if(calenderMember != null){
+            MusicGroup musicGroup = baseCalender.getMusicGroup();
+            //会员价格是否变动
+            MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), calenderMember.getMemberRankSettingId());
+            if(memberFee == null){
+                throw new BizException("操作失败:请配置当前分部会员收费标准");
+            }
+            //获取会员总价
+            BigDecimal memberPaymentAmount = getGroupPurchaseFee(calenderMember.getPeriodEnum(),memberFee).multiply(new BigDecimal(calenderMember.getMemberNum())).setScale(0, BigDecimal.ROUND_HALF_UP);
+            if(memberPaymentAmount.compareTo(calenderMember.getActualAmount()) != 0){
+                return AUDITING;
+            }
+        }
+        return NO;
+    }
+
+    private BigDecimal getGroupPurchaseFee(PeriodEnum periodEnum,MemberFeeSetting memberFee){
+        switch (periodEnum){
+            case MONTH :
+                return memberFee.getGroupPurchaseMonthFee();
+            case QUARTERLY :
+                return memberFee.getGroupPurchaseQuarterlyFee();
+            case YEAR_HALF :
+                return memberFee.getGroupPurchaseHalfYearFee();
+            case YEAR :
+                return memberFee.getGroupPurchaseYearFee();
+            default:
+                throw new BizException("请选择正确的会员有效期");
+        }
+    }
+}

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

@@ -1,7 +1,12 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
+import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderBaseService;
+import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -11,16 +16,25 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.util.CollectionUtils;
 
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
+
 @Service
-public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentCalenderCourseSettings>  implements MusicGroupPaymentCalenderCourseSettingsService {
+public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentCalenderCourseSettings>  implements MusicGroupPaymentCalenderCourseSettingsService, MusicGroupPaymentCalenderBaseService {
 	
 	@Autowired
 	private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
 	@Autowired
 	private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
+	@Autowired
+	private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
+	@Autowired
+	private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
 
 	@Override
 	public BaseDAO<Integer, MusicGroupPaymentCalenderCourseSettings> getDAO() {
@@ -48,4 +62,57 @@ public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServ
 		}
 		return result;
 	}
+
+	@Override
+	public void createComponent(MusicGroupPaymentBaseCalender baseCalender) {
+
+	}
+
+	@Override
+	public MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender) {
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = baseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
+		if(musicGroupPaymentCalenderCourseSettingsList != null && musicGroupPaymentCalenderCourseSettingsList.size() > 0){
+			if (baseCalender.getPaymentType() == MUSIC_APPLY || baseCalender.getPaymentType() == MUSIC_RENEW) {
+				// 当前缴费的课程费用
+				Map<CourseSchedule.CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
+						Collectors.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
+
+				// 查询默认课程费用
+				Integer musicGroupOrganizationCourseSettingId = baseCalender.getMusicGroupOrganizationCourseSettingId();
+				Map<CourseSchedule.CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
+						.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
+						.stream()
+						.collect(Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail::getCourseType,
+										MusicGroupOrganizationCourseSettingsDetail::getCourseCurrentPrice));
+
+				// 相同类型的课程如果修改了课程费用,需要走审批
+				for (Map.Entry<CourseSchedule.CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
+					if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
+						return AUDITING;
+					}
+				}
+			} else if (baseCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_COURSE) {
+				MusicGroup musicGroup = baseCalender.getMusicGroup();
+				// 如果是课程收费,判断是否审核
+				for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
+					OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
+							musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
+					if (defaultUnitPrice == null) {
+						throw new BizException("请先设置分部课程类型单价");
+					}
+					if (courseSettings.getCourseTotalMinuties() != 0) {
+						if (defaultUnitPrice.getUnitPrice().multiply(new BigDecimal(courseSettings.getCourseTotalMinuties())).setScale(0, BigDecimal.ROUND_HALF_UP)
+								.compareTo(courseSettings.getCourseCurrentPrice()) != 0) {
+							return AUDITING;
+						}
+					} else {
+						return AUDITING;
+					}
+				}
+			}else {
+				throw new BizException("错误的缴费类型");
+			}
+		}
+		return MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
+	}
 }

+ 177 - 303
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -24,6 +24,7 @@ import com.ym.mec.biz.event.source.GroupEventSource;
 import com.ym.mec.biz.service.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
@@ -66,7 +67,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
 
 	@Autowired
-	private MusicGroupOrganizationCourseSettingsDao musicGroupOrganizationCourseSettingsDao;
+	private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
 	
 	@Autowired
 	private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
@@ -137,6 +138,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private StudentService studentService;
 	@Autowired
 	private CloudTeacherOrderDao cloudTeacherOrderDao;
+	@Autowired
+	private MusicGroupPaymentCalenderBaseService musicGroupPaymentCalenderBaseService;
 
 	@Override
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
@@ -463,7 +466,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					.getMusicGroupPaymentCalenderCourseSettingsList();
 
 			if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
-				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender
+				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
 						.getMusicGroupOrganizationCourseSettingId());
 				for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
 					musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
@@ -540,44 +543,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public String create1(MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto) {
+	public String create1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
 
-		String musicGroupId = musicGroupPaymentCalenderDto.getMusicGroupId();
+		String musicGroupId = musicGroupPaymentBaseCalender.getMusicGroupId();
 
-		PaymentType paymentType = musicGroupPaymentCalenderDto.getPaymentType();
+		PaymentType paymentType = musicGroupPaymentBaseCalender.getPaymentType();
 
-		PayUserType payUserType = musicGroupPaymentCalenderDto.getPayUserType();
+		PayUserType payUserType = musicGroupPaymentBaseCalender.getPayUserType();
 
-		List<MusicGroupPaymentDateRange> musicGroupPaymentDateRangeList = musicGroupPaymentCalenderDto.getMusicGroupPaymentDateRangeList();
-		if(musicGroupPaymentDateRangeList.size() > 1){
-			throw new BizException("暂不支持多周期缴费");
-		}
 		MusicGroup musicGroup = musicGroupDao.getLocked(musicGroupId);
 		if (musicGroup == null) {
 			throw new BizException("乐团查询失败,请检查参数");
 		}
-		if (paymentType == PaymentType.ADD_STUDENT) {
-			//获取缴费状态在审核中或者已拒绝的缴费项目的学员
-			Integer userId = Integer.parseInt(musicGroupPaymentCalenderDto.getStudentIds());
-			if(musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
-				//该学员是否在其他的会员团
-				boolean hasMemberGroup = studentRegistrationDao.checkHasMemberGroup(musicGroupId,userId);
-				if(hasMemberGroup){
-					throw new BizException("操作失败:学员已在其他系统收费乐团中,不可报名该乐团请联系教务老师");
-				}
-			}
-
-			String studentIds = musicGroupPaymentCalenderDao.queryCalenderStudentIds(musicGroupId,null);
-			if(StringUtils.isNotEmpty(studentIds)){
-				if(studentIds.contains(userId.toString())){
-					throw new BizException("创建缴费失败:所选学员有待审核或已拒绝的缴费项目");
-				}
-			}
-			List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
-			if(musicGroupPaymentCalenderDetailList != null && musicGroupPaymentCalenderDetailList.size() > 0){
-				throw new BizException("创建缴费失败:已存在缴费项目");
-			}
-		}
 
 		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS && musicGroup.getStatus() != MusicGroupStatusEnum.PRE_BUILD_FEE) {
 			throw new BizException("创建缴费失败:已存在缴费项目");
@@ -587,19 +564,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (sysUser == null) {
 			throw new BizException("请登录");
 		}
-		if (musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE && musicGroupPaymentDateRangeList.size() > 1) {
-			throw new BizException("创建缴费失败:会员收费乐团不支持多周期缴费");
-		}
-		//是否自动创建
-		if(!musicGroupPaymentCalenderDto.getAutoCreate()){
-			// 所有缴费项目已完成排课才能创建下一个缴费项目
-			String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,musicGroupPaymentCalenderDto.getIgnoreBatchNoList());
-			if (StringUtils.isNoneBlank(orignBatchNo)) {
-				if(StringUtils.isEmpty(musicGroupPaymentCalenderDto.getBatchNo()) || !musicGroupPaymentCalenderDto.getBatchNo().equals(orignBatchNo)){
-					throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
-				}
-			}
-		}
+		// 所有缴费项目已完成排课才能创建下一个缴费项目
+//		String orignBatchNo = musicGroupPaymentStudentCourseDetailDao.getUnUseBatchNoWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, null, null,null);
+//		if (StringUtils.isNoneBlank(orignBatchNo)) {
+//			throw new BizException("当前乐团存在未排课的缴费项目,请先完成排课再操作");
+//		}
 
 		// 不是进行中,只能创建一次缴费
 		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
@@ -608,6 +577,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				throw new BizException("创建失败,已经存在缴费信息");
 			}
 		}
+		musicGroupPaymentBaseCalender.setMusicGroup(musicGroup);
 
 		PaymentCalenderStatusEnum status = PaymentCalenderStatusEnum.NO;
 
@@ -615,266 +585,181 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		String batchNo = idGeneratorService.generatorId() + "";
 
 		// 获取设置的课程收费标准
-		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderDto
-				.getMusicGroupPaymentCalenderCourseSettingsList();
+//		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
 
 		//会员原价
-		BigDecimal memberPaymentAmount = BigDecimal.ZERO;
+//		BigDecimal memberPaymentAmount = BigDecimal.ZERO;
 		BigDecimal originalMemberPaymentAmount = BigDecimal.ZERO;
 		if (payUserType == SCHOOL) {
 			status = AUDITING;
 		} else {
-			if(musicGroupPaymentCalenderCourseSettingsList != null){
-				if (paymentType == MUSIC_APPLY || paymentType == MUSIC_RENEW) {
-					// 当前缴费的课程费用
-					Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
-							Collectors
-									.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
-
-					// 查询默认课程费用
-					Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId();
-					Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
-							.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
-							.stream()
-							.collect(
-									Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail::getCourseType,
-											MusicGroupOrganizationCourseSettingsDetail::getCourseCurrentPrice));
-
-					// 相同类型的课程如果修改了课程费用,需要走审批
-					for (Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
-						if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
-							status = AUDITING;
-							break;
-						}
-					}
-				} else if (paymentType == PaymentType.ADD_COURSE || paymentType == PaymentType.ADD_STUDENT) {
-					PaymentCalenderStatusEnum dtoStatus = musicGroupPaymentCalenderDto.getStatus();
-					if(dtoStatus != null && dtoStatus == AUDITING){
-						status = AUDITING;
-					}else {
-						// 如果是课程收费,判断是否审核
-						for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
-							OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
-									musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
-							if (defaultUnitPrice == null) {
-								throw new BizException("请先设置分部课程类型单价");
-							}
-							if (courseSettings.getCourseTotalMinuties() != 0) {
-
-								if (defaultUnitPrice.getUnitPrice().multiply(new BigDecimal(courseSettings.getCourseTotalMinuties())).setScale(0, BigDecimal.ROUND_HALF_UP)
-										.compareTo(courseSettings.getCourseCurrentPrice()) != 0) {
+			status = musicGroupPaymentCalenderBaseService.checkComponentAmount(musicGroupPaymentBaseCalender);
+//			if(musicGroupPaymentCalenderCourseSettingsList != null){
+//				if (paymentType == MUSIC_APPLY || paymentType == MUSIC_RENEW) {
+//					// 当前缴费的课程费用
+//					Map<CourseScheduleType, BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(
+//							Collectors
+//									.toMap(MusicGroupPaymentCalenderCourseSettings::getCourseType, MusicGroupPaymentCalenderCourseSettings::getCourseCurrentPrice));
+//
+//					// 查询默认课程费用
+//					Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId();
+//					Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao
+//							.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId)
+//							.stream()
+//							.collect(
+//									Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail::getCourseType,
+//											MusicGroupOrganizationCourseSettingsDetail::getCourseCurrentPrice));
+//
+//					// 相同类型的课程如果修改了课程费用,需要走审批
+//					for (Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()) {
+//						if (defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0) {
+//							status = AUDITING;
+//							break;
+//						}
+//					}
+//				} else if (paymentType == PaymentType.ADD_COURSE || paymentType == PaymentType.ADD_STUDENT) {
+//					PaymentCalenderStatusEnum dtoStatus = musicGroupPaymentCalenderDto.getStatus();
+//					if(dtoStatus != null && dtoStatus == AUDITING){
+//						status = AUDITING;
+//					}else {
+//						// 如果是课程收费,判断是否审核
+//						for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
+//							OrganizationCourseUnitPriceSettings defaultUnitPrice = organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseTypeAndChargeType(
+//									musicGroup.getOrganId(), courseSettings.getCourseType(), musicGroup.getChargeTypeId());
+//							if (defaultUnitPrice == null) {
+//								throw new BizException("请先设置分部课程类型单价");
+//							}
+//							if (courseSettings.getCourseTotalMinuties() != 0) {
+//
+//								if (defaultUnitPrice.getUnitPrice().multiply(new BigDecimal(courseSettings.getCourseTotalMinuties())).setScale(0, BigDecimal.ROUND_HALF_UP)
+//										.compareTo(courseSettings.getCourseCurrentPrice()) != 0) {
+//
+//									status = AUDITING;
+//									break;
+//								}
+//							} else {
+//								status = AUDITING;
+//								break;
+//							}
+//						}
+//					}
+//				}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
+//					status = musicGroupPaymentCalenderDto.getStatus();
+//				}
+//			}
+//			if(musicGroupPaymentCalenderDto.getMemberRankSettingId() != null){
+//				//会员价格是否变动
+//				MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), musicGroupPaymentCalenderDto.getMemberRankSettingId());
+//				if(memberFee == null){
+//					throw new BizException("操作失败:请配置当前分部会员收费标准");
+//				}
+//				switch (musicGroupPaymentCalenderDto.getMemberValidDate()){
+//					case 1 :
+//						memberPaymentAmount = memberFee.getGroupPurchaseMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
+//						originalMemberPaymentAmount = memberFee.getOriginalMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
+//						break;
+//					case 6 :
+//						memberPaymentAmount = memberFee.getGroupPurchaseHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
+//						originalMemberPaymentAmount = memberFee.getOriginalHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
+//						break;
+//					case 12 :
+//						memberPaymentAmount = memberFee.getGroupPurchaseYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
+//						originalMemberPaymentAmount = memberFee.getOriginalYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
+//						break;
+//					default:
+//						throw new BizException("请选择正确的会员有效期");
+//				}
+//				if(memberPaymentAmount.compareTo(musicGroupPaymentCalenderDto.getMemberPaymentAmount()) != 0){
+//					status = AUDITING;
+//				}
+//			}
+		}
+
+		MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
+		musicGroupPaymentCalender.setOriginalMemberPaymentAmount(originalMemberPaymentAmount);
+		musicGroupPaymentCalender.setDeadlinePaymentDate(musicGroupPaymentBaseCalender.getDeadlinePaymentDate());
+		musicGroupPaymentCalender.setMemo(musicGroupPaymentBaseCalender.getMemo());
+		musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
+		musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentBaseCalender.getMusicGroupOrganizationCourseSettingId());
+		BigDecimal totalPaymentAmount = BigDecimal.ZERO;
+		musicGroupPaymentCalender.setPayUserType(musicGroupPaymentBaseCalender.getPayUserType());
+		musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentBaseCalender.getStartPaymentDate());
+		musicGroupPaymentCalender.setOperator(sysUser.getId());
+		musicGroupPaymentCalender.setCreateTime(date);
+		musicGroupPaymentCalender.setUpdateTime(date);
+		musicGroupPaymentCalender.setStatus(status);
+		CalenderMemberDto calenderMember = musicGroupPaymentBaseCalender.getCalenderMember();
+		if(calenderMember != null){
+			//设置会员缴费金额、级别以及有效期
+			totalPaymentAmount.add(calenderMember.getActualAmount());
+			musicGroupPaymentCalender.setMemberPaymentAmount(calenderMember.getActualAmount());
+			musicGroupPaymentCalender.setMemberRankSettingId(calenderMember.getMemberRankSettingId());
+			musicGroupPaymentCalender.setMemberValidDate(calenderMember.getMemberNum());
+			musicGroupPaymentCalender.setMemberPeriod(calenderMember.getPeriodEnum());
+		}
+		//课程费用列表
+		List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
+				.getMusicGroupPaymentCalenderCourseSettingsList();
+		if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
+			totalPaymentAmount.add(currentMusicGroupPaymentCalenderCourseSettings.stream().map(e -> e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add));
+		}
+		musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
+
+//		BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
+//		if(musicGroupPaymentCalenderCourseSettingsList != null){
+//			List<MusicGroupPaymentCalenderCourseSettings> newCSList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>(
+//					musicGroupPaymentCalenderCourseSettingsList.size());
+//			for (MusicGroupPaymentCalenderCourseSettings pccs : musicGroupPaymentCalenderCourseSettingsList) {
+//				MusicGroupPaymentCalenderCourseSettings tempPccs = new MusicGroupPaymentCalenderCourseSettings();
+//				try {
+//					BeanUtils.copyProperties(tempPccs, pccs);
+//				} catch (Exception e) {
+//					throw new BizException("克隆对象出错", e);
+//				}
+//				if (pccs.getIsStudentOptional()) {
+//					tempPccs.setCourseCurrentPrice(pccs.getCourseCurrentPrice());
+//					tempPccs.setCourseOriginalPrice(pccs.getCourseOriginalPrice());
+//					tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties());
+//				} else {
+//					tempPccs.setCourseCurrentPrice(BigDecimal.ZERO);
+//					tempPccs.setCourseOriginalPrice(BigDecimal.ZERO);
+//					tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties());
+//				}
+//				totalPaymentAmount = totalPaymentAmount.add(tempPccs.getCourseCurrentPrice());
+//				newCSList.add(tempPccs);
+//			}
+//			musicGroupPaymentCalender.setMusicGroupPaymentCalenderCourseSettingsList(newCSList);
+//		}
 
-									status = AUDITING;
-									break;
-								}
-							} else {
-								status = AUDITING;
-								break;
-							}
-						}
-					}
-				}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
-					status = musicGroupPaymentCalenderDto.getStatus();
-				}
-			}
-			if(musicGroupPaymentCalenderDto.getMemberRankSettingId() != null){
-				//会员价格是否变动
-				MemberFeeSetting memberFee = memberFeeSettingDao.findByRankIdAndOrganId(musicGroup.getOrganId(), musicGroupPaymentCalenderDto.getMemberRankSettingId());
-				if(memberFee == null){
-					throw new BizException("操作失败:请配置当前分部会员收费标准");
-				}
-				switch (musicGroupPaymentCalenderDto.getMemberValidDate()){
-					case 1 :
-						memberPaymentAmount = memberFee.getGroupPurchaseMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
-						originalMemberPaymentAmount = memberFee.getOriginalMonthFee().setScale(0, BigDecimal.ROUND_HALF_UP);
-						break;
-					case 6 :
-						memberPaymentAmount = memberFee.getGroupPurchaseHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
-						originalMemberPaymentAmount = memberFee.getOriginalHalfYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
-						break;
-					case 12 :
-						memberPaymentAmount = memberFee.getGroupPurchaseYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
-						originalMemberPaymentAmount = memberFee.getOriginalYearFee().setScale(0, BigDecimal.ROUND_HALF_UP);
-						break;
-					default:
-						throw new BizException("请选择正确的会员有效期");
-				}
-				if(memberPaymentAmount.compareTo(musicGroupPaymentCalenderDto.getMemberPaymentAmount()) != 0){
-					status = AUDITING;
-				}
-			}
+		//缴费截止日期默认三天后
+		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
+			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
 
-		int times = musicGroupPaymentDateRangeList.size();
-
-		// 排序
-		Collections.sort(musicGroupPaymentDateRangeList, new Comparator<MusicGroupPaymentDateRange>() {
-
-			@Override
-			public int compare(MusicGroupPaymentDateRange o1, MusicGroupPaymentDateRange o2) {
-				return o1.getPaymentValidStartDate().compareTo(o2.getPaymentValidStartDate());
-			}
-		});
-
-		for (int i = 0; i < musicGroupPaymentDateRangeList.size(); i++) {
-
-			MusicGroupPaymentDateRange musicGroupPaymentDateRange = musicGroupPaymentDateRangeList.get(i);
-
-			MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
-			musicGroupPaymentCalender.setAttribute1(musicGroupPaymentCalenderDto.getAttribute1());
-			musicGroupPaymentCalender.setOriginalMemberPaymentAmount(originalMemberPaymentAmount);
-			musicGroupPaymentCalender.setAttribute2(musicGroupPaymentCalenderDto.getAttribute2());
-			musicGroupPaymentCalender.setDeadlinePaymentDate(musicGroupPaymentDateRange.getDeadlinePaymentDate());
-			musicGroupPaymentCalender.setIsGiveMusicNetwork(musicGroupPaymentCalenderDto.getIsGiveMusicNetwork());
-			musicGroupPaymentCalender.setMemo(musicGroupPaymentCalenderDto.getMemo());
-			musicGroupPaymentCalender.setMusicGroupId(musicGroupId);
-			musicGroupPaymentCalender.setMusicGroupOrganizationCourseSettingId(musicGroupPaymentCalenderDto.getMusicGroupOrganizationCourseSettingId());
-
-			BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
-			if(musicGroupPaymentCalenderCourseSettingsList != null){
-				List<MusicGroupPaymentCalenderCourseSettings> newCSList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>(
-						musicGroupPaymentCalenderCourseSettingsList.size());
-				for (MusicGroupPaymentCalenderCourseSettings pccs : musicGroupPaymentCalenderCourseSettingsList) {
-
-					MusicGroupPaymentCalenderCourseSettings tempPccs = new MusicGroupPaymentCalenderCourseSettings();
-					try {
-						BeanUtils.copyProperties(tempPccs, pccs);
-					} catch (Exception e) {
-						throw new BizException("克隆对象出错", e);
-					}
-					if (i == 0) {
-						if (pccs.getIsStudentOptional()) {
-							tempPccs.setCourseCurrentPrice(pccs.getCourseCurrentPrice());
-							tempPccs.setCourseOriginalPrice(pccs.getCourseOriginalPrice());
-							tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties());
-						} else {
-							tempPccs.setCourseCurrentPrice(pccs.getCourseCurrentPrice().subtract(
-									pccs.getCourseCurrentPrice().divide(new BigDecimal(times), 0, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(times - 1))
-											.setScale(0, BigDecimal.ROUND_DOWN)));
-							tempPccs.setCourseOriginalPrice(pccs.getCourseOriginalPrice().subtract(
-									pccs.getCourseOriginalPrice().divide(new BigDecimal(times), 0, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(times - 1))
-											.setScale(0, BigDecimal.ROUND_DOWN)));
-							tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties() - pccs.getCourseTotalMinuties() / times * (times - 1));
-						}
-					} else {
-						if (!pccs.getIsStudentOptional()) {
-							tempPccs.setCourseCurrentPrice(pccs.getCourseCurrentPrice().divide(new BigDecimal(times), 0, BigDecimal.ROUND_DOWN));
-							tempPccs.setCourseOriginalPrice(pccs.getCourseOriginalPrice().divide(new BigDecimal(times), 0, BigDecimal.ROUND_DOWN));
-							tempPccs.setCourseTotalMinuties(pccs.getCourseTotalMinuties() / times);
-						} else {
-							continue;
-						}
-					}
-					totalPaymentAmount = totalPaymentAmount.add(tempPccs.getCourseCurrentPrice());
-					newCSList.add(tempPccs);
-				}
-				musicGroupPaymentCalender.setMusicGroupPaymentCalenderCourseSettingsList(newCSList);
-			}
-			musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
-			musicGroupPaymentCalender.setPaymentPattern(musicGroupPaymentCalenderDto.getPaymentPattern());
-			musicGroupPaymentCalender.setPaymentValidEndDate(musicGroupPaymentDateRange.getPaymentValidEndDate());
-			musicGroupPaymentCalender.setPaymentValidStartDate(musicGroupPaymentDateRange.getPaymentValidStartDate());
-
-			if (paymentType == PaymentType.MUSIC_APPLY) {
-				if (i == 0) {
-					musicGroupPaymentCalender.setPaymentType(paymentType);
-				} else {
-					musicGroupPaymentCalender.setPaymentType(PaymentType.MUSIC_RENEW);
-				}
+		if (musicGroupPaymentCalender.getStatus() != AUDITING) {
+			if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+			} else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
 			} else {
-				musicGroupPaymentCalender.setPaymentType(paymentType);
-			}
-			musicGroupPaymentCalender.setPayUserType(musicGroupPaymentCalenderDto.getPayUserType());
-			musicGroupPaymentCalender.setStartPaymentDate(musicGroupPaymentDateRange.getStartPaymentDate());
-			musicGroupPaymentCalender.setStudentIds(musicGroupPaymentCalenderDto.getStudentIds());
-			musicGroupPaymentCalender.setOperator(sysUser.getId());
-			musicGroupPaymentCalender.setCreateTime(date);
-			musicGroupPaymentCalender.setUpdateTime(date);
-			musicGroupPaymentCalender.setStatus(status);
-
-			//缴费截止日期默认三天后
-			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
-				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
-			}
-			//校验缴费有效期冲突
-			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
-				if(musicGroupPaymentCalender.getPaymentValidStartDate() != null){
-					int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
-							musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
-					if (count > 0) {
-						throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
-					}
-				}
-			}
-
-			if (paymentType == PaymentType.ADD_STUDENT) {
-				musicGroupPaymentCalender.setPayUserType(STUDENT);
-				musicGroupPaymentCalender.setIsGiveMusicNetwork(false);
-				if (musicGroupPaymentCalender.getStatus() != AUDITING) {
-					musicGroupPaymentCalender.setExpectNum(1);
-				}
-			}
-			if (musicGroupPaymentCalender.getStatus() != AUDITING) {
-				if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
-					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-				} else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-				} else {
-					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
-				}
-			}
-
-			// 设置批次号
-			musicGroupPaymentCalender.setBatchNo(batchNo);
-			//设置会员缴费金额、级别以及有效期
-			musicGroupPaymentCalender.setMemberPaymentAmount(musicGroupPaymentCalenderDto.getMemberPaymentAmount());
-			musicGroupPaymentCalender.setMemberRankSettingId(musicGroupPaymentCalenderDto.getMemberRankSettingId());
-			musicGroupPaymentCalender.setMemberValidDate(musicGroupPaymentCalenderDto.getMemberValidDate());
-			musicGroupPaymentCalenderDto.setBatchNo(batchNo);
-			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
-
-			//课程费用列表
-			List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
-					.getMusicGroupPaymentCalenderCourseSettingsList();
-
-			if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
-				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender
-						.getMusicGroupOrganizationCourseSettingId());
-				for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
-					musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-					if (courseSettings != null) {
-						musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
-					}
-				}
-				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 			}
+		}
 
-			//如果是跨团班级合并,保存用户缴费详情
-			List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = null;
-			if (musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
-				musicGroupPaymentCalenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
-				//记录学员缴费详情
-				musicGroupPaymentCalenderStudentDetailDao.batchInsert(musicGroupPaymentCalenderStudentDetails,musicGroupPaymentCalender.getBatchNo());
-			}
+		// 设置批次号
+		musicGroupPaymentCalender.setBatchNo(batchNo);
+		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 
-			if (musicGroupPaymentCalender.getStatus() != AUDITING) {
-				// 如果是进行中加学生
-				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings,musicGroup);
-				}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
-					//如果是跨团班级合并,添加学员
-					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderStudentDetails);
-				}else if(musicGroupPaymentCalenderDto.getMergeClassFlag()){
-					//缴费项目添加学员
-					int[] ints = Arrays.stream(musicGroupPaymentCalenderDto.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
-					Set<Integer> list2 = Arrays.stream(ints).boxed().collect(Collectors.toSet());
-					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender.getId(),list2,musicGroup,false);
+		if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
+			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
+					.getMusicGroupOrganizationCourseSettingId());
+			for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
+				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+				if (courseSettings != null) {
+					musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
 				}
-				//将0元未缴费学员缴费状态更新为已缴费
-				int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
-				musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
-				musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 			}
+			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
 		}
 
 		// 如果是报名,需要修改乐团状态
@@ -882,7 +767,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (status != AUDITING) {
 				musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
 				// 记录操作日志
-				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(创建缴费 -> 报名中)", sysUser.getId(), ""));
+				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(创建缴费 -> 报名中)", sysUser.getId(), ""));
 			} else {
 				musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT);
 				// 记录操作日志
@@ -890,15 +775,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
-		} else if (paymentType == ADD_STUDENT) {
-			if (status != AUDITING) {
-				// 学生加到班级
-				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
-				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(musicGroupPaymentCalenderDto.getStudentIds()), classGroupIdStr,
-						batchNo, musicGroupPaymentCalenderCourseSettingsList,musicGroup);
-			}
 		}
-
 		if (status == AUDITING) {
 			// 如果是审核中
 			Set<Integer> roleIds = new HashSet<>(1);
@@ -906,10 +783,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			Organization organization = organizationDao.get(musicGroup.getOrganId());
 			sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()),
 					MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(), musicGroup.getName());
-		}else {
-			imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
 		}
-
 		return batchNo;
 	}
 
@@ -1258,7 +1132,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 
 			if (currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
-				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender
+				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
 						.getMusicGroupOrganizationCourseSettingId());
 				for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
 					musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());

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

@@ -150,10 +150,6 @@ public class MusicGroupTrainPlanServiceImpl extends BaseServiceImpl<Integer, Mus
 		return musicGroupTrainPlanSaveDto;
 	}
 
-	public static void main(String[] args) {
-
-	}
-
 	@Override
 	public MusicGroupTrainPlanSaveDto getSchoolTerm(CourseSchedule courseSchedule){
 		MusicGroupTrainPlanSaveDto musicGroupTrainPlanSaveDto = new MusicGroupTrainPlanSaveDto();

+ 49 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicRepairPaymentCalenderServiceImpl.java

@@ -0,0 +1,49 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dto.CalenderMemberDto;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
+import com.ym.mec.biz.dal.dto.MusicRepairDto;
+import com.ym.mec.biz.dal.entity.MemberFeeSetting;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderBaseService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysTenantConfigService;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.tenant.TenantContextHolder;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.math.BigDecimal;
+
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
+
+public class MusicRepairPaymentCalenderServiceImpl implements MusicGroupPaymentCalenderBaseService {
+
+    @Autowired
+    private SysTenantConfigService sysTenantConfigService;
+
+    @Override
+    public void createComponent(MusicGroupPaymentBaseCalender baseCalender) {
+
+    }
+
+    @Override
+    public MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        MusicRepairDto musicRepair = baseCalender.getMusicRepair();
+        if(musicRepair != null){
+            Integer tenantId = TenantContextHolder.getTenantId();
+            String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.ONE_YEAR_MUSICAL_REPAIR_AMOUNT, tenantId);
+            if(StringUtils.isEmpty(configValue)){
+                throw new BizException("操作失败:请配置乐保零售价");
+            }
+            //获取会员总价
+            BigDecimal repairPaymentAmount = new BigDecimal(configValue).multiply(musicRepair.getNum()).setScale(0, BigDecimal.ROUND_HALF_UP);
+            if(repairPaymentAmount.compareTo(musicRepair.getActualAmount()) != 0){
+                return AUDITING;
+            }
+        }
+        return NO;
+    }
+}

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

@@ -143,7 +143,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
                 throw new BizException("乐团课禁止跨天点名");
             }
         } else {
-            String sysConfigVip = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_BEFOR_COURSE_START_TIME_RANGE_VIP,tenantId);
+            String sysConfigVip = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP,tenantId);
             if(StringUtils.isNotEmpty(sysConfigVip)){
                 int i = Integer.parseInt(sysConfigVip);
                 int courseStartTime = DateUtil.minutesBetween(date, courseSchedule.getStartClassTime());
@@ -151,8 +151,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
                     throw new BizException("VIP课开课前{}分钟禁止点名", i);
                 }
             }
-            String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP, tenantId);
-            if(StringUtils.isNotEmpty(configValue)){
+            if(StringUtils.isNotEmpty(sysConfigVip)){
                 int i = Integer.parseInt(sysConfigVip);
                 int courseEndTime = DateUtil.minutesBetween(courseSchedule.getEndClassTime(), date);
                 if (date.after(courseSchedule.getEndClassTime()) && courseEndTime > i) {

+ 12 - 4
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -35,6 +35,7 @@
         <result column="original_member_payment_amount_" property="originalMemberPaymentAmount"/>
         <result column="member_rank_setting_id_" property="memberRankSettingId"/>
         <result column="member_valid_date_" property="memberValidDate"/>
+        <result column="member_period_" property="memberPeriod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -53,12 +54,14 @@
         INSERT INTO music_group_payment_calender
         (music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,
-        payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_)
+        payment_pattern_,payment_type_,payment_amount_,batch_no_,audit_memo_,operator_,attribute1_,
+         attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_,member_period_)
         VALUES(#{musicGroupId},#{musicGroupOrganizationCourseSettingId},#{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{rejectReason},#{startPaymentDate},#{deadlinePaymentDate},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{expectNum},#{actualNum},#{memo},#{isGiveMusicNetwork},now(),now(),
         #{paymentValidStartDate},#{paymentValidEndDate},#{paymentPattern},#{paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2},#{studentIds},#{memberPaymentAmount},#{memberRankSettingId},#{memberValidDate},#{originalMemberPaymentAmount})
+        #{paymentAmount},#{batchNo},#{auditMemo},#{operator},#{attribute1},#{attribute2},#{studentIds},
+               #{memberPaymentAmount},#{memberRankSettingId},#{memberValidDate},#{originalMemberPaymentAmount},#{memberPeriod})
     </insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
@@ -66,13 +69,15 @@
         INSERT INTO music_group_payment_calender
         (music_group_id_,music_group_organization_course_settings_id_,pay_user_type_,reject_reason_,start_payment_date_,deadline_payment_date_,status_,expect_num_,
         actual_num_,memo_,is_give_music_network_,create_time_,update_time_,payment_valid_start_date_,payment_valid_end_date_,payment_pattern_,payment_amount_,
-        payment_type_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_)
+        payment_type_,batch_no_,audit_memo_,operator_,attribute1_,attribute2_,student_ids_,
+         member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_,member_period_)
         VALUES
         <foreach collection="list" item="item" index="index" separator=",">
         (#{item.musicGroupId},#{item.musicGroupOrganizationCourseSettingId},#{item.payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.rejectReason},#{item.startPaymentDate},#{item.deadlinePaymentDate},#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{item.expectNum},#{item.actualNum},#{item.memo},#{item.isGiveMusicNetwork},now(),now(),
         #{item.paymentValidStartDate},#{item.paymentValidEndDate},#{item.paymentPattern},#{item.paymentAmount},#{item.paymentType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{item.batchNo},#{item.auditMemo},#{item.operator},#{item.attribute1},#{item.attribute2},#{item.studentIds},#{item.memberPaymentAmount},#{item.memberRankSettingId},#{item.memberValidDate},#{item.originalMemberPaymentAmount})
+        #{item.batchNo},#{item.auditMemo},#{item.operator},#{item.attribute1},#{item.attribute2},
+         #{item.studentIds},#{item.memberPaymentAmount},#{item.memberRankSettingId},#{item.memberValidDate},#{item.originalMemberPaymentAmount},#{item.memberPeriod})
         </foreach>
     </insert>
 
@@ -80,6 +85,9 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
         UPDATE music_group_payment_calender
         <set>
+            <if test="memberPeriod != null">
+                member_period_ = #{memberPeriod},
+            </if>
             <if test="originalMemberPaymentAmount != null">
                 original_member_payment_amount_ = #{originalMemberPaymentAmount},
             </if>

+ 1 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -93,7 +93,6 @@ public class TeacherCourseScheduleController extends BaseController {
         String configValue1 = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP, user.getTenantId());
         String courseBeforeBufferTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_BEFORE_BUFFER_TIME, user.getTenantId());
         String courseAfterBufferTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_AFTER_BUFFER_TIME, user.getTenantId());
-        String configValue = sysTenantConfigService.getTenantConfigValue(SysConfigService.ENABLE_STUDENT_ATTENDANCE_BEFOR_COURSE_START_TIME_RANGE_VIP, user.getTenantId());
         List<CourseScheduleDto> teacherCourseSchedulesWithDate = scheduleService.getTeacherCourseSchedulesWithDate(user.getId(),date,type,user.getTenantId());
         Map<String,Object> result = new HashMap<>();
         result.put("rows",teacherCourseSchedulesWithDate);
@@ -101,7 +100,7 @@ public class TeacherCourseScheduleController extends BaseController {
         result.put("offlineSignInEarlyForwardTime", StringUtils.isEmpty(offlineSignInEarlyForwardTime)?60:Integer.parseInt(offlineSignInEarlyForwardTime));
         result.put("enableStudentAttendanceTimeRange",sysConfig.getParanValue(Integer.class));
         result.put("enableStudentAttendanceTimeRangeVip",StringUtils.isEmpty(configValue1)?0:Integer.parseInt(configValue1));
-        result.put("joinRoomBeforeTime",StringUtils.isEmpty(configValue)?0:Integer.parseInt(configValue));
+        result.put("joinRoomBeforeTime",StringUtils.isEmpty(courseBeforeBufferTime)?10:Integer.parseInt(courseBeforeBufferTime));
         result.put("courseBeforeBufferTime", StringUtils.isEmpty(courseBeforeBufferTime)?10:Integer.parseInt(courseBeforeBufferTime));
         result.put("courseAfterBufferTime", StringUtils.isEmpty(courseAfterBufferTime)?10:Integer.parseInt(courseAfterBufferTime));
         return succeed(result);