Commit 17bb5dc0 authored by 赵啸非's avatar 赵啸非

修改线程初始化数量

parent 4092b2d6
......@@ -31,7 +31,6 @@ 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;
......@@ -246,13 +245,13 @@ 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);
rsp.setData(deviceResp);
/* SendThirdPartyTask sendThirdPartyTask = new SendThirdPartyTask(deviceEntity, productEntity, platformEntity, deviceService);
......@@ -859,10 +858,12 @@ public class DeviceApiController {
if (!ObjectUtils.isEmpty(deviceEntity)) {
throw new AppException(DEVICE_CODE_IS_EXIST, DEVICE_CODE_IS_EXIST_CONTENT);
}
ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(req.getProductCode()));
if (ObjectUtils.isEmpty(productEntity)) {
throw new AppException(PRODUCT_IS_EMPTY, PRODUCT_IS_EMPTY_CONTENT);
}
PlatformEntity platformEntity = platformService.getCache(productEntity.getPlatformId().toString());
if (ObjectUtils.isEmpty(platformEntity)) {
throw new AppException(PLATFORM_IS_EMPTY, PLATFORM_IS_EMPTY_CONTENT);
......@@ -902,8 +903,8 @@ public class DeviceApiController {
if (ObjectUtils.isEmpty(deviceEntity)) {
throw new AppException(DEVICE_CODE_IS_EMPTY, DEVICE_CODE_IS_EMPTY_CONTENT);
}
ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(req.getProductCode()));
ProductEntity productEntity =productService.getExtCache(req.getProductCode());
// ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(req.getProductCode()));
if (ObjectUtils.isEmpty(productEntity)) {
throw new AppException(PRODUCT_IS_EMPTY, PRODUCT_IS_EMPTY_CONTENT);
}
......
......@@ -5,7 +5,6 @@ import cn.hutool.core.net.url.UrlPath;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
......@@ -14,15 +13,15 @@ import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.message.impl.MessageProducer;
import com.mortals.xhx.busiz.rsp.ProductVersionInfo;
import com.mortals.xhx.common.code.LogTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.QueueKey;
import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders;
import com.mortals.xhx.common.model.MessageHeader;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceLogEntity;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceLogService;
import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.platform.model.PlatformEntity;
......@@ -78,6 +77,10 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
@Autowired
private ISiteFeign siteFeign;
@Override
protected String getExtKey(ProductEntity data) {
return data.getProductCode();
}
@Override
protected void saveBefore(ProductEntity entity, Context context) throws 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