| @@ -116,7 +116,7 @@ public class WxOrder extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String title; | 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) | @TableField(exist = false) | ||||
| private Integer attribute; | private Integer attribute; | ||||
| @@ -93,7 +93,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | ||||
| private Integer 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") | @io.swagger.annotations.ApiModelProperty(value = "业态", name = "business") | ||||
| private Integer business; | private Integer business; | ||||
| @@ -189,7 +189,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long couponId; | 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) | @TableField(exist = false) | ||||
| private Integer couponType; | private Integer couponType; | ||||
| @@ -10,7 +10,9 @@ public enum EnumMerchantSubsidySource { | |||||
| COUPON(2, "券核销"), | COUPON(2, "券核销"), | ||||
| PRESS(3, "砍价核销"), | PRESS(3, "砍价核销"), | ||||
| GROUP(4, "拼团核销"), | GROUP(4, "拼团核销"), | ||||
| CASHIER(5, "收银台"),; | |||||
| CASHIER(5, "收银台"), | |||||
| DISTRIBUTION_GOODS(6, "可配送商品"), | |||||
| GIFT_BAG(7, "券订单"),; | |||||
| public static EnumMerchantSubsidySource getEnum(Integer code) { | public static EnumMerchantSubsidySource getEnum(Integer code) { | ||||
| for (EnumMerchantSubsidySource value : values()) { | for (EnumMerchantSubsidySource value : values()) { | ||||
| @@ -368,7 +368,7 @@ public class WxCUserTagsServiceHelper{ | |||||
| int count = 0; | int count = 0; | ||||
| if(cardSpendCountList.size() > 0) { | if(cardSpendCountList.size() > 0) { | ||||
| for (Map<String, Object> cardSpendCount : cardSpendCountList) { | for (Map<String, Object> cardSpendCount : cardSpendCountList) { | ||||
| if (cardSpendCount.get("businessId").equals(b.getId().toString())) { | |||||
| if (cardSpendCount.get("business_id").equals(b.getId().toString())) { | |||||
| count += (Integer) cardSpendCount.get("buCount"); | count += (Integer) cardSpendCount.get("buCount"); | ||||
| } | } | ||||
| } | } | ||||
| @@ -767,6 +767,12 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| && couponOrder.getCouponPrice().equals(wxCoupon.getSalePrice())) { | && couponOrder.getCouponPrice().equals(wxCoupon.getSalePrice())) { | ||||
| //拼团 | //拼团 | ||||
| merchantSubsidy.setSource(EnumMerchantSubsidySource.GROUP.getCode()); | 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 { | } else { | ||||
| //券 | //券 | ||||
| merchantSubsidy.setSource(EnumMerchantSubsidySource.COUPON.getCode()); | merchantSubsidy.setSource(EnumMerchantSubsidySource.COUPON.getCode()); | ||||
| @@ -884,14 +884,38 @@ | |||||
| c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,2 attribute from wx_order o | 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_c_user_basic_info cubi on o.c_user_id=cubi.id | ||||
| left join wx_coupon c on o.product_id=c.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) | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and o.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and o.`parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <!-- 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,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) | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and o.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and o.`parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| 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) | |||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and o.`tenant_id` = #{tenantId} | and o.`tenant_id` = #{tenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and o.`parent_tenant_id` = #{parentTenantId} | and o.`parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| and ifnull(press_current_num,0)=0 and ifnull(order_group_id,0)=0 | |||||
| union all | union all | ||||
| select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment, | 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 | case o.order_status when 6 then 0 when 7 then 0 | ||||