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
e6ec98a1
Commit
e6ec98a1
authored
Jul 12, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商户停用
parent
2199a536
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
10 deletions
+50
-10
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+48
-10
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+2
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
e6ec98a1
...
...
@@ -14,6 +14,7 @@ import com.gic.enterprise.api.dto.EnterpriseDTO;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StorePhotoDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseUseForbidService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.common.anno.IgnoreLogin
;
import
com.gic.haoban.common.utils.HaobanResponse
;
...
...
@@ -64,6 +65,8 @@ public class StoreController extends WebBaseController {
private
StaffApiService
staffApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
EnterpriseUseForbidService
enterpriseUseForbidService
;
/**
* 会员小程序-门店列表
...
...
@@ -95,22 +98,41 @@ public class StoreController extends WebBaseController {
}
//主门店
ClerkMainStoreRelatedDTO
mainDTO
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffId
);
String
s
toreId
=
mainDTO
==
null
?
""
:
mainDTO
.
getStoreId
();
String
mainS
toreId
=
mainDTO
==
null
?
""
:
mainDTO
.
getStoreId
();
Map
<
String
,
Boolean
>
map
=
new
HashMap
<>();
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
bindRelationList
)
{
boolean
enterpriseOver
=
isEnterpriseOver
(
staffClerkRelationDTO
.
getStoreId
())
;
if
(
enterpriseOver
)
{
logger
.
info
(
"该企业过期了:{},{},{}"
,
staffId
,
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getStoreId
());
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
{
boolean
enterpriseOver
=
isEnterpriseOver2
(
enterprsieId
);
if
(
enterpriseOver
)
{
logger
.
info
(
"该企业过期,{}"
,
staffId
,
enterprsieId
);
map
.
put
(
enterprsieId
,
false
)
;
continue
;
}
Integer
code
=
this
.
enterpriseUseForbidService
.
selectPermissionStatus
(
enterprsieId
,
"haoban-3"
)
;
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
());
if
(
clerk
==
null
)
{
continue
;
}
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
if
(
store
==
null
)
{
continue
;
}
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
continue
;
...
...
@@ -126,7 +148,7 @@ public class StoreController extends WebBaseController {
}
//主门店标志
int
mainStoreFlag
=
0
;
if
(
s
toreId
.
equals
(
store
.
getStoreId
()))
{
if
(
mainS
toreId
.
equals
(
store
.
getStoreId
()))
{
mainStoreFlag
=
1
;
}
EnterpriseDetailDTO
enterpriseDetailDTO
=
enterpriseTypeMap
.
get
(
enterpriseId
);
...
...
@@ -350,6 +372,22 @@ public class StoreController extends WebBaseController {
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
}
}
public
boolean
isEnterpriseOver2
(
String
enterpriseId
)
{
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
enterpriseId
);
if
(
enterprise
==
null
||
enterprise
.
getStatus
()
!=
1
)
{
return
true
;
}
if
(
enterprise
.
getExpireTime
()
==
null
)
{
if
(
enterprise
.
getEnabledState
()
==
null
)
{
return
false
;
}
else
{
return
enterprise
.
getEnabledState
()
!=
1
;
}
}
else
{
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
}
}
}
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
e6ec98a1
...
...
@@ -18,6 +18,8 @@
<!-- <dubbo:registry address="zookeeper://192.168.1.118:2181" protocol="dubbo" id="localAdd"/> -->
<!--<dubbo:registry address="zookeeper://115.159.182.172:2199" protocol="dubbo" id="remoteAdd"/>-->
<!--<dubbo:registry address="zookeeper://localhost:2181|zookeeper://115.159.182.172:2199" protocol="dubbo"/>-->
<dubbo:reference
interface=
"com.gic.enterprise.api.service.EnterpriseUseForbidService"
id=
"enterpriseUseForbidService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService"
id=
"staffDepartmentRelatedApiService"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.ClerkService"
id=
"clerkService"
/>
<dubbo:reference
interface=
"com.gic.haoban.data.api.service.HaobanDataApiService"
id=
"haobanDataApiService"
/>
...
...
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