重构代码

于相涌/mail
YXY 2 years ago committed by bob
parent 498b90d72b
commit 9c06a8d323

@ -0,0 +1,42 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.lark.oapi.service.approval.v4.model.GetInstanceReq;
import com.lark.oapi.service.approval.v4.model.GetInstanceRespBody;
import com.ruoyi.flyingbook.domain.lark.LarkApprovalRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author yuxiangyong
* @create 2023-03-12 18:10
*/
@Slf4j
@Component
public class LarkApprovalHelper extends LarkHelper{
static String instanceId = "3487F263-9116-42A3-99EC-A737845E66AD";
public static void main(String[] args) throws Exception {
LarkApprovalHelper bk = new LarkApprovalHelper();
GetInstanceRespBody approvalInfoDetail = bk.getApprovalInfoDetail(new LarkApprovalRequest(appId, secret, instanceId));
System.out.println(approvalInfoDetail);
}
/**
*
*
* @return
*/
public GetInstanceRespBody getApprovalInfoDetail(LarkApprovalRequest request) {
try {
return buildClient(request).approval().instance().get(GetInstanceReq.newBuilder()
.instanceId(request.getInstanceId()).build()).getData();
} catch (Exception e) {
}
return null;
}
}

@ -0,0 +1,37 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.lark.oapi.Client;
import com.lark.oapi.core.cache.ICache;
import com.lark.oapi.core.enums.AppType;
import com.lark.oapi.service.bitable.v1.model.*;
import com.ruoyi.flyingbook.domain.lark.LarkRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* @author yuxiangyong
* @create 2023-03-12 18:10
*/
@Slf4j
public class LarkHelper {
static String appId = "cli_a482a8572cbc9013";
static String secret = "lZNXbCLlOslWbwBIVc4qvgxOdnfA8Mos";
/**
* cli_a482a8572cbc9013
* lZNXbCLlOslWbwBIVc4qvgxOdnfA8Mos
* @param request
* @return
*/
protected Client buildClient(LarkRequest request){
return Client.newBuilder(request.getAppId(), request.getAppSecret())
.marketplaceApp()
.appType(AppType.SELF_BUILT)
.build();
}
}

@ -0,0 +1,110 @@
package com.ruoyi.flyingbook.LarkHelper;
import com.lark.oapi.service.bitable.v1.model.*;
import com.ruoyi.flyingbook.domain.lark.LarkTableRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* @author yuxiangyong
* @create 2023-03-12 18:10
*/
@Slf4j
@Component
public class LarkTableHelper extends LarkHelper{
static String appToken = "Gyu1b8VAFaYiEysfEUjcCKomnVc";
static String tableId = "tbloMVR0ACW2uO33";
static String record = "rec8umOjIh";
static Map<String, Object> map = new HashMap<>();
public static void main(String[] args) throws Exception {
LarkTableHelper bk = new LarkTableHelper();
map.put("b", "aaa");
LarkTableRequest add = new LarkTableRequest(appId, secret, appToken, tableId,map);
CreateAppTableRecordRespBody createAppTableRecordRespBody = bk.addTableRecord(add);
String recordId = createAppTableRecordRespBody.getRecord().getRecordId();
// map.put("b", "EEE");
// LarkTableRequest update = new LarkTableRequest(appId, secret, appToken,tableId, record,map);
// bk.updateTableRecord(update);
LarkTableRequest delete = new LarkTableRequest(appId, secret, appToken,tableId, recordId);
bk.deleteTableRecord(delete);
}
/**
*
*
* @return
*/
public GetAppTableRecordResp getTableRecordDetail(LarkTableRequest request) {
try {
return buildClient(request).bitable().appTableRecord().get(
GetAppTableRecordReq
.newBuilder()
.appToken(request.getAppToken())
.tableId(request.getAppTable())
.recordId(request.getRecord()).
build());
} catch (Exception e) {
}
return null;
}
public CreateAppTableRecordRespBody addTableRecord(LarkTableRequest request) {
try {
return buildClient(request).bitable().appTableRecord()
.create(CreateAppTableRecordReq.newBuilder()
.appToken(request.getAppToken())
.tableId(request.getAppTable())
.appTableRecord(
AppTableRecord.newBuilder()
.fields(request.getBody())
.build())
.build()).getData();
} catch (Exception e) {
}
return null;
}
public DeleteAppTableRecordRespBody deleteTableRecord(LarkTableRequest request) {
try {
return buildClient(request).bitable().appTableRecord().delete(
DeleteAppTableRecordReq.newBuilder()
.appToken(request.getAppToken())
.tableId(request.getAppTable())
.recordId(request.getRecord())
.build()
).getData();
} catch (Exception e) {
}
return null;
}
public UpdateAppTableRecordRespBody updateTableRecord(LarkTableRequest request) {
try {
return buildClient(request).bitable().appTableRecord().update(
UpdateAppTableRecordReq.newBuilder()
.appToken(request.getAppToken())
.tableId(request.getAppTable())
.recordId(request.getRecord())
.appTableRecord(
AppTableRecord.newBuilder()
.fields(request.getBody())
.build()
).build()
).getData();
} catch (Exception e) {
}
return null;
}
}

