| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | |
| | | import com.java110.config.properties.code.Java110Properties; |
| | | import com.java110.core.client.FtpUploadTemplate; |
| | | import com.java110.core.client.OssUploadTemplate; |
| | | |
| | | import com.java110.core.component.BaseComponentSMO; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | |
| | | import com.java110.entity.assetImport.ImportRoomFee; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.front.smo.assetImport.IImportRoomFeeSMO; |
| | | |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.*; |
| | | |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ImportExcelUtils; |
| | | import com.java110.utils.util.StringUtil; |
| | | |
| | | import com.java110.vo.ResultVo; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private FtpUploadTemplate ftpUploadTemplate; |
| | | |
| | | @Autowired |
| | | private Java110Properties java110Properties; |
| | | |
| | | @Autowired |
| | | private OssUploadTemplate ossUploadTemplate; |
| | | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> importExcelData(IPageData pd, MultipartFile uploadFile) throws Exception { |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> importFile(MultipartFile uploadFile) throws Exception { |
| | | try { |
| | | String fileName = ""; |
| | | String ossSwitch = MappingCache.getValue(OSSUtil.DOMAIN, OSSUtil.OSS_SWITCH); |
| | | if (StringUtil.isEmpty(ossSwitch) || !OSSUtil.OSS_SWITCH_OSS.equals(ossSwitch)) { |
| | | fileName = ftpUploadTemplate.upload(uploadFile, java110Properties.getFtpServer(), |
| | | java110Properties.getFtpPort(), java110Properties.getFtpUserName(), |
| | | java110Properties.getFtpUserPassword(), java110Properties.getFtpPath()); |
| | | } else { |
| | | fileName = ossUploadTemplate.upload(uploadFile, java110Properties.getFtpServer(), |
| | | java110Properties.getFtpPort(), java110Properties.getFtpUserName(), |
| | | java110Properties.getFtpUserPassword(), java110Properties.getFtpPath()); |
| | | } |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(fileName, HttpStatus.OK); |
| | | return responseEntity; |
| | | } catch (Exception e) { |
| | | logger.error("上传合同附件失败 ", e); |
| | | return new ResponseEntity<String>("非常抱歉,上传合同附件失败:" + e.getMessage(), HttpStatus.BAD_REQUEST); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | |
| | | public ResponseEntity<String> importTempData(IPageData pd) { |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |