|  | @@ -1,12 +1,15 @@
 | 
	
		
			
				|  |  |  package com.ym.mec.biz.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSON;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.enums.DealStatusEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.GoodsType;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.*;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  | +import org.snaker.engine.core.OrderService;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -18,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  |  import java.util.Map;
 | 
	
		
			
				|  |  | +import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  @Service
 | 
	
		
			
				|  |  |  public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, MusicGroupSubjectPlan> implements MusicGroupSubjectPlanService {
 | 
	
	
		
			
				|  | @@ -39,6 +43,8 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SubjectService subjectService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public BaseDAO<Integer, MusicGroupSubjectPlan> getDAO() {
 | 
	
	
		
			
				|  | @@ -125,4 +131,33 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
 | 
	
		
			
				|  |  |      public int batchUpdateFee(List<MusicGroupSubjectPlan> musicGroupSubjectPlans) {
 | 
	
		
			
				|  |  |          return musicGroupSubjectPlanDao.batchUpdateFee(musicGroupSubjectPlans);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Override
 | 
	
		
			
				|  |  | +    public MusicGroupSubjectGoodsAndInfoDto getStudentGoodsAndInfo(String musicGroupId, Integer subjectId, MusicGroupStudentFee musicGroupStudentFee) {
 | 
	
		
			
				|  |  | +        MusicGroup musicGroup = musicGroupService.get(musicGroupId);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //课程形态
 | 
	
		
			
				|  |  | +        Map<String, Object> courseForm = JSON.parseObject(musicGroup.getCourseForm(), Map.class);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //乐团计划及收费信息
 | 
	
		
			
				|  |  | +        MusicGroupSubjectPlan musicOneSubjectClassPlan = this.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
 | 
	
		
			
				|  |  | +        musicOneSubjectClassPlan.setFee(musicGroupStudentFee.getTemporaryCourseFee());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.findUserApplyOrder(musicGroupStudentFee.getUserId(), DealStatusEnum.WAIT_PAY);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        String goodsIds = orderDetails.stream().filter(orderDetail -> orderDetail.getGoodsIdList() != null).map(orderDetail -> orderDetail.getGoodsIdList()).collect(Collectors.joining(","));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        List<Goods> goodies = goodsService.findGoodsByIds(goodsIds);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        //获取声部(科目)下其他商品
 | 
	
		
			
				|  |  | +        List<Goods> otherGoods = goodsService.findTypeGoods("OTHER");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        MusicGroupSubjectGoodsAndInfoDto musicGroupSubjectGoodsAndInfo = new MusicGroupSubjectGoodsAndInfoDto();
 | 
	
		
			
				|  |  | +        musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectPlan(musicOneSubjectClassPlan);
 | 
	
		
			
				|  |  | +        musicGroupSubjectGoodsAndInfo.setCourseScheduleInfo(courseForm);
 | 
	
		
			
				|  |  | +        musicGroupSubjectGoodsAndInfo.setStudentGoods(goodies);
 | 
	
		
			
				|  |  | +        musicGroupSubjectGoodsAndInfo.setOtherGoods(otherGoods);
 | 
	
		
			
				|  |  | +        return musicGroupSubjectGoodsAndInfo;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  }
 |