@ -1,140 +0,0 @@
package com.ruoyi.flyingbook.LarkHelper;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @author yuxiangyong
* @create 2023-03-12 18:10
*/
@Slf4j
@Component
public class LarkTokenHelper {
private static OkHttpClient client = new OkHttpClient().newBuilder()
.callTimeout(10, TimeUnit.SECONDS)
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.build();
private JSONObject execute(Request request) {
Response execute = null;
JSONObject jsonObject = null;
try {
execute = client.newCall(request).execute();
if (execute == null || execute.body() == null){
throw new RuntimeException("飞书返回结果为空");
}
jsonObject = JSONObject.parseObject(execute.body().string());
} catch (IOException e) {
String errorMessage = String.format("飞书接口调用失败:{}",e.getMessage());
throw new RuntimeException(errorMessage);
}
if ("0".equals(jsonObject.getString("code"))){
return jsonObject;
}else {
String errorMessage = String.format("%s##%s", jsonObject.getString("code"), jsonObject.getString("msg"));
throw new RuntimeException(errorMessage);
}
}
public String getToken(String appId, String srcret,String tokenType) {
Map<String, String> map = new HashMap<>();
map.put("app_id", appId);
map.put("app_secret", srcret);
Request.Builder builder = new Request.Builder();
builder.url("https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal");
RequestBody requestBody = RequestBody.create(MediaType.get("application/json"),JSONObject.toJSONString(map));
builder.post(requestBody);
return execute(builder.build()).getString(tokenType);
}
/**
* @param url
* @param token
* @return
*/
public JSONObject getLark(String url, Map<String, String> body, String token, List<String> safeCodeList) {
Response execute = null;
Request request = new Request.Builder()
.url(url)
.addHeader("Authorization",String.format("Bearer %s",token))
.build();
JSONObject jsonObject = null;
try {
execute = client.newCall(request).execute();
if (execute == null || execute.body() == null){
throw new RuntimeException("飞书返回结果为空");
}
jsonObject = JSONObject.parseObject(execute.body().string());
} catch (IOException e) {
String errorMessage = String.format("飞书接口调用失败:{}",e.getMessage());
throw new RuntimeException(errorMessage);
}
String code = jsonObject.getString("code");
if ("0".equals(code) || (CollectionUtils.isNotEmpty(safeCodeList) && safeCodeList.contains(code))){
return jsonObject;
}else {
String errorMessage = String.format("%s##%s", code, jsonObject.getString("msg"));
throw new RuntimeException(errorMessage);
}
}
public JSONObject postLark(String url,Map<Object, Map<Object, Object>> body, String token) {
Request request = new Request.Builder()
.method("POST", RequestBody
.create(MediaType.get("application/json"),JSONObject.toJSONString(body)))
.url(url)
.addHeader("Authorization",String.format("Bearer %s",token))
.build();
return execute(request);
}
public JSONObject putLark(String url,Map<Object, Map<Object, Object>> body, String token) {
Request request = new Request.Builder()
.put(RequestBody
.create( MediaType.get("application/json"),JSONObject.toJSONString(body)))
.url(url)
.addHeader("Authorization",String.format("Bearer %s",token))
.build();
return execute(request);
}
public JSONObject deleteLark(String url,Map<Object, Map<Object, Object>> body, String token) {
Request.Builder builder = new Request.Builder()
.url(url)
.addHeader("Authorization", String.format("Bearer %s", token));
if (body == null || body.isEmpty()){
builder.delete();
}else {
builder.delete(RequestBody
.create(MediaType.get("application/json"),JSONObject.toJSONString(body)));
}
return execute(builder.build());
}
public static void main(String[] args) {
LarkTokenHelper helper = new LarkTokenHelper();
String token = helper.getToken( "cli_a482a8572cbc9013", "lZNXbCLlOslWbwBIVc4qvgxOdnfA8Mos","tenant_access_token");
System.out.println(token);
JSONObject jsonObject = JSONObject.parseObject(token);
Map<Object,Object> map = new HashMap<>();
JSONObject b = new JSONObject();
map.put("fields",b);
b.put("多行文本","345");
// helper.putLark("https://open.feishu.cn/open-apis/bitable/v1/apps/Gyu1b8VAFaYiEysfEUjcCKomnVc/tables/tbloMVR0ACW2uO33/records/rece1nuKGU",map,jsonObject.getString("tenant_access_token"));
}
}

@ -1,7 +1,7 @@
package com.ruoyi.flyingbook.controller; package com.ruoyi.flyingbook.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.flyingbook.domain.LarkRequest; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.utils.DecryptUtil; import com.ruoyi.common.utils.DecryptUtil;
import com.ruoyi.flyingbook.factory.LarkCallBackFactory; import com.ruoyi.flyingbook.factory.LarkCallBackFactory;
@ -33,7 +33,7 @@ public class EventController extends BaseController {
result = DecryptUtil.decrypt(jsonObject.getString("encrypt")); result = DecryptUtil.decrypt(jsonObject.getString("encrypt"));
log.info("/event/test1/approval encrypt:{}", JSONObject.toJSONString(result)); log.info("/event/test1/approval encrypt:{}", JSONObject.toJSONString(result));
} }
LarkRequest larkRequest = new LarkRequest(); RequestVo larkRequest = new RequestVo();
larkRequest.setMessage(result); larkRequest.setMessage(result);
larkFactory.execute(larkRequest); larkFactory.execute(larkRequest);
return result; return result;

