Procházet zdrojové kódy

HC 小区管理系统重新对接 HC物联网系统 代码开发完成

java110 před 5 roky
rodič
revize
c8db48e53a

+ 3 - 0
java110-bean/src/main/java/com/java110/dto/machine/MachineAttrDto.java

@@ -15,6 +15,9 @@ import java.util.Date;
  **/
 public class MachineAttrDto extends PageDto implements Serializable {
 
+    //硬件协议
+    public static final String SPEC_HM = "7127015495";
+
     private String machineId;
     private String[] machineIds;
     private String attrId;

+ 6 - 6
service-job/src/main/java/com/java110/job/adapt/hcIot/asyn/IIotSendAsyn.java

@@ -56,30 +56,30 @@ public interface IIotSendAsyn {
      * @param postParameters
      * @param ownerDtos
      */
-    public void addMachine(MultiValueMap<String, Object> postParameters, List<MultiValueMap<String, Object>> ownerDtos);
+    public void addMachine(JSONObject postParameters, List<JSONObject> ownerDtos);
 
     /**
      * 修改 设备 至 HC IOT
      *
      * @param postParameters
      */
-    void updateMachine(MultiValueMap<String, Object> postParameters);
+    void updateMachine(JSONObject postParameters);
 
-    void deleteSend(MultiValueMap<String, Object> postParameters);
+    void deleteSend(JSONObject postParameters);
 
-    public void sendOwner(MultiValueMap<String, Object> postParameters);
+    public void addOwner(JSONObject postParameters);
 
     /**
      * 修改业主
      *
      * @param postParameters
      */
-    void sendUpdateOwner(MultiValueMap<String, Object> postParameters);
+    void sendUpdateOwner(JSONObject postParameters);
 
     /**
      * 删除业主
      *
      * @param postParameters
      */
-    void sendDeleteOwner(MultiValueMap<String, Object> postParameters);
+    void sendDeleteOwner(JSONObject postParameters);
 }

+ 20 - 33
service-job/src/main/java/com/java110/job/adapt/hcIot/asyn/impl/IotSendAsynImpl.java

@@ -17,14 +17,12 @@ package com.java110.job.adapt.hcIot.asyn.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.client.RestTemplate;
-import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.dto.machine.MachineDto;
 import com.java110.intf.common.IMachineAttrInnerServiceSMO;
 import com.java110.intf.common.IMachineInnerServiceSMO;
 import com.java110.job.adapt.hcIot.GetToken;
 import com.java110.job.adapt.hcIot.IotConstant;
 import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
-import com.java110.po.machine.MachineAttrPo;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,7 +71,7 @@ public class IotSendAsynImpl implements IIotSendAsyn {
     @Override
     @Async
     public void addCommunity(JSONObject postParameters) {
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.ADD_COMMUNITY_URL, HttpMethod.POST, httpEntity, String.class);
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
@@ -81,7 +79,7 @@ public class IotSendAsynImpl implements IIotSendAsyn {
     @Override
     @Async
     public void editCommunity(JSONObject postParameters) {
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.UPDATE_COMMUNITY_URL, HttpMethod.POST, httpEntity, String.class);
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
@@ -89,20 +87,21 @@ public class IotSendAsynImpl implements IIotSendAsyn {
     @Override
     @Async
     public void deleteCommunity(JSONObject postParameters) {
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.DELETE_COMMUNITY_URL, HttpMethod.POST, httpEntity, String.class);
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
 
     /**
      * 添加设备
+     *
      * @param postParameters
      * @param ownerDtos
      */
     @Override
     @Async
-    public void addMachine(MultiValueMap<String, Object> postParameters, List<MultiValueMap<String, Object>> ownerDtos) {
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+    public void addMachine(JSONObject postParameters, List<JSONObject> ownerDtos) {
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.ADD_MACHINE_URL, HttpMethod.POST, httpEntity, String.class);
 
         logger.debug("调用HC IOT信息:" + responseEntity);
@@ -116,70 +115,58 @@ public class IotSendAsynImpl implements IIotSendAsyn {
             return;
         }
 
-        JSONObject data = tokenObj.getJSONObject("data");
-        String devMac = data.getString("devMac");
-        String appEkey = data.getString("appEkey");
-
         MachineDto machinePo = new MachineDto();
-        machinePo.setMachineId(data.getString("uuid"));
+        machinePo.setMachineId(postParameters.getString("extMachineId"));
+        machinePo.setCommunityId(postParameters.getString("extCommunityId"));
         machinePo.setState("1700");
-        machinePo.setMachineMac(devMac);
         machineInnerServiceSMOImpl.updateMachineState(machinePo);
 
-        MachineAttrPo machineAttrPo = new MachineAttrPo();
-        machineAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
-        machineAttrPo.setCommunityId(postParameters.get("extCommunityUuid").get(0).toString());
-        machineAttrPo.setSpecCd("7127015495");
-        machineAttrPo.setMachineId(data.getString("uuid"));
-        machineAttrPo.setValue(appEkey);
-        machineAttrInnerServiceSMOImpl.saveMachineAttrs(machineAttrPo);
-
-        for (MultiValueMap<String, Object> owner : ownerDtos) {
-            sendOwner(owner);
+        for (JSONObject owner : ownerDtos) {
+            addOwner(owner);
         }
     }
 
     @Override
     @Async
-    public void updateMachine(MultiValueMap<String, Object> postParameters) {
+    public void updateMachine(JSONObject postParameters) {
 
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.UPDATE_MACHINE_URL, HttpMethod.POST, httpEntity, String.class);
 
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
 
     @Override
-    public void deleteSend(MultiValueMap<String, Object> postParameters) {
+    public void deleteSend(JSONObject postParameters) {
 
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.DELETE_MACHINE_URL, HttpMethod.POST, httpEntity, String.class);
 
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
 
     @Override
-    public void sendOwner(MultiValueMap<String, Object> postParameters) {
+    public void addOwner(JSONObject postParameters) {
 
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.ADD_OWNER, HttpMethod.POST, httpEntity, String.class);
 
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
 
     @Override
-    public void sendUpdateOwner(MultiValueMap<String, Object> postParameters) {
+    public void sendUpdateOwner(JSONObject postParameters) {
 
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.EDIT_OWNER, HttpMethod.POST, httpEntity, String.class);
 
         logger.debug("调用HC IOT信息:" + responseEntity);
     }
 
     @Override
-    public void sendDeleteOwner(MultiValueMap<String, Object> postParameters) {
+    public void sendDeleteOwner(JSONObject postParameters) {
 
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders());
+        HttpEntity httpEntity = new HttpEntity(postParameters, getHeaders());
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.DELETE_OWNER, HttpMethod.POST, httpEntity, String.class);
 
         logger.debug("调用HC IOT信息:" + responseEntity);

+ 39 - 22
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/AddMachineToIotAdapt.java

@@ -21,11 +21,13 @@ import com.java110.dto.RoomDto;
 import com.java110.dto.communityLocation.CommunityLocationDto;
 import com.java110.dto.file.FileDto;
 import com.java110.dto.file.FileRelDto;
+import com.java110.dto.machine.MachineAttrDto;
 import com.java110.dto.machine.MachineDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.entity.order.Business;
 import com.java110.intf.common.IFileInnerServiceSMO;
 import com.java110.intf.common.IFileRelInnerServiceSMO;
+import com.java110.intf.common.IMachineAttrInnerServiceSMO;
 import com.java110.intf.common.IMachineInnerServiceSMO;
 import com.java110.intf.community.ICommunityLocationInnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
@@ -35,10 +37,9 @@ import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
 import com.java110.po.machine.MachinePo;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -58,6 +59,9 @@ public class AddMachineToIotAdapt extends DatabusAdaptImpl {
     @Autowired
     IMachineInnerServiceSMO machineInnerServiceSMOImpl;
 
+    @Autowired
+    private IMachineAttrInnerServiceSMO machineAttrInnerServiceSMOImpl;
+
     @Autowired
     private ICommunityLocationInnerServiceSMO communityLocationInnerServiceSMOImpl;
 
@@ -118,28 +122,40 @@ public class AddMachineToIotAdapt extends DatabusAdaptImpl {
 
         Assert.listOnlyOne(machineDtos, "未找到设备");
 
-        if (!"9999".equals(machineDtos.get(0).getMachineTypeCd())) {
-            return;
-        }
+        String hmId = getHmId(machineDtos.get(0));
 
-        List<MultiValueMap<String, Object>> ownerDtos = getOwners(machinePo);
+        List<JSONObject> ownerDtos = getOwners(machinePo);
 
-        MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
+        JSONObject postParameters = new JSONObject();
 
-        postParameters.add("extCommunityUuid", machinePo.getCommunityId());
-        postParameters.add("devSn", machinePo.getMachineCode());
-        postParameters.add("uuid", machineDtos.get(0).getMachineId());
-        postParameters.add("name", machinePo.getMachineName());
-        postParameters.add("positionType", "0");
-        postParameters.add("positionUuid", machinePo.getCommunityId());
+        postParameters.put("machineCode", machinePo.getMachineCode());
+        postParameters.put("machineName", machinePo.getMachineName());
+        postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
+        postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
+        postParameters.put("extCommunityId", machinePo.getCommunityId());
+        postParameters.put("hmId", hmId);
         hcMachineAsynImpl.addMachine(postParameters, ownerDtos);
     }
 
-    private List<MultiValueMap<String, Object>> getOwners(MachinePo machinePo) {
+    private String getHmId(MachineDto machineDto) {
+        MachineAttrDto machineAttrDto = new MachineAttrDto();
+        machineAttrDto.setCommunityId(machineDto.getCommunityId());
+        machineAttrDto.setMachineId(machineDto.getMachineId());
+        List<MachineAttrDto> machineAttrDtos = machineAttrInnerServiceSMOImpl.queryMachineAttrs(machineAttrDto);
+
+        for (MachineAttrDto tmpMachineAttrDto : machineAttrDtos) {
+            if (MachineAttrDto.SPEC_HM.equals(tmpMachineAttrDto.getSpecCd())) {
+                return tmpMachineAttrDto.getValue();
+            }
+        }
+        return "";
+    }
+
+    private List<JSONObject> getOwners(MachinePo machinePo) {
         //拿到小区ID
         String communityId = machinePo.getCommunityId();
 
-        List<MultiValueMap<String, Object>> ownerDtos = new ArrayList<>();
+        List<JSONObject> ownerDtos = new ArrayList<>();
 
         List<OwnerDto> owners = null;
         //根据小区ID查询现有设备
@@ -190,13 +206,14 @@ public class AddMachineToIotAdapt extends DatabusAdaptImpl {
             if (fileDtos == null || fileDtos.size() != 1) {
                 continue;
             }
-            MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-            postParameters.add("extCommunityUuid", tOwnerDto.getCommunityId());
-            postParameters.add("addAuthorizationDevSn", machinePo.getMachineCode());
-            postParameters.add("uuid", tOwnerDto.getMemberId());
-            postParameters.add("name", tOwnerDto.getName());
-            postParameters.add("faceFileBase64Array", fileDtos.get(0).getContext());
+            JSONObject postParameters = new JSONObject();
+            postParameters.put("userId", tOwnerDto.getMemberId());
+            postParameters.put("faceBase64", fileDtos.get(0).getContext());
+            postParameters.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+            postParameters.put("endTime", DateUtil.LAST_TIME);
+            postParameters.put("name", tOwnerDto.getName());
+            postParameters.put("idNumber", tOwnerDto.getIdCard());
+            postParameters.put("machineCode", machinePo.getMachineCode());
 
             ownerDtos.add(postParameters);
         }

+ 5 - 19
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/DeleteMachineToIotAdapt.java

@@ -26,8 +26,6 @@ import com.java110.po.machine.MachinePo;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 
 import java.util.List;
 
@@ -48,13 +46,9 @@ public class DeleteMachineToIotAdapt extends DatabusAdaptImpl {
     IMachineInnerServiceSMO machineInnerServiceSMOImpl;
 
     /**
-     * accessToken={access_token}
-     * &extCommunityUuid=01000
-     * &extCommunityId=1
-     * &devSn=111111111
-     * &name=设备名称
-     * &positionType=0
-     * &positionUuid=1
+     * {
+     *     "extMachineId": "702020042194860037"
+     * }
      *
      * @param business   当前处理业务
      * @param businesses 所有业务信息
@@ -82,19 +76,11 @@ public class DeleteMachineToIotAdapt extends DatabusAdaptImpl {
     }
 
     private void doSendMachine(Business business, JSONObject businessMachine) {
-
         MachinePo machinePo = BeanConvertUtil.covertBean(businessMachine, MachinePo.class);
         MachineDto machineDto = new MachineDto();
         machineDto.setMachineId(machinePo.getMachineId());
-//        List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto);
-//
-//        Assert.listOnlyOne(machineDtos, "未找到设备");
-
-        MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-        postParameters.add("extCommunityUuid", machinePo.getCommunityId());
-        postParameters.add("devSns", machinePo.getMachineCode());
-        //postParameters.add("uuids", machinePo.getMachineId());
+        JSONObject postParameters = new JSONObject();
+        postParameters.put("extMachineId", machinePo.getMachineId());
         hcMachineAsynImpl.deleteSend(postParameters);
     }
 }

+ 27 - 8
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/ModifyMachineToIotAdapt.java

@@ -17,8 +17,10 @@ package com.java110.job.adapt.hcIot.machine;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.machine.MachineAttrDto;
 import com.java110.dto.machine.MachineDto;
 import com.java110.entity.order.Business;
+import com.java110.intf.common.IMachineAttrInnerServiceSMO;
 import com.java110.intf.common.IMachineInnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
 import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
@@ -47,6 +49,9 @@ public class ModifyMachineToIotAdapt extends DatabusAdaptImpl {
     @Autowired
     IMachineInnerServiceSMO machineInnerServiceSMOImpl;
 
+    @Autowired
+    private IMachineAttrInnerServiceSMO machineAttrInnerServiceSMOImpl;
+
     /**
      * accessToken={access_token}
      * &extCommunityUuid=01000
@@ -89,15 +94,29 @@ public class ModifyMachineToIotAdapt extends DatabusAdaptImpl {
         List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto);
 
         Assert.listOnlyOne(machineDtos, "未找到设备");
+        String hmId = getHmId(machineDtos.get(0));
+        JSONObject postParameters = new JSONObject();
 
-        MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-        postParameters.add("extCommunityUuid", machineDtos.get(0).getCommunityId());
-        postParameters.add("devSn", machinePo.getMachineCode());
-        //postParameters.add("uuid", machinePo.getMachineId());
-        postParameters.add("name", machinePo.getMachineName());
-        postParameters.add("positionType", "0");
-        postParameters.add("positionUuid", machinePo.getCommunityId());
+        postParameters.put("machineCode", machinePo.getMachineCode());
+        postParameters.put("machineName", machinePo.getMachineName());
+        postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
+        postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
+        postParameters.put("extCommunityId", machinePo.getCommunityId());
+        postParameters.put("hmId", hmId);
         hcMachineAsynImpl.updateMachine(postParameters);
     }
+
+    private String getHmId(MachineDto machineDto) {
+        MachineAttrDto machineAttrDto = new MachineAttrDto();
+        machineAttrDto.setCommunityId(machineDto.getCommunityId());
+        machineAttrDto.setMachineId(machineDto.getMachineId());
+        List<MachineAttrDto> machineAttrDtos = machineAttrInnerServiceSMOImpl.queryMachineAttrs(machineAttrDto);
+
+        for (MachineAttrDto tmpMachineAttrDto : machineAttrDtos) {
+            if (MachineAttrDto.SPEC_HM.equals(tmpMachineAttrDto.getSpecCd())) {
+                return tmpMachineAttrDto.getValue();
+            }
+        }
+        return "";
+    }
 }

+ 11 - 10
service-job/src/main/java/com/java110/job/adapt/hcIot/owner/AddOwnerToIotAdapt.java

@@ -31,10 +31,9 @@ import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
 import com.java110.po.owner.OwnerPo;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -141,14 +140,16 @@ public class AddOwnerToIotAdapt extends DatabusAdaptImpl {
             if (!"9999".equals(tmpMachineDto.getMachineTypeCd())) {
                 continue;
             }
-            MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-            postParameters.add("extCommunityUuid", ownerPo.getCommunityId());
-            postParameters.add("addAuthorizationDevSn", tmpMachineDto.getMachineCode());
-            postParameters.add("uuid", ownerPo.getMemberId());
-            postParameters.add("name", ownerPo.getName());
-            postParameters.add("faceFileBase64Array", fileDtos.get(0).getContext());
-            hcMachineAsynImpl.sendOwner(postParameters);
+            JSONObject postParameters = new JSONObject();
+
+            postParameters.put("userId", ownerPo.getMemberId());
+            postParameters.put("faceBase64", fileDtos.get(0).getContext());
+            postParameters.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+            postParameters.put("endTime", DateUtil.LAST_TIME);
+            postParameters.put("name", ownerPo.getName());
+            postParameters.put("idNumber", ownerPo.getIdCard());
+            postParameters.put("machineCode", tmpMachineDto.getMachineCode());
+            hcMachineAsynImpl.addOwner(postParameters);
         }
 
     }

+ 7 - 12
service-job/src/main/java/com/java110/job/adapt/hcIot/owner/DeleteOwnerToIotAdapt.java

@@ -27,8 +27,6 @@ import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -50,13 +48,10 @@ public class DeleteOwnerToIotAdapt extends DatabusAdaptImpl {
 
 
     /**
-     * accessToken={access_token}
-     * &extCommunityUuid=01000
-     * &extCommunityId=1
-     * &devSn=111111111
-     * &name=设备名称
-     * &positionType=0
-     * &positionUuid=1
+     * {
+     * "userId": "702020042194860037",
+     * "machineCode": "101010"
+     * }
      *
      * @param business   当前处理业务
      * @param businesses 所有业务信息
@@ -101,10 +96,10 @@ public class DeleteOwnerToIotAdapt extends DatabusAdaptImpl {
             if (!"9999".equals(tmpMachineDto.getMachineTypeCd())) {
                 continue;
             }
-            MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
+            JSONObject postParameters = new JSONObject();
 
-            postParameters.add("extCommunityUuid", ownerPo.getCommunityId());
-            postParameters.add("uuids", ownerPo.getMemberId());
+            postParameters.put("machineCode", tmpMachineDto.getMachineCode());
+            postParameters.put("userId", ownerPo.getMemberId());
             hcMachineAsynImpl.sendDeleteOwner(postParameters);
         }
 

+ 10 - 7
service-job/src/main/java/com/java110/job/adapt/hcIot/owner/EditOwnerToIotAdapt.java

@@ -31,6 +31,7 @@ import com.java110.job.adapt.hcIot.asyn.IIotSendAsyn;
 import com.java110.po.owner.OwnerPo;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.LinkedMultiValueMap;
@@ -141,13 +142,15 @@ public class EditOwnerToIotAdapt extends DatabusAdaptImpl {
             if (!"9999".equals(tmpMachineDto.getMachineTypeCd())) {
                 continue;
             }
-            MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-            postParameters.add("extCommunityUuid", ownerPo.getCommunityId());
-            postParameters.add("addAuthorizationDevSn", tmpMachineDto.getMachineCode());
-            postParameters.add("uuid", ownerPo.getMemberId());
-            postParameters.add("name", ownerPo.getName());
-            postParameters.add("faceFileBase64Array", fileDtos.get(0).getContext());
+            JSONObject postParameters = new JSONObject();
+
+            postParameters.put("userId", ownerPo.getMemberId());
+            postParameters.put("faceBase64", fileDtos.get(0).getContext());
+            postParameters.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+            postParameters.put("endTime", DateUtil.LAST_TIME);
+            postParameters.put("name", ownerPo.getName());
+            postParameters.put("idNumber", ownerPo.getIdCard());
+            postParameters.put("machineCode", tmpMachineDto.getMachineCode());
             hcMachineAsynImpl.sendUpdateOwner(postParameters);
         }
 

+ 11 - 8
service-job/src/main/java/com/java110/job/adapt/hcIot/owner/OwnerBindRoomToIotAdapt.java

@@ -34,6 +34,7 @@ import com.java110.po.owner.OwnerPo;
 import com.java110.po.owner.OwnerRoomRelPo;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.util.LinkedMultiValueMap;
@@ -159,14 +160,16 @@ public class OwnerBindRoomToIotAdapt extends DatabusAdaptImpl {
             if (!"9999".equals(tmpMachineDto.getMachineTypeCd())) {
                 continue;
             }
-            MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-            postParameters.add("extCommunityUuid", tOwnerDto.getCommunityId());
-            postParameters.add("addAuthorizationDevSn", tmpMachineDto.getMachineCode());
-            postParameters.add("uuid", tOwnerDto.getMemberId());
-            postParameters.add("name", tOwnerDto.getName());
-            postParameters.add("faceFileBase64Array", fileDtos.get(0).getContext());
-            hcMachineAsynImpl.sendOwner(postParameters);
+            JSONObject postParameters = new JSONObject();
+
+            postParameters.put("userId", tOwnerDto.getMemberId());
+            postParameters.put("faceBase64", fileDtos.get(0).getContext());
+            postParameters.put("startTime", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
+            postParameters.put("endTime", DateUtil.LAST_TIME);
+            postParameters.put("name", tOwnerDto.getName());
+            postParameters.put("idNumber", tOwnerDto.getIdCard());
+            postParameters.put("machineCode", tmpMachineDto.getMachineCode());
+            hcMachineAsynImpl.addOwner(postParameters);
         }
     }
 }

+ 3 - 6
service-job/src/main/java/com/java110/job/adapt/hcIot/owner/OwnerUnBindRoomToIotAdapt.java

@@ -34,8 +34,6 @@ import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -141,10 +139,9 @@ public class OwnerUnBindRoomToIotAdapt extends DatabusAdaptImpl {
             if (!"9999".equals(tmpMachineDto.getMachineTypeCd())) {
                 continue;
             }
-            MultiValueMap<String, Object> postParameters = new LinkedMultiValueMap<>();
-
-            postParameters.add("extCommunityUuid", tOwnerDto.getCommunityId());
-            postParameters.add("uuids", tOwnerDto.getMemberId());
+            JSONObject postParameters = new JSONObject();
+            postParameters.put("machineCode", tmpMachineDto.getMachineCode());
+            postParameters.put("userId", tOwnerDto.getMemberId());
             hcMachineAsynImpl.sendDeleteOwner(postParameters);
         }
     }