| | |
| | | package com.doumee.service.business.impl.hksync; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | |
| | | //分页遍历循环查询所有门禁设备数据 |
| | | param = new AcsDeviceListRequest(); |
| | | param.setPageNo(curPage); |
| | | param.setPageSize(10000); |
| | | param.setPageSize(100); |
| | | BaseResponse<AcsDeviceListResponse> response = HKService.acsDeviceList(param); |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~"); |
| | | } |
| | | AcsDeviceListResponse r = response.getData(); |
| | | curTotal += 10000; |
| | | curTotal += 100; |
| | | if(curTotal >= r.getTotal()){ |
| | | hasNext = false; |
| | | } |
| | |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setIp(device.getIp()); |
| | | model.setHkDate(date); |
| | | model.setCreateDate(DateUtil.StringToDate2(device.getCreateTime())); |
| | | model.setEditDate(DateUtil.StringToDate2(device.getUpdateTime())); |
| | | model.setNo(device.getDeviceCode()); |
| | | model.setCreateDate(DateUtil.getISO8601DateByStr(device.getCreateTime())); |
| | | model.setEditDate(DateUtil.getISO8601DateByStr(device.getUpdateTime())); |
| | | model.setNo(device.getDevSerialNum()); |
| | | model.setHkId(device.getIndexCode()); |
| | | model.setName(device.getName()); |
| | | model.setHkStatus(Constants.ONE); |
| | | model.setManufature(device.getManufacturer()); |
| | | model.setType(Constants.ZERO); |
| | | // model.setNo(device.getDevSerialNum()); |
| | | // model.setChannelNo(device); |
| | | model.setResourceType(device.getResourceType()); |
| | | model.setDevTypeCode(device.getDevTypeCode()); |
| | | model.setManufature(device.getManufacturer()); |
| | | model.setPort(device.getPort()); |
| | | model.setRemark(JSONObject.toJSONString(device)); |
| | | return model; |
| | | } |
| | | |