|
@@ -6,7 +6,6 @@ import com.diagbot.dto.ProductAuthProgressDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.UserOrgDTO;
|
|
|
import com.diagbot.dto.WaitExamOrderCouDTO;
|
|
|
-import com.diagbot.entity.LantoneProduct;
|
|
|
import com.diagbot.entity.OrderDetailStatus;
|
|
|
import com.diagbot.entity.OrderDetails;
|
|
|
import com.diagbot.entity.ProductOrder;
|
|
@@ -114,11 +113,9 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
}
|
|
|
OrderDetails orderDetails = null;
|
|
|
List<OrderDetails> list =new ArrayList();
|
|
|
+ List<Long> lantoneProductId =new ArrayList<>();
|
|
|
for (Long o : addOrderVO.getProductId()) {
|
|
|
- LantoneProduct lantoneProduct = lantoneProductFacade.selectLanProduct(o);
|
|
|
- if (null == lantoneProduct) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取产品信息失败:" + o);
|
|
|
- }
|
|
|
+ lantoneProductId.add(o);
|
|
|
orderDetails = new OrderDetails();
|
|
|
orderDetails.setUserId(userId);
|
|
|
orderDetails.setOrderNum(orderNum);
|
|
@@ -127,6 +124,9 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
orderDetails.setProductId(o);
|
|
|
list.add(orderDetails);
|
|
|
}
|
|
|
+ if (0 == lantoneProductFacade.listByIds(lantoneProductId).size()) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取产品信息失败:");
|
|
|
+ }
|
|
|
if(orderDetailsFacade.saveOrderDetails(list)){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "添加订单失败");
|
|
|
}
|