From 9108fe37516a05b7af57953cb036e361ae3c86d2 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Fri, 19 Mar 2021 16:00:40 +0800
Subject: [PATCH] 积分商城8
---
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml | 14 +++-
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java | 2
zq-erp/src/main/resources/config/db/increment/推广员.sql | 5 +
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java | 24 +++++++
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java | 64 ++++++++++++---------
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml | 16 +++--
6 files changed, 83 insertions(+), 42 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java
index 4cb582a..335a26b 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java
@@ -59,8 +59,6 @@
shopCartBillVo.setBillCouponTotal(shopCartBillVo.getBillCouponTotal().add(shopCartVo.getCouponPrice()));
}
}
-
-
for (ShopShoppingCart shopCart : shopCartVo.getCartList()) {
if (shopCart.getIsSelected() == 1) {
selectCount += shopCart.getCartNumber();
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java
index f250956..0fbad67 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrderDetails.java
@@ -12,7 +12,15 @@
*/
public class ShopOrderDetails extends EntityDTO{
@Extend
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
+ /**
+ *支付方式-直接购买
+ */
+ public static final int PAYTYPE_MICRO = 1;
+ /**
+ *支付方式-积分兑换
+ */
+ public static final int PAYTYPE_SCORE=2;
/**
@@ -49,7 +57,11 @@
* 数量
*/
private Integer count;
-
+ /**
+ * 支付方式1 直接购买 2,积分兑换
+ */
+ private Integer payType;
+
/**
* 总价
@@ -132,6 +144,14 @@
this.price = price;
}
+ public Integer getPayType() {
+ return payType;
+ }
+
+ public void setPayType(Integer payType) {
+ this.payType = payType;
+ }
+
public Integer getCount() {
return count;
}
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
index a9c2ae4..fffc389 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
@@ -16,40 +16,40 @@
@Extend
private static final long serialVersionUID = 1L;
/**
- *购物车类型-微商城
+ *购物车类型-直接购买
*/
public static final int CAR_TYPE_MICRO =1;
/**
- *购物车类型-积分商城
+ *购物车类型-积分兑换
*/
public static final int CAR_TYPE_SCORE=2;
-
+
/**
* 主键
*/
private Integer cartId;
-
-
+
+
/**
* 用户ID
*/
private String cartUserId;
-
-
+
+
/**
* 产品ID
*/
private Integer cartProductId;
-
-
+
+
/**
* 规格ID
*/
private Integer cartSkuId;
-
-
+
+
/**
* 数量
*/
@@ -59,7 +59,10 @@
* 用户是否选中 1选中 2未选中
*/
private Integer isSelected;
-
+ /**
+ * 购物车类型 1直接支付 2积分兑换
+ */
+ private Integer cartType;
@@ -263,44 +266,44 @@
public Integer getCartId() {
return cartId;
}
-
- public void setCartId(Integer cartId) {
+
+ public void setCartId(Integer cartId) {
this.cartId=cartId;
}
-
+
public String getCartUserId() {
return cartUserId;
}
-
- public void setCartUserId(String cartUserId) {
+
+ public void setCartUserId(String cartUserId) {
this.cartUserId=cartUserId;
}
-
+
public Integer getCartProductId() {
return cartProductId;
}
-
- public void setCartProductId(Integer cartProductId) {
+
+ public void setCartProductId(Integer cartProductId) {
this.cartProductId=cartProductId;
}
-
+
public Integer getCartSkuId() {
return cartSkuId;
}
-
- public void setCartSkuId(Integer cartSkuId) {
+
+ public void setCartSkuId(Integer cartSkuId) {
this.cartSkuId=cartSkuId;
}
-
+
public Integer getCartNumber() {
return cartNumber;
}
-
- public void setCartNumber(Integer cartNumber) {
+
+ public void setCartNumber(Integer cartNumber) {
this.cartNumber=cartNumber;
}
@@ -330,11 +333,18 @@
public void setShopCoupons(List<ShopCoupon> shopCoupons) {
this.shopCoupons=shopCoupons;
-
+
}
public List<ShopCoupon> getShopCoupons() {
return shopCoupons;
}
+ public Integer getCartType() {
+ return cartType;
+ }
+
+ public void setCartType(Integer cartType) {
+ this.cartType = cartType;
+ }
}
\ No newline at end of file
diff --git "a/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" "b/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql"
index c6a4cce..90732e4 100644
--- "a/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql"
+++ "b/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql"
@@ -191,6 +191,11 @@
ADD COLUMN `able_sales` int(2) NULL COMMENT '是否为分销产品1是2不是' AFTER `score_category_id`,
ADD COLUMN `able_score_pay` int(2) NULL COMMENT '是否可用积分支付1是2不是' AFTER `able_sales`;
+ALTER TABLE `shop_shopping_cart`
+ ADD COLUMN `cart_type` int(2) NOT NULL COMMENT '购物车类型 1微商城 2积分商城' AFTER `company_id`;
+ALTER TABLE `shop_sku`
+ ADD COLUMN `pay_type` int(2) NULL COMMENT '支付方式1 直接购买 2,积分兑换' AFTER `score_count`;
+
update shop_product set able_score_pay=1;
update shop_product set able_sales=2;
diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml
index c1263ab..d513e38 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDetailsDao.xml
@@ -19,6 +19,7 @@
<result property="sTitle" column="s_title" />
<result property="discountExplain" column="discount_explain" />
<result property="discountAmount" column="discount_amount" />
+ <result property="payType" column="pay_type" />
</resultMap>
<!-- 定义ShopOrderDetails 的复杂map -->
@@ -37,6 +38,7 @@
<result property="sTitle" column="s_title" />
<result property="discountExplain" column="discount_explain" />
<result property="discountAmount" column="discount_amount" />
+ <result property="payType" column="pay_type" />
<!--产品信息-->
<association property="shopProduct" column="p_id"
select="com.matrix.system.shopXcx.dao.ShopProductDao.selectById"/>
@@ -48,11 +50,6 @@
select="selectProductionEnterpriseByPid"/>
</resultMap>
- <!--查询产品生产企业-->
- <select id="selectProductionEnterpriseByPid" resultType="java.lang.String">
- select ifnull(param_value, '') from shop_product_param_ref
- where p_id = ${pId} and param_name = '生产企业'
- </select>
<!-- 字段sql -->
<sql id="columns">
@@ -69,7 +66,8 @@
total_price,
s_title,
discount_explain,
- discount_amount
+ discount_amount,
+ pay_type
</sql>
<!-- 属性sql -->
@@ -87,7 +85,8 @@
#{item.totalPrice},
#{item.sTitle},
#{item.discountExplain},
- #{item.discountAmount}
+ #{item.discountAmount},
+ #{item.payType}
</sql>
<!-- where sql -->
@@ -124,6 +123,9 @@
<if test="(record.discountAmount!=null and record.discountAmount!='') or (record.discountAmount!='' and record.discountAmount==0) ">
and discount_amount = #{record.discountAmount}
</if>
+ <if test="(record.payType!=null and record.payType!='') or (record.payType!='' and record.payType==0) ">
+ and pay_type = #{record.payType}
+ </if>
</if>
</sql>
diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
index 271fc01..db3b77e 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
@@ -27,6 +27,7 @@
<result property="isSelected" column="isSelected" />
<result property="shopId" column="shop_id" />
<result property="companyId" column="company_id" />
+ <result property="cartType" column="cart_type" />
</resultMap>
@@ -44,6 +45,7 @@
<result property="isSelected" column="isSelected" />
<result property="shopId" column="shop_id" />
<result property="companyId" column="company_id" />
+ <result property="cartType" column="cart_type" />
</resultMap>
@@ -60,7 +62,8 @@
cart_number,
isSelected,
shop_id,
- company_id
+ company_id,
+ cart_type
</sql>
@@ -77,7 +80,8 @@
#{item.cartNumber},
#{item.isSelected},
#{item.shopId},
- #{item.companyId}
+ #{item.companyId},
+ #{item.cartType}
</sql>
@@ -272,7 +276,8 @@
p.img_mobile,
p.img_pc,
u.nick_name,
- s.NAME
+ s.NAME,
+ c.cart_type,
from shop_shopping_cart c
LEFT JOIN shop_product p ON c.cart_product_id = p.id
LEFT JOIN shop_sku s ON c.cart_sku_id = s.id
@@ -329,7 +334,8 @@
p.img_pc,
p.buy_limit,
s.NAME,
- s.stock
+ s.stock,
+ c.cart_type
from shop_shopping_cart c
LEFT JOIN shop_product p ON c.cart_product_id = p.id
LEFT JOIN shop_sku s ON c.cart_sku_id = s.id
--
Gitblit v1.9.1