@@ -191,8 +191,20 @@ public class WxMpMemberCardServiceImpl implements WxMpMemberCardService { | |||||
return WxMpCardCreateResult.failure("会员卡基本信息的门店使用范围选择指定门店,门店列表:locationIdList不能为空"); | return WxMpCardCreateResult.failure("会员卡基本信息的门店使用范围选择指定门店,门店列表:locationIdList不能为空"); | ||||
} | } | ||||
//TODO 高级信息 | |||||
//校验高级信息 | |||||
AdvancedInfo advancedInfo = memberCard.getAdvancedInfo(); | |||||
if (advancedInfo != null) { | |||||
if (advancedInfo.getBusinessServiceList() != null) { | |||||
for (String bs : advancedInfo.getBusinessServiceList()) { | |||||
BusinessServiceType businessServiceType = null; | |||||
try { | |||||
businessServiceType = BusinessServiceType.valueOf(bs); | |||||
} catch (IllegalArgumentException ex) { | |||||
return WxMpCardCreateResult.failure("会员卡高级信息的商户服务:" + bs + " 不合法"); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
return WxMpCardCreateResult.success(); | return WxMpCardCreateResult.success(); | ||||
} | } | ||||
@@ -15,19 +15,19 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class Abstract implements Serializable { | public class Abstract implements Serializable { | ||||
/** | |||||
* 摘要 | |||||
*/ | |||||
@SerializedName("abstract") | |||||
private String abstractInfo; | |||||
/** | |||||
* 摘要 | |||||
*/ | |||||
@SerializedName("abstract") | |||||
private String abstractInfo; | |||||
/** | |||||
* 封面图片列表,仅支持填入一 个封面图片链接, 上传图片接口 上传获取图片获得链接,填写 非CDN链接会报错,并在此填入。 建议图片尺寸像素850*350 | |||||
*/ | |||||
@SerializedName("icon_url_list") | |||||
private String iconUrlList; | |||||
/** | |||||
* 封面图片列表,仅支持填入一 个封面图片链接, 上传图片接口 上传获取图片获得链接,填写 非CDN链接会报错,并在此填入。 建议图片尺寸像素850*350 | |||||
*/ | |||||
@SerializedName("icon_url_list") | |||||
private String iconUrlList; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -25,37 +25,45 @@ public class AdvancedInfo implements Serializable { | |||||
// timeLimit = new TimeLimit(); | // timeLimit = new TimeLimit(); | ||||
// } | // } | ||||
/** | |||||
* 使用门槛(条件),若不填写使用条件则在券面拼写 :无最低消费限制,全场通用,不限品类;并在使用说明显示: 可与其他优惠共享 | |||||
*/ | |||||
@SerializedName( "use_condition") | |||||
private UseCondition useCondition; | |||||
/** | |||||
* 封面摘要 | |||||
*/ | |||||
@SerializedName( "abstract") | |||||
private Abstract abstractInfo; | |||||
/** | |||||
* 图文列表,显示在详情内页 ,优惠券券开发者须至少传入 一组图文列表 | |||||
*/ | |||||
@SerializedName( "text_image_list") | |||||
private List<TextImageList> textImageList; | |||||
/** | |||||
* 商家服务类型,数组类型:BIZ_SERVICE_DELIVER 外卖服务; BIZ_SERVICE_FREE_PARK 停车位; BIZ_SERVICE_WITH_PET 可带宠物; BIZ_SERVICE_FREE_WIFI 免费wifi, 可多选 | |||||
*/ | |||||
@SerializedName( "business_service") | |||||
private String businessService; | |||||
/** | |||||
* 使用时段限制 | |||||
*/ | |||||
@SerializedName( "time_limit") | |||||
private TimeLimit timeLimit; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
/** | |||||
* 使用门槛(条件),若不填写使用条件则在券面拼写 :无最低消费限制,全场通用,不限品类;并在使用说明显示: 可与其他优惠共享 | |||||
*/ | |||||
@SerializedName("use_condition") | |||||
private UseCondition useCondition; | |||||
/** | |||||
* 封面摘要 | |||||
*/ | |||||
@SerializedName("abstract") | |||||
private Abstract abstractInfo; | |||||
/** | |||||
* 图文列表,显示在详情内页 ,优惠券券开发者须至少传入 一组图文列表 | |||||
*/ | |||||
@SerializedName("text_image_list") | |||||
private List<TextImageList> textImageList; | |||||
/** | |||||
* 商家服务类型,数组类型:BIZ_SERVICE_DELIVER 外卖服务; BIZ_SERVICE_FREE_PARK 停车位; BIZ_SERVICE_WITH_PET 可带宠物; BIZ_SERVICE_FREE_WIFI 免费wifi, 可多选 | |||||
*/ | |||||
@SerializedName("business_service") | |||||
private List<String> businessServiceList; | |||||
/** | |||||
* 使用时段限制 | |||||
*/ | |||||
@SerializedName("time_limit") | |||||
private TimeLimit timeLimit; | |||||
public void addBusinessService(BusinessServiceType businessServiceType) { | |||||
if (businessServiceType != null) { | |||||
if (businessServiceList == null) | |||||
businessServiceList = new ArrayList<String>(); | |||||
businessServiceList.add(businessServiceType.name()); | |||||
} | } | ||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -164,7 +164,7 @@ public class BaseInfo implements Serializable { | |||||
* 每人可领券的数量限制,建议会员卡每人限领一张 | * 每人可领券的数量限制,建议会员卡每人限领一张 | ||||
*/ | */ | ||||
@SerializedName("get_limit") | @SerializedName("get_limit") | ||||
private Integer getLimit=1; | |||||
private Integer getLimit = 1; | |||||
/** | /** | ||||
* 卡券领取页面是否可分享,默认为true | * 卡券领取页面是否可分享,默认为true | ||||
@@ -0,0 +1,21 @@ | |||||
package me.chanjar.weixin.mp.bean.card; | |||||
/** | |||||
* 商户提供服务类型 | |||||
*/ | |||||
public enum BusinessServiceType { | |||||
BIZ_SERVICE_DELIVER("外卖服务"), | |||||
BIZ_SERVICE_FREE_PARK("停车位"), | |||||
BIZ_SERVICE_WITH_PET("可带宠物"), | |||||
BIZ_SERVICE_FREE_WIFI("可带宠物"); | |||||
private String description; | |||||
BusinessServiceType(String description) { | |||||
this.description = description; | |||||
} | |||||
public String getDescription() { | |||||
return description; | |||||
} | |||||
} |
@@ -2,33 +2,34 @@ package me.chanjar.weixin.mp.bean.card; | |||||
/** | /** | ||||
* 会员卡颜色 | * 会员卡颜色 | ||||
* | |||||
* @author yuanqixun | * @author yuanqixun | ||||
* @date 2018-08-29 | * @date 2018-08-29 | ||||
*/ | */ | ||||
public enum CardColor{ | |||||
Color010("#63b359"), | |||||
Color020("#2c9f67"), | |||||
Color030("#509fc9"), | |||||
Color040("#5885cf"), | |||||
Color050("#9062c0"), | |||||
Color060("#d09a45"), | |||||
Color070("#e4b138"), | |||||
Color080("#ee903c"), | |||||
Color081("#f08500"), | |||||
Color082("#a9d92d"), | |||||
Color090("#dd6549"), | |||||
Color100("#cc463d"), | |||||
Color101("#cf3e36"), | |||||
Color102("#5E6671"); | |||||
public enum CardColor { | |||||
Color010("#63b359"), | |||||
Color020("#2c9f67"), | |||||
Color030("#509fc9"), | |||||
Color040("#5885cf"), | |||||
Color050("#9062c0"), | |||||
Color060("#d09a45"), | |||||
Color070("#e4b138"), | |||||
Color080("#ee903c"), | |||||
Color081("#f08500"), | |||||
Color082("#a9d92d"), | |||||
Color090("#dd6549"), | |||||
Color100("#cc463d"), | |||||
Color101("#cf3e36"), | |||||
Color102("#5E6671"); | |||||
private String type; | |||||
private String type; | |||||
CardColor(String type) { | |||||
this.type = type; | |||||
} | |||||
CardColor(String type) { | |||||
this.type = type; | |||||
} | |||||
public String getValue() { | |||||
return type; | |||||
} | |||||
public String getValue() { | |||||
return type; | |||||
} | |||||
} | } |
@@ -15,25 +15,25 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class CustomCell1 implements Serializable { | public class CustomCell1 implements Serializable { | ||||
/** | |||||
* 入口名称 | |||||
*/ | |||||
@SerializedName("name") | |||||
private String name; | |||||
/** | |||||
* 入口名称 | |||||
*/ | |||||
@SerializedName("name") | |||||
private String name; | |||||
/** | |||||
* 入口右侧提示语,6个汉字内。 | |||||
*/ | |||||
@SerializedName("tips") | |||||
private String tips; | |||||
/** | |||||
* 入口右侧提示语,6个汉字内。 | |||||
*/ | |||||
@SerializedName("tips") | |||||
private String tips; | |||||
/** | |||||
* 入口跳转链接。 | |||||
*/ | |||||
@SerializedName("url") | |||||
private String url; | |||||
/** | |||||
* 入口跳转链接。 | |||||
*/ | |||||
@SerializedName("url") | |||||
private String url; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -15,13 +15,13 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class PayInfo implements Serializable { | public class PayInfo implements Serializable { | ||||
/** | |||||
* 刷卡功能 | |||||
*/ | |||||
@SerializedName( "swipe_card") | |||||
private SwipeCard swipeCard; | |||||
/** | |||||
* 刷卡功能 | |||||
*/ | |||||
@SerializedName("swipe_card") | |||||
private SwipeCard swipeCard; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -15,13 +15,13 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class Sku implements Serializable { | public class Sku implements Serializable { | ||||
/** | |||||
* 卡券库存的数量,不支持填写0,上限为100000000。 | |||||
*/ | |||||
@SerializedName("quantity") | |||||
private Integer quantity=100000000; | |||||
/** | |||||
* 卡券库存的数量,不支持填写0,上限为100000000。 | |||||
*/ | |||||
@SerializedName("quantity") | |||||
private Integer quantity = 100000000; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -15,19 +15,19 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class SwipeCard implements Serializable { | public class SwipeCard implements Serializable { | ||||
/** | |||||
* 是否设置该会员卡支持拉出微信支付刷卡界面 | |||||
*/ | |||||
@SerializedName( "is_swipe_card") | |||||
private boolean isSwipeCard; | |||||
/** | |||||
* 是否设置该会员卡支持拉出微信支付刷卡界面 | |||||
*/ | |||||
@SerializedName("is_swipe_card") | |||||
private boolean isSwipeCard; | |||||
/** | |||||
* 是否设置该会员卡中部的按钮同时支持微信支付刷卡和会员卡二维码 | |||||
*/ | |||||
@SerializedName( "is_pay_and_qrcode") | |||||
private boolean isPayAndQrcode; | |||||
/** | |||||
* 是否设置该会员卡中部的按钮同时支持微信支付刷卡和会员卡二维码 | |||||
*/ | |||||
@SerializedName("is_pay_and_qrcode") | |||||
private boolean isPayAndQrcode; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -15,19 +15,19 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class TextImageList implements Serializable { | public class TextImageList implements Serializable { | ||||
/** | |||||
* 图片链接,必须调用 上传图片接口 上传图片获得链接,并在此填入, 否则报错 | |||||
*/ | |||||
@SerializedName( "image_url") | |||||
private String imageUrl; | |||||
/** | |||||
* 图片链接,必须调用 上传图片接口 上传图片获得链接,并在此填入, 否则报错 | |||||
*/ | |||||
@SerializedName("image_url") | |||||
private String imageUrl; | |||||
/** | |||||
* 图文描述 | |||||
*/ | |||||
@SerializedName("text") | |||||
private String text; | |||||
/** | |||||
* 图文描述 | |||||
*/ | |||||
@SerializedName("text") | |||||
private String text; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -16,37 +16,37 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class TimeLimit implements Serializable { | public class TimeLimit implements Serializable { | ||||
/** | |||||
* 限制类型枚举值,支持填入 MONDAY 周一 TUESDAY 周二 WEDNESDAY 周三 THURSDAY 周四 FRIDAY 周五 SATURDAY 周六 SUNDAY 周日 此处只控制显示, 不控制实际使用逻辑,不填默认不显示 | |||||
*/ | |||||
@SerializedName("type") | |||||
private String type; | |||||
/** | |||||
* 起始时间(小时),当前type类型下的起始时间(小时) ,如当前结构体内填写了MONDAY, 此处填写了10,则此处表示周一 10:00可用 | |||||
*/ | |||||
@SerializedName( "begin_hour") | |||||
private Integer beginHour; | |||||
/** | |||||
* 起始时间(分钟),如当前结构体内填写了MONDAY, begin_hour填写10,此处填写了59, 则此处表示周一 10:59可用 | |||||
*/ | |||||
@SerializedName( "begin_minute") | |||||
private Integer beginMinute; | |||||
/** | |||||
* 结束时间(小时),如当前结构体内填写了MONDAY, 此处填写了20, 则此处表示周一 10:00-20:00可用 | |||||
*/ | |||||
@SerializedName( "end_hour") | |||||
private Integer endHour; | |||||
/** | |||||
* 结束时间(分钟),如当前结构体内填写了MONDAY, begin_hour填写10,此处填写了59, 则此处表示周一 10:59-00:59可用 | |||||
*/ | |||||
@SerializedName( "end_minute") | |||||
private Integer endMinute; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
/** | |||||
* 限制类型枚举值,支持填入 MONDAY 周一 TUESDAY 周二 WEDNESDAY 周三 THURSDAY 周四 FRIDAY 周五 SATURDAY 周六 SUNDAY 周日 此处只控制显示, 不控制实际使用逻辑,不填默认不显示 | |||||
*/ | |||||
@SerializedName("type") | |||||
private String type; | |||||
/** | |||||
* 起始时间(小时),当前type类型下的起始时间(小时) ,如当前结构体内填写了MONDAY, 此处填写了10,则此处表示周一 10:00可用 | |||||
*/ | |||||
@SerializedName("begin_hour") | |||||
private Integer beginHour; | |||||
/** | |||||
* 起始时间(分钟),如当前结构体内填写了MONDAY, begin_hour填写10,此处填写了59, 则此处表示周一 10:59可用 | |||||
*/ | |||||
@SerializedName("begin_minute") | |||||
private Integer beginMinute; | |||||
/** | |||||
* 结束时间(小时),如当前结构体内填写了MONDAY, 此处填写了20, 则此处表示周一 10:00-20:00可用 | |||||
*/ | |||||
@SerializedName("end_hour") | |||||
private Integer endHour; | |||||
/** | |||||
* 结束时间(分钟),如当前结构体内填写了MONDAY, begin_hour填写10,此处填写了59, 则此处表示周一 10:59-00:59可用 | |||||
*/ | |||||
@SerializedName("end_minute") | |||||
private Integer endMinute; | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |
@@ -16,37 +16,37 @@ import java.io.Serializable; | |||||
@Data | @Data | ||||
public class UseCondition implements Serializable { | public class UseCondition implements Serializable { | ||||
/** | |||||
* 指定可用的商品类目,仅用于代金券类型 ,填入后将在券面拼写适用于xxx | |||||
*/ | |||||
@SerializedName( "accept_category") | |||||
private String acceptCategory; | |||||
/** | |||||
* 指定不可用的商品类目,仅用于代金券类型 ,填入后将在券面拼写不适用于xxxx | |||||
*/ | |||||
@SerializedName( "reject_category") | |||||
private String rejectCategory; | |||||
/** | |||||
* 满减门槛字段,可用于兑换券和代金券 ,填入后将在全面拼写消费满xx元可用 | |||||
*/ | |||||
@SerializedName( "least_cost") | |||||
private Integer leastCost; | |||||
/** | |||||
* 购买xx可用类型门槛,仅用于兑换 ,填入后自动拼写购买xxx可用 | |||||
*/ | |||||
@SerializedName( "object_use_for") | |||||
private String objectUseFor; | |||||
/** | |||||
* 不可以与其他类型共享门槛,填写false时系统将在使用须知里 拼写“不可与其他优惠共享”, 填写true时系统将在使用须知里 拼写“可与其他优惠共享”, 默认为true | |||||
*/ | |||||
@SerializedName( "can_use_with_other_discount") | |||||
private boolean canUseWithOtherDiscount; | |||||
public String toString(){ | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
/** | |||||
* 指定可用的商品类目,仅用于代金券类型 ,填入后将在券面拼写适用于xxx | |||||
*/ | |||||
@SerializedName("accept_category") | |||||
private String acceptCategory; | |||||
/** | |||||
* 指定不可用的商品类目,仅用于代金券类型 ,填入后将在券面拼写不适用于xxxx | |||||
*/ | |||||
@SerializedName("reject_category") | |||||
private String rejectCategory; | |||||
/** | |||||
* 满减门槛字段,可用于兑换券和代金券 ,填入后将在全面拼写消费满xx元可用 | |||||
*/ | |||||
@SerializedName("least_cost") | |||||
private Integer leastCost; | |||||
/** | |||||
* 购买xx可用类型门槛,仅用于兑换 ,填入后自动拼写购买xxx可用 | |||||
*/ | |||||
@SerializedName("object_use_for") | |||||
private String objectUseFor; | |||||
/** | |||||
* 不可以与其他类型共享门槛,填写false时系统将在使用须知里 拼写“不可与其他优惠共享”, 填写true时系统将在使用须知里 拼写“可与其他优惠共享”, 默认为true | |||||
*/ | |||||
@SerializedName("can_use_with_other_discount") | |||||
private boolean canUseWithOtherDiscount; | |||||
public String toString() { | |||||
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); | |||||
} | |||||
} | } |