Browse Source

Merge branch 'release_toaliyun_real_202208' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real_202208

release_toaliyun_real
zhengfangyuan 3 years ago
parent
commit
e9bb35128a
2 changed files with 21 additions and 21 deletions
  1. +19
    -19
      mallinkBApi/src/main/java/com/iformall/controller/WxProfitSharingReceiverApplyController.java
  2. +2
    -2
      mallinkBApi/src/main/java/com/iformall/utils/ImgYwsqhUtil.java

+ 19
- 19
mallinkBApi/src/main/java/com/iformall/controller/WxProfitSharingReceiverApplyController.java View File

@@ -207,25 +207,25 @@ public class WxProfitSharingReceiverApplyController extends BaseController {
if(bytes == null){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"生成图片异常");
}
return new ResultData(bytes);
// try {
//
// String url = aliyunOSS.upload(tenantEntity.getTenantId(), ".png", new ByteArrayInputStream(bytes));
// if(StringUtils.isBlank(url)){
// return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"获取图片异常");
// }
//
// Map<String,String> map = new HashMap<>();
// map.put("url",url);
// return new ResultData(map);
//
// } catch(MallinkException e){
// logger.error(e.getMessage());
// return new ResultData(e.getErrorCode(),e.getMessage());
// } catch (Exception e) {
// logger.error(e.getMessage());
// return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR);
// }
// return new ResultData(bytes);
try {
String url = aliyunOSS.upload(tenantEntity.getTenantId(), ".png", new ByteArrayInputStream(bytes));
if(StringUtils.isBlank(url)){
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"获取图片异常");
}
Map<String,String> map = new HashMap<>();
map.put("url",url);
return new ResultData(map);
} catch(MallinkException e){
logger.error(e.getMessage());
return new ResultData(e.getErrorCode(),e.getMessage());
} catch (Exception e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR);
}
}

}

+ 2
- 2
mallinkBApi/src/main/java/com/iformall/utils/ImgYwsqhUtil.java View File

@@ -42,7 +42,7 @@ public class ImgYwsqhUtil {
InputStream backImgUrl = resource.getInputStream();

BufferedImage backImg = ImageIO.read(backImgUrl);
backImgUrl.close();
// backImgUrl.close();
Graphics g = backImg.getGraphics();

Font fTxtBottom = new Font("微软雅黑", Font.PLAIN, 70);
@@ -111,7 +111,7 @@ public class ImgYwsqhUtil {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(backImg, "png", out);
byte[] bytes = out.toByteArray();
out.close();
// out.close();
return bytes;
} catch (Exception e) {
e.printStackTrace();


Loading…
Cancel
Save