Przeglądaj źródła

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 4 lat temu
rodzic
commit
923c109acf

+ 26 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAddStudentDto.java

@@ -0,0 +1,26 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.List;
+
+public class MusicGroupPaymentCalenderAddStudentDto {
+
+	private Long musicGroupPaymentCalenderId;
+
+	private List<Integer> userIdList;
+
+	public Long getMusicGroupPaymentCalenderId() {
+		return musicGroupPaymentCalenderId;
+	}
+
+	public void setMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId) {
+		this.musicGroupPaymentCalenderId = musicGroupPaymentCalenderId;
+	}
+
+	public List<Integer> getUserIdList() {
+		return userIdList;
+	}
+
+	public void setUserIdList(List<Integer> userIdList) {
+		this.userIdList = userIdList;
+	}
+}

+ 7 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -515,6 +515,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
                 Map<String, BigDecimal> groupType = JSONObject.parseObject(goodsGroup.getKitGroupPurchaseTypeJson(), new TypeReference<Map<String, BigDecimal>>() {
                 });
+
                 Map<String, BigDecimal> coursePurchase = JSONObject.parseObject(goodsGroup.getCoursePurchaseTypeJson(), new TypeReference<Map<String, BigDecimal>>() {
                 });
                 if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
@@ -527,7 +528,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     }
                     goodsGroup.setKitGroupPurchaseType(KitGroupPurchaseTypeEnum.valueOf(kitGroupPurchaseType));
                     remitFee = groupType.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : groupType.get(kitGroupPurchaseType);
-                    courseRemitFee = coursePurchase.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : coursePurchase.get(kitGroupPurchaseType);
+                    if (coursePurchase != null){
+                        courseRemitFee = coursePurchase.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : coursePurchase.get(kitGroupPurchaseType);
+                    }
                 }
                 orderAmount = orderAmount.add(goodsGroup.getPrice());
                 goodsGroup.setGoodsList(goodsService.findGoodsByIds(goodsGroup.getGoodsIdList()));
@@ -743,7 +746,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     }
                     goodsGroup.setKitGroupPurchaseType(KitGroupPurchaseTypeEnum.valueOf(kitGroupPurchaseType));
                     remitFee = groupType.get(kitGroupPurchaseType);
-                    courseRemitFee = coursePurchase.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : coursePurchase.get(kitGroupPurchaseType);
+                    if (coursePurchase != null) {
+                        courseRemitFee = coursePurchase.get(kitGroupPurchaseType) == null ? BigDecimal.ZERO : coursePurchase.get(kitGroupPurchaseType);
+                    }
                 }
                 orderAmount = orderAmount.add(goodsGroup.getPrice());
                 goodsGroup.setGoodsList(goodsService.findGoodsByIds(goodsGroup.getGoodsIdList()));

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

@@ -124,7 +124,7 @@
 	</select>
 
     <select id="getCalenderCourseSettings" resultMap="MusicGroupPaymentCalenderCourseSettings">
-		SELECT * FROM music_group_organization_course_settings WHERE id_ IN
+		SELECT * FROM music_group_payment_calender_course_settings WHERE id_ IN
 		<foreach collection="ids" item="id" open="(" close=")" separator=",">
 			#{id}
 		</foreach>

+ 7 - 5
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -4,15 +4,16 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 import java.math.BigDecimal;
-import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAddStudentDto;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
 import com.ym.mec.common.controller.BaseController;
@@ -59,10 +60,11 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
     @ApiOperation(value = "乐团缴费记录新增学员")
     @PostMapping("/batchAdd")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/batchAdd')")
-    public Object batchAdd(Long musicGroupPaymentCalenderId,List<Integer> userIdList) {
-        musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalenderId,userIdList);
-        return succeed();
-    }
+	public Object batchAdd(@RequestBody MusicGroupPaymentCalenderAddStudentDto musicGroupPaymentCalenderAddStudentDto) {
+		musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalenderAddStudentDto.getMusicGroupPaymentCalenderId(),
+				musicGroupPaymentCalenderAddStudentDto.getUserIdList());
+		return succeed();
+	}
 
     @ApiOperation(value = "批量删除缴费信息")
     @PostMapping("/batchDel")