Commit 903f26f6 authored by macro's avatar macro
Browse files

生成订单添加地址校验逻辑

parent 6a189507
......@@ -93,6 +93,10 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
@Override
public Map<String, Object> generateOrder(OrderParam orderParam) {
List<OmsOrderItem> orderItemList = new ArrayList<>();
//校验收货地址
if(orderParam.getMemberReceiveAddressId()==null){
Asserts.fail("请选择收货地址!");
}
//获取购物车及优惠信息
UmsMember currentMember = memberService.getCurrentMember();
List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(currentMember.getId(), orderParam.getCartIds());
......@@ -230,6 +234,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
//如使用积分需要扣除积分
if (orderParam.getUseIntegration() != null) {
order.setUseIntegration(orderParam.getUseIntegration());
if(currentMember.getIntegration()==null){
currentMember.setIntegration(0);
}
memberService.updateIntegration(currentMember.getId(), currentMember.getIntegration() - orderParam.getUseIntegration());
}
//删除购物车中的下单商品
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment