| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.api.R; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.DataSyncConfig; |
| | |
| | | @Override |
| | | public List<RoleListResponse> erpQueryDeviceList(RoleListRequest param){ |
| | | List<RoleListResponse> result = new ArrayList<>(); |
| | | try{ |
| | | List<DeviceRole> deviceRoleList = this.deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda() |
| | | .eq(DeviceRole::getIsdeleted,Constants.ZERO) |
| | | .eq(!Objects.isNull(param.getId()),DeviceRole::getId,param.getId()) |
| | |
| | | } |
| | | } |
| | | } |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/role/list",JSONObject.toJSONString(result),Constants.ZERO); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<ParkListResponse> parkList(ParkListRequest param){ |
| | | List<ParkListResponse> result = new ArrayList<>(); |
| | | try{ |
| | | List<Parks> parksList = this.parksMapper.selectList(new QueryWrapper<Parks>().lambda() |
| | | .eq(Parks::getIsdeleted,Constants.ZERO) |
| | | .eq(!Objects.isNull(param.getId()),Parks::getId,param.getId()) |
| | |
| | | result.add(parkListResponse); |
| | | } |
| | | } |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/park/list",JSONObject.toJSONString(result),Constants.ZERO); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public PageData<VisitEventListResponse> visitListPage(PageWrap<VisitListRequest> param) { |
| | | PageData<VisitEventListResponse> result = new PageData<>(); |
| | | try{ |
| | | VisitListRequest visitListRequest = param.getModel(); |
| | | IPage<VisitEvent> page = new Page<>(param.getPage(), param.getCapacity()); |
| | | MPJLambdaWrapper<VisitEvent> queryWrapper = new MPJLambdaWrapper<>(); |
| | |
| | | } |
| | | IPage<VisitEventListResponse> pageData = visitEventJoinMapper.selectJoinPage(page, VisitEventListResponse.class,queryWrapper); |
| | | result = PageData.from(pageData); |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/visit/list",JSONObject.toJSONString(result),Constants.ZERO); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public PageData<DoorEventListResponse> doorEventListPage(PageWrap<DoorEventListRequest> param) { |
| | | PageData<DoorEventListResponse> result = new PageData<>(); |
| | | try{ |
| | | |
| | | DoorEventListRequest doorEventListRequest = param.getModel(); |
| | | IPage<DeviceEvent> page = new Page<>(param.getPage(), param.getCapacity()); |
| | | MPJLambdaWrapper<DeviceEvent> queryWrapper = new MPJLambdaWrapper<>(); |
| | |
| | | |
| | | IPage<DoorEventListResponse> pageData = deviceEventJoinMapper.selectJoinPage(page, DoorEventListResponse.class,queryWrapper); |
| | | result = PageData.from(pageData); |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/doorEvent/list",JSONObject.toJSONString(result),Constants.ZERO); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public PageData<CarEventListResponse> carEventList(PageWrap<CarEventListRequest> param) { |
| | | PageData<CarEventListResponse> result = new PageData<>(); |
| | | try{ |
| | | CarEventListRequest carEventListRequest = param.getModel(); |
| | | IPage<CarEvent> page = new Page<>(param.getPage(), param.getCapacity()); |
| | | MPJLambdaWrapper<CarEvent> queryWrapper = new MPJLambdaWrapper<>(); |
| | |
| | | i.setVehiclePicUrl(null); |
| | | } |
| | | }); |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/carEventList",JSONObject.toJSONString(result),Constants.ZERO); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public void orgUpdate(OrgUpdateRequest param){ |
| | | try{ |
| | | if(Objects.isNull(param) |
| | | ||Objects.isNull(param.getId()) |
| | | ||StringUtils.isBlank(param.getName()) |
| | |
| | | companyMapper.updateById(company); |
| | | //TODO 海康数据更新 |
| | | } |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/orgUpdate",null,Constants.ZERO); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void userUpdate(UserUpdateRequest param){ |
| | | try{ |
| | | if(param.getIsdeleted() == 1){ |
| | | if( Objects.isNull(param.getId()) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | // getRoleIdByParam(param.getRoleIds(),member); |
| | | //添加人员卡片数据 |
| | | dealMemberCard(member,param); |
| | | } |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/visitBiz/resource/userUpdate",null,Constants.ZERO); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public void roleUserAuthor(UserAuthorRequest param){ |
| | | try{ |
| | | if(Objects.isNull(param) |
| | | ||StringUtils.isBlank(param.getUserId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | .set(Member::getEndTime,param.getValidEndTime()) |
| | | .set(Member::getEditDate,new Date()) |
| | | .set(Member::getHkStatus,Constants.ZERO )); |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/event/role/userAuthor",null,Constants.ZERO); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void parkCarAuthor(CarAuthorRequest param){ |
| | | try{ |
| | | if(Objects.isNull(param) |
| | | ||StringUtils.isBlank(param.getCarCode())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,停车库信息不存在,授权失败"); |
| | | } |
| | | } |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }finally { |
| | | saveInterfaceLog(param,"/event/park/carAuthor",null,Constants.ZERO); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.NOT_SUPPORTED) |
| | | @Override |
| | | public void saveInterfaceLog(Object param, String path, String result, Integer type) { |
| | | InterfaceLog interfaceLog=new InterfaceLog(); |
| | | interfaceLog.setType(type); |