Ver código fonte

Merge remote-tracking branch 'origin/master'

周箭河 4 anos atrás
pai
commit
3d1f2bb0d1
20 arquivos alterados com 293 adições e 95 exclusões
  1. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
  2. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  3. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java
  4. 2 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  5. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderDetail.java
  6. 40 9
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCourseUnitPriceSettings.java
  7. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  8. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationCourseUnitPriceSettingsService.java
  9. 40 22
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java
  10. 57 31
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  11. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationCourseUnitPriceSettingsServiceImpl.java
  12. 3 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  13. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  14. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml
  15. 4 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  16. 11 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  17. 28 12
      mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml
  18. 1 0
      mec-web/src/main/java/com/ym/mec/web/controller/LuckDrawController.java
  19. 8 1
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java
  20. 14 8
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCourseUnitPriceSettingsController.java

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -166,4 +166,20 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      */
     List<MusicGroupPaymentCalenderAuditDto> queryAuditList(Map<String, Object> params);
 
+    /**
+     * 统计预计缴费人数
+     *
+     * @param id
+     * @return
+     */
+    List<Map<Long, Long>> countExpectNum(@Param("id") Long id);
+
+    /**
+     * 统计预计缴费人数
+     *
+     * @param id
+     * @return
+     */
+    List<Map<Long, Long>> countActualNum(@Param("id") Long id);
+
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -167,4 +168,11 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
 	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Integer calenderId, @Param("musicGroupId") String musicGroupId);
+
+	/**
+	 * 统计实际收款金额
+	 * @param id
+	 * @return
+	 */
+	BigDecimal sumActualAmount(@Param("id") Long id);
 }

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java

@@ -1,5 +1,9 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
 import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.common.dal.BaseDAO;
@@ -12,5 +16,12 @@ public interface OrganizationCourseUnitPriceSettingsDao extends BaseDAO<Integer,
 	 * @param courseType 课程类型
 	 * @return
 	 */
-	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType);
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(@Param("organId") Integer organId, @Param("courseScheduleType") CourseScheduleType courseType);
+	
+	/**
+	 * 批量新增
+	 * @param organizationCourseUnitPriceSettingsList
+	 * @return
+	 */
+	int batchInsert(List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList);
 }

+ 2 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java

