日历同步

于相涌/robot_optimize
YXY 1 year ago
parent 085b806494
commit 0e2d9934c8

@ -6,6 +6,7 @@ import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Date;
@ -149,9 +150,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
}
public static LocalDateTime long2ldt(long time) {
Instant instant = Instant.ofEpochMilli(time);
ZoneId zone = ZoneId.systemDefault();
return LocalDateTime.ofInstant(instant, zone);
return LocalDateTime.ofInstant(Instant.ofEpochSecond(time), ZoneOffset.ofHours(8));
}
public static String long2Str(long time, String pattern) {

@ -36,7 +36,7 @@ public class LarkApprovalHelper extends LarkHelper{
if (getInstanceResp.getCode() == 0){
return getInstanceResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkApprovalHelper.getApprovalInfoDetail", JSONObject.toJSONString(getInstanceResp.getError()),request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkApprovalHelper.getApprovalInfoDetail", getInstanceResp.getMsg(),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkApprovalHelper.getApprovalInfoDetail",e.getMessage(),request).getErrorMessageBody());

@ -1,8 +1,6 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.alibaba.fastjson.JSONObject;
import com.lark.oapi.core.response.EmptyData;
import com.lark.oapi.service.calendar.v4.enums.BatchDeleteCalendarEventAttendeeUserIdTypeEnum;
import com.lark.oapi.service.calendar.v4.model.*;
import com.ruoyi.flyingbook.domain.lark.LarkCalendarRequest;
import com.ruoyi.flyingbook.domain.lark.LarkException;
@ -42,7 +40,7 @@ public class LarkCalendarHelper extends LarkHelper {
if (primary.getCode() == 0) {
return primary.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(primary.getError()), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", primary.getMsg(), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
@ -67,10 +65,10 @@ public class LarkCalendarHelper extends LarkHelper {
if (list.getCode() == 0) {
return list.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(list.getError()), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.getCalendarDetail", list.getMsg(), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.getCalendarDetail", e.getMessage(), request).getErrorMessageBody());
}
}
@ -112,10 +110,10 @@ public class LarkCalendarHelper extends LarkHelper {
if (createCalendarEventResp.getCode() == 0) {
return createCalendarEventResp.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(createCalendarEventResp.getError()), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.createCalendarDetail", createCalendarEventResp.getMsg(), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.createCalendarDetail", e.getMessage(), request).getErrorMessageBody());
}
}
@ -136,6 +134,7 @@ public class LarkCalendarHelper extends LarkHelper {
.summary(request.getSummary())
.needNotification(request.getNeedNotification())
.attendeeAbility(request.getAttendeeAbility())
.description(request.getDesc())
.startTime(
TimeInfo.newBuilder()
.timezone(request.getTimeZone())
@ -156,10 +155,10 @@ public class LarkCalendarHelper extends LarkHelper {
if (patch.getCode() == 0) {
return patch.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(patch.getError()), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.updateCalendarDetail", patch.getMsg(), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.updateCalendarDetail", e.getMessage(), request).getErrorMessageBody());
}
}
@ -188,10 +187,10 @@ public class LarkCalendarHelper extends LarkHelper {
if (createCalendarEventAttendeeResp.getCode() == 0) {
return createCalendarEventAttendeeResp.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(createCalendarEventAttendeeResp.getError()), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.attendeesCalendarDetail", createCalendarEventAttendeeResp.getMsg(), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.attendeesCalendarDetail", e.getMessage(), request).getErrorMessageBody());
}
}
@ -208,10 +207,10 @@ public class LarkCalendarHelper extends LarkHelper {
BatchDeleteCalendarEventAttendeeReq.newBuilder()
.calendarId(request.getCalendarId())
.eventId(request.getEventId())
.userIdType(BatchDeleteCalendarEventAttendeeUserIdTypeEnum.USER_ID)
.batchDeleteCalendarEventAttendeeReqBody(
BatchDeleteCalendarEventAttendeeReqBody.newBuilder()
.deleteIds(request.getCalendarEventDeleteArray())
.needNotification(Boolean.FALSE)
.build()
)
.build()
@ -220,10 +219,10 @@ public class LarkCalendarHelper extends LarkHelper {
if (batchDeleteCalendarEventAttendeeResp.getCode() == 0) {
return batchDeleteCalendarEventAttendeeResp.getData();
} else {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", JSONObject.toJSONString(batchDeleteCalendarEventAttendeeResp.getError()), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.unAttendeesCalendarDetail", batchDeleteCalendarEventAttendeeResp.getMsg(), request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkCalendarHelper.getPrimaryCalendar", e.getMessage(), request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkCalendarHelper.unAttendeesCalendarDetail", e.getMessage(), request).getErrorMessageBody());
}
}

