Explorar o código

Merge remote-tracking branch 'origin/saas' into saas

# Conflicts:
#	mec-web/src/main/java/com/ym/mec/web/controller/SysManualController.java
yanite %!s(int64=3) %!d(string=hai) anos
pai
achega
e5bf47e97b
Modificáronse 23 ficheiros con 509 adicións e 199 borrados
  1. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderActivityDao.java
  2. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CalenderMemberDto.java
  3. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentBaseCalender.java
  4. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicRepairDto.java
  5. 44 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  6. 123 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderActivity.java
  7. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/DeductReasonEnum.java
  8. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderActivityService.java
  9. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderBaseService.java
  10. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java
  11. 19 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  12. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPaymentCalenderServiceImpl.java
  13. 45 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderActivityServiceImpl.java
  14. 43 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderCourseSettingsServiceImpl.java
  15. 58 154
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  16. 11 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicRepairPaymentCalenderServiceImpl.java
  17. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  18. 10 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java
  19. 2 2
      mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  20. 27 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml
  21. 24 4
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  22. 5 13
      mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java
  23. 12 1
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderActivityDao.java

@@ -0,0 +1,12 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MusicGroupPaymentCalenderActivityDao extends BaseMapper<MusicGroupPaymentCalenderActivity> {
+
+    void insertBatch(@Param("calenderActivityList") List<MusicGroupPaymentCalenderActivity> musicGroupPaymentCalenderActivities);
+}

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

