jiangping
2024-01-09 d7e663d304a2ccb565a24362b116ddaa9da9941a
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncDeviceServiceImpl.java
@@ -179,17 +179,19 @@
        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())){
@@ -198,11 +200,15 @@
                    }
                    if(StringUtils.isNotBlank(str)){
                        str += ",";
                        names += ",";
                    }
                    str+=info.getChannelNo();
                    names+=info.getName();
                }
            }
        }
        model.setChannelNo(str);
        model.setChannelInfo(names);
        return str;
    }