Commit 60edcbe8 by guojuxing

会员中心页面和卡券详情页面不能超过5个页面

parent b2e707a4
......@@ -122,10 +122,20 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
record.setBackgroundType(backgroundType);
record.setBackgroundImage(backgroundImage);
record.setQuickGuideSwitch(quickGuideSwitch);
//页面数量(包括启用和未启用)
int count = appletCustomPageService.count(enterpriseId, appType, appId, pageType);
boolean isCouponOrMemberCenterPage = pageType == AppletPageTypeEnum.MEMBER_CENTER.getCode() || pageType == AppletPageTypeEnum.CARD_DETAIL_LIST.getCode();
if (isCouponOrMemberCenterPage) {
//如果是卡券或者会员中心
if (isAddOperation && count > 5) {
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "页面超过5个");
}
}
//如果是有默认数据的类型(会员中心),第一条记录,即使saveType = 2,也自动变成1
if (AppletPageTypeEnum.hasDefault(pageType)) {
//查询记录
int count = appletCustomPageService.count(enterpriseId, appType, appId, pageType);
boolean isNeedSet = false;
if (pageId == null && count < 1) {
isNeedSet = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment