| | |
| | | @Override |
| | | public CommonPage selectEntryRecordList(HzEntryRecord entryRecord) { |
| | | SysUser currentUser = SecurityUtils.getLoginUser().getUser(); |
| | | if (!currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())) { |
| | | if (!currentUser.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode()) && !currentUser.getUserType().equals(UserTypeEnum.CHECK_USER.getCode())) { |
| | | entryRecord.setCompanyId(currentUser.getCompanyId()); |
| | | } |
| | | PageUtils.startPage(); |
| | |
| | | throw new ApiException("入库信息不存在"); |
| | | } |
| | | checkUserAllowed(entryRecord,currentUser); |
| | | //设置分表id |
| | | IdTableNameHandler.setCurrentId(currentUser.getCompanyId()); |
| | | if (currentUser.getUserType().equals(UserTypeEnum.CHECK_USER.getCode())){ |
| | | IdTableNameHandler.setCurrentId(entryRecord.getCompanyId()); |
| | | }else { |
| | | //设置分表id |
| | | IdTableNameHandler.setCurrentId(currentUser.getCompanyId()); |
| | | } |
| | | PageUtils.startPage(); |
| | | List<HzHazmat> hazmatList = hazmatMapper.selectHazmatList(new HzHazmat().setEntryId(entryId)); |
| | | IdTableNameHandler.removeCurrentId(); |
| | |
| | | throw new ApiException("管理员不能操作"); |
| | | } |
| | | if(entryRecord!=null){ |
| | | if(!Objects.equals(user.getCompanyId(), entryRecord.getCompanyId())){ |
| | | throw new ApiException("无权限操作其他企业数据"); |
| | | if (!user.getUserType().equals(UserTypeEnum.CHECK_USER.getCode())){ |
| | | if(!Objects.equals(user.getCompanyId(), entryRecord.getCompanyId())){ |
| | | throw new ApiException("无权限操作其他企业数据"); |
| | | } |
| | | } |
| | | } |
| | | } |