| | |
| | | |
| | | |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | if (data.getLimitNumber()<num1) { |
| | | throw new ServiceException("该商品已售罄,暂无库存"); |
| | | if (data.getLimitNumber()!=0){ |
| | | if (data.getLimitNumber()<num1) { |
| | | throw new ServiceException("对不起,大于商品购买数"); |
| | | } |
| | | } |
| | | |
| | | |
| | | order.setOrderFrom(OrderFromEnum.SNAP_ORDERS); |
| | | memberOrderVO.setGoodsSkuId(memberOrderDTO.getGoodsSkuId()); |
| | |
| | | memberOrderDTO1.setGoodsSkuId(order.getGoodsSkuId()); |
| | | Integer num=baseMapper.getSeckillMembers1(memberOrderDTO1); |
| | | Integer num1=0; |
| | | if (num!=null){ |
| | | num1 =num+order.getGoodsQuantity(); |
| | | if(num!=order.getGoodsQuantity()){ |
| | | if (num!=null){ |
| | | num1 =num+order.getGoodsQuantity(); |
| | | }else{ |
| | | num1=order.getGoodsQuantity(); |
| | | } |
| | | }else{ |
| | | num1=order.getGoodsQuantity(); |
| | | num1=num; |
| | | } |
| | | |
| | | |
| | | GoodsSeckill data = goodsSkuClient.getGoodsSeckillOne(order.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(data.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | |
| | | if (num1!=order.getGoodsQuantity()){ |
| | | if (data.getLimitNumber()<num1){ |
| | | if (data.getLimitNumber()!=0||data.getLimitNumber()<num1){ |
| | | throw new ServiceException("对不起,大于商品购买数"); |
| | | }else{ |
| | | |
| | |
| | | pice=pice.subtract(data.getReductionAmount()); |
| | | order.setDiscountMoney(data.getReductionAmount()); |
| | | }else{ |
| | | order.setDiscountMoney(pice); |
| | | pice=new BigDecimal(0); |
| | | |
| | | } |
| | |
| | | if (data.getCouponType().getCode()==2){ |
| | | pice= order.getTotalAmount(); |
| | | if(pice.compareTo(data.getVoucherAmount())<0){ |
| | | throw new ServiceException("优惠卷抵扣金额不能大于实际支付金额"); |
| | | order.setDiscountMoney(pice); |
| | | pice=new BigDecimal(0); |
| | | }else{ |
| | | pice=pice.subtract(data.getVoucherAmount()); |
| | | order.setDiscountMoney(data.getVoucherAmount()); |
| | | } |
| | | pice=pice.subtract(data.getVoucherAmount()); |
| | | order.setDiscountMoney(data.getVoucherAmount()); |
| | | |
| | | } |
| | | if (data.getCouponType().getCode()==3){ |
| | | pice= order.getTotalAmount(); |
| | |
| | | pice3=new BigDecimal(data.getMaxDiscount().doubleValue()); |
| | | } |
| | | if(pice.compareTo(pice3)<0){ |
| | | throw new ServiceException("优惠卷抵扣金额不能大于实际支付金额"); |
| | | BigDecimal pice4= pice.subtract(pice3); |
| | | if (pice4.doubleValue()>data.getMaxDiscount().doubleValue()){ |
| | | pice=pice.subtract(data.getMaxDiscount()); |
| | | order.setDiscountMoney(data.getMaxDiscount()); |
| | | }else{ |
| | | order.setDiscountMoney(pice4); |
| | | pice=pice3; |
| | | } |
| | | }else{ |
| | | order.setDiscountMoney(pice); |
| | | pice=new BigDecimal(0); |
| | | } |
| | | |
| | | BigDecimal pice4= pice.subtract(pice3); |
| | | if (pice4.doubleValue()>data.getMaxDiscount().doubleValue()){ |
| | | pice=pice.subtract(data.getMaxDiscount()); |
| | | order.setDiscountMoney(data.getMaxDiscount()); |
| | | }else{ |
| | | order.setDiscountMoney(pice4); |
| | | pice=pice3; |
| | | } |
| | | |
| | | |
| | | } |
| | | order.setCouponId(memberOrderDTO.getCouponId()); |
| | |
| | | }else { |
| | | MemberOrderList.setIsAuctionBond(1); |
| | | } |
| | | |
| | | CustomConfig memberPointsPoints = sysUserClient.getconfig("MALL_ORDER_DESCRIPTION").getData(); |
| | | MemberOrderList.setOrderShuoMin(memberPointsPoints.getConfigValue()); |
| | | CustomConfig ReturnCycle = sysUserClient.getconfig("RETURN_CYCLE").getData(); |
| | | MemberOrderList.setOrderZq(Integer.valueOf(ReturnCycle.getConfigValue())); |
| | | } |
| | | |
| | | |