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
ee35946f
Commit
ee35946f
authored
Feb 03, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
转移操作日志处理
parent
774ee2f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
4 deletions
+47
-4
TransferActiveCodeDTO.java
.../com/gic/haoban/manage/api/dto/TransferActiveCodeDTO.java
+20
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+15
-2
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+12
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/TransferActiveCodeDTO.java
View file @
ee35946f
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
cn.hutool.core.collection.CollUtil
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -28,7 +30,7 @@ public class TransferActiveCodeDTO implements Serializable {
...
@@ -28,7 +30,7 @@ public class TransferActiveCodeDTO implements Serializable {
/**
/**
* 失败明细
* 失败明细
*/
*/
private
List
<
Map
<
String
,
String
>>
failedList
;
private
List
<
Map
<
String
,
String
>>
failedList
;
public
Integer
getTotalNum
()
{
public
Integer
getTotalNum
()
{
return
totalNum
;
return
totalNum
;
...
@@ -61,4 +63,21 @@ public class TransferActiveCodeDTO implements Serializable {
...
@@ -61,4 +63,21 @@ public class TransferActiveCodeDTO implements Serializable {
public
void
setFailedList
(
List
<
Map
<
String
,
String
>>
failedList
)
{
public
void
setFailedList
(
List
<
Map
<
String
,
String
>>
failedList
)
{
this
.
failedList
=
failedList
;
this
.
failedList
=
failedList
;
}
}
//操作日志记录
public
String
logRecord
()
{
StringBuilder
log
=
new
StringBuilder
();
log
.
append
(
"共需转移"
+
this
.
totalNum
+
",成功"
+
this
.
successNum
+
",失败"
+
this
.
failedNum
+
"。"
);
if
(
CollUtil
.
isNotEmpty
(
this
.
failedList
))
{
log
.
append
(
"失败明细:"
);
for
(
int
i
=
1
;
i
<=
this
.
failedList
.
size
();
i
++){
Map
<
String
,
String
>
stringMap
=
this
.
failedList
.
get
(
i
-
1
);
log
.
append
(
i
+
".(转移成员:"
+
stringMap
.
get
(
"handoverStaffName"
)+
",接收成员:"
+
stringMap
.
get
(
"takeoverStaffName"
)+
");"
);
}
//去掉末尾的分号
String
substring
=
log
.
substring
(
0
,
log
.
toString
().
length
()
-
1
);
return
substring
;
}
return
log
.
toString
();
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
ee35946f
...
@@ -970,11 +970,11 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -970,11 +970,11 @@ public class StaffApiServiceImpl implements StaffApiService {
});
});
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
List
<
AccountTransferUserDTO
>>
listServiceResponse
=
qywxOrderApiService
.
batchTransferLicense
(
serviceCorpid
,
openCorpid
,
accountTransferUserDTOList
);
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
List
<
AccountTransferUserDTO
>>
listServiceResponse
=
qywxOrderApiService
.
batchTransferLicense
(
serviceCorpid
,
openCorpid
,
accountTransferUserDTOList
);
logger
.
info
(
"转移成员返回结果:{}"
,
JSONObject
.
toJSONString
(
listServiceResponse
));
logger
.
info
(
"转移成员返回结果:{}"
,
JSONObject
.
toJSONString
(
listServiceResponse
));
int
successNum
=
0
,
failedNum
=
0
;
List
<
Map
<
String
,
String
>>
failedList
=
new
ArrayList
<>();
if
(
Constant
.
SUCCESS
.
equals
(
listServiceResponse
.
getCode
())){
if
(
Constant
.
SUCCESS
.
equals
(
listServiceResponse
.
getCode
())){
List
<
AccountTransferUserDTO
>
resultList
=
listServiceResponse
.
getResult
();
List
<
AccountTransferUserDTO
>
resultList
=
listServiceResponse
.
getResult
();
result
.
setTotalNum
(
resultList
.
size
());
result
.
setTotalNum
(
resultList
.
size
());
int
successNum
=
0
,
failedNum
=
0
;
List
<
Map
<
String
,
String
>>
failedList
=
new
ArrayList
<>();
for
(
AccountTransferUserDTO
dto
:
resultList
)
{
for
(
AccountTransferUserDTO
dto
:
resultList
)
{
if
(
Constant
.
SUCCESS
.
equals
(
dto
.
getErrcode
())){
if
(
Constant
.
SUCCESS
.
equals
(
dto
.
getErrcode
())){
//企微转移成功,好办staff表对应更新
//企微转移成功,好办staff表对应更新
...
@@ -1002,6 +1002,19 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1002,6 +1002,19 @@ public class StaffApiServiceImpl implements StaffApiService {
result
.
setFailedList
(
failedList
);
result
.
setFailedList
(
failedList
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
result
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
result
);
}
}
//企业微信接口调用失败,记录错误
result
.
setTotalNum
(
accountTransferUserDTOList
.
size
());
result
.
setSuccessNum
(
0
);
result
.
setFailedNum
(
accountTransferUserDTOList
.
size
());
accountTransferUserDTOList
.
stream
().
forEach
(
a
->{
TabHaobanStaff
handoverStaff
=
collect
.
get
(
map
.
get
(
a
.
getHandover_userid
()));
TabHaobanStaff
takeOverStaff
=
collect
.
get
(
map
.
get
(
a
.
getTakeover_userid
()));
Map
<
String
,
String
>
stringMap
=
new
HashMap
<>(
8
);
stringMap
.
put
(
"handoverStaffName"
,
handoverStaff
.
getStaffName
());
stringMap
.
put
(
"takeoverStaffName"
,
takeOverStaff
.
getStaffName
());
failedList
.
add
(
stringMap
);
});
result
.
setFailedList
(
failedList
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
listServiceResponse
.
getCode
(),
listServiceResponse
.
getMessage
(),
result
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
listServiceResponse
.
getCode
(),
listServiceResponse
.
getMessage
(),
result
);
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
ee35946f
...
@@ -10,8 +10,13 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -10,8 +10,13 @@ import com.alibaba.fastjson.JSONArray;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.log.LogRecordUserServiceImpl
;
import
com.gic.haoban.manage.web.qo.TransferActiveCodeQO
;
import
com.gic.haoban.manage.web.qo.TransferActiveCodeQO
;
import
com.gic.haoban.manage.web.vo.StaffActiveDataVO
;
import
com.gic.haoban.manage.web.vo.StaffActiveDataVO
;
import
com.gic.log.record.anno.GicLogRecord
;
import
com.gic.log.record.util.GicLogRecordCategoryEnum
;
import
com.gic.log.record.util.GicLogRecordEvaluationContext
;
import
com.gic.log.record.util.GicLogRecordOptTypeEnum
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -613,12 +618,18 @@ public class StaffController extends WebBaseController {
...
@@ -613,12 +618,18 @@ public class StaffController extends WebBaseController {
* 通讯录许可转移
* 通讯录许可转移
*/
*/
@RequestMapping
(
"staff-active-transfer"
)
@RequestMapping
(
"staff-active-transfer"
)
@GicLogRecord
(
value
=
"${#logValue}"
,
category
=
GicLogRecordCategoryEnum
.
HB_TXL
,
optType
=
GicLogRecordOptTypeEnum
.
HB_1003_01
,
userFunc
=
LogRecordUserServiceImpl
.
class
,
optPage
=
"好办通讯录许可转移"
)
public
RestResponse
transferActiveCode
(
@RequestBody
List
<
TransferActiveCodeQO
>
transferActiveCodeQOList
)
{
public
RestResponse
transferActiveCode
(
@RequestBody
List
<
TransferActiveCodeQO
>
transferActiveCodeQOList
)
{
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
WebLoginDTO
login
=
AuthWebRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQDTOList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
transferActiveCodeQOList
),
TransferActiveCodeQDTO
.
class
);
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQDTOList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
transferActiveCodeQOList
),
TransferActiveCodeQDTO
.
class
);
ServiceResponse
<
TransferActiveCodeDTO
>
transferActiveCodeDTOServiceResponse
=
staffApiService
.
batchTransferLicense
(
transferActiveCodeQDTOList
,
wxEnterpriseId
);
ServiceResponse
<
TransferActiveCodeDTO
>
transferActiveCodeDTOServiceResponse
=
staffApiService
.
batchTransferLicense
(
transferActiveCodeQDTOList
,
wxEnterpriseId
);
//保存操作日志
TransferActiveCodeDTO
result
=
transferActiveCodeDTOServiceResponse
.
getResult
();
if
(
null
!=
result
)
{
String
logs
=
result
.
logRecord
();
GicLogRecordEvaluationContext
.
putAttribute
(
"logValue"
,
logs
);
}
return
RestResponse
.
successResult
(
transferActiveCodeDTOServiceResponse
);
return
RestResponse
.
successResult
(
transferActiveCodeDTOServiceResponse
);
}
}
...
...
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