Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-enterprise
Commits
8f31b0c1
Commit
8f31b0c1
authored
Jan 07, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分服务、会员成就、会员任务组件定义
parent
4bb04503
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
28 deletions
+54
-28
AppletPageComponentEnum.java
...c/enterprise/constant/applet/AppletPageComponentEnum.java
+47
-22
AppletCustomPageApiServiceImpl.java
...se/service/outer/impl/AppletCustomPageApiServiceImpl.java
+7
-6
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/constant/applet/AppletPageComponentEnum.java
View file @
8f31b0c1
...
...
@@ -7,34 +7,39 @@ package com.gic.enterprise.constant.applet;
* @date 2019/11/25 2:43 PM
*/
public
enum
AppletPageComponentEnum
{
RICH_TEXT
(
"A1"
,
"富文本"
),
IMAGE
(
"A2"
,
"图文广告"
),
MAGIC
(
"A3"
,
"魔方"
),
IMAGE_TEXT
(
"A4"
,
"图文导航"
),
TEXT
(
"A5"
,
"文本"
),
CROSS_BAR
(
"A6"
,
"横栏"
),
GUIDE_LINE
(
"A7"
,
"辅助线"
),
GUIDE_BLANK
(
"A8"
,
"辅助空白"
),
TEXT_TITLE
(
"A9"
,
"文本标题"
),
DATA_ASSET
(
"A10"
,
"数据资产"
),
MEMBER_PRIVILEGE
(
"B1"
,
"会员特权"
),
MEMBER_CARD
(
"B2"
,
"会员卡"
),
INTEGRAL_SIGN
(
"B3"
,
"积分签到"
),
GOODS_SHELF
(
"B4"
,
"商品货架"
),
MALL_SEARCH
(
"B5"
,
"搜索"
),
MALL_GOODS
(
"B6"
,
"商品"
),
COUPON
(
"B7"
,
"卡券"
),
MALL_CLASSIFY
(
"B8"
,
"分类"
),
INTEGRAL_SERVICE
(
"C1"
,
"积分服务"
),
MEMBER_ACHIEVEMENT
(
"C2"
,
"会员成就"
),
MEMBER_TASK
(
"C3"
,
"会员任务"
);
RICH_TEXT
(
"A1"
,
"富文本"
,
0
),
IMAGE
(
"A2"
,
"图文广告"
,
0
),
MAGIC
(
"A3"
,
"魔方"
,
0
),
IMAGE_TEXT
(
"A4"
,
"图文导航"
,
0
),
TEXT
(
"A5"
,
"文本"
,
0
),
CROSS_BAR
(
"A6"
,
"横栏"
,
0
),
GUIDE_LINE
(
"A7"
,
"辅助线"
,
0
),
GUIDE_BLANK
(
"A8"
,
"辅助空白"
,
0
),
TEXT_TITLE
(
"A9"
,
"文本标题"
,
0
),
DATA_ASSET
(
"A10"
,
"数据资产"
,
0
),
MEMBER_PRIVILEGE
(
"B1"
,
"会员特权"
,
0
),
MEMBER_CARD
(
"B2"
,
"会员卡"
,
2
),
INTEGRAL_SIGN
(
"B3"
,
"积分签到"
,
0
),
GOODS_SHELF
(
"B4"
,
"商品货架"
,
0
),
MALL_SEARCH
(
"B5"
,
"搜索"
,
0
),
MALL_GOODS
(
"B6"
,
"商品"
,
0
),
COUPON
(
"B7"
,
"卡券"
,
0
),
MALL_CLASSIFY
(
"B8"
,
"分类"
,
0
),
INTEGRAL_SERVICE
(
"C1"
,
"积分服务"
,
4
),
MEMBER_ACHIEVEMENT
(
"C2"
,
"会员成就"
,
5
),
MEMBER_TASK
(
"C3"
,
"会员任务"
,
6
);
private
String
code
;
private
String
message
;
/**
* 有些组件是页面专有组件,必有
*/
private
int
pageType
;
private
AppletPageComponentEnum
(
String
code
,
String
message
)
{
private
AppletPageComponentEnum
(
String
code
,
String
message
,
int
pageType
)
{
this
.
code
=
code
;
this
.
message
=
message
;
this
.
pageType
=
pageType
;
}
public
String
getCode
()
{
...
...
@@ -53,6 +58,14 @@ public enum AppletPageComponentEnum {
this
.
message
=
message
;
}
public
int
getPageType
()
{
return
pageType
;
}
public
void
setPageType
(
int
pageType
)
{
this
.
pageType
=
pageType
;
}
public
static
boolean
isSaveToComponentTable
(
String
code
)
{
for
(
AppletPageComponentEnum
componentEnum
:
values
())
{
if
(
componentEnum
.
getCode
().
equals
(
code
))
{
...
...
@@ -61,4 +74,16 @@ public enum AppletPageComponentEnum {
}
return
false
;
}
public
static
AppletPageComponentEnum
mustComponent
(
Integer
pageType
)
{
if
(
pageType
==
null
)
{
return
null
;
}
for
(
AppletPageComponentEnum
componentEnum
:
values
())
{
if
(
componentEnum
.
getPageType
()
!=
0
&&
pageType
.
intValue
()
==
componentEnum
.
getPageType
())
{
return
componentEnum
;
}
}
return
null
;
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AppletCustomPageApiServiceImpl.java
View file @
8f31b0c1
...
...
@@ -181,14 +181,15 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
}
}
//如果是会员中心,必须有会员卡组件
if
(
AppletPageTypeEnum
.
MEMBER_CENTER
.
getCode
()
==
pageType
.
intValue
())
{
if
(!
componentMap
.
containsKey
(
AppletPageComponentEnum
.
MEMBER_CARD
.
getCode
()))
{
//如果是会员中心等页面,必须有对应的组件
AppletPageComponentEnum
mustComponent
=
AppletPageComponentEnum
.
mustComponent
(
pageType
);
if
(
mustComponent
!=
null
)
{
//说明该页面有必须的组件,需要验证组件是否存在
if
(!
componentMap
.
containsKey
(
mustComponent
.
getCode
()))
{
//回滚
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
AppletPageTypeEnum
.
MEMBER_CENTER
.
getMessage
()
+
"必须有"
+
AppletPageComponentEnum
.
MEMBER_CARD
.
getMessage
()
+
"组件"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"必须有"
+
mustComponent
.
getMessage
()
+
"组件"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment