| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean addSharedData(Long id) { |
| | | log.info("addSharedData方法的入参id :{}", id); |
| | | //先判断一下share表是否已经插入 |
| | |
| | | Boolean aBoolean = sharedService.delResharedInfoById(serviceReimbursementShared.getId()); |
| | | log.error("文件上传失败,将分享表数据回滚:{}", aBoolean); |
| | | } |
| | | e.getMessage(); |
| | | return false; |
| | | } |
| | | |
| | |
| | | log.info("filePath的修改:{}", filePath); |
| | | String url = rbDetailFile.getUrl(); |
| | | //file用的是绝对位置 |
| | | String substring = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length()); |
| | | String fileName = url.substring(url.indexOf("/profile/upload") + "/profile/upload".length()); |
| | | String strFile = rbDetailFile.getUrl().replace(filePath, "/profile/upload"); |
| | | System.out.println("reimbursement服务的filePath + substring是乱码吗: " + filePath + substring); |
| | | File filetest = new File(filePath + substring); |
| | | File fileUpload = new File(filePath + fileName); |
| | | log.info("请求第三方的入参strFile : {}, strFUrl : {}", strFile, filePath); |
| | | String struploadResult = HttpClientKit.sendPostWithFile(filetest, strFUrl); |
| | | String struploadResult = HttpClientKit.sendPostWithFile(fileUpload, strFUrl); |
| | | log.info("第三方传回的数据: {}", struploadResult); |
| | | if (StringUtils.isEmpty(struploadResult)) { |
| | | log.info("HttpClientKit.sendPostWithFile 请求为空了 filetest:{}, strFUrl:{} ", filetest, strFUrl); |
| | | log.info("HttpClientKit.sendPostWithFile 请求为空了 struploadResult:{}, strFUrl:{} ", struploadResult, strFUrl); |
| | | return 0; |
| | | } |
| | | |