| | |
| | | @Override |
| | | public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception { |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | if (paramIn.getString("userId").isEmpty() || paramIn.getString("userId").equals("null")){ |
| | | throw new IllegalArgumentException("userId为空"); |
| | | } |
| | | paramIn.put("userId", pd.getUserId()); |
| | | Assert.hasKeyAndValue(paramIn, "importAdapt", "未包含模板"); |
| | | Assert.hasKeyAndValue(paramIn, "userId", "未包含userId"); |
| | | String importAdapt = paramIn.getString("importAdapt") + "DataCleaning"; |
| | | |
| | | importDataCleaningAdapt = ApplicationContextFactory.getBean(importAdapt, IImportDataCleaningAdapt.class); |
| | |
| | | } |
| | | else{ |
| | | workbook = ImportExcelUtils.createWorkbook(uploadFile); |
| | | |
| | | result.setImportFileName(uploadFile.getOriginalFilename()); |
| | | // todo 适配器封装数据 |
| | | List datas = importDataCleaningAdapt.analysisExcel(workbook, paramIn, result); |
| | | |
| | |
| | | assetImportLogPo.setUserName(users.get(0).getUserName()); |
| | | } |
| | | } |
| | | assetImportLogPo.setImportFileName(result.getImportFileName()); |
| | | assetImportLogInnerServiceSMOImpl.saveAssetImportLog(assetImportLogPo); |
| | | |
| | | List<AssetImportLogDetailPo> assetImportLogDetailPos = new ArrayList<>(); |