|
|
|
@ -108,7 +108,7 @@ public class TfSourceTaskNew {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 压缩记录入库,每次压缩5万
|
|
|
|
|
* 压缩记录入库,每次压缩10万
|
|
|
|
|
*/
|
|
|
|
|
private void saveData(Integer total, DateTime startTime, DateTime endTime, String dataSourceName) {
|
|
|
|
|
if (total <= 0) {
|
|
|
|
@ -135,7 +135,7 @@ public class TfSourceTaskNew {
|
|
|
|
|
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
|
|
|
|
|
String password = RandomUtil.randomString(6);
|
|
|
|
|
String newPath = zipFile(filePath + File.separator + entry.getKey() + ".zip", entry.getValue(), password);
|
|
|
|
|
if (StrUtil.isNotBlank(filePath)) {
|
|
|
|
|
if (StrUtil.isNotBlank(newPath)) {
|
|
|
|
|
//保存文件记录
|
|
|
|
|
TbTfSourceEntity tbTfSourceEntity = new TbTfSourceEntity().addTbTfSourceEntity(format, null, null, entry.getKey(), newPath, password);
|
|
|
|
|
saveList.add(tbTfSourceEntity);
|
|
|
|
@ -151,7 +151,7 @@ public class TfSourceTaskNew {
|
|
|
|
|
String format = DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd");
|
|
|
|
|
//生成文件
|
|
|
|
|
for (String tag : mapByTag.keySet()) {
|
|
|
|
|
String filePath = path + File.separator + format + File.separator + tag + circulateNum + ".csv";
|
|
|
|
|
String filePath = path + File.separator + format + File.separator + tag + "-" + circulateNum + ".csv";
|
|
|
|
|
File file = new File(filePath);
|
|
|
|
|
CsvWriter writer = new CsvWriter(file, StandardCharsets.UTF_8);
|
|
|
|
|
writer.writeBeans(mapByTag.get(tag));
|
|
|
|
|