| | |
| | | param = new PrivilegeGroupRequest(); |
| | | param.setPageNo(curPage); |
| | | param.setPageSize(100); |
| | | BaseResponse<PrivilegeGroupListResponse> response = HKService.privilegeGroup(param); |
| | | // BaseResponse<PrivilegeGroupListResponse> response = HKService.privilegeGroup(param); |
| | | // if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | // response = HKService.privilegIccmeGroup(param);//接口V1版本不存在,调用iccm版本接口 |
| | | // } |
| | | BaseResponse<PrivilegeGroupListResponse> response = HKService.privilegIccmeGroup(param);//接口V1版本不存在,调用iccm版本接口 |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~"); |
| | | } |
| | |
| | | } |
| | | } |
| | | if(addList.size()>0){ |
| | | DeviceRoleMapper.insertBatchSomeColumn(addList); |
| | | DeviceRoleMapper.insert(addList); |
| | | } |
| | | if(editList.size()>0){ |
| | | for(DeviceRole d : editList){ |
| | |
| | | if(model !=null){ |
| | | //如果已存在,则更新数据 |
| | | model = initDataByHkData(model,device,date); |
| | | if(allHkList.size()==1){ |
| | | model.setIsDefault(Constants.ZERO); |
| | | } |
| | | editList.add(model); |
| | | }else{ |
| | | //如果不存在,则新增数据 |
| | | model = new DeviceRole(); |
| | | model = initDataByHkData(model,device,date); |
| | | if(allHkList.size()==1){ |
| | | model.setIsDefault(Constants.ZERO); |
| | | } |
| | | addList.add(model); |
| | | } |
| | | } |