ソースを参照

优化远程开门接口

java110 5 年 前
コミット
92389cad41

+ 1 - 1
service-job/src/main/java/com/java110/job/adapt/hcIot/OpenDoorAdapt.java

@@ -43,7 +43,7 @@ public class OpenDoorAdapt extends DatabusAdaptImpl {
     public ResultVo openDoor(JSONObject paramIn) {
     public ResultVo openDoor(JSONObject paramIn) {
         JSONObject postParameters = new JSONObject();
         JSONObject postParameters = new JSONObject();
         postParameters.put("machineCode", paramIn.getString("machineCode"));
         postParameters.put("machineCode", paramIn.getString("machineCode"));
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders(outRestTemplate));
+        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters.toJSONString(), getHeaders(outRestTemplate));
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.getUrl(IotConstant.OPEN_DOOR), HttpMethod.POST, httpEntity, String.class);
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.getUrl(IotConstant.OPEN_DOOR), HttpMethod.POST, httpEntity, String.class);
         if (responseEntity.getStatusCode() != HttpStatus.OK) {
         if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return new ResultVo(ResultVo.CODE_ERROR, responseEntity.getBody());
             return new ResultVo(ResultVo.CODE_ERROR, responseEntity.getBody());

+ 1 - 1
service-job/src/main/java/com/java110/job/adapt/hcIot/RestartMachineAdapt.java

@@ -43,7 +43,7 @@ public class RestartMachineAdapt extends DatabusAdaptImpl {
     public ResultVo restartMachine(JSONObject paramIn) {
     public ResultVo restartMachine(JSONObject paramIn) {
         JSONObject postParameters = new JSONObject();
         JSONObject postParameters = new JSONObject();
         postParameters.put("machineCode", paramIn.getString("machineCode"));
         postParameters.put("machineCode", paramIn.getString("machineCode"));
-        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters, getHeaders(outRestTemplate));
+        HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(postParameters.toJSONString(), getHeaders(outRestTemplate));
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.getUrl(IotConstant.RESTART_MACHINE), HttpMethod.POST, httpEntity, String.class);
         ResponseEntity<String> responseEntity = outRestTemplate.exchange(IotConstant.getUrl(IotConstant.RESTART_MACHINE), HttpMethod.POST, httpEntity, String.class);
         if (responseEntity.getStatusCode() != HttpStatus.OK) {
         if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return new ResultVo(ResultVo.CODE_ERROR, responseEntity.getBody());
             return new ResultVo(ResultVo.CODE_ERROR, responseEntity.getBody());

+ 1 - 0
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/AddMachineToIotAdapt.java

@@ -130,6 +130,7 @@ public class AddMachineToIotAdapt extends DatabusAdaptImpl {
 
 
         postParameters.put("machineCode", machinePo.getMachineCode());
         postParameters.put("machineCode", machinePo.getMachineCode());
         postParameters.put("machineName", machinePo.getMachineName());
         postParameters.put("machineName", machinePo.getMachineName());
+        postParameters.put("machineVersion", machinePo.getMachineVersion());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());

+ 1 - 0
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/ModifyMachineToIotAdapt.java

@@ -99,6 +99,7 @@ public class ModifyMachineToIotAdapt extends DatabusAdaptImpl {
 
 
         postParameters.put("machineCode", machinePo.getMachineCode());
         postParameters.put("machineCode", machinePo.getMachineCode());
         postParameters.put("machineName", machinePo.getMachineName());
         postParameters.put("machineName", machinePo.getMachineName());
+        postParameters.put("machineVersion", machinePo.getMachineVersion());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());