Преглед изворни кода

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

release_toaliyun_real
Stormeye Wu пре 7 година
родитељ
комит
043848a92e
6 измењених фајлова са 47 додато и 14 уклоњено
  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 Прегледај датотеку

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

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


+ 13
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java Прегледај датотеку

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

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

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

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

public Long getProductId() {
return productId;
}

@@ -234,6 +244,7 @@ public class WxOrder implements Serializable {
,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC")
,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_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")
,Type_ASC("`type` ASC"),Type_DESC("`type` DESC")
,PaymentType_ASC("`payment_type` ASC"),PaymentType_DESC("`payment_type` DESC")


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java Прегледај датотеку

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

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


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxOrderService.java Прегледај датотеку

@@ -65,7 +65,7 @@ public interface WxOrderService {
* @param couponId
* @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 Прегледај датотеку

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

@Override
@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 用户状态
WxCUser user = null;
try {
@@ -680,6 +681,7 @@ public class WxOrderServiceImpl implements WxOrderService {
record.setId(orderNumber);
record.setTenantId(user.getTenantId());
record.setOrderNumber(orderNumber);
record.setCouponChannelId(couponChannelId);
record.setProductId(couponId);
record.setType(EnumOrderType.COUPON.getCode());
record.setcUserId(user.getId());


+ 26
- 9
mallinkService/src/main/resources/mapper/WxOrderMapper.xml Прегледај датотеку

@@ -6,6 +6,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<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="type" jdbcType="TINYINT" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -21,7 +22,7 @@
</resultMap>

<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`
</sql>

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

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

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


<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,
cal.channel_type as send_channel_type
</sql>


<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,
co.id as coupon_order_id,co.coupon_order_status
</sql>
@@ -183,6 +191,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<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="payment_type" jdbcType="INTEGER" property="paymentType"/>
<result column="payment" jdbcType="INTEGER" property="payment"/>
@@ -274,6 +283,10 @@
and bu.`id` = #{bUserId}
</if>

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

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

<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`,
m.name as merchant_name, bu.name, bu.phone as bphone,
cu.phone, cu.nick_name, cubi.name c_user_name
@@ -438,6 +452,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<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="type" jdbcType="TINYINT" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -456,7 +471,7 @@
<select id="findListOrder" resultMap="orderMap" parameterType="com.iformall.domain.vo.WxOrderQueryVo">
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
from
(
@@ -465,7 +480,7 @@
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
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
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_c_user_basic_info cubi on o.c_user_id=cubi.id
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
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
@@ -558,6 +573,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<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="type" jdbcType="INTEGER" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -592,6 +608,7 @@
<result column="order_number" jdbcType="BIGINT" property="orderNumber"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<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="type" jdbcType="INTEGER" property="type"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -627,13 +644,13 @@
</resultMap>

<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,
c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.press_limit_num
</sql>

<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,
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


Loading…
Откажи
Сачувај