Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-module-job
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-module-job
Commits
af8221d3
提交
af8221d3
authored
1月 14, 2026
作者:
000516
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
人员离职时,T100同步禁用此用户
上级
cf9e643c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
82 行增加
和
1 行删除
+82
-1
DeptAndUserServiceImpl.java
...va/com/sfa/job/service/system/DeptAndUserServiceImpl.java
+21
-0
T100Util.java
src/main/java/com/sfa/job/util/T100Util.java
+32
-1
T100UtilTest.java
src/test/java/com/sfa/job/util/T100UtilTest.java
+29
-0
没有找到文件。
src/main/java/com/sfa/job/service/system/DeptAndUserServiceImpl.java
浏览文件 @
af8221d3
...
...
@@ -5,9 +5,12 @@ import com.alibaba.fastjson2.JSONObject;
import
com.sfa.common.core.utils.sdk.FeiShuUtil
;
import
com.sfa.job.domain.qince.dao.IQinceEmployeeDao
;
import
com.sfa.job.domain.system.dao.ISysDeptDao
;
import
com.sfa.job.domain.system.dao.ISysEventLogDao
;
import
com.sfa.job.domain.system.dao.ISysUserDao
;
import
com.sfa.job.domain.system.entity.SysDept
;
import
com.sfa.job.pojo.response.SysEventLogDto
;
import
com.sfa.job.util.QinCeUtils
;
import
com.sfa.job.util.T100Util
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -35,7 +38,11 @@ public class DeptAndUserServiceImpl implements IDeptAndUserService {
@Autowired
private
IQinceEmployeeDao
qinceEmployeeDao
;
@Autowired
private
ISysEventLogDao
sysEventLogDao
;
@Autowired
private
QinCeUtils
qinCeUtils
;
@Autowired
private
T100Util
t100Util
;
/**
* 从飞书同步全量部门信息
*/
...
...
@@ -92,6 +99,20 @@ public class DeptAndUserServiceImpl implements IDeptAndUserService {
}
catch
(
Exception
e
){
log
.
error
(
"勤策接口禁用用户异常,详情:{}"
,
e
.
getMessage
());
}
// 3、T100人员离职
try
{
JSONObject
json
=
new
JSONObject
();
String
msg
=
t100Util
.
userResigned
(
employeeNo
,
"X"
,
json
);
SysEventLogDto
eventDto
=
new
SysEventLogDto
()
.
setEventName
(
"T100 user status"
)
.
setEventGroup
(
"T100 user"
)
.
setRequestMsg
(
JSONObject
.
toJSONString
(
json
))
.
setResponseMsg
(
msg
);
sysEventLogDao
.
insert
(
eventDto
);
}
catch
(
Exception
e
){
log
.
error
(
"T100接口禁用用户异常,详情:{}"
,
e
.
getMessage
());
}
}
@Override
...
...
src/main/java/com/sfa/job/util/T100Util.java
浏览文件 @
af8221d3
...
...
@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -72,7 +73,6 @@ public class T100Util {
String
msg
=
body
.
replaceAll
(
"\n"
,
""
);
log
.
info
(
"T100-AU-USER结果:{}"
,
msg
);
return
msg
;
}
private
JSONObject
getHost
(){
...
...
@@ -84,4 +84,35 @@ public class T100Util {
host
.
put
(
"timestamp"
,
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_MS_PATTERN
));
return
host
;
}
public
String
userResigned
(
String
employeeNo
,
String
userStatus
,
JSONObject
json
)
{
json
.
put
(
"host"
,
getHost
());
json
.
putObject
(
"service"
).
put
(
"name"
,
"upd_azzi800"
);
JSONObject
datakey
=
new
JSONObject
();
datakey
.
put
(
"CompanyId"
,
"BJHQ"
);
datakey
.
put
(
"EntId"
,
entId
);
json
.
put
(
"datakey"
,
datakey
);
JSONObject
userJson
=
new
JSONObject
();
userJson
.
put
(
"gzxa001"
,
employeeNo
);
userJson
.
put
(
"gzxastus"
,
userStatus
);
json
.
putObject
(
"payload"
).
putObject
(
"std_data"
).
putObject
(
"parameter"
).
put
(
"detail"
,
Arrays
.
asList
(
userJson
));
log
.
info
(
"T100-USE-STATUS参数:{}"
,
json
);
String
body
=
HttpUtil
.
createPost
(
url
).
addHeaders
(
getHeader
()).
body
(
json
.
toString
()).
execute
().
body
();
String
msg
=
body
.
replaceAll
(
"\n"
,
""
);
log
.
info
(
"T100-USE-STATUS结果:{}"
,
msg
);
return
msg
;
}
public
HashMap
<
String
,
String
>
getHeader
(){
HashMap
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"Content-Type"
,
"application/json;charset=utf-8"
);
header
.
put
(
"digi-protocol"
,
"raw"
);
header
.
put
(
"digi-srvver"
,
"1.0"
);
header
.
put
(
"digi-srvcode"
,
"000"
);
header
.
put
(
"digi-type"
,
"sync"
);
header
.
put
(
"digi-key"
,
"f63b06af224e90ea3f9f08e0226fc91e"
);
return
header
;
}
}
src/test/java/com/sfa/job/util/T100UtilTest.java
0 → 100644
浏览文件 @
af8221d3
package
com
.
sfa
.
job
.
util
;
import
com.alibaba.fastjson2.JSONObject
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
junit
.
Assert
.*;
/**
* @author : liqiulin
* @date : 2026-01-13 18
* @describe :
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
T100UtilTest
{
@Autowired
private
T100Util
t100Util
;
@Test
public
void
userResigned
()
{
// JSONObject json = new JSONObject();
// t100Util.userResigned("000043","X",json);
// System.out.println(json.toString());
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论