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

修改线程初始化数量

parent 2e8546ac
......@@ -31,6 +31,7 @@ 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;
......@@ -243,15 +244,17 @@ public class DeviceApiController {
deviceEntity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
deviceEntity.setDeviceVersion(req.getDeviceVersion() == null ? "" : req.getDeviceVersion());
DeviceEntity entity = new DeviceEntity();
entity.setId(deviceEntity.getId());
entity.setOnlineTime(new Date());
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
deviceService.getDeviceDao().update(deviceEntity);
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);
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