|
|
|
@ -227,54 +227,6 @@ public class BasicGenExcelService {
|
|
|
|
|
}
|
|
|
|
|
@Async
|
|
|
|
|
public void exportJsonUdiInfo(String genKey, UdiInfoExportRequest udiInfoExportRequest) {
|
|
|
|
|
UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
|
|
|
|
|
List<List<String>> excelData = new ArrayList<>();
|
|
|
|
|
List<String> head = new ArrayList<>();
|
|
|
|
|
head.add("udiCode");
|
|
|
|
|
head.add("医保编码");
|
|
|
|
|
head.add("商品条码");
|
|
|
|
|
head.add("thirdId");
|
|
|
|
|
head.add("thirdId1");
|
|
|
|
|
head.add("thirdId2");
|
|
|
|
|
head.add("thirdId3");
|
|
|
|
|
head.add("thirdId4");
|
|
|
|
|
head.add("是否以使用单元入库");
|
|
|
|
|
excelData.add(head);
|
|
|
|
|
//选中导出
|
|
|
|
|
if (udiInfoExportRequest.getUuids() != null && udiInfoExportRequest.getUuids().size() > 0) {
|
|
|
|
|
List<String> uuids = udiInfoExportRequest.getUuids();
|
|
|
|
|
for (String uuid : uuids) {
|
|
|
|
|
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
|
|
|
|
|
filterUdiInfoRequest.setUuid(uuid);
|
|
|
|
|
List<List<String>> genDatas = genExcelData(filterUdiInfoRequest);
|
|
|
|
|
if (genDatas != null && genDatas.size() > 0) {
|
|
|
|
|
excelData.addAll(genDatas);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {//一键导出
|
|
|
|
|
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
|
|
|
|
|
BeanUtils.copyProperties(udiInfoExportRequest, filterUdiInfoRequest);
|
|
|
|
|
filterUdiInfoRequest.setPage(null);
|
|
|
|
|
List<List<String>> genDatas = genExcelData(filterUdiInfoRequest);
|
|
|
|
|
if (genDatas != null && genDatas.size() > 0) {
|
|
|
|
|
excelData.addAll(genDatas);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sheetName = "UDI产品信息对照";
|
|
|
|
|
|
|
|
|
|
File file = new File(udiInfoExportLogEntity.getFilePath());
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
|
try {
|
|
|
|
|
file.createNewFile();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
new ExcelUtil().exportExcel(excelData, sheetName, udiInfoExportLogEntity.getFilePath(), 20);
|
|
|
|
|
udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
|
|
|
|
|
udiInfoExportLogService.updateUdiInfoExportLog(udiInfoExportLogEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|