|
|
|
@ -347,7 +347,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
.set(BasicExportStatusEntity::getStatus, BasicExportStatusEnum.WAIT_SYNC.getCode())
|
|
|
|
|
.set(BasicExportStatusEntity::getUpdateTime, new Date())
|
|
|
|
|
.set(BasicExportStatusEntity::getCacheFilePath, fileFullPath)
|
|
|
|
|
.set(BasicExportStatusEntity::getRemark, String.format("%s: %s条", BasicExportStatusEnum.WAIT_SYNC.getRemark(), total))
|
|
|
|
|
.set(BasicExportStatusEntity::getRemark, String.format("%s: %s条", BasicExportTypeEnum.BASIC_DATA.getRemark(), total))
|
|
|
|
|
.eq(BasicExportStatusEntity::getType, BasicExportTypeEnum.BASIC_DATA.getRemark())
|
|
|
|
|
.eq(BasicExportStatusEntity::getStatus, BasicExportStatusEnum.WAIT_BUILT.getCode())
|
|
|
|
|
.isNull(BasicExportStatusEntity::getCacheFilePath)
|
|
|
|
@ -460,12 +460,18 @@ public class SpsSyncDownloadService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String writeFile(String filePath, String fileDesc, String content) throws IOException {
|
|
|
|
|
String fileFullPath = String.format("%s/%s/%s-%s.udi", filePath, DateUtil.getDate(), fileDesc, IdUtil.fastSimpleUUID());
|
|
|
|
|
File file = new File(fileFullPath);
|
|
|
|
|
filePath = String.format("%s/%s", filePath, DateUtil.getDate());
|
|
|
|
|
String fileFullPath = String.format("%s/%s-%s.udi", filePath, fileDesc, IdUtil.fastSimpleUUID());
|
|
|
|
|
File file = new File(filePath);
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
|
file.mkdirs();
|
|
|
|
|
}
|
|
|
|
|
file = new File(fileFullPath);
|
|
|
|
|
while (!file.createNewFile()) {
|
|
|
|
|
fileFullPath = String.format("%s/%s/%s-%s.udi", filePath, DateUtil.getDate(), fileDesc, IdUtil.fastSimpleUUID());
|
|
|
|
|
file = new File(fileFullPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FileWriter fileWriter = new FileWriter(file);
|
|
|
|
|
fileWriter.write(content);
|
|
|
|
|
fileWriter.flush();
|
|
|
|
|