zouxuan 5 éve
szülő
commit
e8716a361a

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/dal/entity/MusicGroupSubjectGoodsGroup.java

@@ -25,7 +25,7 @@ public class MusicGroupSubjectGoodsGroup {
 	
 	/**  */
 	@ApiModelProperty(value = "乐团编号",required = false)
-	private Integer musicGroupId;
+	private String musicGroupId;
 	
 	/**  */
 	@ApiModelProperty(value = "科目编号",required = false)
@@ -80,11 +80,11 @@ public class MusicGroupSubjectGoodsGroup {
 		this.type = type;
 	}
 
-	public void setMusicGroupId(Integer musicGroupId){
+	public void setMusicGroupId(String musicGroupId){
 		this.musicGroupId = musicGroupId;
 	}
 	
-	public Integer getMusicGroupId(){
+	public String getMusicGroupId(){
 		return this.musicGroupId;
 	}
 			

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/dal/entity/MusicGroupSubjectPlan.java

@@ -16,7 +16,7 @@ public class MusicGroupSubjectPlan {
 	
 	/** 乐团编号 */
 	@ApiModelProperty(value = "乐团编号",required = false)
-	private Integer musicGroupId;
+	private String musicGroupId;
 	
 	/** 科目编号 */
 	@ApiModelProperty(value = "科目编号",required = false)
@@ -68,11 +68,11 @@ public class MusicGroupSubjectPlan {
 		return this.id;
 	}
 			
-	public void setMusicGroupId(Integer musicGroupId){
+	public void setMusicGroupId(String musicGroupId){
 		this.musicGroupId = musicGroupId;
 	}
 	
-	public Integer getMusicGroupId(){
+	public String getMusicGroupId(){
 		return this.musicGroupId;
 	}
 			

+ 36 - 16
mec-web/src/main/java/com/ym/mec/web/service/impl/MusicGroupServiceImpl.java

@@ -2,13 +2,9 @@ package com.ym.mec.web.service.impl;
 
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.web.dal.dao.MusicGroupDao;
-import com.ym.mec.web.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.web.dal.dao.MusicGroupPaymentEntitiesDao;
+import com.ym.mec.web.dal.dao.*;
 import com.ym.mec.web.dal.dto.SubFeeSettingDto;
-import com.ym.mec.web.dal.entity.MusicGroup;
-import com.ym.mec.web.dal.entity.MusicGroupPaymentCalender;
-import com.ym.mec.web.dal.entity.MusicGroupPaymentEntities;
+import com.ym.mec.web.dal.entity.*;
 import com.ym.mec.web.service.MusicGroupService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -25,6 +21,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
 	@Autowired
 	private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
+	@Autowired
+	private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
+	@Autowired
+	private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
 
 	@Override
 	public BaseDAO<String, MusicGroup> getDAO() {
@@ -49,18 +49,38 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 	@Transactional(rollbackFor = Exception.class)
 	public void createGroup(SubFeeSettingDto subFeeSettingDto) {
 		MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
-		if(musicGroup != null){
+		List<MusicGroupPaymentEntities> musicGroupPaymentEntities = subFeeSettingDto.getMusicGroupPaymentEntities();
+		List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
+		List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
+		if(musicGroup == null || musicGroupPaymentEntities == null || musicGroupSubjectGoodsGroups == null || musicGroupSubjectPlans == null){
+			//保存乐团基本信息
 			musicGroupDao.insert(musicGroup);
-			List<MusicGroupPaymentEntities> musicGroupPaymentEntities = subFeeSettingDto.getMusicGroupPaymentEntities();
-			if(musicGroupPaymentEntities != null && musicGroupPaymentEntities.size() > 0){
-				musicGroupPaymentEntities.forEach(e ->{
-					e.setMusicGroupId(musicGroup.getId());
-					musicGroupPaymentEntitiesDao.insert(e);
-				});
+			//保存乐团付费主体列表
+			musicGroupPaymentEntities.forEach(e ->{
+				e.setMusicGroupId(musicGroup.getId());
+				musicGroupPaymentEntitiesDao.insert(e);
+			});
+			//保存学员付费周期
+			List<Integer> months = subFeeSettingDto.getMonths();
+			if(months != null && months.size() > 0){
+				MusicGroupPaymentCalender mg;
+				for (Integer month:months) {
+					mg = new MusicGroupPaymentCalender();
+					mg.setMusicGroupId(musicGroup.getId());
+					mg.setPaymentMonth(month);
+					musicGroupPaymentCalenderDao.insert(mg);
+				}
 			}
-//			if(){
-//
-//			}
+			//保存乐团声部规划
+			musicGroupSubjectPlans.forEach(e ->{
+				e.setMusicGroupId(musicGroup.getId());
+				musicGroupSubjectPlanDao.insert(e);
+			});
+			//保存乐团声部商品规划
+			musicGroupSubjectGoodsGroups.forEach(e->{
+				e.setMusicGroupId(musicGroup.getId());
+				musicGroupSubjectGoodsGroupDao.insert(e);
+			});
 		}
 	}
 }

+ 3 - 2
mec-web/src/main/resources/config/mybatis/GoodsMapper.xml

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