添加生成确认单接口
This commit is contained in:
parent
61a67c9aa9
commit
b33f396d53
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,30 @@
|
||||
package com.macro.mall.mapper;
|
||||
|
||||
import com.macro.mall.model.UmsIntegrationConsumeSetting;
|
||||
import com.macro.mall.model.UmsIntegrationConsumeSettingExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface UmsIntegrationConsumeSettingMapper {
|
||||
int countByExample(UmsIntegrationConsumeSettingExample example);
|
||||
|
||||
int deleteByExample(UmsIntegrationConsumeSettingExample example);
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(UmsIntegrationConsumeSetting record);
|
||||
|
||||
int insertSelective(UmsIntegrationConsumeSetting record);
|
||||
|
||||
List<UmsIntegrationConsumeSetting> selectByExample(UmsIntegrationConsumeSettingExample example);
|
||||
|
||||
UmsIntegrationConsumeSetting selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") UmsIntegrationConsumeSetting record, @Param("example") UmsIntegrationConsumeSettingExample example);
|
||||
|
||||
int updateByExample(@Param("record") UmsIntegrationConsumeSetting record, @Param("example") UmsIntegrationConsumeSettingExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(UmsIntegrationConsumeSetting record);
|
||||
|
||||
int updateByPrimaryKey(UmsIntegrationConsumeSetting record);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package com.macro.mall.mapper;
|
||||
|
||||
import com.macro.mall.model.UmsIntergrationConsumeSetting;
|
||||
import com.macro.mall.model.UmsIntergrationConsumeSettingExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface UmsIntergrationConsumeSettingMapper {
|
||||
int countByExample(UmsIntergrationConsumeSettingExample example);
|
||||
|
||||
int deleteByExample(UmsIntergrationConsumeSettingExample example);
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(UmsIntergrationConsumeSetting record);
|
||||
|
||||
int insertSelective(UmsIntergrationConsumeSetting record);
|
||||
|
||||
List<UmsIntergrationConsumeSetting> selectByExample(UmsIntergrationConsumeSettingExample example);
|
||||
|
||||
UmsIntergrationConsumeSetting selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") UmsIntergrationConsumeSetting record, @Param("example") UmsIntergrationConsumeSettingExample example);
|
||||
|
||||
int updateByExample(@Param("record") UmsIntergrationConsumeSetting record, @Param("example") UmsIntergrationConsumeSettingExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(UmsIntergrationConsumeSetting record);
|
||||
|
||||
int updateByPrimaryKey(UmsIntergrationConsumeSetting record);
|
||||
}
|
@ -44,6 +44,13 @@ public class OmsOrder implements Serializable {
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 应付金额(实际支付金额)
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 运费金额
|
||||
*
|
||||
@ -247,6 +254,13 @@ public class OmsOrder implements Serializable {
|
||||
*/
|
||||
private Integer confirmStatus;
|
||||
|
||||
/**
|
||||
* 删除状态:0->未删除;1->已删除
|
||||
*
|
||||
* @mbggenerated
|
||||
*/
|
||||
private Integer deleteStatus;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Long getId() {
|
||||
@ -305,6 +319,14 @@ public class OmsOrder implements Serializable {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPayAmount() {
|
||||
return payAmount;
|
||||
}
|
||||
|
||||
public void setPayAmount(BigDecimal payAmount) {
|
||||
this.payAmount = payAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFreightAmount() {
|
||||
return freightAmount;
|
||||
}
|
||||
@ -537,6 +559,14 @@ public class OmsOrder implements Serializable {
|
||||
this.confirmStatus = confirmStatus;
|
||||
}
|
||||
|
||||
public Integer getDeleteStatus() {
|
||||
return deleteStatus;
|
||||
}
|
||||
|
||||
public void setDeleteStatus(Integer deleteStatus) {
|
||||
this.deleteStatus = deleteStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@ -550,6 +580,7 @@ public class OmsOrder implements Serializable {
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", memberUsername=").append(memberUsername);
|
||||
sb.append(", totalAmount=").append(totalAmount);
|
||||
sb.append(", payAmount=").append(payAmount);
|
||||
sb.append(", freightAmount=").append(freightAmount);
|
||||
sb.append(", promotionAmount=").append(promotionAmount);
|
||||
sb.append(", integrationAmount=").append(integrationAmount);
|
||||
@ -579,6 +610,7 @@ public class OmsOrder implements Serializable {
|
||||
sb.append(", receiverDetailAddress=").append(receiverDetailAddress);
|
||||
sb.append(", note=").append(note);
|
||||
sb.append(", confirmStatus=").append(confirmStatus);
|
||||
sb.append(", deleteStatus=").append(deleteStatus);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
|
@ -546,6 +546,66 @@ public class OmsOrderExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountIsNull() {
|
||||
addCriterion("pay_amount is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountIsNotNull() {
|
||||
addCriterion("pay_amount is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountEqualTo(BigDecimal value) {
|
||||
addCriterion("pay_amount =", value, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountNotEqualTo(BigDecimal value) {
|
||||
addCriterion("pay_amount <>", value, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountGreaterThan(BigDecimal value) {
|
||||
addCriterion("pay_amount >", value, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("pay_amount >=", value, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountLessThan(BigDecimal value) {
|
||||
addCriterion("pay_amount <", value, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("pay_amount <=", value, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountIn(List<BigDecimal> values) {
|
||||
addCriterion("pay_amount in", values, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountNotIn(List<BigDecimal> values) {
|
||||
addCriterion("pay_amount not in", values, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("pay_amount between", value1, value2, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPayAmountNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("pay_amount not between", value1, value2, "payAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andFreightAmountIsNull() {
|
||||
addCriterion("freight_amount is null");
|
||||
return (Criteria) this;
|
||||
@ -2435,6 +2495,66 @@ public class OmsOrderExample {
|
||||
addCriterion("confirm_status not between", value1, value2, "confirmStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusIsNull() {
|
||||
addCriterion("delete_status is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusIsNotNull() {
|
||||
addCriterion("delete_status is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusEqualTo(Integer value) {
|
||||
addCriterion("delete_status =", value, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusNotEqualTo(Integer value) {
|
||||
addCriterion("delete_status <>", value, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusGreaterThan(Integer value) {
|
||||
addCriterion("delete_status >", value, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("delete_status >=", value, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusLessThan(Integer value) {
|
||||
addCriterion("delete_status <", value, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("delete_status <=", value, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusIn(List<Integer> values) {
|
||||
addCriterion("delete_status in", values, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusNotIn(List<Integer> values) {
|
||||
addCriterion("delete_status not in", values, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusBetween(Integer value1, Integer value2) {
|
||||
addCriterion("delete_status between", value1, value2, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDeleteStatusNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("delete_status not between", value1, value2, "deleteStatus");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
@ -2,7 +2,7 @@ package com.macro.mall.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UmsIntergrationConsumeSetting implements Serializable {
|
||||
public class UmsIntegrationConsumeSetting implements Serializable {
|
||||
private Long id;
|
||||
|
||||
/**
|
@ -3,14 +3,14 @@ package com.macro.mall.model;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UmsIntergrationConsumeSettingExample {
|
||||
public class UmsIntegrationConsumeSettingExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public UmsIntergrationConsumeSettingExample() {
|
||||
public UmsIntegrationConsumeSettingExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="member_username" jdbcType="VARCHAR" property="memberUsername" />
|
||||
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
||||
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
|
||||
<result column="freight_amount" jdbcType="DECIMAL" property="freightAmount" />
|
||||
<result column="promotion_amount" jdbcType="DECIMAL" property="promotionAmount" />
|
||||
<result column="integration_amount" jdbcType="DECIMAL" property="integrationAmount" />
|
||||
@ -38,6 +39,7 @@
|
||||
<result column="receiver_detail_address" jdbcType="VARCHAR" property="receiverDetailAddress" />
|
||||
<result column="note" jdbcType="VARCHAR" property="note" />
|
||||
<result column="confirm_status" jdbcType="INTEGER" property="confirmStatus" />
|
||||
<result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
@ -98,12 +100,12 @@
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, member_id, coupon_id, order_sn, create_time, member_username, total_amount, freight_amount,
|
||||
promotion_amount, integration_amount, coupon_amount, discount_amount, pay_type, source_type,
|
||||
status, order_type, delivery_company, delivery_sn, auto_confirm_day, integration,
|
||||
growth, promotion_info, bill_type, bill_header, bill_content, bill_receiver_phone,
|
||||
id, member_id, coupon_id, order_sn, create_time, member_username, total_amount, pay_amount,
|
||||
freight_amount, promotion_amount, integration_amount, coupon_amount, discount_amount,
|
||||
pay_type, source_type, status, order_type, delivery_company, delivery_sn, auto_confirm_day,
|
||||
integration, growth, promotion_info, bill_type, bill_header, bill_content, bill_receiver_phone,
|
||||
bill_receiver_email, receiver_name, receiver_phone, receiver_post_code, receiver_province,
|
||||
receiver_city, receiver_region, receiver_detail_address, note, confirm_status
|
||||
receiver_city, receiver_region, receiver_detail_address, note, confirm_status, delete_status
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderExample" resultMap="BaseResultMap">
|
||||
select
|
||||
@ -141,28 +143,30 @@
|
||||
</selectKey>
|
||||
insert into oms_order (member_id, coupon_id, order_sn,
|
||||
create_time, member_username, total_amount,
|
||||
freight_amount, promotion_amount, integration_amount,
|
||||
coupon_amount, discount_amount, pay_type,
|
||||
source_type, status, order_type,
|
||||
delivery_company, delivery_sn, auto_confirm_day,
|
||||
integration, growth, promotion_info,
|
||||
bill_type, bill_header, bill_content,
|
||||
bill_receiver_phone, bill_receiver_email, receiver_name,
|
||||
receiver_phone, receiver_post_code, receiver_province,
|
||||
receiver_city, receiver_region, receiver_detail_address,
|
||||
note, confirm_status)
|
||||
pay_amount, freight_amount, promotion_amount,
|
||||
integration_amount, coupon_amount, discount_amount,
|
||||
pay_type, source_type, status,
|
||||
order_type, delivery_company, delivery_sn,
|
||||
auto_confirm_day, integration, growth,
|
||||
promotion_info, bill_type, bill_header,
|
||||
bill_content, bill_receiver_phone, bill_receiver_email,
|
||||
receiver_name, receiver_phone, receiver_post_code,
|
||||
receiver_province, receiver_city, receiver_region,
|
||||
receiver_detail_address, note, confirm_status,
|
||||
delete_status)
|
||||
values (#{memberId,jdbcType=BIGINT}, #{couponId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{memberUsername,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL},
|
||||
#{freightAmount,jdbcType=DECIMAL}, #{promotionAmount,jdbcType=DECIMAL}, #{integrationAmount,jdbcType=DECIMAL},
|
||||
#{couponAmount,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{payType,jdbcType=INTEGER},
|
||||
#{sourceType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{orderType,jdbcType=INTEGER},
|
||||
#{deliveryCompany,jdbcType=VARCHAR}, #{deliverySn,jdbcType=VARCHAR}, #{autoConfirmDay,jdbcType=INTEGER},
|
||||
#{integration,jdbcType=INTEGER}, #{growth,jdbcType=INTEGER}, #{promotionInfo,jdbcType=VARCHAR},
|
||||
#{billType,jdbcType=INTEGER}, #{billHeader,jdbcType=VARCHAR}, #{billContent,jdbcType=VARCHAR},
|
||||
#{billReceiverPhone,jdbcType=VARCHAR}, #{billReceiverEmail,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR},
|
||||
#{receiverPhone,jdbcType=VARCHAR}, #{receiverPostCode,jdbcType=VARCHAR}, #{receiverProvince,jdbcType=VARCHAR},
|
||||
#{receiverCity,jdbcType=VARCHAR}, #{receiverRegion,jdbcType=VARCHAR}, #{receiverDetailAddress,jdbcType=VARCHAR},
|
||||
#{note,jdbcType=VARCHAR}, #{confirmStatus,jdbcType=INTEGER})
|
||||
#{payAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL}, #{promotionAmount,jdbcType=DECIMAL},
|
||||
#{integrationAmount,jdbcType=DECIMAL}, #{couponAmount,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL},
|
||||
#{payType,jdbcType=INTEGER}, #{sourceType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
|
||||
#{orderType,jdbcType=INTEGER}, #{deliveryCompany,jdbcType=VARCHAR}, #{deliverySn,jdbcType=VARCHAR},
|
||||
#{autoConfirmDay,jdbcType=INTEGER}, #{integration,jdbcType=INTEGER}, #{growth,jdbcType=INTEGER},
|
||||
#{promotionInfo,jdbcType=VARCHAR}, #{billType,jdbcType=INTEGER}, #{billHeader,jdbcType=VARCHAR},
|
||||
#{billContent,jdbcType=VARCHAR}, #{billReceiverPhone,jdbcType=VARCHAR}, #{billReceiverEmail,jdbcType=VARCHAR},
|
||||
#{receiverName,jdbcType=VARCHAR}, #{receiverPhone,jdbcType=VARCHAR}, #{receiverPostCode,jdbcType=VARCHAR},
|
||||
#{receiverProvince,jdbcType=VARCHAR}, #{receiverCity,jdbcType=VARCHAR}, #{receiverRegion,jdbcType=VARCHAR},
|
||||
#{receiverDetailAddress,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{confirmStatus,jdbcType=INTEGER},
|
||||
#{deleteStatus,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrder">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
@ -188,6 +192,9 @@
|
||||
<if test="totalAmount != null">
|
||||
total_amount,
|
||||
</if>
|
||||
<if test="payAmount != null">
|
||||
pay_amount,
|
||||
</if>
|
||||
<if test="freightAmount != null">
|
||||
freight_amount,
|
||||
</if>
|
||||
@ -275,6 +282,9 @@
|
||||
<if test="confirmStatus != null">
|
||||
confirm_status,
|
||||
</if>
|
||||
<if test="deleteStatus != null">
|
||||
delete_status,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="memberId != null">
|
||||
@ -295,6 +305,9 @@
|
||||
<if test="totalAmount != null">
|
||||
#{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="payAmount != null">
|
||||
#{payAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="freightAmount != null">
|
||||
#{freightAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@ -382,6 +395,9 @@
|
||||
<if test="confirmStatus != null">
|
||||
#{confirmStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="deleteStatus != null">
|
||||
#{deleteStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.macro.mall.model.OmsOrderExample" resultType="java.lang.Integer">
|
||||
@ -414,6 +430,9 @@
|
||||
<if test="record.totalAmount != null">
|
||||
total_amount = #{record.totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.payAmount != null">
|
||||
pay_amount = #{record.payAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.freightAmount != null">
|
||||
freight_amount = #{record.freightAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@ -501,6 +520,9 @@
|
||||
<if test="record.confirmStatus != null">
|
||||
confirm_status = #{record.confirmStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.deleteStatus != null">
|
||||
delete_status = #{record.deleteStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
@ -515,6 +537,7 @@
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
member_username = #{record.memberUsername,jdbcType=VARCHAR},
|
||||
total_amount = #{record.totalAmount,jdbcType=DECIMAL},
|
||||
pay_amount = #{record.payAmount,jdbcType=DECIMAL},
|
||||
freight_amount = #{record.freightAmount,jdbcType=DECIMAL},
|
||||
promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
|
||||
integration_amount = #{record.integrationAmount,jdbcType=DECIMAL},
|
||||
@ -543,7 +566,8 @@
|
||||
receiver_region = #{record.receiverRegion,jdbcType=VARCHAR},
|
||||
receiver_detail_address = #{record.receiverDetailAddress,jdbcType=VARCHAR},
|
||||
note = #{record.note,jdbcType=VARCHAR},
|
||||
confirm_status = #{record.confirmStatus,jdbcType=INTEGER}
|
||||
confirm_status = #{record.confirmStatus,jdbcType=INTEGER},
|
||||
delete_status = #{record.deleteStatus,jdbcType=INTEGER}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
@ -569,6 +593,9 @@
|
||||
<if test="totalAmount != null">
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="payAmount != null">
|
||||
pay_amount = #{payAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="freightAmount != null">
|
||||
freight_amount = #{freightAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
@ -656,6 +683,9 @@
|
||||
<if test="confirmStatus != null">
|
||||
confirm_status = #{confirmStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="deleteStatus != null">
|
||||
delete_status = #{deleteStatus,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
@ -667,6 +697,7 @@
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
member_username = #{memberUsername,jdbcType=VARCHAR},
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
pay_amount = #{payAmount,jdbcType=DECIMAL},
|
||||
freight_amount = #{freightAmount,jdbcType=DECIMAL},
|
||||
promotion_amount = #{promotionAmount,jdbcType=DECIMAL},
|
||||
integration_amount = #{integrationAmount,jdbcType=DECIMAL},
|
||||
@ -695,7 +726,8 @@
|
||||
receiver_region = #{receiverRegion,jdbcType=VARCHAR},
|
||||
receiver_detail_address = #{receiverDetailAddress,jdbcType=VARCHAR},
|
||||
note = #{note,jdbcType=VARCHAR},
|
||||
confirm_status = #{confirmStatus,jdbcType=INTEGER}
|
||||
confirm_status = #{confirmStatus,jdbcType=INTEGER},
|
||||
delete_status = #{deleteStatus,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
@ -1,7 +1,7 @@
|
||||
<?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.mapper.UmsIntergrationConsumeSettingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.macro.mall.model.UmsIntergrationConsumeSetting">
|
||||
<mapper namespace="com.macro.mall.mapper.UmsIntegrationConsumeSettingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.macro.mall.model.UmsIntegrationConsumeSetting">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="deduction_per_amount" jdbcType="INTEGER" property="deductionPerAmount" />
|
||||
<result column="max_percent_per_order" jdbcType="INTEGER" property="maxPercentPerOrder" />
|
||||
@ -69,13 +69,13 @@
|
||||
<sql id="Base_Column_List">
|
||||
id, deduction_per_amount, max_percent_per_order, use_unit, coupon_status
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.macro.mall.model.UmsIntergrationConsumeSettingExample" resultMap="BaseResultMap">
|
||||
<select id="selectByExample" parameterType="com.macro.mall.model.UmsIntegrationConsumeSettingExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from ums_intergration_consume_setting
|
||||
from ums_integration_consume_setting
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
@ -86,33 +86,33 @@
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from ums_intergration_consume_setting
|
||||
from ums_integration_consume_setting
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from ums_intergration_consume_setting
|
||||
delete from ums_integration_consume_setting
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.macro.mall.model.UmsIntergrationConsumeSettingExample">
|
||||
delete from ums_intergration_consume_setting
|
||||
<delete id="deleteByExample" parameterType="com.macro.mall.model.UmsIntegrationConsumeSettingExample">
|
||||
delete from ums_integration_consume_setting
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.macro.mall.model.UmsIntergrationConsumeSetting">
|
||||
<insert id="insert" parameterType="com.macro.mall.model.UmsIntegrationConsumeSetting">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ums_intergration_consume_setting (deduction_per_amount, max_percent_per_order,
|
||||
insert into ums_integration_consume_setting (deduction_per_amount, max_percent_per_order,
|
||||
use_unit, coupon_status)
|
||||
values (#{deductionPerAmount,jdbcType=INTEGER}, #{maxPercentPerOrder,jdbcType=INTEGER},
|
||||
#{useUnit,jdbcType=INTEGER}, #{couponStatus,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsIntergrationConsumeSetting">
|
||||
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsIntegrationConsumeSetting">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ums_intergration_consume_setting
|
||||
insert into ums_integration_consume_setting
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deductionPerAmount != null">
|
||||
deduction_per_amount,
|
||||
@ -142,14 +142,14 @@
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.macro.mall.model.UmsIntergrationConsumeSettingExample" resultType="java.lang.Integer">
|
||||
select count(*) from ums_intergration_consume_setting
|
||||
<select id="countByExample" parameterType="com.macro.mall.model.UmsIntegrationConsumeSettingExample" resultType="java.lang.Integer">
|
||||
select count(*) from ums_integration_consume_setting
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update ums_intergration_consume_setting
|
||||
update ums_integration_consume_setting
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
@ -172,7 +172,7 @@
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update ums_intergration_consume_setting
|
||||
update ums_integration_consume_setting
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
deduction_per_amount = #{record.deductionPerAmount,jdbcType=INTEGER},
|
||||
max_percent_per_order = #{record.maxPercentPerOrder,jdbcType=INTEGER},
|
||||
@ -182,8 +182,8 @@
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.UmsIntergrationConsumeSetting">
|
||||
update ums_intergration_consume_setting
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.UmsIntegrationConsumeSetting">
|
||||
update ums_integration_consume_setting
|
||||
<set>
|
||||
<if test="deductionPerAmount != null">
|
||||
deduction_per_amount = #{deductionPerAmount,jdbcType=INTEGER},
|
||||
@ -200,8 +200,8 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.UmsIntergrationConsumeSetting">
|
||||
update ums_intergration_consume_setting
|
||||
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.UmsIntegrationConsumeSetting">
|
||||
update ums_integration_consume_setting
|
||||
set deduction_per_amount = #{deductionPerAmount,jdbcType=INTEGER},
|
||||
max_percent_per_order = #{maxPercentPerOrder,jdbcType=INTEGER},
|
||||
use_unit = #{useUnit,jdbcType=INTEGER},
|
@ -0,0 +1,31 @@
|
||||
package com.macro.mall.portal.controller;
|
||||
|
||||
import com.macro.mall.portal.domain.CommonResult;
|
||||
import com.macro.mall.portal.domain.ConfirmOrderResult;
|
||||
import com.macro.mall.portal.service.OmsPortalOrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 订单管理Controller
|
||||
* Created by macro on 2018/8/30.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "OmsPortalOrderController",description = "订单管理")
|
||||
@RequestMapping("/order")
|
||||
public class OmsPortalOrderController {
|
||||
@Autowired
|
||||
private OmsPortalOrderService portalOrderService;
|
||||
@ApiOperation("根据购物车信息生成确认单信息")
|
||||
@RequestMapping(value = "confirmOrder",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object confirmOrder(){
|
||||
ConfirmOrderResult confirmOrderResult = portalOrderService.generateConfirmOrder();
|
||||
return new CommonResult().success(confirmOrderResult);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.macro.mall.portal.domain;
|
||||
|
||||
import com.macro.mall.model.UmsIntegrationConsumeSetting;
|
||||
import com.macro.mall.model.UmsMemberReceiveAddress;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 确认单信息封装
|
||||
* Created by macro on 2018/8/30.
|
||||
*/
|
||||
public class ConfirmOrderResult {
|
||||
//包含优惠信息的购物车信息
|
||||
private List<CartPromotionItem> cartPromotionItemList;
|
||||
//用户收货地址列表
|
||||
private List<UmsMemberReceiveAddress> memberReceiveAddressList;
|
||||
//用户可用优惠券列表
|
||||
private List<SmsCouponHistoryDetail> couponHistoryDetailList;
|
||||
//积分使用规则
|
||||
private UmsIntegrationConsumeSetting integrationConsumeSetting;
|
||||
//会员持有的积分
|
||||
private Integer memberIntegration;
|
||||
//计算的金额
|
||||
private CalcAmount calcAmount;
|
||||
|
||||
public List<CartPromotionItem> getCartPromotionItemList() {
|
||||
return cartPromotionItemList;
|
||||
}
|
||||
|
||||
public void setCartPromotionItemList(List<CartPromotionItem> cartPromotionItemList) {
|
||||
this.cartPromotionItemList = cartPromotionItemList;
|
||||
}
|
||||
|
||||
public List<UmsMemberReceiveAddress> getMemberReceiveAddressList() {
|
||||
return memberReceiveAddressList;
|
||||
}
|
||||
|
||||
public void setMemberReceiveAddressList(List<UmsMemberReceiveAddress> memberReceiveAddressList) {
|
||||
this.memberReceiveAddressList = memberReceiveAddressList;
|
||||
}
|
||||
|
||||
public List<SmsCouponHistoryDetail> getCouponHistoryDetailList() {
|
||||
return couponHistoryDetailList;
|
||||
}
|
||||
|
||||
public void setCouponHistoryDetailList(List<SmsCouponHistoryDetail> couponHistoryDetailList) {
|
||||
this.couponHistoryDetailList = couponHistoryDetailList;
|
||||
}
|
||||
|
||||
public UmsIntegrationConsumeSetting getIntegrationConsumeSetting() {
|
||||
return integrationConsumeSetting;
|
||||
}
|
||||
|
||||
public void setIntegrationConsumeSetting(UmsIntegrationConsumeSetting integrationConsumeSetting) {
|
||||
this.integrationConsumeSetting = integrationConsumeSetting;
|
||||
}
|
||||
|
||||
public Integer getMemberIntegration() {
|
||||
return memberIntegration;
|
||||
}
|
||||
|
||||
public void setMemberIntegration(Integer memberIntegration) {
|
||||
this.memberIntegration = memberIntegration;
|
||||
}
|
||||
|
||||
public CalcAmount getCalcAmount() {
|
||||
return calcAmount;
|
||||
}
|
||||
|
||||
public void setCalcAmount(CalcAmount calcAmount) {
|
||||
this.calcAmount = calcAmount;
|
||||
}
|
||||
|
||||
public static class CalcAmount{
|
||||
//订单商品总金额
|
||||
private BigDecimal totalAmount;
|
||||
//运费
|
||||
private BigDecimal freightAmount;
|
||||
//活动优惠
|
||||
private BigDecimal promotionAmount;
|
||||
//应付金额
|
||||
private BigDecimal payAmount;
|
||||
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
public void setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFreightAmount() {
|
||||
return freightAmount;
|
||||
}
|
||||
|
||||
public void setFreightAmount(BigDecimal freightAmount) {
|
||||
this.freightAmount = freightAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPromotionAmount() {
|
||||
return promotionAmount;
|
||||
}
|
||||
|
||||
public void setPromotionAmount(BigDecimal promotionAmount) {
|
||||
this.promotionAmount = promotionAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPayAmount() {
|
||||
return payAmount;
|
||||
}
|
||||
|
||||
public void setPayAmount(BigDecimal payAmount) {
|
||||
this.payAmount = payAmount;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.macro.mall.portal.service;
|
||||
|
||||
import com.macro.mall.portal.domain.ConfirmOrderResult;
|
||||
|
||||
/**
|
||||
* 前台订单管理Service
|
||||
* Created by macro on 2018/8/30.
|
||||
*/
|
||||
public interface OmsPortalOrderService {
|
||||
/**
|
||||
* 根据用户购物车信息生成确认单信息
|
||||
*/
|
||||
ConfirmOrderResult generateConfirmOrder();
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.macro.mall.portal.service.impl;
|
||||
|
||||
import com.macro.mall.mapper.UmsIntegrationConsumeSettingMapper;
|
||||
import com.macro.mall.model.UmsIntegrationConsumeSetting;
|
||||
import com.macro.mall.model.UmsMember;
|
||||
import com.macro.mall.model.UmsMemberReceiveAddress;
|
||||
import com.macro.mall.portal.domain.CartPromotionItem;
|
||||
import com.macro.mall.portal.domain.ConfirmOrderResult;
|
||||
import com.macro.mall.portal.domain.SmsCouponHistoryDetail;
|
||||
import com.macro.mall.portal.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前台订单管理Service
|
||||
* Created by macro on 2018/8/30.
|
||||
*/
|
||||
@Service
|
||||
public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
|
||||
@Autowired
|
||||
private UmsMemberService memberService;
|
||||
@Autowired
|
||||
private OmsCartItemService cartItemService;
|
||||
@Autowired
|
||||
private UmsMemberReceiveAddressService memberReceiveAddressService;
|
||||
@Autowired
|
||||
private UmsMemberCouponService memberCouponService;
|
||||
@Autowired
|
||||
private UmsIntegrationConsumeSettingMapper integrationConsumeSettingMapper;
|
||||
@Override
|
||||
public ConfirmOrderResult generateConfirmOrder() {
|
||||
ConfirmOrderResult result = new ConfirmOrderResult();
|
||||
//获取购物车信息
|
||||
UmsMember currentMember = memberService.getCurrentMember();
|
||||
List<CartPromotionItem> cartPromotionItemList = cartItemService.listPromotion(currentMember.getId());
|
||||
result.setCartPromotionItemList(cartPromotionItemList);
|
||||
//获取用户收货地址列表
|
||||
List<UmsMemberReceiveAddress> memberReceiveAddressList = memberReceiveAddressService.list();
|
||||
result.setMemberReceiveAddressList(memberReceiveAddressList);
|
||||
//获取用户可用优惠券列表
|
||||
List<SmsCouponHistoryDetail> couponHistoryDetailList = memberCouponService.listCart(cartPromotionItemList, 1);
|
||||
result.setCouponHistoryDetailList(couponHistoryDetailList);
|
||||
//获取用户积分
|
||||
result.setMemberIntegration(currentMember.getIntegration());
|
||||
//获取积分使用规则
|
||||
UmsIntegrationConsumeSetting integrationConsumeSetting = integrationConsumeSettingMapper.selectByPrimaryKey(1L);
|
||||
result.setIntegrationConsumeSetting(integrationConsumeSetting);
|
||||
//计算总金额、活动优惠、应付金额
|
||||
ConfirmOrderResult.CalcAmount calcAmount = calcCartAmount(cartPromotionItemList);
|
||||
result.setCalcAmount(calcAmount);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算购物车中商品的价格
|
||||
*/
|
||||
private ConfirmOrderResult.CalcAmount calcCartAmount(List<CartPromotionItem> cartPromotionItemList) {
|
||||
ConfirmOrderResult.CalcAmount calcAmount = new ConfirmOrderResult.CalcAmount();
|
||||
calcAmount.setFreightAmount(new BigDecimal(0));
|
||||
BigDecimal totalAmount = new BigDecimal("0");
|
||||
BigDecimal promotionAmount = new BigDecimal("0");
|
||||
for (CartPromotionItem cartPromotionItem : cartPromotionItemList) {
|
||||
totalAmount=totalAmount.add(cartPromotionItem.getPrice().multiply(new BigDecimal(cartPromotionItem.getQuantity())));
|
||||
promotionAmount=promotionAmount.add(cartPromotionItem.getReduceAmount().multiply(new BigDecimal(cartPromotionItem.getQuantity())));
|
||||
}
|
||||
calcAmount.setTotalAmount(totalAmount);
|
||||
calcAmount.setPromotionAmount(promotionAmount);
|
||||
calcAmount.setPayAmount(totalAmount.subtract(promotionAmount));
|
||||
return calcAmount;
|
||||
}
|
||||
|
||||
}
|
@ -45,7 +45,8 @@ public class OmsPromotionServiceImpl implements OmsPromotionService {
|
||||
BeanUtils.copyProperties(item,cartPromotionItem);
|
||||
cartPromotionItem.setPromotionMessage("单品促销");
|
||||
//商品原价-促销价
|
||||
cartPromotionItem.setReduceAmount(getOriginalPrice(promotionProduct, item.getProductSkuId()).subtract(getSinglePromotionPrice(promotionProduct, item.getProductSkuId())));
|
||||
BigDecimal originalPrice = getOriginalPrice(promotionProduct, item.getProductSkuId());
|
||||
cartPromotionItem.setReduceAmount(originalPrice.subtract(getSinglePromotionPrice(promotionProduct, item.getProductSkuId())));
|
||||
cartPromotionItemList.add(cartPromotionItem);
|
||||
}
|
||||
} else if (promotionType == 3) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user