提交修改

This commit is contained in:
quyixiao 2020-11-09 09:46:26 +08:00
parent a376c46294
commit c91e8e1607
3 changed files with 9 additions and 0 deletions

View File

@ -50,4 +50,6 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
List<StaffRole> selectByRoleLevel(@Param("name") String name);
List<StaffRole> selectPageByRoleLevel(@Param("page") IPage page, @Param("name") String name);
StaffRole selectStaffRolesByStaffIdDepartmentLevel(@Param("staffId") Long staffId, @Param("departmentLevel") String departmentLevel);
}

View File

@ -407,6 +407,10 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
return R.ok("更新成功");
}
} else if (roleModel.getStaffId() != null) { // 员工不为空
StaffRole data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevel(roleModel.getStaffId(),roleModel.getDepartmentLevel());
if(data !=null ){
return R.error("该管理员己经存在");
}
staffRole = new StaffRole();
com.lz.modules.app.utils.BeanUtils.copyProperty(staffRole, roleModel);
staffRole.setStaffName(staffEntity.getName());

View File

@ -153,6 +153,9 @@
<select id="selectPageByRoleLevel" resultType="com.lz.modules.flow.entity.StaffRole">
select * from lz_staff_role where is_delete = 0 and department_level = #{name}
</select>
<select id="selectStaffRolesByStaffIdDepartmentLevel" resultType="com.lz.modules.flow.entity.StaffRole">
select * from lz_staff_role where is_delete = 0 and department_level = #{departmentLevel} and staff_id =#{staffId}
</select>
</mapper>