@@ -20,7 +20,7 @@ public class CalenderMemberDto {
     @ApiModelProperty(value = "会员等级编号", required = false)
     private Integer memberRankSettingId = 1;
 
-    @ApiModelProperty(value = "是否选", required = false)
+    @ApiModelProperty(value = "是否选", required = false)
     private Boolean optionalFlag = false;
 
     public PeriodEnum getPeriodEnum() {

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

@@ -3,6 +3,7 @@ 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.MusicGroupPaymentCalenderActivity;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -43,9 +44,20 @@ public class MusicGroupPaymentBaseCalender {
 	@ApiModelProperty(value = "乐保信息", required = false)
 	private MusicRepairDto musicRepair;
 
+	@ApiModelProperty(value = "乐团活动相关信息(vip、网管课)", required = false)
+	private List<MusicGroupPaymentCalenderActivity> calenderActivityList;
+
 	@ApiModelProperty(value = "乐团课程信息", required = false)
 	private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList;
 
+	public List<MusicGroupPaymentCalenderActivity> getCalenderActivityList() {
+		return calenderActivityList;
+	}
+
+	public void setCalenderActivityList(List<MusicGroupPaymentCalenderActivity> calenderActivityList) {
+		this.calenderActivityList = calenderActivityList;
+	}
+
 	public MusicRepairDto getMusicRepair() {
 		return musicRepair;
 	}

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

@@ -12,6 +12,17 @@ public class MusicRepairDto {
     @ApiModelProperty(value = "团购价", required = false)
     private BigDecimal actualAmount;
 
+    @ApiModelProperty(value = "是否必选", required = false)
+    private Boolean optionalFlag = false;
+
+    public Boolean getOptionalFlag() {
+        return optionalFlag;
+    }
+
+    public void setOptionalFlag(Boolean optionalFlag) {
+        this.optionalFlag = optionalFlag;
+    }
+
     public BigDecimal getNum() {
         return num;
     }

+ 44 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java

@@ -188,6 +188,50 @@ public class MusicGroupPaymentCalender extends BaseEntity {
 	//会员等级名称
 	private String memberRankSettingName;
 
+	//会员是否必选
+	private Boolean memberOptionalFlag = false;
+
+	//乐保年限
+	private BigDecimal musicRepairNum = BigDecimal.ZERO;
+
+	//乐保购买价格
+	private BigDecimal musicRepairActualPrice = BigDecimal.ZERO;
+
+	//乐保是否必选
+	private Boolean musicRepairOptionalFlag = false;
+
+	public Boolean getMemberOptionalFlag() {
+		return memberOptionalFlag;
+	}
+
+	public void setMemberOptionalFlag(Boolean memberOptionalFlag) {
+		this.memberOptionalFlag = memberOptionalFlag;
+	}
+
+	public BigDecimal getMusicRepairNum() {
+		return musicRepairNum;
+	}
+
+	public void setMusicRepairNum(BigDecimal musicRepairNum) {
+		this.musicRepairNum = musicRepairNum;
+	}
+
+	public BigDecimal getMusicRepairActualPrice() {
+		return musicRepairActualPrice;
+	}
+
+	public void setMusicRepairActualPrice(BigDecimal musicRepairActualPrice) {
+		this.musicRepairActualPrice = musicRepairActualPrice;
+	}
+
+	public Boolean getMusicRepairOptionalFlag() {
+		return musicRepairOptionalFlag;
+	}
+
+	public void setMusicRepairOptionalFlag(Boolean musicRepairOptionalFlag) {
+		this.musicRepairOptionalFlag = musicRepairOptionalFlag;
+	}
+
 	public PeriodEnum getMemberPeriod() {
 		return memberPeriod;
 	}

+ 123 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderActivity.java

@@ -0,0 +1,123 @@
+package com.ym.mec.biz.dal.entity;
+
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+/**
+ * 缴费项目关联活动(MusicGroupPaymentCalenderActivity)表实体类
+ *
+ * @author zx
+ * @since 2021-12-22 15:54:47
+ */
+@ApiModel(value = "music_group_payment_calender_activity-缴费项目关联活动")
+public class MusicGroupPaymentCalenderActivity implements Serializable {
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "${column.comment}")
+    private Long id;
+
+    @TableField("activity_id_")
+    @ApiModelProperty(value = "活动编号")
+    private Integer activityId;
+
+    @TableField("calender_id_")
+    @ApiModelProperty(value = "缴费项目编号")
+    private Long calenderId;
+
+    @TableField("optional_flag_")
+    @ApiModelProperty(value = "是否必选")
+    private Integer optionalFlag;
+
+    @TableField("actual_amount_")
+    @ApiModelProperty(value = "现价")
+    private BigDecimal actualAmount;
+
+    @TableField("original_amount_")
+    @ApiModelProperty(value = "原价")
+    private BigDecimal originalAmount;
+
+    @TableField("create_time_")
+    @ApiModelProperty(value = "${column.comment}")
+    private Date createTime;
+
+    @TableField("update_time_")
+    @ApiModelProperty(value = "${column.comment}")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getActivityId() {
+        return activityId;
+    }
+
+    public void setActivityId(Integer activityId) {
+        this.activityId = activityId;
+    }
+
+    public Long getCalenderId() {
+        return calenderId;
+    }
+
+    public void setCalenderId(Long calenderId) {
+        this.calenderId = calenderId;
+    }
+
+    public Integer getOptionalFlag() {
+        return optionalFlag;
+    }
+
+    public void setOptionalFlag(Integer optionalFlag) {
+        this.optionalFlag = optionalFlag;
+    }
+
+    public BigDecimal getActualAmount() {
+        return actualAmount;
+    }
+
+    public void setActualAmount(BigDecimal actualAmount) {
+        this.actualAmount = actualAmount;
+    }
+
+    public BigDecimal getOriginalAmount() {
+        return originalAmount;
+    }
+
+    public void setOriginalAmount(BigDecimal originalAmount) {
+        this.originalAmount = originalAmount;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+
+}
+

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

@@ -9,8 +9,8 @@ import com.ym.mec.common.enums.BaseEnum;
 public enum DeductReasonEnum implements BaseEnum<String,DeductReasonEnum> {
     SIGN_IN_TIME_ERR("SIGN_IN_TIME_ERR", "签到时间异常", ""),
     SIGN_OUT_TIME_ERR("SIGN_OUT_TIME_ERR", "签退时间异常", ""),
-    GPS_ERR_IN("GPS_ERR", "位置异常", ""),
-    GPS_ERR_OUT("GPS_ERR", "位置异常", ""),
+    GPS_ERR_IN("GPS_ERR", "签到位置异常", ""),
+    GPS_ERR_OUT("GPS_ERR", "签退位置异常", ""),
     NOT_SETTLEMENT("NOT_SETTLEMENT", "不结算课酬", "特殊老师不结算课酬"),
     TRAIL("TRAIL", "试用期扣减", "试用期老师课酬按系统配置的折扣计算"),
 

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderActivityService.java

@@ -0,0 +1,15 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
+
+public interface MusicGroupPaymentCalenderActivityService {
+    /**
+    * @description: 新增活动缴费项目
+     * @param musicGroupPaymentBaseCalender
+     * @param calenderId
+    * @return void
+    * @author zx
+    * @date 2021/12/22 15:31
+    */
+    void batchInsert(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender, Long calenderId);
+}

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

@@ -3,6 +3,8 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 
+import java.math.BigDecimal;
+
 public interface MusicGroupPaymentCalenderBaseService {
 
     /**
@@ -22,4 +24,13 @@ public interface MusicGroupPaymentCalenderBaseService {
     * @date 2021/12/21 11:37
     */
     MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender);
+
+    /**
+    * @description: 获取实际金额
+     * @param baseCalender
+    * @return java.math.BigDecimal
+    * @author zx
+    * @date 2021/12/21 23:35
+    */
+    BigDecimal getActualAmount(MusicGroupPaymentBaseCalender baseCalender);
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.common.service.BaseService;
 import java.util.List;
@@ -16,4 +17,12 @@ public interface MusicGroupPaymentCalenderCourseSettingsService extends BaseServ
      * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
      */
     Map<String, Integer> getMusicCourseSettingsWithStudents(String musicGroupId, List<Integer> studentIds);
+
+    void batchInsert(MusicGroupPaymentCalender musicGroupPaymentCalender);
+
+    void deleteByMusicGroupPaymentCalenderId(List<Long> calenderIds);
+
+    List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Long calenderId);
+
+    List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettingsByBatchNo(String batchNo);
 }

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

@@ -279,7 +279,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
             //判断课程是否在试用期内
             if(isTrail(teacher,courseScheduleTeacherSalary.getCourseSchedule().getClassDate())){
-                expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary/100));
+                expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary/100)).setScale(0,BigDecimal.ROUND_HALF_UP);
                 deductReasons.add("未转正");
             }
 
@@ -395,7 +395,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             //判断课程是否在试用期内
             //如果上课日期在试用期内按80%结算
             if(isTrail(teacher,courseScheduleTeacherSalary.getCourseSchedule().getClassDate())){
-                expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary/100));
+                expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary/100)).setScale(0,BigDecimal.ROUND_HALF_UP);
                 deductReasons.add("未转正");
             }
             //扣除费用
@@ -538,7 +538,12 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             }
             //是否异常签到
             if(signCourseTimeBetween >= 0 && signCourseTimeBetween < i){
-                return SalarySettlementSignEnum.ERR_IN;
+                if(teachModeEnum == TeachModeEnum.ONLINE){
+                    //线上课,没有异常签到
+                    return SalarySettlementSignEnum.LATE;
+                }else {
+                    return SalarySettlementSignEnum.ERR_IN;
+                }
             }
         }
         //迟到规则
@@ -769,7 +774,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
             //如果上课日期在试用期内按80%结算
             if(isTrail(teacher,courseSchedule.getClassDate())){
-                teacherSalary = teacherSalary.multiply(new BigDecimal(probationTeacherSalary/100));
+                teacherSalary = teacherSalary.multiply(new BigDecimal(probationTeacherSalary/100)).setScale(0,BigDecimal.ROUND_HALF_UP);
                 deductReasons.add("未转正");
             }
 
@@ -1659,21 +1664,21 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
         //试用期课酬规则
         String configValue2 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PROBATION_TEACHER_SALARY,tenantId);
-        Integer probationTeacherSalary = 100;
+        double probationTeacherSalary = 100;
         if(StringUtils.isNotEmpty(configValue2)){
-            probationTeacherSalary = Integer.parseInt(configValue2);
+            probationTeacherSalary = Double.parseDouble(configValue2);
         }
         //如果上课日期在试用期内按80%结算
         BigDecimal expectTeacherSalary = teacherSalary;
         if(isTrail(teacher,courseSchedule.getClassDate())){
-            teacherSalary = teacherSalary.multiply(new BigDecimal(probationTeacherSalary / 100));
+            teacherSalary = teacherSalary.multiply(new BigDecimal(probationTeacherSalary / 100)).setScale(0,BigDecimal.ROUND_HALF_UP);
             deductReasons.add(new TeacherSalaryDeductReasonDto(DeductReasonEnum.TRAIL, expectTeacherSalary.subtract(teacherSalary)));
         }
 
         //扣除费用
         BigDecimal deductCost = BigDecimal.ZERO;
         //获取签到状态
-        TeachModeEnum teachMode = courseScheduleTeacherSalary.getCourseSchedule().getTeachMode();
+        TeachModeEnum teachMode = courseSchedule.getTeachMode();
         TeacherAttendance teacherAttendance = null;
         if(teacherAttendances != null && teacherAttendances.size() > 0){
             teacherAttendance = teacherAttendances.get(0);
@@ -1765,14 +1770,14 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
         //试用期课酬规则
         String configValue2 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PROBATION_TEACHER_SALARY,tenantId);
-        Integer probationTeacherSalary = 100;
+        double probationTeacherSalary = 100;
         if(StringUtils.isNotEmpty(configValue2)){
-            probationTeacherSalary = Integer.parseInt(configValue2);
+            probationTeacherSalary = Double.parseDouble(configValue2);
         }
         //如果上课日期在试用期内按80%结算
         BigDecimal expectTeacherSalary = expectSalary;
         if(isTrail(teacher,courseSchedule.getClassDate())){
-            expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary / 100));
+            expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary / 100)).setScale(0,BigDecimal.ROUND_HALF_UP);
             deductReasons.add(new TeacherSalaryDeductReasonDto(DeductReasonEnum.TRAIL, expectTeacherSalary.subtract(expectSalary)));
         }
         //扣除费用
@@ -1858,13 +1863,13 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         //如果上课日期在试用期内按80%结算
         //试用期课酬规则
         String configValue2 = sysTenantConfigService.getTenantConfigValue(SysConfigService.PROBATION_TEACHER_SALARY,tenantId);
-        Integer probationTeacherSalary = 100;
+        double probationTeacherSalary = 100;
         if(StringUtils.isNotEmpty(configValue2)){
-            probationTeacherSalary = Integer.parseInt(configValue2);
+            probationTeacherSalary = Double.parseDouble(configValue2);
         }
         BigDecimal expectTeacherSalary = expectSalary;
         if(isTrail(teacher,courseSchedule.getClassDate())){
-            expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary / 100));
+            expectSalary = expectSalary.multiply(new BigDecimal(probationTeacherSalary / 100)).setScale(0,BigDecimal.ROUND_HALF_UP);
             deductReasons.add(new TeacherSalaryDeductReasonDto(DeductReasonEnum.TRAIL, expectTeacherSalary.subtract(expectSalary)));
         }
 

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

@@ -10,12 +10,15 @@ 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 org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
 
 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;
 
