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
a2615aab
Commit
a2615aab
authored
May 17, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好办登录
parent
d1507cce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
WxEnterpriseRelatedApiService.java
...ban/manage/api/service/WxEnterpriseRelatedApiService.java
+2
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+25
-0
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+8
-7
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseRelatedApiService.java
View file @
a2615aab
...
...
@@ -86,6 +86,8 @@ public interface WxEnterpriseRelatedApiService {
* @return
*/
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
);
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
,
String
clerkPhoneNumber
);
/**
* 根据商户id 获取所有被绑定分组
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
a2615aab
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.RightService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
...
...
@@ -72,6 +75,8 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
private
StoreService
storeService
;
@Autowired
private
RightService
rightService
;
@Autowired
private
ClerkService
clerkService
;
/**
* 查询好办所有的企业id
...
...
@@ -490,6 +495,26 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
List
<
WxEnterpriseDTO
>
ret
=
EntityUtil
.
changeEntityListNew
(
WxEnterpriseDTO
.
class
,
wxEnterprises
);
return
ret
;
}
@Override
public
List
<
WxEnterpriseDTO
>
listWxEnterpriseByEid
(
String
enterpriseId
,
String
clerkPhoneNumber
)
{
List
<
WxEnterpriseDTO
>
list
=
new
ArrayList
<>();
ClerkDTO
clerk
=
this
.
clerkService
.
getUserByPhoneNumber
(
clerkPhoneNumber
,
enterpriseId
);
if
(
null
==
clerk
||
StringUtils
.
isBlank
(
clerk
.
getHbEnt
()))
{
return
list
;
}
List
<
WxEnterpriseDTO
>
dtoList
=
this
.
listWxEnterpriseByEid
(
enterpriseId
)
;
logger
.
info
(
"用户管辖微信企业phone={},hbEnt={},dtoList={}"
,
clerkPhoneNumber
,
clerk
.
getHbEnt
(),
JSON
.
toJSONString
(
dtoList
));
if
(
CollectionUtils
.
isEmpty
(
dtoList
))
{
return
list
;
}
for
(
WxEnterpriseDTO
item
:
dtoList
)
{
if
(
clerk
.
getHbEnt
().
contains
(
item
.
getWxEnterpriseId
()))
{
list
.
add
(
item
)
;
}
}
return
list
;
}
@Override
public
List
<
StoreRangeInfoDTO
>
listAllBindStoreOrGroup
(
String
enterpriseId
)
{
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
a2615aab
...
...
@@ -186,7 +186,7 @@ public class LoginController extends WebBaseController {
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
o
);
String
gicEnterpriseId
=
jsonObject
.
getString
(
"enterpriseId"
);
String
loginPhoneNumber
=
jsonObject
.
getString
(
"phoneNumber"
);
List
<
WxEnterpriseDTO
>
enterpriseDTOList
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
);
List
<
WxEnterpriseDTO
>
enterpriseDTOList
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
,
loginPhoneNumber
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseDTOList
))
{
logger
.
info
(
"登录失败,不存在对应企业:{}"
,
o
);
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-3/#/gic-error"
,
false
,
false
));
...
...
@@ -358,8 +358,9 @@ public class LoginController extends WebBaseController {
logger
.
info
(
o
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
o
);
String
gicEnterpriseId
=
jsonObject
.
getString
(
"enterpriseId"
);
String
phoneNumber
=
jsonObject
.
getString
(
"phoneNumber"
)
;
String
wxEnterpriseId
=
jsonObject
.
getString
(
"wxEnterpriseId"
);
List
<
WxEnterpriseDTO
>
enterpriseDTOList
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
);
List
<
WxEnterpriseDTO
>
enterpriseDTOList
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
,
phoneNumber
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseDTOList
))
{
logger
.
info
(
"登录失败,不存在对应企业:{}"
,
o
);
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
...
...
@@ -395,11 +396,11 @@ public class LoginController extends WebBaseController {
}
@RequestMapping
(
"/gic-login-check"
)
public
ModelAndView
gicLogin
(
String
c
ode
,
String
hbEnt
)
{
logger
.
info
(
"gic登录c
ode={},hbEnt={}"
,
code
,
hbEnt
);
PowerClerkDTO
clerkDTO
=
this
.
userService
.
haobanLoginBack
(
c
ode
);
public
ModelAndView
gicLogin
(
String
c
lerkId
,
String
hbEnt
)
{
logger
.
info
(
"gic登录c
lerkId={},hbEnt={}"
,
clerkId
,
hbEnt
);
PowerClerkDTO
clerkDTO
=
this
.
userService
.
haobanLoginBack
(
c
lerkId
);
if
(
clerkDTO
==
null
)
{
logger
.
info
(
"登录失败,code失效:{}"
,
c
ode
);
logger
.
info
(
"登录失败,code失效:{}"
,
c
lerkId
);
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-web/#/gic-error"
,
false
));
return
model
;
}
...
...
@@ -420,7 +421,7 @@ public class LoginController extends WebBaseController {
new
RedirectView
(
"/haoban-3/#/loginMore?random="
+
random
,
false
,
false
));
return
model
;
}
logger
.
info
(
"登录失败,code失效:{}"
,
c
ode
);
logger
.
info
(
"登录失败,code失效:{}"
,
c
lerkId
);
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-web/#/gic-error"
,
false
));
return
model
;
}
...
...
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