| | |
| | | import com.moral.api.mapper.ResponsibilityUnitMapper; |
| | | import com.moral.api.mapper.SysDictDataMapper; |
| | | import com.moral.api.mapper.SysDictTypeMapper; |
| | | import com.moral.api.mapper.UserMapper; |
| | | import com.moral.api.pojo.bean.BaseInvalidEntity; |
| | | import com.moral.api.pojo.dto.allocation.AllocationUnitViewDto; |
| | | import com.moral.api.pojo.enums.*; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean authority(String allocationNum,Integer userId) { |
| | | //获取用户信息 |
| | | QxUser user = UserHelper.getCurrentUser(); |
| | | List<Integer> userList = responsibilityUnitMapper.selectCodeList(SysDictTypeEnum.SYS_JBD.getValue(),user.getUserId()); |
| | | if(CollectionUtils.isNotEmpty(userList)){ |
| | | return true; |
| | | } |
| | | if(Objects.nonNull(user.getUnitId())){ |
| | | LambdaQueryWrapper<Allocation> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Allocation::getAllocationNum,allocationNum); |
| | | wrapper.eq(Allocation::getIsDel,0); |
| | | wrapper.eq(Allocation::getIsInvalid,0); |
| | | Allocation allocation = allocationMapper.selectOne(wrapper); |
| | | if (allocation.getUnitId().equals(user.getUnitId())){ |
| | | return true; |
| | | } |
| | | String code = responsibilityUnitMapper.selectAreaCode(user.getUnitId()); |
| | | if(code.length()>6){ |
| | | return false; |
| | | }else { |
| | | return true; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> unitResult() { |
| | | QxUser user = UserHelper.getCurrentUser(); |
| | | Integer unitId = Objects.nonNull(user.getUnitId())?user.getUnitId():0; |