|
|
|
@ -83,15 +83,12 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
|
|
|
|
|
//基础表导入
|
|
|
|
|
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiInfoEntities())) {
|
|
|
|
|
try {
|
|
|
|
|
List<UdiInfoEntity> corpList = udiRelevanceExportJsonResponse.getUdiInfoEntities();
|
|
|
|
|
UdiInfoDao mapper = batchSession.getMapper(UdiInfoDao.class);
|
|
|
|
|
for (UdiInfoEntity basicUnitMaintainEntity : corpList) {
|
|
|
|
|
mapper.insertUdiInfo(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
List<UdiInfoEntity> corpList = udiRelevanceExportJsonResponse.getUdiInfoEntities();
|
|
|
|
|
UdiInfoDao mapper = batchSession.getMapper(UdiInfoDao.class);
|
|
|
|
|
for (UdiInfoEntity basicUnitMaintainEntity : corpList) {
|
|
|
|
|
mapper.insertUdiInfo(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
}
|
|
|
|
|
batchSession.close();
|
|
|
|
|
// udiInfoDao.importUdiInfo(udiRelevanceExportJsonResponse.getUdiInfoEntities());
|
|
|
|
@ -101,15 +98,12 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
|
|
|
|
|
//关联表导入
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getUdiRelevanceEntities())) {
|
|
|
|
|
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
|
|
|
|
try {
|
|
|
|
|
List<UdiRelevanceEntity> corpList = udiRelevanceExportJsonResponse.getUdiRelevanceEntities();
|
|
|
|
|
UdiRelevanceDao mapper = batchSession.getMapper(UdiRelevanceDao.class);
|
|
|
|
|
for (UdiRelevanceEntity basicUnitMaintainEntity : corpList) {
|
|
|
|
|
mapper.insertUdiRelevance(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
List<UdiRelevanceEntity> corpList = udiRelevanceExportJsonResponse.getUdiRelevanceEntities();
|
|
|
|
|
UdiRelevanceDao mapper = batchSession.getMapper(UdiRelevanceDao.class);
|
|
|
|
|
for (UdiRelevanceEntity basicUnitMaintainEntity : corpList) {
|
|
|
|
|
mapper.insertUdiRelevance(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
batchSession.close();
|
|
|
|
|
// udiRelevanceDao.importUdiRelevance(udiRelevanceExportJsonResponse.getUdiRelevanceEntities());
|
|
|
|
|
}
|
|
|
|
@ -118,15 +112,12 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getThrProductsEntities())) {
|
|
|
|
|
|
|
|
|
|
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
|
|
|
|
try {
|
|
|
|
|
List<ThrProductsEntity> corpList = udiRelevanceExportJsonResponse.getThrProductsEntities();
|
|
|
|
|
ThrProductsDao mapper = batchSession.getMapper(ThrProductsDao.class);
|
|
|
|
|
for (ThrProductsEntity basicUnitMaintainEntity : corpList) {
|
|
|
|
|
mapper.insertThrProducts(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
List<ThrProductsEntity> corpList = udiRelevanceExportJsonResponse.getThrProductsEntities();
|
|
|
|
|
ThrProductsDao mapper = batchSession.getMapper(ThrProductsDao.class);
|
|
|
|
|
for (ThrProductsEntity basicUnitMaintainEntity : corpList) {
|
|
|
|
|
mapper.insertThrProducts(basicUnitMaintainEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
batchSession.close();
|
|
|
|
|
// thrProductsDao.importThrProductss(udiRelevanceExportJsonResponse.getThrProductsEntities());
|
|
|
|
|
}
|
|
|
|
@ -135,15 +126,12 @@ public class UdiInfoImportDetailServiceImpl implements UdiInfoImportDetailServic
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRelevanceExportJsonResponse.getCompanyProductRelevanceEntities())) {
|
|
|
|
|
|
|
|
|
|
SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
|
|
|
|
try {
|
|
|
|
|
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = udiRelevanceExportJsonResponse.getCompanyProductRelevanceEntities();
|
|
|
|
|
CompanyProductRelevanceDao mapper = batchSession.getMapper(CompanyProductRelevanceDao.class);
|
|
|
|
|
for (CompanyProductRelevanceEntity companyProductRelevanceEntity : companyProductRelevanceEntities) {
|
|
|
|
|
mapper.importCompanyProductRelevance(companyProductRelevanceEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
List<CompanyProductRelevanceEntity> companyProductRelevanceEntities = udiRelevanceExportJsonResponse.getCompanyProductRelevanceEntities();
|
|
|
|
|
CompanyProductRelevanceDao mapper = batchSession.getMapper(CompanyProductRelevanceDao.class);
|
|
|
|
|
for (CompanyProductRelevanceEntity companyProductRelevanceEntity : companyProductRelevanceEntities) {
|
|
|
|
|
mapper.importCompanyProductRelevance(companyProductRelevanceEntity);
|
|
|
|
|
}
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
batchSession.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|