From a3ed8459b7f90789f9fc2dca850d7356db771452 Mon Sep 17 00:00:00 2001 From: xhxu Date: Tue, 12 Oct 2021 20:03:58 +0800 Subject: [PATCH] update gift --- .../java/com/iformall/domain/po/WxOrder.java | 2 +- .../iformall/domain/vo/WxCouponOrderBVo.java | 4 +-- .../enums/EnumMerchantSubsidySource.java | 4 ++- .../helper/WxCUserTagsServiceHelper.java | 2 +- .../impl/WxCouponOrderServiceImpl.java | 6 ++++ .../main/resources/mapper/WxOrderMapper.xml | 28 +++++++++++++++++-- 6 files changed, 39 insertions(+), 7 deletions(-) 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 8ae6b5681..f7f4a0971 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java @@ -116,7 +116,7 @@ public class WxOrder extends TenantEntity { @TableField(exist = false) private String title; - @Excel(name = "商品属性", width = 20, orderNum = "4", replace = {"消费卡_1", "优惠券_2", "砍价_3", "拼团_4","可配送商品_5", " _-1"}) + @Excel(name = "商品属性", width = 20, orderNum = "4", replace = {"消费卡_1", "优惠券_2", "砍价_3", "拼团_4","可配送商品_6","券礼包_7", " _-1"}) @TableField(exist = false) private Integer attribute; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java index 79a4e4d23..179ad8941 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java @@ -93,7 +93,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { @io.swagger.annotations.ApiModelProperty(value="面额",name="price") private Integer price; - @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10"}) + @Excel(name = "所属业态", width = 50, orderNum = "11", replace = {"餐饮_1", "娱乐_2", "服饰_3", "亲子_4", "超市_5", "其它_6", "美妆_7", "珠宝_8", "服务_9", "家居_10", "其它_"}) @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") private Integer business; @@ -189,7 +189,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { @TableField(exist = false) private Long couponId; - @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "积分券_50", "积分停车券_51", "消费卡_100"}) + @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "券礼包_12", "积分券_50", "积分停车券_51", "消费卡_100"}) @TableField(exist = false) private Integer couponType; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMerchantSubsidySource.java b/mallinkService/src/main/java/com/iformall/enums/EnumMerchantSubsidySource.java index 7c4ebd164..040c4e122 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumMerchantSubsidySource.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMerchantSubsidySource.java @@ -10,7 +10,9 @@ public enum EnumMerchantSubsidySource { COUPON(2, "券核销"), PRESS(3, "砍价核销"), GROUP(4, "拼团核销"), - CASHIER(5, "收银台"),; + CASHIER(5, "收银台"), + DISTRIBUTION_GOODS(6, "可配送商品"), + GIFT_BAG(7, "券订单"),; public static EnumMerchantSubsidySource getEnum(Integer code) { for (EnumMerchantSubsidySource value : values()) { diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxCUserTagsServiceHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxCUserTagsServiceHelper.java index 5a3cbc45a..382eaa772 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxCUserTagsServiceHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxCUserTagsServiceHelper.java @@ -368,7 +368,7 @@ public class WxCUserTagsServiceHelper{ int count = 0; if(cardSpendCountList.size() > 0) { for (Map cardSpendCount : cardSpendCountList) { - if (cardSpendCount.get("businessId").equals(b.getId().toString())) { + if (cardSpendCount.get("business_id").equals(b.getId().toString())) { count += (Integer) cardSpendCount.get("buCount"); } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index ecbb9c2b8..2a7bbb2bb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -767,6 +767,12 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { && couponOrder.getCouponPrice().equals(wxCoupon.getSalePrice())) { //拼团 merchantSubsidy.setSource(EnumMerchantSubsidySource.GROUP.getCode()); + } else if(couponOrder.getCouponType().equals(EnumCouponType.COUPON_DISTRIBUTION.getCode())){ + //可配送商品 + merchantSubsidy.setSource(EnumMerchantSubsidySource.DISTRIBUTION_GOODS.getCode()); + } else if(couponOrder.getCouponType().equals(EnumCouponType.COUPON_GIFT.getCode())){ + //券礼包 + merchantSubsidy.setSource(EnumMerchantSubsidySource.GIFT_BAG.getCode()); } else { //券 merchantSubsidy.setSource(EnumMerchantSubsidySource.COUPON.getCode()); diff --git a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml index 85b3097e7..a4d51d27e 100644 --- a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml @@ -884,14 +884,38 @@ c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,2 attribute from wx_order o left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id left join wx_coupon c on o.product_id=c.id - where c.type!=100 and o.order_status in(0,1,2,3,4,5) + where c.type in (1,2,3,4,5,6,10,50,51) and o.order_status in(0,1,2,3,4,5) + + and o.`tenant_id` = #{tenantId} + + + and o.`parent_tenant_id` = #{parentTenantId} + + + union all + select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment,o.order_status, + c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,6 attribute from wx_order o + left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id + left join wx_coupon c on o.product_id=c.id + where c.type = 11 and o.order_status in(0,1,2,3,4,5) + + and o.`tenant_id` = #{tenantId} + + + and o.`parent_tenant_id` = #{parentTenantId} + + union all + select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment,o.order_status, + c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,7 attribute from wx_order o + left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id + left join wx_coupon c on o.product_id=c.id + where c.type = 12 and o.order_status in(0,1,2,3,4,5) and o.`tenant_id` = #{tenantId} and o.`parent_tenant_id` = #{parentTenantId} - and ifnull(press_current_num,0)=0 and ifnull(order_group_id,0)=0 union all select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment, case o.order_status when 6 then 0 when 7 then 0