| | |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.cache.SysCache; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.modules.cps.entity.Employee; |
| | | import com.qianwen.smartman.modules.cps.service.IEmployeeService; |
| | | import com.qianwen.smartman.modules.smis.entity.Employee; |
| | | import com.qianwen.smartman.modules.smis.service.IEmployeeService; |
| | | import com.qianwen.smartman.modules.system.entity.Dept; |
| | | import com.qianwen.smartman.modules.system.entity.DeptScope; |
| | | import com.qianwen.smartman.modules.system.entity.UserDept; |
| | | import com.qianwen.smartman.modules.system.mapper.DeptMapper; |
| | | import com.qianwen.smartman.modules.system.service.IDataScopeManagerService; |
| | | import com.qianwen.smartman.modules.system.service.IDeptScopeService; |
| | |
| | | } |
| | | |
| | | private void checkUsingDept(List<Long> deptId) { |
| | | if (this.userDeptService.count(Lambda.in((v0) -> { |
| | | return v0.getDeptId(); |
| | | }, deptId)) != 0) { |
| | | if (this.userDeptService.count(Lambda.in(UserDept::getDeptId, deptId)) != 0) { |
| | | throw new ServiceException("无法删除,账号绑定了该权限"); |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional |
| | | public boolean grant(final DataScopeGrantVO grantVO) { |
| | | this.deptScopeService.remove(Lambda.eq((v0) -> { |
| | | return v0.getDeptId(); |
| | | }, grantVO.getDeptId())); |
| | | this.deptScopeService.remove(Lambda.eq(DeptScope::getDeptId, grantVO.getDeptId())); |
| | | |
| | | List<DeptScope> deptScopeList = grantVO.getDataScopeIds().stream().map(scopeId -> { |
| | | DeptScope scope = new DeptScope(); |
| | | scope.setScopeId(scopeId); |