modify product_id -> product_code

This commit is contained in:
Carl 2022-01-06 16:57:38 +08:00
parent 6e46d5743a
commit a5c665b822
5 changed files with 13 additions and 13 deletions

View File

@ -60,12 +60,12 @@ public class OrderController {
OrdersEntity ordersEntity = new OrdersEntity();
OrderAddress orderAddress = new OrderAddress();
for (OrdersEntity ordersEntitys:ordersEntityList) {
cartService.cancelProduct(ordersEntitys.getMemberId(),ordersEntity.getProductId());
cartService.cancelProduct(ordersEntitys.getMemberId(),ordersEntity.getProductCode());
//存储orderDetailList
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
orderDatilListEntity.setProductId(ordersEntitys.getProductId());
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
orderDatilListJson.add(orderDatilListEntity);
if(ordersEntitys.getCouponCode() != "") {
@ -80,7 +80,7 @@ public class OrderController {
orderAddress.setAddressPhoneNumber(ordersEntitys.getOrderAddress().getAddressPhoneNumber());
orderAddress.setAddressUserName(ordersEntitys.getOrderAddress().getAddressUserName());
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
productId.append(ordersEntitys.getProductId()+",");
productId.append(ordersEntitys.getProductCode()+",");
productName.append(ordersEntitys.getProductName()+",");
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
memberId = ordersEntitys.getMemberId();
@ -88,7 +88,7 @@ public class OrderController {
buyCount = buyCount + ordersEntitys.getBuyCount();
}
ordersEntity.setOrderAddress(orderAddress);
ordersEntity.setProductId(productId.substring(0,productId.length()-1));
ordersEntity.setProductCode(productId.substring(0,productId.length()-1));
ordersEntity.setProductName(productName.substring(0,productName.length()-1));
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
ordersEntity.setMemberId(memberId);
@ -98,7 +98,7 @@ public class OrderController {
ordersEntity.setOrderStatus("0");
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
wxPayEntity.setProduct_id(ordersEntity.getProductId());
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
return ResponseDTO.succData(wxpayService.generateQRCode(wxPayEntity));
@ -139,12 +139,12 @@ public class OrderController {
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
orderDatilListEntity.setProductId(ordersEntitys.getProductId());
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
orderDatilListJson.add(orderDatilListEntity);
productId.append(ordersEntitys.getProductId()+",");
productId.append(ordersEntitys.getProductCode()+",");
productName.append(ordersEntitys.getProductName()+",");
if(ordersEntitys.getPayAmount() != "0"){
total_fee = total_fee + (Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount()) - Double.parseDouble(ordersEntitys.getCouponAmount());
@ -155,7 +155,7 @@ public class OrderController {
mobile = ordersEntitys.getPhoneNumber();
buyCount = buyCount + ordersEntitys.getBuyCount();
}
ordersEntity.setProductId(productId.substring(0,productId.length()-1));
ordersEntity.setProductCode(productId.substring(0,productId.length()-1));
ordersEntity.setProductName(productName.substring(0,productName.length()-1));
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
ordersEntity.setMemberId(memberId);
@ -165,7 +165,7 @@ public class OrderController {
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
ordersEntity.setOrderStatus("0");
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
aliPayEntity.setProduct_code(ordersEntity.getProductId());
aliPayEntity.setProduct_code(ordersEntity.getProductCode());
aliPayEntity.setTotal_amount(StringUtil.toString(total_fee));
aliPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
return ResponseDTO.succData(aliPayService.generateQRCode(aliPayEntity));

View File

@ -17,7 +17,7 @@ public class OrderEntity {
private String payAmount ="";
private String productId;
private String productCode;
private String productName;

View File

@ -15,7 +15,7 @@ public class OrdersEntity {
private String payAmount ="";
private String productId;
private String productCode;
private String productName;

View File

@ -54,7 +54,7 @@ public class OrderService {
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
couponCosumeEntity.setCouponCode(ordersEntity.getCouponCode());
couponCosumeEntity.setOrderNo(ordersEntity.getOrderNo());
couponCosumeEntity.setProductCode(ordersEntity.getProductId());
couponCosumeEntity.setProductCode(ordersEntity.getProductCode());
BigDecimal realCouponAmount =new BigDecimal(ordersEntity.getOrderAmount());
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));

View File

@ -1634,7 +1634,7 @@ CREATE TABLE `t_good_orders` (
`order_status` varchar(20) DEFAULT NULL COMMENT '0:待付款,1:待收货,2:已完成,3:已取消,4:异常订单',
`order_amount` varchar(11) DEFAULT NULL COMMENT '订单金额',
`pay_amount` varchar(11) DEFAULT NULL COMMENT '实际支付金额',
`product_id` varchar(20) DEFAULT NULL COMMENT '产品表外键ID',
`product_code` varchar(20) DEFAULT NULL COMMENT '产品表外键ID',
`coupon_code` varchar(20) DEFAULT NULL COMMENT '优惠券code',
`coupon_id` varchar(20) DEFAULT NULL COMMENT '优惠券ID',
`coupon_name` varchar(20) DEFAULT NULL COMMENT '优惠券名字',