+@Service(value = "memberCalenderService")
 public class MemberPaymentCalenderServiceImpl implements MusicGroupPaymentCalenderBaseService {
 
     @Autowired
@@ -45,6 +48,15 @@ public class MemberPaymentCalenderServiceImpl implements MusicGroupPaymentCalend
         return NO;
     }
 
+    @Override
+    public BigDecimal getActualAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        CalenderMemberDto calenderMember = baseCalender.getCalenderMember();
+        if(calenderMember != null){
+            return calenderMember.getActualAmount();
+        }
+        return BigDecimal.ZERO;
+    }
+
     private BigDecimal getGroupPurchaseFee(PeriodEnum periodEnum,MemberFeeSetting memberFee){
         switch (periodEnum){
             case MONTH :

+ 45 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderActivityServiceImpl.java

@@ -0,0 +1,45 @@
+package com.ym.mec.biz.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderActivityDao;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderActivityService;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderBaseService;
+import org.springframework.stereotype.Service;
+import java.math.BigDecimal;
+import java.util.List;
+
+@Service
+public class MusicGroupPaymentCalenderActivityServiceImpl extends ServiceImpl<MusicGroupPaymentCalenderActivityDao, MusicGroupPaymentCalenderActivity>
+        implements MusicGroupPaymentCalenderActivityService, MusicGroupPaymentCalenderBaseService {
+
+    @Override
+    public void createComponent(MusicGroupPaymentBaseCalender baseCalender) {
+
+    }
+
+    @Override
+    public MusicGroupPaymentCalender.PaymentCalenderStatusEnum checkComponentAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        return null;
+    }
+
+    @Override
+    public BigDecimal getActualAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        List<MusicGroupPaymentCalenderActivity> calenderActivityList = baseCalender.getCalenderActivityList();
+        if(calenderActivityList != null && calenderActivityList.size() > 0){
+            return calenderActivityList.stream().map(e->e.getActualAmount()).reduce(BigDecimal.ZERO,BigDecimal::add);
+        }
+        return BigDecimal.ZERO;
+    }
+
+    @Override
+    public void batchInsert(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender, Long calenderId) {
+        List<MusicGroupPaymentCalenderActivity> calenderActivityList = musicGroupPaymentBaseCalender.getCalenderActivityList();
+        if(calenderActivityList != null && calenderActivityList.size() > 0){
+            calenderActivityList.stream().forEach(e->e.setCalenderId(calenderId));
+            baseMapper.insertBatch(calenderActivityList);
+        }
+    }
+}

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

@@ -5,6 +5,7 @@ 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.MusicGroupOrganizationCourseSettingsService;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderBaseService;
 import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +36,8 @@ public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServ
 	private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
 	@Autowired
 	private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
+	@Autowired
+	private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
 
 	@Override
 	public BaseDAO<Integer, MusicGroupPaymentCalenderCourseSettings> getDAO() {
@@ -63,6 +66,37 @@ public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServ
 		return result;
 	}
 
+    @Override
+    public void batchInsert(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingss = musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList();
+		if (musicGroupPaymentCalenderCourseSettingss != null && musicGroupPaymentCalenderCourseSettingss.size() > 0) {
+			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
+					.getMusicGroupOrganizationCourseSettingId());
+			for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingss) {
+				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+				if (courseSettings != null) {
+					musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
+				}
+			}
+			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingss);
+		}
+    }
+
+	@Override
+	public void deleteByMusicGroupPaymentCalenderId(List<Long> calenderIds) {
+		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
+	}
+
+	@Override
+	public List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Long calenderId) {
+		return musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
+	}
+
+	@Override
+	public List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettingsByBatchNo(String batchNo) {
+		return musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo);
+	}
+
 	@Override
 	public void createComponent(MusicGroupPaymentBaseCalender baseCalender) {
 
@@ -115,4 +149,13 @@ public class MusicGroupPaymentCalenderCourseSettingsServiceImpl extends BaseServ
 		}
 		return MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
 	}
+
+	@Override
+	public BigDecimal getActualAmount(MusicGroupPaymentBaseCalender baseCalender) {
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = baseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
+		if(musicGroupPaymentCalenderCourseSettingsList != null && musicGroupPaymentCalenderCourseSettingsList.size() > 0){
+			return musicGroupPaymentCalenderCourseSettingsList.stream().map(e -> e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+		}
+		return BigDecimal.ZERO;
+	}
 }

+ 58 - 154
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -26,6 +26,7 @@ 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.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
@@ -49,6 +50,9 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.springframework.util.Assert;
+
+import javax.annotation.Resource;
 
 @Service
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
@@ -59,46 +63,32 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
 	@Autowired
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
-	
 	@Autowired
-	private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
-	
+	private MusicGroupPaymentCalenderCourseSettingsService musicGroupPaymentCalenderCourseSettingsService;
 	@Autowired
 	private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
-
 	@Autowired
 	private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
-	
 	@Autowired
 	private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
-	
 	@Autowired
 	private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
-
 	@Autowired
 	private MusicGroupSchoolTermCourseDetailDao musicGroupSchoolTermCourseDetailDao;
