lyhzzz пре 2 година
родитељ
комит
76845f1f90
1 измењених фајлова са 15 додато и 0 уклоњено
  1. 15 0
      src/main/java/com/fdkankan/ucenter/service/impl/OrderServiceImpl.java

+ 15 - 0
src/main/java/com/fdkankan/ucenter/service/impl/OrderServiceImpl.java

@@ -75,6 +75,8 @@ public class OrderServiceImpl extends ServiceImpl<IOrderMapper, Order> implement
     @Autowired
     IIncrementTypeService incrementTypeService;
     @Autowired
+    IUserIncrementService userIncrementService;
+    @Autowired
     IOrderService orderService;
 
     @Override
@@ -292,6 +294,19 @@ public class OrderServiceImpl extends ServiceImpl<IOrderMapper, Order> implement
         if(user == null){
             throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
         }
+        if(param.getIncrementId() != null){
+            UserIncrement userIncrement = userIncrementService.getById(param.getIncrementId());
+            if(userIncrement == null){
+                throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+
+            }
+            IncrementType incrementType = incrementTypeService.getById(param.getIncrementType());
+            if(incrementType == null){
+                throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);
+            }
+            return incrementOrderService.insertIncrementOrder(user, param,incrementType);
+        }
+
         IncrementType incrementType = incrementTypeService.getById(param.getIncrementType());
         if(incrementType == null){
             throw new BusinessException(OrderConstant.FAILURE_CODE_8004, OrderConstant.FAILURE_MSG_8004);