Ver código fonte

管乐迷商城改造

zouxuan 1 ano atrás
pai
commit
226565adf5

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentActivityServiceImpl.java

@@ -488,7 +488,7 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
 //            this.addSellOrder(studentPaymentOrder, replacementInstrumentActivity);
             List<Integer> goodsIds = new ArrayList<>();
             goodsIds.add(replacementInstrumentActivity.getInstrumentsId());
-            sellOrderService.initSellOrder(studentPaymentOrder,null,goodsIds,null);
+            sellOrderService.initSellOrder(studentPaymentOrder,null,goodsIds,null,true);
             try {
                 contractService.transferProduceContract(userId, null, studentPaymentOrder.getType());
             } catch (Exception e) {

+ 7 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -1213,16 +1213,17 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         return pageInfo;
     }
 
-    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+    @Transactional(rollbackFor = Exception.class)
     public void saveSellOrder(String orderNo) {
         StudentPaymentOrder orderByOrderNo = studentPaymentOrderService.findOrderByOrderNo(orderNo);
         StudentGoodsSell studentGoodsSell = studentGoodsSellDao.findByOrderNo(orderNo);
         String goodsJson = studentGoodsSell.getGoodsJson();
         List<GoodsSellDto> goodsSellDtos = JSONObject.parseArray(goodsJson, GoodsSellDto.class);
         //用户选择的商品
-        Map<Integer, List<GoodsSellDto>> collect = goodsSellDtos.stream().collect(Collectors.groupingBy(GoodsSellDto::getGoodsId));
-        List<Integer> goodsIds = new ArrayList<>();
-        goodsSellDtos.forEach(e -> {
+//        Map<Integer, List<GoodsSellDto>> collect = goodsSellDtos.stream().collect(Collectors.groupingBy(GoodsSellDto::getGoodsId));
+        List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
+        sellOrderService.initSellOrder(orderByOrderNo,null,goodsIds,null,true);
+        /*goodsSellDtos.forEach(e -> {
             for (int i = 0; i < e.getGoodsNum(); i++) {
                 goodsIds.add(e.getGoodsId());
             }
@@ -1437,7 +1438,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             }
             sellOrderService.batchInsert(sellOrderList);
             sellOrderService.syncSellOrder2Mall(sellOrderList,orderByOrderNo);
-        }
+        }*/
     }
 
     @Override
@@ -1537,7 +1538,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
                             studentPaymentOrder.getBalancePaymentAmount(), couponRemitFee);*/
                     studentPaymentOrder.setExpectAmount(studentPaymentOrder.getExpectAmount().add(repairInfo.getExemptionAmount()));
                     studentPaymentOrder.setCouponRemitFee(couponRemitFee);
-                    sellOrderService.initSellOrder(studentPaymentOrder,null,goodsIds,null);
+                    sellOrderService.initSellOrder(studentPaymentOrder,null,goodsIds,null,true);
                 }
             }
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectChangeServiceImpl.java

@@ -1259,6 +1259,6 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
         if (goodsIds == null || goodsIds.size() <= 0) {
             return null;
         }
-        return sellOrderService.initSellOrder(order,musicGroupId,goodsIds,kitGroupPurchaseType);
+        return sellOrderService.initSellOrder(order,musicGroupId,goodsIds,kitGroupPurchaseType,true);
     }
 }