|
|
|
@ -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文件
|
|
|
|
|