Merge remote-tracking branch 'origin/dev_WMS20260401' into dev_WMS20260401

This commit is contained in:
王奎兴
2026-05-30 00:37:50 +08:00
3 changed files with 8 additions and 3 deletions
@@ -79,7 +79,7 @@ public class SysDictTypeController extends BaseController
fillDictTypeOrganization(dict);
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
{
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」已存在(全局不可重复)");
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "在当前组织下已存在");
}
dict.setCreateBy(SecurityUtils.getUsername());
return toAjax(dictTypeService.insertDictType(dict));
@@ -124,6 +124,10 @@ public class SysDictTypeController extends BaseController
dict.setOrganizationName(userPo.getOrganizationName());
}
}
if (dict.getOrganizationId() == null)
{
dict.setOrganizationId(0L);
}
}
/**
@@ -137,7 +141,7 @@ public class SysDictTypeController extends BaseController
fillDictTypeOrganization(dict);
if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
{
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "」已存在(全局不可重复)");
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型编码「" + dict.getDictType() + "在当前组织下已存在");
}
dict.setUpdateBy(SecurityUtils.getUsername());
return toAjax(dictTypeService.updateDictType(dict));
@@ -230,7 +230,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
}
/**
* 校验字典类型是否唯一
* 校验字典类型在同一组织下是否唯一
*
* @param dict 字典类型
* @return 结果
@@ -69,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkDictTypeUnique" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
and IFNULL(organization_id, 0) = IFNULL(#{organizationId}, 0)
limit 1
</select>