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
83754147
Commit
83754147
authored
Aug 03, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序装修页面调整
parent
c1f39714
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
32 deletions
+19
-32
AppletCustomPageApiServiceImpl.java
...se/service/outer/impl/AppletCustomPageApiServiceImpl.java
+19
-32
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/AppletCustomPageApiServiceImpl.java
View file @
83754147
...
...
@@ -59,10 +59,7 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
@Override
public
ServiceResponse
<
Integer
>
saveOrUpdate
(
String
param
,
Integer
pageId
,
Integer
enterpriseId
,
Integer
saveType
,
Integer
appType
,
String
appId
)
{
ServiceResponse
valiParams
=
this
.
validParams
(
enterpriseId
,
saveType
,
appType
,
appId
,
param
);
if
(!
valiParams
.
isSuccess
()){
return
valiParams
;
}
validParams
(
enterpriseId
,
saveType
,
appType
,
appId
,
param
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
param
);
String
title
=
jsonObject
.
getString
(
"title"
);
...
...
@@ -87,9 +84,9 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
}
else
{
if
(
enterpriseId
==
-
1
)
{
//默认数据配置
TabAppletCustomPage
defaultPage
=
getDefaultPage
(
pageType
);
if
(
defaultPage
!=
null
)
{
pageId
=
defaultPage
.
getPageId
();
getById
=
getDefaultPage
(
pageType
);
if
(
getById
!=
null
)
{
pageId
=
getById
.
getPageId
();
isAddOperation
=
false
;
}
}
...
...
@@ -124,20 +121,11 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
record
.
setSerialNumber
(
0
);
}
}
record
.
setEnterpriseId
(
enterpriseId
);
record
.
setStatus
(
saveType
);
record
.
setAppType
(
appType
);
record
.
setAppId
(
appId
);
record
.
setTitle
(
title
);
record
.
setEnterpriseId
(
enterpriseId
);
record
.
setStatus
(
saveType
);
record
.
setAppType
(
appType
);
record
.
setAppId
(
appId
);
record
.
setTitle
(
title
);
// 0代表不限,1代表开卡会员,2代表认证会员
record
.
setEntryCondition
(
entryCondition
);
record
.
setSetting
(
jsonObject
.
getString
(
"setting"
));
record
.
setPageType
(
pageType
);
record
.
setBackgroundColor
(
backgroundColor
);
record
.
setAppletTitle
(
appletTitle
);
record
.
setBackgroundType
(
backgroundType
);
record
.
setBackgroundImage
(
backgroundImage
);
record
.
setQuickGuideSwitch
(
quickGuideSwitch
);
record
.
setEntryCondition
(
entryCondition
);
record
.
setSetting
(
jsonObject
.
getString
(
"setting"
));
record
.
setPageType
(
pageType
);
record
.
setBackgroundColor
(
backgroundColor
);
record
.
setAppletTitle
(
appletTitle
);
record
.
setBackgroundType
(
backgroundType
);
record
.
setBackgroundImage
(
backgroundImage
);
record
.
setQuickGuideSwitch
(
quickGuideSwitch
);
//页面数量(包括启用和未启用)
int
count
=
appletCustomPageService
.
count
(
enterpriseId
,
appType
,
appId
,
pageType
);
...
...
@@ -227,54 +215,53 @@ public class AppletCustomPageApiServiceImpl implements AppletCustomPageApiServic
}
}
private
ServiceResponse
validParams
(
Integer
enterpriseId
,
Integer
saveType
,
Integer
appType
,
String
appId
,
String
param
){
private
void
validParams
(
Integer
enterpriseId
,
Integer
saveType
,
Integer
appType
,
String
appId
,
String
param
){
//参数校验
if
(
enterpriseId
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"商户ID不能为空"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"商户ID不能为空"
);
}
//1:保存并发布 2:保存
boolean
isRightStatus
=
saveType
==
null
||
(
saveType
.
intValue
()
!=
1
&&
saveType
.
intValue
()
!=
2
);
if
(
isRightStatus
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面状态值错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面状态值错误"
);
}
//1:小程序 2:服务号
boolean
isRightAppType
=
appType
==
null
||
(
appType
.
intValue
()
!=
1
&&
appType
.
intValue
()
!=
2
);
if
(
isRightAppType
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"app类型值错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"app类型值错误"
);
}
if
(
StringUtils
.
isBlank
(
appId
))
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"appKey/appId不能为空"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"appKey/appId不能为空"
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
param
);
if
(!
jsonObject
.
containsKey
(
TITLE
))
{
LOGGER
.
warn
(
"title不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面名称错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面名称错误"
);
}
String
title
=
jsonObject
.
getString
(
"title"
);
if
(
StringUtils
.
isBlank
(
title
))
{
LOGGER
.
warn
(
"title不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面名称错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面名称错误"
);
}
if
(!
jsonObject
.
containsKey
(
ENTRYCONDITION
))
{
LOGGER
.
warn
(
"entryCondition不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面进入条件错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面进入条件错误"
);
}
//0代表不限,1代表开卡会员,2代表认证会员
Integer
entryCondition
=
jsonObject
.
getInteger
(
"entryCondition"
);
if
(!
EntryConditionEnum
.
isRightCode
(
entryCondition
))
{
LOGGER
.
warn
(
"entryCondition值错误"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面进入条件错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面进入条件错误"
);
}
if
(!
jsonObject
.
containsKey
(
PAGETYPE
))
{
LOGGER
.
warn
(
"pageType不存在"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面类型错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面类型错误"
);
}
Integer
pageType
=
jsonObject
.
getInteger
(
"pageType"
);
if
(!
AppletPageTypeEnum
.
isRightCode
(
pageType
))
{
LOGGER
.
warn
(
"pageType值错误"
);
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面类型错误"
);
throw
new
CommonException
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"页面类型错误"
);
}
return
ServiceResponse
.
success
();
}
private
ServiceResponse
<
Integer
>
componentParse
(
JSONObject
jsonObject
,
Integer
enterpriseId
,
Integer
pageId
,
List
<
TabAppletPageComponent
>
componentList
,
Map
<
String
,
Object
>
componentMap
){
...
...
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