提交代码

master
胡锐 6 months ago committed by yuanye
parent d12bb42058
commit d47ae07ae2
  1. 5
      order/src/main/java/com/order/controller/OrderController.java
  2. 5
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java

@ -30,6 +30,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -95,6 +96,10 @@ public class OrderController {
}
}
public static void main(String[] args) {
System.out.println(new BigDecimal("500").compareTo(new BigDecimal("0")));
}
@RequestMapping(value="/cancel",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "取消订单")

@ -195,8 +195,9 @@ public class BsOrderServiceImpl implements BsOrderService {
}
/************ 交易优惠 **************/
order.setPayRealPrice(totalPrice.subtract(order.getDeduction().getTotalDeductionPrice()));
order.setOrderStatus(order.getPayRealPrice().equals(new BigDecimal("0"))?OrderStatusEnum.status2.getCode():OrderStatusEnum.status1.getCode());
BigDecimal payRealPrice = totalPrice.subtract(order.getDeduction().getTotalDeductionPrice());
order.setPayRealPrice(payRealPrice.compareTo(new BigDecimal("0")) < 0 ?payRealPrice:new BigDecimal("0"));
order.setOrderStatus(order.getPayRealPrice().compareTo(new BigDecimal("0")) == 0?OrderStatusEnum.status2.getCode():OrderStatusEnum.status1.getCode());
// 订单入库前处理
for (OrderChildModel childOrder : order.getOrderChildList()) {
childOrder.setSurplusRefundCount(childOrder.getProductCount());

Loading…
Cancel
Save