From f11afb84d32ed6d2b582ed193db2f9805cd365ec Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 18 十二月 2023 15:13:32 +0800
Subject: [PATCH] 工作通知定时任务
---
ycl-platform/src/main/java/com/ycl/timer/GetDingUserOrgTimer.java | 56 ++++++++++++++++++++++++++++----------------------------
1 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/ycl-platform/src/main/java/com/ycl/timer/GetDingUserOrgTimer.java b/ycl-platform/src/main/java/com/ycl/timer/GetDingUserOrgTimer.java
index 0491949..453f87a 100644
--- a/ycl-platform/src/main/java/com/ycl/timer/GetDingUserOrgTimer.java
+++ b/ycl-platform/src/main/java/com/ycl/timer/GetDingUserOrgTimer.java
@@ -72,7 +72,8 @@
@Value("${spring.profiles.active}")
private String env;
- @Scheduled(cron = "0 0 1 * * ?") // 姣忓ぉ闆剁偣鎵ц
+
+ @Scheduled(cron = "0 00 00 * * ?") // 姣忓ぉ闆剁偣鎵ц
@Transactional(rollbackFor = Exception.class)
public void run() {
if ("online".equals(env)) {
@@ -115,13 +116,14 @@
/**
// * 鏍规嵁缁勭粐code 鏌ヨ 閫氳褰曚汉鍛樹俊鎭�
// */
- //鏌ヨ鐢ㄦ埛缁勭粐鍏宠仈琛�
- List<UmsDepartManage> empOrgList = departManageService.list();
//鏌ヨ鎵�鏈夌敤鎴�
Set<DingUserInfo> dingList = dingCommon.getPersonInfoByOrgCode();
Set<DingUserInfo> dingUsers = new HashSet<>(dingList);
- log.info("dinglistStart----->{}", dingList);
+
+ log.info("鏌ヨ鎵�鏈夌敤鎴�------->{}", dingUsers);
List<UmsAdmin> userList = umsAdminService.list();
+ //鏌ヨ鐢ㄦ埛缁勭粐鍏宠仈琛�
+ List<UmsDepartManage> empOrgList = departManageService.list();
Iterator<DingUserInfo> iterator = dingUsers.iterator();
while (iterator.hasNext()) {
DingUserInfo dingUserInfo = iterator.next();
@@ -142,7 +144,6 @@
}
- log.info("dinglistEnd----->{}", dingUsers);
ArrayList<UmsAdminRoleRelation> relations = new ArrayList<>();
// log.info(TAG + " elapsed time:" + timer.interval());
for (DingUserInfo dingUserInfo : dingUsers) {
@@ -158,7 +159,6 @@
}
//code
//accountId
- log.info("鍛樺伐璐︽埛id{}", dingUserInfo.getAccountId());
user.setAccountId(dingUserInfo.getAccountId());
//澶村儚
user.setIcon(dingUserInfo.getGovEmpAvatar());
@@ -177,30 +177,30 @@
//鐘舵�佷负鍋滅敤锛堜笉鍙敤鐘舵�侊級鐐瑰嚮鐧诲綍鍚庢墠鑳戒娇鐢�
user.setStatus(1);
umsAdminService.save(user);
-// //鍛樺伐淇℃伅锛屽叧鑱旂粍缁�
-// UmsDepartManage departManage = new UmsDepartManage();
-// departManage.setDepartId(dingUserInfo.getOrgId());
-// departManage.setIsLeader(0);
-// departManage.setUserId(dingUserInfo.getUserId());
-// departManageService.saveOrUpdate(departManage);
-// //瑙掕壊淇℃伅
-// List<String> roleCode = dingUserInfo.getRoleCodeList();
-// if (CollectionUtils.isNotEmpty(roleCode)) {
-// List<UmsRole> roleList = roleService.getRoleListByCodes(roleCode);
-// roleList.forEach(item -> {
-// UmsAdminRoleRelation relation = new UmsAdminRoleRelation();
-// relation.setAdminId(dingUserInfo.getUserId());
-// relation.setRoleId(item.getId());
-// relations.add(relation);
-// });
-// }
-// }
-// if (CollUtil.isNotEmpty(relations)) {
-// umsAdminRoleRelationService.saveBatch(relations, IService.DEFAULT_BATCH_SIZE);
+ //鍛樺伐淇℃伅锛屽叧鑱旂粍缁�
+ UmsDepartManage departManage = new UmsDepartManage();
+ departManage.setDepartId(dingUserInfo.getOrgId());
+ departManage.setIsLeader(0);
+ departManage.setUserId(dingUserInfo.getUserId());
+ departManageService.saveOrUpdate(departManage);
+ //瑙掕壊淇℃伅
+ List<String> roleCode = dingUserInfo.getRoleCodeList();
+ if (CollectionUtils.isNotEmpty(roleCode)) {
+ List<UmsRole> roleList = roleService.getRoleListByCodes(roleCode);
+ roleList.forEach(item -> {
+ UmsAdminRoleRelation relation = new UmsAdminRoleRelation();
+ relation.setAdminId(dingUserInfo.getUserId());
+ relation.setRoleId(item.getId());
+ relations.add(relation);
+ });
+ }
+ }
+ if (CollUtil.isNotEmpty(relations)) {
+ umsAdminRoleRelationService.saveBatch(relations, IService.DEFAULT_BATCH_SIZE);
}
log.info("鍚屾浠诲姟缁撴潫");
-// log.info(TAG + "update user size " + dingList.size());
-// getEmployeeAvatar();
+ log.info(TAG + "update user size " + dingList.size());
+ getEmployeeAvatar();
}
}
--
Gitblit v1.8.0