@ -1,10 +1,12 @@
package com.ruoyi.flyingbook.domain; package com.ruoyi.flyingbook.domain;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lark.oapi.service.approval.v4.model.GetInstanceRespBody;
import com.lark.oapi.service.bitable.v1.model.GetAppTableRecordResp;
import com.ruoyi.common.enums.EventOperateType; import com.ruoyi.common.enums.EventOperateType;
import com.ruoyi.flyingbook.domain.lark.LarkApprovalRequest;
import lombok.Data; import lombok.Data;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -12,13 +14,14 @@ import java.util.Map;
* @create 2023-03-12 16:00 * @create 2023-03-12 16:00
*/ */
@Data @Data
public class LarkRequest { public class RequestVo {
/** /**
* *
*/ */
private String token; private String token;
private String appId; private String appId;
private String appSecret;
private String fromAppToken; private String fromAppToken;
private String toAppToken; private String toAppToken;
private String errorCode; private String errorCode;
@ -29,11 +32,14 @@ public class LarkRequest {
* ApprovalCallback * ApprovalCallback
*/ */
private Long eventId; private Long eventId;
private String instance;
private GetInstanceRespBody instanceRespBody;
private String message; private String message;
/** /**
* MultidimensionalTableOperate * MultidimensionalTableOperate
*/ */
private GetAppTableRecordResp respBody;
private JSONObject record; private JSONObject record;
private Long companyRelationId; private Long companyRelationId;
private Long tableRelationId; private Long tableRelationId;

@ -0,0 +1,21 @@
package com.ruoyi.flyingbook.domain.lark;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author yuxiangyong
* @create 2023-03-18 1:05
*/
@Data
@NoArgsConstructor
public class LarkApprovalRequest extends LarkRequest{
private String instanceId;
public LarkApprovalRequest(String appId, String appSecret, String instanceId) {
super(appId, appSecret);
this.instanceId = instanceId;
}
}

@ -0,0 +1,30 @@
package com.ruoyi.flyingbook.domain.lark;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author yuxiangyong
* @create 2023-03-18 0:12
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LarkRequest {
private String appId;
private String appSecret;
/**
* code
*/
private List<Integer> safeCode;
public LarkRequest(String appId, String appSecret) {
this.appId = appId;
this.appSecret = appSecret;
}
}

@ -0,0 +1,44 @@
package com.ruoyi.flyingbook.domain.lark;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* @author yuxiangyong
* @create 2023-03-18 0:12
*/
@Data
@NoArgsConstructor
public class LarkTableRequest extends LarkRequest{
private String appToken;
private String appTable;
private String record;
private Map<String,Object> body;
public LarkTableRequest(String appId,String appSecret,String appToken, String appTable, Map<String, Object> body) {
super(appId,appSecret);
this.appToken = appToken;
this.appTable = appTable;
this.body = body;
}
public LarkTableRequest(String appId,String appSecret,String appToken, String appTable, String record, Map<String, Object> body) {
super(appId,appSecret);
this.appToken = appToken;
this.appTable = appTable;
this.record = record;
this.body = body;
}
public LarkTableRequest(String appId,String appSecret,String appToken, String appTable, String record) {
super(appId,appSecret);
this.appToken = appToken;
this.appTable = appTable;
this.record = record;
}
}

@ -2,7 +2,7 @@ package com.ruoyi.flyingbook.factory;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.enums.CallBackTypeEnum; import com.ruoyi.common.enums.CallBackTypeEnum;
import com.ruoyi.flyingbook.domain.LarkRequest; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.flyingbook.strategy.callback.ApprovalCallback; import com.ruoyi.flyingbook.strategy.callback.ApprovalCallback;
import com.ruoyi.flyingbook.strategy.callback.MultidimensionalTableCallback; import com.ruoyi.flyingbook.strategy.callback.MultidimensionalTableCallback;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -21,7 +21,7 @@ public class LarkCallBackFactory {
@Autowired @Autowired
private ApprovalCallback approvalCallback; private ApprovalCallback approvalCallback;
public void execute(LarkRequest larkRequest) { public void execute(RequestVo larkRequest) {
String message = larkRequest.getMessage(); String message = larkRequest.getMessage();
if (StringUtils.isBlank(message)) { if (StringUtils.isBlank(message)) {
return; return;

@ -2,7 +2,7 @@ package com.ruoyi.flyingbook.factory;
import com.ruoyi.common.enums.EventTypeEnum; import com.ruoyi.common.enums.EventTypeEnum;
import com.ruoyi.flyingbook.domain.Event; import com.ruoyi.flyingbook.domain.Event;
import com.ruoyi.flyingbook.domain.LarkRequest; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.flyingbook.strategy.operate.ApprovalCallbackOperate; import com.ruoyi.flyingbook.strategy.operate.ApprovalCallbackOperate;
import com.ruoyi.flyingbook.strategy.operate.MultidimensionalTableOperate; import com.ruoyi.flyingbook.strategy.operate.MultidimensionalTableOperate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -25,7 +25,7 @@ public class LarkOperateFactory {
if (eventTypeEnum == null) { if (eventTypeEnum == null) {
return; return;
} }
LarkRequest request = new LarkRequest(); RequestVo request = new RequestVo();
request.setEvent(event); request.setEvent(event);
switch (eventTypeEnum) { switch (eventTypeEnum) {
case ROW_CHANGE: case ROW_CHANGE:

@ -1,8 +1,6 @@
package com.ruoyi.flyingbook.strategy; package com.ruoyi.flyingbook.strategy;
import com.ruoyi.common.enums.EventOperateType; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.flyingbook.domain.EventLog;
import com.ruoyi.flyingbook.domain.LarkRequest;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
@ -12,7 +10,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public abstract class LarkOperateAbstract{ public abstract class LarkOperateAbstract{
public String execute(LarkRequest request){ public String execute(RequestVo request){
try { try {
//参数校验逻辑 //参数校验逻辑
if (!check(request)){ if (!check(request)){
@ -46,30 +44,30 @@ public abstract class LarkOperateAbstract{
* *
* *
*/ */
protected Boolean check(LarkRequest request){ protected Boolean check(RequestVo request){
return Boolean.TRUE; return Boolean.TRUE;
} }
/** /**
* *
*/ */
protected abstract void preOperate(LarkRequest request); protected abstract void preOperate(RequestVo request);
/** /**
* *
* @param request * @param request
*/ */
protected abstract void businessProcessing(LarkRequest request); protected abstract void businessProcessing(RequestVo request);
/** /**
* *
*/ */
protected void endHandle(LarkRequest request){}; protected void endHandle(RequestVo request){};
/** /**
* *
*/ */
protected abstract String buildResult(LarkRequest request); protected abstract String buildResult(RequestVo request);
protected abstract String getName(); protected abstract String getName();

@ -7,7 +7,7 @@ import com.ruoyi.common.enums.EventOperateType;
import com.ruoyi.common.enums.FlagStatus; import com.ruoyi.common.enums.FlagStatus;
import com.ruoyi.flyingbook.domain.Event; import com.ruoyi.flyingbook.domain.Event;
import com.ruoyi.flyingbook.domain.EventLog; import com.ruoyi.flyingbook.domain.EventLog;
import com.ruoyi.flyingbook.domain.LarkRequest; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.flyingbook.service.IEventLogService; import com.ruoyi.flyingbook.service.IEventLogService;
import com.ruoyi.flyingbook.service.IEventService; import com.ruoyi.flyingbook.service.IEventService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -36,12 +36,12 @@ public class ApprovalCallback extends CallbackAbstract {
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Override @Override
protected Boolean check(LarkRequest request) { protected Boolean check(RequestVo request) {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override @Override
protected void preOperate(LarkRequest request) { protected void preOperate(RequestVo request) {
String message = request.getMessage(); String message = request.getMessage();
JSONObject jsonObject = JSONObject.parseObject(message); JSONObject jsonObject = JSONObject.parseObject(message);
JSONObject event = jsonObject.getJSONObject("event"); JSONObject event = jsonObject.getJSONObject("event");
@ -50,7 +50,7 @@ public class ApprovalCallback extends CallbackAbstract {
} }
@Override @Override
protected void businessProcessing(LarkRequest request) { protected void businessProcessing(RequestVo request) {
Event event = queryEvent(request.getAppId(),request.getFromRecordId()); Event event = queryEvent(request.getAppId(),request.getFromRecordId());
//如果已经存在处理中的就不需要操作数据库了 //如果已经存在处理中的就不需要操作数据库了
if (event != null && EventOperateStatus.PENDING.getCode().equals(event.getOperateStatus())){ if (event != null && EventOperateStatus.PENDING.getCode().equals(event.getOperateStatus())){
@ -66,7 +66,7 @@ public class ApprovalCallback extends CallbackAbstract {
} }
@Override @Override
protected void endHandle(LarkRequest request) { protected void endHandle(RequestVo request) {
if (request.getEventId() == null){ if (request.getEventId() == null){
return; return;
} }
@ -80,7 +80,7 @@ public class ApprovalCallback extends CallbackAbstract {
} }
@Override @Override
protected String buildResult(LarkRequest request) { protected String buildResult(RequestVo request) {
return ""; return "";
} }
@ -102,7 +102,7 @@ public class ApprovalCallback extends CallbackAbstract {
return null; return null;
} }
private Event buildDto(LarkRequest request,Event event){ private Event buildDto(RequestVo request, Event event){
event = event == null ? new Event() :event; event = event == null ? new Event() :event;
event.setFlag(FlagStatus.OK.getCode()); event.setFlag(FlagStatus.OK.getCode());
event.setRecordId(request.getFromRecordId()); event.setRecordId(request.getFromRecordId());

@ -7,7 +7,7 @@ import com.ruoyi.flyingbook.domain.Event;
import com.ruoyi.flyingbook.domain.EventLog; import com.ruoyi.flyingbook.domain.EventLog;
import com.ruoyi.flyingbook.service.IEventLogService; import com.ruoyi.flyingbook.service.IEventLogService;
import com.ruoyi.flyingbook.service.IEventService; import com.ruoyi.flyingbook.service.IEventService;
import com.ruoyi.flyingbook.domain.LarkRequest; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.common.constant.RedisConstants; import com.ruoyi.common.constant.RedisConstants;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -35,12 +35,12 @@ public class MultidimensionalTableCallback extends CallbackAbstract {
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Override @Override
protected Boolean check(LarkRequest request) { protected Boolean check(RequestVo request) {
return Boolean.TRUE; return Boolean.TRUE;
} }
@Override @Override
protected void preOperate(LarkRequest request) { protected void preOperate(RequestVo request) {
if (StringUtils.isBlank(request.getMessage())) { if (StringUtils.isBlank(request.getMessage())) {
return; return;
} }
@ -73,7 +73,7 @@ public class MultidimensionalTableCallback extends CallbackAbstract {
} }
@Override @Override
protected void businessProcessing(LarkRequest request) { protected void businessProcessing(RequestVo request) {
String cacheKey = String.format("%s_%s_%s_%s", RedisConstants.MULTIPLE_TABLE_RECORD, request.getFromAppToken(),request.getFromTableId(), request.getFromRecordId()); String cacheKey = String.format("%s_%s_%s_%s", RedisConstants.MULTIPLE_TABLE_RECORD, request.getFromAppToken(),request.getFromTableId(), request.getFromRecordId());
String eventStr = (String)redisTemplate.opsForValue().get(cacheKey); String eventStr = (String)redisTemplate.opsForValue().get(cacheKey);
Event event = null; Event event = null;
@ -97,7 +97,7 @@ public class MultidimensionalTableCallback extends CallbackAbstract {
} }
@Override @Override
protected void endHandle(LarkRequest request) { protected void endHandle(RequestVo request) {
if (request.getEventId() == null){ if (request.getEventId() == null){
return; return;
} }
@ -111,7 +111,7 @@ public class MultidimensionalTableCallback extends CallbackAbstract {
} }
@Override @Override
protected String buildResult(LarkRequest request) { protected String buildResult(RequestVo request) {
return ""; return "";
} }
@ -134,7 +134,7 @@ public class MultidimensionalTableCallback extends CallbackAbstract {
return null; return null;
} }
private Event buildDto(LarkRequest request,Event event){ private Event buildDto(RequestVo request, Event event){
event = event == null ? new Event() :event; event = event == null ? new Event() :event;
event.setFlag(FlagStatus.OK.getCode()); event.setFlag(FlagStatus.OK.getCode());
event.setAppToken(request.getFromAppToken()); event.setAppToken(request.getFromAppToken());

@ -1,15 +1,19 @@
package com.ruoyi.flyingbook.strategy.operate; package com.ruoyi.flyingbook.strategy.operate;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lark.oapi.service.approval.v4.model.GetInstanceRespBody;
import com.lark.oapi.service.bitable.v1.model.CreateAppTableRecordRespBody;
import com.ruoyi.common.enums.*; import com.ruoyi.common.enums.*;
import com.ruoyi.flyingbook.LarkHelper.LarkTokenHelper; import com.ruoyi.flyingbook.LarkHelper.LarkApprovalHelper;
import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper;
import com.ruoyi.flyingbook.domain.*; import com.ruoyi.flyingbook.domain.*;
import com.ruoyi.flyingbook.domain.lark.LarkApprovalRequest;
import com.ruoyi.flyingbook.domain.lark.LarkTableRequest;
import com.ruoyi.flyingbook.service.*; import com.ruoyi.flyingbook.service.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList; import java.util.ArrayList;
@ -29,14 +33,14 @@ import java.util.Map;
public class ApprovalCallbackOperate extends LarkAbstract { public class ApprovalCallbackOperate extends LarkAbstract {
@Autowired @Autowired
protected LarkTokenHelper larkTokenHelper; protected LarkTableHelper larkTableHelper;
@Autowired
protected LarkApprovalHelper larkApprovalHelper;
@Autowired @Autowired
protected ILarkCompanyRelationService larkCompanyRelationService; protected ILarkCompanyRelationService larkCompanyRelationService;
@Autowired @Autowired
protected IEventService iEventService; protected IEventService iEventService;
@Autowired @Autowired
private RedisTemplate redisTemplate;
@Autowired
protected ILarkTableRelationService iLarkTableRelationService; protected ILarkTableRelationService iLarkTableRelationService;
@Autowired @Autowired
protected ILarkTableRowRelationService iLarkTableRowRelationService; protected ILarkTableRowRelationService iLarkTableRowRelationService;
@ -44,17 +48,9 @@ public class ApprovalCallbackOperate extends LarkAbstract {
private IEventService eventService; private IEventService eventService;
@Autowired @Autowired
private IEventLogService eventLogService; private IEventLogService eventLogService;
/**
*
*/
private static final String DETAIL = "DETAIL";
private String getDetail = "https://open.feishu.cn/open-apis/approval/v4/instances/:instance_id";
//新增明细行
private static final String CREATE_OPERATE = "CREATE_OPERATE";
private String addLine = "https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records";
private void fillTableRelation(LarkRequest request) { private void fillTableRelation(RequestVo request) {
LarkTableRelation tableRelation = new LarkTableRelation(); LarkTableRelation tableRelation = new LarkTableRelation();
tableRelation.setLarkCompanyRelationId(request.getCompanyRelationId()); tableRelation.setLarkCompanyRelationId(request.getCompanyRelationId());
@ -95,7 +91,7 @@ public class ApprovalCallbackOperate extends LarkAbstract {
} }
@Override @Override
protected void preOperate(LarkRequest request) { protected void preOperate(RequestVo request) {
Event event = request.getEvent(); Event event = request.getEvent();
if (event == null) { if (event == null) {
throw new RuntimeException("当前事件为空"); throw new RuntimeException("当前事件为空");
@ -110,62 +106,43 @@ public class ApprovalCallbackOperate extends LarkAbstract {
request.setCompanyRelationId(relation.getId()); request.setCompanyRelationId(relation.getId());
//关联关系表填充 //关联关系表填充
this.fillTableRelation(request); this.fillTableRelation(request);
String token = larkTokenHelper.getToken(relation.getAppId(), relation.getSecret(), "tenant_access_token"); request.setAppId(relation.getAppId());
request.setToken(token); request.setAppSecret(relation.getSecret());
} }
@Override @Override
protected void businessProcessing(LarkRequest request) { protected void businessProcessing(RequestVo request) {
request.setOperateType(DETAIL); LarkApprovalRequest detailRequest = new LarkApprovalRequest(request.getAppId(), request.getAppSecret(), request.getInstance());
JSONObject message = larkTokenHelper.getLark(getUrl(request), null, request.getToken(), null); GetInstanceRespBody approvalInfoDetail = larkApprovalHelper.getApprovalInfoDetail(detailRequest);
request.setRecord(message); request.setInstanceRespBody(approvalInfoDetail);
for (Map.Entry<String, Long> entry : request.getTableRelationMap().entrySet()) { for (Map.Entry<String, Long> entry : request.getTableRelationMap().entrySet()) {
String[] arr = entry.getKey().split("_"); String[] arr = entry.getKey().split("_");
request.setToAppToken(arr[0]); request.setToAppToken(arr[0]);
request.setToTableId(arr[1]); request.setToTableId(arr[1]);
request.setTableRelationId(entry.getValue()); request.setTableRelationId(entry.getValue());
Map<Object, Map<Object, Object>> body = getBody(request); send( request);
String url = getUrl(request);
if (StringUtils.isBlank(url)) {
return;
}
send(request.getOperateType(), url, body, request);
} }
} }
@Override @Override
protected String getUrl(LarkRequest request) { protected Map<String, Object> getBody(RequestVo request) {
Event event = request.getEvent(); Map<String , Object> result = new HashMap<>();
if (CREATE_OPERATE.equals(request.getOperateType())) {
return addLine.replace(":app_token", request.getToAppToken()).replace(":table_id", request.getToTableId());
} else if (DETAIL.equals(request.getOperateType())) {
return getDetail.replace(":instance_id", event.getRecordId());
}
return null;
}
@Override
protected Map<Object, Map<Object, Object>> getBody(LarkRequest request) {
Map<Object, Map<Object, Object>> result = new HashMap<>();
JSONObject record = request.getRecord(); JSONObject record = request.getRecord();
String responseCode = record.getString("code"); String responseCode = record.getString("code");
if ("0".equals(responseCode)) { if ("0".equals(responseCode)) {
result = parseMap(request); result = parseMap(request);
request.setOperateType(CREATE_OPERATE);
} }
return result; return result;
} }
private Map<Object, Map<Object, Object>> parseMap(LarkRequest request) { private Map<String, Object> parseMap(RequestVo request) {
Map<Object, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
JSONObject record = request.getRecord(); JSONObject record = request.getRecord();
Map<String, String> colRelation = request.getTableColRelationMap().getOrDefault(request.getTableRelationId(), new HashMap<>()); Map<String, String> colRelation = request.getTableColRelationMap().getOrDefault(request.getTableRelationId(), new HashMap<>());
for (Map.Entry<String, String> entry : colRelation.entrySet()) { for (Map.Entry<String, String> entry : colRelation.entrySet()) {
result.put(entry.getValue(), recursiveValue(record,entry.getKey())); result.put(entry.getValue(), recursiveValue(record,entry.getKey()));
} }
Map<Object, Map<Object, Object>> map = new HashMap<>(); return result;
map.put("fields", result);
return map;
} }
private Object recursiveValue(JSONObject record,String key){ private Object recursiveValue(JSONObject record,String key){
@ -180,16 +157,15 @@ public class ApprovalCallbackOperate extends LarkAbstract {
return record.get(split[split.length-1]); return record.get(split[split.length-1]);
} }
protected void send(String type, String url, Map<Object, Map<Object, Object>> body, LarkRequest request) { protected void send(RequestVo request) {
Map<String, Object> body = getBody(request);
request.setOperateInfo(String.valueOf(body)); request.setOperateInfo(String.valueOf(body));
String token = request.getToken(); LarkTableRequest add = new LarkTableRequest(request.getAppId(), request.getAppSecret(), request.getToAppToken(), request.getToTableId(), body);
if (CREATE_OPERATE.equals(type)) { CreateAppTableRecordRespBody resp = larkTableHelper.addTableRecord(add);
JSONObject result = larkTokenHelper.postLark(url, body, token);
}
} }
@Override @Override
protected void endHandle(LarkRequest request) { protected void endHandle(RequestVo request) {
Event event = request.getEvent(); Event event = request.getEvent();
EventLog eventLog = null; EventLog eventLog = null;
if (StringUtils.isBlank(request.getErrorMessage())) { if (StringUtils.isBlank(request.getErrorMessage())) {
@ -208,7 +184,7 @@ public class ApprovalCallbackOperate extends LarkAbstract {
} }
@Override @Override
protected String buildResult(LarkRequest request) { protected String buildResult(RequestVo request) {
return null; return null;
} }

@ -1,9 +1,7 @@
package com.ruoyi.flyingbook.strategy.operate; package com.ruoyi.flyingbook.strategy.operate;
import com.alibaba.fastjson.JSONObject; import com.ruoyi.flyingbook.domain.RequestVo;
import com.ruoyi.flyingbook.domain.LarkRequest;
import com.ruoyi.flyingbook.strategy.LarkOperateAbstract; import com.ruoyi.flyingbook.strategy.LarkOperateAbstract;
import org.apache.commons.lang3.StringUtils;
import java.util.Map; import java.util.Map;
@ -14,15 +12,11 @@ import java.util.Map;
public abstract class LarkAbstract extends LarkOperateAbstract { public abstract class LarkAbstract extends LarkOperateAbstract {
/**
* URL
*/
protected abstract String getUrl(LarkRequest request);
/** /**
* body * body
*/ */
protected abstract Map<Object, Map<Object, Object>> getBody(LarkRequest request); protected abstract Map<String,Object> getBody(RequestVo request);

@ -1,10 +1,12 @@
package com.ruoyi.flyingbook.strategy.operate; package com.ruoyi.flyingbook.strategy.operate;
import com.alibaba.fastjson.JSONObject; import com.lark.oapi.service.bitable.v1.model.CreateAppTableRecordRespBody;
import com.lark.oapi.service.bitable.v1.model.GetAppTableRecordResp;
import com.ruoyi.common.constant.RedisConstants; import com.ruoyi.common.constant.RedisConstants;
import com.ruoyi.common.enums.*; import com.ruoyi.common.enums.*;
import com.ruoyi.flyingbook.LarkHelper.LarkTokenHelper; import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper;
import com.ruoyi.flyingbook.domain.*; import com.ruoyi.flyingbook.domain.*;
import com.ruoyi.flyingbook.domain.lark.LarkTableRequest;
import com.ruoyi.flyingbook.service.*; import com.ruoyi.flyingbook.service.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -13,10 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
@ -30,7 +29,7 @@ import java.util.Map;
public class MultidimensionalTableOperate extends LarkAbstract { public class MultidimensionalTableOperate extends LarkAbstract {
@Autowired @Autowired
protected LarkTokenHelper larkTokenHelper; protected LarkTableHelper larkTokenHelper;
@Autowired @Autowired
protected ILarkCompanyRelationService larkCompanyRelationService; protected ILarkCompanyRelationService larkCompanyRelationService;
@Autowired @Autowired
@ -46,22 +45,20 @@ public class MultidimensionalTableOperate extends LarkAbstract {
@Autowired @Autowired
private IEventLogService eventLogService; private IEventLogService eventLogService;
/** /**
* *
*/ */
private static final String DETAIL = "DETAIL";
private String getDetail = "https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id";
//新增明细行
private static final String CREATE_OPERATE = "CREATE_OPERATE"; private static final String CREATE_OPERATE = "CREATE_OPERATE";
private String addLine = "https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records"; /**
//修改明细行 *
*/
private static final String UPDATE_OPERATE = "UPDATE_OPERATE"; private static final String UPDATE_OPERATE = "UPDATE_OPERATE";
private String updateLine = "https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id"; /**
//删除明细行 *
*/
private static final String DELETE_OPERATE = "DELETE_OPERATE"; private static final String DELETE_OPERATE = "DELETE_OPERATE";
private String deleteLine = "https://open.feishu.cn/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id";
private void fillTableRelation(LarkRequest request) { private void fillTableRelation(RequestVo request) {
LarkTableRelation tableRelation = new LarkTableRelation(); LarkTableRelation tableRelation = new LarkTableRelation();
tableRelation.setLarkCompanyRelationId(request.getCompanyRelationId()); tableRelation.setLarkCompanyRelationId(request.getCompanyRelationId());
tableRelation.setFromTableId(request.getEvent().getTableId()); tableRelation.setFromTableId(request.getEvent().getTableId());
@ -104,7 +101,7 @@ public class MultidimensionalTableOperate extends LarkAbstract {
} }
@Override @Override
protected void preOperate(LarkRequest request) { protected void preOperate(RequestVo request) {
Event event = request.getEvent(); Event event = request.getEvent();
if (event == null) { if (event == null) {
throw new RuntimeException("当前事件为空"); throw new RuntimeException("当前事件为空");
@ -115,62 +112,36 @@ public class MultidimensionalTableOperate extends LarkAbstract {
log.error("larkCompanyRelationService.getByCompanyName:{}", errorMessage); log.error("larkCompanyRelationService.getByCompanyName:{}", errorMessage);
throw new RuntimeException(errorMessage); throw new RuntimeException(errorMessage);
} }
request.setAppId(relation.getAppId());
request.setAppSecret(relation.getSecret());
//用于后续追加row时候做关联关系 //用于后续追加row时候做关联关系
request.setCompanyRelationId(relation.getId()); request.setCompanyRelationId(relation.getId());
//关联关系表填充 //关联关系表填充
this.fillTableRelation(request); this.fillTableRelation(request);
String token = larkTokenHelper.getToken(relation.getAppId(), relation.getSecret(), "tenant_access_token");
request.setToken(token);
} }
@Override @Override
protected void businessProcessing(LarkRequest request) { protected void businessProcessing(RequestVo request) {
request.setOperateType(DETAIL); Event event = request.getEvent();
List<String> safeCodeList = new ArrayList<>(); LarkTableRequest detailRequest = new LarkTableRequest(request.getAppId(), request.getAppSecret(), event.getAppToken(), event.getTableId(), event.getRecordId());
safeCodeList.add("1254043"); detailRequest.setSafeCode(Arrays.asList(1254043));
JSONObject message = larkTokenHelper.getLark(getUrl(request), null, request.getToken(),safeCodeList); GetAppTableRecordResp recordDetail = larkTokenHelper.getTableRecordDetail(detailRequest);
request.setRecord(message); request.setRespBody(recordDetail);
for (Map.Entry<String, Long> entry : request.getTableRelationMap().entrySet()) { for (Map.Entry<String, Long> entry : request.getTableRelationMap().entrySet()) {
String[] arr = entry.getKey().split("_"); String[] arr = entry.getKey().split("_");
request.setToAppToken(arr[0]); request.setToAppToken(arr[0]);
request.setToTableId(arr[1]); request.setToTableId(arr[1]);
request.setTableRelationId(entry.getValue()); request.setTableRelationId(entry.getValue());
Map<Object, Map<Object, Object>> body = getBody(request); send(request);
String url = getUrl(request);
if (StringUtils.isBlank(url)) {
return;
}
send(request.getOperateType(), url, body, request);
} }
} }
@Override
protected String getUrl(LarkRequest request) {
Event event = request.getEvent();
Map<String, String> rowRelation = request.getTableRowRelationMap().get(request.getTableRelationId());
String cacheKey = String.format("%s_%s_%s_%s", RedisConstants.MULTIPLE_TABLE_RECORD, event.getAppToken(), event.getTableId(), event.getRecordId());
redisTemplate.delete(cacheKey);
if (UPDATE_OPERATE.equals(request.getOperateType())) {
if (rowRelation.containsKey(event.getRecordId())) {
return updateLine.replace(":app_token", request.getToAppToken()).replace(":table_id", request.getToTableId()).replace(":record_id", rowRelation.get(event.getRecordId()));
}
} else if (CREATE_OPERATE.equals(request.getOperateType())) {
return addLine.replace(":app_token", request.getToAppToken()).replace(":table_id", request.getToTableId());
} else if (DELETE_OPERATE.equals(request.getOperateType())) {
if (rowRelation.containsKey(event.getRecordId())) {
return deleteLine.replace(":app_token", request.getToAppToken()).replace(":table_id", request.getToTableId()).replace(":record_id", rowRelation.get(event.getRecordId()));
}
} else if (DETAIL.equals(request.getOperateType())) {
return getDetail.replace(":app_token", event.getAppToken()).replace(":table_id", event.getTableId()).replace(":record_id", event.getRecordId());
}
return null;
}
@Override @Override
protected Map<Object, Map<Object, Object>> getBody(LarkRequest request) { protected Map<String, Object> getBody(RequestVo request) {
Map<Object, Map<Object, Object>> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
JSONObject record = request.getRecord(); GetAppTableRecordResp respBody = request.getRespBody();
String responseCode = record.getString("code"); Integer responseCode = respBody.getCode();
Map<String, String> rowMap = request.getTableRowRelationMap().getOrDefault(request.getTableRelationId(), new HashMap<>()); Map<String, String> rowMap = request.getTableRowRelationMap().getOrDefault(request.getTableRelationId(), new HashMap<>());
if ("1254043".equals(responseCode)) { if ("1254043".equals(responseCode)) {
request.setOperateType(DELETE_OPERATE); request.setOperateType(DELETE_OPERATE);
@ -185,50 +156,53 @@ public class MultidimensionalTableOperate extends LarkAbstract {
return result; return result;
} }
private Map<Object, Map<Object, Object>> parseMap(LarkRequest request) { /**
Map<Object, Object> result = new HashMap<>(); *
JSONObject record = request.getRecord(); */
private Map<String, Object> parseMap(RequestVo request) {
Map<String, Object> result = new HashMap<>();
Map<String, String> colRelation = request.getTableColRelationMap().getOrDefault(request.getTableRelationId(), new HashMap<>()); Map<String, String> colRelation = request.getTableColRelationMap().getOrDefault(request.getTableRelationId(), new HashMap<>());
String fields = record.getJSONObject("data").getJSONObject("record").getString("fields"); Map<String, Object> midMap = request.getRespBody().getData().getRecord().getFields();
Map<Object, Object> midMap = JSONObject.parseObject(fields, Map.class); for (Map.Entry<String, Object> entry : midMap.entrySet()) {
for (Map.Entry<Object, Object> entry : midMap.entrySet()) {
String key = String.valueOf(entry.getKey()); String key = String.valueOf(entry.getKey());
if (!colRelation.containsKey(key)) { if (!colRelation.containsKey(key)) {
continue; continue;
} }
result.put(colRelation.get(key), entry.getValue()); result.put(colRelation.get(key), entry.getValue());
} }
Map<Object, Map<Object, Object>> map = new HashMap<>(); return result;
map.put("fields", result);
return map;
} }
protected void send(String type, String url, Map<Object, Map<Object, Object>> body, LarkRequest request) { private void send(RequestVo request) {
String type = request.getOperateType();
Map<String, Object> body = getBody(request);
Event event = request.getEvent();
String cacheKey = String.format("%s_%s_%s_%s", RedisConstants.MULTIPLE_TABLE_RECORD, event.getAppToken(), event.getTableId(), event.getRecordId());
redisTemplate.delete(cacheKey);
request.setOperateInfo(String.valueOf(body)); request.setOperateInfo(String.valueOf(body));
String token = request.getToken();
if (CREATE_OPERATE.equals(type)) { if (CREATE_OPERATE.equals(type)) {
JSONObject result = larkTokenHelper.postLark(url, body, token); LarkTableRequest add = new LarkTableRequest(request.getAppId(), request.getAppSecret(), request.getToAppToken(), request.getToTableId(), body);
JSONObject data = result.getJSONObject("data"); CreateAppTableRecordRespBody addResp = larkTokenHelper.addTableRecord(add);
if (data != null) { if (addResp != null) {
JSONObject record = data.getJSONObject("record"); String recordId = addResp.getRecord().getRecordId();
if (record != null && StringUtils.isNotBlank(record.getString("record_id"))) { LarkTableRowRelation rowRelation = new LarkTableRowRelation(request.getCompanyRelationId(), event.getRecordId(), recordId, TableDetailRelationTypeEnum.ROW.getCode(), TableDetailRelationTypeEnum.ROW.getCode());
String recordId = record.getString("record_id"); iLarkTableRowRelationService.insertLarkTableRowRelation(rowRelation);
LarkTableRowRelation rowRelation = new LarkTableRowRelation(request.getCompanyRelationId(), request.getEvent().getRecordId(), recordId, TableDetailRelationTypeEnum.ROW.getCode(), TableDetailRelationTypeEnum.ROW.getCode());
iLarkTableRowRelationService.insertLarkTableRowRelation(rowRelation);
}
} }
request.setEventOperateType(EventOperateType.CREATE); request.setEventOperateType(EventOperateType.CREATE);
} else if (UPDATE_OPERATE.equals(type)) { } else if (UPDATE_OPERATE.equals(type)) {
request.setEventOperateType(EventOperateType.UPDATE); request.setEventOperateType(EventOperateType.UPDATE);
larkTokenHelper.putLark(url, body, token); LarkTableRequest update = new LarkTableRequest(request.getAppId(), request.getAppSecret(), request.getToAppToken(), request.getToTableId(),request.getToRecordId(), body);
larkTokenHelper.updateTableRecord(update);
} else if (DELETE_OPERATE.equals(type)) { } else if (DELETE_OPERATE.equals(type)) {
request.setEventOperateType(EventOperateType.DELETE); request.setEventOperateType(EventOperateType.DELETE);
larkTokenHelper.deleteLark(url, body, token); LarkTableRequest delete = new LarkTableRequest(request.getAppId(), request.getAppSecret(), request.getToAppToken(), request.getToTableId(),request.getToRecordId());
larkTokenHelper.deleteTableRecord(delete);
} }
} }
@Override @Override
protected void endHandle(LarkRequest request) { protected void endHandle(RequestVo request) {
Event event = request.getEvent(); Event event = request.getEvent();
EventLog eventLog = null; EventLog eventLog = null;
if (StringUtils.isBlank(request.getErrorMessage())) { if (StringUtils.isBlank(request.getErrorMessage())) {
@ -247,7 +221,7 @@ public class MultidimensionalTableOperate extends LarkAbstract {
} }
@Override @Override
protected String buildResult(LarkRequest request) { protected String buildResult(RequestVo request) {
return null; return null;
} }

Loading…
Cancel
Save