【feat】 getContentDocumnetLink获取LinkType
This commit is contained in:
parent
0c78cafc84
commit
47fead11ad
@ -1103,29 +1103,29 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
@Override
|
@Override
|
||||||
public ReturnT<String> getDocumentLink(String paramStr) throws Exception {
|
public ReturnT<String> getDocumentLink(String paramStr) throws Exception {
|
||||||
String api = "ContentDocumentLink";
|
String api = "ContentDocumentLink";
|
||||||
// PartnerConnection partnerConnection = salesforceConnect.createConnect();
|
PartnerConnection partnerConnection = salesforceConnect.createConnect();
|
||||||
PartnerConnection connection = salesforceTargetConnect.createConnect();
|
PartnerConnection connection = salesforceTargetConnect.createConnect();
|
||||||
List<Map<String, Object>> list = customMapper.list("Id", "ContentDocument", "new_id is not null");
|
List<Map<String, Object>> list = customMapper.list("Id", "ContentDocument", "new_id is not null");
|
||||||
// DescribeSObjectResult dsr = partnerConnection.describeSObject(api);
|
DescribeSObjectResult dsr = partnerConnection.describeSObject(api);
|
||||||
// List<String> fields = customMapper.getFields(api).stream().map(String::toUpperCase).collect(Collectors.toList());
|
List<String> fields = customMapper.getFields(api).stream().map(String::toUpperCase).collect(Collectors.toList());
|
||||||
// Field[] dsrFields = dsr.getFields();
|
Field[] dsrFields = dsr.getFields();
|
||||||
try {
|
try {
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
// for (Map<String, Object> map : list) {
|
for (Map<String, Object> map : list) {
|
||||||
// String contentDocumentId = (String) map.get("Id");
|
String contentDocumentId = (String) map.get("Id");
|
||||||
// String sql = "SELECT Id, LinkedEntityId, LinkedEntity.Type, ContentDocumentId, Visibility, ShareType, SystemModstamp, IsDeleted FROM ContentDocumentLink where ContentDocumentId = '" + contentDocumentId + "'";
|
String sql = "SELECT Id, LinkedEntityId, LinkedEntity.Type, ContentDocumentId, Visibility, ShareType, SystemModstamp, IsDeleted FROM ContentDocumentLink where ContentDocumentId = '" + contentDocumentId + "'";
|
||||||
// JSONArray objects = null;
|
JSONArray objects = null;
|
||||||
// try {
|
try {
|
||||||
// QueryResult queryResult = partnerConnection.queryAll(sql);
|
QueryResult queryResult = partnerConnection.queryAll(sql);
|
||||||
// SObject[] records = queryResult.getRecords();
|
SObject[] records = queryResult.getRecords();
|
||||||
// objects = DataUtil.toJsonArray(records, dsrFields);
|
objects = DataUtil.toJsonArray(records, dsrFields);
|
||||||
// saveOrUpdate(api, fields, records, objects, true);
|
saveOrUpdate(api, fields, records, objects, true);
|
||||||
// } catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
// log.error("getDocumentLink error api:{}, data:{}", api, JSON.toJSONString(objects), e);
|
log.error("getDocumentLink error api:{}, data:{}", api, JSON.toJSONString(objects), e);
|
||||||
// TimeUnit.MINUTES.sleep(1);
|
TimeUnit.MINUTES.sleep(1);
|
||||||
// return ReturnT.FAIL;
|
return ReturnT.FAIL;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
//表内数据总量
|
//表内数据总量
|
||||||
Integer count = customMapper.countBySQL(api, "where ShareType = 'V' and new_id = '0'");
|
Integer count = customMapper.countBySQL(api, "where ShareType = 'V' and new_id = '0'");
|
||||||
@ -1148,7 +1148,7 @@ public class CommonServiceImpl implements CommonService {
|
|||||||
QueryWrapper<DataObject> qw = new QueryWrapper<>();
|
QueryWrapper<DataObject> qw = new QueryWrapper<>();
|
||||||
qw.eq("name", linkedEntityType);
|
qw.eq("name", linkedEntityType);
|
||||||
List<DataObject> objects = dataObjectService.list(qw);
|
List<DataObject> objects = dataObjectService.list(qw);
|
||||||
if (objects.size() > 0) {
|
if (!objects.isEmpty()) {
|
||||||
Map<String, Object> dMap = customMapper.getById("new_id", "ContentDocument", contentDocumentId);
|
Map<String, Object> dMap = customMapper.getById("new_id", "ContentDocument", contentDocumentId);
|
||||||
Map<String, Object> lMap = customMapper.getById("new_id", linkedEntityType, linkedEntityId);
|
Map<String, Object> lMap = customMapper.getById("new_id", linkedEntityType, linkedEntityId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user