-
 	@Autowired
 	private MusicGroupSchoolTermStudentCourseDetailDao musicGroupSchoolTermStudentCourseDetailDao;
-	
 	@Autowired
 	private IdGeneratorService idGeneratorService;
-	
 	@Autowired
 	private ClassGroupService classGroupService;
-	
 	@Autowired
 	private MusicGroupDao musicGroupDao;
-
 	@Autowired
 	private ClassGroupDao classGroupDao;
-
 	@Autowired
 	private CourseScheduleDao courseScheduleDao;
-
 	@Autowired
 	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
-
 	@Autowired
 	private TeacherAttendanceDao teacherAttendanceDao;
 	@Autowired
@@ -127,7 +117,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	private StudentRegistrationDao studentRegistrationDao;
 	@Autowired
 	private GroupEventSource groupEventSource;
-
 	@Autowired
 	private StudentPaymentOrderDao studentPaymentOrderDao;
 	@Autowired
@@ -139,7 +128,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Autowired
 	private CloudTeacherOrderDao cloudTeacherOrderDao;
 	@Autowired
-	private MusicGroupPaymentCalenderBaseService musicGroupPaymentCalenderBaseService;
+	private MusicGroupPaymentCalenderActivityService musicGroupPaymentCalenderActivityService;
+	@Resource(name = "musicRepairService")
+	private MusicGroupPaymentCalenderBaseService musicRepairService;
+	@Resource(name = "memberCalenderService")
+	private MusicGroupPaymentCalenderBaseService memberCalenderService;
 
 	@Override
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
@@ -462,20 +455,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 
 			//课程费用列表
-			List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
-					.getMusicGroupPaymentCalenderCourseSettingsList();
-
-			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());
-					}
-				}
-				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
-			}
+			musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
 
 			//如果是跨团班级合并,保存用户缴费详情
 			List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = null;
@@ -488,7 +468,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (musicGroupPaymentCalender.getStatus() != AUDITING) {
 				// 如果是进行中加学生
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings,musicGroup);
+					addStudent(musicGroupPaymentCalender, musicGroupPaymentCalender
+							.getMusicGroupPaymentCalenderCourseSettingsList(),musicGroup);
 				}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
 					//如果是跨团班级合并,添加学员
 					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderStudentDetails);
@@ -544,7 +525,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public String create1(MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
-
+		if(musicGroupPaymentBaseCalender == null){
+			throw new BizException("参数校验异常");
+		}
+		if(musicGroupPaymentBaseCalender.getCalenderActivityList() == null
+				&& musicGroupPaymentBaseCalender.getCalenderMember() == null
+				&& musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList() == null
+				&& musicGroupPaymentBaseCalender.getMusicRepair() == null){
+			throw new BizException("请选择一个缴费项目");
+		}
 		String musicGroupId = musicGroupPaymentBaseCalender.getMusicGroupId();
 
 		PaymentType paymentType = musicGroupPaymentBaseCalender.getPaymentType();
@@ -584,95 +573,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		Date date = new Date();
 		String batchNo = idGeneratorService.generatorId() + "";
 
-		// 获取设置的课程收费标准
-//		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentBaseCalender.getMusicGroupPaymentCalenderCourseSettingsList();
-
-		//会员原价
-//		BigDecimal memberPaymentAmount = BigDecimal.ZERO;
 		BigDecimal originalMemberPaymentAmount = BigDecimal.ZERO;
 		if (payUserType == SCHOOL) {
 			status = AUDITING;
 		} else {
-			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;
-//				}
-//			}
+			status = memberCalenderService.checkComponentAmount(musicGroupPaymentBaseCalender);
+			if(status != AUDITING){
+				status = ((MusicGroupPaymentCalenderCourseSettingsServiceImpl)musicGroupPaymentCalenderCourseSettingsService).checkComponentAmount(musicGroupPaymentBaseCalender);
+			}
+			if(status != AUDITING){
+				status = musicRepairService.checkComponentAmount(musicGroupPaymentBaseCalender);
+			}
 		}
 
 		MusicGroupPaymentCalender musicGroupPaymentCalender = new MusicGroupPaymentCalender();
@@ -681,29 +592,38 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		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);
+		musicGroupPaymentCalender.setPaymentType(musicGroupPaymentBaseCalender.getPaymentType());
+
+		BigDecimal totalPaymentAmount = BigDecimal.ZERO;
+		totalPaymentAmount = totalPaymentAmount.add(memberCalenderService.getActualAmount(musicGroupPaymentBaseCalender));
+		totalPaymentAmount = totalPaymentAmount.add(((MusicGroupPaymentCalenderCourseSettingsServiceImpl)musicGroupPaymentCalenderCourseSettingsService).getActualAmount(musicGroupPaymentBaseCalender));
+		totalPaymentAmount = totalPaymentAmount.add(musicRepairService.getActualAmount(musicGroupPaymentBaseCalender));
+		totalPaymentAmount = totalPaymentAmount.add(((MusicGroupPaymentCalenderActivityServiceImpl)musicGroupPaymentCalenderActivityService).getActualAmount(musicGroupPaymentBaseCalender));
+		musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
+
+		//会员缴费信息
 		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());
+			musicGroupPaymentCalender.setMemberOptionalFlag(calenderMember.getOptionalFlag());
 		}
-		//课程费用列表
-		List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
-				.getMusicGroupPaymentCalenderCourseSettingsList();
-		if (currentMusicGroupPaymentCalenderCourseSettings != null && currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
-			totalPaymentAmount.add(currentMusicGroupPaymentCalenderCourseSettings.stream().map(e -> e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add));
+		//乐保缴费信息
+		MusicRepairDto musicRepair = musicGroupPaymentBaseCalender.getMusicRepair();
+		if(musicRepair != null){
+			musicGroupPaymentCalender.setMusicRepairNum(musicRepair.getNum());
+			musicGroupPaymentCalender.setMusicRepairActualPrice(musicRepair.getActualAmount());
+			musicGroupPaymentCalender.setMusicRepairOptionalFlag(musicRepair.getOptionalFlag());
 		}
-		musicGroupPaymentCalender.setPaymentAmount(totalPaymentAmount);
 
 //		BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
 //		if(musicGroupPaymentCalenderCourseSettingsList != null){
@@ -750,17 +670,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setBatchNo(batchNo);
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 
-		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());
-				}
-			}
-			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
-		}
+		//课程费用列表
+		musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
+		//活动费用列表
+		musicGroupPaymentCalenderActivityService.batchInsert(musicGroupPaymentBaseCalender,musicGroupPaymentCalender.getId());
 
 		// 如果是报名,需要修改乐团状态
 		if (paymentType == MUSIC_APPLY) {
@@ -797,7 +710,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
 		//收费标准名称
 		String name = musicGroupPaymentCalenderDao.getCalenderSettingsName(id);
-		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(id);
+		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(id);
 		Map<String, Object> result = new HashMap<>(4);
 		result.put("musicGroupPaymentCalenderCourseSettings", musicGroupPaymentCalenderCourseSettings);
 		if(calender.getMemberRankSettingId() != null){
@@ -859,7 +772,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		List<Long> calenderIds = musicGroupPaymentCalenderList.stream().map(MusicGroupPaymentCalender :: getId).collect(Collectors.toList());
 		//删除原来数据
 		musicGroupPaymentCalenderDao.delByIds(calenderIds);
-		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
+		musicGroupPaymentCalenderCourseSettingsService.deleteByMusicGroupPaymentCalenderId(calenderIds);
 
 		status = PaymentCalenderStatusEnum.NO;
 
@@ -1131,17 +1044,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 			}
 
-			if (currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
-				MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsService.get(musicGroupPaymentCalender
-						.getMusicGroupOrganizationCourseSettingId());
-				for (MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : currentMusicGroupPaymentCalenderCourseSettings) {
-					musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-					if (courseSettings != null) {
-						musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
-					}
-				}
-				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
-			}
+			//课程费用列表
+			musicGroupPaymentCalenderCourseSettingsService.batchInsert(musicGroupPaymentCalender);
 		}
 
 		// 如果是报名,需要修改乐团状态
@@ -1457,7 +1361,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 		}
 		//获取收费标准
-		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo));
 		//获取跨团合班学员缴费详情
 		calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
 		return calenderAuditDetailDto;
@@ -1561,7 +1465,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 					musicGroupPaymentCalender.setExpectNum(1);
-					List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
+					List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
 					addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings,musicGroup);
 				}
 			}
@@ -1609,7 +1513,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				String classGroupIdStr = calender.getAttribute1();
 				if (StringUtils.isNotBlank(classGroupIdStr)) {
 					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
-							musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo),musicGroup);
+							musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo),musicGroup);
 				}
 				MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
 				if(musicGroupStudentClassAdjust != null){
@@ -1835,7 +1739,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		
 		List<Long> calenderIds = new ArrayList<Long>();
 		calenderIds.add(id);
-		musicGroupPaymentCalenderCourseSettingsDao.deleteByMusicGroupPaymentCalenderId(calenderIds);
+		musicGroupPaymentCalenderCourseSettingsService.deleteByMusicGroupPaymentCalenderId(calenderIds);
 		
 		//如果乐团是“费用审核”,则需要修改状态
 		MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());

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

@@ -1,10 +1,7 @@
 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;
@@ -13,12 +10,14 @@ 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 org.springframework.stereotype.Service;
 
 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;
 
+@Service(value = "musicRepairService")
 public class MusicRepairPaymentCalenderServiceImpl implements MusicGroupPaymentCalenderBaseService {
 
     @Autowired
@@ -46,4 +45,13 @@ public class MusicRepairPaymentCalenderServiceImpl implements MusicGroupPaymentC
         }
         return NO;
     }
+
+    @Override
+    public BigDecimal getActualAmount(MusicGroupPaymentBaseCalender baseCalender) {
+        MusicRepairDto musicRepair = baseCalender.getMusicRepair();
+        if(musicRepair != null){
+            return musicRepair.getActualAmount().multiply(musicRepair.getNum());
+        }
+        return BigDecimal.ZERO;
+    }
 }

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

