| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<UnqualifiedRecord> findJoinList(Integer recordId) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!Constants.equalsInteger(user.getType(),Constants.USERTYPE.COM)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,您无权限进行该操作!"); |
| | | } |
| | | |
| | | MPJLambdaWrapper<UnqualifiedRecord> mpjLambdaWrapper = new MPJLambdaWrapper<>(); |
| | | mpjLambdaWrapper.selectAll(UnqualifiedRecord.class); |
| | | mpjLambdaWrapper.selectAs(Workorder::getCode, UnqualifiedRecord::getWorkOrderCode); |
| | | mpjLambdaWrapper.selectAs(Material::getName, UnqualifiedRecord::getMaterialName); |
| | | mpjLambdaWrapper.selectAs(Material::getCode, UnqualifiedRecord::getMaterialCode); |
| | | mpjLambdaWrapper.selectAs(Procedures::getName, UnqualifiedRecord::getProceduresName); |
| | | mpjLambdaWrapper.selectAs(Category::getName, UnqualifiedRecord::getCategoryName); |
| | | mpjLambdaWrapper.selectAs(SystemUser::getRealname, UnqualifiedRecord::getCreateUserName); |
| | | |
| | | mpjLambdaWrapper.leftJoin(Workorder.class,Workorder::getId,UnqualifiedRecord::getWorkorderId); |
| | | mpjLambdaWrapper.leftJoin(MaterialDistribute.class,MaterialDistribute::getId,Workorder::getMaterialId); |
| | | mpjLambdaWrapper.leftJoin(Material.class,Material::getId,MaterialDistribute::getMaterialId); |
| | | mpjLambdaWrapper.leftJoin(Procedures.class,Procedures::getId,Workorder::getProcedureId); |
| | | mpjLambdaWrapper.leftJoin(Category.class,Category::getId,UnqualifiedRecord::getCategoryId); |
| | | mpjLambdaWrapper.leftJoin(SystemUser.class,SystemUser::getId,UnqualifiedRecord::getCreateUser); |
| | | //只能查看当前根组织的数据 |
| | | mpjLambdaWrapper.eq(Workorder::getRootDepartId,user.getRootDepartment().getId()); |
| | | //如果当前选择的公司级组织非根组织信息,只能查看当前选择公司级组织数据 |
| | | mpjLambdaWrapper.eq(Workorder::getDepartId,user.getCurComDepartment().getId()); |
| | | mpjLambdaWrapper.eq(UnqualifiedRecord::getDeleted,Constants.ZERO); |
| | | mpjLambdaWrapper.eq(UnqualifiedRecord::getRecordId, recordId); |
| | | List<UnqualifiedRecord> unqualifiedRecordList = unQualifiedRecordJoinMapper.selectJoinList(UnqualifiedRecord.class,mpjLambdaWrapper); |
| | | return unqualifiedRecordList; |
| | | } |
| | | |
| | | |
| | | } |