|
@@ -105,7 +105,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> control(String productCode, String deviceUuid, String commandCode, String commandValue, String domain, Long userId, String userName) {
|
|
|
+ public Map<String, Object> control(String productCode, String deviceUuid, String commandCode, String commandValue, String domain, Long userId, String userName, Integer categoryType, String gatewayUuid) {
|
|
|
Integer tenantId;
|
|
|
long commandUserId;
|
|
|
String commandUserName;
|
|
@@ -146,12 +146,18 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("method", "control");
|
|
|
+ map.put("deviceUuid", deviceUuid);
|
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
|
map1.put("commandCode", commandCode);
|
|
|
map1.put("commandValue", commandValue);
|
|
|
map.put("params", map1);
|
|
|
|
|
|
- return remoteTransferService.deviceControl(productCode, deviceUuid, JSON.toJSONString(map), tenantId, commandUserId, commandUserName);
|
|
|
+ if(categoryType == 3){
|
|
|
+ return remoteTransferService.deviceControl(productCode, gatewayUuid, JSON.toJSONString(map), tenantId, commandUserId, commandUserName);
|
|
|
+ }else{
|
|
|
+ return remoteTransferService.deviceControl(productCode, deviceUuid, JSON.toJSONString(map), tenantId, commandUserId, commandUserName);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -166,6 +172,8 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
Integer productId = requestVO.getProductId();
|
|
|
Integer pageNum = requestVO.getPageNum();
|
|
|
Integer pageSize = requestVO.getPageSize();
|
|
|
+ Integer categoryType = requestVO.getCategoryType();
|
|
|
+
|
|
|
|
|
|
pageNum = (pageNum != null) ? pageNum : 1;
|
|
|
pageSize = (pageSize != null) ? pageSize : 10;
|
|
@@ -182,37 +190,101 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
throw new BusinessException("设备uuid“deviceUuid“不能为空!");
|
|
|
}
|
|
|
|
|
|
- DmpTopicResponseVO add = new DmpTopicResponseVO();
|
|
|
- add.setTopic("/" + productCode + "/" + deviceId + "/" + TopicInfo.ADD_REMARKS.getLetter());
|
|
|
- add.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
- add.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
- add.setRemarks(TopicInfo.ADD_REMARKS.getValue());
|
|
|
- responseVOList.add(add);
|
|
|
-
|
|
|
- DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
- info.setTopic("/" + productCode + "/" + deviceId + "/" + TopicInfo.INFO_REMARKS.getLetter());
|
|
|
- info.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
- info.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
- info.setRemarks(TopicInfo.INFO_REMARKS.getValue());
|
|
|
- responseVOList.add(info);
|
|
|
-
|
|
|
- DmpTopicResponseVO control = new DmpTopicResponseVO();
|
|
|
- control.setTopic("/" + deviceUuid + "/" + TopicInfo.CONTROL_REMARKS.getLetter());
|
|
|
- control.setSubscriber(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
- control.setPublisher(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
- control.setRemarks(TopicInfo.CONTROL_REMARKS.getValue());
|
|
|
- responseVOList.add(control);
|
|
|
-
|
|
|
- DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
|
|
|
- controlResponse.setTopic("/" + deviceUuid + "/" + TopicInfo.CONTROL_RESPONSE_REMARKS.getLetter());
|
|
|
- controlResponse.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
- controlResponse.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
- controlResponse.setRemarks(TopicInfo.CONTROL_RESPONSE_REMARKS.getValue());
|
|
|
- responseVOList.add(controlResponse);
|
|
|
+ if(categoryType == 1){
|
|
|
+ DmpTopicResponseVO add = new DmpTopicResponseVO();
|
|
|
+ add.setTopic("/usky/devices/" + deviceUuid + "/add");
|
|
|
+ add.setPublisher("普通设备");
|
|
|
+ add.setSubscriber("物联网平台");
|
|
|
+ add.setRemarks("添加普通设备");
|
|
|
+ responseVOList.add(add);
|
|
|
+
|
|
|
+ DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
+ info.setTopic("/usky/devices/" + deviceUuid + "/info");
|
|
|
+ info.setPublisher("普通设备");
|
|
|
+ info.setSubscriber("物联网平台");
|
|
|
+ info.setRemarks("普通设备上报数据");
|
|
|
+ responseVOList.add(info);
|
|
|
+
|
|
|
+ DmpTopicResponseVO control = new DmpTopicResponseVO();
|
|
|
+ control.setTopic("/usky/devices/" + deviceUuid + "/control");
|
|
|
+ control.setPublisher("物联网平台");
|
|
|
+ control.setSubscriber("普通设备");
|
|
|
+ control.setRemarks("物联网平台给普通设备下发命令");
|
|
|
+ responseVOList.add(control);
|
|
|
+
|
|
|
+ DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
|
|
|
+ controlResponse.setTopic("/usky/devices/" + deviceUuid + "/controlResponse");
|
|
|
+ controlResponse.setPublisher("普通设备");
|
|
|
+ controlResponse.setSubscriber("物联网平台");
|
|
|
+ controlResponse.setRemarks("普通设备返回给物联网平台的命令响应");
|
|
|
+ responseVOList.add(controlResponse);
|
|
|
+ }else{
|
|
|
+ String gatewayUuid = requestVO.getGatewayUuid();
|
|
|
+ if(categoryType == 2){
|
|
|
+ gatewayUuid = requestVO.getDeviceUuid();
|
|
|
+ }
|
|
|
+
|
|
|
+ DmpTopicResponseVO add = new DmpTopicResponseVO();
|
|
|
+ add.setTopic("/usky/devices/" + gatewayUuid + "/add");
|
|
|
+ add.setPublisher("网关设备");
|
|
|
+ add.setSubscriber("物联网平台");
|
|
|
+ add.setRemarks("网关设备添加子设备");
|
|
|
+ responseVOList.add(add);
|
|
|
+
|
|
|
+ DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
+ info.setTopic("/usky/devices/" + gatewayUuid + "/info");
|
|
|
+ info.setPublisher("网关设备");
|
|
|
+ info.setSubscriber("物联网平台");
|
|
|
+ info.setRemarks("网关设备上报数据");
|
|
|
+ responseVOList.add(info);
|
|
|
+
|
|
|
+ DmpTopicResponseVO control = new DmpTopicResponseVO();
|
|
|
+ control.setTopic("/usky/devices/" + gatewayUuid + "/control");
|
|
|
+ control.setPublisher("物联网平台");
|
|
|
+ control.setSubscriber("网关设备");
|
|
|
+ control.setRemarks("物联网平台给网关设备下发命令");
|
|
|
+ responseVOList.add(control);
|
|
|
+
|
|
|
+ DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
|
|
|
+ controlResponse.setTopic("/usky/devices/" + gatewayUuid + "/controlResponse");
|
|
|
+ controlResponse.setPublisher("网关设备");
|
|
|
+ controlResponse.setSubscriber("物联网平台");
|
|
|
+ controlResponse.setRemarks("网关设备返回给物联网平台的命令响应");
|
|
|
+ responseVOList.add(controlResponse);
|
|
|
+ }
|
|
|
+
|
|
|
+// DmpTopicResponseVO add = new DmpTopicResponseVO();
|
|
|
+// add.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.ADD_REMARKS.getLetter());
|
|
|
+// add.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
+// add.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
+// add.setRemarks(TopicInfo.ADD_REMARKS.getValue());
|
|
|
+// responseVOList.add(add);
|
|
|
+//
|
|
|
+// DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
+// info.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.INFO_REMARKS.getLetter());
|
|
|
+// info.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
+// info.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
+// info.setRemarks(TopicInfo.INFO_REMARKS.getValue());
|
|
|
+// responseVOList.add(info);
|
|
|
+//
|
|
|
+// DmpTopicResponseVO control = new DmpTopicResponseVO();
|
|
|
+// control.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.CONTROL_REMARKS.getLetter());
|
|
|
+// control.setSubscriber(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
+// control.setPublisher(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
+// control.setRemarks(TopicInfo.CONTROL_REMARKS.getValue());
|
|
|
+// responseVOList.add(control);
|
|
|
+//
|
|
|
+// DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
|
|
|
+// controlResponse.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.CONTROL_RESPONSE_REMARKS.getLetter());
|
|
|
+// controlResponse.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
+// controlResponse.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
+// controlResponse.setRemarks(TopicInfo.CONTROL_RESPONSE_REMARKS.getValue());
|
|
|
+// responseVOList.add(controlResponse);
|
|
|
|
|
|
} else {
|
|
|
- switch (topicType) {
|
|
|
- case "add":
|
|
|
+ if(categoryType == 1){
|
|
|
+ switch (topicType) {
|
|
|
+ case "add":
|
|
|
/*if (StringUtils.isBlank(productCode)) {
|
|
|
throw new BusinessException("产品编码“productCode”不能为空!");
|
|
|
} else if (StringUtils.isBlank(deviceId)) {
|
|
@@ -241,44 +313,141 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
String topicPayload = topicPayloadJson.toString();
|
|
|
add.setTopicPayload(topicPayload);
|
|
|
responseVOList.add(add);*/
|
|
|
- break;
|
|
|
- case "info":
|
|
|
- if (StringUtils.isBlank(productCode)) {
|
|
|
+ break;
|
|
|
+ case "info":
|
|
|
+ if (StringUtils.isBlank(productCode)) {
|
|
|
+ throw new BusinessException("产品编码“productCode”不能为空!");
|
|
|
+ } else if (productId == null) {
|
|
|
+ throw new BusinessException("产品ID“productId“不能为空!");
|
|
|
+ } else if (StringUtils.isBlank(deviceId)) {
|
|
|
+ throw new BusinessException("设备编号“deviceId”不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
+ info.setTopic("/usky/devices/" + deviceUuid + "/info");
|
|
|
+ info.setPublisher("普通设备");
|
|
|
+ info.setSubscriber("物联网平台");
|
|
|
+ info.setRemarks("普通设备上报数据");
|
|
|
+
|
|
|
+ // 组装topicPayload
|
|
|
+ JSONObject infoPayloadJson = new JSONObject();
|
|
|
+ infoPayloadJson.put("productCode", productCode);
|
|
|
+ infoPayloadJson.put("deviceUuid", deviceUuid);
|
|
|
+ Long timestamp = System.currentTimeMillis();
|
|
|
+ infoPayloadJson.put("timestamp", timestamp);
|
|
|
+
|
|
|
+ JSONObject metricsJson = new JSONObject();
|
|
|
+ List<DmpProductAttribute> productAttributeList = getProductAttributeList(productId);
|
|
|
+ for (DmpProductAttribute productAttribute : productAttributeList) {
|
|
|
+ metricsJson.put(productAttribute.getAttributeCode(), productAttribute.getMaximum());
|
|
|
+ }
|
|
|
+ infoPayloadJson.put("metrics", metricsJson);
|
|
|
+
|
|
|
+ JSONObject tagsJson = new JSONObject();
|
|
|
+ tagsJson.put("device_id", deviceId);
|
|
|
+ infoPayloadJson.put("tags", tagsJson);
|
|
|
+ String infoPayload = infoPayloadJson.toString();
|
|
|
+ info.setTopicPayload(infoPayload);
|
|
|
+ info.setProductAttributeList(productAttributeList);
|
|
|
+ responseVOList.add(info);
|
|
|
+ break;
|
|
|
+ case "control":
|
|
|
+ /*if (StringUtils.isBlank(deviceUuid)) {
|
|
|
+ throw new BusinessException("设备uuid“deviceUuid“不能为空!");
|
|
|
+ }else if (StringUtils.isBlank(productCode)){
|
|
|
+ throw new BusinessException("产品编码“productCode”不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ DmpTopicResponseVO control = new DmpTopicResponseVO();
|
|
|
+ control.setTopic("/" + deviceUuid + "/" + TopicInfo.CONTROL_REMARKS.getLetter());
|
|
|
+ control.setPublisher(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
+ control.setSubscriber(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
+ control.setRemarks(TopicInfo.CONTROL_REMARKS.getValue());
|
|
|
+
|
|
|
+ // 组装topicPayload
|
|
|
+ JSONObject controlPayloadJson = new JSONObject();
|
|
|
+
|
|
|
+ responseVOList.add(control);*/
|
|
|
+ break;
|
|
|
+ case "controlResponse":
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new BusinessException("topicType参数错误!");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ String gatewayUuid = requestVO.getGatewayUuid();
|
|
|
+ if(categoryType == 2){
|
|
|
+ gatewayUuid = requestVO.getDeviceUuid();
|
|
|
+ }
|
|
|
+ switch (topicType) {
|
|
|
+ case "add":
|
|
|
+ /*if (StringUtils.isBlank(productCode)) {
|
|
|
throw new BusinessException("产品编码“productCode”不能为空!");
|
|
|
- } else if (productId == null) {
|
|
|
- throw new BusinessException("产品ID“productId“不能为空!");
|
|
|
} else if (StringUtils.isBlank(deviceId)) {
|
|
|
throw new BusinessException("设备编号“deviceId”不能为空!");
|
|
|
+ } else if (StringUtils.isBlank(deviceName)) {
|
|
|
+ throw new BusinessException("设备名“deviceName“不能为空!");
|
|
|
}
|
|
|
|
|
|
- DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
- info.setTopic("/" + productCode + "/" + deviceId + "/" + TopicInfo.INFO_REMARKS.getLetter());
|
|
|
- info.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
- info.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
- info.setRemarks(TopicInfo.INFO_REMARKS.getValue());
|
|
|
+ DmpTopicResponseVO add = new DmpTopicResponseVO();
|
|
|
+ add.setTopic("/" + productCode + "/" + deviceId + "/" + TopicInfo.ADD_REMARKS.getLetter());
|
|
|
+ add.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
|
|
|
+ add.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
|
|
|
+ add.setRemarks(TopicInfo.ADD_REMARKS.getValue());
|
|
|
|
|
|
// 组装topicPayload
|
|
|
- JSONObject infoPayloadJson = new JSONObject();
|
|
|
- infoPayloadJson.put("productCode", productCode);
|
|
|
- Long timestamp = System.currentTimeMillis();
|
|
|
- infoPayloadJson.put("timestamp", timestamp);
|
|
|
-
|
|
|
- JSONObject metricsJson = new JSONObject();
|
|
|
- List<DmpProductAttribute> productAttributeList = getProductAttributeList(productId);
|
|
|
- for (DmpProductAttribute productAttribute : productAttributeList) {
|
|
|
- metricsJson.put(productAttribute.getAttributeCode(), productAttribute.getMaximum());
|
|
|
+ JSONObject topicPayloadJson = new JSONObject();
|
|
|
+ topicPayloadJson.put("productCode", productCode);
|
|
|
+ topicPayloadJson.put("deviceId", deviceId);
|
|
|
+ topicPayloadJson.put("deviceName", deviceName);
|
|
|
+ if (!StringUtils.isBlank(simCode)) {
|
|
|
+ topicPayloadJson.put("simCode", simCode);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isBlank(installAddress)) {
|
|
|
+ topicPayloadJson.put("installAddress", installAddress);
|
|
|
}
|
|
|
- infoPayloadJson.put("metrics", metricsJson);
|
|
|
-
|
|
|
- JSONObject tagsJson = new JSONObject();
|
|
|
- tagsJson.put("device_id", deviceId);
|
|
|
- infoPayloadJson.put("tags", tagsJson);
|
|
|
- String infoPayload = infoPayloadJson.toString();
|
|
|
- info.setTopicPayload(infoPayload);
|
|
|
- info.setProductAttributeList(productAttributeList);
|
|
|
- responseVOList.add(info);
|
|
|
- break;
|
|
|
- case "control":
|
|
|
+ String topicPayload = topicPayloadJson.toString();
|
|
|
+ add.setTopicPayload(topicPayload);
|
|
|
+ responseVOList.add(add);*/
|
|
|
+ break;
|
|
|
+ case "info":
|
|
|
+ if (StringUtils.isBlank(productCode)) {
|
|
|
+ throw new BusinessException("产品编码“productCode”不能为空!");
|
|
|
+ } else if (productId == null) {
|
|
|
+ throw new BusinessException("产品ID“productId“不能为空!");
|
|
|
+ } else if (StringUtils.isBlank(deviceId)) {
|
|
|
+ throw new BusinessException("设备编号“deviceId”不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ DmpTopicResponseVO info = new DmpTopicResponseVO();
|
|
|
+ info.setTopic("/usky/devices/" + gatewayUuid + "/info");
|
|
|
+ info.setPublisher("网关设备");
|
|
|
+ info.setSubscriber("物联网平台");
|
|
|
+ info.setRemarks("网关设备上报数据");
|
|
|
+
|
|
|
+ // 组装topicPayload
|
|
|
+ JSONObject infoPayloadJson = new JSONObject();
|
|
|
+ infoPayloadJson.put("productCode", productCode);
|
|
|
+ infoPayloadJson.put("deviceUuid", deviceUuid);
|
|
|
+ Long timestamp = System.currentTimeMillis();
|
|
|
+ infoPayloadJson.put("timestamp", timestamp);
|
|
|
+
|
|
|
+ JSONObject metricsJson = new JSONObject();
|
|
|
+ List<DmpProductAttribute> productAttributeList = getProductAttributeList(productId);
|
|
|
+ for (DmpProductAttribute productAttribute : productAttributeList) {
|
|
|
+ metricsJson.put(productAttribute.getAttributeCode(), productAttribute.getMaximum());
|
|
|
+ }
|
|
|
+ infoPayloadJson.put("metrics", metricsJson);
|
|
|
+
|
|
|
+ JSONObject tagsJson = new JSONObject();
|
|
|
+ tagsJson.put("device_id", deviceId);
|
|
|
+ infoPayloadJson.put("tags", tagsJson);
|
|
|
+ String infoPayload = infoPayloadJson.toString();
|
|
|
+ info.setTopicPayload(infoPayload);
|
|
|
+ info.setProductAttributeList(productAttributeList);
|
|
|
+ responseVOList.add(info);
|
|
|
+ break;
|
|
|
+ case "control":
|
|
|
/*if (StringUtils.isBlank(deviceUuid)) {
|
|
|
throw new BusinessException("设备uuid“deviceUuid“不能为空!");
|
|
|
}else if (StringUtils.isBlank(productCode)){
|
|
@@ -295,11 +464,12 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
JSONObject controlPayloadJson = new JSONObject();
|
|
|
|
|
|
responseVOList.add(control);*/
|
|
|
- break;
|
|
|
- case "controlResponse":
|
|
|
- break;
|
|
|
- default:
|
|
|
- throw new BusinessException("topicType参数错误!");
|
|
|
+ break;
|
|
|
+ case "controlResponse":
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new BusinessException("topicType参数错误!");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -369,7 +539,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
dmpDeviceInfo.setCreatedBy(SecurityUtils.getUsername());
|
|
|
dmpDeviceInfo.setCreatedTime(LocalDateTime.now());
|
|
|
dmpDeviceInfo.setTenantId(SecurityUtils.getTenantId());
|
|
|
-// dmpDeviceInfo.setServiceStatus(1);
|
|
|
+ dmpDeviceInfo.setServiceStatus(1);
|
|
|
if (StringUtils.isBlank(dmpDeviceInfo.getDeviceUuid())) {
|
|
|
dmpDeviceInfo.setDeviceUuid(UUIDUtils.uuid());
|
|
|
}
|
|
@@ -473,7 +643,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
IPage<DmpDeviceInfo> page = new Page<>(pageCurrent, pageSize);
|
|
|
|
|
|
if (diRequest.getDeviceStatus() != null) {
|
|
|
- if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceUuid()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null) {
|
|
|
+ if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceUuid()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null || diRequest.getCategoryType() != null) {
|
|
|
LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()), DmpDeviceInfo::getDeviceId, diRequest.getDeviceId())
|
|
|
.eq(StringUtils.isNotBlank(diRequest.getDeviceUuid()), DmpDeviceInfo::getDeviceUuid, diRequest.getDeviceUuid())
|
|
@@ -481,6 +651,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
.eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
|
|
|
.like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
|
|
|
.eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
|
|
|
+ .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
|
|
|
.eq(DmpDeviceInfo::getDeleteFlag, 0)
|
|
|
.eq(DmpDeviceInfo::getTenantId, SecurityUtils.getTenantId())
|
|
|
.orderByDesc(DmpDeviceInfo::getId);
|
|
@@ -591,6 +762,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
.eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
|
|
|
.like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
|
|
|
.eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
|
|
|
+ .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
|
|
|
.eq(DmpDeviceInfo::getDeleteFlag, 0)
|
|
|
.eq(DmpDeviceInfo::getTenantId, SecurityUtils.getTenantId());
|
|
|
|
|
@@ -668,13 +840,14 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
}
|
|
|
|
|
|
if (diRequest.getDeviceStatus() != null) {
|
|
|
- if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null) {
|
|
|
+ if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null || diRequest.getCategoryType() != null) {
|
|
|
LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()), DmpDeviceInfo::getDeviceId, diRequest.getDeviceId())
|
|
|
.like(StringUtils.isNotBlank(diRequest.getDeviceName()), DmpDeviceInfo::getDeviceName, diRequest.getDeviceName())
|
|
|
.eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
|
|
|
.like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
|
|
|
.eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
|
|
|
+ .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
|
|
|
.eq(DmpDeviceInfo::getDeleteFlag, 0)
|
|
|
.eq(DmpDeviceInfo::getTenantId, tenantId)
|
|
|
.orderByDesc(DmpDeviceInfo::getId);
|
|
@@ -784,6 +957,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
.eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
|
|
|
.like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
|
|
|
.eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
|
|
|
+ .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
|
|
|
.eq(DmpDeviceInfo::getDeleteFlag, 0)
|
|
|
.eq(DmpDeviceInfo::getTenantId, tenantId)
|
|
|
.orderByDesc(DmpDeviceInfo::getId);
|
|
@@ -825,6 +999,18 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageCurrent);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<DmpDeviceInfo> gatewayDeviceList(){
|
|
|
+ LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(DmpDeviceInfo::getCategoryType,2)
|
|
|
+ .eq(DmpDeviceInfo::getDeleteFlag, 0)
|
|
|
+ .eq(DmpDeviceInfo::getTenantId, SecurityUtils.getTenantId())
|
|
|
+ .orderByDesc(DmpDeviceInfo::getId);
|
|
|
+ List<DmpDeviceInfo> list1 = this.list(queryWrapper);
|
|
|
+
|
|
|
+ return list1;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean remove(Integer id) {
|
|
|
DmpDeviceInfo dmpDeviceInfo = this.getById(id);
|