Commit a49c3a53 authored by fangxinjiang's avatar fangxinjiang

客户服务平台-fxj

parent 36b0e4d5
......@@ -103,4 +103,5 @@ public interface SysDeptMapper extends BaseMapper<SysDept> {
List<SysDept> cspDelDeptIds(@Param("projectNo") String projectNo);
void updateAllAncestors(@Param("projectNo")String projectNo, @Param("oldStr")String oldStr, @Param("newStr")String newStr);
}
......@@ -626,9 +626,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
if (Common.isEmpty(updateEntity)){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
String oldStr = updateEntity.getAncestors();
String newStr = parentDept.getAncestors()+","+parentDept.getDeptId();
updateEntity.setParentId(parentDept.getDeptId());
updateEntity.setAncestors(parentDept.getAncestors()+","+parentDept.getDeptId());
baseMapper.updateById(updateEntity);
baseMapper.updateAllAncestors(parentDept.getProjectNo(),oldStr,newStr);
List<DeptSortVo> moveVos = dept.getDeptSortList();
baseMapper.batchUpdateSort(moveVos);
// 清理用户权限
......
......@@ -176,4 +176,8 @@
select dept_id from sys_dept where del_flag = '1' AND project_no = #{projectNo}
</select>
<update id="updateAllAncestors">
update sys_dept set ancestors = REPLACE(ancestors,#{oldStr},#{newStr}) where project_no = #{projectNo}
</update>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment