Browse Source

定时任务 不更新 更新时间

master
PoffyZhang 1 year ago
parent
commit
6e4fcdba50
2 changed files with 26 additions and 29 deletions
  1. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  2. +26
    -28
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java View File

@@ -261,7 +261,6 @@ public class EmployeeBatchGetTask {
iUserInfoService.save(userInfo);
}else{
userInfo.setAvatar(dingEmployeeInfo.getAvatar());
userInfo.setUpdateOn(LocalDateTime.now());
iUserInfoService.updateById(userInfo);
}
}


+ 26
- 28
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java View File

@@ -108,37 +108,35 @@ public class AppIrsManage {

ApiResponse body = forEntity.getBody();

if(Objects.isNull(body)){
if(Objects.isNull(body) || Objects.isNull(body.getCode())
|| 0 != body.getCode()){
return Boolean.FALSE;
}

if(Objects.nonNull(body.getSuccess())
&& body.getSuccess()){
//保存关系
app.setAppCode(appCode);
if(applicationService.updateById(app)){
/**
* 判断下 如果成功的话 那么判断下 这个项目的初次创建的app 是否都已经被注册
* 如果都已经注册 要调用状态机 进入下一个状态
*/
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, project.getId()));
//筛选出 初次新建的app 但是没有appCode的
apps = apps.stream().filter(a -> {
if(CommonEnum.YES.getCode().equals(a.getIsFirst()) &&
StringUtils.isBlank(app.getAppCode())){
return Boolean.TRUE;
}
return Boolean.FALSE;
})
.collect(Collectors.toList());

//如果筛选出来的 为空的话 就调用状态机
if(CollUtil.isEmpty(apps)){
stateMachineUtils.pass(project);
project.setUpdateOn(LocalDateTime.now());
projectService.updateById(project);
}
//保存关系
app.setAppCode(appCode);
if(applicationService.updateById(app)){
/**
* 判断下 如果成功的话 那么判断下 这个项目的初次创建的app 是否都已经被注册
* 如果都已经注册 要调用状态机 进入下一个状态
*/
List<ProjectApplication> apps = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, project.getId()));
//筛选出 初次新建的app 但是没有appCode的
apps = apps.stream().filter(a -> {
if(CommonEnum.YES.getCode().equals(a.getIsFirst()) &&
StringUtils.isBlank(app.getAppCode())){
return Boolean.TRUE;
}
return Boolean.FALSE;
})
.collect(Collectors.toList());

//如果筛选出来的 为空的话 就调用状态机
if(CollUtil.isEmpty(apps)){
stateMachineUtils.pass(project);
project.setUpdateOn(LocalDateTime.now());
projectService.updateById(project);
}
}



Loading…
Cancel
Save