mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-04 11:16:39 +08:00
modify product_id -> product_code
This commit is contained in:
parent
6e46d5743a
commit
a5c665b822
@ -60,12 +60,12 @@ public class OrderController {
|
|||||||
OrdersEntity ordersEntity = new OrdersEntity();
|
OrdersEntity ordersEntity = new OrdersEntity();
|
||||||
OrderAddress orderAddress = new OrderAddress();
|
OrderAddress orderAddress = new OrderAddress();
|
||||||
for (OrdersEntity ordersEntitys:ordersEntityList) {
|
for (OrdersEntity ordersEntitys:ordersEntityList) {
|
||||||
cartService.cancelProduct(ordersEntitys.getMemberId(),ordersEntity.getProductId());
|
cartService.cancelProduct(ordersEntitys.getMemberId(),ordersEntity.getProductCode());
|
||||||
//存储orderDetailList
|
//存储orderDetailList
|
||||||
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
|
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
|
||||||
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
||||||
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
||||||
orderDatilListEntity.setProductId(ordersEntitys.getProductId());
|
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
|
||||||
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
||||||
orderDatilListJson.add(orderDatilListEntity);
|
orderDatilListJson.add(orderDatilListEntity);
|
||||||
if(ordersEntitys.getCouponCode() != "") {
|
if(ordersEntitys.getCouponCode() != "") {
|
||||||
@ -80,7 +80,7 @@ public class OrderController {
|
|||||||
orderAddress.setAddressPhoneNumber(ordersEntitys.getOrderAddress().getAddressPhoneNumber());
|
orderAddress.setAddressPhoneNumber(ordersEntitys.getOrderAddress().getAddressPhoneNumber());
|
||||||
orderAddress.setAddressUserName(ordersEntitys.getOrderAddress().getAddressUserName());
|
orderAddress.setAddressUserName(ordersEntitys.getOrderAddress().getAddressUserName());
|
||||||
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
|
orderAddress.setAddressProvinceName(ordersEntitys.getOrderAddress().getAddressProvinceName());
|
||||||
productId.append(ordersEntitys.getProductId()+",");
|
productId.append(ordersEntitys.getProductCode()+",");
|
||||||
productName.append(ordersEntitys.getProductName()+",");
|
productName.append(ordersEntitys.getProductName()+",");
|
||||||
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
|
total_fee = total_fee + orderService.couponTotal(ordersEntitys.getCouponTypeId(),Double.parseDouble(ordersEntitys.getCouponAmount()),Double.parseDouble(ordersEntitys.getPayAmount()),ordersEntitys.getBuyCount());
|
||||||
memberId = ordersEntitys.getMemberId();
|
memberId = ordersEntitys.getMemberId();
|
||||||
@ -88,7 +88,7 @@ public class OrderController {
|
|||||||
buyCount = buyCount + ordersEntitys.getBuyCount();
|
buyCount = buyCount + ordersEntitys.getBuyCount();
|
||||||
}
|
}
|
||||||
ordersEntity.setOrderAddress(orderAddress);
|
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.setProductName(productName.substring(0,productName.length()-1));
|
||||||
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
||||||
ordersEntity.setMemberId(memberId);
|
ordersEntity.setMemberId(memberId);
|
||||||
@ -98,7 +98,7 @@ public class OrderController {
|
|||||||
ordersEntity.setOrderStatus("0");
|
ordersEntity.setOrderStatus("0");
|
||||||
|
|
||||||
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
||||||
wxPayEntity.setProduct_id(ordersEntity.getProductId());
|
wxPayEntity.setProduct_id(ordersEntity.getProductCode());
|
||||||
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
|
wxPayEntity.setTotal_fee(StringUtil.toString(total_fee));
|
||||||
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
wxPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
||||||
return ResponseDTO.succData(wxpayService.generateQRCode(wxPayEntity));
|
return ResponseDTO.succData(wxpayService.generateQRCode(wxPayEntity));
|
||||||
@ -139,12 +139,12 @@ public class OrderController {
|
|||||||
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
|
OrderDatilListEntity orderDatilListEntity= new OrderDatilListEntity();
|
||||||
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
orderDatilListEntity.setProductName(ordersEntitys.getProductName());
|
||||||
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
orderDatilListEntity.setPcs(ordersEntitys.getBuyCount());
|
||||||
orderDatilListEntity.setProductId(ordersEntitys.getProductId());
|
orderDatilListEntity.setProductCode(ordersEntitys.getProductCode());
|
||||||
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
orderDatilListEntity.setEcPrice(ordersEntitys.getPayAmount());
|
||||||
orderDatilListJson.add(orderDatilListEntity);
|
orderDatilListJson.add(orderDatilListEntity);
|
||||||
|
|
||||||
|
|
||||||
productId.append(ordersEntitys.getProductId()+",");
|
productId.append(ordersEntitys.getProductCode()+",");
|
||||||
productName.append(ordersEntitys.getProductName()+",");
|
productName.append(ordersEntitys.getProductName()+",");
|
||||||
if(ordersEntitys.getPayAmount() != "0"){
|
if(ordersEntitys.getPayAmount() != "0"){
|
||||||
total_fee = total_fee + (Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount()) - Double.parseDouble(ordersEntitys.getCouponAmount());
|
total_fee = total_fee + (Double.parseDouble(ordersEntitys.getPayAmount()) * ordersEntitys.getBuyCount()) - Double.parseDouble(ordersEntitys.getCouponAmount());
|
||||||
@ -155,7 +155,7 @@ public class OrderController {
|
|||||||
mobile = ordersEntitys.getPhoneNumber();
|
mobile = ordersEntitys.getPhoneNumber();
|
||||||
buyCount = buyCount + ordersEntitys.getBuyCount();
|
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.setProductName(productName.substring(0,productName.length()-1));
|
||||||
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
ordersEntity.setOrderAmount(StringUtil.toString(total_fee));
|
||||||
ordersEntity.setMemberId(memberId);
|
ordersEntity.setMemberId(memberId);
|
||||||
@ -165,7 +165,7 @@ public class OrderController {
|
|||||||
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
ordersEntity.setOrderNo(GenerateSequenceUtil.generateSequenceNo());
|
||||||
ordersEntity.setOrderStatus("0");
|
ordersEntity.setOrderStatus("0");
|
||||||
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
if(orderService.generateOrder(ordersEntity,orderDatilListJson) == 1){
|
||||||
aliPayEntity.setProduct_code(ordersEntity.getProductId());
|
aliPayEntity.setProduct_code(ordersEntity.getProductCode());
|
||||||
aliPayEntity.setTotal_amount(StringUtil.toString(total_fee));
|
aliPayEntity.setTotal_amount(StringUtil.toString(total_fee));
|
||||||
aliPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
aliPayEntity.setOut_trade_no(ordersEntity.getOrderNo());
|
||||||
return ResponseDTO.succData(aliPayService.generateQRCode(aliPayEntity));
|
return ResponseDTO.succData(aliPayService.generateQRCode(aliPayEntity));
|
||||||
|
@ -17,7 +17,7 @@ public class OrderEntity {
|
|||||||
|
|
||||||
private String payAmount ="";
|
private String payAmount ="";
|
||||||
|
|
||||||
private String productId;
|
private String productCode;
|
||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ public class OrdersEntity {
|
|||||||
|
|
||||||
private String payAmount ="";
|
private String payAmount ="";
|
||||||
|
|
||||||
private String productId;
|
private String productCode;
|
||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class OrderService {
|
|||||||
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
||||||
couponCosumeEntity.setCouponCode(ordersEntity.getCouponCode());
|
couponCosumeEntity.setCouponCode(ordersEntity.getCouponCode());
|
||||||
couponCosumeEntity.setOrderNo(ordersEntity.getOrderNo());
|
couponCosumeEntity.setOrderNo(ordersEntity.getOrderNo());
|
||||||
couponCosumeEntity.setProductCode(ordersEntity.getProductId());
|
couponCosumeEntity.setProductCode(ordersEntity.getProductCode());
|
||||||
BigDecimal realCouponAmount =new BigDecimal(ordersEntity.getOrderAmount());
|
BigDecimal realCouponAmount =new BigDecimal(ordersEntity.getOrderAmount());
|
||||||
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
|
couponCosumeEntity.setRealCouponAmount(realCouponAmount);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));
|
JSONObject jsonObject = JSONObject.parseObject(couponService.couponCosume(couponCosumeEntity));
|
||||||
|
@ -1634,7 +1634,7 @@ CREATE TABLE `t_good_orders` (
|
|||||||
`order_status` varchar(20) DEFAULT NULL COMMENT '0:待付款,1:待收货,2:已完成,3:已取消,4:异常订单',
|
`order_status` varchar(20) DEFAULT NULL COMMENT '0:待付款,1:待收货,2:已完成,3:已取消,4:异常订单',
|
||||||
`order_amount` varchar(11) DEFAULT NULL COMMENT '订单金额',
|
`order_amount` varchar(11) DEFAULT NULL COMMENT '订单金额',
|
||||||
`pay_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_code` varchar(20) DEFAULT NULL COMMENT '优惠券code',
|
||||||
`coupon_id` varchar(20) DEFAULT NULL COMMENT '优惠券ID',
|
`coupon_id` varchar(20) DEFAULT NULL COMMENT '优惠券ID',
|
||||||
`coupon_name` varchar(20) DEFAULT NULL COMMENT '优惠券名字',
|
`coupon_name` varchar(20) DEFAULT NULL COMMENT '优惠券名字',
|
||||||
|
Loading…
Reference in New Issue
Block a user