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