Browse Source

Merge remote-tracking branch 'origin/master'

ezhizao_zx 1 week ago
parent
commit
9561a88f8d

+ 2 - 2
src/main/java/cn/ezhizao/project/business/mapper/SysDeptMapper.java

@@ -20,8 +20,8 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
      * @return 部门集合
      */
     public List<SysDept> getList(SysDept sysDept);
-    public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
-    public SysDept checkDeptCodeUnique(@Param("deptCode") String deptCode, @Param("parentId") Long parentId);
+    public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId, @Param("tenantId") Long tenantId);
+    public SysDept checkDeptCodeUnique(@Param("deptCode") String deptCode, @Param("parentId") Long parentId , @Param("tenantId") Long tenantId);
     public int insertDept(SysDept dept);
     public int updateDept(SysDept dept);
     public SysDept selectDeptById(Long deptId);

+ 2 - 2
src/main/java/cn/ezhizao/project/business/service/impl/SysDeptServiceImpl.java

@@ -44,7 +44,7 @@ public class SysDeptServiceImpl  extends ServiceImpl<SysDeptMapper, SysDept> imp
     public String checkDeptNameUnique(SysDept dept)
     {
         Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
-        SysDept info = sysDeptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
+        SysDept info = sysDeptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId(),dept.getTenantId());
         if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
         {
             return UserConstants.NOT_UNIQUE;
@@ -55,7 +55,7 @@ public class SysDeptServiceImpl  extends ServiceImpl<SysDeptMapper, SysDept> imp
     public String checkDeptCodeUnique(SysDept dept)
     {
         Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
-        SysDept info = sysDeptMapper.checkDeptCodeUnique(dept.getDeptCode(), dept.getParentId());
+        SysDept info = sysDeptMapper.checkDeptCodeUnique(dept.getDeptCode(), dept.getParentId(),dept.getTenantId());
         if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
         {
             return UserConstants.NOT_UNIQUE;

+ 3 - 3
src/main/resources/mybatis/business/SysDeptMapper.xml

@@ -43,11 +43,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
     <select id="checkDeptNameUnique" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
-        where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0'  limit 1
+        where dept_name=#{deptName} and parent_id = #{parentId} and tenant_id = #{tenantId} and del_flag = '0'  limit 1
     </select>
     <select id="checkDeptCodeUnique" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
-        where dept_code=#{deptCode} and parent_id = #{parentId} and del_flag = '0' limit 1
+        where dept_code=#{deptCode} and parent_id = #{parentId} and tenant_id = #{tenantId} and del_flag = '0' limit 1
     </select>
     <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
         select d.type,d.dept_id,d.is_work_section,d.is_sort_packaging,d.tenant_id,d.parent_id, d.ancestors, d.dept_name,d.dept_code, d.order_num, d.phone, d.email, d.status,d.equiment_flag,d.auto_allocation,
@@ -147,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="supplierId != null">supplier_id = #{supplierId},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="type != null">type = #{type},</if>
-            <if test="jdId != null">jd_id = #{jdId}</if>
+            <if test="jdId != null">jd_id = #{jdId},</if>
             update_time = sysdate()
         </set>
         where dept_id = #{deptId}