diff --git a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java index 19c2dc20..4789d5ff 100644 --- a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java @@ -201,7 +201,7 @@ public class SpsSyncDownloadService { if (exportStatus == null || BasicExportStatusEnum.COMPLETED.getCode().equals(exportStatus.getStatus())) { //判断有无新数据 - Boolean hasData = hasDataMethod.apply(clazz.getConstructor().newInstance()); + Boolean hasData = hasDataMethod.apply(this); if (Boolean.FALSE.equals(hasData)) { return; } @@ -215,7 +215,7 @@ public class SpsSyncDownloadService { .build(); basicExportService.save(exportStatus); } else if (exportStatus.getStatus().equals(BasicExportStatusEnum.WAIT_BUILT.getCode())) {//文件待生成 - createFileMethod.apply(clazz.getConstructor().newInstance()); + createFileMethod.apply(this); } } @@ -227,7 +227,7 @@ public class SpsSyncDownloadService { * @param createFile 是否创建文件 * @return 是否有数据 true/false 有新数据/无新数据 */ - private boolean generateBasicDataFile(SyncDataSetResponse info, Date now, boolean createFile) { + protected boolean generateBasicDataFile(SyncDataSetResponse info, Date now, boolean createFile) { //文件数据 Map jsonMap = new WeakHashMap<>(4); Map> totalTimeMap = new WeakHashMap<>(10); @@ -238,7 +238,7 @@ public class SpsSyncDownloadService { totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_PRODUCTS, map); List hospTypeList = hospTypeService.list(Wrappers.lambdaQuery(BasicHospTypeEntity.class) .le((boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(hospTypeList)) { @@ -246,7 +246,7 @@ public class SpsSyncDownloadService { } List udiRelevanceList = udiRelevanceService.list(Wrappers.lambdaQuery(UdiRelevanceEntity.class) .le((boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(udiRelevanceList)) { @@ -254,7 +254,7 @@ public class SpsSyncDownloadService { } List productsList = basicProductsDao.selectList(Wrappers.lambdaQuery(BasicProductsEntity.class) .le((boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(productsList)) { @@ -262,7 +262,7 @@ public class SpsSyncDownloadService { } List relevanceList = relevanceService.list(Wrappers.lambdaQuery(CompanyProductRelevanceEntity.class) .le((boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(relevanceList)) { @@ -275,7 +275,7 @@ public class SpsSyncDownloadService { totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_CORP, map); List corpList = corpService.list(Wrappers.lambdaQuery(BasicCorpEntity.class) .le((boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(corpList)) { @@ -289,7 +289,7 @@ public class SpsSyncDownloadService { totalTimeMap.put(BasicExportStatusTimeEnum.SUP_CERT, map); List supCertList = supCertService.list(Wrappers.lambdaQuery(SupCertEntity.class) .le((boolean) map.get("isNew"), SupCertEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), SupCertEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), SupCertEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(supCertList)) { @@ -297,7 +297,7 @@ public class SpsSyncDownloadService { } List supCertSetList = supCertSetService.list(Wrappers.lambdaQuery(SupCertSetEntity.class) .le((boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(supCertSetList)) { @@ -305,7 +305,7 @@ public class SpsSyncDownloadService { } List supCompanyList = supCompanyService.list(Wrappers.lambdaQuery(SupCompanyEntity.class) .le((boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(supCompanyList)) { @@ -313,7 +313,7 @@ public class SpsSyncDownloadService { } List supManufacturerList = supManufacturerService.list(Wrappers.lambdaQuery(SupManufacturerEntity.class) .le((boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(supManufacturerList)) { @@ -321,7 +321,7 @@ public class SpsSyncDownloadService { } List supProductList = supProductService.list(Wrappers.lambdaQuery(SupProductEntity.class) .le((boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now) - .between((boolean) map.get("isNew"), SupProductEntity::getUpdateTime + .between(!(boolean) map.get("isNew"), SupProductEntity::getUpdateTime , map.get("oldDate"), now) ); if (CollectionUtil.isNotEmpty(supProductList)) {