|
@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -107,24 +108,26 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
|
|
|
//乐团乐器及辅件信息
|
|
|
List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroup(musicGroupId, subjectId);
|
|
|
|
|
|
- List<Goods> accessoriesList = goodsService.findGoodsBySubId(subjectId, GoodsType.ACCESSORIES.getCode());
|
|
|
|
|
|
- goodsGroups.forEach(goodsGroup -> {
|
|
|
- if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
|
|
|
- goodsGroup.getGoodsList().forEach(goods -> {
|
|
|
- goods.setGoodsList(accessoriesList);
|
|
|
- });
|
|
|
+ for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
|
|
|
+ String childGoodIds = "";
|
|
|
+ for (Goods goods : goodsGroup.getGoodsList()) {
|
|
|
+ if (StringUtils.isNotBlank(goods.getComplementGoodsIdList())) {
|
|
|
+ childGoodIds += StringUtils.isNotBlank(childGoodIds) ? "," : "" + goods.getComplementGoodsIdList();
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
- //获取声部(科目)下其他商品
|
|
|
- List<Goods> otherGoods = goodsService.findTypeGoods("OTHER");
|
|
|
+ if(StringUtils.isNotBlank(childGoodIds)) {
|
|
|
+ goodsGroup.setChildGoodsList(goodsDao.findGoodsByIds(childGoodIds));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ //获取声部(科目)下其他商品
|
|
|
MusicGroupSubjectGoodsAndInfoDto musicGroupSubjectGoodsAndInfo = new MusicGroupSubjectGoodsAndInfoDto();
|
|
|
musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectPlan(musicOneSubjectClassPlan);
|
|
|
musicGroupSubjectGoodsAndInfo.setCourseScheduleInfo(courseForm);
|
|
|
musicGroupSubjectGoodsAndInfo.setMusicGroupPaymentCalender(musicGroupRegCalender);
|
|
|
musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectGoodsGroupList(goodsGroups);
|
|
|
- musicGroupSubjectGoodsAndInfo.setOtherGoods(otherGoods);
|
|
|
musicGroupSubjectGoodsAndInfo.setMusicGroup(musicGroup);
|
|
|
return musicGroupSubjectGoodsAndInfo;
|
|
|
}
|
|
@@ -145,14 +148,14 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void addApplyStudentNum(String musicGroupId, Integer subjectId, int num){
|
|
|
+ public void addApplyStudentNum(String musicGroupId, Integer subjectId, int num) {
|
|
|
boolean flag = false;
|
|
|
for (int i = 10; i >= 1; i--) {
|
|
|
MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
|
|
|
- if(musicOneSubjectClassPlan == null){
|
|
|
+ if (musicOneSubjectClassPlan == null) {
|
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
|
Subject subject = subjectService.get(subjectId);
|
|
|
- throw new BizException("操作失败:{}乐团缺少{}声部",musicGroup.getName(),subject.getName());
|
|
|
+ throw new BizException("操作失败:{}乐团缺少{}声部", musicGroup.getName(), subject.getName());
|
|
|
}
|
|
|
int applyNum = musicOneSubjectClassPlan.getApplyStudentNum() == null ? 0 : musicOneSubjectClassPlan.getApplyStudentNum();
|
|
|
musicOneSubjectClassPlan.setApplyStudentNum(applyNum + num);
|