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
c1dbc892
Commit
c1dbc892
authored
Aug 20, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h5托管授权
parent
aa832c0a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
32 deletions
+69
-32
QywxOpenController.java
...haoban/manage/web/controller/open/QywxOpenController.java
+31
-32
OpenClerkVO.java
...n/java/com/gic/haoban/manage/web/vo/open/OpenClerkVO.java
+38
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/open/QywxOpenController.java
View file @
c1dbc892
...
@@ -31,6 +31,7 @@ import com.gic.haoban.manage.api.service.StaffApiService;
...
@@ -31,6 +31,7 @@ import com.gic.haoban.manage.api.service.StaffApiService;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.web.qo.open.OpenStaffQO
;
import
com.gic.haoban.manage.web.qo.open.OpenStaffQO
;
import
com.gic.haoban.manage.web.utils.ImportExcelUtil
;
import
com.gic.haoban.manage.web.utils.ImportExcelUtil
;
import
com.gic.haoban.manage.web.vo.open.OpenClerkVO
;
import
com.gic.haoban.manage.web.vo.open.OpenQwAccountInfoVO
;
import
com.gic.haoban.manage.web.vo.open.OpenQwAccountInfoVO
;
import
com.gic.haoban.manage.web.vo.open.OpenStaffVO
;
import
com.gic.haoban.manage.web.vo.open.OpenStaffVO
;
import
com.gic.qcloud.BucketNameEnum
;
import
com.gic.qcloud.BucketNameEnum
;
...
@@ -173,11 +174,26 @@ public class QywxOpenController {
...
@@ -173,11 +174,26 @@ public class QywxOpenController {
* @return
* @return
*/
*/
@RequestMapping
(
"login-init"
)
@RequestMapping
(
"login-init"
)
public
RestResponse
<
OpenStaffDTO
>
init
(
String
staffId
,
@RequestParam
(
defaultValue
=
"0"
)
int
loginAgainFlag
)
{
@IgnoreLogin
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
public
RestResponse
<
OpenStaffDTO
>
init
(
String
staffId
,
@RequestParam
(
defaultValue
=
"0"
)
int
loginAgainFlag
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
enterpriseId
=
login
.
getEnterpriseId
();
ServiceResponse
<
OpenStaffDTO
>
staffResp
=
this
.
openStaffApiService
.
getByStaffId
(
staffId
)
;
ServiceResponse
<
OpenStaffDTO
>
staffResp
=
this
.
openStaffApiService
.
getByStaffId
(
staffId
)
;
if
(
null
!=
loginUser
)
{
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
enterpriseId
=
loginUser
.
getEnterpriseId
();
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
enterpriseId
,
staffId
))
{
return
RestResponse
.
failure
(
"9999"
,
"参数为空"
)
;
}
}
else
{
// 未登录直接通过参数授权
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
enterpriseId
,
staffId
))
{
return
RestResponse
.
failure
(
"9999"
,
"参数为空"
)
;
}
OpenStaffDTO
openStaff
=
staffResp
.
getResult
()
;
if
(
null
!=
openStaff
&&
openStaff
.
getStatusFlag
()==
1
)
{
return
RestResponse
.
failure
(
"9999"
,
"导购账号已授权"
)
;
}
}
String
checkMsg
=
this
.
check
(
wxEnterpriseId
,
enterpriseId
,
null
!=
staffResp
.
getResult
());
String
checkMsg
=
this
.
check
(
wxEnterpriseId
,
enterpriseId
,
null
!=
staffResp
.
getResult
());
if
(
null
!=
checkMsg
)
{
if
(
null
!=
checkMsg
)
{
return
RestResponse
.
failure
(
"9999"
,
checkMsg
);
return
RestResponse
.
failure
(
"9999"
,
checkMsg
);
...
@@ -198,7 +214,8 @@ public class QywxOpenController {
...
@@ -198,7 +214,8 @@ public class QywxOpenController {
ClerkDTO
clerk
=
this
.
clerkService
.
getclerkById
(
clerkId
)
;
ClerkDTO
clerk
=
this
.
clerkService
.
getclerkById
(
clerkId
)
;
o
.
setClerkType
(
clerk
.
getClerkType
());
o
.
setClerkType
(
clerk
.
getClerkType
());
});
});
relationList
=
relationList
.
stream
().
filter
(
o
->
o
.
getClerkType
()
<=
1
&&
o
.
getEnterpriseId
().
equals
(
enterpriseId
)).
collect
(
Collectors
.
toList
());
String
_enterpriseId
=
enterpriseId
;
relationList
=
relationList
.
stream
().
filter
(
o
->
o
.
getClerkType
()
<=
1
&&
o
.
getEnterpriseId
().
equals
(
_enterpriseId
)).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
relationList
))
{
if
(
CollectionUtils
.
isEmpty
(
relationList
))
{
return
RestResponse
.
failure
(
"9999"
,
"成员需关联gic商户下导购"
);
return
RestResponse
.
failure
(
"9999"
,
"成员需关联gic商户下导购"
);
}
}
...
@@ -366,7 +383,7 @@ public class QywxOpenController {
...
@@ -366,7 +383,7 @@ public class QywxOpenController {
*/
*/
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"open-qrcode-for-clerk"
)
@RequestMapping
(
"open-qrcode-for-clerk"
)
public
RestResponse
<
Open
StaffDT
O
>
cancelOpenStaff
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
clerkCode
)
{
public
RestResponse
<
Open
ClerkV
O
>
cancelOpenStaff
(
String
wxEnterpriseId
,
String
enterpriseId
,
String
clerkCode
)
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
enterpriseId
,
clerkCode
))
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
enterpriseId
,
clerkCode
))
{
return
RestResponse
.
failure
(
"9999"
,
"参数为空"
)
;
return
RestResponse
.
failure
(
"9999"
,
"参数为空"
)
;
}
}
...
@@ -374,38 +391,20 @@ public class QywxOpenController {
...
@@ -374,38 +391,20 @@ public class QywxOpenController {
if
(
null
==
clerk
)
{
if
(
null
==
clerk
)
{
return
RestResponse
.
failure
(
"9999"
,
"该账号在当前企业下不存在"
)
;
return
RestResponse
.
failure
(
"9999"
,
"该账号在当前企业下不存在"
)
;
}
}
if
(
clerk
.
getClerkType
()
>
1
)
{
return
RestResponse
.
failure
(
"9999"
,
"非导购"
)
;
}
String
clerkId
=
clerk
.
getClerkId
()
;
String
clerkId
=
clerk
.
getClerkId
()
;
StaffClerkRelationDTO
staffClerkRelationDTO
=
this
.
staffClerkRelationApiService
.
getByClerkId
(
clerkId
)
;
StaffClerkRelationDTO
staffClerkRelationDTO
=
this
.
staffClerkRelationApiService
.
getByClerkId
(
clerkId
)
;
if
(
null
==
staffClerkRelationDTO
)
{
if
(
null
==
staffClerkRelationDTO
)
{
return
RestResponse
.
failure
(
"9999"
,
"该账号未绑定好办小程序"
)
;
return
RestResponse
.
failure
(
"9999"
,
"该账号未绑定好办小程序"
)
;
}
}
String
staffId
=
staffClerkRelationDTO
.
getStaffId
()
;
String
staffId
=
staffClerkRelationDTO
.
getStaffId
()
;
ServiceResponse
<
OpenStaffDTO
>
staffResp
=
this
.
openStaffApiService
.
getByStaffId
(
staffId
)
;
OpenClerkVO
vo
=
new
OpenClerkVO
()
;
if
(!
staffResp
.
isSuccess
()
||
null
==
staffResp
.
getResult
())
{
vo
.
setClerkId
(
clerkId
);
return
RestResponse
.
failure
(
"9999"
,
"此成员未添加到授权列表"
)
;
vo
.
setStoreId
(
clerk
.
getStoreId
());
}
vo
.
setStaffId
(
staffId
);
OpenStaffDTO
openStaff
=
staffResp
.
getResult
()
;
return
RestResponse
.
successResult
(
vo
);
if
(
openStaff
.
getStatusFlag
()==
1
)
{
return
RestResponse
.
failure
(
"9999"
,
"导购账号已授权"
)
;
}
String
checkMsg
=
this
.
check
(
wxEnterpriseId
,
enterpriseId
,
true
);
if
(
null
!=
checkMsg
)
{
return
RestResponse
.
failure
(
"9999"
,
checkMsg
);
}
OpenStaffInitQDTO
initQDTO
=
new
OpenStaffInitQDTO
();
initQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
initQDTO
.
setEnterpriseId
(
enterpriseId
);
initQDTO
.
setStaffId
(
staffId
);
initQDTO
.
setLoginAgainFlag
(
0
);
ServiceResponse
<
OpenStaffDTO
>
initResp
=
this
.
openStaffApiService
.
init
(
initQDTO
);
if
(!
initResp
.
isSuccess
())
{
return
RestResponse
.
failure
(
"9999"
,
initResp
.
getMessage
());
}
OpenStaffDTO
openStaffDTO
=
initResp
.
getResult
();
openStaffDTO
.
setStaffName
(
staffClerkRelationDTO
.
getStaffName
());
StaffDTO
staff
=
this
.
staffApiService
.
selectById
(
openStaffDTO
.
getStaffId
());
openStaffDTO
.
setStaffHeadImg
(
staff
.
getHeadImg
());
return
RestResponse
.
successResult
(
openStaffDTO
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/open/OpenClerkVO.java
0 → 100644
View file @
c1dbc892
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
.
open
;
import
java.io.Serializable
;
public
class
OpenClerkVO
implements
Serializable
{
/**
* 成员id
*/
private
String
staffId
;
private
String
clerkId
;
private
String
storeId
;
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
public
String
getStaffId
()
{
return
staffId
;
}
public
void
setStaffId
(
String
staffId
)
{
this
.
staffId
=
staffId
;
}
}
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