|
|
|
@ -40,6 +40,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.File;
|
|
|
|
@ -132,6 +133,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
// 创建国家库同步任务
|
|
|
|
|
public void syncDiProductsTask(Date lastUpdateTime) {
|
|
|
|
|
|
|
|
|
@ -144,8 +146,16 @@ public class SpsSyncDownloadService {
|
|
|
|
|
//首次任务or上次任务结束
|
|
|
|
|
if (exportStatus == null || BasicExportStatusEnum.COMPLETED.getCode().equals(exportStatus.getStatus())) {
|
|
|
|
|
SpsSyncDataRequest spsSyncDataRequest = getRequest(ConstantStatus.SYNC_DI_PRODUCTS);
|
|
|
|
|
if (lastUpdateTime != null)
|
|
|
|
|
if (lastUpdateTime != null) {
|
|
|
|
|
spsSyncDataRequest.setLastUpdateTime(DateUtil.formatDateTime(lastUpdateTime));
|
|
|
|
|
|
|
|
|
|
BasicExportStatusTimeEntity timeInfo = BasicExportStatusTimeEntity.builder()
|
|
|
|
|
.key("AutoDownloadDiProducts")
|
|
|
|
|
.lastUpdateTime(DateUtil.formatDateTime(lastUpdateTime))
|
|
|
|
|
.build();
|
|
|
|
|
basicExportTimeService.replace(timeInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BaseResponse<SpSyncUdiResponse> baseResponse = syncUdi(spsSyncDataRequest);
|
|
|
|
|
SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData();
|
|
|
|
|
if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList())
|
|
|
|
|