Selaa lähdekoodia

添加外部订单,商品为组合商品bug

周箭河 4 vuotta sitten
vanhempi
commit
7e941fe652

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

@@ -130,6 +130,11 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public StudentPaymentRouteOrder addOutOrder(StudentPaymentRouteOrder studentPaymentRouteOrder) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("transNo", studentPaymentRouteOrder.getTransNo());
+        if(studentPaymentRouteOrderDao.queryAuditCount(params) >0){
+            throw new  BizException("流水号不能重复");
+        }
         Date nowDate = new Date();
         String orderNo = idGeneratorService.generatorId("payment") + "";
         studentPaymentRouteOrder.setOrderNo(orderNo);
@@ -251,7 +256,7 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
 
                     BigDecimal hasRouteSellOrderActualAmount = BigDecimal.ZERO;
                     for (SellOrder sellOrder : sellOrderList) {
-                        if (!goodsMap.getKey().equals(sellOrder.getParentGoodsId()) && !goodsMap.getKey().equals(sellOrder.getGoodsId().toString())) {
+                        if (!goodsMap.getKey().equals(sellOrder.getParentGoodsId().toString()) && !goodsMap.getKey().equals(sellOrder.getGoodsId().toString())) {
                             continue;
                         }
                         BigDecimal sellOrderActualAmount = BigDecimal.ZERO;