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
8a8f9c51
Commit
8a8f9c51
authored
Dec 20, 2019
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导航保存重复验证
parent
3cae87b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
CustomGuideController.java
.../gic/enterprise/web/controller/CustomGuideController.java
+15
-5
No files found.
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/CustomGuideController.java
View file @
8a8f9c51
...
...
@@ -19,10 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
@RestController
public
class
CustomGuideController
{
...
...
@@ -35,9 +32,18 @@ public class CustomGuideController {
Integer
enterpriseId
=
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
();
JSONArray
array
=
JSON
.
parseArray
(
param
);
List
<
CustomGuideDTO
>
list
=
new
ArrayList
<>();
Map
<
Integer
,
Object
>
exist
=
new
HashMap
<>();
Map
<
String
,
Object
>
pagePathExist
=
new
HashMap
<>();
ServiceResponse
<
List
<
GuideTypeDTO
>>
response
=
this
.
customGuideApiService
.
listGuideType
();
for
(
int
i
=
0
;
i
<
array
.
size
();
i
++){
JSONObject
json
=
array
.
getJSONObject
(
i
);
int
customLinkType
=
json
.
getIntValue
(
"customLinkType"
);
if
(
customLinkType
!=
0
&&
customLinkType
!=
7
){
if
(
exist
.
get
(
customLinkType
)
!=
null
){
return
RestResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
"链接类型不能重复选择"
);
}
exist
.
put
(
customLinkType
,
customLinkType
);
}
CustomGuideDTO
guideDTO
=
new
CustomGuideDTO
();
guideDTO
.
setGuideId
(
json
.
getInteger
(
"guideId"
));
guideDTO
.
setIcon
(
json
.
getString
(
"icon"
));
...
...
@@ -45,13 +51,17 @@ public class CustomGuideController {
guideDTO
.
setEntryCondition
(
json
.
getInteger
(
"entryCondition"
));
guideDTO
.
setEnterpriseId
(
enterpriseId
);
guideDTO
.
setLink
(
json
.
getString
(
"link"
));
guideDTO
.
setCustomLinkType
(
json
.
getIntValue
(
"customLinkType"
)
);
guideDTO
.
setCustomLinkType
(
customLinkType
);
guideDTO
.
setSort
(
json
.
getInteger
(
"sort"
));
guideDTO
.
setStatus
(
json
.
getInteger
(
"status"
));
guideDTO
.
setAppid
(
appId
);
guideDTO
.
setIconPath
(
json
.
getString
(
"iconPath"
));
guideDTO
.
setSelectedIconPath
(
json
.
getString
(
"selectedIconPath"
));
this
.
getPath
(
guideDTO
,
list
,
response
.
getResult
());
if
(
pagePathExist
.
get
(
guideDTO
.
getCustomPage
())
!=
null
){
return
RestResponse
.
failure
(
ErrorCode
.
SYSTEM_ERROR
.
getCode
(),
"链接路径不能重复选择"
);
}
pagePathExist
.
put
(
guideDTO
.
getCustomPage
(),
guideDTO
.
getCustomPage
());
list
.
add
(
guideDTO
);
}
if
(!
isNeedNewVersion
&&
this
.
isNeedNewVersion
(
list
,
enterpriseId
,
appId
)){
...
...
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