新版
This commit is contained in:
@@ -126,10 +126,10 @@ public class BuyOrderController {
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequestMapping("/buysave")
|
||||
@Transactional
|
||||
// @RequiresPermissions("book:buyorder:save")
|
||||
public R save(@RequestBody BuyOrderEntity buyOrder){
|
||||
public R buysave(@RequestBody BuyOrderEntity buyOrder){
|
||||
|
||||
|
||||
BigDecimal realMoney = new BigDecimal(0);
|
||||
@@ -151,14 +151,13 @@ public class BuyOrderController {
|
||||
BigDecimal activityPrice = product.getActivityPrice();
|
||||
BigDecimal big = new BigDecimal(0);
|
||||
BigDecimal price=null;
|
||||
//activityPrice等于0,则原价
|
||||
if (activityPrice == big) {
|
||||
price = product.getPrice();
|
||||
|
||||
//activityPrice等于0,则原价
|
||||
if (activityPrice.equals(big)||activityPrice==null) {
|
||||
price = product.getPrice();
|
||||
}else {
|
||||
price = product.getActivityPrice();
|
||||
}
|
||||
|
||||
Integer quantity = buyOrderDetail.getQuantity();
|
||||
BigDecimal bigDecimal = new BigDecimal(price.doubleValue() * quantity);
|
||||
System.out.println("bigDecimal=================bigDecimal======================"+bigDecimal);
|
||||
@@ -176,13 +175,8 @@ public class BuyOrderController {
|
||||
buyOrderDetailEntity.setProductPrice(product.getPrice());
|
||||
buyOrderDetailEntity.setAddressId(buyOrder.getAddressId());
|
||||
buyOrderDetailEntity.setProductUrl(product.getProductImages());
|
||||
System.out.println(buyOrder.getAddressId());
|
||||
buyOrderDetailEntity.setOrderStatus("0");
|
||||
list.add(buyOrderDetailEntity);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Integer couponId = buyOrder.getCouponId();
|
||||
@@ -201,15 +195,12 @@ public class BuyOrderController {
|
||||
|
||||
// 减去优惠券金额
|
||||
realMoney = buyOrder.getRealMoney();
|
||||
|
||||
if (bigDecimal1.compareTo(realMoney) == 0) {
|
||||
|
||||
//特定格式的时间ID
|
||||
//特定格式的时间ID
|
||||
String timeId = IdWorker.getTimeId().substring(0,32);
|
||||
buyOrder.setOrderSn(timeId);
|
||||
if("4".equals(buyOrder.getPaymentMethod())){
|
||||
buyOrder.setOrderStatus("1");
|
||||
|
||||
}
|
||||
//todo 增加结束时间
|
||||
buyOrder.setPaymentDate(new Date());
|
||||
@@ -284,9 +275,9 @@ public class BuyOrderController {
|
||||
* @param buyOrder 订单表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/buysave")
|
||||
@RequestMapping("/buysave1")
|
||||
@Transactional
|
||||
public R buysave(@RequestBody BuyOrderEntity buyOrder) {
|
||||
public R buysave1(@RequestBody BuyOrderEntity buyOrder) {
|
||||
|
||||
BigDecimal realMoney = new BigDecimal(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user