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 98a57a82
authored
Jan 27, 2026
by
林永健
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix(controller): 修正MerchantStaffController中的错误处理和日志信息
1 parent
22eab51e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantStaffController.java
src/main/java/cn/com/glsx/dj/strategy/controller/MerchantStaffController.java
View file @
98a57a8
...
@@ -3,6 +3,7 @@ package cn.com.glsx.dj.strategy.controller;
...
@@ -3,6 +3,7 @@ package cn.com.glsx.dj.strategy.controller;
import
cn.com.glsx.dj.smartcarlife.dto.StaffInfoDTO
;
import
cn.com.glsx.dj.smartcarlife.dto.StaffInfoDTO
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.smartcarlife.remote.StaffInfoRemote
;
import
cn.com.glsx.dj.strategy.request.StrategyStaffRequest
;
import
cn.com.glsx.dj.strategy.request.StrategyStaffRequest
;
import
cn.com.glsx.dj.strategy.uitl.CommonUtil
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.enums.DefaultErrorEnum
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
...
@@ -60,11 +61,11 @@ public class MerchantStaffController {
...
@@ -60,11 +61,11 @@ public class MerchantStaffController {
}
}
return
RopResponse
.
success
(
res
.
getResult
());
return
RopResponse
.
success
(
res
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"addMerchantStaff occur e
rror
!"
,
e
);
log
.
info
(
"addMerchantStaff occur e
xception
!"
,
e
);
return
RopResponse
.
error
(
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"addMerchantStaff occur error!"
,
e
);
log
.
info
(
"addMerchantStaff occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERV
ICE
_ERROR
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERV
ER
_ERROR
);
}
}
}
}
...
@@ -82,11 +83,11 @@ public class MerchantStaffController {
...
@@ -82,11 +83,11 @@ public class MerchantStaffController {
RpcResponse
<
List
<
MerchantStaffResponse
>>
staffListRes
=
merchantStaffRemote
.
selectStaffListByMerchantIdsAndPhone
(
staffQuery
);
RpcResponse
<
List
<
MerchantStaffResponse
>>
staffListRes
=
merchantStaffRemote
.
selectStaffListByMerchantIdsAndPhone
(
staffQuery
);
if
(
staffListRes
.
isFailed
())
{
if
(
staffListRes
.
isFailed
())
{
log
.
error
(
"查询员工列表失败,response:{}"
,
staffListRes
);
log
.
error
(
"查询员工列表失败,response:{}"
,
staffListRes
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ICE
_ERROR
,
staffListRes
.
getMessage
());
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ER
_ERROR
,
staffListRes
.
getMessage
());
}
}
if
(
CollectionUtils
.
isNotEmpty
(
staffListRes
.
getResult
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
staffListRes
.
getResult
()))
{
log
.
info
(
"员工已存在, staffIds:{}"
,
staffListRes
.
getResult
().
stream
().
map
(
MerchantStaffResponse:
:
getUuid
).
collect
(
Collectors
.
toList
()));
log
.
info
(
"员工已存在, staffIds:{}"
,
staffListRes
.
getResult
().
stream
().
map
(
MerchantStaffResponse:
:
getUuid
).
collect
(
Collectors
.
toList
()));
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ICE
_ERROR
,
"已存在员工账号"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ER
_ERROR
,
"已存在员工账号"
);
}
}
}
}
...
@@ -99,15 +100,15 @@ public class MerchantStaffController {
...
@@ -99,15 +100,15 @@ public class MerchantStaffController {
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
(
"lyj-test"
);
staffRequest
.
setCreatedAccount
(
CommonUtil
.
getUserName
()
);
staffRequest
.
setCreatedName
(
"lyj-test1"
);
staffRequest
.
setCreatedName
(
CommonUtil
.
getUserName
()
);
staffRequest
.
setStaffLabel
(
request
.
getStaffLabel
());
staffRequest
.
setStaffLabel
(
request
.
getStaffLabel
());
staffRequest
.
setStaffBusinessType
(
0
);
staffRequest
.
setStaffBusinessType
(
0
);
// 查询商户主键
// 查询商户主键
RpcResponse
<
MerchantBaseInfoResponse
>
merchantRes
=
merchantRemote
.
findMerchantBaseInfo
(
request
.
getMerchantId
());
RpcResponse
<
MerchantBaseInfoResponse
>
merchantRes
=
merchantRemote
.
findMerchantBaseInfo
(
request
.
getMerchantId
());
if
(
merchantRes
.
isFailed
()
||
merchantRes
.
getResult
()
==
null
)
{
if
(
merchantRes
.
isFailed
()
||
merchantRes
.
getResult
()
==
null
)
{
log
.
error
(
"查询商户信息失败,merchantId:{}, response:{}"
,
request
.
getMerchantId
(),
merchantRes
);
log
.
error
(
"查询商户信息失败,merchantId:{}, response:{}"
,
request
.
getMerchantId
(),
merchantRes
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ICE
_ERROR
,
"查询商户信息失败"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ER
_ERROR
,
"查询商户信息失败"
);
}
}
staffRequest
.
setMerchantId
(
merchantRes
.
getResult
().
getId
());
staffRequest
.
setMerchantId
(
merchantRes
.
getResult
().
getId
());
...
@@ -119,7 +120,7 @@ public class MerchantStaffController {
...
@@ -119,7 +120,7 @@ public class MerchantStaffController {
RpcResponse
<
List
<
MerchantRoleResponse
>>
roleListRes
=
merchantRoleRemote
.
getRoleListRemote
(
roleQuery
);
RpcResponse
<
List
<
MerchantRoleResponse
>>
roleListRes
=
merchantRoleRemote
.
getRoleListRemote
(
roleQuery
);
if
(!
roleListRes
.
hasResult
()
||
CollectionUtils
.
isEmpty
(
roleListRes
.
getResult
()))
{
if
(!
roleListRes
.
hasResult
()
||
CollectionUtils
.
isEmpty
(
roleListRes
.
getResult
()))
{
log
.
error
(
"查询角色列表失败,response:{}"
,
roleListRes
);
log
.
error
(
"查询角色列表失败,response:{}"
,
roleListRes
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ICE
_ERROR
,
"门店驻店人员角色不存在"
);
throw
new
RpcServiceException
(
DefaultErrorEnum
.
SERV
ER
_ERROR
,
"门店驻店人员角色不存在"
);
}
}
Integer
roleId
=
roleListRes
.
getResult
().
get
(
0
).
getId
();
Integer
roleId
=
roleListRes
.
getResult
().
get
(
0
).
getId
();
staffRequest
.
setRoleIds
(
Lists
.
newArrayList
(
roleId
));
staffRequest
.
setRoleIds
(
Lists
.
newArrayList
(
roleId
));
...
@@ -137,11 +138,11 @@ public class MerchantStaffController {
...
@@ -137,11 +138,11 @@ public class MerchantStaffController {
}
}
return
RopResponse
.
success
(
res
.
getResult
());
return
RopResponse
.
success
(
res
.
getResult
());
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"disableMerchantStaff occur e
rror
!"
,
e
);
log
.
info
(
"disableMerchantStaff occur e
xception
!"
,
e
);
return
RopResponse
.
error
(
e
);
return
RopResponse
.
error
(
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"disableMerchantStaff occur error!"
,
e
);
log
.
info
(
"disableMerchantStaff occur error!"
,
e
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERV
ICE
_ERROR
);
return
RopResponse
.
result
(
DefaultErrorEnum
.
SERV
ER
_ERROR
);
}
}
}
}
...
...
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