bug fix:county name is not unique value
This commit is contained in:
@@ -227,6 +227,7 @@ public class BuyOrderController {
|
||||
* @throws IOException
|
||||
*/
|
||||
@RequestMapping(value = "/placeOrder", method = RequestMethod.POST)
|
||||
@Transactional
|
||||
public R placeOrder(@RequestBody BuyOrder buyOrder) throws IOException {
|
||||
List<BuyOrderProduct> buyOrderProductList = buyOrder.getProductList();
|
||||
// 订单总金额
|
||||
@@ -241,13 +242,6 @@ public class BuyOrderController {
|
||||
return R.error(500, "库存不足");
|
||||
}
|
||||
totalPrice = totalPrice.add(price.multiply(BigDecimal.valueOf(quantity)));
|
||||
int originWeight = product.getWeight();
|
||||
int originWeightIntValue = originWeight / 100;
|
||||
int originWeightDecimalValue = originWeightIntValue % 100;
|
||||
//buyOrderProduct.setWeight(BigDecimal.valueOf(originWeightIntValue).add(BigDecimal.valueOf(originWeightDecimalValue).divide(new BigDecimal(100),
|
||||
//MathContext.DECIMAL64)));
|
||||
// buyOrderDetail.setProductUrl(product.getProductImages());
|
||||
// buyOrderDetail.setOrderStatus(Constants.ORDER_STATUS_TO_BE_PAID);
|
||||
}
|
||||
|
||||
totalPrice = totalPrice.subtract(useCouponAmount(buyOrder));
|
||||
@@ -268,12 +262,10 @@ public class BuyOrderController {
|
||||
|
||||
for (BuyOrderProduct buyOrderDetail : buyOrderProductList) {
|
||||
buyOrderDetail.setOrderId(buyOrder.getId());
|
||||
//buyOrderDetail.setUserId(buyOrder.getUserId());
|
||||
if (Constants.BUY_TYPE_CART.equals(buyOrder.getBuyType())) {
|
||||
handleBuyCart(buyOrder, buyOrderDetail);
|
||||
}
|
||||
}
|
||||
// buyOrderDetailService.saveBatch(buyOrderDetails);
|
||||
buyOrderProductService.saveBatch(buyOrderProductList);
|
||||
// 1. 虚拟币支付
|
||||
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
||||
@@ -364,7 +356,7 @@ public class BuyOrderController {
|
||||
}
|
||||
// 库存回滚
|
||||
QueryWrapper<BuyOrderProduct> buyOrderProductQueryWrapper = new QueryWrapper<>();
|
||||
buyOrderProductQueryWrapper.eq("order_id",buyOrder.getId());
|
||||
buyOrderProductQueryWrapper.eq("order_id", buyOrder.getId());
|
||||
List<BuyOrderProduct> buyOrderProductList = buyOrderProductService.list(buyOrderProductQueryWrapper);
|
||||
for (BuyOrderProduct buyOrderProduct : buyOrderProductList) {
|
||||
Integer productId = buyOrderProduct.getProductId();
|
||||
@@ -626,7 +618,7 @@ public class BuyOrderController {
|
||||
* 分包发货
|
||||
*
|
||||
* @param expressCompanyCode 快递公司编码
|
||||
* @param buyOrderProductId 订单商品
|
||||
* @param buyOrderProductId 订单商品
|
||||
* @return R
|
||||
*/
|
||||
@RequestMapping(value = "/delivery", method = RequestMethod.POST)
|
||||
|
||||
Reference in New Issue
Block a user