@@ -94,10 +94,10 @@ public class MusicGroupPaymentCalender {
 	@ApiModelProperty(value = "缴费有效期截止时间", required = false)
 	private Date paymentValidEndDate;
 
-	@ApiModelProperty(value = "缴费方式0按月,1按,2一次性", required = false)
+	@ApiModelProperty(value = "缴费方式0按月,1按学期,2一次性", required = false)
 	private Integer paymentPattern;
 
-	@ApiModelProperty(value = "缴费类型0续费,1报名", required = false)
+	@ApiModelProperty(value = "缴费类型", required = false)
 	private PaymentType paymentType;
 
 	@ApiModelProperty(value = "状态", required = false)
@@ -131,8 +131,6 @@ public class MusicGroupPaymentCalender {
 	@ApiModelProperty(value = "批次号", required = false)
 	private String batchNo;
 
-	private List<MusicGroupPaymentCalenderCourseSettings> MusicGroupPaymentCalenderCourseSettingsList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>();
-
 	public String getAuditMemo() {
 		return auditMemo;
 	}

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

@@ -53,6 +53,12 @@ public class MusicGroupPaymentCalenderDetail {
 	/**  */
 	private java.util.Date deadlinePaymentDate;
 
+	/**  */
+	private java.util.Date startPaymentDateMgpc;
+
+	/**  */
+	private java.util.Date deadlinePaymentDateMgpc;
+
 	@ApiModelProperty(value = "订单编号",required = true)
 	private Long paymentOrderId;
 
@@ -66,6 +72,22 @@ public class MusicGroupPaymentCalenderDetail {
 
 	private SysUser sysUser = new SysUser();
 
+	public Date getStartPaymentDateMgpc() {
+		return startPaymentDateMgpc;
+	}
+
+	public void setStartPaymentDateMgpc(Date startPaymentDateMgpc) {
+		this.startPaymentDateMgpc = startPaymentDateMgpc;
+	}
+
+	public Date getDeadlinePaymentDateMgpc() {
+		return deadlinePaymentDateMgpc;
+	}
+
+	public void setDeadlinePaymentDateMgpc(Date deadlinePaymentDateMgpc) {
+		this.deadlinePaymentDateMgpc = deadlinePaymentDateMgpc;
+	}
+
 	public YesOrNoEnum getOpenFlag() {
 		return openFlag;
 	}

+ 40 - 9
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCourseUnitPriceSettings.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
+import java.math.BigDecimal;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
@@ -17,9 +19,10 @@ public class OrganizationCourseUnitPriceSettings {
 	
 	/** 课程类型 */
 	private CourseScheduleType courseType;
+
+	private Integer chargeTypeId;
 	
-	/** 单价的json串(key-乐团模式,value-单价) */
-	private String unitPriceJson;
+	private BigDecimal unitPrice = new BigDecimal(0);
 	
 	/**  */
 	private java.util.Date createTime;
@@ -27,6 +30,10 @@ public class OrganizationCourseUnitPriceSettings {
 	/**  */
 	private java.util.Date updateTime;
 	
+	private Organization organ = new Organization();
+	
+	private ChargeType chargeType = new ChargeType();
+	
 	public void setId(Integer id){
 		this.id = id;
 	}
@@ -50,15 +57,15 @@ public class OrganizationCourseUnitPriceSettings {
 	public void setCourseType(CourseScheduleType courseType) {
 		this.courseType = courseType;
 	}
-
-	public void setUnitPriceJson(String unitPriceJson){
-		this.unitPriceJson = unitPriceJson;
+			
+	public BigDecimal getUnitPrice() {
+		return unitPrice;
 	}
-	
-	public String getUnitPriceJson(){
-		return this.unitPriceJson;
+
+	public void setUnitPrice(BigDecimal unitPrice) {
+		this.unitPrice = unitPrice;
 	}
-			
+
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}
@@ -75,6 +82,30 @@ public class OrganizationCourseUnitPriceSettings {
 		return this.updateTime;
 	}
 			
+	public Integer getChargeTypeId() {
+		return chargeTypeId;
+	}
+
+	public void setChargeTypeId(Integer chargeTypeId) {
+		this.chargeTypeId = chargeTypeId;
+	}
+
+	public Organization getOrgan() {
+		return organ;
+	}
+
+	public void setOrgan(Organization organ) {
+		this.organ = organ;
+	}
+
+	public ChargeType getChargeType() {
+		return chargeType;
+	}
+
+	public void setChargeType(ChargeType chargeType) {
+		this.chargeType = chargeType;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -14,10 +14,17 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 
 	/**
 	 * 创建缴费信息
-	 * @param musicGroupPaymentCalenderDto
+	 * @param musicGroupPaymentCalender
 	 * @return
 	 */
 	boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender);
+
+	/**
+	 * 获取明细
+	 * @param id
+	 * @return
+	 */
+	Object getDetail(Long id);
 	
 	/**
 	 * 更新缴费信息

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

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.service;
 
+import java.util.List;
+
 import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.common.service.BaseService;
@@ -7,6 +9,13 @@ import com.ym.mec.common.service.BaseService;
 public interface OrganizationCourseUnitPriceSettingsService extends BaseService<Integer, OrganizationCourseUnitPriceSettings> {
 
 	/**
+	 * 批量新增
+	 * @param organizationCourseUnitPriceSettingsList
+	 * @return
+	 */
+	boolean batchInsert(List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList);
+
+	/**
 	 * 根据分部编号以及课程类型查询对象
 	 * @param organId 分部编号
 	 * @param courseType 课程类型

+ 40 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -1,14 +1,51 @@
 package com.ym.mec.biz.service.impl;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.PictureData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.multipart.MultipartFile;
+
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dao.GoodsDao;
+import com.ym.mec.biz.dal.dao.GoodsProcurementDao;
+import com.ym.mec.biz.dal.dao.SellOrderDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
+import com.ym.mec.biz.dal.dao.TeacherDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.GoodsSellDto;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.GoodsProcurement;
 import com.ym.mec.biz.dal.entity.SellOrder;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.enums.AccountType;
+import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.SellStatus;
+import com.ym.mec.biz.dal.enums.StockType;
+import com.ym.mec.biz.dal.enums.TemplateTypeEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.service.GoodsService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.biz.service.UploadFileService;
@@ -20,25 +57,6 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.excel.IniFileUtil;
 import com.ym.mec.util.excel.POIUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.usermodel.PictureData;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Isolation;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
 
 @Service
 public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implements GoodsService {
@@ -504,7 +522,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		Map<Integer, Goods> idTempGoodsMap = tempGoodsList.stream().collect(Collectors.toMap(Goods::getId, g -> g));
 		List<GoodsProcurement> goodsProcurements = new ArrayList<>();
 		for (Integer goodsId : goodsIds) {
-			Goods tempGoods = tempGoodsList.get(goodsId);
+			Goods tempGoods = idTempGoodsMap.get(goodsId);
 			List<Goods> childGoods = new ArrayList<>();
 			if(StringUtils.isBlank(tempGoods.getComplementGoodsIdList())){
 				childGoods.add(tempGoods);

+ 57 - 31
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
@@ -25,6 +26,7 @@ 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.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -36,6 +38,9 @@ import java.util.*;
 import java.util.Map.Entry;
 import java.util.stream.Collectors;
 
+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 MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
 
@@ -93,8 +98,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		musicGroupPaymentCalender.setOperator(sysUser.getId());
 		musicGroupPaymentCalender.setCreateTime(date);
 		musicGroupPaymentCalender.setUpdateTime(date);
-		
-		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null) {
+		musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+
+		if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && musicGroupPaymentCalender.getPayUserType() == PayUserType.STUDENT) {
 			musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 		}
 		int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPaymentValidStartDate(),
@@ -102,29 +108,40 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		if (count > 0) {
 			throw new BizException("缴费有效期存在冲突,请修改缴费有效期");
 		}
-		
 		//获取设置的课程
 		List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList();
 		if(musicGroupPaymentCalenderCourseSettingsList == null){
 			musicGroupPaymentCalenderCourseSettingsList = new ArrayList<>();
 		}
-		
-		//查询默认课程费用
-		Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId();
-		Map<CourseScheduleType, BigDecimal> defaultCoursePrice = musicGroupOrganizationCourseSettingsDetailDao.queryByMusicGroupOrganizationCourseSettingsId(musicGroupOrganizationCourseSettingId).stream().collect(Collectors.toMap(MusicGroupOrganizationCourseSettingsDetail :: getCourseType, MusicGroupOrganizationCourseSettingsDetail :: getCourseCurrentPrice));
-		
 		//当前缴费的课程费用
-		Map<CourseScheduleType,BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().collect(Collectors.toMap(MusicGroupPaymentCalenderCourseSettings :: getCourseType, MusicGroupPaymentCalenderCourseSettings :: getCourseCurrentPrice));
-		
-		BigDecimal totalPrice = new BigDecimal(0);
-		//相同类型的课程如果修改了课程费用,需要走审批
-		for(Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()){
-			if(defaultCoursePrice.get(entry.getKey()).compareTo(entry.getValue()) != 0){
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+		Map<CourseScheduleType,BigDecimal> currentCoursePrice = musicGroupPaymentCalenderCourseSettingsList.stream().
+				collect(Collectors.toMap(MusicGroupPaymentCalenderCourseSettings :: getCourseType, MusicGroupPaymentCalenderCourseSettings :: getCourseCurrentPrice));
+
+		if(musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY || musicGroupPaymentCalender.getPaymentType() == MUSIC_RENEW){
+			//查询默认课程费用
+			Integer musicGroupOrganizationCourseSettingId = musicGroupPaymentCalender.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){
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
+				}
 			}
-			totalPrice.add(entry.getValue());
+			for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
+				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalenderCourseSettings.setCreateTime(date);
+				musicGroupPaymentCalenderCourseSettings.setUpdateTime(date);
+			}
+
+			if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
+				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
+			}
+		}else {
+			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
 		}
-		
+
 		if (musicGroupPaymentCalender.getStatus() != PaymentCalenderStatusEnum.AUDITING) {
 			if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
 				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
@@ -135,7 +152,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			
 			//如果是报名,需要修改乐团状态
-			if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
+			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
 				if(musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT){
 					throw new BizException("创建失败:缴费项目类型不匹配");
 				}
@@ -157,7 +174,12 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					pushUserMap.put(Integer.parseInt(studentId), studentId);
 				}
 			}
-			
+
+			BigDecimal totalPrice = new BigDecimal(0);
+			//相同类型的课程如果修改了课程费用,需要走审批
+			for(Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()){
+				totalPrice.add(entry.getValue());
+			}
 			//创建缴费明细
 			for(String studentId : sutdentIdList){
 				musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
@@ -176,16 +198,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		//设置批次号
 		musicGroupPaymentCalender.setBatchNo(idGeneratorService.generatorId()+"");
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
-		
-		for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
-			musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-			musicGroupPaymentCalenderCourseSettings.setCreateTime(date);
-			musicGroupPaymentCalenderCourseSettings.setUpdateTime(date);
-		}
-		
-		if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
-			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
-		}
 
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
@@ -205,6 +217,20 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	}
 
 	@Override
+	public Object getDetail(Long id) {
+		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(id);
+		Map<Long, Long> expectNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countExpectNum(id));
+		Map<Long, Long> actualNumMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.countActualNum(id));
+		calender.setActualNum(actualNumMap.get(id) == null ? 0 : actualNumMap.get(id).intValue());
+		calender.setExpectNum(expectNumMap.get(id) == null ? 0 : expectNumMap.get(id).intValue());
+		BigDecimal sumActualAmount = musicGroupPaymentCalenderDetailDao.sumActualAmount(id);
+		Map<String, Object> result = new HashMap<>(2);
+		result.put("calender", calender);
+		result.put("sumActualAmount", sumActualAmount);
+		return result;
+	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public int update(MusicGroupPaymentCalender musicGroupPaymentCalender) {
 		
@@ -269,7 +295,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			
 			//如果是报名,需要修改乐团状态
-			if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
+			if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
 				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 				musicGroup.setUpdateTime(date);
 				musicGroupDao.update(musicGroup);
@@ -434,7 +460,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 		}
 		//如果是报名,需要修改乐团状态
-		if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
+		if (musicGroupPaymentCalender.getPaymentType() == MUSIC_APPLY) {
 			MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
 			musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 			musicGroup.setUpdateTime(date);

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

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -22,6 +24,12 @@ public class OrganizationCourseUnitPriceSettingsServiceImpl extends BaseServiceI
 	}
 
 	@Override
+	public boolean batchInsert(List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList) {
+		organizationCourseUnitPriceSettingsDao.batchInsert(organizationCourseUnitPriceSettingsList);
+		return true;
+	}
+
+	@Override
 	public OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType) {
 		return organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseType(organId, courseType);
 	}

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

@@ -1811,10 +1811,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		int studentCourseNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroup.getId());
 		if(studentCourseNum<=0&&classGroup.getStudentNum().equals(classGroup.getExpectStudentNum())){
 			vipGroup.setStatus(VipGroupStatusEnum.PAUSE);
-			int notStartCourseStudentNum = courseScheduleStudentPaymentDao.countNotStartCourseStudentNumWithGroup(vipGroupId.toString(), GroupType.VIP);
-			if(notStartCourseStudentNum<=0){
-				List<CourseSchedule> groupNotFinishCourses = courseScheduleDao.findGroupNotFinishCourses(vipGroupId.toString(), GroupType.VIP);
-				List<Long> csIds = groupNotFinishCourses.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+			List<CourseSchedule> groupNotFinishCourses = courseScheduleDao.findGroupNotFinishCourses(vipGroupId.toString(), GroupType.VIP);
+			List<Long> csIds = groupNotFinishCourses.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+			if(!CollectionUtils.isEmpty(csIds)){
 				courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(csIds);
 				courseScheduleDao.batchDeleteCourseSchedules(csIds);
 				teacherAttendanceDao.batchDeleteByCourseSchedules(csIds);

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

@@ -2922,7 +2922,7 @@
         FROM course_schedule
         WHERE group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           AND music_group_id_ = #{groupId}
-          AND CONCAT(class_date_, ' ', end_class_time_) &gt; NOW()
+          AND CONCAT(class_date_, ' ', start_class_time_) &gt; NOW()
     </select>
     <select id="getSubjectNameById" resultType="java.lang.String">
         SELECT GROUP_CONCAT(DISTINCT s.name_)

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

@@ -50,7 +50,7 @@
 		<foreach collection="list" item="item" separator=",">
 		(#{item.musicGroupPaymentCalenderId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		#{item.courseTotalMinuties},#{item.unitPrice},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
-		#{item.isStudentOptional},#{item.createTime},#{item.updateTime},#{name})
+		#{item.isStudentOptional},#{item.createTime},#{item.updateTime},#{item.name})
 		</foreach>
 	</insert>
 

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

@@ -356,4 +356,8 @@
 		LEFT JOIN `subject` s ON s.id_ = sr.subject_id_
 		WHERE mgpcd.music_group_payment_calender_id_ = #{calenderId}
 	</select>
+	<select id="sumActualAmount" resultType="java.math.BigDecimal">
+		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
+		WHERE mgpcd.music_group_payment_calender_id_ = #{id}
+	</select>
 </mapper>

+ 11 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml

@@ -408,4 +408,15 @@
         ORDER BY create_time_ DESC
         <include refid="global.limit"/>
     </select>
+    <select id="countExpectNum" resultType="java.util.Map">
+        SELECT mgpcd.music_group_payment_calender_id_ 'key',COUNT(DISTINCT mgpcd.user_id_) 'value' FROM music_group_payment_calender_detail mgpcd
+        WHERE mgpcd.music_group_payment_calender_id_ = #{id}
+        GROUP BY mgpcd.music_group_payment_calender_id_
+    </select>
+    <select id="countActualNum" resultType="java.util.Map">
+        SELECT mgpcd.music_group_payment_calender_id_ 'key',COUNT(DISTINCT mgpcd.user_id_) 'value' FROM music_group_payment_calender_detail mgpcd
+        WHERE mgpcd.music_group_payment_calender_id_ = #{id}
+        AND mgpcd.payment_status_ = 'PAID_COMPLETED'
+        GROUP BY mgpcd.music_group_payment_calender_id_
+    </select>
 </mapper>

+ 28 - 12
mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml

@@ -7,9 +7,12 @@
 		<result column="id_" property="id" />
 		<result column="organ_id_" property="organId" />
 		<result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
-		<result column="unit_price_json_" property="unitPriceJson" />
+		<result column="charge_type_id_" property="chargeTypeId" />
+		<result column="unit_price_" property="unitPrice" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="organ_name_" property="organ.name" />
+		<result column="charge_type_name_" property="chargeType.name" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -27,8 +30,17 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO organization_course_unit_price_settings
-		(id_,organ_id_,course_type_,unit_price_json_,create_time_,update_time_)
-		VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{unitPriceJson},#{createTime},#{updateTime})
+		(id_,organ_id_,course_type_,charge_type_id_,unit_price_,create_time_,update_time_)
+		VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{chargeTypeId},#{unitPrice},now(),now())
+	</insert>
+	
+	<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO organization_course_unit_price_settings
+		(id_,organ_id_,course_type_,charge_type_id_,unit_price_,create_time_,update_time_)
+		VALUES
+		<foreach collection="list" item="item" separator=",">
+		(#{item.id},#{item.organId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.chargeTypeId},#{item.unitPrice},now(),now())
+		</foreach>
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -47,8 +59,11 @@
 			<if test="courseType != null">
 				course_type_ = #{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 			</if>
-			<if test="unitPriceJson != null">
-				unit_price_json_ = #{unitPriceJson},
+			<if test="chargeTypeId != null">
+				charge_type_id_ = #{chargeTypeId},
+			</if>
+			<if test="unitPrice != null">
+				unit_price_ = #{unitPrice},
 			</if>
 			<if test="createTime != null">
 				create_time_ = #{createTime},
@@ -64,28 +79,29 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="OrganizationCourseUnitPriceSettings" parameterType="map">
-		SELECT * FROM organization_course_unit_price_settings 
+		SELECT ups.*,o.name_ organ_name_ ,ct.name_ charge_type_name_ FROM organization_course_unit_price_settings ups left join organization o on ups.organ_id_ = o.id_
+		left join charge_type ct on ct.id_ = ups.charge_type_id_
 		<where>
 			<if test="organId != null">
-				and organ_id_ = #{organId}
+				and ups.organ_id_ = #{organId}
 			</if>
 			<if test="courseScheduleType != null">
-				and course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				and ups.course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 		</where>
-		ORDER BY id_
+		ORDER BY ups.id_ desc
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM organization_course_unit_price_settings
+		SELECT COUNT(ups.id_) FROM organization_course_unit_price_settings ups
 		<where>
 			<if test="organId != null">
-				and organ_id_ = #{organId}
+				and ups.organ_id_ = #{organId}
 			</if>
 			<if test="courseScheduleType != null">
-				and course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				and ups.course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 		</where>
 	</select>

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

@@ -115,6 +115,7 @@ public class LuckDrawController extends BaseController {
 		oriGoods.setStock(luckDrawPrize.getStock());
 		oriGoods.setRewardType(luckDrawPrize.getRewardType());
 		oriGoods.setGroupId(luckDrawPrize.getGroupId());
+		oriGoods.setIsDefault(luckDrawPrize.getIsDefault());
 		oriGoods.setMemo(luckDrawPrize.getMemo());
 		Date date = new Date();
 		oriGoods.setModifyOn(date);

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

@@ -44,6 +44,13 @@ public class MusicGroupPaymentCalenderController extends BaseController {
         return succeed(musicGroupPaymentCalenderService.queryPage(queryInfo));
     }
 
+    @ApiOperation(value = "获取缴费信息")
+    @GetMapping("/getDetail")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/getDetail')")
+    public Object getDetail(Long id) {
+        return succeed(musicGroupPaymentCalenderService.getDetail(id));
+    }
+
     @ApiOperation(value = "新增乐团缴费日历")
     @PostMapping(value = "/add", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/add')")
@@ -117,7 +124,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
 
     @ApiOperation(value = "乐团缴费日历审核拒绝")
     @PostMapping("/auditRefuse")
-    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditPass')")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditRefuse')")
     public Object auditRefuse(Long calenderId,String auditMemo) {
         musicGroupPaymentCalenderService.auditRefuse(calenderId,auditMemo);
         return succeed();

+ 14 - 8
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCourseUnitPriceSettingsController.java

@@ -4,6 +4,9 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 
+import java.util.Date;
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -31,19 +34,21 @@ public class OrganizationCourseUnitPriceSettingsController extends BaseControlle
 	@GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/queryPage')")
 	public Object queryPage(OrganizationCourseUnitPriceSettingsQueryInfo queryInfo) {
-		return succeed();
+		return succeed(organizationCourseUnitPriceSettingsService.queryPage(queryInfo));
 	}
 
 	@ApiOperation(value = "新增对象")
 	@PostMapping(value = "/insert", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
-	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/update')")
-	public Object insert(@RequestBody OrganizationCourseUnitPriceSettings organizationCourseUnitPriceSettings) {
-		OrganizationCourseUnitPriceSettings originalObj = organizationCourseUnitPriceSettingsService.queryByOrganIdAndCourseType(
-				organizationCourseUnitPriceSettings.getOrganId(), organizationCourseUnitPriceSettings.getCourseType());
-		if (originalObj != null) {
-			return failed("当前分部已经存在该课程类型的单价");
+	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/insert')")
+	public Object insert(@RequestBody List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList) {
+		for (OrganizationCourseUnitPriceSettings organizationCourseUnitPriceSettings : organizationCourseUnitPriceSettingsList) {
+			OrganizationCourseUnitPriceSettings originalObj = organizationCourseUnitPriceSettingsService.queryByOrganIdAndCourseType(
+					organizationCourseUnitPriceSettings.getOrganId(), organizationCourseUnitPriceSettings.getCourseType());
+			if (originalObj != null) {
+				return failed("当前分部已经存在该课程类型的单价");
+			}
 		}
-		organizationCourseUnitPriceSettingsService.insert(organizationCourseUnitPriceSettings);
+		organizationCourseUnitPriceSettingsService.batchInsert(organizationCourseUnitPriceSettingsList);
 		return succeed();
 	}
 
@@ -51,6 +56,7 @@ public class OrganizationCourseUnitPriceSettingsController extends BaseControlle
 	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/update')")
 	public Object update(@RequestBody OrganizationCourseUnitPriceSettings organizationCourseUnitPriceSettings) {
+		organizationCourseUnitPriceSettings.setUpdateTime(new Date());
 		organizationCourseUnitPriceSettingsService.update(organizationCourseUnitPriceSettings);
 		return succeed();
 	}