"git@ustchcs.com:gujinli1118/MCMS.git" did not exist on "9645da575a3d205c0fa29f7829661606d014b5ef"
Commit 2dd5d939 authored by zhh's avatar zhh
Browse files

下单接口完成

parent c9831e02
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -111,6 +111,10 @@ public class OmsCartItem implements Serializable { ...@@ -111,6 +111,10 @@ public class OmsCartItem implements Serializable {
*/ */
private Long productCategoryId; private Long productCategoryId;
private String productBrand;
private String productSn;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
...@@ -257,6 +261,22 @@ public class OmsCartItem implements Serializable { ...@@ -257,6 +261,22 @@ public class OmsCartItem implements Serializable {
this.productCategoryId = productCategoryId; this.productCategoryId = productCategoryId;
} }
public String getProductBrand() {
return productBrand;
}
public void setProductBrand(String productBrand) {
this.productBrand = productBrand;
}
public String getProductSn() {
return productSn;
}
public void setProductSn(String productSn) {
this.productSn = productSn;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
...@@ -281,6 +301,8 @@ public class OmsCartItem implements Serializable { ...@@ -281,6 +301,8 @@ public class OmsCartItem implements Serializable {
sb.append(", modifyDate=").append(modifyDate); sb.append(", modifyDate=").append(modifyDate);
sb.append(", deleteStatus=").append(deleteStatus); sb.append(", deleteStatus=").append(deleteStatus);
sb.append(", productCategoryId=").append(productCategoryId); sb.append(", productCategoryId=").append(productCategoryId);
sb.append(", productBrand=").append(productBrand);
sb.append(", productSn=").append(productSn);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
......
...@@ -1265,6 +1265,146 @@ public class OmsCartItemExample { ...@@ -1265,6 +1265,146 @@ public class OmsCartItemExample {
addCriterion("product_category_id not between", value1, value2, "productCategoryId"); addCriterion("product_category_id not between", value1, value2, "productCategoryId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andProductBrandIsNull() {
addCriterion("product_brand is null");
return (Criteria) this;
}
public Criteria andProductBrandIsNotNull() {
addCriterion("product_brand is not null");
return (Criteria) this;
}
public Criteria andProductBrandEqualTo(String value) {
addCriterion("product_brand =", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandNotEqualTo(String value) {
addCriterion("product_brand <>", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandGreaterThan(String value) {
addCriterion("product_brand >", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandGreaterThanOrEqualTo(String value) {
addCriterion("product_brand >=", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandLessThan(String value) {
addCriterion("product_brand <", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandLessThanOrEqualTo(String value) {
addCriterion("product_brand <=", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandLike(String value) {
addCriterion("product_brand like", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandNotLike(String value) {
addCriterion("product_brand not like", value, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandIn(List<String> values) {
addCriterion("product_brand in", values, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandNotIn(List<String> values) {
addCriterion("product_brand not in", values, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandBetween(String value1, String value2) {
addCriterion("product_brand between", value1, value2, "productBrand");
return (Criteria) this;
}
public Criteria andProductBrandNotBetween(String value1, String value2) {
addCriterion("product_brand not between", value1, value2, "productBrand");
return (Criteria) this;
}
public Criteria andProductSnIsNull() {
addCriterion("product_sn is null");
return (Criteria) this;
}
public Criteria andProductSnIsNotNull() {
addCriterion("product_sn is not null");
return (Criteria) this;
}
public Criteria andProductSnEqualTo(String value) {
addCriterion("product_sn =", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnNotEqualTo(String value) {
addCriterion("product_sn <>", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnGreaterThan(String value) {
addCriterion("product_sn >", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnGreaterThanOrEqualTo(String value) {
addCriterion("product_sn >=", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnLessThan(String value) {
addCriterion("product_sn <", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnLessThanOrEqualTo(String value) {
addCriterion("product_sn <=", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnLike(String value) {
addCriterion("product_sn like", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnNotLike(String value) {
addCriterion("product_sn not like", value, "productSn");
return (Criteria) this;
}
public Criteria andProductSnIn(List<String> values) {
addCriterion("product_sn in", values, "productSn");
return (Criteria) this;
}
public Criteria andProductSnNotIn(List<String> values) {
addCriterion("product_sn not in", values, "productSn");
return (Criteria) this;
}
public Criteria andProductSnBetween(String value1, String value2) {
addCriterion("product_sn between", value1, value2, "productSn");
return (Criteria) this;
}
public Criteria andProductSnNotBetween(String value1, String value2) {
addCriterion("product_sn not between", value1, value2, "productSn");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
...@@ -22,7 +22,7 @@ public class OmsOrderItem implements Serializable { ...@@ -22,7 +22,7 @@ public class OmsOrderItem implements Serializable {
private Long productId; private Long productId;
private String proudctPic; private String productPic;
private String productName; private String productName;
...@@ -30,21 +30,40 @@ public class OmsOrderItem implements Serializable { ...@@ -30,21 +30,40 @@ public class OmsOrderItem implements Serializable {
private String productSn; private String productSn;
private BigDecimal productAmount; /**
* 销售价格
*
* @mbggenerated
*/
private BigDecimal productPrice;
/** /**
* 购买数量 * 购买数量
* *
* @mbggenerated * @mbggenerated
*/ */
private Integer productCount; private Integer productQuantity;
/** /**
* 该商品经过优惠后的分解金额 * 商品sku编号
*
* @mbggenerated
*/
private Long productSkuId;
/**
* 商品sku条码
* *
* @mbggenerated * @mbggenerated
*/ */
private BigDecimal productRealAmount; private String productSkuCode;
/**
* 商品分类id
*
* @mbggenerated
*/
private Long productCategoryId;
/** /**
* 商品的销售属性 * 商品的销售属性
...@@ -57,6 +76,45 @@ public class OmsOrderItem implements Serializable { ...@@ -57,6 +76,45 @@ public class OmsOrderItem implements Serializable {
private String sp3; private String sp3;
/**
* 商品促销名称
*
* @mbggenerated
*/
private String promotionName;
/**
* 商品促销分解金额
*
* @mbggenerated
*/
private BigDecimal promotionAmount;
/**
* 优惠券优惠分解金额
*
* @mbggenerated
*/
private BigDecimal couponAmount;
/**
* 积分优惠分解金额
*
* @mbggenerated
*/
private BigDecimal integrationAmount;
/**
* 该商品经过优惠后的分解金额
*
* @mbggenerated
*/
private BigDecimal realAmount;
private Integer giftIntegration;
private Integer giftGrowth;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
...@@ -91,12 +149,12 @@ public class OmsOrderItem implements Serializable { ...@@ -91,12 +149,12 @@ public class OmsOrderItem implements Serializable {
this.productId = productId; this.productId = productId;
} }
public String getProudctPic() { public String getProductPic() {
return proudctPic; return productPic;
} }
public void setProudctPic(String proudctPic) { public void setProductPic(String productPic) {
this.proudctPic = proudctPic; this.productPic = productPic;
} }
public String getProductName() { public String getProductName() {
...@@ -123,28 +181,44 @@ public class OmsOrderItem implements Serializable { ...@@ -123,28 +181,44 @@ public class OmsOrderItem implements Serializable {
this.productSn = productSn; this.productSn = productSn;
} }
public BigDecimal getProductAmount() { public BigDecimal getProductPrice() {
return productAmount; return productPrice;
}
public void setProductPrice(BigDecimal productPrice) {
this.productPrice = productPrice;
}
public Integer getProductQuantity() {
return productQuantity;
}
public void setProductQuantity(Integer productQuantity) {
this.productQuantity = productQuantity;
}
public Long getProductSkuId() {
return productSkuId;
} }
public void setProductAmount(BigDecimal productAmount) { public void setProductSkuId(Long productSkuId) {
this.productAmount = productAmount; this.productSkuId = productSkuId;
} }
public Integer getProductCount() { public String getProductSkuCode() {
return productCount; return productSkuCode;
} }
public void setProductCount(Integer productCount) { public void setProductSkuCode(String productSkuCode) {
this.productCount = productCount; this.productSkuCode = productSkuCode;
} }
public BigDecimal getProductRealAmount() { public Long getProductCategoryId() {
return productRealAmount; return productCategoryId;
} }
public void setProductRealAmount(BigDecimal productRealAmount) { public void setProductCategoryId(Long productCategoryId) {
this.productRealAmount = productRealAmount; this.productCategoryId = productCategoryId;
} }
public String getSp1() { public String getSp1() {
...@@ -171,6 +245,62 @@ public class OmsOrderItem implements Serializable { ...@@ -171,6 +245,62 @@ public class OmsOrderItem implements Serializable {
this.sp3 = sp3; this.sp3 = sp3;
} }
public String getPromotionName() {
return promotionName;
}
public void setPromotionName(String promotionName) {
this.promotionName = promotionName;
}
public BigDecimal getPromotionAmount() {
return promotionAmount;
}
public void setPromotionAmount(BigDecimal promotionAmount) {
this.promotionAmount = promotionAmount;
}
public BigDecimal getCouponAmount() {
return couponAmount;
}
public void setCouponAmount(BigDecimal couponAmount) {
this.couponAmount = couponAmount;
}
public BigDecimal getIntegrationAmount() {
return integrationAmount;
}
public void setIntegrationAmount(BigDecimal integrationAmount) {
this.integrationAmount = integrationAmount;
}
public BigDecimal getRealAmount() {
return realAmount;
}
public void setRealAmount(BigDecimal realAmount) {
this.realAmount = realAmount;
}
public Integer getGiftIntegration() {
return giftIntegration;
}
public void setGiftIntegration(Integer giftIntegration) {
this.giftIntegration = giftIntegration;
}
public Integer getGiftGrowth() {
return giftGrowth;
}
public void setGiftGrowth(Integer giftGrowth) {
this.giftGrowth = giftGrowth;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
...@@ -181,16 +311,25 @@ public class OmsOrderItem implements Serializable { ...@@ -181,16 +311,25 @@ public class OmsOrderItem implements Serializable {
sb.append(", orderId=").append(orderId); sb.append(", orderId=").append(orderId);
sb.append(", orderSn=").append(orderSn); sb.append(", orderSn=").append(orderSn);
sb.append(", productId=").append(productId); sb.append(", productId=").append(productId);
sb.append(", proudctPic=").append(proudctPic); sb.append(", productPic=").append(productPic);
sb.append(", productName=").append(productName); sb.append(", productName=").append(productName);
sb.append(", productBrand=").append(productBrand); sb.append(", productBrand=").append(productBrand);
sb.append(", productSn=").append(productSn); sb.append(", productSn=").append(productSn);
sb.append(", productAmount=").append(productAmount); sb.append(", productPrice=").append(productPrice);
sb.append(", productCount=").append(productCount); sb.append(", productQuantity=").append(productQuantity);
sb.append(", productRealAmount=").append(productRealAmount); sb.append(", productSkuId=").append(productSkuId);
sb.append(", productSkuCode=").append(productSkuCode);
sb.append(", productCategoryId=").append(productCategoryId);
sb.append(", sp1=").append(sp1); sb.append(", sp1=").append(sp1);
sb.append(", sp2=").append(sp2); sb.append(", sp2=").append(sp2);
sb.append(", sp3=").append(sp3); sb.append(", sp3=").append(sp3);
sb.append(", promotionName=").append(promotionName);
sb.append(", promotionAmount=").append(promotionAmount);
sb.append(", couponAmount=").append(couponAmount);
sb.append(", integrationAmount=").append(integrationAmount);
sb.append(", realAmount=").append(realAmount);
sb.append(", giftIntegration=").append(giftIntegration);
sb.append(", giftGrowth=").append(giftGrowth);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
<result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" /> <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
<result column="delete_status" jdbcType="INTEGER" property="deleteStatus" /> <result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
<result column="product_category_id" jdbcType="BIGINT" property="productCategoryId" /> <result column="product_category_id" jdbcType="BIGINT" property="productCategoryId" />
<result column="product_brand" jdbcType="VARCHAR" property="productBrand" />
<result column="product_sn" jdbcType="VARCHAR" property="productSn" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -82,7 +84,7 @@ ...@@ -82,7 +84,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, product_id, product_sku_id, member_id, quantity, price, sp1, sp2, sp3, product_pic, id, product_id, product_sku_id, member_id, quantity, price, sp1, sp2, sp3, product_pic,
product_name, product_sub_title, product_sku_code, member_nickname, create_date, product_name, product_sub_title, product_sku_code, member_nickname, create_date,
modify_date, delete_status, product_category_id modify_date, delete_status, product_category_id, product_brand, product_sn
</sql> </sql>
<select id="selectByExample" parameterType="com.macro.mall.model.OmsCartItemExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.macro.mall.model.OmsCartItemExample" resultMap="BaseResultMap">
select select
...@@ -123,13 +125,15 @@ ...@@ -123,13 +125,15 @@
sp2, sp3, product_pic, sp2, sp3, product_pic,
product_name, product_sub_title, product_sku_code, product_name, product_sub_title, product_sku_code,
member_nickname, create_date, modify_date, member_nickname, create_date, modify_date,
delete_status, product_category_id) delete_status, product_category_id, product_brand,
product_sn)
values (#{productId,jdbcType=BIGINT}, #{productSkuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, values (#{productId,jdbcType=BIGINT}, #{productSkuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
#{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{sp1,jdbcType=VARCHAR}, #{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{sp1,jdbcType=VARCHAR},
#{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{productPic,jdbcType=VARCHAR}, #{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{productPic,jdbcType=VARCHAR},
#{productName,jdbcType=VARCHAR}, #{productSubTitle,jdbcType=VARCHAR}, #{productSkuCode,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{productSubTitle,jdbcType=VARCHAR}, #{productSkuCode,jdbcType=VARCHAR},
#{memberNickname,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP}, #{memberNickname,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP},
#{deleteStatus,jdbcType=INTEGER}, #{productCategoryId,jdbcType=BIGINT}) #{deleteStatus,jdbcType=INTEGER}, #{productCategoryId,jdbcType=BIGINT}, #{productBrand,jdbcType=VARCHAR},
#{productSn,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.OmsCartItem"> <insert id="insertSelective" parameterType="com.macro.mall.model.OmsCartItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -188,6 +192,12 @@ ...@@ -188,6 +192,12 @@
<if test="productCategoryId != null"> <if test="productCategoryId != null">
product_category_id, product_category_id,
</if> </if>
<if test="productBrand != null">
product_brand,
</if>
<if test="productSn != null">
product_sn,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null"> <if test="productId != null">
...@@ -241,6 +251,12 @@ ...@@ -241,6 +251,12 @@
<if test="productCategoryId != null"> <if test="productCategoryId != null">
#{productCategoryId,jdbcType=BIGINT}, #{productCategoryId,jdbcType=BIGINT},
</if> </if>
<if test="productBrand != null">
#{productBrand,jdbcType=VARCHAR},
</if>
<if test="productSn != null">
#{productSn,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.macro.mall.model.OmsCartItemExample" resultType="java.lang.Integer"> <select id="countByExample" parameterType="com.macro.mall.model.OmsCartItemExample" resultType="java.lang.Integer">
...@@ -306,6 +322,12 @@ ...@@ -306,6 +322,12 @@
<if test="record.productCategoryId != null"> <if test="record.productCategoryId != null">
product_category_id = #{record.productCategoryId,jdbcType=BIGINT}, product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
</if> </if>
<if test="record.productBrand != null">
product_brand = #{record.productBrand,jdbcType=VARCHAR},
</if>
<if test="record.productSn != null">
product_sn = #{record.productSn,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -330,7 +352,9 @@ ...@@ -330,7 +352,9 @@
create_date = #{record.createDate,jdbcType=TIMESTAMP}, create_date = #{record.createDate,jdbcType=TIMESTAMP},
modify_date = #{record.modifyDate,jdbcType=TIMESTAMP}, modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
delete_status = #{record.deleteStatus,jdbcType=INTEGER}, delete_status = #{record.deleteStatus,jdbcType=INTEGER},
product_category_id = #{record.productCategoryId,jdbcType=BIGINT} product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
product_brand = #{record.productBrand,jdbcType=VARCHAR},
product_sn = #{record.productSn,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -389,6 +413,12 @@ ...@@ -389,6 +413,12 @@
<if test="productCategoryId != null"> <if test="productCategoryId != null">
product_category_id = #{productCategoryId,jdbcType=BIGINT}, product_category_id = #{productCategoryId,jdbcType=BIGINT},
</if> </if>
<if test="productBrand != null">
product_brand = #{productBrand,jdbcType=VARCHAR},
</if>
<if test="productSn != null">
product_sn = #{productSn,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -410,7 +440,9 @@ ...@@ -410,7 +440,9 @@
create_date = #{createDate,jdbcType=TIMESTAMP}, create_date = #{createDate,jdbcType=TIMESTAMP},
modify_date = #{modifyDate,jdbcType=TIMESTAMP}, modify_date = #{modifyDate,jdbcType=TIMESTAMP},
delete_status = #{deleteStatus,jdbcType=INTEGER}, delete_status = #{deleteStatus,jdbcType=INTEGER},
product_category_id = #{productCategoryId,jdbcType=BIGINT} product_category_id = #{productCategoryId,jdbcType=BIGINT},
product_brand = #{productBrand,jdbcType=VARCHAR},
product_sn = #{productSn,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,16 +6,25 @@ ...@@ -6,16 +6,25 @@
<result column="order_id" jdbcType="BIGINT" property="orderId" /> <result column="order_id" jdbcType="BIGINT" property="orderId" />
<result column="order_sn" jdbcType="VARCHAR" property="orderSn" /> <result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
<result column="product_id" jdbcType="BIGINT" property="productId" /> <result column="product_id" jdbcType="BIGINT" property="productId" />
<result column="proudct_pic" jdbcType="VARCHAR" property="proudctPic" /> <result column="product_pic" jdbcType="VARCHAR" property="productPic" />
<result column="product_name" jdbcType="VARCHAR" property="productName" /> <result column="product_name" jdbcType="VARCHAR" property="productName" />
<result column="product_brand" jdbcType="VARCHAR" property="productBrand" /> <result column="product_brand" jdbcType="VARCHAR" property="productBrand" />
<result column="product_sn" jdbcType="VARCHAR" property="productSn" /> <result column="product_sn" jdbcType="VARCHAR" property="productSn" />
<result column="product_amount" jdbcType="DECIMAL" property="productAmount" /> <result column="product_price" jdbcType="DECIMAL" property="productPrice" />
<result column="product_count" jdbcType="INTEGER" property="productCount" /> <result column="product_quantity" jdbcType="INTEGER" property="productQuantity" />
<result column="product_real_amount" jdbcType="DECIMAL" property="productRealAmount" /> <result column="product_sku_id" jdbcType="BIGINT" property="productSkuId" />
<result column="product_sku_code" jdbcType="VARCHAR" property="productSkuCode" />
<result column="product_category_id" jdbcType="BIGINT" property="productCategoryId" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" /> <result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" /> <result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" /> <result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="promotion_name" jdbcType="VARCHAR" property="promotionName" />
<result column="promotion_amount" jdbcType="DECIMAL" property="promotionAmount" />
<result column="coupon_amount" jdbcType="DECIMAL" property="couponAmount" />
<result column="integration_amount" jdbcType="DECIMAL" property="integrationAmount" />
<result column="real_amount" jdbcType="DECIMAL" property="realAmount" />
<result column="gift_integration" jdbcType="INTEGER" property="giftIntegration" />
<result column="gift_growth" jdbcType="INTEGER" property="giftGrowth" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
...@@ -76,8 +85,10 @@ ...@@ -76,8 +85,10 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, order_id, order_sn, product_id, proudct_pic, product_name, product_brand, product_sn, id, order_id, order_sn, product_id, product_pic, product_name, product_brand, product_sn,
product_amount, product_count, product_real_amount, sp1, sp2, sp3 product_price, product_quantity, product_sku_id, product_sku_code, product_category_id,
sp1, sp2, sp3, promotion_name, promotion_amount, coupon_amount, integration_amount,
real_amount, gift_integration, gift_growth
</sql> </sql>
<select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderItemExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderItemExample" resultMap="BaseResultMap">
select select
...@@ -114,15 +125,21 @@ ...@@ -114,15 +125,21 @@
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into oms_order_item (order_id, order_sn, product_id, insert into oms_order_item (order_id, order_sn, product_id,
proudct_pic, product_name, product_brand, product_pic, product_name, product_brand,
product_sn, product_amount, product_count, product_sn, product_price, product_quantity,
product_real_amount, sp1, sp2, product_sku_id, product_sku_code, product_category_id,
sp3) sp1, sp2, sp3, promotion_name,
promotion_amount, coupon_amount, integration_amount,
real_amount, gift_integration, gift_growth
)
values (#{orderId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR}, #{productId,jdbcType=BIGINT}, values (#{orderId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR}, #{productId,jdbcType=BIGINT},
#{proudctPic,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{productBrand,jdbcType=VARCHAR}, #{productPic,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{productBrand,jdbcType=VARCHAR},
#{productSn,jdbcType=VARCHAR}, #{productAmount,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER}, #{productSn,jdbcType=VARCHAR}, #{productPrice,jdbcType=DECIMAL}, #{productQuantity,jdbcType=INTEGER},
#{productRealAmount,jdbcType=DECIMAL}, #{sp1,jdbcType=VARCHAR}, #{sp2,jdbcType=VARCHAR}, #{productSkuId,jdbcType=BIGINT}, #{productSkuCode,jdbcType=VARCHAR}, #{productCategoryId,jdbcType=BIGINT},
#{sp3,jdbcType=VARCHAR}) #{sp1,jdbcType=VARCHAR}, #{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{promotionName,jdbcType=VARCHAR},
#{promotionAmount,jdbcType=DECIMAL}, #{couponAmount,jdbcType=DECIMAL}, #{integrationAmount,jdbcType=DECIMAL},
#{realAmount,jdbcType=DECIMAL}, #{giftIntegration,jdbcType=INTEGER}, #{giftGrowth,jdbcType=INTEGER}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrderItem"> <insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrderItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
...@@ -139,8 +156,8 @@ ...@@ -139,8 +156,8 @@
<if test="productId != null"> <if test="productId != null">
product_id, product_id,
</if> </if>
<if test="proudctPic != null"> <if test="productPic != null">
proudct_pic, product_pic,
</if> </if>
<if test="productName != null"> <if test="productName != null">
product_name, product_name,
...@@ -151,14 +168,20 @@ ...@@ -151,14 +168,20 @@
<if test="productSn != null"> <if test="productSn != null">
product_sn, product_sn,
</if> </if>
<if test="productAmount != null"> <if test="productPrice != null">
product_amount, product_price,
</if> </if>
<if test="productCount != null"> <if test="productQuantity != null">
product_count, product_quantity,
</if> </if>
<if test="productRealAmount != null"> <if test="productSkuId != null">
product_real_amount, product_sku_id,
</if>
<if test="productSkuCode != null">
product_sku_code,
</if>
<if test="productCategoryId != null">
product_category_id,
</if> </if>
<if test="sp1 != null"> <if test="sp1 != null">
sp1, sp1,
...@@ -169,6 +192,27 @@ ...@@ -169,6 +192,27 @@
<if test="sp3 != null"> <if test="sp3 != null">
sp3, sp3,
</if> </if>
<if test="promotionName != null">
promotion_name,
</if>
<if test="promotionAmount != null">
promotion_amount,
</if>
<if test="couponAmount != null">
coupon_amount,
</if>
<if test="integrationAmount != null">
integration_amount,
</if>
<if test="realAmount != null">
real_amount,
</if>
<if test="giftIntegration != null">
gift_integration,
</if>
<if test="giftGrowth != null">
gift_growth,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null"> <if test="orderId != null">
...@@ -180,8 +224,8 @@ ...@@ -180,8 +224,8 @@
<if test="productId != null"> <if test="productId != null">
#{productId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT},
</if> </if>
<if test="proudctPic != null"> <if test="productPic != null">
#{proudctPic,jdbcType=VARCHAR}, #{productPic,jdbcType=VARCHAR},
</if> </if>
<if test="productName != null"> <if test="productName != null">
#{productName,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR},
...@@ -192,14 +236,20 @@ ...@@ -192,14 +236,20 @@
<if test="productSn != null"> <if test="productSn != null">
#{productSn,jdbcType=VARCHAR}, #{productSn,jdbcType=VARCHAR},
</if> </if>
<if test="productAmount != null"> <if test="productPrice != null">
#{productAmount,jdbcType=DECIMAL}, #{productPrice,jdbcType=DECIMAL},
</if> </if>
<if test="productCount != null"> <if test="productQuantity != null">
#{productCount,jdbcType=INTEGER}, #{productQuantity,jdbcType=INTEGER},
</if> </if>
<if test="productRealAmount != null"> <if test="productSkuId != null">
#{productRealAmount,jdbcType=DECIMAL}, #{productSkuId,jdbcType=BIGINT},
</if>
<if test="productSkuCode != null">
#{productSkuCode,jdbcType=VARCHAR},
</if>
<if test="productCategoryId != null">
#{productCategoryId,jdbcType=BIGINT},
</if> </if>
<if test="sp1 != null"> <if test="sp1 != null">
#{sp1,jdbcType=VARCHAR}, #{sp1,jdbcType=VARCHAR},
...@@ -210,6 +260,27 @@ ...@@ -210,6 +260,27 @@
<if test="sp3 != null"> <if test="sp3 != null">
#{sp3,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR},
</if> </if>
<if test="promotionName != null">
#{promotionName,jdbcType=VARCHAR},
</if>
<if test="promotionAmount != null">
#{promotionAmount,jdbcType=DECIMAL},
</if>
<if test="couponAmount != null">
#{couponAmount,jdbcType=DECIMAL},
</if>
<if test="integrationAmount != null">
#{integrationAmount,jdbcType=DECIMAL},
</if>
<if test="realAmount != null">
#{realAmount,jdbcType=DECIMAL},
</if>
<if test="giftIntegration != null">
#{giftIntegration,jdbcType=INTEGER},
</if>
<if test="giftGrowth != null">
#{giftGrowth,jdbcType=INTEGER},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.macro.mall.model.OmsOrderItemExample" resultType="java.lang.Integer"> <select id="countByExample" parameterType="com.macro.mall.model.OmsOrderItemExample" resultType="java.lang.Integer">
...@@ -233,8 +304,8 @@ ...@@ -233,8 +304,8 @@
<if test="record.productId != null"> <if test="record.productId != null">
product_id = #{record.productId,jdbcType=BIGINT}, product_id = #{record.productId,jdbcType=BIGINT},
</if> </if>
<if test="record.proudctPic != null"> <if test="record.productPic != null">
proudct_pic = #{record.proudctPic,jdbcType=VARCHAR}, product_pic = #{record.productPic,jdbcType=VARCHAR},
</if> </if>
<if test="record.productName != null"> <if test="record.productName != null">
product_name = #{record.productName,jdbcType=VARCHAR}, product_name = #{record.productName,jdbcType=VARCHAR},
...@@ -245,14 +316,20 @@ ...@@ -245,14 +316,20 @@
<if test="record.productSn != null"> <if test="record.productSn != null">
product_sn = #{record.productSn,jdbcType=VARCHAR}, product_sn = #{record.productSn,jdbcType=VARCHAR},
</if> </if>
<if test="record.productAmount != null"> <if test="record.productPrice != null">
product_amount = #{record.productAmount,jdbcType=DECIMAL}, product_price = #{record.productPrice,jdbcType=DECIMAL},
</if> </if>
<if test="record.productCount != null"> <if test="record.productQuantity != null">
product_count = #{record.productCount,jdbcType=INTEGER}, product_quantity = #{record.productQuantity,jdbcType=INTEGER},
</if> </if>
<if test="record.productRealAmount != null"> <if test="record.productSkuId != null">
product_real_amount = #{record.productRealAmount,jdbcType=DECIMAL}, product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
</if>
<if test="record.productSkuCode != null">
product_sku_code = #{record.productSkuCode,jdbcType=VARCHAR},
</if>
<if test="record.productCategoryId != null">
product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
</if> </if>
<if test="record.sp1 != null"> <if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR}, sp1 = #{record.sp1,jdbcType=VARCHAR},
...@@ -263,6 +340,27 @@ ...@@ -263,6 +340,27 @@
<if test="record.sp3 != null"> <if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR}, sp3 = #{record.sp3,jdbcType=VARCHAR},
</if> </if>
<if test="record.promotionName != null">
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
</if>
<if test="record.promotionAmount != null">
promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
</if>
<if test="record.couponAmount != null">
coupon_amount = #{record.couponAmount,jdbcType=DECIMAL},
</if>
<if test="record.integrationAmount != null">
integration_amount = #{record.integrationAmount,jdbcType=DECIMAL},
</if>
<if test="record.realAmount != null">
real_amount = #{record.realAmount,jdbcType=DECIMAL},
</if>
<if test="record.giftIntegration != null">
gift_integration = #{record.giftIntegration,jdbcType=INTEGER},
</if>
<if test="record.giftGrowth != null">
gift_growth = #{record.giftGrowth,jdbcType=INTEGER},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -274,16 +372,25 @@ ...@@ -274,16 +372,25 @@
order_id = #{record.orderId,jdbcType=BIGINT}, order_id = #{record.orderId,jdbcType=BIGINT},
order_sn = #{record.orderSn,jdbcType=VARCHAR}, order_sn = #{record.orderSn,jdbcType=VARCHAR},
product_id = #{record.productId,jdbcType=BIGINT}, product_id = #{record.productId,jdbcType=BIGINT},
proudct_pic = #{record.proudctPic,jdbcType=VARCHAR}, product_pic = #{record.productPic,jdbcType=VARCHAR},
product_name = #{record.productName,jdbcType=VARCHAR}, product_name = #{record.productName,jdbcType=VARCHAR},
product_brand = #{record.productBrand,jdbcType=VARCHAR}, product_brand = #{record.productBrand,jdbcType=VARCHAR},
product_sn = #{record.productSn,jdbcType=VARCHAR}, product_sn = #{record.productSn,jdbcType=VARCHAR},
product_amount = #{record.productAmount,jdbcType=DECIMAL}, product_price = #{record.productPrice,jdbcType=DECIMAL},
product_count = #{record.productCount,jdbcType=INTEGER}, product_quantity = #{record.productQuantity,jdbcType=INTEGER},
product_real_amount = #{record.productRealAmount,jdbcType=DECIMAL}, product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
product_sku_code = #{record.productSkuCode,jdbcType=VARCHAR},
product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
sp1 = #{record.sp1,jdbcType=VARCHAR}, sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR}, sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR} sp3 = #{record.sp3,jdbcType=VARCHAR},
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
coupon_amount = #{record.couponAmount,jdbcType=DECIMAL},
integration_amount = #{record.integrationAmount,jdbcType=DECIMAL},
real_amount = #{record.realAmount,jdbcType=DECIMAL},
gift_integration = #{record.giftIntegration,jdbcType=INTEGER},
gift_growth = #{record.giftGrowth,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -300,8 +407,8 @@ ...@@ -300,8 +407,8 @@
<if test="productId != null"> <if test="productId != null">
product_id = #{productId,jdbcType=BIGINT}, product_id = #{productId,jdbcType=BIGINT},
</if> </if>
<if test="proudctPic != null"> <if test="productPic != null">
proudct_pic = #{proudctPic,jdbcType=VARCHAR}, product_pic = #{productPic,jdbcType=VARCHAR},
</if> </if>
<if test="productName != null"> <if test="productName != null">
product_name = #{productName,jdbcType=VARCHAR}, product_name = #{productName,jdbcType=VARCHAR},
...@@ -312,14 +419,20 @@ ...@@ -312,14 +419,20 @@
<if test="productSn != null"> <if test="productSn != null">
product_sn = #{productSn,jdbcType=VARCHAR}, product_sn = #{productSn,jdbcType=VARCHAR},
</if> </if>
<if test="productAmount != null"> <if test="productPrice != null">
product_amount = #{productAmount,jdbcType=DECIMAL}, product_price = #{productPrice,jdbcType=DECIMAL},
</if> </if>
<if test="productCount != null"> <if test="productQuantity != null">
product_count = #{productCount,jdbcType=INTEGER}, product_quantity = #{productQuantity,jdbcType=INTEGER},
</if> </if>
<if test="productRealAmount != null"> <if test="productSkuId != null">
product_real_amount = #{productRealAmount,jdbcType=DECIMAL}, product_sku_id = #{productSkuId,jdbcType=BIGINT},
</if>
<if test="productSkuCode != null">
product_sku_code = #{productSkuCode,jdbcType=VARCHAR},
</if>
<if test="productCategoryId != null">
product_category_id = #{productCategoryId,jdbcType=BIGINT},
</if> </if>
<if test="sp1 != null"> <if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR}, sp1 = #{sp1,jdbcType=VARCHAR},
...@@ -330,6 +443,27 @@ ...@@ -330,6 +443,27 @@
<if test="sp3 != null"> <if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR}, sp3 = #{sp3,jdbcType=VARCHAR},
</if> </if>
<if test="promotionName != null">
promotion_name = #{promotionName,jdbcType=VARCHAR},
</if>
<if test="promotionAmount != null">
promotion_amount = #{promotionAmount,jdbcType=DECIMAL},
</if>
<if test="couponAmount != null">
coupon_amount = #{couponAmount,jdbcType=DECIMAL},
</if>
<if test="integrationAmount != null">
integration_amount = #{integrationAmount,jdbcType=DECIMAL},
</if>
<if test="realAmount != null">
real_amount = #{realAmount,jdbcType=DECIMAL},
</if>
<if test="giftIntegration != null">
gift_integration = #{giftIntegration,jdbcType=INTEGER},
</if>
<if test="giftGrowth != null">
gift_growth = #{giftGrowth,jdbcType=INTEGER},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -338,16 +472,25 @@ ...@@ -338,16 +472,25 @@
set order_id = #{orderId,jdbcType=BIGINT}, set order_id = #{orderId,jdbcType=BIGINT},
order_sn = #{orderSn,jdbcType=VARCHAR}, order_sn = #{orderSn,jdbcType=VARCHAR},
product_id = #{productId,jdbcType=BIGINT}, product_id = #{productId,jdbcType=BIGINT},
proudct_pic = #{proudctPic,jdbcType=VARCHAR}, product_pic = #{productPic,jdbcType=VARCHAR},
product_name = #{productName,jdbcType=VARCHAR}, product_name = #{productName,jdbcType=VARCHAR},
product_brand = #{productBrand,jdbcType=VARCHAR}, product_brand = #{productBrand,jdbcType=VARCHAR},
product_sn = #{productSn,jdbcType=VARCHAR}, product_sn = #{productSn,jdbcType=VARCHAR},
product_amount = #{productAmount,jdbcType=DECIMAL}, product_price = #{productPrice,jdbcType=DECIMAL},
product_count = #{productCount,jdbcType=INTEGER}, product_quantity = #{productQuantity,jdbcType=INTEGER},
product_real_amount = #{productRealAmount,jdbcType=DECIMAL}, product_sku_id = #{productSkuId,jdbcType=BIGINT},
product_sku_code = #{productSkuCode,jdbcType=VARCHAR},
product_category_id = #{productCategoryId,jdbcType=BIGINT},
sp1 = #{sp1,jdbcType=VARCHAR}, sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR}, sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR} sp3 = #{sp3,jdbcType=VARCHAR},
promotion_name = #{promotionName,jdbcType=VARCHAR},
promotion_amount = #{promotionAmount,jdbcType=DECIMAL},
coupon_amount = #{couponAmount,jdbcType=DECIMAL},
integration_amount = #{integrationAmount,jdbcType=DECIMAL},
real_amount = #{realAmount,jdbcType=DECIMAL},
gift_integration = #{giftIntegration,jdbcType=INTEGER},
gift_growth = #{giftGrowth,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
package com.macro.mall.portal.dao;
import com.macro.mall.model.OmsOrderItem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 订单商品信息自定义Dao
* Created by macro on 2018/9/3.
*/
public interface PortalOrderItemDao {
int insertList(@Param("list") List<OmsOrderItem> list);
}
...@@ -15,6 +15,10 @@ public class CartPromotionItem extends OmsCartItem{ ...@@ -15,6 +15,10 @@ public class CartPromotionItem extends OmsCartItem{
private BigDecimal reduceAmount; private BigDecimal reduceAmount;
//商品的真实库存(剩余库存-锁定库存) //商品的真实库存(剩余库存-锁定库存)
private Integer realStock; private Integer realStock;
//购买商品赠送积分
private Integer integration;
//购买商品赠送成长值
private Integer growth;
public String getPromotionMessage() { public String getPromotionMessage() {
return promotionMessage; return promotionMessage;
} }
...@@ -38,4 +42,20 @@ public class CartPromotionItem extends OmsCartItem{ ...@@ -38,4 +42,20 @@ public class CartPromotionItem extends OmsCartItem{
public void setRealStock(Integer realStock) { public void setRealStock(Integer realStock) {
this.realStock = realStock; this.realStock = realStock;
} }
public Integer getIntegration() {
return integration;
}
public void setIntegration(Integer integration) {
this.integration = integration;
}
public Integer getGrowth() {
return growth;
}
public void setGrowth(Integer growth) {
this.growth = growth;
}
} }
...@@ -10,7 +10,7 @@ public class OrderParam { ...@@ -10,7 +10,7 @@ public class OrderParam {
//优惠券id //优惠券id
private Long couponId; private Long couponId;
//使用的积分数 //使用的积分数
private Integer useIngegration; private Integer useIntegration;
//支付方式 //支付方式
private Integer payType; private Integer payType;
...@@ -30,14 +30,6 @@ public class OrderParam { ...@@ -30,14 +30,6 @@ public class OrderParam {
this.couponId = couponId; this.couponId = couponId;
} }
public Integer getUseIngegration() {
return useIngegration;
}
public void setUseIngegration(Integer useIngegration) {
this.useIngegration = useIngegration;
}
public Integer getPayType() { public Integer getPayType() {
return payType; return payType;
} }
...@@ -45,4 +37,12 @@ public class OrderParam { ...@@ -45,4 +37,12 @@ public class OrderParam {
public void setPayType(Integer payType) { public void setPayType(Integer payType) {
this.payType = payType; this.payType = payType;
} }
public Integer getUseIntegration() {
return useIntegration;
}
public void setUseIntegration(Integer useIntegration) {
this.useIntegration = useIntegration;
}
} }
...@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; ...@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -85,7 +86,11 @@ public class OmsCartItemServiceImpl implements OmsCartItemService { ...@@ -85,7 +86,11 @@ public class OmsCartItemServiceImpl implements OmsCartItemService {
@Override @Override
public List<CartPromotionItem> listPromotion(Long memberId) { public List<CartPromotionItem> listPromotion(Long memberId) {
List<OmsCartItem> cartItemList = list(memberId); List<OmsCartItem> cartItemList = list(memberId);
return promotionService.calcCartPromotion(cartItemList); List<CartPromotionItem> cartPromotionItemList = new ArrayList<>();
if(!CollectionUtils.isEmpty(cartItemList)){
cartPromotionItemList = promotionService.calcCartPromotion(cartItemList);
}
return cartPromotionItemList;
} }
@Override @Override
......
...@@ -11,6 +11,7 @@ import com.macro.mall.portal.service.OmsPromotionService; ...@@ -11,6 +11,7 @@ import com.macro.mall.portal.service.OmsPromotionService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
...@@ -49,6 +50,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService { ...@@ -49,6 +50,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService {
BigDecimal originalPrice = skuStock.getPrice(); BigDecimal originalPrice = skuStock.getPrice();
cartPromotionItem.setReduceAmount(originalPrice.subtract(skuStock.getPromotionPrice())); cartPromotionItem.setReduceAmount(originalPrice.subtract(skuStock.getPromotionPrice()));
cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock()); cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
cartPromotionItemList.add(cartPromotionItem); cartPromotionItemList.add(cartPromotionItem);
} }
} else if (promotionType == 3) { } else if (promotionType == 3) {
...@@ -67,6 +70,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService { ...@@ -67,6 +70,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService {
BigDecimal reduceAmount = originalPrice.subtract(ladder.getDiscount().multiply(originalPrice)); BigDecimal reduceAmount = originalPrice.subtract(ladder.getDiscount().multiply(originalPrice));
cartPromotionItem.setReduceAmount(reduceAmount); cartPromotionItem.setReduceAmount(reduceAmount);
cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock()); cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
cartPromotionItemList.add(cartPromotionItem); cartPromotionItemList.add(cartPromotionItem);
} }
}else{ }else{
...@@ -88,6 +93,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService { ...@@ -88,6 +93,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService {
BigDecimal reduceAmount = originalPrice.divide(totalAmount,RoundingMode.HALF_EVEN).multiply(fullReduction.getReducePrice()); BigDecimal reduceAmount = originalPrice.divide(totalAmount,RoundingMode.HALF_EVEN).multiply(fullReduction.getReducePrice());
cartPromotionItem.setReduceAmount(reduceAmount); cartPromotionItem.setReduceAmount(reduceAmount);
cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock()); cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
cartPromotionItemList.add(cartPromotionItem); cartPromotionItemList.add(cartPromotionItem);
} }
}else{ }else{
...@@ -156,6 +163,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService { ...@@ -156,6 +163,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService {
cartPromotionItem.setReduceAmount(new BigDecimal(0)); cartPromotionItem.setReduceAmount(new BigDecimal(0));
PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId()); PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock()); cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
cartPromotionItemList.add(cartPromotionItem); cartPromotionItemList.add(cartPromotionItem);
} }
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.macro.mall.portal.dao.PortalOrderItemDao">
<insert id="insertList">
insert into oms_order_item (order_id, order_sn, product_id,
product_pic, product_name, product_brand,
product_sn, product_price, product_quantity,
product_sku_id, product_category_id, product_sku_code,
sp1, sp2, sp3, promotion_name,
promotion_amount, coupon_amount, integration_amount,
real_amount) values
<foreach collection="list" item="item" separator="," index="index">
(#{item.orderId,jdbcType=BIGINT}, #{item.orderSn,jdbcType=VARCHAR}, #{item.productId,jdbcType=BIGINT},
#{item.productPic,jdbcType=VARCHAR}, #{item.productName,jdbcType=VARCHAR}, #{item.productBrand,jdbcType=VARCHAR},
#{item.productSn,jdbcType=VARCHAR}, #{item.productPrice,jdbcType=DECIMAL}, #{item.productQuantity,jdbcType=INTEGER},
#{item.productSkuId,jdbcType=BIGINT}, #{item.productCategoryId,jdbcType=BIGINT}, #{item.productSkuCode,jdbcType=VARCHAR},
#{item.sp1,jdbcType=VARCHAR}, #{item.sp2,jdbcType=VARCHAR}, #{item.sp3,jdbcType=VARCHAR},
#{item.promotionName,jdbcType=VARCHAR},
#{item.promotionAmount,jdbcType=DECIMAL}, #{item.couponAmount,jdbcType=DECIMAL},
#{item.integrationAmount,jdbcType=DECIMAL},
#{item.realAmount,jdbcType=DECIMAL})
</foreach>
</insert>
</mapper>
\ No newline at end of file
...@@ -50,10 +50,14 @@ ...@@ -50,10 +50,14 @@
p.id, p.id,
p.`name`, p.`name`,
p.promotion_type, p.promotion_type,
p.gift_growth,
p.gift_point,
sku.id sku_id, sku.id sku_id,
sku.price sku_price, sku.price sku_price,
sku.sku_code sku_sku_code, sku.sku_code sku_sku_code,
sku.promotion_price sku_promotion_price, sku.promotion_price sku_promotion_price,
sku.stock sku_stock,
sku.lock_stock sku_lock_stock,
ladder.id ladder_id, ladder.id ladder_id,
ladder.count ladder_count, ladder.count ladder_count,
ladder.discount ladder_discount, ladder.discount ladder_discount,
......
...@@ -31,5 +31,6 @@ ...@@ -31,5 +31,6 @@
LEFT JOIN sms_coupon_product_relation cpr ON cpr.coupon_id = c.id LEFT JOIN sms_coupon_product_relation cpr ON cpr.coupon_id = c.id
LEFT JOIN sms_coupon_product_category_relation cpcr ON cpcr.coupon_id = c.id LEFT JOIN sms_coupon_product_category_relation cpcr ON cpcr.coupon_id = c.id
WHERE ch.member_id = #{memberId} WHERE ch.member_id = #{memberId}
AND ch.use_status = 0
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment