导出产品信息窗口执行‘结果全部导出’操作,导出的文件数据为空

dev
schry 2 years ago
parent e20a65a00c
commit f89247401a

@ -118,6 +118,45 @@ public class ThrProductsExportLogController {
//产品信息导出生成Excel并创建生成记录
@PostMapping("/udiwms/thrProducts/importLog/export")
public BaseResponse excelDownload(@RequestBody ThrProductsExportRequest thrProductsExportRequest) {
ThrProductsExportLogEntity thrProductsExportLogEntity = new ThrProductsExportLogEntity();
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setThirdSysFk(thrProductsExportRequest.getThirdSys());
filterThrProductsRequest.setThirdSys(thrProductsExportRequest.getThirdSys());
//List<ThrProductsEntity> thrProductsEntities = thrProductsService.filterThrProducts1(filterThrProductsRequest);
//thrProductsExportRequest.setThrProductsEntities(thrProductsEntities);
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS);
String genKey = CustomUtil.getId();
String fileName = "D:\\udiwms\\exportFile\\" + "第三方产品信息" + genKey + ".UpperIn";
File file = new File(fileName);
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
List<ThrProductsEntity> thrProductsEntityList = thrProductsExportRequest.getThrProductsEntities();
thrProductsExportLogEntity.setGenKey(genKey);
thrProductsExportLogEntity.setFilePath(fileName);
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setDlCount(0);
thrProductsExportLogEntity.setType(BasicProcessStatus.EXPORT_JSON);
thrProductsExportLogEntity.setUpdateUser(String.valueOf(customerService.getUserId()));
thrProductsExportLogEntity.setCreateUser(String.valueOf(customerService.getUserId()));
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setCreateTime(new Date());
thrProductsExportLogEntity.setRemark("本次导出数据" + thrProductsEntityList.size() + "条");
thrProductsExportLogService.insertThrProductsExportLog(thrProductsExportLogEntity);
//thrProductsDlService.genExcel(genKey, thrProductsExportRequest);
//修改为导出json文件
thrProductsDlService.genJsonFile(genKey, thrProductsExportRequest);
return ResultVOUtils.success("后台正在导出生成udi文件请稍后刷新查看!");
}
//产品信息导出生成Excel并创建生成记录
@PostMapping("/udiwms/thrProducts/importLog/exportAll")
public BaseResponse excelDownloadAll(@RequestBody ThrProductsExportRequest thrProductsExportRequest) {
ThrProductsExportLogEntity thrProductsExportLogEntity = new ThrProductsExportLogEntity();
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
filterThrProductsRequest.setThirdSysFk(thrProductsExportRequest.getThirdSys());
@ -135,6 +174,7 @@ public class ThrProductsExportLogController {
e.printStackTrace();
}
}
List<ThrProductsEntity> thrProductsEntityList = thrProductsExportRequest.getThrProductsEntities();
thrProductsExportLogEntity.setGenKey(genKey);
thrProductsExportLogEntity.setFilePath(fileName);
thrProductsExportLogEntity.setUpdateTime(new Date());
@ -144,6 +184,7 @@ public class ThrProductsExportLogController {
thrProductsExportLogEntity.setCreateUser(String.valueOf(customerService.getUserId()));
thrProductsExportLogEntity.setUpdateTime(new Date());
thrProductsExportLogEntity.setCreateTime(new Date());
thrProductsExportLogEntity.setRemark("本次导出数据" + thrProductsEntityList.size() + "条");
thrProductsExportLogService.insertThrProductsExportLog(thrProductsExportLogEntity);
//thrProductsDlService.genExcel(genKey, thrProductsExportRequest);
//修改为导出json文件

Loading…
Cancel
Save