fix(core): 标签模板唯一校验更新

标签模板唯一校验更新
yun-zuoyi
Wynne 4 years ago
parent e1a394d9e3
commit 726c2cede5

@ -2,6 +2,7 @@ package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLabelTemplateService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
@ -18,7 +19,6 @@ import cn.estsh.i3plus.pojo.platform.repository.SysLabelTemplateRepository;
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -114,6 +114,9 @@ public class SysLabelTemplateService implements ISysLabelTemplateService {
//暂时根据id和模板代码作为唯一性校验
StringBuffer where = new StringBuffer();
HqlPack.getNumNOEqualPack(sysLabelTemplate.getId(), "id", where);
// FIX 原始是删除 后改成软删 导致唯一校验存在问题
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", where);
HqlPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isValid", where);
HqlPack.getStringEqualPack(sysLabelTemplate.getTemplateCode(), "templateCode", where);
int count = sysLabelTemplateRDao.findByHqlWhereCount(where.toString());
if (count > 0) {

Loading…
Cancel
Save