Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4aa3ec52
authored
Jul 04, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] 项目列表添加项目经理字段
1 parent
7c7fa772
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
src/main/java/vion/controller/StoreController.java
src/main/java/vion/controller/StoreController.java
View file @
4aa3ec5
...
...
@@ -10,12 +10,16 @@ import lombok.extern.slf4j.Slf4j;
import
org.dromara.hutool.core.array.ArrayUtil
;
import
org.dromara.hutool.core.lang.Assert
;
import
org.dromara.hutool.core.lang.Opt
;
import
org.dromara.hutool.core.map.MapUtil
;
import
org.dromara.hutool.core.text.StrUtil
;
import
org.dromara.hutool.core.util.ObjUtil
;
import
org.springframework.web.bind.annotation.*
;
import
vion.dto.StatusDTO
;
import
vion.dto.StoreDTO
;
import
vion.model.*
;
import
vion.model.RStoreConfederate
;
import
vion.model.RStoreUser
;
import
vion.model.Store
;
import
vion.model.StoreLog
;
import
vion.service.IRStoreConfederateService
;
import
vion.service.IRStoreUserService
;
import
vion.service.IStoreLogService
;
...
...
@@ -26,6 +30,7 @@ import vion.vo.UserVO;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
(
"/api"
)
...
...
@@ -59,9 +64,16 @@ public class StoreController {
.
eq
(
ObjUtil
.
isNotNull
(
accountId
),
Store:
:
getAccountId
,
accountId
)
.
eq
(
ObjUtil
.
isNotNull
(
id
),
Store:
:
getId
,
id
)
.
like
(
StrUtil
.
isNotBlank
(
name
),
Store:
:
getName
,
name
)
.
last
(
limit
!=
null
,
"limit "
+
limit
)
.
last
(
ObjUtil
.
isNotNull
(
limit
)
,
"limit "
+
limit
)
.
list
();
return
converter
.
convert
(
storeList
,
StoreVO
.
class
);
var
storeIdList
=
storeList
.
stream
().
map
(
Store:
:
getId
).
toList
();
var
storeId2UserIdMap
=
Opt
.
ofEmptyAble
(
storeIdList
)
.
map
(
l
->
storeUserService
.
lambdaQuery
().
in
(
RStoreUser:
:
getStoreId
,
l
).
eq
(
RStoreUser:
:
getIsMain
,
1
).
list
())
.
map
(
suList
->
suList
.
stream
().
collect
(
Collectors
.
toMap
(
RStoreUser:
:
getStoreId
,
RStoreUser:
:
getUserId
)))
.
orElse
(
MapUtil
.
empty
());
var
voList
=
converter
.
convert
(
storeList
,
StoreVO
.
class
);
voList
.
forEach
(
v
->
v
.
setMainUser
(
storeId2UserIdMap
.
getOrDefault
(
v
.
getId
(),
null
)));
return
voList
;
}
@PostMapping
(
"/stores"
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment