提交订单完成,mall模块基本完成
This commit is contained in:
1 parent
33a7758e72
commit
f3d1c57f42
23 files changed
+1529
-399
No files matched your search
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.dao;
|
||||||
|
|
||||||
|
import com.ruoyi.app.common.persistence.model.StoreCouponList;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券记录表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
public interface StoreCouponListMapper extends BaseMapper<StoreCouponList> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.dao;
|
||||||
|
|
||||||
|
import com.ruoyi.app.common.persistence.model.StoreCoupon;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.app.modular.shop.service.dto.CouponDTO;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.apache.ibatis.annotations.Update;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券主表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
public interface StoreCouponMapper extends BaseMapper<StoreCoupon> {
|
||||||
|
|
||||||
|
@Select("select s.id,c.money from store_coupon_list s left join store_coupon c " +
|
||||||
|
"on s.cid=c.id where s.id=#{id}")
|
||||||
|
CouponDTO findLog(int id);
|
||||||
|
|
||||||
|
@Update("update store_coupon set use_num=use_num+1 where id=#{id}")
|
||||||
|
void incUserNum(int id);
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.dao;
|
||||||
|
|
||||||
|
import com.ruoyi.app.common.persistence.model.StoreMemberAddress;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 商城会员收货地址 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
public interface StoreMemberAddressMapper extends BaseMapper<StoreMemberAddress> {
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.dao;
|
||||||
|
|
||||||
|
import com.ruoyi.app.common.persistence.model.StoreOrderGoods;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 订单商品表与订单主表关联 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
public interface StoreOrderGoodsMapper extends BaseMapper<StoreOrderGoods> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.ruoyi.app.common.persistence.dao;
|
package com.ruoyi.app.common.persistence.dao;
|
||||||
|
|
||||||
import com.ruoyi.app.common.persistence.model.StoreOrder;
|
import com.ruoyi.app.common.persistence.model.StoreOrder;
|
||||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
<?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.ruoyi.app.common.persistence.dao.StoreCouponListMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.ruoyi.app.common.persistence.model.StoreCouponList">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="cid" property="cid" />
|
||||||
|
<result column="type" property="type" />
|
||||||
|
<result column="uid" property="uid" />
|
||||||
|
<result column="order_id" property="orderId" />
|
||||||
|
<result column="get_order_id" property="getOrderId" />
|
||||||
|
<result column="use_time" property="useTime" />
|
||||||
|
<result column="code" property="code" />
|
||||||
|
<result column="send_time" property="sendTime" />
|
||||||
|
<result column="status" property="status" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
<?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.ruoyi.app.common.persistence.dao.StoreCouponMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.ruoyi.app.common.persistence.model.StoreCoupon">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="name" property="name" />
|
||||||
|
<result column="type" property="type" />
|
||||||
|
<result column="money" property="money" />
|
||||||
|
<result column="condition" property="condition" />
|
||||||
|
<result column="createnum" property="createnum" />
|
||||||
|
<result column="send_num" property="sendNum" />
|
||||||
|
<result column="use_num" property="useNum" />
|
||||||
|
<result column="send_start_time" property="sendStartTime" />
|
||||||
|
<result column="send_end_time" property="sendEndTime" />
|
||||||
|
<result column="use_start_time" property="useStartTime" />
|
||||||
|
<result column="use_end_time" property="useEndTime" />
|
||||||
|
<result column="add_time" property="addTime" />
|
||||||
|
<result column="status" property="status" />
|
||||||
|
<result column="use_type" property="useType" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
<?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.ruoyi.app.common.persistence.dao.StoreMemberAddressMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.ruoyi.app.common.persistence.model.StoreMemberAddress">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="mid" property="mid" />
|
||||||
|
<result column="username" property="username" />
|
||||||
|
<result column="phone" property="phone" />
|
||||||
|
<result column="province" property="province" />
|
||||||
|
<result column="city" property="city" />
|
||||||
|
<result column="area" property="area" />
|
||||||
|
<result column="city_info" property="cityInfo" />
|
||||||
|
<result column="address" property="address" />
|
||||||
|
<result column="status" property="status" />
|
||||||
|
<result column="is_default" property="isDefault" />
|
||||||
|
<result column="is_deleted" property="isDeleted" />
|
||||||
|
<result column="create_at" property="createAt" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
+29
-32
@@ -1,32 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.app.common.persistence.dao.StoreOrderGoodsMapper">
|
<mapper namespace="com.ruoyi.app.common.persistence.dao.StoreOrderGoodsMapper">
|
||||||
|
|
||||||
<!-- 通用查询映射结果 -->
|
<!-- 通用查询映射结果 -->
|
||||||
<resultMap id="BaseResultMap" type="com.ruoyi.app.common.persistence.model.StoreOrderGoods">
|
<resultMap id="BaseResultMap" type="com.ruoyi.app.common.persistence.model.StoreOrderGoods">
|
||||||
<id column="rec_id" property="recId" />
|
<id column="rec_id" property="recId" />
|
||||||
<result column="order_id" property="orderId" />
|
<result column="order_id" property="orderId" />
|
||||||
<result column="goods_id" property="goodsId" />
|
<result column="goods_id" property="goodsId" />
|
||||||
<result column="goods_name" property="goodsName" />
|
<result column="goods_name" property="goodsName" />
|
||||||
<result column="goods_sn" property="goodsSn" />
|
<result column="goods_sn" property="goodsSn" />
|
||||||
<result column="goods_num" property="goodsNum" />
|
<result column="goods_num" property="goodsNum" />
|
||||||
<result column="market_price" property="marketPrice" />
|
<result column="market_price" property="marketPrice" />
|
||||||
<result column="goods_price" property="goodsPrice" />
|
<result column="goods_price" property="goodsPrice" />
|
||||||
<result column="cost_price" property="costPrice" />
|
<result column="cost_price" property="costPrice" />
|
||||||
<result column="member_goods_price" property="memberGoodsPrice" />
|
<result column="member_goods_price" property="memberGoodsPrice" />
|
||||||
<result column="give_integral" property="giveIntegral" />
|
<result column="give_integral" property="giveIntegral" />
|
||||||
<result column="spec_key" property="specKey" />
|
<result column="spec_key" property="specKey" />
|
||||||
<result column="spec_key_name" property="specKeyName" />
|
<result column="spec_key_name" property="specKeyName" />
|
||||||
<result column="bar_code" property="barCode" />
|
<result column="bar_code" property="barCode" />
|
||||||
<result column="is_comment" property="isComment" />
|
<result column="is_comment" property="isComment" />
|
||||||
<result column="prom_type" property="promType" />
|
<result column="prom_type" property="promType" />
|
||||||
<result column="prom_id" property="promId" />
|
<result column="prom_id" property="promId" />
|
||||||
<result column="pay_status" property="payStatus" />
|
<result column="is_send" property="isSend" />
|
||||||
<result column="is_send" property="isSend" />
|
<result column="delivery_id" property="deliveryId" />
|
||||||
<result column="delivery_id" property="deliveryId" />
|
<result column="sku" property="sku" />
|
||||||
<result column="sku" property="sku" />
|
</resultMap>
|
||||||
<result column="start_time" property="startTime" />
|
|
||||||
<result column="end_time" property="endTime" />
|
</mapper>
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -0,0 +1,242 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.model;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券主表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
@TableName("store_coupon")
|
||||||
|
public class StoreCoupon extends Model<StoreCoupon> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 优惠券名字
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 发放类型 0下单赠送1 指定发放 2 免费领取 3线下发放
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 优惠券金额
|
||||||
|
*/
|
||||||
|
private BigDecimal money;
|
||||||
|
/**
|
||||||
|
* 使用条件,满多少金额
|
||||||
|
*/
|
||||||
|
private BigDecimal condition;
|
||||||
|
/**
|
||||||
|
* 发放数量
|
||||||
|
*/
|
||||||
|
private Integer createnum;
|
||||||
|
/**
|
||||||
|
* 已领取数量
|
||||||
|
*/
|
||||||
|
@TableField("send_num")
|
||||||
|
private Integer sendNum;
|
||||||
|
/**
|
||||||
|
* 已使用数量
|
||||||
|
*/
|
||||||
|
@TableField("use_num")
|
||||||
|
private Integer useNum;
|
||||||
|
/**
|
||||||
|
* 发放开始时间
|
||||||
|
*/
|
||||||
|
@TableField("send_start_time")
|
||||||
|
private Integer sendStartTime;
|
||||||
|
/**
|
||||||
|
* 发放结束时间
|
||||||
|
*/
|
||||||
|
@TableField("send_end_time")
|
||||||
|
private Integer sendEndTime;
|
||||||
|
/**
|
||||||
|
* 使用开始时间
|
||||||
|
*/
|
||||||
|
@TableField("use_start_time")
|
||||||
|
private Date useStartTime;
|
||||||
|
/**
|
||||||
|
* 使用结束时间
|
||||||
|
*/
|
||||||
|
@TableField("use_end_time")
|
||||||
|
private Date useEndTime;
|
||||||
|
/**
|
||||||
|
* 添加时间
|
||||||
|
*/
|
||||||
|
@TableField("add_time")
|
||||||
|
private Integer addTime;
|
||||||
|
/**
|
||||||
|
* 状态:1有效,2无效
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 使用范围:0全店通用1指定商品可用2指定分类商品可用
|
||||||
|
*/
|
||||||
|
@TableField("use_type")
|
||||||
|
private Integer useType;
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMoney() {
|
||||||
|
return money;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMoney(BigDecimal money) {
|
||||||
|
this.money = money;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCondition() {
|
||||||
|
return condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCondition(BigDecimal condition) {
|
||||||
|
this.condition = condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCreatenum() {
|
||||||
|
return createnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatenum(Integer createnum) {
|
||||||
|
this.createnum = createnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSendNum() {
|
||||||
|
return sendNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendNum(Integer sendNum) {
|
||||||
|
this.sendNum = sendNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUseNum() {
|
||||||
|
return useNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseNum(Integer useNum) {
|
||||||
|
this.useNum = useNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSendStartTime() {
|
||||||
|
return sendStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendStartTime(Integer sendStartTime) {
|
||||||
|
this.sendStartTime = sendStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSendEndTime() {
|
||||||
|
return sendEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendEndTime(Integer sendEndTime) {
|
||||||
|
this.sendEndTime = sendEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUseStartTime() {
|
||||||
|
return useStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseStartTime(Date useStartTime) {
|
||||||
|
this.useStartTime = useStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUseEndTime() {
|
||||||
|
return useEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseEndTime(Date useEndTime) {
|
||||||
|
this.useEndTime = useEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAddTime() {
|
||||||
|
return addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddTime(Integer addTime) {
|
||||||
|
this.addTime = addTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUseType() {
|
||||||
|
return useType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseType(Integer useType) {
|
||||||
|
this.useType = useType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Serializable pkVal() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StoreCoupon{" +
|
||||||
|
", id=" + id +
|
||||||
|
", name=" + name +
|
||||||
|
", type=" + type +
|
||||||
|
", money=" + money +
|
||||||
|
", condition=" + condition +
|
||||||
|
", createnum=" + createnum +
|
||||||
|
", sendNum=" + sendNum +
|
||||||
|
", useNum=" + useNum +
|
||||||
|
", sendStartTime=" + sendStartTime +
|
||||||
|
", sendEndTime=" + sendEndTime +
|
||||||
|
", useStartTime=" + useStartTime +
|
||||||
|
", useEndTime=" + useEndTime +
|
||||||
|
", addTime=" + addTime +
|
||||||
|
", status=" + status +
|
||||||
|
", useType=" + useType +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 优惠券记录表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
@TableName("store_coupon_list")
|
||||||
|
public class StoreCouponList extends Model<StoreCouponList> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 优惠券 对应coupon表id
|
||||||
|
*/
|
||||||
|
private Integer cid;
|
||||||
|
/**
|
||||||
|
* 发放类型 1 按订单发放 2 注册 3 邀请 4 按用户发放
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Integer uid;
|
||||||
|
/**
|
||||||
|
* 订单id
|
||||||
|
*/
|
||||||
|
@TableField("order_id")
|
||||||
|
private Integer orderId;
|
||||||
|
/**
|
||||||
|
* 优惠券来自订单ID
|
||||||
|
*/
|
||||||
|
@TableField("get_order_id")
|
||||||
|
private Integer getOrderId;
|
||||||
|
/**
|
||||||
|
* 使用时间
|
||||||
|
*/
|
||||||
|
@TableField("use_time")
|
||||||
|
private Integer useTime;
|
||||||
|
/**
|
||||||
|
* 优惠券兑换码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 发放时间
|
||||||
|
*/
|
||||||
|
@TableField("send_time")
|
||||||
|
private Integer sendTime;
|
||||||
|
/**
|
||||||
|
* 0未使用1已使用2已过期
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCid() {
|
||||||
|
return cid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCid(Integer cid) {
|
||||||
|
this.cid = cid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(Integer uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrderId() {
|
||||||
|
return orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderId(Integer orderId) {
|
||||||
|
this.orderId = orderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGetOrderId() {
|
||||||
|
return getOrderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGetOrderId(Integer getOrderId) {
|
||||||
|
this.getOrderId = getOrderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUseTime() {
|
||||||
|
return useTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseTime(Integer useTime) {
|
||||||
|
this.useTime = useTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSendTime() {
|
||||||
|
return sendTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSendTime(Integer sendTime) {
|
||||||
|
this.sendTime = sendTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Serializable pkVal() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StoreCouponList{" +
|
||||||
|
", id=" + id +
|
||||||
|
", cid=" + cid +
|
||||||
|
", type=" + type +
|
||||||
|
", uid=" + uid +
|
||||||
|
", orderId=" + orderId +
|
||||||
|
", getOrderId=" + getOrderId +
|
||||||
|
", useTime=" + useTime +
|
||||||
|
", code=" + code +
|
||||||
|
", sendTime=" + sendTime +
|
||||||
|
", status=" + status +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
+208
@@ -0,0 +1,208 @@
|
|||||||
|
package com.ruoyi.app.common.persistence.model;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 商城会员收货地址
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hupeng
|
||||||
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
|
@TableName("store_member_address")
|
||||||
|
public class StoreMemberAddress extends Model<StoreMemberAddress> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 会员ID
|
||||||
|
*/
|
||||||
|
private Long mid;
|
||||||
|
/**
|
||||||
|
* 收货人姓名
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
/**
|
||||||
|
* 收货手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
/**
|
||||||
|
* 收货地址省份
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 收货地址城市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 收货地址区域
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
/**
|
||||||
|
* 城市信息
|
||||||
|
*/
|
||||||
|
@TableField("city_info")
|
||||||
|
private String cityInfo;
|
||||||
|
/**
|
||||||
|
* 收货详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 状态(0无效, 1新快递)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 默认收货地址
|
||||||
|
*/
|
||||||
|
@TableField("is_default")
|
||||||
|
private Integer isDefault;
|
||||||
|
/**
|
||||||
|
* 删除状态(1删除,0未删除)
|
||||||
|
*/
|
||||||
|
@TableField("is_deleted")
|
||||||
|
private Long isDeleted;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_at")
|
||||||
|
private Date createAt;
|
||||||
|
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMid() {
|
||||||
|
return mid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMid(Long mid) {
|
||||||
|
this.mid = mid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArea() {
|
||||||
|
return area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArea(String area) {
|
||||||
|
this.area = area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCityInfo() {
|
||||||
|
return cityInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCityInfo(String cityInfo) {
|
||||||
|
this.cityInfo = cityInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIsDefault() {
|
||||||
|
return isDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDefault(Integer isDefault) {
|
||||||
|
this.isDefault = isDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIsDeleted() {
|
||||||
|
return isDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDeleted(Long isDeleted) {
|
||||||
|
this.isDeleted = isDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateAt() {
|
||||||
|
return createAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateAt(Date createAt) {
|
||||||
|
this.createAt = createAt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Serializable pkVal() {
|
||||||
|
return this.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StoreMemberAddress{" +
|
||||||
|
", id=" + id +
|
||||||
|
", mid=" + mid +
|
||||||
|
", username=" + username +
|
||||||
|
", phone=" + phone +
|
||||||
|
", province=" + province +
|
||||||
|
", city=" + city +
|
||||||
|
", area=" + area +
|
||||||
|
", cityInfo=" + cityInfo +
|
||||||
|
", address=" + address +
|
||||||
|
", status=" + status +
|
||||||
|
", isDefault=" + isDefault +
|
||||||
|
", isDeleted=" + isDeleted +
|
||||||
|
", createAt=" + createAt +
|
||||||
|
"}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.ruoyi.app.common.persistence.model;
|
package com.ruoyi.app.common.persistence.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.enums.IdType;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import com.baomidou.mybatisplus.annotations.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotations.TableField;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.activerecord.Model;
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
import com.baomidou.mybatisplus.annotations.TableName;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -194,8 +193,8 @@ public class StoreOrder extends Model<StoreOrder> {
|
|||||||
/**
|
/**
|
||||||
* 下单时间
|
* 下单时间
|
||||||
*/
|
*/
|
||||||
@TableField("add_time")
|
@TableField(value = "add_time",fill = FieldFill.INSERT)
|
||||||
private Integer addTime;
|
private Date addTime;
|
||||||
/**
|
/**
|
||||||
* 最后新发货时间
|
* 最后新发货时间
|
||||||
*/
|
*/
|
||||||
@@ -599,11 +598,11 @@ public class StoreOrder extends Model<StoreOrder> {
|
|||||||
this.totalAmount = totalAmount;
|
this.totalAmount = totalAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getAddTime() {
|
public Date getAddTime() {
|
||||||
return addTime;
|
return addTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddTime(Integer addTime) {
|
public void setAddTime(Date addTime) {
|
||||||
this.addTime = addTime;
|
this.addTime = addTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+315
-355
@@ -1,355 +1,315 @@
|
|||||||
package com.ruoyi.app.common.persistence.model;
|
package com.ruoyi.app.common.persistence.model;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.io.Serializable;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
/**
|
import java.io.Serializable;
|
||||||
* <p>
|
|
||||||
* 订单商品表与订单主表关联
|
/**
|
||||||
* </p>
|
* <p>
|
||||||
*
|
* 订单商品表与订单主表关联
|
||||||
* @author hupeng
|
* </p>
|
||||||
* @since 2019-06-26
|
*
|
||||||
*/
|
* @author hupeng
|
||||||
public class StoreOrderGoods extends Model<StoreOrderGoods> {
|
* @since 2019-09-13
|
||||||
|
*/
|
||||||
private static final long serialVersionUID=1L;
|
@TableName("store_order_goods")
|
||||||
|
public class StoreOrderGoods extends Model<StoreOrderGoods> {
|
||||||
/**
|
|
||||||
* 表id自增
|
private static final long serialVersionUID = 1L;
|
||||||
*/
|
|
||||||
@TableId(value = "rec_id", type = IdType.AUTO)
|
/**
|
||||||
private Integer recId;
|
* 表id自增
|
||||||
|
*/
|
||||||
/**
|
@TableId(value = "rec_id", type = IdType.AUTO)
|
||||||
* 订单id
|
private Integer recId;
|
||||||
*/
|
/**
|
||||||
private Integer orderId;
|
* 订单id
|
||||||
|
*/
|
||||||
/**
|
@TableField("order_id")
|
||||||
* 商品id
|
private Integer orderId;
|
||||||
*/
|
/**
|
||||||
private Integer goodsId;
|
* 商品id
|
||||||
|
*/
|
||||||
/**
|
@TableField("goods_id")
|
||||||
* 商品名称
|
private Integer goodsId;
|
||||||
*/
|
/**
|
||||||
private String goodsName;
|
* 商品名称
|
||||||
|
*/
|
||||||
/**
|
@TableField("goods_name")
|
||||||
* 商品货号
|
private String goodsName;
|
||||||
*/
|
/**
|
||||||
private String goodsSn;
|
* 商品货号
|
||||||
|
*/
|
||||||
/**
|
@TableField("goods_sn")
|
||||||
* 购买数量
|
private String goodsSn;
|
||||||
*/
|
/**
|
||||||
private Integer goodsNum;
|
* 购买数量
|
||||||
|
*/
|
||||||
/**
|
@TableField("goods_num")
|
||||||
* 市场价
|
private Integer goodsNum;
|
||||||
*/
|
/**
|
||||||
private BigDecimal marketPrice;
|
* 市场价
|
||||||
|
*/
|
||||||
/**
|
@TableField("market_price")
|
||||||
* 本店价(供货价)
|
private BigDecimal marketPrice;
|
||||||
*/
|
/**
|
||||||
private BigDecimal goodsPrice;
|
* 本店价(供货价)
|
||||||
|
*/
|
||||||
/**
|
@TableField("goods_price")
|
||||||
* 商品成本价
|
private BigDecimal goodsPrice;
|
||||||
*/
|
/**
|
||||||
private BigDecimal costPrice;
|
* 商品成本价
|
||||||
|
*/
|
||||||
/**
|
@TableField("cost_price")
|
||||||
* 会员折扣价
|
private BigDecimal costPrice;
|
||||||
*/
|
/**
|
||||||
private BigDecimal memberGoodsPrice;
|
* 会员折扣价
|
||||||
|
*/
|
||||||
/**
|
@TableField("member_goods_price")
|
||||||
* 购买商品赠送积分
|
private BigDecimal memberGoodsPrice;
|
||||||
*/
|
/**
|
||||||
private Integer giveIntegral;
|
* 购买商品赠送积分
|
||||||
|
*/
|
||||||
/**
|
@TableField("give_integral")
|
||||||
* 商品规格key
|
private Integer giveIntegral;
|
||||||
*/
|
/**
|
||||||
private String specKey;
|
* 商品规格key
|
||||||
|
*/
|
||||||
/**
|
@TableField("spec_key")
|
||||||
* 规格对应的中文名字
|
private String specKey;
|
||||||
*/
|
/**
|
||||||
private String specKeyName;
|
* 规格对应的中文名字
|
||||||
|
*/
|
||||||
/**
|
@TableField("spec_key_name")
|
||||||
* 条码
|
private String specKeyName;
|
||||||
*/
|
/**
|
||||||
private String barCode;
|
* 条码
|
||||||
|
*/
|
||||||
/**
|
@TableField("bar_code")
|
||||||
* 是否评价
|
private String barCode;
|
||||||
*/
|
/**
|
||||||
private Boolean isComment;
|
* 是否评价
|
||||||
|
*/
|
||||||
/**
|
@TableField("is_comment")
|
||||||
* 0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售
|
private Integer isComment;
|
||||||
*/
|
/**
|
||||||
private Boolean promType;
|
* 0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售
|
||||||
|
*/
|
||||||
/**
|
@TableField("prom_type")
|
||||||
* 活动id
|
private Integer promType;
|
||||||
*/
|
/**
|
||||||
private Integer promId;
|
* 活动id
|
||||||
|
*/
|
||||||
/**
|
@TableField("prom_id")
|
||||||
* 0未支付1已支付
|
private Integer promId;
|
||||||
*/
|
/**
|
||||||
private Boolean payStatus;
|
* 0未发货,1已发货,2已换货,3已退货
|
||||||
|
*/
|
||||||
/**
|
@TableField("is_send")
|
||||||
* 0未发货,1已发货,2已换货,3已退货
|
private Integer isSend;
|
||||||
*/
|
/**
|
||||||
private Boolean isSend;
|
* 发货单ID
|
||||||
|
*/
|
||||||
/**
|
@TableField("delivery_id")
|
||||||
* 发货单ID
|
private Integer deliveryId;
|
||||||
*/
|
/**
|
||||||
private Integer deliveryId;
|
* sku
|
||||||
|
*/
|
||||||
/**
|
private String sku;
|
||||||
* sku
|
|
||||||
*/
|
|
||||||
private String sku;
|
public Integer getRecId() {
|
||||||
|
return recId;
|
||||||
/**
|
}
|
||||||
* 订单开始时间
|
|
||||||
*/
|
public void setRecId(Integer recId) {
|
||||||
private Integer startTime;
|
this.recId = recId;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 订单结束时间
|
public Integer getOrderId() {
|
||||||
*/
|
return orderId;
|
||||||
private Integer endTime;
|
}
|
||||||
|
|
||||||
|
public void setOrderId(Integer orderId) {
|
||||||
public Integer getRecId() {
|
this.orderId = orderId;
|
||||||
return recId;
|
}
|
||||||
}
|
|
||||||
|
public Integer getGoodsId() {
|
||||||
public void setRecId(Integer recId) {
|
return goodsId;
|
||||||
this.recId = recId;
|
}
|
||||||
}
|
|
||||||
|
public void setGoodsId(Integer goodsId) {
|
||||||
public Integer getOrderId() {
|
this.goodsId = goodsId;
|
||||||
return orderId;
|
}
|
||||||
}
|
|
||||||
|
public String getGoodsName() {
|
||||||
public void setOrderId(Integer orderId) {
|
return goodsName;
|
||||||
this.orderId = orderId;
|
}
|
||||||
}
|
|
||||||
|
public void setGoodsName(String goodsName) {
|
||||||
public Integer getGoodsId() {
|
this.goodsName = goodsName;
|
||||||
return goodsId;
|
}
|
||||||
}
|
|
||||||
|
public String getGoodsSn() {
|
||||||
public void setGoodsId(Integer goodsId) {
|
return goodsSn;
|
||||||
this.goodsId = goodsId;
|
}
|
||||||
}
|
|
||||||
|
public void setGoodsSn(String goodsSn) {
|
||||||
public String getGoodsName() {
|
this.goodsSn = goodsSn;
|
||||||
return goodsName;
|
}
|
||||||
}
|
|
||||||
|
public Integer getGoodsNum() {
|
||||||
public void setGoodsName(String goodsName) {
|
return goodsNum;
|
||||||
this.goodsName = goodsName;
|
}
|
||||||
}
|
|
||||||
|
public void setGoodsNum(Integer goodsNum) {
|
||||||
public String getGoodsSn() {
|
this.goodsNum = goodsNum;
|
||||||
return goodsSn;
|
}
|
||||||
}
|
|
||||||
|
public BigDecimal getMarketPrice() {
|
||||||
public void setGoodsSn(String goodsSn) {
|
return marketPrice;
|
||||||
this.goodsSn = goodsSn;
|
}
|
||||||
}
|
|
||||||
|
public void setMarketPrice(BigDecimal marketPrice) {
|
||||||
public Integer getGoodsNum() {
|
this.marketPrice = marketPrice;
|
||||||
return goodsNum;
|
}
|
||||||
}
|
|
||||||
|
public BigDecimal getGoodsPrice() {
|
||||||
public void setGoodsNum(Integer goodsNum) {
|
return goodsPrice;
|
||||||
this.goodsNum = goodsNum;
|
}
|
||||||
}
|
|
||||||
|
public void setGoodsPrice(BigDecimal goodsPrice) {
|
||||||
public BigDecimal getMarketPrice() {
|
this.goodsPrice = goodsPrice;
|
||||||
return marketPrice;
|
}
|
||||||
}
|
|
||||||
|
public BigDecimal getCostPrice() {
|
||||||
public void setMarketPrice(BigDecimal marketPrice) {
|
return costPrice;
|
||||||
this.marketPrice = marketPrice;
|
}
|
||||||
}
|
|
||||||
|
public void setCostPrice(BigDecimal costPrice) {
|
||||||
public BigDecimal getGoodsPrice() {
|
this.costPrice = costPrice;
|
||||||
return goodsPrice;
|
}
|
||||||
}
|
|
||||||
|
public BigDecimal getMemberGoodsPrice() {
|
||||||
public void setGoodsPrice(BigDecimal goodsPrice) {
|
return memberGoodsPrice;
|
||||||
this.goodsPrice = goodsPrice;
|
}
|
||||||
}
|
|
||||||
|
public void setMemberGoodsPrice(BigDecimal memberGoodsPrice) {
|
||||||
public BigDecimal getCostPrice() {
|
this.memberGoodsPrice = memberGoodsPrice;
|
||||||
return costPrice;
|
}
|
||||||
}
|
|
||||||
|
public Integer getGiveIntegral() {
|
||||||
public void setCostPrice(BigDecimal costPrice) {
|
return giveIntegral;
|
||||||
this.costPrice = costPrice;
|
}
|
||||||
}
|
|
||||||
|
public void setGiveIntegral(Integer giveIntegral) {
|
||||||
public BigDecimal getMemberGoodsPrice() {
|
this.giveIntegral = giveIntegral;
|
||||||
return memberGoodsPrice;
|
}
|
||||||
}
|
|
||||||
|
public String getSpecKey() {
|
||||||
public void setMemberGoodsPrice(BigDecimal memberGoodsPrice) {
|
return specKey;
|
||||||
this.memberGoodsPrice = memberGoodsPrice;
|
}
|
||||||
}
|
|
||||||
|
public void setSpecKey(String specKey) {
|
||||||
public Integer getGiveIntegral() {
|
this.specKey = specKey;
|
||||||
return giveIntegral;
|
}
|
||||||
}
|
|
||||||
|
public String getSpecKeyName() {
|
||||||
public void setGiveIntegral(Integer giveIntegral) {
|
return specKeyName;
|
||||||
this.giveIntegral = giveIntegral;
|
}
|
||||||
}
|
|
||||||
|
public void setSpecKeyName(String specKeyName) {
|
||||||
public String getSpecKey() {
|
this.specKeyName = specKeyName;
|
||||||
return specKey;
|
}
|
||||||
}
|
|
||||||
|
public String getBarCode() {
|
||||||
public void setSpecKey(String specKey) {
|
return barCode;
|
||||||
this.specKey = specKey;
|
}
|
||||||
}
|
|
||||||
|
public void setBarCode(String barCode) {
|
||||||
public String getSpecKeyName() {
|
this.barCode = barCode;
|
||||||
return specKeyName;
|
}
|
||||||
}
|
|
||||||
|
public Integer getIsComment() {
|
||||||
public void setSpecKeyName(String specKeyName) {
|
return isComment;
|
||||||
this.specKeyName = specKeyName;
|
}
|
||||||
}
|
|
||||||
|
public void setIsComment(Integer isComment) {
|
||||||
public String getBarCode() {
|
this.isComment = isComment;
|
||||||
return barCode;
|
}
|
||||||
}
|
|
||||||
|
public Integer getPromType() {
|
||||||
public void setBarCode(String barCode) {
|
return promType;
|
||||||
this.barCode = barCode;
|
}
|
||||||
}
|
|
||||||
|
public void setPromType(Integer promType) {
|
||||||
public Boolean getComment() {
|
this.promType = promType;
|
||||||
return isComment;
|
}
|
||||||
}
|
|
||||||
|
public Integer getPromId() {
|
||||||
public void setComment(Boolean isComment) {
|
return promId;
|
||||||
this.isComment = isComment;
|
}
|
||||||
}
|
|
||||||
|
public void setPromId(Integer promId) {
|
||||||
public Boolean getPromType() {
|
this.promId = promId;
|
||||||
return promType;
|
}
|
||||||
}
|
|
||||||
|
public Integer getIsSend() {
|
||||||
public void setPromType(Boolean promType) {
|
return isSend;
|
||||||
this.promType = promType;
|
}
|
||||||
}
|
|
||||||
|
public void setIsSend(Integer isSend) {
|
||||||
public Integer getPromId() {
|
this.isSend = isSend;
|
||||||
return promId;
|
}
|
||||||
}
|
|
||||||
|
public Integer getDeliveryId() {
|
||||||
public void setPromId(Integer promId) {
|
return deliveryId;
|
||||||
this.promId = promId;
|
}
|
||||||
}
|
|
||||||
|
public void setDeliveryId(Integer deliveryId) {
|
||||||
public Boolean getPayStatus() {
|
this.deliveryId = deliveryId;
|
||||||
return payStatus;
|
}
|
||||||
}
|
|
||||||
|
public String getSku() {
|
||||||
public void setPayStatus(Boolean payStatus) {
|
return sku;
|
||||||
this.payStatus = payStatus;
|
}
|
||||||
}
|
|
||||||
|
public void setSku(String sku) {
|
||||||
public Boolean getSend() {
|
this.sku = sku;
|
||||||
return isSend;
|
}
|
||||||
}
|
|
||||||
|
@Override
|
||||||
public void setSend(Boolean isSend) {
|
protected Serializable pkVal() {
|
||||||
this.isSend = isSend;
|
return this.recId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getDeliveryId() {
|
@Override
|
||||||
return deliveryId;
|
public String toString() {
|
||||||
}
|
return "StoreOrderGoods{" +
|
||||||
|
", recId=" + recId +
|
||||||
public void setDeliveryId(Integer deliveryId) {
|
", orderId=" + orderId +
|
||||||
this.deliveryId = deliveryId;
|
", goodsId=" + goodsId +
|
||||||
}
|
", goodsName=" + goodsName +
|
||||||
|
", goodsSn=" + goodsSn +
|
||||||
public String getSku() {
|
", goodsNum=" + goodsNum +
|
||||||
return sku;
|
", marketPrice=" + marketPrice +
|
||||||
}
|
", goodsPrice=" + goodsPrice +
|
||||||
|
", costPrice=" + costPrice +
|
||||||
public void setSku(String sku) {
|
", memberGoodsPrice=" + memberGoodsPrice +
|
||||||
this.sku = sku;
|
", giveIntegral=" + giveIntegral +
|
||||||
}
|
", specKey=" + specKey +
|
||||||
|
", specKeyName=" + specKeyName +
|
||||||
public Integer getStartTime() {
|
", barCode=" + barCode +
|
||||||
return startTime;
|
", isComment=" + isComment +
|
||||||
}
|
", promType=" + promType +
|
||||||
|
", promId=" + promId +
|
||||||
public void setStartTime(Integer startTime) {
|
", isSend=" + isSend +
|
||||||
this.startTime = startTime;
|
", deliveryId=" + deliveryId +
|
||||||
}
|
", sku=" + sku +
|
||||||
|
"}";
|
||||||
public Integer getEndTime() {
|
}
|
||||||
return endTime;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void setEndTime(Integer endTime) {
|
|
||||||
this.endTime = endTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Serializable pkVal() {
|
|
||||||
return this.recId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "StoreOrderGoods{" +
|
|
||||||
"recId=" + recId +
|
|
||||||
", orderId=" + orderId +
|
|
||||||
", goodsId=" + goodsId +
|
|
||||||
", goodsName=" + goodsName +
|
|
||||||
", goodsSn=" + goodsSn +
|
|
||||||
", goodsNum=" + goodsNum +
|
|
||||||
", marketPrice=" + marketPrice +
|
|
||||||
", goodsPrice=" + goodsPrice +
|
|
||||||
", costPrice=" + costPrice +
|
|
||||||
", memberGoodsPrice=" + memberGoodsPrice +
|
|
||||||
", giveIntegral=" + giveIntegral +
|
|
||||||
", specKey=" + specKey +
|
|
||||||
", specKeyName=" + specKeyName +
|
|
||||||
", barCode=" + barCode +
|
|
||||||
", isComment=" + isComment +
|
|
||||||
", promType=" + promType +
|
|
||||||
", promId=" + promId +
|
|
||||||
", payStatus=" + payStatus +
|
|
||||||
", isSend=" + isSend +
|
|
||||||
", deliveryId=" + deliveryId +
|
|
||||||
", sku=" + sku +
|
|
||||||
", startTime=" + startTime +
|
|
||||||
", endTime=" + endTime +
|
|
||||||
"}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.app.common.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OrderUtil
|
||||||
|
* @Author hupeng <610796224@qq.com>
|
||||||
|
* @Date 2019/9/13
|
||||||
|
**/
|
||||||
|
public class OrderUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间戳订单号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String orderSn(){
|
||||||
|
Date date = DateUtil.date();
|
||||||
|
return DateUtil.format(date,"yyyyMMddHHmmssSSS");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取精确到秒的时间戳
|
||||||
|
* @param date
|
||||||
|
* @return
|
||||||
|
**/
|
||||||
|
public static int getSecondTimestampTwo(){
|
||||||
|
String timestamp = String.valueOf(new Date().getTime()/1000);
|
||||||
|
return Integer.valueOf(timestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,16 +3,17 @@ package com.ruoyi.app.modular.shop.controller;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.itmuch.lightsecurity.jwt.UserOperator;
|
import com.itmuch.lightsecurity.jwt.UserOperator;
|
||||||
import com.ruoyi.app.common.R;
|
import com.ruoyi.app.common.R;
|
||||||
import com.ruoyi.app.common.exception.BadRequestException;
|
|
||||||
import com.ruoyi.app.common.persistence.model.StoreSpecGoodsPrice;
|
import com.ruoyi.app.common.persistence.model.StoreSpecGoodsPrice;
|
||||||
import com.ruoyi.app.modular.shop.service.dto.CateDTO;
|
import com.ruoyi.app.modular.shop.service.dto.CateDTO;
|
||||||
import com.ruoyi.app.modular.shop.service.dto.GoodsDTO;
|
import com.ruoyi.app.modular.shop.service.dto.GoodsDTO;
|
||||||
import com.ruoyi.app.modular.shop.service.dto.SpecItemDTO;
|
import com.ruoyi.app.modular.shop.service.dto.SpecItemDTO;
|
||||||
import com.ruoyi.app.modular.shop.service.impl.CateServiceImpl;
|
import com.ruoyi.app.modular.shop.service.impl.CateServiceImpl;
|
||||||
import com.ruoyi.app.modular.shop.service.impl.GoodsServiceImpl;
|
import com.ruoyi.app.modular.shop.service.impl.GoodsServiceImpl;
|
||||||
|
import com.ruoyi.app.modular.shop.service.impl.OrderServiceImpl;
|
||||||
import com.ruoyi.app.modular.shop.service.mapper.GoodsMapper;
|
import com.ruoyi.app.modular.shop.service.mapper.GoodsMapper;
|
||||||
import com.ruoyi.app.modular.shop.service.vo.CartVO;
|
import com.ruoyi.app.modular.shop.service.vo.CartVO;
|
||||||
import com.ruoyi.app.modular.shop.service.vo.CollectVO;
|
import com.ruoyi.app.modular.shop.service.vo.CollectVO;
|
||||||
|
import com.ruoyi.app.modular.shop.service.vo.OrderVo;
|
||||||
import com.ruoyi.app.modular.shop.service.vo.PageVO;
|
import com.ruoyi.app.modular.shop.service.vo.PageVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -39,6 +40,7 @@ public class MallController {
|
|||||||
private final GoodsServiceImpl goodsService;
|
private final GoodsServiceImpl goodsService;
|
||||||
private final UserOperator userOperator;
|
private final UserOperator userOperator;
|
||||||
private final GoodsMapper goodsMapper;
|
private final GoodsMapper goodsMapper;
|
||||||
|
private final OrderServiceImpl orderervice;
|
||||||
|
|
||||||
@GetMapping("/shop/mall-lists")
|
@GetMapping("/shop/mall-lists")
|
||||||
@ApiOperation(value = "商品分类模块列表",notes = "商品分类模块列表")
|
@ApiOperation(value = "商品分类模块列表",notes = "商品分类模块列表")
|
||||||
@@ -153,4 +155,21 @@ public class MallController {
|
|||||||
return R.success(goodsService.cartList(pageVO,userId));
|
return R.success(goodsService.cartList(pageVO,userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/shop/mall-order-submit")
|
||||||
|
@ApiOperation(value = "提交订单",notes = "提交订单")
|
||||||
|
public R submitOrder(@Validated @RequestBody OrderVo orderVo){
|
||||||
|
int userId = userOperator.getUser().getId();
|
||||||
|
String orderSn = "";
|
||||||
|
if(Integer.valueOf(orderVo.getOrderFrom()) == 1){
|
||||||
|
orderSn = orderervice.addOrderOfOne(orderVo,userId);
|
||||||
|
}else{
|
||||||
|
orderSn = orderervice.addOrderOfTwo(orderVo,userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String,String> map = new HashMap<>();
|
||||||
|
map.put("orderSn",orderSn);
|
||||||
|
return R.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ruoyi.app.modular.shop.service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.app.common.persistence.model.StoreOrderGoods;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IOrderGoodsService extends IService<StoreOrderGoods> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ruoyi.app.modular.shop.service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.app.common.persistence.model.StoreOrder;
|
||||||
|
import com.ruoyi.app.modular.shop.service.vo.OrderVo;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public interface IOrderService extends IService<StoreOrder> {
|
||||||
|
|
||||||
|
public String addOrderOfOne(OrderVo orderVo,int userId);
|
||||||
|
|
||||||
|
public String addOrderOfTwo(OrderVo orderVo,int userId);
|
||||||
|
|
||||||
|
public int checkStore(int goodsId,String spec_key);
|
||||||
|
|
||||||
|
public void updateCouponStatus(int id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ruoyi.app.modular.shop.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName CouponDTO
|
||||||
|
* @Author hupeng <610796224@qq.com>
|
||||||
|
* @Date 2019/9/14
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CouponDTO implements Serializable {
|
||||||
|
private int id;
|
||||||
|
private String name;
|
||||||
|
private Double money;
|
||||||
|
private Double condition;
|
||||||
|
private Date useEndTime;
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.app.modular.shop.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.app.common.persistence.dao.*;
|
||||||
|
import com.ruoyi.app.common.persistence.model.*;
|
||||||
|
import com.ruoyi.app.modular.shop.service.IOrderGoodsService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class OrderGoodsServiceImpl extends ServiceImpl<StoreOrderGoodsMapper, StoreOrderGoods> implements IOrderGoodsService {
|
||||||
|
|
||||||
|
}
|
||||||
+260
@@ -0,0 +1,260 @@
|
|||||||
|
package com.ruoyi.app.modular.shop.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.itmuch.lightsecurity.exception.LightSecurityException;
|
||||||
|
import com.ruoyi.app.common.persistence.dao.*;
|
||||||
|
import com.ruoyi.app.common.persistence.model.*;
|
||||||
|
import com.ruoyi.app.common.utils.OrderUtil;
|
||||||
|
import com.ruoyi.app.modular.shop.service.IOrderService;
|
||||||
|
import com.ruoyi.app.modular.shop.service.dto.CouponDTO;
|
||||||
|
import com.ruoyi.app.modular.shop.service.vo.CartAttrVO;
|
||||||
|
import com.ruoyi.app.modular.shop.service.vo.CartVO;
|
||||||
|
import com.ruoyi.app.modular.shop.service.vo.OrderVo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
|
public class OrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOrder> implements IOrderService {
|
||||||
|
|
||||||
|
private final StoreCartMapper storeCartMapper;
|
||||||
|
private final StoreSpecGoodsPriceMapper storeSpecGoodsPriceMapper;
|
||||||
|
private final StoreMemberAddressMapper storeMemberAddressMapper;
|
||||||
|
private final StoreCouponMapper storeCouponMapper;
|
||||||
|
private final StoreCouponListMapper storeCouponListMapper;
|
||||||
|
private final OrderGoodsServiceImpl orderGoodsService;
|
||||||
|
private final GoodsServiceImpl goodsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车提交
|
||||||
|
* @param orderVo
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public String addOrderOfOne(OrderVo orderVo,int userId) {
|
||||||
|
if(StrUtil.isEmpty(orderVo.getGoodsIds())){
|
||||||
|
throw new LightSecurityException("参数缺失");
|
||||||
|
}
|
||||||
|
String[] goddsArr = orderVo.getGoodsIds().split(",");
|
||||||
|
QueryWrapper<StoreCart> cartQueryWrapper = new QueryWrapper<>();
|
||||||
|
cartQueryWrapper.eq("user_id",userId).in("goods_id", Arrays.asList(goddsArr));
|
||||||
|
List<StoreCart> storeCarts = storeCartMapper.selectList(cartQueryWrapper);
|
||||||
|
System.out.println("storeCarts:"+storeCarts);
|
||||||
|
if(storeCarts.isEmpty()){
|
||||||
|
throw new LightSecurityException("购物车空空如也");
|
||||||
|
}
|
||||||
|
|
||||||
|
//计算商品总价
|
||||||
|
Double totalGoodsPrice = 0d;
|
||||||
|
|
||||||
|
for (StoreCart cart : storeCarts) {
|
||||||
|
int storeCount = checkStore(cart.getGoodsId(),cart.getSpecKey());
|
||||||
|
if(storeCount < cart.getGoodsNum()){
|
||||||
|
throw new LightSecurityException("库存不足");
|
||||||
|
}
|
||||||
|
|
||||||
|
// BigDecimal decimal = new BigDecimal();
|
||||||
|
totalGoodsPrice += cart.getGoodsPrice().doubleValue()*cart.getGoodsNum();
|
||||||
|
}
|
||||||
|
|
||||||
|
//插入主表
|
||||||
|
StoreOrder storeOrder = new StoreOrder();
|
||||||
|
storeOrder.setOrderSn(OrderUtil.orderSn());
|
||||||
|
storeOrder.setUserId(userId);
|
||||||
|
storeOrder.setReceiveType(2);
|
||||||
|
storeOrder.setGoodsPrice(BigDecimal.valueOf(totalGoodsPrice));
|
||||||
|
storeOrder.setTotalAmount(BigDecimal.valueOf(totalGoodsPrice));
|
||||||
|
//storeOrder.setAddTime(OrderUtil.getSecondTimestampTwo());
|
||||||
|
|
||||||
|
|
||||||
|
//处理收货
|
||||||
|
StoreMemberAddress address = storeMemberAddressMapper.selectById(orderVo.getAddressId());
|
||||||
|
if(address == null){
|
||||||
|
throw new LightSecurityException("地址不存在");
|
||||||
|
}
|
||||||
|
storeOrder.setConsignee(address.getUsername());
|
||||||
|
storeOrder.setCityInfo(address.getCityInfo());
|
||||||
|
storeOrder.setAddress(address.getAddress());
|
||||||
|
storeOrder.setMobile(address.getPhone());
|
||||||
|
//处理优惠券
|
||||||
|
if(StrUtil.isNotEmpty(orderVo.getCouponId())){
|
||||||
|
CouponDTO couponInfo = storeCouponMapper
|
||||||
|
.findLog(Integer.valueOf(orderVo.getCouponId()));
|
||||||
|
storeOrder.setCouponPrice(BigDecimal.valueOf(couponInfo.getMoney()));
|
||||||
|
storeOrder.setOrderAmount(BigDecimal
|
||||||
|
.valueOf((totalGoodsPrice - couponInfo.getMoney())));
|
||||||
|
updateCouponStatus(Integer.valueOf(orderVo.getCouponId()));
|
||||||
|
}else{
|
||||||
|
storeOrder.setOrderAmount(BigDecimal.valueOf(totalGoodsPrice));
|
||||||
|
}
|
||||||
|
|
||||||
|
//插入主表
|
||||||
|
if(baseMapper.insert(storeOrder) == 0) throw new LightSecurityException("操作失败");;
|
||||||
|
int orderId = storeOrder.getOrderId();
|
||||||
|
|
||||||
|
//副表
|
||||||
|
List<StoreOrderGoods> orderGoodsList = new ArrayList<>();
|
||||||
|
for (StoreCart cart : storeCarts) {
|
||||||
|
StoreOrderGoods orderGoods = new StoreOrderGoods();
|
||||||
|
orderGoods.setOrderId(orderId);
|
||||||
|
orderGoods.setGoodsId(cart.getGoodsId());
|
||||||
|
orderGoods.setGoodsSn(cart.getGoodsSn());
|
||||||
|
orderGoods.setGoodsName(cart.getGoodsName());
|
||||||
|
orderGoods.setMarketPrice(cart.getMarketPrice());
|
||||||
|
orderGoods.setGoodsPrice(cart.getGoodsPrice());
|
||||||
|
orderGoods.setGoodsNum(cart.getGoodsNum());
|
||||||
|
orderGoods.setSpecKey(cart.getSpecKey());
|
||||||
|
orderGoods.setSpecKeyName(cart.getSpecKeyName());
|
||||||
|
|
||||||
|
orderGoodsList.add(orderGoods);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!orderGoodsService.saveBatch(orderGoodsList)){
|
||||||
|
throw new LightSecurityException("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
//清空购物车
|
||||||
|
QueryWrapper<StoreCart> cartWrapper = new QueryWrapper<>();
|
||||||
|
cartWrapper.eq("user_id",userId).in("goods_id", Arrays.asList(goddsArr));
|
||||||
|
storeCartMapper.delete(cartWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return storeOrder.getOrderSn();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接提交订单
|
||||||
|
* @param orderVo
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String addOrderOfTwo(OrderVo orderVo, int userId) {
|
||||||
|
if(orderVo.getCartVO() == null){
|
||||||
|
throw new LightSecurityException("参数缺失");
|
||||||
|
}
|
||||||
|
|
||||||
|
CartVO cartVO = orderVo.getCartVO();
|
||||||
|
|
||||||
|
StoreGoods storeGoods = goodsService.getById(cartVO.getGoodsId());
|
||||||
|
if(storeGoods == null) throw new LightSecurityException("商品不存在");
|
||||||
|
|
||||||
|
//计算商品总价
|
||||||
|
Double totalGoodsPrice = 0d;
|
||||||
|
|
||||||
|
for (CartAttrVO attrVO : cartVO.getCartAttr()) {
|
||||||
|
int storeCount = checkStore(Integer.valueOf(cartVO.getGoodsId()),attrVO.getSpecKey());
|
||||||
|
if(storeCount < attrVO.getGoodsNum()){
|
||||||
|
throw new LightSecurityException("库存不足");
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryWrapper<StoreSpecGoodsPrice> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("goods_id",cartVO.getGoodsId()).eq("`key`",attrVO.getSpecKey());
|
||||||
|
StoreSpecGoodsPrice storeSpecGoodsPrice = storeSpecGoodsPriceMapper
|
||||||
|
.selectOne(wrapper);
|
||||||
|
totalGoodsPrice += storeSpecGoodsPrice.getPrice().doubleValue()*attrVO.getGoodsNum();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//插入主表
|
||||||
|
StoreOrder storeOrder = new StoreOrder();
|
||||||
|
storeOrder.setOrderSn(OrderUtil.orderSn());
|
||||||
|
storeOrder.setUserId(userId);
|
||||||
|
storeOrder.setReceiveType(2);
|
||||||
|
storeOrder.setGoodsPrice(BigDecimal.valueOf(totalGoodsPrice));
|
||||||
|
storeOrder.setTotalAmount(BigDecimal.valueOf(totalGoodsPrice));
|
||||||
|
|
||||||
|
|
||||||
|
//处理收货
|
||||||
|
StoreMemberAddress address = storeMemberAddressMapper.selectById(orderVo.getAddressId());
|
||||||
|
if(address == null){
|
||||||
|
throw new LightSecurityException("地址不存在");
|
||||||
|
}
|
||||||
|
storeOrder.setConsignee(address.getUsername());
|
||||||
|
storeOrder.setCityInfo(address.getCityInfo());
|
||||||
|
storeOrder.setAddress(address.getAddress());
|
||||||
|
storeOrder.setMobile(address.getPhone());
|
||||||
|
|
||||||
|
//处理优惠券
|
||||||
|
if(StrUtil.isNotEmpty(orderVo.getCouponId())){
|
||||||
|
CouponDTO couponInfo = storeCouponMapper
|
||||||
|
.findLog(Integer.valueOf(orderVo.getCouponId()));
|
||||||
|
storeOrder.setCouponPrice(BigDecimal.valueOf(couponInfo.getMoney()));
|
||||||
|
storeOrder.setOrderAmount(BigDecimal
|
||||||
|
.valueOf((totalGoodsPrice - couponInfo.getMoney())));
|
||||||
|
updateCouponStatus(Integer.valueOf(orderVo.getCouponId()));
|
||||||
|
}else{
|
||||||
|
storeOrder.setOrderAmount(BigDecimal.valueOf(totalGoodsPrice));
|
||||||
|
}
|
||||||
|
|
||||||
|
//插入主表
|
||||||
|
if(baseMapper.insert(storeOrder) == 0) throw new LightSecurityException("操作失败");;
|
||||||
|
int orderId = storeOrder.getOrderId();
|
||||||
|
|
||||||
|
//处理副表
|
||||||
|
List<StoreOrderGoods> orderGoodsList = new ArrayList<>();
|
||||||
|
for (CartAttrVO attrVO : cartVO.getCartAttr()) {
|
||||||
|
QueryWrapper<StoreSpecGoodsPrice> wrap = new QueryWrapper<>();
|
||||||
|
wrap.eq("goods_id",cartVO.getGoodsId()).eq("`key`",attrVO.getSpecKey());
|
||||||
|
StoreSpecGoodsPrice specGoodsPrice = storeSpecGoodsPriceMapper
|
||||||
|
.selectOne(wrap);
|
||||||
|
StoreOrderGoods orderGoods = new StoreOrderGoods();
|
||||||
|
orderGoods.setOrderId(orderId);
|
||||||
|
orderGoods.setGoodsId(storeGoods.getGoodsId());
|
||||||
|
orderGoods.setGoodsSn(storeGoods.getGoodsSn());
|
||||||
|
orderGoods.setGoodsName(storeGoods.getGoodsName());
|
||||||
|
orderGoods.setMarketPrice(BigDecimal.valueOf(specGoodsPrice.getMarketPrice()));
|
||||||
|
orderGoods.setGoodsPrice(specGoodsPrice.getPrice());
|
||||||
|
orderGoods.setGoodsNum(attrVO.getGoodsNum());
|
||||||
|
orderGoods.setSpecKey(attrVO.getSpecKey());
|
||||||
|
orderGoods.setSpecKeyName(specGoodsPrice.getKeyName());
|
||||||
|
|
||||||
|
orderGoodsList.add(orderGoods);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!orderGoodsService.saveBatch(orderGoodsList)){
|
||||||
|
throw new LightSecurityException("操作失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
return storeOrder.getOrderSn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int checkStore(int goodsId, String spec_key) {
|
||||||
|
QueryWrapper<StoreSpecGoodsPrice> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("`key`",spec_key)
|
||||||
|
.eq("goods_id", goodsId);
|
||||||
|
return storeSpecGoodsPriceMapper.selectOne(queryWrapper).getStoreCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateCouponStatus(int id) {
|
||||||
|
StoreCouponList storeCouponList = new StoreCouponList();
|
||||||
|
storeCouponList.setId(id);
|
||||||
|
storeCouponList.setUseTime(OrderUtil.getSecondTimestampTwo());
|
||||||
|
storeCouponList.setStatus(1);
|
||||||
|
storeCouponListMapper.updateById(storeCouponList);
|
||||||
|
storeCouponMapper.incUserNum(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.app.modular.shop.service.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OrderVo
|
||||||
|
* @Author hupeng <610796224@qq.com>
|
||||||
|
* @Date 2019/9/13
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrderVo {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String orderFrom; //订单来源1-购物车提交 2-直接提交
|
||||||
|
|
||||||
|
private String goodsIds; //order_from=1时候需要传购物车商品id字符串逗号隔开例如"5,6,7"
|
||||||
|
|
||||||
|
private CartVO cartVO; //order_from=2直接提交
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String addressId;
|
||||||
|
|
||||||
|
private String couponId;
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ public class EntityGenerator {
|
|||||||
StrategyConfig strategy = new StrategyConfig();
|
StrategyConfig strategy = new StrategyConfig();
|
||||||
//strategy.setTablePrefix(new String[]{"_"});// 此处可以修改为您的表前缀
|
//strategy.setTablePrefix(new String[]{"_"});// 此处可以修改为您的表前缀
|
||||||
strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
|
strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
|
||||||
strategy.setInclude(new String[]{"store_cart"});
|
strategy.setInclude(new String[]{"store_coupon","store_coupon_list"});
|
||||||
mpg.setStrategy(strategy);
|
mpg.setStrategy(strategy);
|
||||||
|
|
||||||
// 包配置
|
// 包配置
|
||||||
|
|||||||
Reference in new issue
Block a user