excl批量导入标准 添加搜索中心

This commit is contained in:
zhaokaiyao@91isoft.com
2021-09-10 15:59:10 +08:00
parent ea9e2b31cc
commit 61be8c0aaa
@@ -258,7 +258,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
}
@Value("file.importPath")
@Value("${file.importFilePath}")
private String importPath;
private List<ImportDto> error = new ArrayList<>();
@@ -268,6 +268,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
@Autowired
private ISarStandardsInfoService sarStandardsInfoService;
@Autowired
private ISarBussionessStandService sarBussionessStandService;
@Override
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap) {
@@ -456,7 +457,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
/**
* 截取发布日期 年月日
*/
String issueDate = importDto.getPublishTime().substring(0, 9);
String issueDate = importDto.getPublishTime().substring(0, 19);
sarStandardsInfoEO.setIssueTime(issueDate);//标准发布日期
String standStatus = importDto.getStandStatus();
@@ -468,8 +469,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
* 标准属性字段
*/
HashMap<String, String> attrInfoMap = new HashMap<>();
attrInfoMap.put("new","构建映射");
attrInfoMap.put("DTBJH", importDto.getReplaceId());
attrInfoMap.put("SSRQ", importDto.getImplementedTime().substring(0, 9));
attrInfoMap.put("SSRQ", importDto.getImplementedTime().substring(0, 19));
/**
* 文件
@@ -484,9 +487,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
try {
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
// File file = new File(importPath + realPath);
File file = new File("/home/file/2021/" + realPath);
// File file = new File("/home/file/2021/" + realPath);
if (file.exists()) {
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
@@ -552,6 +555,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
*/
HashMap<String, String> attrInfoMap = new HashMap<>();
attrInfoMap.put("new","构建映射");
if (importDto.getPath() != null) {
String path[] = importDto.getPath().split("/");
String realPath = "";
@@ -562,9 +566,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
try {
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
// File file = new File(importPath + realPath);
File file = new File("/home/file/2021/" + realPath);
// File file = new File("/home/file/2021/" + realPath);
if (file.exists()) {
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
@@ -593,7 +597,8 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
}
String attrInfoJson = new Gson().toJson(attrInfoMap);
sarBussionessStand.setSarStandAttrEOStr(attrInfoJson);//新增修改时属性表信息
return sarBussionessStand;
}