Skip to content

#bugfix#卡券高级信息的商户服务应该为列表 #736

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,20 @@ private WxMpCardCreateResult validCheck(WxMpMemberCardCreateMessage createMessag
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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
@Data
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,45 @@ public class AdvancedInfo implements Serializable {
// 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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public class BaseInfo implements Serializable {
* 每人可领券的数量限制,建议会员卡每人限领一张
*/
@SerializedName("get_limit")
private Integer getLimit=1;
private Integer getLimit = 1;

/**
* 卡券领取页面是否可分享,默认为true
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@

/**
* 会员卡颜色
*
* @author yuanqixun
* @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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
@Data
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
@Data
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
@Data
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
@Data
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
@Data
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);
}
}
Loading