第三方电池接口去除https
This commit is contained in:
@@ -58,8 +58,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
|
||||
// 查询绑定电池的用户
|
||||
for (Equipment equipment : list) {
|
||||
// 查询状态
|
||||
System.out.println("equipment.getEquipmentCode() = " + equipment.getEquipmentCode());
|
||||
try {
|
||||
ResponseEntity<JSONObject> entity = restTemplate.getForEntity("https://battery.zfdliot.com/api/battery/status?battery_sn=" + equipment.getEquipmentCode(), JSONObject.class);
|
||||
ResponseEntity<JSONObject> entity = restTemplate.getForEntity("http://battery.zfdliot.com/api/battery/status?battery_sn=" + equipment.getEquipmentCode(), JSONObject.class);
|
||||
JSONObject body = entity.getBody();
|
||||
Integer code = body.getInteger("code");
|
||||
JSONObject data = body.getJSONObject("data");
|
||||
@@ -111,8 +112,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
|
||||
EquipmentParam param = new EquipmentParam();
|
||||
param.setEquipmentId(equipmentId);
|
||||
Equipment equipment = baseMapper.selectListRel(param).get(0);
|
||||
System.out.println("equipment.getEquipmentCode2() = " + equipment.getEquipmentCode());
|
||||
try {
|
||||
ResponseEntity<JSONObject> entity = restTemplate.getForEntity("https://battery.zfdliot.com/api/battery/status?battery_sn=" + equipment.getEquipmentCode(), JSONObject.class);
|
||||
ResponseEntity<JSONObject> entity = restTemplate.getForEntity("http://battery.zfdliot.com/api/battery/status?battery_sn=" + equipment.getEquipmentCode(), JSONObject.class);
|
||||
JSONObject body = entity.getBody();
|
||||
Integer code = body.getInteger("code");
|
||||
JSONObject data = body.getJSONObject("data");
|
||||
|
||||
@@ -272,8 +272,9 @@ public class OpenEquipmentController extends BaseController {
|
||||
param.put("userName", loginUser.getNickname());
|
||||
param.put("userPhone", loginUser.getPhone());
|
||||
param.put("battery_sn", one.getEquipmentCode());
|
||||
System.out.println("param = " + param);
|
||||
try {
|
||||
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity("https://battery.zfdliot.com/api/battery/batteryBindUser", param, JSONObject.class);
|
||||
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity("http://battery.zfdliot.com/api/battery/batteryBindUser", param, JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
log.info("电池绑定调用第三方返回:{}", body.toString());
|
||||
}catch (Exception e) {
|
||||
@@ -376,7 +377,8 @@ public class OpenEquipmentController extends BaseController {
|
||||
param.put("userName", loginUser.getNickname());
|
||||
param.put("userPhone", loginUser.getPhone());
|
||||
param.put("battery_sn", one.getEquipmentCode());
|
||||
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity("https://battery.zfdliot.com/api/battery/batteryBindUser", param, JSONObject.class);
|
||||
System.out.println("param2 = " + param);
|
||||
ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity("http://battery.zfdliot.com/api/battery/batteryBindUser", param, JSONObject.class);
|
||||
JSONObject body = responseEntity.getBody();
|
||||
log.info("电池更换调用第三方返回:{}", body);
|
||||
return success("换电成功");
|
||||
|
||||
Reference in New Issue
Block a user