From acecdd5b060746d19e9683ba461210b7cd52b428 Mon Sep 17 00:00:00 2001 From: cuibaocheng Date: Mon, 6 Sep 2021 11:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E5=AD=97=E9=95=BF?= =?UTF-8?q?=E5=BA=A6=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE/=E6=A0=8F?= =?UTF-8?q?=E7=9B=AE=E5=A2=9E=E5=8A=A0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IPicturesTemplateAreaService.java | 2 +- .../PicturesTemplateAreaController.java | 2 +- .../impl/PicturesTemplateAreaServiceImpl.java | 19 +++++++++++-------- .../save-picturestemplatearea.html | 3 +++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/interface-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/IPicturesTemplateAreaService.java b/interface-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/IPicturesTemplateAreaService.java index dc810a8..11047f2 100644 --- a/interface-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/IPicturesTemplateAreaService.java +++ b/interface-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/IPicturesTemplateAreaService.java @@ -157,7 +157,7 @@ public interface IPicturesTemplateAreaService { List getPicturesTemplateAreaByPicturesTemplateId(String picturesTemplateId) throws SearchException; - SuccessResult updatePicturesTemplateAreaPoint(String picturesTemplateAreaId, PicturesTemplateAreaPiointVO picturesTemplateAreaPiointVO) throws Exception; + SuccessResultData updatePicturesTemplateAreaPoint(String picturesTemplateAreaId, PicturesTemplateAreaPiointVO picturesTemplateAreaPiointVO) throws Exception; SuccessResult copyPicturesTemplateAreaPoint(String picturesTemplateAreaId, String templateAreaSource) throws Exception; diff --git a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/controller/apis/picturestemplatearea/PicturesTemplateAreaController.java b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/controller/apis/picturestemplatearea/PicturesTemplateAreaController.java index a23f060..0e17ffa 100644 --- a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/controller/apis/picturestemplatearea/PicturesTemplateAreaController.java +++ b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/controller/apis/picturestemplatearea/PicturesTemplateAreaController.java @@ -80,7 +80,7 @@ public class PicturesTemplateAreaController extends DefaultBaseController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("updatepicturestemplateareapoint/{picturesTemplateAreaId}") @CheckRequestBodyAnnotation - public SuccessResult updatePicturesTemplateAreaPoint(@PathVariable("picturesTemplateAreaId") String picturesTemplateAreaId, @RequestBody PicturesTemplateAreaPiointVO picturesTemplateAreaPiointVO) throws Exception { + public synchronized SuccessResultData updatePicturesTemplateAreaPoint(@PathVariable("picturesTemplateAreaId") String picturesTemplateAreaId, @RequestBody PicturesTemplateAreaPiointVO picturesTemplateAreaPiointVO) throws Exception { return picturesTemplateAreaService.updatePicturesTemplateAreaPoint(picturesTemplateAreaId, picturesTemplateAreaPiointVO); } diff --git a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/impl/PicturesTemplateAreaServiceImpl.java b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/impl/PicturesTemplateAreaServiceImpl.java index 05ed79a..fb43564 100644 --- a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/impl/PicturesTemplateAreaServiceImpl.java +++ b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatearea/impl/PicturesTemplateAreaServiceImpl.java @@ -316,12 +316,13 @@ public class PicturesTemplateAreaServiceImpl extends DefaultBaseService implemen } @Override - public SuccessResult updatePicturesTemplateAreaPoint(String picturesTemplateAreaId, PicturesTemplateAreaPiointVO picturesTemplateAreaPiointVO) throws Exception { + public SuccessResultData updatePicturesTemplateAreaPoint(String picturesTemplateAreaId, PicturesTemplateAreaPiointVO picturesTemplateAreaPiointVO) throws Exception { /** * 算出下,与 右 */ + String message = ""; PicturesTemplateAreaDTO areaDTO = getPicturesTemplateAreaById(picturesTemplateAreaId); - if(areaDTO.getTemplateAreaHeight() != picturesTemplateAreaPiointVO.getTemplateAreaHeight() || areaDTO.getTemplateAreaWidth() != picturesTemplateAreaPiointVO.getTemplateAreaWidth() || areaDTO.getTemplateAreaLeft() != picturesTemplateAreaPiointVO.getTemplateAreaLeft() || areaDTO.getTemplateAreaTop() != picturesTemplateAreaPiointVO.getTemplateAreaTop()) { + //if(areaDTO.getTemplateAreaHeight() != picturesTemplateAreaPiointVO.getTemplateAreaHeight() || areaDTO.getTemplateAreaWidth() != picturesTemplateAreaPiointVO.getTemplateAreaWidth() || areaDTO.getTemplateAreaLeft() != picturesTemplateAreaPiointVO.getTemplateAreaLeft() || areaDTO.getTemplateAreaTop() != picturesTemplateAreaPiointVO.getTemplateAreaTop()) { // 移动的是文字区域 if("1".equals(areaDTO.getTemplateAreaServerLink())) { // 计算区域可以容纳的文字数量 . 如果当前的限制字数 > 可容纳字数 , 将可容纳字数存储 @@ -339,7 +340,8 @@ public class PicturesTemplateAreaServiceImpl extends DefaultBaseService implemen // 设置自定义长度限制 if(areaDTO.getTemplateAreaFontLength() > fontLength * rowCount) { updateFontLength.put("templateAreaFontLength", fontLength * rowCount); - picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); + message = "当前区域文字仅可容纳: " + (fontLength * rowCount); + // picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); } } if("2".equals(areaDTO.getTemplateAreaFontCenter())) { @@ -347,7 +349,8 @@ public class PicturesTemplateAreaServiceImpl extends DefaultBaseService implemen // 设置自定义长度限制 if(areaDTO.getTemplateAreaFontLength() > fontLength) { updateFontLength.put("templateAreaFontLength", fontLength > 1 ? fontLength : 1); - picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); + message = "当前区域文字仅可容纳: " + (fontLength > 1 ? fontLength : 1); + // picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); } } if("3".equals(areaDTO.getTemplateAreaFontCenter())) { @@ -356,12 +359,12 @@ public class PicturesTemplateAreaServiceImpl extends DefaultBaseService implemen // 设置自定义长度限制 if(areaDTO.getTemplateAreaFontLength() > fontLength) { updateFontLength.put("templateAreaFontLength", fontLength > 1 ? fontLength : 1); - picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); + message = "当前区域文字仅可容纳: " + (fontLength > 1 ? fontLength : 1); + // picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); } } - } - } + //} Double down = picturesTemplateAreaPiointVO.getTemplateAreaLeft() + picturesTemplateAreaPiointVO.getTemplateAreaWidth(); picturesTemplateAreaPiointVO.setTemplateAreaDown(down); Double right = picturesTemplateAreaPiointVO.getTemplateAreaTop() + picturesTemplateAreaPiointVO.getTemplateAreaHeight(); @@ -370,7 +373,7 @@ public class PicturesTemplateAreaServiceImpl extends DefaultBaseService implemen params.put("picturesTemplateAreaId", picturesTemplateAreaId); setUpdateInfo(params); picturesTemplateAreaDao.updatePicturesTemplateAreaPoint(params); - return new SuccessResult(); + return new SuccessResultData(message); } @Override diff --git a/module-building-pictures/src/main/resources/templates/picturestemplate/save-picturestemplatearea.html b/module-building-pictures/src/main/resources/templates/picturestemplate/save-picturestemplatearea.html index aa786f3..dd15276 100644 --- a/module-building-pictures/src/main/resources/templates/picturestemplate/save-picturestemplatearea.html +++ b/module-building-pictures/src/main/resources/templates/picturestemplate/save-picturestemplatearea.html @@ -398,6 +398,9 @@ var formData = {templateAreaLeft : x.replace("px","") , templateAreaTop : y.replace("px","") , templateAreaHeight : h , templateAreaWidth : w }; var loadLayerIndex; top.restAjax.put(top.restAjax.path('api/picturestemplatearea/updatepicturestemplateareapoint/{picturesTemplateAreaId}', [id]), formData, null, function(code, data) { + if(data.data) { + top.dialog.msg(data.data, {time: 2000}); + } }, function(code, data) { top.dialog.msg(data.msg, {time: 1000}); }, function() {