|
@@ -8,16 +8,12 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
import com.persagy.dmp.basic.model.QueryCriteria;
|
|
|
import com.persagy.dmp.basic.utils.JsonNodeUtils;
|
|
|
import com.persagy.dmp.common.constant.ResponseCode;
|
|
|
-import com.persagy.dmp.common.model.entity.AuditableEntity;
|
|
|
-import com.persagy.dmp.common.model.entity.BaseEntity;
|
|
|
-import com.persagy.dmp.define.entity.ObjectTypeDefine;
|
|
|
import com.persagy.dmp.digital.client.DigitalObjectFacade;
|
|
|
import com.persagy.dmp.digital.entity.ObjectDigital;
|
|
|
import com.persagy.dmp.rwd.migrate.entity.SyncData;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import com.persagy.proxy.migration.constant.MigrationConstant;
|
|
|
-import com.persagy.proxy.migration.constant.MigrationObjType;
|
|
|
import com.persagy.proxy.migration.constant.MigrationTable;
|
|
|
import com.persagy.proxy.migration.constant.MigrationType;
|
|
|
import com.persagy.proxy.migration.model.DataMigrationExcel;
|
|
@@ -25,7 +21,6 @@ import com.persagy.proxy.migration.model.DataMigrationResponse;
|
|
|
import com.persagy.proxy.migration.model.MigrationInfo;
|
|
|
import com.persagy.proxy.migration.service.IDataMigration;
|
|
|
import com.persagy.proxy.migration.service.IDataMigrationProcess;
|
|
|
-import com.persagy.proxy.migration.service.Impl.MigrationAbstractServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -55,14 +50,14 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
|
|
|
log.info("######################### dt_object 数据迁移内容获取开始 #########################");
|
|
|
long start = System.currentTimeMillis();
|
|
|
List<DataMigrationExcel> dataMigrationExcels = new ArrayList<>();
|
|
|
+ List<String> objTypes = getObjTypes(context);
|
|
|
+ for(String objType : objTypes){
|
|
|
+ log.info("######################### dt_object "+objType+"数据迁移内容获取开始 #########################");
|
|
|
|
|
|
- for(MigrationObjType objType : MigrationObjType.values()){
|
|
|
- log.info("######################### dt_object "+objType.getCode()+"数据迁移内容获取开始 #########################");
|
|
|
-
|
|
|
- QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
|
|
|
+ QueryCriteria queryCriteria = getQueryCriteria(objType);
|
|
|
dataMigrationExcels.addAll(startMigrateForExcel(context,migrationInfo,queryCriteria));
|
|
|
|
|
|
- log.info("######################### dt_object "+objType.getCode()+"数据迁移内容获取结束 #########################");
|
|
|
+ log.info("######################### dt_object "+objType+"数据迁移内容获取结束 #########################");
|
|
|
}
|
|
|
|
|
|
long end = System.currentTimeMillis();
|
|
@@ -80,13 +75,14 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
|
|
|
public AdmResponse migrateForLog(InstanceUrlParam context, MigrationInfo migrationInfo) {
|
|
|
log.info("######################### dt_object 同步开始 #########################");
|
|
|
long start = System.currentTimeMillis();
|
|
|
- for(MigrationObjType objType : MigrationObjType.values()){
|
|
|
- log.info("######################### dt_object "+objType.getCode()+"同步开始 #########################");
|
|
|
+ List<String> objTypes = getObjTypes(context);
|
|
|
+ for(String objType : objTypes){
|
|
|
+ log.info("######################### dt_object "+objType+"同步开始 #########################");
|
|
|
|
|
|
- QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
|
|
|
+ QueryCriteria queryCriteria = getQueryCriteria(objType);
|
|
|
startMigrateForLog(context,migrationInfo,queryCriteria);
|
|
|
|
|
|
- log.info("######################### dt_object "+objType.getCode()+"同步结束 #########################");
|
|
|
+ log.info("######################### dt_object "+objType+"同步结束 #########################");
|
|
|
}
|
|
|
long end = System.currentTimeMillis();
|
|
|
log.info("######################### dt_object 数据迁移已结束 时间:"+(end-start)+" #########################");
|
|
@@ -104,8 +100,9 @@ public class ObjectDigitalMigration extends MigrationAbstractServiceImpl<ObjectD
|
|
|
StringBuffer sqls = new StringBuffer(" \n -- 数据迁移 dt_object ------ \n");
|
|
|
//获取已经采集的数据
|
|
|
String sqls_temp = "";
|
|
|
- for(MigrationObjType objType : MigrationObjType.values()){
|
|
|
- QueryCriteria queryCriteria = getQueryCriteria(objType.getCode());
|
|
|
+ List<String> objTypes = getObjTypes(context);
|
|
|
+ for(String objType : objTypes){
|
|
|
+ QueryCriteria queryCriteria = getQueryCriteria(objType);
|
|
|
List<ObjectNode> admData = getAdmData(context,queryCriteria);
|
|
|
if(CollUtil.isEmpty(admData)){
|
|
|
continue;
|