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 String importPath;
private List<ImportDto> error = new ArrayList<>(); private List<ImportDto> error = new ArrayList<>();
@@ -268,6 +268,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
@Autowired @Autowired
private ISarStandardsInfoService sarStandardsInfoService; private ISarStandardsInfoService sarStandardsInfoService;
@Autowired
private ISarBussionessStandService sarBussionessStandService; private ISarBussionessStandService sarBussionessStandService;
@Override @Override
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap) { 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);//标准发布日期 sarStandardsInfoEO.setIssueTime(issueDate);//标准发布日期
String standStatus = importDto.getStandStatus(); String standStatus = importDto.getStandStatus();
@@ -468,8 +469,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
* 标准属性字段 * 标准属性字段
*/ */
HashMap<String, String> attrInfoMap = new HashMap<>(); HashMap<String, String> attrInfoMap = new HashMap<>();
attrInfoMap.put("new","构建映射");
attrInfoMap.put("DTBJH", importDto.getReplaceId()); 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 { 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(importPath + realPath);
File file = new File("/home/file/2021/" + realPath); // File file = new File("/home/file/2021/" + realPath);
if (file.exists()) { if (file.exists()) {
AttFileVo fileInfo = attFileEOService.saveFileInfo(file); AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
@@ -552,6 +555,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
*/ */
HashMap<String, String> attrInfoMap = new HashMap<>(); HashMap<String, String> attrInfoMap = new HashMap<>();
attrInfoMap.put("new","构建映射");
if (importDto.getPath() != null) { if (importDto.getPath() != null) {
String path[] = importDto.getPath().split("/"); String path[] = importDto.getPath().split("/");
String realPath = ""; String realPath = "";
@@ -562,9 +566,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
try { 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(importPath + realPath);
File file = new File("/home/file/2021/" + realPath); // File file = new File("/home/file/2021/" + realPath);
if (file.exists()) { if (file.exists()) {
AttFileVo fileInfo = attFileEOService.saveFileInfo(file); 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; return sarBussionessStand;
} }