mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 10:08:16 +08:00
#736 修复卡券高级信息的商户服务属性
This commit is contained in:
parent
f90f72fc9c
commit
28b09f7ed6
@ -191,8 +191,20 @@ public class WxMpMemberCardServiceImpl implements WxMpMemberCardService {
|
||||
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();
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class AdvancedInfo implements Serializable {
|
||||
* 商家服务类型,数组类型:BIZ_SERVICE_DELIVER 外卖服务; BIZ_SERVICE_FREE_PARK 停车位; BIZ_SERVICE_WITH_PET 可带宠物; BIZ_SERVICE_FREE_WIFI 免费wifi, 可多选
|
||||
*/
|
||||
@SerializedName("business_service")
|
||||
private String businessService;
|
||||
private List<String> businessServiceList;
|
||||
|
||||
/**
|
||||
* 使用时段限制
|
||||
@ -55,6 +55,14 @@ public class AdvancedInfo implements Serializable {
|
||||
@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);
|
||||
}
|
||||
|
@ -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,6 +2,7 @@ package me.chanjar.weixin.mp.bean.card;
|
||||
|
||||
/**
|
||||
* 会员卡颜色
|
||||
*
|
||||
* @author yuanqixun
|
||||
* @date 2018-08-29
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user