From e6c6426200668dff9d677d20277dc254b5637d89 Mon Sep 17 00:00:00 2001 From: cuibaocheng Date: Sat, 14 Aug 2021 19:33:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A8=E6=80=81=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E8=87=AA=E5=8A=A8=E6=8E=92=E7=89=88=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E4=BF=9D=E5=AD=98=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CardTemplateUseServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java index ea6625e..6718e2c 100644 --- a/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java +++ b/src/main/java/cn/com/tenlion/systemcard/service/cardtemplateuse/impl/CardTemplateUseServiceImpl.java @@ -1,5 +1,6 @@ package cn.com.tenlion.systemcard.service.cardtemplateuse.impl; +import cn.com.tenlion.buildingpictures.pojo.dtos.picturestemplate.PicturesTemplateDTO; import cn.com.tenlion.buildingpictures.pojo.dtos.picturestemplatearea.PicturesTemplateAreaBuildingDTO; import cn.com.tenlion.buildingpictures.service.picturestemplatebuilding.IPicturesTemplateBuildingService; import cn.com.tenlion.buildingpictures.util.CreateImageBean; @@ -24,6 +25,7 @@ import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.UpdateException; import ink.wgink.module.dictionary.pojo.dtos.DataDTO; import ink.wgink.module.dictionary.service.IDataService; +import ink.wgink.module.file.service.IFileService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.bos.UserInfoBO; @@ -92,6 +94,9 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC @Autowired private IDataService iDataService; + @Autowired + private IFileService iFileService; + private static BufferedImage viewButtonBuffer; static { @@ -422,6 +427,12 @@ public class CardTemplateUseServiceImpl extends DefaultBaseService implements IC BufferedImage bufferedImage = base64ToBufferedImage(cardTemplateUsePhoto); // cardTemplateUseDispatchPhoto = thumbnailImage(bufferedImage, 220 , 176); cardTemplateUseDispatchPhoto = wXDispatchImage(bufferedImage); + /** + * 删除旧的名片预览图 + */ + if(!StringUtils.isEmpty(useDTO.getCardTemplateUsePhotoUrl())) { + iFileService.delete(useDTO.getCardTemplateUsePhotoUrl()); + } cardTemplateUsePhotoUrl = iPicturesTemplateBuildingService.saveBase64ToFile(cardTemplateUsePhoto); } catch (Exception e) { e.printStackTrace();