|
@@ -107,6 +107,20 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
@Transactional
|
|
|
public Boolean addOrders(AddOrderVO addOrderVO) {
|
|
|
Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
|
|
|
+ List<Long> opendId = openedProductsFacade.getOpendCountByUserId(userId);
|
|
|
+ List<Long> orderDetailsId = orderDetailsFacade.getOrderDetailsByUser(userId);
|
|
|
+ for (int i =0; i<addOrderVO.getProductId().size();i++){
|
|
|
+ for (int j =0; j<opendId.size();j++){
|
|
|
+ if(addOrderVO.getProductId().get(i)==opendId.get(j)){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请勿重复提交已开通产品:");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (int k =0; k<orderDetailsId.size();k++){
|
|
|
+ if(addOrderVO.getProductId().get(i)==orderDetailsId.get(k)){
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "产品正在审核中请勿重复提交:");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
ProductOrder productOrder = new ProductOrder();
|
|
|
productOrder.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
productOrder.setGmtCreate(DateUtil.now());
|
|
@@ -133,9 +147,9 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
|
|
|
if (0 == lantoneProductFacade.listByIds(lantoneProductId).size()) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取产品信息失败:");
|
|
|
}
|
|
|
- if(orderDetailsFacade.saveOrderDetails(list)){
|
|
|
+ /*if(orderDetailsFacade.saveOrderDetails(list)){
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "添加订单失败");
|
|
|
- }
|
|
|
+ }*/
|
|
|
return true;
|
|
|
}
|
|
|
|