@@ -816,7 +816,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				}
 				//如果课程时间在两天前
 				int i = DateUtil.daysBetween(classDate, DateUtil.stringToDate(DateUtil.format(date, DateUtil.DEFAULT_PATTERN), DateUtil.DEFAULT_PATTERN));
-				if (i > --day) {
+				if (i > day) {
 					throw new BizException("超出可申述时间");
 				}
 			}

+ 10 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -253,7 +253,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         RBucket<Object> bucket = redissonClient.getBucket(key);
         //原子操作 抢锁成功为true
         if (!bucket.trySet(tenantId, 3L, TimeUnit.MINUTES)) {
-            throw new BizException("机构正在开通中请勿频繁操作");
+            throw new BizException("机构正在开通中请勿频繁操作");
         }
         //获取产品信息得到服务id
         TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
@@ -269,7 +269,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         //拆分菜单获取菜单ID
         List<Integer> collectMenuId = getMenuId(menuIdList);
         //建立角色
-        Integer roleId = createRole(tenantId);
+        Integer roleId = createRole(tenantInfo);
         //建立角色和菜单关系数据
         employeeService.batchInsertRoleMenu(roleId, collectMenuId);
         // 创建账号、用户信息、用户和角色关系
@@ -287,13 +287,15 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
     }
 
     //创建角色
-    private Integer createRole(Integer tenantId) {
+    private Integer createRole(TenantInfo tenantInfo) {
         SysRole sysRole = new SysRole();
         sysRole.setRoleName("管理员");
         sysRole.setRoleDesc("管理员");
         sysRole.setCreateTime(new Date());
         sysRole.setDelFlag("0");
-        sysRole.setTenantId(tenantId);
+        sysRole.setTenantId(tenantInfo.getId());
+        Organization organization = organizationDao.getByName(tenantInfo.getName(), tenantInfo.getId());
+        sysRole.setOrganId(organization.getId());
         employeeService.insertSysRole(sysRole);
         return sysRole.getId();
     }
@@ -306,6 +308,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         e.setJobNature(JobNatureEnum.FULL_TIME);
         e.setEntryDate(LocalDate.now().toDate());
         e.setRoles(roles);
+        e.setRoleIds(roles);
         try {
             employeeService.add(e);
         } catch (Exception ex) {
@@ -342,6 +345,9 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         RBucket<Object> bucket = redissonClient.getBucket(key);
         //原子操作 抢锁成功为true
         if (!bucket.trySet(tenantId, 10, TimeUnit.SECONDS)) {
+            if(tenantInfo.getPayState() == 1){
+                throw new BizException("已缴费请勿重复缴费!");
+            }
             throw new BizException("该机构数正在缴费中请勿频繁操作");
         }
         //机构产品信息

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

@@ -94,8 +94,8 @@
             useGeneratedKeys="true">
         INSERT INTO `sys_role` (`role_name_`, `role_code_`, `role_desc_`, `create_time_`,
                                 `update_time_`, `del_flag_`, `organ_id_`, `tenant_id_`)
-        VALUES (#{RoleName}, #{RoleCode}, #{RoleDesc}, #{CreateTime},
-                #{UpdateTime}, #{DelFlag}, #{OrganId}, #{TenantId});
+        VALUES (#{roleName}, #{roleCode}, #{roleDesc}, #{createTime},
+                #{updateTime}, #{delFlag}, #{organId}, #{tenantId});
     </insert>
 
     <select id="queryByPhone" resultMap="SysUser">

+ 27 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderActivityDao.xml

@@ -0,0 +1,27 @@
+<?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.MusicGroupPaymentCalenderActivityDao">
+  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity">
+    <id column="id_" jdbcType="BIGINT" property="id" />
+    <result column="activity_id_" jdbcType="INTEGER" property="activityId" />
+    <result column="calender_id_" property="calenderId" />
+    <result column="optional_flag_" jdbcType="TINYINT" property="optionalFlag" />
+    <result column="actual_amount_" jdbcType="TINYINT" property="actualAmount" />
+    <result column="original_amount_" jdbcType="TINYINT" property="originalAmount" />
+    <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id_, activity_id_, calender_id_, optional_flag_,actual_amount_ ,original_amount_, create_time_, update_time_
+  </sql>
+
+  <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+          parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity">
+    insert into music_group_payment_calender_activity(activity_id_, calender_id_, optional_flag_, actual_amount_ ,original_amount_, create_time_, update_time_)
+    values
+    <foreach collection="calenderActivityList" item="entity" separator=",">
+      (#{entity.activityId}, #{entity.calenderId}, #{entity.optionalFlag}, #{entity.actualAmount},
+      #{entity.originalAmount}, NOW(), NOW())
+    </foreach>
+  </insert>
+</mapper>

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

@@ -36,6 +36,10 @@
         <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"/>
+        <result column="member_optional_flag_" property="memberOptionalFlag"/>
+        <result column="music_repair_num_" property="musicRepairNum"/>
+        <result column="music_repair_actual_price_" property="musicRepairActualPrice"/>
+        <result column="music_repair_optional_flag_" property="musicRepairOptionalFlag"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -55,13 +59,15 @@
         (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_,member_period_)
+         attribute2_,student_ids_,member_payment_amount_,member_rank_setting_id_,member_valid_date_
+         ,original_member_payment_amount_,member_period_,member_optional_flag_,music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_)
         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},#{memberPeriod})
+               #{memberPaymentAmount},#{memberRankSettingId},#{memberValidDate},#{originalMemberPaymentAmount},#{memberPeriod},
+               #{memberOptionalFlag},#{musicRepairNum},#{musicRepairActualPrice},#{musicRepairOptionalFlag})
     </insert>
 
     <insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender" useGeneratedKeys="true"
@@ -70,14 +76,16 @@
         (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_,member_period_)
+         member_payment_amount_,member_rank_setting_id_,member_valid_date_,original_member_payment_amount_,member_period_
+        ,member_optional_flag_,music_repair_num_,music_repair_actual_price_,music_repair_optional_flag_)
         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.memberPeriod})
