From 043848a92e4db8ef376469844d780655f31227f0 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Thu, 17 Jan 2019 14:32:12 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=A0=8D=E4=BB=B7][=E4=BF=AE=E6=94=B9]:order?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0couponChannel=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxOrderController.java | 2 +- .../java/com/iformall/domain/po/WxOrder.java | 15 ++++++-- .../iformall/domain/vo/WxOrderCouponVo.java | 3 ++ .../com/iformall/service/WxOrderService.java | 2 +- .../service/impl/WxOrderServiceImpl.java | 4 ++- .../main/resources/mapper/WxOrderMapper.xml | 35 ++++++++++++++----- 6 files changed, 47 insertions(+), 14 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index 8dfd6c70f..2140b705a 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/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()); diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java b/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java index 098386931..8b5c38f48 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java +++ b/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") diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java index b83cc87b6..d0f6d99c4 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java +++ b/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; diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java index 5e455cf45..0bafae37e 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java +++ b/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); /** * 免费券订单接口 diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 552108dfb..f8ba508f8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/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()); diff --git a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml index fd54bf1c9..63096ed86 100644 --- a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml @@ -6,6 +6,7 @@ + @@ -21,7 +22,7 @@ - `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` @@ -44,6 +45,10 @@ and `c_user_id` = #{cUserId} + + and `coupon_channel_id` = #{couponChannelId} + + and `product_id` = #{productId} @@ -122,6 +127,9 @@ and `c_user_id` = #{cUserId} + + and `coupon_channel_id` = #{couponChannelId} + and `product_id` = #{productId} @@ -165,14 +173,14 @@ - 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 - 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 @@ -183,6 +191,7 @@ + @@ -274,6 +283,10 @@ and bu.`id` = #{bUserId} + + and o.`coupon_channel_id` = #{couponChannelId} + + and o.`product_id` = #{productId} @@ -292,6 +305,7 @@ + @@ -312,7 +326,7 @@ - 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 @@ + @@ -456,7 +471,7 @@