生成任务名称修改
continuous-integration/drone/push Build is passing Details

报错信息修改
yxy/生成PDF
YXY 1 year ago
parent 327e43f7db
commit 6bf5ad3a13

@ -2,6 +2,7 @@ package com.ruoyi.flyingbook.strategy;
import com.ruoyi.flyingbook.domain.RequestVo; import com.ruoyi.flyingbook.domain.RequestVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
/** /**
* @author yuxiangyong * @author yuxiangyong
@ -25,7 +26,7 @@ public abstract class LarkOperateAbstract{
}catch (Exception e){ }catch (Exception e){
log.error("{} execute error: {}",getName(),e); log.error("{} execute error: {}",getName(),e);
String message = e.getMessage(); String message = e.getMessage();
if (message.contains("##")){ if (StringUtils.isNotBlank(message) && message.contains("##")){
String[] split = message.split("##"); String[] split = message.split("##");
request.setErrorCode(split[0]); request.setErrorCode(split[0]);
request.setErrorMessage(split[1]); request.setErrorMessage(split[1]);

@ -1,6 +1,5 @@
package com.ruoyi.flyingbook.strategy.operate; package com.ruoyi.flyingbook.strategy.operate;
import cn.hutool.core.io.unit.DataUnit;
import com.lark.oapi.service.calendar.v4.model.*; import com.lark.oapi.service.calendar.v4.model.*;
import com.lark.oapi.service.task.v1.model.*; import com.lark.oapi.service.task.v1.model.*;
import com.ruoyi.common.enums.*; import com.ruoyi.common.enums.*;
@ -20,10 +19,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
@ -79,10 +77,13 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
} }
String operator = collaborators[0].getId(); String operator = collaborators[0].getId();
Follower[] followers = task.getFollowers(); Follower[] followers = task.getFollowers();
String[] followerIds = new String[collaborators.length]; String[] followerIds = null;
if (followers != null){
followerIds = new String[followers.length];
for (int i = 0; i < followers.length; i++) { for (int i = 0; i < followers.length; i++) {
followerIds[i] = followers[i].getId(); followerIds[i] = followers[i].getId();
} }
}
//待绑定日程用户 //待绑定日程用户
String[] taskFollowerArray = getArrayIntersection(collaboratorIds, followerIds); String[] taskFollowerArray = getArrayIntersection(collaboratorIds, followerIds);
//待解除绑定日程用户 //待解除绑定日程用户
@ -200,6 +201,7 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
Set<String> collaboratorIdSet = collaboratorIds != null ? new HashSet<String>(Arrays.asList(collaboratorIds)) : new HashSet<String>(); Set<String> collaboratorIdSet = collaboratorIds != null ? new HashSet<String>(Arrays.asList(collaboratorIds)) : new HashSet<String>();
Set<String> followerIdSet = followerIds != null ? new HashSet<String>(Arrays.asList(followerIds)) : new HashSet<String>(); Set<String> followerIdSet = followerIds != null ? new HashSet<String>(Arrays.asList(followerIds)) : new HashSet<String>();
collaboratorIdSet.addAll(followerIdSet); collaboratorIdSet.addAll(followerIdSet);
collaboratorIdSet = collaboratorIdSet.stream().filter(Objects::nonNull).collect(Collectors.toSet());
return collaboratorIdSet.toArray(new String[collaboratorIdSet.size()]); return collaboratorIdSet.toArray(new String[collaboratorIdSet.size()]);
} }

@ -79,7 +79,8 @@ public class MultidimensionalTableCreateTaskOperate extends LarkAbstract {
AppTableRecord record = respBody.getData().getRecord(); AppTableRecord record = respBody.getData().getRecord();
Map<String, Object> fields = record.getFields(); Map<String, Object> fields = record.getFields();
Object syncTaskCountObj = fields.get("批量同步任务数量"); Object syncTaskCountObj = fields.get("批量同步任务数量");
Object taskCreatorObj = fields.get("人员"); Object taskCreatorObj = fields.get("负责人");
Object taskName = fields.get("任务名称");
if(syncTaskCountObj == null || taskCreatorObj == null){ if(syncTaskCountObj == null || taskCreatorObj == null){
return; return;
} }
@ -96,7 +97,7 @@ public class MultidimensionalTableCreateTaskOperate extends LarkAbstract {
task.setCollaboratorIds(createrIdList); task.setCollaboratorIds(createrIdList);
larkTaskRequest.setTask(task); larkTaskRequest.setTask(task);
for (int i = 0;i < syncTaskCount;i++){ for (int i = 0;i < syncTaskCount;i++){
String createTaskTemplate = new StringBuilder("创建任务模板").append(i).toString(); String createTaskTemplate = new StringBuilder(String.valueOf(taskName)).append(i).toString();
task.setSummary(createTaskTemplate); task.setSummary(createTaskTemplate);
task.setDescription(createTaskTemplate); task.setDescription(createTaskTemplate);
larkTaskHelper.createTask(larkTaskRequest); larkTaskHelper.createTask(larkTaskRequest);

Loading…
Cancel
Save