Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
5dfa2571
Commit
5dfa2571
authored
Aug 16, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品页面列表去重
parent
d8dd933f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageInfoController.java
...a/com/mortals/xhx/module/page/web/PageInfoController.java
+51
-0
No files found.
portal-manager/src/main/java/com/mortals/xhx/module/page/web/PageInfoController.java
View file @
5dfa2571
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.module.page.web;
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.module.page.web;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.product.ProductPdu
;
import
com.mortals.xhx.common.pdu.product.ProductPdu
;
...
@@ -10,12 +12,14 @@ import com.mortals.xhx.feign.product.IProductFeign;
...
@@ -10,12 +12,14 @@ import com.mortals.xhx.feign.product.IProductFeign;
import
com.mortals.xhx.module.page.model.PageInfoEntity
;
import
com.mortals.xhx.module.page.model.PageInfoEntity
;
import
com.mortals.xhx.module.page.service.PageInfoService
;
import
com.mortals.xhx.module.page.service.PageInfoService
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -77,4 +81,51 @@ public class PageInfoController extends BaseCRUDJsonBodyMappingController<PageIn
...
@@ -77,4 +81,51 @@ public class PageInfoController extends BaseCRUDJsonBodyMappingController<PageIn
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
return
ret
;
}
}
@Override
@PostMapping
({
"list"
})
@UnAuth
public
Rest
<
Object
>
list
(
@RequestBody
PageInfoEntity
query
)
{
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"查询"
+
this
.
getModuleDesc
();
int
code
;
try
{
this
.
doListBefore
(
query
,
model
,
context
);
PageInfo
pageInfo
=
this
.
buildPageInfo
(
query
);
Result
<
PageInfoEntity
>
result
=
this
.
getService
().
find
(
query
,
pageInfo
,
context
);
this
.
doListAfter
(
query
,
result
.
getList
(),
context
);
if
(
CollectionUtils
.
isNotEmpty
(
result
.
getList
())){
List
<
PageInfoEntity
>
newList
=
new
ArrayList
<>();
Map
<
String
,
String
>
pageCode
=
new
HashMap
<>();
for
(
PageInfoEntity
item:
result
.
getList
()){
if
(
pageCode
.
containsKey
(
item
.
getPageCode
())){
continue
;
}
else
{
pageCode
.
put
(
item
.
getPageCode
(),
item
.
getPageCode
());
newList
.
add
(
item
);
}
}
result
.
setList
(
newList
);
}
model
.
put
(
"data"
,
result
.
getList
());
model
.
put
(
"pageInfo"
,
result
.
getPageInfo
());
this
.
parsePageInfo
(
model
,
result
.
getPageInfo
());
code
=
this
.
doListAfter
(
query
,
(
Map
)
model
,
context
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setData
(
model
);
ret
.
setDict
(
model
.
get
(
"dict"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
}
\ No newline at end of file
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