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

修改离线消息

parent cf078990
......@@ -31,12 +31,16 @@ import com.mortals.xhx.busiz.rsp.*;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.QueueKey;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders;
import com.mortals.xhx.common.model.MessageHeader;
import com.mortals.xhx.common.pdu.DeviceReq;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.utils.*;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.common.utils.DownMsgTask;
import com.mortals.xhx.common.utils.EncryptUtil;
import com.mortals.xhx.common.utils.SendTaskThreadPool;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity;
......@@ -243,17 +247,17 @@ public class DeviceApiController {
deviceEntity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
deviceEntity.setDeviceVersion(req.getDeviceVersion() == null ? "" : req.getDeviceVersion());
/* if(deviceEntity.getDeviceStatus()== DeviceStatusEnum.离线.getValue()){
if(deviceEntity.getDeviceStatus()== DeviceStatusEnum.离线.getValue()){
DeviceEntity entity = new DeviceEntity();
entity.setId(deviceEntity.getId());
entity.setOnlineTime(new Date());
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
cacheService.lpush(RedisKey.KEY_DEVICE_THIRDPARTY_QUEUE, entity);
}*/
deviceService.getDeviceDao().update(deviceEntity);
}
// deviceService.getDeviceDao().update(deviceEntity);
rsp.setData(deviceResp);
SendThirdPartyTask sendThirdPartyTask = new SendThirdPartyTask(deviceEntity, productEntity, platformEntity, deviceService);
sendTaskThreadPool.execute(sendThirdPartyTask);
/* SendThirdPartyTask sendThirdPartyTask = new SendThirdPartyTask(deviceEntity, productEntity, platformEntity, deviceService);
sendTaskThreadPool.execute(sendThirdPartyTask);*/
} catch (AppException e) {
//log.error("接收数据失败", e);
rsp.setCode(e.getCode());
......
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