diff --git a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/dao/picturestemplatearea/IPicturesTemplateAreaDao.java b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/dao/picturestemplatearea/IPicturesTemplateAreaDao.java index 5d475d9..3a9274a 100644 --- a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/dao/picturestemplatearea/IPicturesTemplateAreaDao.java +++ b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/dao/picturestemplatearea/IPicturesTemplateAreaDao.java @@ -92,4 +92,6 @@ public interface IPicturesTemplateAreaDao { void updatePicturesTemplateAreaAll(Map params) throws UpdateException; List list(Map queryParams) throws SearchException; + + void updatePicturesTemplateAreaFontLength(Map updateFontLength) throws UpdateException; } \ No newline at end of file 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 7937fb2..05ed79a 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 @@ -26,6 +26,7 @@ import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.UUIDUtil; import ink.wgink.util.map.HashMapUtil; import org.apache.commons.lang3.StringUtils; +import org.omg.CORBA.INTERNAL; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Primary; @@ -319,6 +320,48 @@ public class PicturesTemplateAreaServiceImpl extends DefaultBaseService implemen /** * 算出下,与 右 */ + PicturesTemplateAreaDTO areaDTO = getPicturesTemplateAreaById(picturesTemplateAreaId); + if(areaDTO.getTemplateAreaHeight() != picturesTemplateAreaPiointVO.getTemplateAreaHeight() || areaDTO.getTemplateAreaWidth() != picturesTemplateAreaPiointVO.getTemplateAreaWidth() || areaDTO.getTemplateAreaLeft() != picturesTemplateAreaPiointVO.getTemplateAreaLeft() || areaDTO.getTemplateAreaTop() != picturesTemplateAreaPiointVO.getTemplateAreaTop()) { + // 移动的是文字区域 + if("1".equals(areaDTO.getTemplateAreaServerLink())) { + // 计算区域可以容纳的文字数量 . 如果当前的限制字数 > 可容纳字数 , 将可容纳字数存储 + Map updateFontLength = getHashMap(2); + updateFontLength.put("picturesTemplateAreaId", picturesTemplateAreaId); + if("1".equals(areaDTO.getTemplateAreaFontCenter())) { + // 居左 + int fontLength = (int)(picturesTemplateAreaPiointVO.getTemplateAreaWidth() / Double.valueOf(areaDTO.getTemplateAreaFontSize())) ; + fontLength = fontLength > 1 ? fontLength : 1; + int rowCount = (int)(picturesTemplateAreaPiointVO.getTemplateAreaHeight() / ( Double.valueOf(areaDTO.getTemplateAreaFontSize()) + 3) ); + if(rowCount * ( Double.valueOf(areaDTO.getTemplateAreaFontSize()) + 3) > picturesTemplateAreaPiointVO.getTemplateAreaHeight()) { + rowCount = rowCount - 1; + } + rowCount = rowCount > 1 ? rowCount : 1; + // 设置自定义长度限制 + if(areaDTO.getTemplateAreaFontLength() > fontLength * rowCount) { + updateFontLength.put("templateAreaFontLength", fontLength * rowCount); + picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); + } + } + if("2".equals(areaDTO.getTemplateAreaFontCenter())) { + int fontLength = (int)(picturesTemplateAreaPiointVO.getTemplateAreaWidth() / Double.valueOf(areaDTO.getTemplateAreaFontSize())) ; + // 设置自定义长度限制 + if(areaDTO.getTemplateAreaFontLength() > fontLength) { + updateFontLength.put("templateAreaFontLength", fontLength > 1 ? fontLength : 1); + picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); + } + } + if("3".equals(areaDTO.getTemplateAreaFontCenter())) { + // 居右 + int fontLength = (int)(picturesTemplateAreaPiointVO.getTemplateAreaWidth() / Double.valueOf(areaDTO.getTemplateAreaFontSize())) ; + // 设置自定义长度限制 + if(areaDTO.getTemplateAreaFontLength() > fontLength) { + updateFontLength.put("templateAreaFontLength", fontLength > 1 ? fontLength : 1); + picturesTemplateAreaDao.updatePicturesTemplateAreaFontLength(updateFontLength); + } + } + + } + } Double down = picturesTemplateAreaPiointVO.getTemplateAreaLeft() + picturesTemplateAreaPiointVO.getTemplateAreaWidth(); picturesTemplateAreaPiointVO.setTemplateAreaDown(down); Double right = picturesTemplateAreaPiointVO.getTemplateAreaTop() + picturesTemplateAreaPiointVO.getTemplateAreaHeight(); diff --git a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatebuilding/impl/PicturesTemplateBuildingServiceImpl.java b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatebuilding/impl/PicturesTemplateBuildingServiceImpl.java index fec6c13..02cac32 100644 --- a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatebuilding/impl/PicturesTemplateBuildingServiceImpl.java +++ b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/service/picturestemplatebuilding/impl/PicturesTemplateBuildingServiceImpl.java @@ -199,7 +199,13 @@ public class PicturesTemplateBuildingServiceImpl extends DefaultBaseService impl /** * 对内容进行封装换行 */ - int y = bean.getY() + ( ( ( ( bean.getHeight() / 2) + ( bean.getFontSize() / 2) ) - 3 ) * index ); + int fontHeight = bean.getFontSize() * index; + int y = bean.getY() + fontHeight + 3; + // 超出部分, 不显示 + int gao = (bean.getY() + bean.getHeight()) - (bean.getFontSize() + 3 ); + if(y > gao) { + break; + } graphics.drawString(fontContent, bean.getX(), y); index++; } @@ -357,7 +363,13 @@ public class PicturesTemplateBuildingServiceImpl extends DefaultBaseService impl /** * 对内容进行封装换行 */ - int y = bean.getY() + ( ( ( ( bean.getHeight() / 2) + ( bean.getFontSize() / 2) ) - 3 ) * index ); + int fontHeight = bean.getFontSize() * index; + int y = bean.getY() + fontHeight + 3; + // 超出部分, 不显示 + int gao = (bean.getY() + bean.getHeight()) - (bean.getFontSize() + 3 ); + if(y > gao) { + break; + } graphics.drawString(fontContent, bean.getX(), y); index++; } diff --git a/module-building-pictures/src/main/resources/mybatis/mapper/picturestemplatearea/picturesmplatearea-mapper.xml b/module-building-pictures/src/main/resources/mybatis/mapper/picturestemplatearea/picturesmplatearea-mapper.xml index 2f55368..bebc34b 100644 --- a/module-building-pictures/src/main/resources/mybatis/mapper/picturestemplatearea/picturesmplatearea-mapper.xml +++ b/module-building-pictures/src/main/resources/mybatis/mapper/picturestemplatearea/picturesmplatearea-mapper.xml @@ -105,6 +105,15 @@ order by t1.gmt_create + + UPDATE + m_pictures_template_area + SET + template_area_font_length = #{templateAreaFontLength} + WHERE + pictures_template_area_id = #{picturesTemplateAreaId} + + UPDATE m_pictures_template_area diff --git a/module-config-column/src/main/resources/mybatis/mapper/configcolumn/config-column-mapper.xml b/module-config-column/src/main/resources/mybatis/mapper/configcolumn/config-column-mapper.xml index 7ed943a..93e940f 100644 --- a/module-config-column/src/main/resources/mybatis/mapper/configcolumn/config-column-mapper.xml +++ b/module-config-column/src/main/resources/mybatis/mapper/configcolumn/config-column-mapper.xml @@ -465,6 +465,9 @@ m_config_column t1 WHERE t1.is_delete = 0 + + AND t1.config_column_role LIKE CONCAT('%', CONCAT( #{configColumnRole} , '%')) + AND t1.config_table_id = #{configTableId} diff --git a/module-config-column/src/main/resources/templates/configcolumngroup/list.html b/module-config-column/src/main/resources/templates/configcolumngroup/list.html index 2ae3171..f179c49 100644 --- a/module-config-column/src/main/resources/templates/configcolumngroup/list.html +++ b/module-config-column/src/main/resources/templates/configcolumngroup/list.html @@ -246,7 +246,7 @@ top.layer.open({ type: 2, title: false, - closeBtn: 0, + closeBtn: 1, area: ['80%', '80%'], shadeClose: true, anim: 2, diff --git a/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java b/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java index 6a0d40c..507bfdf 100644 --- a/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java +++ b/module-config-table/src/main/java/cn/com/tenlion/configtable/service/configtableoperation/impl/ConfigTableOperationServiceImpl.java @@ -554,8 +554,10 @@ public class ConfigTableOperationServiceImpl extends DefaultBaseService implemen List> configTableOperationDTOs = list(page.getParams()); for (Map map : configTableOperationDTOs) { MiniappUserPO userPO = iMiniappUserService.getPO(map.get("creator").toString()); - map.put("creatorIcon", userPO.getAvatarUrl()); - map.put("creatorNickName", userPO.getNickName()); + if(userPO != null) { + map.put("creatorIcon", userPO.getAvatarUrl()); + map.put("creatorNickName", userPO.getNickName()); + } } PageInfo> pageInfo = new PageInfo<>(configTableOperationDTOs); return new SuccessResultList<>(configTableOperationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());