畅捷通多个账户配置

沃森川job同步飞书
YXY 1 year ago
parent 8eed20a9c2
commit 368a5b1883

@ -141,7 +141,6 @@ public abstract class SyncAccountsJobAbstract {
sync(context); sync(context);
} catch (Exception e) { } catch (Exception e) {
log.error("{} 执行失败", getClassName(), e); log.error("{} 执行失败", getClassName(), e);
larkRobotHelper.sendMessageByBot(ROBOT_GROUP, buildRobotErrorMessage(e));
CJTRetryRequest request = new CJTRetryRequest(now,1); CJTRetryRequest request = new CJTRetryRequest(now,1);
redisCache.rightPush(getRetryKey(),request); redisCache.rightPush(getRetryKey(),request);
}finally { }finally {
@ -153,6 +152,21 @@ public abstract class SyncAccountsJobAbstract {
return String.format(RETRY_KEY, syncLarkAppType().getCode()); return String.format(RETRY_KEY, syncLarkAppType().getCode());
} }
/**
*
*/
protected String getCertificate(){
return "OXYwHSWAc22UPHxfIUM0SSFZwziCLmBfOzBaN+PCNp0SNfV3ewYIaWLJCCrYToCU46x3PJO8t4TXV57bGpbiqClld5DiAkQ3EX1qqxoyaE9J0HAsfnp/PkPurKMQewBHICM2oEPRyLU5GUQjTCucfLvO4xT3DKlelbjBsIkKLqs=";
}
protected String getCjtAppKey(){
return "wwjSb5Vl";
}
protected String getCjtAppSecret(){
return "C661F71361CC4C5636396480FF08BBA4";
}
private String buildRobotErrorCountMessage(Exception e,CJTRetryRequest request){ private String buildRobotErrorCountMessage(Exception e,CJTRetryRequest request){
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("同步任务",getClassName()); jsonObject.put("同步任务",getClassName());
@ -445,7 +459,7 @@ public abstract class SyncAccountsJobAbstract {
, context.getAppKey() , context.getAppKey()
, context.getAppSecret() , context.getAppSecret()
, context.getTicket() , context.getTicket()
, CERTIFICATE); , getCertificate());
cjtRequest.buildGenerateBody(); cjtRequest.buildGenerateBody();
JSONObject body = JSONObject.parseObject(post(cjtRequest)); JSONObject body = JSONObject.parseObject(post(cjtRequest));
JSONObject value = body.getJSONObject("value"); JSONObject value = body.getJSONObject("value");
@ -476,10 +490,8 @@ public abstract class SyncAccountsJobAbstract {
List<LarkTableRelation> larkTableRelations = larkTableRelationMapper.selectLarkTableRelationList(tableRelationQuery); List<LarkTableRelation> larkTableRelations = larkTableRelationMapper.selectLarkTableRelationList(tableRelationQuery);
LarkTableRelation tableRelation = larkTableRelations.get(0); LarkTableRelation tableRelation = larkTableRelations.get(0);
context.setTableRelation(tableRelation); context.setTableRelation(tableRelation);
String remark = companyRelation.getRemark(); context.setAppKey(getCjtAppKey());
String[] arr = remark.split("_"); context.setAppSecret(getCjtAppSecret());
context.setAppKey(arr[0]);
context.setAppSecret(arr[1]);
} }
/** /**

Loading…
Cancel
Save