Compare commits

..

No commits in common. "87f1863d01665cb221f41ea3349144348b30a3ee" and "006ceba21135eb433822f8b297ebe7ced31a9427" have entirely different histories.

3 changed files with 22 additions and 21 deletions

View File

@ -586,9 +586,6 @@ public class CommonServiceImpl implements CommonService {
fields.add("Who.type"); fields.add("Who.type");
fields.add("What.type"); fields.add("What.type");
} }
if ("TaskRelation".equals(api) || "EventRelation".equals(api)) {
fields.add("Relation.type");
}
DataObject dataObject = dataObjectService.getById(api); DataObject dataObject = dataObjectService.getById(api);
if (dataObject != null && StringUtils.isNotBlank(dataObject.getExtraField())) { if (dataObject != null && StringUtils.isNotBlank(dataObject.getExtraField())) {
fields.addAll(Arrays.asList(StringUtils.split(dataObject.getExtraField().replaceAll(StringUtils.SPACE, StringUtils.EMPTY), ","))); fields.addAll(Arrays.asList(StringUtils.split(dataObject.getExtraField().replaceAll(StringUtils.SPACE, StringUtils.EMPTY), ",")));
@ -820,7 +817,6 @@ public class CommonServiceImpl implements CommonService {
log.info("check api:{}", apiName); log.info("check api:{}", apiName);
try { try {
boolean hasCreatedDate = false; boolean hasCreatedDate = false;
PartnerConnection connection = salesforceConnect.createConnect(); PartnerConnection connection = salesforceConnect.createConnect();
DataObject dataObject = dataObjectService.getById(apiName); DataObject dataObject = dataObjectService.getById(apiName);
Date now = new Date(); Date now = new Date();
@ -830,6 +826,8 @@ public class CommonServiceImpl implements CommonService {
List<Map<String, Object>> list = Lists.newArrayList(); List<Map<String, Object>> list = Lists.newArrayList();
DescribeSObjectResult dsr = connection.describeSObject(apiName); DescribeSObjectResult dsr = connection.describeSObject(apiName);
String label = dsr.getLabel(); String label = dsr.getLabel();
boolean isCustomObject = dsr.isCustom(); // 自定义对象才支持新增字段
boolean isUpdateable = dsr.isUpdateable(); // 对象本身是否可修改
List<DataField> fieldList = Lists.newArrayList(); List<DataField> fieldList = Lists.newArrayList();
List<String> fields = Lists.newArrayList(); List<String> fields = Lists.newArrayList();
String blobField = null; String blobField = null;
@ -953,14 +951,6 @@ public class CommonServiceImpl implements CommonService {
list.add(LinkedMap1); list.add(LinkedMap1);
} }
if ("TaskRelation".equals(apiName) || "EventRelation".equals(apiName)){
Map<String, Object> LinkedMap = Maps.newHashMap();
LinkedMap.put("type", "varchar(18)");
LinkedMap.put("comment", "relationId关联对象");
LinkedMap.put("name", "Relation_Type__c");
list.add(LinkedMap);
}
if ("ContentDocumentLink".equals(apiName)){ if ("ContentDocumentLink".equals(apiName)){
//文档关联表新增关联对象字段 //文档关联表新增关联对象字段
Map<String, Object> LinkedMap = Maps.newHashMap(); Map<String, Object> LinkedMap = Maps.newHashMap();
@ -1035,6 +1025,9 @@ public class CommonServiceImpl implements CommonService {
update.setName(apiName); update.setName(apiName);
update.setLastUpdateDate(endCreateDate); update.setLastUpdateDate(endCreateDate);
update.setBlobField(blobField); update.setBlobField(blobField);
if(!isCustomObject && !isUpdateable){
update.setIsEditable(false);
}
dataObjectService.saveOrUpdate(update); dataObjectService.saveOrUpdate(update);
} }
} finally { } finally {

View File

@ -767,15 +767,23 @@ public class DataImportNewServiceImpl implements DataImportNewService {
} }
} }
} else { } else {
if ("WhatId_Type__c".equals(field) || "WhoId_Type__c".equals(field) || "Relation_Type__c".equals(field)){ if (api.equals("Task") || api.equals("Event")) {
Map<String, Object> m = customMapper.getById("new_id", String.valueOf(map.get(field)), value); if ("WhatId_Type__c".equals(field) || "WhoId_Type__c".equals(field)){
if (m != null && !m.isEmpty()) { Map<String, Object> m = customMapper.getById("new_id", String.valueOf(map.get(field)), value);
account.setField(field, m.get("new_id")); if (m != null && !m.isEmpty()) {
account.setField(field, m.get("new_id"));
}else {
String message = "对象类型:" + api + "的数据:"+ map.get("Id") +"的引用对象:" + dataField.getReferenceTo() + "的数据:"+ map.get(field) +"不存在!";
EmailUtil.send("DataDump ERROR", message);
log.info(message);
return;
}
}else { }else {
String message = "对象类型:" + api + "的数据:"+ map.get("Id") +"的引用对象:" + dataField.getReferenceTo() + "的数据:"+ map.get(field) +"不存在!"; if (map.get(field) != null && StringUtils.isNotBlank(dataField.getSfType())) {
EmailUtil.send("DataDump ERROR", message); account.setField(field, DataUtil.localDataToSfData(dataField.getSfType(), value));
log.info(message); }else {
return; account.setField(field, map.get(field));
}
} }
}else { }else {
if (map.get(field) != null && StringUtils.isNotBlank(dataField.getSfType())) { if (map.get(field) != null && StringUtils.isNotBlank(dataField.getSfType())) {

View File

@ -674,7 +674,7 @@ public class FileServiceImpl implements FileService {
log.info("文件不存在"); log.info("文件不存在");
break; break;
} }
String fileName = (String) map.get("Name"); String fileName = file.getName();
// dataObject查询 // dataObject查询
QueryWrapper<DataObject> qw = new QueryWrapper<>(); QueryWrapper<DataObject> qw = new QueryWrapper<>();