1、同步待办时,暂时使用仿真组的固定用户作为项目经理

This commit is contained in:
2026-02-10 20:38:58 +08:00
parent 6d9d114363
commit a9a775eaed

View File

@@ -189,6 +189,13 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
@Value("${lyricTodoInterval:90}")
private int lyricTodoInterval;
// 拉取的EP项目设置项目经理权限时暂时写死为仿真组的19个用户
List<Long> epFixManagerUserIdList = Arrays.asList(2003641538857771009L,2003641499053826049L,2000891541365284865L,
2003641270736887809L,2000891541367895412L,2000891541367892039L,2017165368993247238L,2017165370440282114L,
2017165373720227852L,2017166413785972745L,2017166413785972746L,2017166413785972749L,2017166413785972753L,
2017166413785972755L,2017166413785972758L,2017166413785972774L,2017166413785972780L,2017166417586012738L,
2017166417586012737L);
/**
* 判断字符串是否可以安全转换为Long类型
*
@@ -2717,28 +2724,24 @@ public class LyricInternalServiceImpl implements ILyricInternalService {
// 批量创建文件夹
batchCreateNodeDir(addNodeList);
// 批量更新权限 2026-02-09授予权限,待后面设置项目经理时授予权限 (设置项目经理的权限需要控制好)
// List<BatchUpdatePermissionReq.FilePermissionItem> filePermissions = new ArrayList<>();
// for (SpdmProjectNodeEditReq addNode : addNodeList) {
// BatchUpdatePermissionReq.FilePermissionItem item = new BatchUpdatePermissionReq.FilePermissionItem();
// item.setUuid(addNode.getUuid());
// Map<Long, Byte> userPermissions = new HashMap<>();
// // 2026-02-09 因为项目视图中没有项目经理,这里将项目创建人当成项目经理
// userPermissions.put(jobNumber, FilePermissionEnum.ALL.getValue());
// item.setUserPermissions(userPermissions);
// filePermissions.add(item);
// }
// if (CollectionUtils.isNotEmpty(filePermissions)) {
// BatchUpdatePermissionReq batchReq = new BatchUpdatePermissionReq();
// batchReq.setFilePermissions(filePermissions);
// log.info("创建项目阶段时,批量更新权限,任务数量:{}", filePermissions.size());
// SdmResponse response = dataFeignClient.batchUpdatePermission(batchReq);
// log.info("创建项目阶段时,批量更新权限结果:{}", response);
// if (!response.isSuccess()) {
// log.error("批量更新权限失败:{}", response.getMessage());
// }
// }
// 批量更新权限 2026-02-10 先授予固定用户权限
List<BatchUpdatePermissionReq.FilePermissionItem> filePermissions = new ArrayList<>();
BatchUpdatePermissionReq.FilePermissionItem item = new BatchUpdatePermissionReq.FilePermissionItem();
item.setUuid(spdmProjectNodeEditReq.getUuid());
Map<Long, Byte> userPermissions = new HashMap<>();
for (Long userId : epFixManagerUserIdList) {
userPermissions.put(userId,FilePermissionEnum.ALL.getValue());
}
item.setUserPermissions(userPermissions);
filePermissions.add(item);
if (CollectionUtils.isNotEmpty(filePermissions)) {
BatchUpdatePermissionReq batchReq = new BatchUpdatePermissionReq();
batchReq.setFilePermissions(filePermissions);
log.info("同步待办拉取项目时,批量更新权限,数量为:{}",filePermissions.size());
SdmResponse response = dataFeignClient.batchUpdatePermission(batchReq);
log.info("同步待办拉取项目时,批量更新权限结果为:{}",response);
}
}