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

设备添加产品编码字段,并添加同步更新产品编码字段

parent 4ea504da
...@@ -319,12 +319,13 @@ export default { ...@@ -319,12 +319,13 @@ export default {
}, },
changeStat(val, enabled) { changeStat(val, enabled) {
return;
//去除其它条件 //去除其它条件
delete this.query["productId"] delete this.query["productId"]
delete this.query["deviceName"] delete this.query["deviceName"]
delete this.query["deviceCode"] delete this.query["deviceCode"]
//this.query = Object.assign(this.query, { deviceStatus: val }); if(val!=null){
this.query = Object.assign(this.query, { deviceStatus: val });
}
this.query["page"]=1 this.query["page"]=1
if (!enabled) { if (!enabled) {
...@@ -525,12 +526,6 @@ export default { ...@@ -525,12 +526,6 @@ export default {
type: "select", type: "select",
label: "设备类型", label: "设备类型",
}, },
{
name: "deviceStatus",
type: "select",
label: "设备状态",
},
], ],
columns: [ columns: [
{ {
......
...@@ -13,10 +13,10 @@ public class ApiThirdPartyReq<T> { ...@@ -13,10 +13,10 @@ public class ApiThirdPartyReq<T> {
* 结果描述 * 结果描述
*/ */
private String msg; private String msg;
/**
* 0:设备增删改查,data数据域封装具体设备消息,1:设备消息类,数据域透传设备上行消息体。
*/
private Integer type; private Integer type;
/** /**
* 响应数据 * 响应数据
*/ */
......
...@@ -3,13 +3,10 @@ package com.mortals.xhx.common.utils; ...@@ -3,13 +3,10 @@ package com.mortals.xhx.common.utils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.mortals.framework.util.HttpUtil; import com.mortals.framework.util.HttpUtil;
import com.mortals.xhx.busiz.req.ApiThirdPartyReq; import com.mortals.xhx.busiz.req.ApiThirdPartyReq;
import com.mortals.xhx.busiz.req.DeviceReq;
import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.common.code.MessageTypeEnum; import com.mortals.xhx.common.code.MessageTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -31,15 +28,15 @@ public class SendTask implements Runnable { ...@@ -31,15 +28,15 @@ public class SendTask implements Runnable {
@Override @Override
public void run() { public void run() {
ApiThirdPartyReq<String> deviceReqApiReq = new ApiThirdPartyReq<>(); ApiThirdPartyReq<String> apiThirdReqApiReq = new ApiThirdPartyReq<>();
deviceReqApiReq.setCode(YesNoEnum.YES.getValue()); apiThirdReqApiReq.setCode(YesNoEnum.YES.getValue());
deviceReqApiReq.setType(MessageTypeEnum.TRANSACTION.getValue()); apiThirdReqApiReq.setType(MessageTypeEnum.TRANSACTION.getValue());
deviceReqApiReq.setData(content); apiThirdReqApiReq.setData(content);
String resp = null; String resp = null;
try { try {
Map<String, String> header = new HashMap<>(); Map<String, String> header = new HashMap<>();
header.put(HEADER_CONTENT_TYPE, "application/json"); header.put(HEADER_CONTENT_TYPE, "application/json");
String reqStr = JSON.toJSONString(deviceReqApiReq); String reqStr = JSON.toJSONString(apiThirdReqApiReq);
log.info("sendUrl:{} \n sendMessageReq:{}",sendUrl, reqStr); log.info("sendUrl:{} \n sendMessageReq:{}",sendUrl, reqStr);
resp = HttpUtil.doPost(sendUrl, header, reqStr); resp = HttpUtil.doPost(sendUrl, header, reqStr);
log.debug("sendMessageResp:{}", resp); log.debug("sendMessageResp:{}", resp);
......
package com.mortals.xhx.daemon.applicationservice; package com.mortals.xhx.daemon.applicationservice;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.springcloud.service.IApplicationService;
import com.mortals.framework.springcloud.service.IApplicationStartedService; import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SitePdu; import com.mortals.xhx.common.pdu.site.SitePdu;
...@@ -18,19 +14,11 @@ import com.mortals.xhx.module.platform.model.PlatformQuery; ...@@ -18,19 +14,11 @@ import com.mortals.xhx.module.platform.model.PlatformQuery;
import com.mortals.xhx.module.platform.service.PlatformService; import com.mortals.xhx.module.platform.service.PlatformService;
import com.mortals.xhx.module.product.model.ProductQuery; import com.mortals.xhx.module.product.model.ProductQuery;
import com.mortals.xhx.module.product.service.ProductService; import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.queue.TbQueueMsg;
import com.mortals.xhx.utils.IotThreadFactory;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import static com.mortals.xhx.common.key.RedisKey.*; import static com.mortals.xhx.common.key.RedisKey.*;
...@@ -78,9 +66,7 @@ public class DeviceStartService implements IApplicationStartedService { ...@@ -78,9 +66,7 @@ public class DeviceStartService implements IApplicationStartedService {
} }
}); });
//初始化站点缓存 //初始化站点缓存
SitePdu sitePdu = new SitePdu(); SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1); sitePdu.setSize(-1);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu); Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
......
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