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

添加前端页面

parent 538f3d36
......@@ -92,10 +92,6 @@ export default {
this.reset();
this.urls.currUrl = this.pageInfo.addUrl;
this.pageInfo.type = "add";
this.form.siteId = row.siteId;
this.form.siteName = row.siteName;
this.form.siteCode = row.siteCode;
this.getData();
this.title = "新增设备";
},
......@@ -138,11 +134,12 @@ export default {
console.log("form:", this.form);
Object.assign(this.viewInfo, this.form);
console.log("viewInfo", this.viewInfo);
// if(this.pageInfo.type=='add'){
// this.form.siteId = this.siteId;
// this.form.siteName = this.siteName;
// this.form.siteCode = this.siteCode;
// }
if(this.pageInfo.type=='add'){
this.form.siteId = this.siteId;
this.form.siteName = this.siteName;
this.form.siteCode = this.siteCode;
}
console.log("form:", this.form);
},
afterSubmit(data) {
......
......@@ -160,6 +160,7 @@ public class DeviceApiController {
deviceEntity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
deviceService.update(deviceEntity);
rsp.setData(deviceResp);
deviceService.sendThirdParty(deviceEntity,productEntity,platformEntity,DeviceMethodEnum.ONLINE);
} catch (Exception e) {
log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
......@@ -305,12 +306,11 @@ public class DeviceApiController {
deviceEntity = new DeviceEntity();
deviceEntity.initAttrValue();
saveOrUpdate(req, platformEntity, productEntity, deviceEntity);
deviceEntity.setCreateTime(new Date());
deviceEntity.setCreateUserId(1L);
deviceService.save(deviceEntity, null);
} else {
//更新
saveOrUpdate(req, platformEntity, productEntity, deviceEntity);
......@@ -319,6 +319,8 @@ public class DeviceApiController {
deviceService.update(deviceEntity, null);
}
deviceService.sendThirdParty(deviceEntity,productEntity,platformEntity,DeviceMethodEnum.ACTIVE);
deviceService.sendThirdParty(deviceEntity,productEntity,platformEntity,DeviceMethodEnum.ONLINE);
DeviceQueueAuthInfo authInfo = new DeviceQueueAuthInfo();
authInfo.setHost(host);
authInfo.setPort(port);
......@@ -347,7 +349,6 @@ public class DeviceApiController {
deviceInfo.setProductName(productEntity.getProductName());
registerResp.setDeviceInfo(deviceInfo);
String content = EncryptUtil.myEnscrt(JSON.toJSONString(registerResp), 9, DES_STR, ENCRYPT_STR);
log.info("deEncrypt:{}", EncryptUtil.myReEnscrt(content, 9, DES_STR, ENCRYPT_STR));
......
......@@ -291,7 +291,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
protected void saveBefore(DeviceEntity entity, Context context) throws AppException {
if (ObjectUtils.isEmpty(entity.getDeviceCode())) {
throw new AppException("设备编码不能为空!");
}
......
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