Przeglądaj źródła

[砍价][修改]:order添加couponChannel信息

release_toaliyun_real
Stormeye Wu 7 lat temu
rodzic
commit
043848a92e
6 zmienionych plików z 47 dodań i 14 usunięć
  1. +1
    -1
      mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java
  2. +13
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxOrderService.java
  5. +3
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  6. +26
    -9
      mallinkService/src/main/resources/mapper/WxOrderMapper.xml

+ 1
- 1
mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java Wyświetl plik

@@ -74,7 +74,7 @@ public class WxOrderController extends BaseController {
WxOrder order = null; WxOrder order = null;


try { try {
order = wxOrderService.saveFreeCouponOrder(user.getId(), couponId);
order = wxOrderService.saveFreeCouponOrder(user.getId(), couponChannelId, couponId);
return new ResultData(order); return new ResultData(order);
} catch (MallinkException e) { } catch (MallinkException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());


+ 13
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java Wyświetl plik

@@ -57,7 +57,9 @@ public class WxOrder implements Serializable {
/**c端用户id**/ /**c端用户id**/
@io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId")
private Long cUserId; private Long cUserId;

/**渠道ID**/
@io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId")
private Long couponChannelId;
/**产品ID,根据order type**/ /**产品ID,根据order type**/
@io.swagger.annotations.ApiModelProperty(value="产品ID",name="productId") @io.swagger.annotations.ApiModelProperty(value="产品ID",name="productId")
private Long productId; private Long productId;
@@ -178,7 +180,15 @@ public class WxOrder implements Serializable {
this.cUserId = cUserId; this.cUserId = cUserId;
} }


public Long getProductId() {
public Long getCouponChannelId() {
return couponChannelId;
}

public void setCouponChannelId(Long couponChannelId) {
this.couponChannelId = couponChannelId;
}

public Long getProductId() {
return productId; return productId;
} }


@@ -234,6 +244,7 @@ public class WxOrder implements Serializable {
,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC") ,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC")
,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC") ,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC")
,BUserId_ASC("`b_user_id` ASC"),BUserId_DESC("`b_user_id` DESC") ,BUserId_ASC("`b_user_id` ASC"),BUserId_DESC("`b_user_id` DESC")
,CouponChannelId_ASC("`coupon_channel_id` ASC"),CouponChannelId_DESC("`coupon_channel_id` DESC")
,ProductId_ASC("`product_id` ASC"),ProductId_DESC("`product_id` DESC") ,ProductId_ASC("`product_id` ASC"),ProductId_DESC("`product_id` DESC")
,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC")
,PaymentType_ASC("`payment_type` ASC"),PaymentType_DESC("`payment_type` DESC") ,PaymentType_ASC("`payment_type` ASC"),PaymentType_DESC("`payment_type` DESC")


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java Wyświetl plik

@@ -37,6 +37,9 @@ public class WxOrderCouponVo {
private Long cUserId; private Long cUserId;


/*商户ID**/ /*商户ID**/
/**渠道ID**/
@io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId")
private Long couponChannelId;
/*产品ID**/ /*产品ID**/
@io.swagger.annotations.ApiModelProperty(value="产品ID",name="productId") @io.swagger.annotations.ApiModelProperty(value="产品ID",name="productId")
private Long productId; private Long productId;


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxOrderService.java Wyświetl plik

@@ -65,7 +65,7 @@ public interface WxOrderService {
* @param couponId * @param couponId
* @return WxOrder * @return WxOrder
*/ */
WxOrder saveFreeCouponOrder(Long userId, Long couponId);
WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId);


/** /**
* 免费券订单接口 * 免费券订单接口


+ 3
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Wyświetl plik

@@ -365,6 +365,7 @@ public class WxOrderServiceImpl implements WxOrderService {
record.setId(orderNumber); record.setId(orderNumber);
record.setTenantId(user.getTenantId()); record.setTenantId(user.getTenantId());
record.setOrderNumber(orderNumber); record.setOrderNumber(orderNumber);
record.setCouponChannelId(couponChannelId);
record.setProductId(couponId); record.setProductId(couponId);
record.setType(EnumOrderType.COUPON.getCode()); record.setType(EnumOrderType.COUPON.getCode());
record.setcUserId(user.getId()); record.setcUserId(user.getId());
@@ -628,7 +629,7 @@ public class WxOrderServiceImpl implements WxOrderService {


@Override @Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public WxOrder saveFreeCouponOrder(Long userId, Long couponId) {
public WxOrder saveFreeCouponOrder(Long userId, Long couponChannelId, Long couponId) {
// check 用户状态 // check 用户状态
WxCUser user = null; WxCUser user = null;
try { try {
@@ -680,6 +681,7 @@ public class WxOrderServiceImpl implements WxOrderService {
record.setId(orderNumber); record.setId(orderNumber);
record.setTenantId(user.getTenantId()); record.setTenantId(user.getTenantId());
record.setOrderNumber(orderNumber); record.setOrderNumber(orderNumber);
record.setCouponChannelId(couponChannelId);
record.setProductId(couponId); record.setProductId(couponId);
record.setType(EnumOrderType.COUPON.getCode()); record.setType(EnumOrderType.COUPON.getCode());
record.setcUserId(user.getId()); record.setcUserId(user.getId());


+ 26
- 9
mallinkService/src/main/resources/mapper/WxOrderMapper.xml Wyświetl plik

@@ -6,6 +6,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> <result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/> <result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="type" jdbcType="TINYINT" property="type"/> <result column="type" jdbcType="TINYINT" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> <result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -21,7 +22,7 @@
</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
`id`,`order_number`,`tenant_id`,`c_user_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`,
`id`,`order_number`,`tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`,
`press_end_date`,`press_current_num`,`press_current_value` `press_end_date`,`press_current_num`,`press_current_value`
</sql> </sql>


@@ -44,6 +45,10 @@
and `c_user_id` = #{cUserId} and `c_user_id` = #{cUserId}
</if> </if>


<if test=" null != couponChannelId ">
and `coupon_channel_id` = #{couponChannelId}
</if>

<if test=" null != productId "> <if test=" null != productId ">
and `product_id` = #{productId} and `product_id` = #{productId}
</if> </if>
@@ -122,6 +127,9 @@
<if test=" null != cUserId "> <if test=" null != cUserId ">
and `c_user_id` = #{cUserId} and `c_user_id` = #{cUserId}
</if> </if>
<if test=" null != couponChannelId ">
and `coupon_channel_id` = #{couponChannelId}
</if>
<if test=" null != productId "> <if test=" null != productId ">
and `product_id` = #{productId} and `product_id` = #{productId}
</if> </if>
@@ -165,14 +173,14 @@




<sql id="allCUserOrderListColumns"> <sql id="allCUserOrderListColumns">
o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date,
o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date,
c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit, c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,
cal.channel_type as send_channel_type cal.channel_type as send_channel_type
</sql> </sql>




<sql id="allCUserOrderDetailColumns"> <sql id="allCUserOrderDetailColumns">
o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date,
o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date,
c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.detail,c.remark, c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.detail,c.remark,
co.id as coupon_order_id,co.coupon_order_status co.id as coupon_order_id,co.coupon_order_status
</sql> </sql>
@@ -183,6 +191,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> <result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/> <result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> <result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
<result column="payment" jdbcType="INTEGER" property="payment"/> <result column="payment" jdbcType="INTEGER" property="payment"/>
@@ -274,6 +283,10 @@
and bu.`id` = #{bUserId} and bu.`id` = #{bUserId}
</if> </if>


<if test=" null != couponChannelId ">
and o.`coupon_channel_id` = #{couponChannelId}
</if>

<if test=" null != productId "> <if test=" null != productId ">
and o.`product_id` = #{productId} and o.`product_id` = #{productId}
</if> </if>
@@ -292,6 +305,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> <result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/> <result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="type" jdbcType="TINYINT" property="type"/> <result column="type" jdbcType="TINYINT" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> <result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -312,7 +326,7 @@
</resultMap> </resultMap>


<sql id="allPayOrderColumns"> <sql id="allPayOrderColumns">
o.`id`,o.`order_number`,o.`tenant_id`,o.`c_user_id`,o.`product_id`,o.`type`,
o.`id`,o.`order_number`,o.`tenant_id`,o.`c_user_id`,o.`coupon_channel_id`,o.`product_id`,o.`type`,
o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`, o.`payment_type`,o.`payment`,o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,o.`detail`,
m.name as merchant_name, bu.name, bu.phone as bphone, m.name as merchant_name, bu.name, bu.phone as bphone,
cu.phone, cu.nick_name, cubi.name c_user_name cu.phone, cu.nick_name, cubi.name c_user_name
@@ -438,6 +452,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> <result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/> <result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="type" jdbcType="TINYINT" property="type"/> <result column="type" jdbcType="TINYINT" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> <result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -456,7 +471,7 @@
<select id="findListOrder" resultMap="orderMap" parameterType="com.iformall.domain.vo.WxOrderQueryVo"> <select id="findListOrder" resultMap="orderMap" parameterType="com.iformall.domain.vo.WxOrderQueryVo">
select o.* from ( select o.* from (
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time,
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time,
o.order_status,o.create_date,o.update_date,o.detail,'[多商户交易]' merchant_name,cubi.`name` c_user_name,cubi.phone o.order_status,o.create_date,o.update_date,o.detail,'[多商户交易]' merchant_name,cubi.`name` c_user_name,cubi.phone
from from
( (
@@ -465,7 +480,7 @@
on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o on o.product_id=cm.product_id group by o.id having count(o.id)>1)) o
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id
union all union all
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time,
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time,
o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone
from( from(
select o.*,cm.merchant_id from ( select o.*,cm.merchant_id from (
@@ -481,7 +496,7 @@
left join wx_merchant m on o.merchant_id=m.id left join wx_merchant m on o.merchant_id=m.id
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id
union all union all
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time,
select o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.type,o.payment_type,o.payment,o.payment_time,
o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone o.order_status,o.create_date,o.update_date,o.detail,m.`name` merchant_name,cubi.`name` c_user_name,cubi.phone
from wx_order o left join wx_merchant m on o.product_id=m.id from wx_order o left join wx_merchant m on o.product_id=m.id
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id
@@ -558,6 +573,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> <result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/> <result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="type" jdbcType="INTEGER" property="type"/> <result column="type" jdbcType="INTEGER" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> <result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -592,6 +608,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/> <result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="coupon_channel_id" jdbcType="BIGINT" property="couponChannelId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/> <result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="type" jdbcType="INTEGER" property="type"/> <result column="type" jdbcType="INTEGER" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/> <result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -627,13 +644,13 @@
</resultMap> </resultMap>


<sql id="allOrderPressListColumns"> <sql id="allOrderPressListColumns">
o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,
o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,
o.create_date,o.update_date,o.press_end_date,o.press_current_num,o.press_current_value, o.create_date,o.update_date,o.press_end_date,o.press_current_num,o.press_current_value,
c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.press_limit_num c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.press_limit_num
</sql> </sql>


<sql id="allOrderPressDetailColumns"> <sql id="allOrderPressDetailColumns">
o.id,o.order_number,o.tenant_id,o.c_user_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,
o.id,o.order_number,o.tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,
o.create_date,o.update_date,o.press_end_date,o.press_current_num,o.press_current_value, o.create_date,o.update_date,o.press_end_date,o.press_current_num,o.press_current_value,
c.type as coupon_type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.detail,c.remark,c.press_limit_num, c.type as coupon_type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.detail,c.remark,c.press_limit_num,
co.id as coupon_order_id,co.coupon_order_status co.id as coupon_order_id,co.coupon_order_status


Ładowanie…
Anuluj
Zapisz