+         #{item.studentIds},#{item.memberPaymentAmount},#{item.memberRankSettingId},#{item.memberValidDate},#{item.originalMemberPaymentAmount},#{item.memberPeriod},
+            #{item.memberOptionalFlag},#{item.musicRepairNum},#{item.musicRepairActualPrice},#{item.musicRepairOptionalFlag})
         </foreach>
     </insert>
 
@@ -85,6 +93,18 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender">
         UPDATE music_group_payment_calender
         <set>
+            <if test="memberOptionalFlag != null">
+                member_optional_flag_ = #{memberOptionalFlag},
+            </if>
+            <if test="musicRepairNum != null">
+                music_repair_num_ = #{musicRepairNum},
+            </if>
+            <if test="musicRepairActualPrice != null">
+                music_repair_actual_price_ = #{musicRepairActualPrice},
+            </if>
+            <if test="musicRepairOptionalFlag != null">
+                music_repair_optional_flag_ = #{musicRepairOptionalFlag},
+            </if>
             <if test="memberPeriod != null">
                 member_period_ = #{memberPeriod},
             </if>

+ 5 - 13
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -4,17 +4,18 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.ym.common.ApiException;
-import com.ym.common.BaseResponse;
 import com.ym.common.DisplayEnum;
 import com.ym.common.ErrorEnum;
 import com.ym.config.IMProperties;
 import com.ym.config.RoomProperties;
-import com.ym.dao.*;
+import com.ym.dao.RoomDao;
+import com.ym.dao.RoomMemberDao;
+import com.ym.dao.UserDao;
+import com.ym.dao.WhiteboardDao;
 import com.ym.job.ScheduleManager;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentMusicScoreDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.RongyunBasicUserDto;
 import com.ym.mec.biz.dal.entity.*;
@@ -91,8 +92,6 @@ public class RoomServiceImpl implements RoomService {
     @Autowired
     private SysExamSongDao sysExamSongDao;
     @Autowired
-    private SysConfigDao sysConfigDao;
-    @Autowired
     private CourseScheduleStudentMusicScoreDao courseScheduleStudentMusicScoreDao;
     @Autowired
     private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
@@ -124,13 +123,6 @@ public class RoomServiceImpl implements RoomService {
         return Integer.parseInt(roomId);
     }
 
-    public static void main(String[] args) {
-        Date date = DateUtil.stringToDate("2021-12-14 11:34:00", DateUtil.EXPANDED_DATE_TIME_FORMAT);
-        Date classDate = DateUtil.stringToDate("2021-12-14 11:40:00", DateUtil.EXPANDED_DATE_TIME_FORMAT);
-        int i = classDate.compareTo(DateUtil.addMinutes(date, 5));
-        int i1 = DateUtil.minutesBetween(classDate, date);
-    }
-
     @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     @Override
     public RoomResult joinRoom(String roomId) throws Exception {
@@ -163,7 +155,7 @@ public class RoomServiceImpl implements RoomService {
             continueCourseTime = "5";
         }
 
-        String autoCloseNetworkRoomTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_BEFORE_BUFFER_TIME,courseSchedule.getTenantId());
+        String autoCloseNetworkRoomTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.COURSE_AFTER_BUFFER_TIME,courseSchedule.getTenantId());
         if(StringUtils.isEmpty(autoCloseNetworkRoomTime)){
             autoCloseNetworkRoomTime = "15";
         }

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

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentBaseCalender;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
@@ -62,7 +63,17 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/add')")
     public Object add(@RequestBody MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto) {
     	String batchNo = musicGroupPaymentCalenderService.create(musicGroupPaymentCalenderDto);
-        ModelMap map = new ModelMap();
+        ModelMap map = new ModelMap(1);
+        map.put("musicGroupPaymentCalenderBatchNo", batchNo);
+        return succeed(map);
+    }
+
+    @ApiOperation(value = "新增乐团缴费日历")
+    @PostMapping(value = "/createCalender", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/createCalender')")
+    public Object createCalender(@RequestBody MusicGroupPaymentBaseCalender musicGroupPaymentBaseCalender) {
+    	String batchNo = musicGroupPaymentCalenderService.create1(musicGroupPaymentBaseCalender);
+        ModelMap map = new ModelMap(1);
         map.put("musicGroupPaymentCalenderBatchNo", batchNo);
         return succeed(map);
     }