增加文字长度自动设置/栏目增加校验
This commit is contained in:
parent
985927bd26
commit
7cbe59931d
@ -92,4 +92,6 @@ public interface IPicturesTemplateAreaDao {
|
||||
void updatePicturesTemplateAreaAll(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
List<PicturesTemplateAreaBuildingDTO> list(Map<String, Object> queryParams) throws SearchException;
|
||||
|
||||
void updatePicturesTemplateAreaFontLength(Map<String, Object> updateFontLength) throws UpdateException;
|
||||
}
|
@ -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<String, Object> 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();
|
||||
|
@ -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++;
|
||||
}
|
||||
|
@ -105,6 +105,15 @@
|
||||
order by t1.gmt_create
|
||||
</select>
|
||||
|
||||
<update id="updatePicturesTemplateAreaFontLength" parameterType="map">
|
||||
UPDATE
|
||||
m_pictures_template_area
|
||||
SET
|
||||
template_area_font_length = #{templateAreaFontLength}
|
||||
WHERE
|
||||
pictures_template_area_id = #{picturesTemplateAreaId}
|
||||
</update>
|
||||
|
||||
<update id="updatePicturesTemplateAreaAll" parameterType="map">
|
||||
UPDATE
|
||||
m_pictures_template_area
|
||||
|
@ -465,6 +465,9 @@
|
||||
m_config_column t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
<if test="configColumnRole != null and configColumnRole != ''">
|
||||
AND t1.config_column_role LIKE CONCAT('%', CONCAT( #{configColumnRole} , '%'))
|
||||
</if>
|
||||
<if test="configTableId != null and configTableId != ''">
|
||||
AND t1.config_table_id = #{configTableId}
|
||||
</if>
|
||||
|
@ -246,7 +246,7 @@
|
||||
top.layer.open({
|
||||
type: 2,
|
||||
title: false,
|
||||
closeBtn: 0,
|
||||
closeBtn: 1,
|
||||
area: ['80%', '80%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
|
@ -554,9 +554,11 @@ public class ConfigTableOperationServiceImpl extends DefaultBaseService implemen
|
||||
List<Map<String, Object>> configTableOperationDTOs = list(page.getParams());
|
||||
for (Map<String, Object> map : configTableOperationDTOs) {
|
||||
MiniappUserPO userPO = iMiniappUserService.getPO(map.get("creator").toString());
|
||||
if(userPO != null) {
|
||||
map.put("creatorIcon", userPO.getAvatarUrl());
|
||||
map.put("creatorNickName", userPO.getNickName());
|
||||
}
|
||||
}
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(configTableOperationDTOs);
|
||||
return new SuccessResultList<>(configTableOperationDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user