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

添加前端页面

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