Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
4e2e729d
Commit
4e2e729d
authored
Sep 02, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办停用
parent
206b528b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+18
-22
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
4e2e729d
...
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.dubbo.common.utils.CollectionUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -110,39 +111,35 @@ public class StoreController extends WebBaseController {
logger
.
info
(
"没有关联任何商户:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
Map
<
String
,
EnterpriseDetailDTO
>
enterpriseTypeMap
=
enterpriseList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getEnterpriseId
(),
dto
->
dto
));
List
<
String
>
enterpriseIdList
=
enterpriseList
.
stream
().
filter
(
dto
->{
String
enterprsieId
=
dto
.
getEnterpriseId
()
;
Integer
code
=
this
.
enterpriseUseForbidService
.
selectPermissionStatus
(
enterprsieId
,
EnterpriseServiceEnum
.
HAO_BAN
.
getRightMenuCode
())
;
logger
.
info
(
"是否停用={},{}"
,
enterprsieId
,
code
);
if
(
code
==
0
||
code
==
1
)
{
return
true
;
}
return
false
;
}).
map
(
EnterpriseDetailDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
enterpriseIdList
))
{
logger
.
info
(
"没有关联任何商户或商户都已停用:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
List
<
String
>
enterpriseIdList
=
enterpriseList
.
stream
().
map
(
EnterpriseDetailDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
(
));
Map
<
String
,
EnterpriseDetailDTO
>
enterpriseTypeMap
=
enterpriseList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getEnterpriseId
(),
dto
->
dto
));
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCodeByStaffId
(
enterpriseIdList
,
staffId
);
if
(
CollectionUtils
.
isEmpty
(
bindRelationList
))
{
logger
.
info
(
"没有关联任何商户导购:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
Map
<
String
,
Boolean
>
map
=
new
HashMap
<>(
);
logger
.
info
(
"成员绑定导购数据={}"
,
JSON
.
toJSONString
(
bindRelationList
)
);
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
bindRelationList
)
{
String
storeId
=
staffClerkRelationDTO
.
getStoreId
()
;
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
)
{
continue
;
}
String
enterprsieId
=
store
.
getEnterpriseId
()
;
if
(
null
!=
map
.
get
(
enterprsieId
))
{
if
(
Boolean
.
FALSE
.
equals
(
map
.
get
(
enterprsieId
)))
{
logger
.
info
(
"该企业过期,{}"
,
enterprsieId
);
continue
;
}
}
else
{
Integer
code
=
this
.
enterpriseUseForbidService
.
selectPermissionStatus
(
enterprsieId
,
EnterpriseServiceEnum
.
HAO_BAN
.
getRightMenuCode
())
;
logger
.
info
(
"是否停用={},{}"
,
enterprsieId
,
code
);
// 不能用
if
(!(
code
==
0
||
code
==
1
))
{
logger
.
info
(
"该企业过期,{}"
,
staffId
,
enterprsieId
);
map
.
put
(
enterprsieId
,
false
)
;
continue
;
}
}
map
.
put
(
enterprsieId
,
true
)
;
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getClerkCode
());
String
enterpriseId
=
store
.
getEnterpriseId
();
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
enterpriseId
,
staffClerkRelationDTO
.
getClerkCode
());
if
(
clerk
==
null
)
{
continue
;
}
...
...
@@ -154,7 +151,6 @@ public class StoreController extends WebBaseController {
if
(
wxEnterpriseDTO
==
null
)
{
continue
;
}
String
enterpriseId
=
clerk
.
getEnterpriseId
();
EnterpriseDTO
enterpriseDTO
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
if
(
enterpriseDTO
==
null
)
{
continue
;
...
...
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