@ -8,6 +8,7 @@ import com.lark.oapi.service.im.v1.model.CreateMessageReq;
import com.lark.oapi.service.im.v1.model.CreateMessageReqBody;
import com.lark.oapi.service.im.v1.model.CreateMessageResp;
import com.lark.oapi.service.im.v1.model.CreateMessageRespBody;
import com.ruoyi.flyingbook.domain.lark.LarkException;
import com.ruoyi.flyingbook.domain.lark.LarkRobotRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -70,7 +71,7 @@ public class LarkRobotHelper extends LarkHelper{
if (createMessageResp.getCode() == 0){
return createMessageResp.getData();
}else {
throw new RuntimeException(createMessageResp.getMsg());
throw new RuntimeException(new LarkException("LarkRobotHelper.sendUserMessage", createMessageResp.getMsg(),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(e.getMessage());

@ -68,7 +68,11 @@ public class LarkTableHelper extends LarkHelper{
)
.build()
);
return createAppResp.getData();
if (createAppResp.getCode() == 0){
return createAppResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkTableHelper.createMultiTable", createAppResp.getMsg(),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTableHelper.createMultiTable",e.getMessage(),request).getErrorMessageBody());
}
@ -81,7 +85,7 @@ public class LarkTableHelper extends LarkHelper{
*/
public CreateAppTableRespBody createDataTable(LarkTableRequest request) {
try {
return buildClient(request).bitable().appTable().create(
CreateAppTableResp createAppTableResp = buildClient(request).bitable().appTable().create(
CreateAppTableReq.newBuilder()
.appToken(request.getAppToken())
.createAppTableReqBody(
@ -96,7 +100,12 @@ public class LarkTableHelper extends LarkHelper{
.build()
)
.build()
).getData();
);
if (createAppTableResp.getCode() == 0){
return createAppTableResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkTableHelper.createDataTable", createAppTableResp.getMsg(),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTableHelper.createDataTable",e.getMessage(),request).getErrorMessageBody());
}
@ -110,13 +119,17 @@ public class LarkTableHelper extends LarkHelper{
*/
public GetAppTableRecordResp getTableRecordDetail(LarkTableRequest request) {
try {
return buildClient(request).bitable().appTableRecord().get(
GetAppTableRecordResp getAppTableRecordResp = buildClient(request).bitable().appTableRecord().get(
GetAppTableRecordReq
.newBuilder()
.appToken(request.getAppToken())
.tableId(request.getAppTable())
.recordId(request.getRecord()).
build());
if (getAppTableRecordResp.getCode() != 0){
throw new RuntimeException(new LarkException("LarkTableHelper.getTableRecordDetail", getAppTableRecordResp.getMsg(),request).getErrorMessageBody());
}
return getAppTableRecordResp;
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTableHelper.getTableRecordDetail",e.getMessage(),request).getErrorMessageBody());
}

@ -51,7 +51,7 @@ public class LarkTaskHelper extends LarkHelper {
if (createTaskResp.getCode() == 0){
return createTaskResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask", JSONObject.toJSONString(createTaskResp.getError()),request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask", createTaskResp.getMsg(),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask",e.getMessage(),request).getErrorMessageBody());
@ -75,7 +75,7 @@ public class LarkTaskHelper extends LarkHelper {
if (getTaskResp.getCode() == 0){
return getTaskResp.getData();
}else {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask", JSONObject.toJSONString(getTaskResp.getError()),request).getErrorMessageBody());
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask", getTaskResp.getMsg(),request).getErrorMessageBody());
}
} catch (Exception e) {
throw new RuntimeException(new LarkException("LarkTaskHelper.createTask",e.getMessage(),request).getErrorMessageBody());

@ -1,9 +1,11 @@
package com.ruoyi.flyingbook.aop;
import com.ruoyi.flyingbook.LarkHelper.LarkRobotHelper;
import com.ruoyi.flyingbook.domain.Event;
import com.ruoyi.flyingbook.domain.EventLog;
import com.ruoyi.flyingbook.domain.lark.LarkException;
import com.ruoyi.flyingbook.domain.lark.LarkRequest;
import com.ruoyi.flyingbook.mapper.EventMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -14,6 +16,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -27,6 +31,8 @@ public class ErrorLogAop {
@Autowired
private LarkRobotHelper larkRobotHelper;
@Autowired
private EventMapper eventMapper;
@Value("${lark.robot.group}")
private String ROBOT_GROUP;
@ -38,10 +44,13 @@ public class ErrorLogAop {
public void prePersist(EventLog dto) {
String errorMessage = dto.getErrorMessage();
if (StringUtils.isNotBlank(errorMessage)) {
LarkRequest larkRequest = new LarkRequest("a", "b");
LarkException larkException = new LarkException("",errorMessage, larkRequest);
String errorMessageBody = larkException.getErrorMessageBody();
// larkRobotHelper.sendMessageByBot(ROBOT_GROUP, errorMessageBody);
Event event = eventMapper.selectEventById(dto.getEventId());
if (event != null && event.getNumbers() != null && event.getNumbers() <= 1) {
LarkRequest larkRequest = new LarkRequest("a", "b");
LarkException larkException = new LarkException("", errorMessage, larkRequest);
String errorMessageBody = larkException.getErrorMessageBody();
larkRobotHelper.sendMessageByBot(ROBOT_GROUP, errorMessageBody);
}
}
}
@ -50,14 +59,32 @@ public class ErrorLogAop {
*/
@After("execution(* com.ruoyi.flyingbook.service.IEventLogService.insertBatchEventLog(..)) && (args(dto))")
public void prePersist(List<EventLog> dto) {
List<Long> eventIdList = dto.stream()
.filter(r -> {
return StringUtils.isNotBlank(r.getErrorMessage()) && r.getEventId() != null;
})
.map(EventLog::getEventId)
.distinct()
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(eventIdList)){
return;
}
List<Event> list = eventMapper.selectEventByIdList(eventIdList);
Map<Long, Event> eventMap = list.stream()
.filter(r -> {
return r.getNumbers() != null && r.getNumbers() <= 1;
}).collect(Collectors.toMap(Event::getId, Function.identity(), (k1, k2) -> k1));
if (eventMap == null || eventMap.isEmpty()){
return;
}
List<String> errorList = dto.stream()
.filter(r -> {
return StringUtils.isNotBlank(r.getErrorMessage());
return StringUtils.isNotBlank(r.getErrorMessage()) && eventMap.containsKey(r.getEventId());
})
.map(EventLog::getErrorMessage)
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(errorList)) {
// larkRobotHelper.sendMessageByBot(ROBOT_GROUP,String.join(",",errorList));
larkRobotHelper.sendMessageByBot(ROBOT_GROUP,String.join(",",errorList));
}
}

@ -36,6 +36,7 @@ public class LarkCalendarRequest extends LarkRequest {
*
*/
private String summary;
private String desc;
/**
*
@ -88,28 +89,16 @@ public class LarkCalendarRequest extends LarkRequest {
this.eventId = eventId;
}
/**
*
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String summary, String startDate, String endDate) {
super(appId, appSecret);
this.calendarId = calendarId;
this.summary = summary;
this.startDate = startDate;
this.endDate = endDate;
this.timeZone = "Asia/Shanghai";
this.needNotification = Boolean.FALSE;
this.attendeeAbility = CalendarEventEventAttendeeAbilityEnum.CANSEEOTHERS;
}
/**
*
* /
*/
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String eventId, String summary, String startDate, String endDate) {
public LarkCalendarRequest(String appId, String appSecret, String calendarId, String eventId, String summary,String desc, String startDate, String endDate) {
super(appId, appSecret);
this.calendarId = calendarId;
this.eventId = eventId;
this.summary = summary;
this.desc = desc;
this.startDate = startDate;
this.endDate = endDate;
this.timeZone = "Asia/Shanghai";
@ -144,6 +133,7 @@ public class LarkCalendarRequest extends LarkRequest {
for (int i = 0; i < followerIdList.size(); i++) {
CalendarEventAttendee calendarEventAttendee = new CalendarEventAttendee();
calendarEventAttendee.setIsOptional(Boolean.TRUE);
calendarEventAttendee.setType("user");
calendarEventAttendee.setUserId(followerIdList.get(i));
calendarEventAttendee.setOperateId(operateId);
calendarEventAttendees[i] = calendarEventAttendee;

@ -24,6 +24,8 @@ public class LarkException {
this.request = request;
}
public String getErrorMessageBody(){
return this.toString();
}

@ -21,6 +21,7 @@ public interface EventMapper
* @return
*/
public Event selectEventById(Long id);
public List<Event> selectEventByIdList(@Param("idList") List<Long> idList);
/**
*

@ -2,9 +2,7 @@ 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.task.v1.model.Due;
import com.lark.oapi.service.task.v1.model.GetTaskRespBody;
import com.lark.oapi.service.task.v1.model.Task;
import com.lark.oapi.service.task.v1.model.*;
import com.ruoyi.common.enums.*;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.flyingbook.LarkHelper.LarkCalendarHelper;
@ -22,7 +20,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
@ -72,9 +72,17 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
GetTaskRespBody taskInfo = larkTaskHelper.getTaskInfo(getTaskRequest);
Task task = taskInfo.getTask();
//任务的关注人及负责人取交集
String[] collaboratorIds = task.getCollaboratorIds();
String operator = collaboratorIds[0];
String[] followerIds = task.getFollowerIds();
Collaborator[] collaborators = task.getCollaborators();
String[] collaboratorIds = new String[collaborators.length];
for (int i = 0; i < collaborators.length; i++) {
collaboratorIds[i] = collaborators[i].getId();
}
String operator = collaborators[0].getId();
Follower[] followers = task.getFollowers();
String[] followerIds = new String[collaborators.length];
for (int i = 0; i < followers.length; i++) {
followerIds[i] = followers[i].getId();
}
//待绑定日程用户
String[] taskFollowerArray = getArrayIntersection(collaboratorIds, followerIds);
//待解除绑定日程用户
@ -85,36 +93,15 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
String calendarId = getCalendarInfo(request.getAppId(), request.getAppSecret());
String eventId = null;
if (taskCalendarRelation == null){
//关系为空,创建日程
String summary = task.getSummary();
if (StringUtils.isNotBlank(task.getCompleteTime()) && !task.getCompleteTime().equals("0")){
summary += "✔";
}
Due due = task.getDue();
LarkCalendarRequest calendarRequest = null;
if (due == null){
String time = DateUtils.ldt2str(LocalDateTime.now(), DateUtils.YYYY_MM_DD);
calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, summary, task.getDescription(), time, time);
}else {
Boolean isAllDay = due.getIsAllDay();
Long time = Long.valueOf(due.getTime());
if (isAllDay){
String allDay = DateUtils.long2Str(time, DateUtils.YYYY_MM_DD);
calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, summary, task.getDescription(), allDay, allDay);
}else {
LocalDateTime localDateTime = DateUtils.long2ldt(time);
LocalDateTime startTime = localDateTime.minusHours(2L);
calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, summary, task.getDescription(), null, null);
calendarRequest.setStartDateStamp(String.valueOf(DateUtils.ldt2Long(startTime)));
calendarRequest.setEndDateStamp(due.getTime());
}
}
LarkCalendarRequest calendarRequest = this.createOrUpdateCalendar(task,calendarId,eventId,request.getAppId(),request.getAppSecret());
CreateCalendarEventRespBody calendarDetail = larkCalendarHelper.createCalendarDetail(calendarRequest);
eventId = calendarDetail.getEvent().getEventId();
//任务日历关系实体
this.buildTaskCalendarRelation(larkTaskId,eventId);
}else {
eventId = taskCalendarRelation.getToId();
LarkCalendarRequest update = this.createOrUpdateCalendar(task,calendarId,eventId,request.getAppId(),request.getAppSecret());
larkCalendarHelper.updateCalendarDetail(update);
LarkCalendarRequest calendarRequest = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, eventId);
ListCalendarEventAttendeeRespBody calendarDetail = larkCalendarHelper.getCalendarDetail(calendarRequest);
for (CalendarEventAttendee item : calendarDetail.getItems()) {
@ -129,8 +116,34 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
LarkCalendarRequest add = new LarkCalendarRequest(request.getAppId(), request.getAppSecret(), calendarId, eventId, Arrays.asList(taskFollowerArray), operator);
larkCalendarHelper.attendeesCalendarDetail(add);
}
}
private LarkCalendarRequest createOrUpdateCalendar(Task task,String calendarId,String eventId,String appId,String appSecret){
//关系为空,创建日程
String summary = task.getSummary();
if (StringUtils.isNotBlank(task.getCompleteTime()) && !task.getCompleteTime().equals("0")){
summary += "✔";
}
Due due = task.getDue();
LarkCalendarRequest calendarRequest = null;
if (due == null || due.getTime().equals("0")){
String time = DateUtils.ldt2str(LocalDateTime.now(), DateUtils.YYYY_MM_DD);
calendarRequest = new LarkCalendarRequest(appId, appSecret, calendarId,eventId, summary, task.getDescription(), time, time);
}else {
Boolean isAllDay = due.getIsAllDay();
Long time = Long.valueOf(due.getTime());
if (isAllDay){
String allDay = DateUtils.long2Str(time, DateUtils.YYYY_MM_DD);
calendarRequest = new LarkCalendarRequest(appId, appSecret, calendarId,eventId, summary, task.getDescription(), allDay, allDay);
}else {
LocalDateTime localDateTime = DateUtils.long2ldt(time);
LocalDateTime startTime = localDateTime.minusHours(2L);
calendarRequest = new LarkCalendarRequest(appId, appSecret, calendarId,eventId, summary, task.getDescription(), null, null);
calendarRequest.setStartDateStamp(String.valueOf(DateUtils.ldt2Long(startTime)).substring(0,10));
calendarRequest.setEndDateStamp(due.getTime());
}
}
return calendarRequest;
}
/**
@ -141,8 +154,11 @@ public class LarkTaskCallbackOperate extends LarkAbstract {
LarkTableRowRelation rowRelation = new LarkTableRowRelation();
rowRelation.setFlag(FlagStatus.OK.getCode());
rowRelation.setType(TableDetailRelationTypeEnum.TASK_CALENDAR.getCode());
rowRelation.setSubType(TableDetailRelationTypeEnum.TASK_CALENDAR.getCode());
rowRelation.setFromId(larkTaskId);
rowRelation.setToId(eventId);
rowRelation.setCreateBy("system");
rowRelation.setCreateTime(new Date());
larkTableRowRelationService.insertLarkTableRowRelation(rowRelation);
}

@ -58,6 +58,14 @@
where id = #{id}
</select>
<select id="selectEventByIdList" resultMap="EventResult">
<include refid="selectEventVo"/>
where id in
<foreach item="id" collection="idList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<insert id="insertEvent" parameterType="com.ruoyi.flyingbook.domain.Event" useGeneratedKeys="true" keyProperty="id">
insert into event
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save