|
@@ -1,23 +1,27 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
|
|
|
-import com.ym.mec.biz.dal.entity.Goods;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPurchaseList;
|
|
|
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
-import com.ym.mec.biz.service.GoodsService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupPurchaseListService;
|
|
|
-import com.ym.mec.common.exception.BizException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupPurchaseListDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
|
+import com.ym.mec.biz.dal.entity.Goods;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPurchaseList;
|
|
|
import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
|
|
|
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
+import com.ym.mec.biz.service.GoodsService;
|
|
|
import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
|
|
|
-import java.util.*;
|
|
|
-
|
|
|
@Service
|
|
|
public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long, StudentPaymentOrderDetail> implements StudentPaymentOrderDetailService {
|
|
|
|
|
@@ -44,33 +48,36 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Goods> getMusicalList(String musicGroupId) {
|
|
|
- List<StudentPaymentOrderDetail> applyOrder = findApplyOrderSuccess(musicGroupId, DealStatusEnum.SUCCESS);
|
|
|
- if (applyOrder == null || applyOrder.size() == 0) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- String goodsIdsStr = "";
|
|
|
- for (StudentPaymentOrderDetail studentPaymentOrderDetail : applyOrder) {
|
|
|
- if (studentPaymentOrderDetail.getGoodsIdList() != null && !studentPaymentOrderDetail.getGoodsIdList().isEmpty()) {
|
|
|
- goodsIdsStr += studentPaymentOrderDetail.getGoodsIdList() + ",";
|
|
|
- }
|
|
|
- }
|
|
|
- goodsIdsStr = goodsIdsStr.substring(0, goodsIdsStr.length() - 1);
|
|
|
-
|
|
|
- String[] goodSIdArr = goodsIdsStr.split(",");
|
|
|
-
|
|
|
- List<Goods> goodies = goodsService.findGoodsByIds(goodsIdsStr);
|
|
|
-
|
|
|
- for (Goods goods : goodies) {
|
|
|
- goods.setSellCount(0);
|
|
|
- for (String goodsIdStr : goodSIdArr) {
|
|
|
- if (goods.getId().equals(Integer.parseInt(goodsIdStr))) {
|
|
|
- goods.setSellCount(goods.getSellCount() + 1);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return goodies;
|
|
|
- }
|
|
|
+ public List<Goods> getMusicalList(String musicGroupId) {
|
|
|
+ List<StudentPaymentOrderDetail> applyOrder = findApplyOrderSuccess(musicGroupId, DealStatusEnum.SUCCESS);
|
|
|
+ if (applyOrder == null || applyOrder.size() == 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String goodsIdsStr = "";
|
|
|
+ for (StudentPaymentOrderDetail studentPaymentOrderDetail : applyOrder) {
|
|
|
+ if (studentPaymentOrderDetail.getGoodsIdList() != null && !studentPaymentOrderDetail.getGoodsIdList().isEmpty()) {
|
|
|
+ goodsIdsStr += studentPaymentOrderDetail.getGoodsIdList() + ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(goodsIdsStr)) {
|
|
|
+ goodsIdsStr = goodsIdsStr.substring(0, goodsIdsStr.length() - 1);
|
|
|
+
|
|
|
+ String[] goodSIdArr = goodsIdsStr.split(",");
|
|
|
+
|
|
|
+ List<Goods> goodies = goodsService.findGoodsByIds(goodsIdsStr);
|
|
|
+
|
|
|
+ for (Goods goods : goodies) {
|
|
|
+ goods.setSellCount(0);
|
|
|
+ for (String goodsIdStr : goodSIdArr) {
|
|
|
+ if (goods.getId().equals(Integer.parseInt(goodsIdStr))) {
|
|
|
+ goods.setSellCount(goods.getSellCount() + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return goodies;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public Boolean verifyMusicalList(String musicGroupId) throws BizException {
|