2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-03-30 981055073317b3b07534d5ac504a4e470e87f3d8
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -641,7 +641,10 @@
            if (pole == null) {
                throw new BusinessException("灯杆不存在");
            }
            pole.setClientId(clientId);
            pole.setUserId(clientId);
            if(!clientService.findClientId(clientId)){
                pole.setClientId(clientService.getClientId(clientId));
            }
            r = updateById(pole);
            if (!r) {
@@ -653,20 +656,27 @@
    }
    public List<Pole> getOwnerPole(BaseConditionVO baseConditionVO, String keyword) {
    public List<Pole> getOwnerPole(BaseConditionVO baseConditionVO, String keyword,Long cilentId) {
        LambdaQueryWrapper<Pole> eq;
        if(SecurityUtils.getClientId()!=null){
//        if(SecurityUtils.getClientId()!=null){
            PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
            if(clientService.findClientId()){
                eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getUserId, SecurityUtils.getUserId());
            if(clientService.findClientId(cilentId)){
                eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getUserId, cilentId);
            }else{
                eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getClientId, SecurityUtils.getUserId());
                PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
                eq = Wrappers.lambdaQuery(Pole.class).eq(Pole::getClientId, cilentId)
                        .or(
                                pole->{
                                    pole.eq(Pole::getUserId, cilentId);
                                }
                        );
            }
        }else {
            PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
            eq = Wrappers.lambdaQuery(Pole.class);
        }
//        }else {
//            PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
//            eq = Wrappers.lambdaQuery(Pole.class);
//        }
        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
        if (!keyword.isEmpty()){
            eq.like(Pole::getPoleName,keyword).or(
                    code->{