Commit a23f125a authored by 赵啸非's avatar 赵啸非

修改接口设备更新站点后,站点名称和编码未更新问题

parent 02d773af
...@@ -137,4 +137,9 @@ public class DeviceReq implements Serializable { ...@@ -137,4 +137,9 @@ public class DeviceReq implements Serializable {
*/ */
private Integer source; private Integer source;
/**
* 激活(0.否,1.是)
*/
private Integer active;
} }
...@@ -203,13 +203,13 @@ public class DeviceApiController { ...@@ -203,13 +203,13 @@ public class DeviceApiController {
} }
private void buildHomeUrl(DeviceEntity deviceEntity, ProductEntity productEntity, ServerInfo serverInfo) { private void buildHomeUrl(DeviceEntity deviceEntity, ProductEntity productEntity, ServerInfo serverInfo) {
String homeUrl=""; String homeUrl = "";
if(!ObjectUtils.isEmpty(productEntity.getHomeUrl())){ if (!ObjectUtils.isEmpty(productEntity.getHomeUrl())) {
homeUrl= productEntity.getHomeUrl(); homeUrl = productEntity.getHomeUrl();
} }
if(!ObjectUtils.isEmpty(deviceEntity.getHomeUrl())){ if (!ObjectUtils.isEmpty(deviceEntity.getHomeUrl())) {
homeUrl= deviceEntity.getHomeUrl(); homeUrl = deviceEntity.getHomeUrl();
} }
String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11091"); String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11091");
...@@ -435,6 +435,11 @@ public class DeviceApiController { ...@@ -435,6 +435,11 @@ public class DeviceApiController {
deviceEntity.setDeviceCode(req.getDeviceCode()); deviceEntity.setDeviceCode(req.getDeviceCode());
deviceEntity.setEnabled(YesNoEnum.YES.getValue()); deviceEntity.setEnabled(YesNoEnum.YES.getValue());
if (!ObjectUtils.isEmpty(req.getActive())) {
deviceEntity.setDeviceStatus(req.getActive() == YesNoEnum.YES.getValue() ? DeviceStatusEnum.离线.getValue() : DeviceStatusEnum.未激活.getValue());
}
// deviceEntity.setDeviceStatus(DeviceStatusEnum.未激活.getValue()); // deviceEntity.setDeviceStatus(DeviceStatusEnum.未激活.getValue());
deviceEntity.setSource(req.getSource()); deviceEntity.setSource(req.getSource());
...@@ -508,8 +513,8 @@ public class DeviceApiController { ...@@ -508,8 +513,8 @@ public class DeviceApiController {
header.put(MessageHeader.DEVICECODE, deviceEntity.getDeviceCode()); header.put(MessageHeader.DEVICECODE, deviceEntity.getDeviceCode());
for (int i = 0; i < 100; i++) { for (int i = 0; i < 100; i++) {
log.info("sendMesageTopic:{}",JSON.toJSONString(info)); log.info("sendMesageTopic:{}", JSON.toJSONString(info));
deviceService.sendDeviceMessage(deviceEntity, info, header, JSON.toJSONString(req),null, null); deviceService.sendDeviceMessage(deviceEntity, info, header, JSON.toJSONString(req), null, null);
Thread.sleep(50); Thread.sleep(50);
} }
//log.info(String.format("sendMsgResp:%s", JSON.toJSONString(sendDeviceMessageResp))); //log.info(String.format("sendMsgResp:%s", JSON.toJSONString(sendDeviceMessageResp)));
......
...@@ -326,6 +326,7 @@ defectsLiabilityPeriod|Date|否|保修期,如2020-08-12 15:00:00 ...@@ -326,6 +326,7 @@ defectsLiabilityPeriod|Date|否|保修期,如2020-08-12 15:00:00
leadingOfficial|String|否|负责人 leadingOfficial|String|否|负责人
leadingOfficialTelephone|String|否|联系电话 leadingOfficialTelephone|String|否|联系电话
source|Integer|否|设备来源,默认1(0.旧设备,1.新设备) source|Integer|否|设备来源,默认1(0.旧设备,1.新设备)
active|Integer|否|设备激活,默认0(0.否,1.是)
**请求样例:** **请求样例:**
``` ```
...@@ -344,8 +345,9 @@ source|Integer|否|设备来源,默认1(0.旧设备,1.新设备) ...@@ -344,8 +345,9 @@ source|Integer|否|设备来源,默认1(0.旧设备,1.新设备)
"deviceInFloor":22, "deviceInFloor":22,
"defectsLiabilityPeriod":"2022-06-30", "defectsLiabilityPeriod":"2022-06-30",
"leadingOfficial":"张三", "leadingOfficial":"张三",
"leadingOfficialTelephone":"13281114856",, "leadingOfficialTelephone":"13281114856",
"source":1 "source":1,
"active":1
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment