| | |
| | | package com.java110.api.smo.assetImport.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonParseException; |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.java110.api.importData.IImportDataCleaningAdapt; |
| | | import com.java110.api.smo.DefaultAbstractComponentSMO; |
| | | import com.java110.api.smo.assetImport.IAssetImportSMO; |
| | |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.log.AssetImportLogDetailDto; |
| | | import com.java110.dto.system.ComponentValidateResult; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.common.IAssetImportLogDetailInnerServiceSMO; |
| | | import com.java110.intf.common.IAssetImportLogInnerServiceSMO; |
| | | import com.java110.intf.job.IUserImportDataV1InnerServiceSMO; |
| | | import com.java110.intf.user.IMenuUserV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserInnerServiceSMO; |
| | | import com.java110.po.log.AssetImportLogDetailPo; |
| | | import com.java110.po.log.AssetImportLogPo; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 导入最大行数 |
| | | */ |
| | | public static final int MAX_LINE = 2000; |
| | | public static final int MAX_LINE = 5000; |
| | | |
| | | /** |
| | | * 导入最大行数 |
| | |
| | | |
| | | @Autowired |
| | | private IUserImportDataV1InnerServiceSMO userImportDataV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO iUserInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception { |
| | |
| | | assetImportLogPo.setLogType(logType); |
| | | assetImportLogPo.setErrorCount("0"); |
| | | assetImportLogPo.setSuccessCount("0"); |
| | | String userId = null; |
| | | userId = pd.getUserId(); |
| | | if(userId != null) { |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> users = iUserInnerServiceSMOImpl.getUsers(userDto); |
| | | if(users != null && users.size() > 0) { |
| | | assetImportLogPo.setUserName(users.get(0).getUserName()); |
| | | } |
| | | } |
| | | assetImportLogInnerServiceSMOImpl.saveAssetImportLog(assetImportLogPo); |
| | | |
| | | List<AssetImportLogDetailPo> assetImportLogDetailPos = new ArrayList<>(); |