Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
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 307b487f
authored
Oct 13, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
4b565899
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
src/main/java/cn/com/glsx/merchants/controller/StaffController.java
src/main/java/cn/com/glsx/merchants/service/StaffService.java
src/main/java/cn/com/glsx/merchants/controller/StaffController.java
View file @
307b487
...
...
@@ -65,6 +65,24 @@ public class StaffController {
}
/**
* 更新员工状态
*
* @param staffUpdateStatusRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.staff.updateStatus"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"更新员工状态"
)
public
RopResponse
<
Boolean
>
updateStatus
(
StaffUpdateStatusRequest
staffUpdateStatusRequest
)
{
try
{
staffService
.
updateStatus
(
staffUpdateStatusRequest
);
return
RopResponse
.
success
(
true
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======StaffController__invoke__updateStaff__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 删除员工
*
* @param staffDeleteRequest 入参
...
...
src/main/java/cn/com/glsx/merchants/service/StaffService.java
View file @
307b487
...
...
@@ -70,7 +70,7 @@ public class StaffService {
private
MerchantStaffRequest
converRequest
(
StaffUpdateRequest
staffUpdateRequest
)
{
MerchantStaffRequest
merchantStaffRequest
=
ConvertRequest
.
convertRequest
(
staffUpdateRequest
,
new
MerchantStaffRequest
());
String
merchantFileRequest
=
staffUpdateRequest
.
getMerchantFileRequest
();
if
(
merchantFileRequest
!=
null
)
{
if
(
merchantFileRequest
!=
null
)
{
merchantStaffRequest
.
setMerchantFileRequest
(
JSONObject
.
parseObject
(
merchantFileRequest
,
MerchantFileRequest
.
class
));
}
return
merchantStaffRequest
;
...
...
@@ -147,21 +147,21 @@ public class StaffService {
*/
public
String
exportData
(
StaffExportRequest
staffExportRequest
)
{
MerchantStaffRequest
merchantStaffRequest
=
ConvertRequest
.
convertRequest
(
staffExportRequest
,
new
MerchantStaffRequest
());
log
.
info
(
"请求入参{}"
,
merchantStaffRequest
);
log
.
info
(
"请求入参{}"
,
merchantStaffRequest
);
RpcResponse
<
List
<
MerchantStaffResponse
>>
listRpcResponse
=
merchantStaffRemote
.
exportStaffRemote
(
ConvertRequest
.
convertRequest
(
staffExportRequest
,
new
MerchantStaffRequest
()));
if
(
listRpcResponse
.
isSuccess
())
{
List
<
StaffExportResponse
>
staffResponses
=
ConvertResponse
.
convertList
(
listRpcResponse
.
getResult
(),
StaffExportResponse
.
class
);
staffResponses
.
forEach
(
index
->
{
index
.
setCreateDate
(
DateUtils
.
format
(
index
.
getUpdatedTime
(),
DateUtils
.
NORMAL_DATE_TIME_PATTERN
));
});
int
num
=
0
;
int
num
=
0
;
for
(
StaffExportResponse
index
:
staffResponses
)
{
index
.
setCreateDate
(
DateUtils
.
format
(
index
.
getUpdatedTime
(),
DateUtils
.
NORMAL_DATE_TIME_PATTERN
));
index
.
setNum
(
num
+
1
);
index
.
setNum
(
num
+
1
);
num
++;
}
String
time
=
new
Date
().
getTime
()
+
""
;
String
filename
=
"员工列表"
+
time
;
String
time
=
new
Date
().
getTime
()
+
""
;
String
filename
=
"员工列表"
+
time
;
byte
[]
bytes
=
ExcelUtiles
.
exportGoodsExcel
(
staffResponses
,
StaffExportResponse
.
class
);
FileUploadServerData
fileUploadServerData
=
FileUploadUtil
.
uploadToFileSystem
(
systemProperty
.
getUploadFileUrl
(),
filename
,
bytes
,
"xlsx"
);
return
fileUploadServerData
.
getUrl
();
...
...
@@ -176,7 +176,19 @@ public class StaffService {
* @return
*/
public
void
updateValPerByStaffId
(
StaffUpdateValRequest
staffUpdateValRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
updateValPerByStaffId
(
ConvertRequest
.
convertRequest
(
staffUpdateValRequest
,
new
MerchantStaffRequest
()));
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
updateValPerByStaffId
(
ConvertRequest
.
convertRequest
(
staffUpdateValRequest
,
new
MerchantStaffRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
/**
* 更新员工状态
*
* @param staffUpdateStatusRequest 入参
*/
public
void
updateStatus
(
StaffUpdateStatusRequest
staffUpdateStatusRequest
)
{
RpcResponse
<
Boolean
>
booleanRpcResponse
=
merchantStaffRemote
.
updateStaffRemote
(
ConvertRequest
.
convertRequest
(
staffUpdateStatusRequest
,
new
MerchantStaffRequest
()));
if
(
booleanRpcResponse
.
isFailed
())
{
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
...
...
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