Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rop-dj-strategy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 11450e02
authored
Jan 22, 2026
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix(merchant-staff): 支持根据状态列表查询商户员工并完善相关逻辑
1 parent
4d7704bb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
src/main/java/cn/com/glsx/dj/strategy/config/dubbo/MerchantDubboConfig.java
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantStaffController.java
src/test/java/cn/com/glsx/dj/strategy/controller/MerchantStaffControllerTest.java
src/main/java/cn/com/glsx/dj/strategy/config/dubbo/MerchantDubboConfig.java
View file @
11450e0
...
@@ -10,12 +10,12 @@ public class MerchantDubboConfig extends DubboConfig {
...
@@ -10,12 +10,12 @@ public class MerchantDubboConfig extends DubboConfig {
@Bean
@Bean
public
MerchantStaffRemote
merchantStaffRemote
()
{
public
MerchantStaffRemote
merchantStaffRemote
()
{
return
factory
.
builder
(
MerchantStaffRemote
.
class
).
version
(
"2.0.0"
).
check
(
check
)
/*.url("dubbo://localhost:2
0885
")*/
.
timeout
(
timeout
).
build
();
return
factory
.
builder
(
MerchantStaffRemote
.
class
).
version
(
"2.0.0"
).
check
(
check
)
/*.url("dubbo://localhost:2
2889
")*/
.
timeout
(
timeout
).
build
();
}
}
@Bean
@Bean
public
MerchantRoleRemote
merchantRoleRemote
()
{
public
MerchantRoleRemote
merchantRoleRemote
()
{
return
factory
.
builder
(
MerchantRoleRemote
.
class
).
version
(
"2.0.0"
).
check
(
check
)
/*.url("dubbo://localhost:2
0885
")*/
.
timeout
(
timeout
).
build
();
return
factory
.
builder
(
MerchantRoleRemote
.
class
).
version
(
"2.0.0"
).
check
(
check
)
/*.url("dubbo://localhost:2
2889
")*/
.
timeout
(
timeout
).
build
();
}
}
...
...
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantStaffController.java
View file @
11450e0
...
@@ -11,8 +11,10 @@ import cn.com.glsx.merchants.model.request.MerchantRoleRequest;
...
@@ -11,8 +11,10 @@ import cn.com.glsx.merchants.model.request.MerchantRoleRequest;
import
cn.com.glsx.merchants.model.request.MerchantStaffRequest
;
import
cn.com.glsx.merchants.model.request.MerchantStaffRequest
;
import
cn.com.glsx.merchants.model.request.StaffBatchRequest
;
import
cn.com.glsx.merchants.model.request.StaffBatchRequest
;
import
cn.com.glsx.merchants.model.request.wechatbinding.MerchantStaffListRequest
;
import
cn.com.glsx.merchants.model.request.wechatbinding.MerchantStaffListRequest
;
import
cn.com.glsx.merchants.model.response.MerchantBaseInfoResponse
;
import
cn.com.glsx.merchants.model.response.MerchantRoleResponse
;
import
cn.com.glsx.merchants.model.response.MerchantRoleResponse
;
import
cn.com.glsx.merchants.model.response.MerchantStaffResponse
;
import
cn.com.glsx.merchants.model.response.MerchantStaffResponse
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantRoleRemote
;
import
cn.com.glsx.merchants.remote.MerchantRoleRemote
;
import
cn.com.glsx.merchants.remote.MerchantStaffRemote
;
import
cn.com.glsx.merchants.remote.MerchantStaffRemote
;
import
com.alibaba.nacos.common.utils.CollectionUtils
;
import
com.alibaba.nacos.common.utils.CollectionUtils
;
...
@@ -39,6 +41,9 @@ public class MerchantStaffController {
...
@@ -39,6 +41,9 @@ public class MerchantStaffController {
private
MerchantStaffRemote
merchantStaffRemote
;
private
MerchantStaffRemote
merchantStaffRemote
;
@Autowired
@Autowired
private
MerchantRemote
merchantRemote
;
@Autowired
private
MerchantRoleRemote
merchantRoleRemote
;
private
MerchantRoleRemote
merchantRoleRemote
;
@ApiOperation
(
"添加员工"
)
@ApiOperation
(
"添加员工"
)
...
@@ -47,6 +52,9 @@ public class MerchantStaffController {
...
@@ -47,6 +52,9 @@ public class MerchantStaffController {
try
{
try
{
checkStaffExist
(
request
);
checkStaffExist
(
request
);
RpcResponse
<
Boolean
>
res
=
merchantStaffRemote
.
saveStaffRemote
(
buildMerchantStaffRequest
(
request
));
RpcResponse
<
Boolean
>
res
=
merchantStaffRemote
.
saveStaffRemote
(
buildMerchantStaffRequest
(
request
));
if
(
res
.
isFailed
())
{
return
RopResponse
.
error
(
res
);
}
return
RopResponse
.
success
(
res
.
getResult
());
return
RopResponse
.
success
(
res
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"addMerchantStaff occur error!"
,
e
);
log
.
info
(
"addMerchantStaff occur error!"
,
e
);
...
@@ -66,6 +74,7 @@ public class MerchantStaffController {
...
@@ -66,6 +74,7 @@ public class MerchantStaffController {
MerchantStaffListRequest
staffQuery
=
new
MerchantStaffListRequest
();
MerchantStaffListRequest
staffQuery
=
new
MerchantStaffListRequest
();
staffQuery
.
setMerchantIds
(
Lists
.
newArrayList
(
request
.
getMerchantId
()));
staffQuery
.
setMerchantIds
(
Lists
.
newArrayList
(
request
.
getMerchantId
()));
staffQuery
.
setStaffPhone
(
request
.
getStaffPhone
());
staffQuery
.
setStaffPhone
(
request
.
getStaffPhone
());
staffQuery
.
setStatusList
(
Lists
.
newArrayList
(
0
,
2
));
log
.
info
(
"查询员工列表参数:{}"
,
staffQuery
);
log
.
info
(
"查询员工列表参数:{}"
,
staffQuery
);
RpcResponse
<
List
<
MerchantStaffResponse
>>
staffListRes
=
merchantStaffRemote
.
selectStaffListByMerchantIdsAndPhone
(
staffQuery
);
RpcResponse
<
List
<
MerchantStaffResponse
>>
staffListRes
=
merchantStaffRemote
.
selectStaffListByMerchantIdsAndPhone
(
staffQuery
);
if
(
staffListRes
.
isFailed
())
{
if
(
staffListRes
.
isFailed
())
{
...
@@ -83,15 +92,22 @@ public class MerchantStaffController {
...
@@ -83,15 +92,22 @@ public class MerchantStaffController {
*/
*/
private
MerchantStaffRequest
buildMerchantStaffRequest
(
StrategyStaffRequest
request
)
{
private
MerchantStaffRequest
buildMerchantStaffRequest
(
StrategyStaffRequest
request
)
{
MerchantStaffRequest
staffRequest
=
new
MerchantStaffRequest
();
MerchantStaffRequest
staffRequest
=
new
MerchantStaffRequest
();
staffRequest
.
setMerchantId
(
request
.
getMerchantId
());
staffRequest
.
setStaffName
(
request
.
getStaffName
());
staffRequest
.
setStaffName
(
request
.
getStaffName
());
staffRequest
.
setStaffPhone
(
request
.
getStaffPhone
());
staffRequest
.
setStaffPhone
(
request
.
getStaffPhone
());
staffRequest
.
setPassword
(
"Gl123456"
);
staffRequest
.
setPassword
(
"Gl123456"
);
staffRequest
.
setVisibleInferiorMer
(
request
.
getMerchantId
().
toString
());
staffRequest
.
setVisibleInferiorMer
(
request
.
getMerchantId
().
toString
());
staffRequest
.
setCreatedAccount
(
CommonUtil
.
getPhone
()
);
staffRequest
.
setCreatedAccount
(
"lyj-test"
);
staffRequest
.
setCreatedName
(
CommonUtil
.
getUserName
()
);
staffRequest
.
setCreatedName
(
"lyj-test1"
);
staffRequest
.
setStaffLabel
(
request
.
getStaffLabel
());
staffRequest
.
setStaffLabel
(
request
.
getStaffLabel
());
staffRequest
.
setStaffBusinessType
(
0
);
staffRequest
.
setStaffBusinessType
(
0
);
// 查询商户主键
RpcResponse
<
MerchantBaseInfoResponse
>
merchantRes
=
merchantRemote
.
findMerchantBaseInfo
(
request
.
getMerchantId
());
if
(
merchantRes
.
isFailed
()
||
merchantRes
.
getResult
()
==
null
)
{
log
.
error
(
"查询商户信息失败,merchantId:{}, response:{}"
,
request
.
getMerchantId
(),
merchantRes
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERVICE_ERROR
,
"查询商户信息失败"
);
}
staffRequest
.
setMerchantId
(
merchantRes
.
getResult
().
getId
());
// 查找该门店的角色id
// 查找该门店的角色id
MerchantRoleRequest
roleQuery
=
new
MerchantRoleRequest
();
MerchantRoleRequest
roleQuery
=
new
MerchantRoleRequest
();
roleQuery
.
setMerchantNo
(
request
.
getMerchantId
());
roleQuery
.
setMerchantNo
(
request
.
getMerchantId
());
...
@@ -116,6 +132,9 @@ public class MerchantStaffController {
...
@@ -116,6 +132,9 @@ public class MerchantStaffController {
staffBatchRequest
.
setStatus
(
2
);
staffBatchRequest
.
setStatus
(
2
);
log
.
info
(
"禁用员工:{}"
,
staffBatchRequest
);
log
.
info
(
"禁用员工:{}"
,
staffBatchRequest
);
RpcResponse
<
Boolean
>
res
=
merchantStaffRemote
.
updateStaffStatusByPhone
(
staffBatchRequest
);
RpcResponse
<
Boolean
>
res
=
merchantStaffRemote
.
updateStaffStatusByPhone
(
staffBatchRequest
);
if
(
res
.
isFailed
())
{
return
RopResponse
.
error
(
res
);
}
return
RopResponse
.
success
(
res
.
getResult
());
return
RopResponse
.
success
(
res
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"disableMerchantStaff occur error!"
,
e
);
log
.
info
(
"disableMerchantStaff occur error!"
,
e
);
...
...
src/test/java/cn/com/glsx/dj/strategy/controller/MerchantStaffControllerTest.java
View file @
11450e0
...
@@ -16,8 +16,8 @@ public class MerchantStaffControllerTest extends BaseControllerTest {
...
@@ -16,8 +16,8 @@ public class MerchantStaffControllerTest extends BaseControllerTest {
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"dj.api.strategy.merchant.staff.add"
);
params
.
add
(
"method"
,
"dj.api.strategy.merchant.staff.add"
);
params
.
add
(
"merchantId"
,
"44209880"
);
params
.
add
(
"merchantId"
,
"44209880"
);
params
.
add
(
"staffPhone"
,
"1787551183
4
"
);
params
.
add
(
"staffPhone"
,
"1787551183
2
"
);
params
.
add
(
"staffName"
,
"林永健test00
1
"
);
params
.
add
(
"staffName"
,
"林永健test00
2
"
);
params
.
add
(
"staffLabel"
,
"0"
);
params
.
add
(
"staffLabel"
,
"0"
);
System
.
out
.
println
(
post
(
params
));
System
.
out
.
println
(
post
(
params
));
}
}
...
@@ -29,7 +29,7 @@ public class MerchantStaffControllerTest extends BaseControllerTest {
...
@@ -29,7 +29,7 @@ public class MerchantStaffControllerTest extends BaseControllerTest {
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>(
4
);
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>(
4
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"dj.api.strategy.merchant.staff.disable"
);
params
.
add
(
"method"
,
"dj.api.strategy.merchant.staff.disable"
);
params
.
add
(
"staffUuid"
,
"
alvin
"
);
params
.
add
(
"staffUuid"
,
"
f271537f982e4ce297f459ea98b51450
"
);
System
.
out
.
println
(
post
(
params
));
System
.
out
.
println
(
post
(
params
));
}
}
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment