Showing
9 changed files
with
9 additions
and
51 deletions
... | ... | @@ -2,12 +2,8 @@ package org.thingsboard.server.controller.yunteng; |
2 | 2 | |
3 | 3 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; |
4 | 4 | |
5 | -import com.amazonaws.util.json.Jackson; | |
6 | -import com.eclipsesource.json.Json; | |
7 | 5 | import com.fasterxml.jackson.databind.JsonNode; |
8 | 6 | import com.fasterxml.jackson.databind.node.ObjectNode; |
9 | -import com.google.gson.JsonArray; | |
10 | -import com.google.gson.JsonObject; | |
11 | 7 | import io.swagger.annotations.Api; |
12 | 8 | import io.swagger.annotations.ApiOperation; |
13 | 9 | import io.swagger.annotations.ApiParam; |
... | ... | @@ -35,16 +31,12 @@ import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants; |
35 | 31 | import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
36 | 32 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
37 | 33 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
38 | -import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; | |
39 | -import org.thingsboard.server.common.data.yunteng.dto.SelectItemDTO; | |
40 | 34 | import org.thingsboard.server.common.data.yunteng.dto.convert.ConvertConfigDTO; |
41 | 35 | import org.thingsboard.server.common.data.yunteng.dto.convert.ConvertConfigReqDTO; |
42 | 36 | import org.thingsboard.server.common.data.yunteng.dto.convert.ConvertReqDTO; |
43 | -import org.thingsboard.server.common.data.yunteng.enums.DatasourceTypeEnum; | |
44 | 37 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
45 | 38 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
46 | 39 | import org.thingsboard.server.controller.BaseController; |
47 | -import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper; | |
48 | 40 | import org.thingsboard.server.dao.yunteng.service.ConvertConfigService; |
49 | 41 | import org.thingsboard.server.dao.yunteng.service.SceneLinkageService; |
50 | 42 | import org.thingsboard.server.dao.yunteng.service.TkRuleChainService; |
... | ... | @@ -118,27 +110,6 @@ public class TkConvertDataToController extends BaseController { |
118 | 110 | public ResponseEntity<ConvertConfigDTO> createOrUpdateConvertData( |
119 | 111 | @Validated @RequestBody ConvertConfigDTO convertConfigDTO) throws ThingsboardException { |
120 | 112 | convertConfigDTO.setTenantId(getCurrentUser().getCurrentTenantId()); |
121 | - //这里针对普通租户管理员的代码 暂时屏蔽根据后续清空看是否开启或删除 | |
122 | -// if(getCurrentUser().isPtCommonTenant()){ | |
123 | -// convertConfigDTO.setDatasourceType(DatasourceTypeEnum.DEVICES); | |
124 | -// JsonArray convertDevices = new JsonArray(); | |
125 | -// JsonNode productNode = convertConfigDTO.getDatasourceContent().get("convertProducts"); | |
126 | -// List<String> orgIds = commonTenantOrganizationAllIds(); | |
127 | -// for (JsonNode deviceProfileId: productNode ) { | |
128 | -// JsonObject product =new JsonObject(); | |
129 | -// JsonArray devices = new JsonArray(); | |
130 | -// List<DeviceDTO> dto=deviceMapper.findDevicesByProfileIdAndOrganizationId(orgIds,deviceProfileId.asText()); | |
131 | -// if(null!=dto&&dto.size()>0){ | |
132 | -// dto.forEach(device ->{devices.add(device.getTbDeviceId());}); | |
133 | -// product.addProperty("product",deviceProfileId.asText()); | |
134 | -// product.add("devices",devices); | |
135 | -// convertDevices.add(product); | |
136 | -// } | |
137 | -// } | |
138 | -// ObjectNode convertProducts = (ObjectNode) convertConfigDTO.getDatasourceContent(); | |
139 | -// convertProducts.set("convertDevices",JacksonUtil.toJsonNode(convertDevices.toString())); | |
140 | -// convertConfigDTO.setDatasourceContent(convertProducts); | |
141 | -// } | |
142 | 113 | convertConfigDTO.setNodeType(FastIotConstants.CONVERT_DATA); |
143 | 114 | return ResponseEntity.ok(convertConfigService.createOrUpdate(convertConfigDTO)); |
144 | 115 | } | ... | ... |
... | ... | @@ -63,7 +63,6 @@ public class TkDeviceController extends BaseController { |
63 | 63 | private final TkDeviceProfileService ytDeviceProfileService; |
64 | 64 | private final GatewayNotificationsService gatewayNotificationsService; |
65 | 65 | private final TkAlarmInfoService tkAlarmInfoService ; |
66 | - private final TkOrganizationService tkOrganizationService; | |
67 | 66 | |
68 | 67 | |
69 | 68 | @PostMapping("/batch/update") |
... | ... | @@ -71,8 +70,7 @@ public class TkDeviceController extends BaseController { |
71 | 70 | @PreAuthorize( |
72 | 71 | "@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:device:post','api:yt:device:update'})") |
73 | 72 | public ResponseEntity<String> batchUpdateDevice( |
74 | - @Validated(AddGroup.class) @RequestBody List<DeviceDTO> deviceDTO,String orgId) | |
75 | - throws ThingsboardException, ExecutionException, InterruptedException { | |
73 | + @Validated(AddGroup.class) @RequestBody List<DeviceDTO> deviceDTO,String orgId) { | |
76 | 74 | deviceDTO.stream().forEach(i ->{ |
77 | 75 | i.setOrganizationId(orgId); |
78 | 76 | try { | ... | ... |
... | ... | @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiOperation; |
5 | 5 | import lombok.RequiredArgsConstructor; |
6 | 6 | import org.apache.commons.lang3.StringUtils; |
7 | 7 | import org.quartz.SchedulerException; |
8 | -import org.springframework.beans.factory.annotation.Autowired; | |
9 | 8 | import org.springframework.security.access.prepost.PreAuthorize; |
10 | 9 | import org.springframework.validation.annotation.Validated; |
11 | 10 | import org.springframework.web.bind.annotation.*; |
... | ... | @@ -15,7 +14,6 @@ import org.thingsboard.server.common.data.yunteng.common.UpdateGroup; |
15 | 14 | import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
16 | 15 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
17 | 16 | import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO; |
18 | -import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; | |
19 | 17 | import org.thingsboard.server.common.data.yunteng.dto.task.TaskImmediateExecuteDTO; |
20 | 18 | import org.thingsboard.server.common.data.yunteng.dto.task.TkTaskCenterDTO; |
21 | 19 | import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum; |
... | ... | @@ -23,12 +21,8 @@ import org.thingsboard.server.common.data.yunteng.enums.TargetTypeEnum; |
23 | 21 | import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult; |
24 | 22 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
25 | 23 | import org.thingsboard.server.controller.BaseController; |
26 | -import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper; | |
27 | 24 | import org.thingsboard.server.dao.yunteng.service.TkTaskCenterService; |
28 | - | |
29 | -import java.util.ArrayList; | |
30 | 25 | import java.util.HashMap; |
31 | -import java.util.List; | |
32 | 26 | |
33 | 27 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; |
34 | 28 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.ORDER_TYPE; |
... | ... | @@ -39,7 +33,6 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant. |
39 | 33 | @RequiredArgsConstructor |
40 | 34 | public class TkTaskCenterController extends BaseController { |
41 | 35 | private final TkTaskCenterService tkTaskCenterService; |
42 | - @Autowired private DeviceMapper deviceMapper; | |
43 | 36 | |
44 | 37 | @GetMapping( |
45 | 38 | name = "page", | ... | ... |
... | ... | @@ -54,7 +54,6 @@ import java.util.HashMap; |
54 | 54 | import java.util.List; |
55 | 55 | import java.util.Objects; |
56 | 56 | import java.util.UUID; |
57 | -import java.util.stream.Collectors; | |
58 | 57 | |
59 | 58 | import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*; |
60 | 59 | |
... | ... | @@ -247,7 +246,7 @@ public class TkUserController extends AbstractUserAccount { |
247 | 246 | } |
248 | 247 | |
249 | 248 | @PreAuthorize( |
250 | - "@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:user:saveCommonTenant:post'})")//todo | |
249 | + "@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:user:saveCommonTenant:post'})") | |
251 | 250 | @PostMapping("save_common_tenant") |
252 | 251 | public UserDTO saveCommonTenant(@Validated(AddGroup.class) @RequestBody UserDTO userDTO) |
253 | 252 | throws ThingsboardException { | ... | ... |
... | ... | @@ -137,9 +137,8 @@ public enum ErrorMessage { |
137 | 137 | DEVICE_NOT_ONLINE(400111,"设备不在线,无法执行相关操作!"), |
138 | 138 | GBT_VIDEO_REPETITION(400112,"该设备通道号视频已存在!"), |
139 | 139 | SSRC_NO_ENABLED(400113,"未获取到可用的SSRC资源"), |
140 | - TENANT_ERROR(400114,"租户管理员只允许创建一个"), | |
141 | - DEVICE_CENTER_IS_DISABLED(400115,"设备【%s】未被允许执行任务"), | |
142 | - CUSTOMER_USER_UPDATE_ERROR(400116,"已分配设备给该客户,请取消分配后重试"), | |
140 | + DEVICE_CENTER_IS_DISABLED(400114,"设备【%s】未被允许执行任务"), | |
141 | + CUSTOMER_USER_UPDATE_ERROR(400115,"已分配设备给该客户,请取消分配后重试"), | |
143 | 142 | HAVE_NO_PERMISSION(500002,"没有修改权限"), |
144 | 143 | NOT_ALLOED_ISOLATED_IN_MONOLITH(500003,"【monolith】模式下,不能选择【isolated】类型的租户配置"); |
145 | 144 | ... | ... |
... | ... | @@ -60,7 +60,6 @@ public class TkHomePageServiceImpl implements HomePageService { |
60 | 60 | private final EntityService entityService; |
61 | 61 | |
62 | 62 | private final ApiUsageStateService apiUsageStateService; |
63 | - private final ApiUsageStateDao apiUsageStateDao; | |
64 | 63 | |
65 | 64 | /** 查询遥测数据,兼容多种数据库 */ |
66 | 65 | private final TimeseriesService timeseriesService; | ... | ... |
... | ... | @@ -256,7 +256,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
256 | 256 | String templateId, |
257 | 257 | TkOrganizationEntity organization, |
258 | 258 | List<TkAlarmContactEntity> contacts) { |
259 | - // TODO 推送钉钉消息 | |
259 | + // 推送钉钉消息 | |
260 | 260 | SmsReqDTO info = new SmsReqDTO(); |
261 | 261 | info.setId(templateId); |
262 | 262 | info.setParams(setAliAlarmParams(alarmInfo, organization)); |
... | ... | @@ -288,7 +288,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
288 | 288 | String templateId, |
289 | 289 | TkOrganizationEntity organization, |
290 | 290 | List<TkAlarmContactEntity> contacts) { |
291 | - // TODO 推送企业微信通知 | |
291 | + // 推送企业微信通知 | |
292 | 292 | SmsReqDTO info = new SmsReqDTO(); |
293 | 293 | info.setId(templateId); |
294 | 294 | info.setParams(setAliAlarmParams(alarmInfo, organization)); |
... | ... | @@ -320,7 +320,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
320 | 320 | String templateId, |
321 | 321 | TkOrganizationEntity organization, |
322 | 322 | List<TkAlarmContactEntity> contacts) { |
323 | - // TODO 推送微信通知 | |
323 | + // 推送微信通知 | |
324 | 324 | SmsReqDTO info = new SmsReqDTO(); |
325 | 325 | info.setId(templateId); |
326 | 326 | info.setParams(setAliAlarmParams(alarmInfo, organization)); |
... | ... | @@ -349,7 +349,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
349 | 349 | String templateId, |
350 | 350 | TkOrganizationEntity organization, |
351 | 351 | List<TkAlarmContactEntity> contacts) { |
352 | - // TODO 电话通知 | |
352 | + // 电话通知 | |
353 | 353 | SmsReqDTO info = new SmsReqDTO(); |
354 | 354 | info.setId(templateId); |
355 | 355 | info.setParams(setAliAlarmParams(alarmInfo, organization)); | ... | ... |