Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
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-store
Commits
aed37102
Commit
aed37102
authored
Jun 24, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店自定义字段-共享
parent
aebbddc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
StoreFieldController.java
...va/com/gic/store/web/controller/StoreFieldController.java
+26
-0
StoreFieldVO.java
...in/java/com/gic/store/web/vo/storefield/StoreFieldVO.java
+60
-0
No files found.
gic-store-web/src/main/java/com/gic/store/web/controller/StoreFieldController.java
View file @
aed37102
...
...
@@ -5,6 +5,9 @@ import java.util.stream.Collectors;
import
java.util.stream.Stream
;
import
com.gic.auth.constant.SignConstants
;
import
com.gic.enterprise.dto.EnterpriseDTO
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -60,6 +63,8 @@ public class StoreFieldController {
private
StoreRegionApiService
storeRegionApiService
;
@Autowired
private
StoreDictApiService
storeDictApiService
;
@Autowired
private
EnterpriseApiService
enterpriseApiService
;
/**
* 字段类型下拉数据列表
...
...
@@ -252,7 +257,16 @@ public class StoreFieldController {
}
if
(
voList
!=
null
)
{
Map
<
Integer
,
String
>
enterpriseIdMapName
=
getEnterpriseIdMapName
(
storeFieldDTOList
.
stream
()
.
filter
(
e
->
e
.
getOwnType
()
==
1
)
.
mapToInt
(
e
->
e
.
getEnterpriseId
())
.
boxed
()
.
collect
(
Collectors
.
toList
()));
for
(
StoreFieldVO
storeFieldVO
:
voList
)
{
//共享商户名称
storeFieldVO
.
setOwnerEntName
(
enterpriseIdMapName
.
get
(
storeFieldVO
.
getEnterpriseId
()));
String
regionId
=
storeFieldIdMapRegionIds
.
get
(
storeFieldVO
.
getStoreFieldId
());
storeFieldVO
.
setRegionName
(
getRegionNameByRegionId
(
regionId
,
regionMap
));
if
(
storeFieldDictValueList
!=
null
...
...
@@ -439,4 +453,16 @@ public class StoreFieldController {
}
return
false
;
}
private
Map
<
Integer
,
String
>
getEnterpriseIdMapName
(
List
<
Integer
>
enterpriseIdList
)
{
Map
<
Integer
,
String
>
map
=
new
HashMap
<>();
ServiceResponse
<
List
<
EnterpriseDTO
>>
response
=
enterpriseApiService
.
listEnterpriseByIds
(
enterpriseIdList
);
if
(
response
.
isSuccess
())
{
List
<
EnterpriseDTO
>
list
=
response
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
map
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
EnterpriseDTO:
:
getEnterpriseId
,
EnterpriseDTO:
:
getEnterpriseName
));
}
}
return
map
;
}
}
gic-store-web/src/main/java/com/gic/store/web/vo/storefield/StoreFieldVO.java
View file @
aed37102
...
...
@@ -67,6 +67,23 @@ public class StoreFieldVO implements Serializable{
*/
private
String
erpRelCode
;
/**
* 0:owner 1:other 授权者和被授权
*/
private
Integer
ownType
;
/**
* 共享标记 1:自有 0:共享
*/
private
Integer
ownerFlag
;
/**
* 自有商户名称
*/
private
String
ownerEntName
;
private
Integer
enterpriseId
;
public
Integer
getStoreFieldId
()
{
return
storeFieldId
;
}
...
...
@@ -159,6 +176,45 @@ public class StoreFieldVO implements Serializable{
this
.
erpRelCode
=
erpRelCode
;
}
public
Integer
getOwnerFlag
()
{
if
(
ownType
!=
null
&&
ownType
==
1
)
{
return
0
;
}
return
1
;
}
public
StoreFieldVO
setOwnerFlag
(
Integer
ownerFlag
)
{
this
.
ownerFlag
=
ownerFlag
;
return
this
;
}
public
String
getOwnerEntName
()
{
return
ownerEntName
;
}
public
StoreFieldVO
setOwnerEntName
(
String
ownerEntName
)
{
this
.
ownerEntName
=
ownerEntName
;
return
this
;
}
public
Integer
getOwnType
()
{
return
ownType
;
}
public
StoreFieldVO
setOwnType
(
Integer
ownType
)
{
this
.
ownType
=
ownType
;
return
this
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
StoreFieldVO
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
return
this
;
}
@Override
public
String
toString
()
{
return
"StoreFieldVO{"
+
...
...
@@ -174,6 +230,10 @@ public class StoreFieldVO implements Serializable{
", isErpMapping="
+
isErpMapping
+
", isFilter="
+
isFilter
+
", erpRelCode='"
+
erpRelCode
+
'\''
+
", ownerFlag='"
+
ownerFlag
+
'\''
+
", ownerEntName='"
+
ownerEntName
+
'\''
+
", ownType='"
+
ownType
+
'\''
+
", enterpriseId='"
+
enterpriseId
+
'\''
+
'}'
;
}
}
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