| | |
| | | model.setManufature(device.getManufacturer()); |
| | | model.setType(Constants.ZERO); |
| | | // model.setNo(device.getDevSerialNum()); |
| | | model.setChannelNo(getChannelNo(device.getIndexCode(),hkDoorList)); |
| | | model.setChannelNo(getChannelNo(device.getIndexCode(),hkDoorList,model)); |
| | | model.setResourceType(device.getResourceType()); |
| | | model.setDevTypeCode(device.getDevTypeCode()); |
| | | model.setDevTypeDesc(device.getDevTypeDesc()); |
| | | model.setManufature(device.getManufacturer()); |
| | | model.setPort(device.getPort()); |
| | | model.setRemark(JSONObject.toJSONString(device)); |
| | | return model; |
| | | } |
| | | |
| | | private String getChannelNo(String indexCode, List<DoorsInfoResponse> hkDoorList) { |
| | | private String getChannelNo(String indexCode, List<DoorsInfoResponse> hkDoorList,Device model ) { |
| | | String str = ""; |
| | | String names = ""; |
| | | if(hkDoorList!=null && hkDoorList.size()>0){ |
| | | for(DoorsInfoResponse info : hkDoorList){ |
| | | if(StringUtils.equals(indexCode,info.getParentIndexCode())){ |
| | |
| | | } |
| | | if(StringUtils.isNotBlank(str)){ |
| | | str += ","; |
| | | names += ","; |
| | | } |
| | | str+=info.getChannelNo(); |
| | | names+=info.getName(); |
| | | } |
| | | } |
| | | } |
| | | model.setChannelNo(str); |
| | | model.setChannelInfo(names); |
| | | return str; |
| | | } |
| | | |