bug修复

master
wj 2 years ago
parent 3cfc2887d4
commit 0aaa214d4f

@ -175,7 +175,7 @@ public class SpsSyncDownloadController {
StringBuilder str = new StringBuilder();
int data;
while ((data = reader.read()) != -1) {
str.append(data);
str.append((char)data);
}
reader.close();
Dict map = JsonUtils.parseMap(str.toString());

@ -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();

Loading…
Cancel
Save