Commit d401024d1c4e11d4823fade04279d969e3ac0524

Authored by 黄 x
1 parent 2fbc7bd3

fix: thingsModel service/event TSL and renamed class

Showing 100 changed files with 353 additions and 350 deletions

Too many changes to show.

To preserve performance only 100 of 125 files are displayed.

... ... @@ -48,7 +48,7 @@ import org.thingsboard.server.common.data.id.EntityId;
48 48 import org.thingsboard.server.common.data.id.EntityIdFactory;
49 49 import org.thingsboard.server.common.data.page.PageData;
50 50 import org.thingsboard.server.common.data.page.TimePageLink;
51   -import org.thingsboard.server.dao.yunteng.service.YtDeviceService;
  51 +import org.thingsboard.server.dao.yunteng.service.TkDeviceService;
52 52 import org.thingsboard.server.queue.util.TbCoreComponent;
53 53 import org.thingsboard.server.service.security.permission.Operation;
54 54 import org.thingsboard.server.service.security.permission.Resource;
... ... @@ -91,7 +91,7 @@ public class AlarmController extends BaseController {
91 91 private static final String ALARM_QUERY_FETCH_ORIGINATOR_DESCRIPTION = "A boolean value to specify if the alarm originator name will be " +
92 92 "filled in the AlarmInfo object field: 'originatorName' or will returns as null.";
93 93
94   - private final YtDeviceService ytDeviceService;
  94 + private final TkDeviceService ytDeviceService;
95 95
96 96 @ApiOperation(value = "Get Alarm (getAlarmById)",
97 97 notes = "Fetch the Alarm object based on the provided Alarm Id. " + ALARM_SECURITY_CHECK, produces = MediaType.APPLICATION_JSON_VALUE)
... ...
... ... @@ -22,7 +22,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
22 22 import org.thingsboard.server.controller.BaseController;
23 23 import org.thingsboard.server.dao.util.yunteng.CronUtils;
24 24 import org.thingsboard.server.dao.util.yunteng.ScheduleUtils;
25   -import org.thingsboard.server.dao.yunteng.service.YtSysJobService;
  25 +import org.thingsboard.server.dao.yunteng.service.TkSysJobService;
26 26
27 27 import java.util.HashMap;
28 28 import java.util.List;
... ... @@ -37,7 +37,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
37 37 @Api(tags = {"定时任务"})
38 38 @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})")
39 39 public class SysJobController extends BaseController {
40   - private final YtSysJobService jobService;
  40 + private final TkSysJobService jobService;
41 41
42 42 @GetMapping(
43 43 path = "/page",
... ...
... ... @@ -3,7 +3,6 @@ package org.thingsboard.server.controller.yunteng;
3 3 import io.swagger.annotations.Api;
4 4 import io.swagger.annotations.ApiOperation;
5 5 import lombok.RequiredArgsConstructor;
6   -import org.apache.commons.lang3.StringUtils;
7 6 import org.quartz.SchedulerException;
8 7 import org.springframework.security.access.prepost.PreAuthorize;
9 8 import org.springframework.web.bind.annotation.*;
... ... @@ -14,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
14 13 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
15 14 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 15 import org.thingsboard.server.controller.BaseController;
17   -import org.thingsboard.server.dao.yunteng.service.YtSysJobLogService;
  16 +import org.thingsboard.server.dao.yunteng.service.TkSysJobLogService;
18 17
19 18 import java.util.HashMap;
20 19
... ... @@ -32,7 +31,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
32 31 @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})")
33 32 public class SysJobLogController extends BaseController {
34 33
35   - private final YtSysJobLogService ytSysJobLogService;
  34 + private final TkSysJobLogService tkSysJobLogService;
36 35
37 36 @GetMapping(
38 37 path = "/page",
... ... @@ -59,26 +58,26 @@ public class SysJobLogController extends BaseController {
59 58 if (orderType != null) {
60 59 queryMap.put(ORDER_TYPE, orderType.name());
61 60 }
62   - return ytSysJobLogService.sysJobLogPageByJobId(queryMap);
  61 + return tkSysJobLogService.sysJobLogPageByJobId(queryMap);
63 62 }
64 63
65 64 @DeleteMapping
66 65 @ApiOperation(value = "删除定时任务")
67 66 public ResponseResult<Boolean> deleteSysJobLog(@RequestBody DeleteDTO deleteDTO)
68 67 throws SchedulerException {
69   - return ResponseResult.success(ytSysJobLogService.deleteSysJobLog(deleteDTO));
  68 + return ResponseResult.success(tkSysJobLogService.deleteSysJobLog(deleteDTO));
70 69 }
71 70
72 71 @GetMapping("/get/{jobId}/{id}")
73 72 @ApiOperation(value = "获取详情")
74 73 public ResponseResult<SysJobLogDTO> getSysJobLog(@PathVariable("jobId") String jobId,@PathVariable("id") String id)
75 74 throws SchedulerException {
76   - return ResponseResult.success(ytSysJobLogService.findSysJobLogById(jobId,id));
  75 + return ResponseResult.success(tkSysJobLogService.findSysJobLogById(jobId,id));
77 76 }
78 77
79 78 @PostMapping("/clean")
80 79 @ApiOperation(value = "清空调度日志")
81 80 public ResponseResult<Boolean> clean() {
82   - return ResponseResult.success(ytSysJobLogService.cleanJobLog());
  81 + return ResponseResult.success(tkSysJobLogService.cleanJobLog());
83 82 }
84 83 }
... ...
... ... @@ -23,9 +23,10 @@ import org.thingsboard.server.common.data.yunteng.enums.StatusEnum;
23 23 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
24 24 import org.thingsboard.server.controller.BaseController;
25 25 import org.thingsboard.server.dao.yunteng.service.ThingsModelService;
26   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
  26 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
27 27
28 28 import java.util.HashMap;
  29 +import java.util.List;
29 30
30 31 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
31 32 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.ORDER_TYPE;
... ... @@ -36,7 +37,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
36 37 @Api(tags = {"物模型管理"})
37 38 public class ThingsModelController extends BaseController {
38 39 private final ThingsModelService thingsModelService;
39   - private final YtDeviceProfileService ytDeviceProfileService;
  40 + private final TkDeviceProfileService tkDeviceProfileService;
40 41
41 42 @GetMapping(
42 43 path = "/page",
... ... @@ -51,7 +52,7 @@ public class ThingsModelController extends BaseController {
51 52 @RequestParam(value = ORDER_FILED, required = false) String orderBy,
52 53 @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType)
53 54 throws ThingsboardException {
54   - if(StringUtils.isEmpty(deviceProfileId)){
  55 + if (StringUtils.isEmpty(deviceProfileId)) {
55 56 throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
56 57 }
57 58 HashMap<String, Object> queryMap = new HashMap<>();
... ... @@ -109,11 +110,12 @@ public class ThingsModelController extends BaseController {
109 110 }
110 111
111 112 @PutMapping("/{deviceProfileId}")
  113 + // @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{'api:yt:things_model:release'})")
112 114 @ApiOperation("物模型发布")
113 115 public ResponseEntity<Boolean> releaseTSL(@PathVariable("deviceProfileId") String deviceProfileId)
114 116 throws ThingsboardException {
115 117 String tenantId = getCurrentUser().getCurrentTenantId();
116   - DeviceProfileDTO dto = ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
  118 + DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
117 119 if (null == dto) {
118 120 throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
119 121 }
... ... @@ -122,11 +124,25 @@ public class ThingsModelController extends BaseController {
122 124 deviceProfileId, tenantId, StatusEnum.ENABLE.getIndex()));
123 125 }
124 126
  127 + @GetMapping("/get_services/{deviceProfileId}")
  128 + @ApiOperation("获取产品服务")
  129 + public ResponseEntity<List<ThingsModelDTO>> getServices(
  130 + @PathVariable("deviceProfileId") String deviceProfileId) throws ThingsboardException {
  131 + String tenantId = getCurrentUser().getCurrentTenantId();
  132 + DeviceProfileDTO dto = tkDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
  133 + if (null == dto) {
  134 + throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
  135 + }
  136 + return ResponseEntity.ok(
  137 + thingsModelService.selectByDeviceProfileId(
  138 + FunctionTypeEnum.services, tenantId, deviceProfileId));
  139 + }
  140 +
125 141 private ThingsModelDTO saveOrUpdate(ThingsModelDTO thingsModelDTO) throws ThingsboardException {
126 142
127 143 String tenantId = getCurrentUser().getCurrentTenantId();
128 144 DeviceProfileDTO deviceProfileDTO =
129   - ytDeviceProfileService.findDeviceProfileById(tenantId, thingsModelDTO.getDeviceProfileId());
  145 + tkDeviceProfileService.findDeviceProfileById(tenantId, thingsModelDTO.getDeviceProfileId());
130 146 if (null == deviceProfileDTO) {
131 147 throw new YtDataValidationException(ErrorMessage.NOT_BELONG_CURRENT_TENANT.getMessage());
132 148 }
... ...
... ... @@ -31,8 +31,8 @@ import org.thingsboard.server.controller.BaseController;
31 31 import org.thingsboard.server.dao.tenant.TenantService;
32 32 import org.thingsboard.server.dao.user.UserService;
33 33 import org.thingsboard.server.dao.yunteng.service.MenuService;
34   -import org.thingsboard.server.dao.yunteng.service.YtTenantService;
35   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  34 +import org.thingsboard.server.dao.yunteng.service.TkTenantService;
  35 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
36 36 import org.thingsboard.server.service.install.InstallScripts;
37 37 import org.thingsboard.server.service.security.permission.Operation;
38 38
... ... @@ -51,9 +51,9 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
51 51 @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{})")
52 52 public class YtAdminController extends BaseController {
53 53
54   - private final YtTenantService ytTenantService;
  54 + private final TkTenantService tkTenantService;
55 55 private final MenuService menuService;
56   - private final YtUserService userService;
  56 + private final TkUserService userService;
57 57 private final TenantService tenantService;
58 58 private final InstallScripts installScripts;
59 59 private final UserService tbUserService;
... ... @@ -62,7 +62,7 @@ public class YtAdminController extends BaseController {
62 62 @Deprecated
63 63 @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN'},{'api:yt:admin:tenant:post'})")
64 64 public ResponseEntity<TenantDTO> saveTenant(@RequestBody TenantReqDTO tenantReqDTO) {
65   - TenantDTO newTenant = ytTenantService.createNewTenant(tenantReqDTO);
  65 + TenantDTO newTenant = tkTenantService.createNewTenant(tenantReqDTO);
66 66 URI location =
67 67 ServletUriComponentsBuilder.fromCurrentRequest()
68 68 .path("/tenant/getById/{id}")
... ... @@ -88,7 +88,7 @@ public class YtAdminController extends BaseController {
88 88 queryMap.put(ORDER_TYPE, orderType.name());
89 89 }
90 90 queryMap.put("tenantName", tenantName);
91   - return ytTenantService.page(queryMap);
  91 + return tkTenantService.page(queryMap);
92 92 }
93 93
94 94 @PutMapping("/tenant")
... ... @@ -96,13 +96,13 @@ public class YtAdminController extends BaseController {
96 96 public TenantDTO updateTenant(@RequestBody TenantDTO tenantDTO) {
97 97 Assert.notNull(tenantDTO, "tenant cannot be null");
98 98 Assert.notNull(tenantDTO.getId(), "tenant id cannot be null when update");
99   - return ytTenantService.updateTenant(tenantDTO);
  99 + return tkTenantService.updateTenant(tenantDTO);
100 100 }
101 101
102 102 @GetMapping("/tenant/roles/{tenantId}")
103 103 public ResponseEntity<List<String>> getTenantRolesByTenantId(
104 104 @PathVariable("tenantId") String tenantId) {
105   - return ResponseEntity.ok(ytTenantService.getTenantRolesByTenantId(tenantId));
  105 + return ResponseEntity.ok(tkTenantService.getTenantRolesByTenantId(tenantId));
106 106 }
107 107
108 108 @DeleteMapping("/tenant")
... ... @@ -114,7 +114,7 @@ public class YtAdminController extends BaseController {
114 114 .getIds()
115 115 .forEach(
116 116 id -> {
117   - ytTenantService
  117 + tkTenantService
118 118 .findById(id)
119 119 .ifPresent(
120 120 tenantDTO -> {
... ... @@ -125,7 +125,7 @@ public class YtAdminController extends BaseController {
125 125 }
126 126 });
127 127 });
128   - ytTenantService.deleteTenants(
  128 + tkTenantService.deleteTenants(
129 129 deleteDTO.getIds().toArray(new String[deleteDTO.getIds().size()]));
130 130 }
131 131
... ... @@ -149,7 +149,7 @@ public class YtAdminController extends BaseController {
149 149
150 150 @GetMapping("/tenant/getById/{id}")
151 151 public ResponseEntity<TenantDTO> getTenant(@PathVariable("id") String id) {
152   - return ResponseEntity.of(ytTenantService.findById(id));
  152 + return ResponseEntity.of(tkTenantService.findById(id));
153 153 }
154 154
155 155 @PostMapping("/tenant/adminUser")
... ... @@ -205,7 +205,7 @@ public class YtAdminController extends BaseController {
205 205 @Validated(UpdateGroup.class) @RequestBody TenantReqDTO tenantReqDTO)
206 206 throws ThingsboardException {
207 207 updateOrSaveTenant(tenantReqDTO);
208   - return ytTenantService.updateOrCreateTenant(tenantReqDTO);
  208 + return tkTenantService.updateOrCreateTenant(tenantReqDTO);
209 209 }
210 210
211 211 private void deleteTenantAdmin(String strUserId) throws ThingsboardException {
... ...
... ... @@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.yunteng.dto.AlarmProfileDTO;
20 20 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
21 21 import org.thingsboard.server.controller.BaseController;
22 22 import org.thingsboard.server.dao.yunteng.service.AlarmProfileService;
23   -import org.thingsboard.server.dao.yunteng.service.YtAlarmContactService;
  23 +import org.thingsboard.server.dao.yunteng.service.TkAlarmContactService;
24 24
25 25 import java.net.URI;
26 26 import java.util.HashMap;
... ... @@ -40,7 +40,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
40 40 @RequiredArgsConstructor
41 41 @Api(tags = "告警联系人")
42 42 public class YtAlarmContactController extends BaseController {
43   - private final YtAlarmContactService alarmService;
  43 + private final TkAlarmContactService alarmService;
44 44 private final AlarmProfileService alarmProfileService;
45 45
46 46 @ApiOperation(value = "新增联系人|编辑")
... ...
... ... @@ -19,7 +19,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
19 19 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
20 20 import org.thingsboard.server.controller.BaseController;
21 21 import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity;
22   -import org.thingsboard.server.dao.yunteng.service.YtAlarmInfoService;
  22 +import org.thingsboard.server.dao.yunteng.service.TkAlarmInfoService;
23 23
24 24 import java.util.HashMap;
25 25 import java.util.List;
... ... @@ -39,7 +39,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
39 39 @Api(tags = "告警中心")
40 40 public class YtAlarmInfoController extends BaseController {
41 41
42   - private final YtAlarmInfoService alarmInfoService;
  42 + private final TkAlarmInfoService alarmInfoService;
43 43
44 44
45 45 //分页测试通过
... ...
... ... @@ -8,7 +8,7 @@ import org.springframework.security.authentication.BadCredentialsException;
8 8 import org.springframework.util.Assert;
9 9 import org.springframework.web.bind.annotation.*;
10 10 import org.thingsboard.server.common.data.yunteng.dto.AlarmInfoDTO;
11   -import org.thingsboard.server.dao.yunteng.service.YtNoticeService;
  11 +import org.thingsboard.server.dao.yunteng.service.TkNoticeService;
12 12 import org.thingsboard.server.service.security.exception.JwtExpiredTokenException;
13 13
14 14 import java.net.InetAddress;
... ... @@ -31,7 +31,7 @@ import java.net.InetAddress;
31 31 @Deprecated
32 32 public class YtAlarmNoticeController {
33 33
34   - private final YtNoticeService service;
  34 + private final TkNoticeService service;
35 35
36 36 @PostMapping("/alert/{alarmProfileId}")
37 37 public void alertNotice(@RequestParam(value = "token", required = true) String token,
... ...
... ... @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationConte
18 18 import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
19 19 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
20 20 import org.thingsboard.server.controller.BaseController;
21   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationCenterService;
  21 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationCenterService;
22 22
23 23 import java.util.HashMap;
24 24
... ... @@ -31,7 +31,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
31 31 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
32 32 public class YtConfigurationCenterController extends BaseController {
33 33
34   - private final YtConfigurationCenterService ytConfigurationCenterService;
  34 + private final TkConfigurationCenterService ytConfigurationCenterService;
35 35
36 36 @GetMapping(params = {PAGE_SIZE, PAGE})
37 37 @ApiOperation("分页")
... ...
... ... @@ -4,7 +4,6 @@ import io.swagger.annotations.Api;
4 4 import io.swagger.annotations.ApiOperation;
5 5 import lombok.RequiredArgsConstructor;
6 6 import org.springframework.http.ResponseEntity;
7   -import org.springframework.security.access.prepost.PreAuthorize;
8 7 import org.springframework.validation.annotation.Validated;
9 8 import org.springframework.web.bind.annotation.*;
10 9 import org.thingsboard.server.common.data.exception.ThingsboardException;
... ... @@ -15,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationContentDTO;
15 14 import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO;
16 15 import org.thingsboard.server.common.data.yunteng.dto.request.ConfigurationContentInfoDTO;
17 16 import org.thingsboard.server.controller.BaseController;
18   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationContentService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationContentService;
19 18
20 19 @RestController
21 20 @RequestMapping("/api/yt/configuration/content")
... ... @@ -23,7 +22,7 @@ import org.thingsboard.server.dao.yunteng.service.YtConfigurationContentService;
23 22 @Api(tags = "组态内容")
24 23 public class YtConfigurationContentController extends BaseController {
25 24
26   - private final YtConfigurationContentService ytConfigurationContentService;
  25 + private final TkConfigurationContentService ytConfigurationContentService;
27 26
28 27 @PostMapping
29 28 @ApiOperation("新增")
... ...
... ... @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiOperation;
5 5 import io.swagger.annotations.ApiParam;
6 6 import lombok.RequiredArgsConstructor;
7 7 import org.springframework.http.ResponseEntity;
8   -import org.springframework.security.access.prepost.PreAuthorize;
9 8 import org.springframework.validation.annotation.Validated;
10 9 import org.springframework.web.bind.annotation.*;
11 10 import org.thingsboard.server.common.data.exception.ThingsboardException;
... ... @@ -13,9 +12,9 @@ import org.thingsboard.server.common.data.yunteng.common.AddGroup;
13 12 import org.thingsboard.server.common.data.yunteng.dto.*;
14 13 import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil;
15 14 import org.thingsboard.server.controller.BaseController;
16   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationActService;
17   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationDatasourceService;
18   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationEventService;
  15 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationActService;
  16 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationDatasourceService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationEventService;
19 18
20 19 import java.util.List;
21 20 import java.util.Optional;
... ... @@ -29,9 +28,9 @@ import java.util.Optional;
29 28 @Api(tags = "组态结点管理")
30 29 public class YtConfigurationNodeController extends BaseController {
31 30
32   - private final YtConfigurationDatasourceService datasourceService;
33   - private final YtConfigurationEventService eventService;
34   - private final YtConfigurationActService actService;
  31 + private final TkConfigurationDatasourceService datasourceService;
  32 + private final TkConfigurationEventService eventService;
  33 + private final TkConfigurationActService actService;
35 34
36 35 @PostMapping
37 36 @ApiOperation("保存节点数据源并刷新节点的交互和动效信息")
... ...
... ... @@ -33,7 +33,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
33 33 import org.thingsboard.server.controller.BaseController;
34 34 import org.thingsboard.server.dao.yunteng.service.ConvertConfigService;
35 35 import org.thingsboard.server.dao.yunteng.service.SceneLinkageService;
36   -import org.thingsboard.server.dao.yunteng.service.YtRuleChainService;
  36 +import org.thingsboard.server.dao.yunteng.service.TkRuleChainService;
37 37 import org.thingsboard.server.service.rule.TbRuleChainService;
38 38 import org.thingsboard.server.service.security.permission.Operation;
39 39
... ... @@ -48,7 +48,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
48 48 @Api(tags = {"数据流转控制器"})
49 49 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{})")
50 50 public class YtConvertDataToController extends BaseController {
51   - private final YtRuleChainService ytRuleChainService;
  51 + private final TkRuleChainService tkRuleChainService;
52 52
53 53 @Value("${actors.rule.chain.debug_mode_rate_limits_per_tenant.enabled}")
54 54 private boolean debugPerTenantEnabled;
... ... @@ -225,7 +225,7 @@ public class YtConvertDataToController extends BaseController {
225 225 boolean needSaveRuleNode;
226 226 TenantId tenantId = getTenantId();
227 227 // 1. GET DEFAULT RULE CHAIN
228   - RuleChain ruleChain = ytRuleChainService.getRootTenantRuleChain(getTenantId());
  228 + RuleChain ruleChain = tkRuleChainService.getRootTenantRuleChain(getTenantId());
229 229 // 2. GET RULE CHAIN METADATA
230 230 RuleChainMetaData ruleChainMetaData =
231 231 ruleChainService.loadRuleChainMetaData(getTenantId(), ruleChain.getId());
... ...
... ... @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
21 21 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
22 22 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
23 23 import org.thingsboard.server.controller.BaseController;
24   -import org.thingsboard.server.dao.yunteng.service.YtDataBoardService;
  24 +import org.thingsboard.server.dao.yunteng.service.TkDataBoardService;
25 25
26 26 import java.util.HashMap;
27 27 import java.util.List;
... ... @@ -35,7 +35,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
35 35 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
36 36 @Api(tags = {"数据看板"})
37 37 public class YtDataBoardController extends BaseController {
38   - private final YtDataBoardService ytDataBoardService;
  38 + private final TkDataBoardService ytDataBoardService;
39 39
40 40 @GetMapping(params = {PAGE_SIZE, PAGE})
41 41 @ApiOperation("分页查询")
... ...
... ... @@ -22,8 +22,8 @@ import org.thingsboard.server.common.data.yunteng.dto.board.ComponentLayoutDTO;
22 22 import org.thingsboard.server.common.data.yunteng.dto.board.MoreDataComponentInfoDTO;
23 23 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
24 24 import org.thingsboard.server.controller.BaseController;
25   -import org.thingsboard.server.dao.yunteng.service.YtDataBoardService;
26   -import org.thingsboard.server.dao.yunteng.service.YtDataComponentService;
  25 +import org.thingsboard.server.dao.yunteng.service.TkDataBoardService;
  26 +import org.thingsboard.server.dao.yunteng.service.TkDataComponentService;
27 27
28 28 import java.util.ArrayList;
29 29 import java.util.List;
... ... @@ -34,8 +34,8 @@ import java.util.List;
34 34 @RequestMapping("api/yt/data_component")
35 35 @Api(tags = {"数据组件"})
36 36 public class YtDataComponentController extends BaseController {
37   - private final YtDataComponentService ytDataComponentService;
38   - private final YtDataBoardService ytDataBoardService;
  37 + private final TkDataComponentService ytDataComponentService;
  38 + private final TkDataBoardService ytDataBoardService;
39 39
40 40 @GetMapping("/{boardId}")
41 41 @ApiOperation(value = "查询看板下的所有组件信息")
... ...
... ... @@ -36,8 +36,8 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
36 36 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
37 37 import org.thingsboard.server.controller.BaseController;
38 38 import org.thingsboard.server.dao.device.DeviceService;
39   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
40   -import org.thingsboard.server.dao.yunteng.service.YtDeviceService;
  39 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
  40 +import org.thingsboard.server.dao.yunteng.service.TkDeviceService;
41 41 import org.thingsboard.server.service.security.permission.Operation;
42 42 import org.thingsboard.server.service.security.permission.Resource;
43 43
... ... @@ -54,10 +54,10 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
54 54 @Api(tags = {"设备管理"})
55 55 @Slf4j
56 56 public class YtDeviceController extends BaseController {
57   - private final YtDeviceService deviceService;
  57 + private final TkDeviceService deviceService;
58 58 private final DeviceService tbDeviceService;
59 59 private final ObjectMapper objectMapper;
60   - private final YtDeviceProfileService ytDeviceProfileService;
  60 + private final TkDeviceProfileService ytDeviceProfileService;
61 61
62 62 @PostMapping
63 63 @ApiOperation("创建|编辑")
... ...
... ... @@ -31,8 +31,8 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
31 31 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
32 32 import org.thingsboard.server.common.msg.queue.ServiceQueue;
33 33 import org.thingsboard.server.controller.BaseController;
34   -import org.thingsboard.server.dao.yunteng.service.YtDeviceScriptService;
35   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
  34 +import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService;
  35 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
36 36 import org.thingsboard.server.service.security.permission.Operation;
37 37
38 38 import java.time.LocalDateTime;
... ... @@ -48,8 +48,8 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
48 48 @RequestMapping("api/yt/device_profile")
49 49 @Api(tags = {"设备配置管理"})
50 50 public class YtDeviceProfileController extends BaseController {
51   - private final YtDeviceProfileService ytDeviceProfileService;
52   - private final YtDeviceScriptService javaScriptService;
  51 + private final TkDeviceProfileService ytDeviceProfileService;
  52 + private final TkDeviceScriptService javaScriptService;
53 53
54 54 @PostMapping()
55 55 @PreAuthorize(
... ...
... ... @@ -41,8 +41,8 @@ import org.thingsboard.server.common.msg.queue.ServiceQueue;
41 41 import org.thingsboard.server.common.yunteng.script.YtScriptInvokeService;
42 42 import org.thingsboard.server.common.yunteng.script.YtScriptType;
43 43 import org.thingsboard.server.controller.BaseController;
44   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
45   -import org.thingsboard.server.dao.yunteng.service.YtDeviceScriptService;
  44 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
  45 +import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService;
46 46
47 47 import java.time.LocalDateTime;
48 48 import java.time.ZoneOffset;
... ... @@ -60,8 +60,8 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
60 60 public class YtDeviceScriptController extends BaseController {
61 61 private static final JsonParser parser = new JsonParser();
62 62 private static final ObjectMapper objectMapper = new ObjectMapper();
63   - private final YtDeviceScriptService scriptService;
64   - private final YtDeviceProfileService ytDeviceProfileService;
  63 + private final TkDeviceScriptService scriptService;
  64 + private final TkDeviceProfileService ytDeviceProfileService;
65 65 private final YtScriptInvokeService jsEngine;
66 66
67 67 @PostMapping()
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO;
16 16 import org.thingsboard.server.common.data.yunteng.dto.DeviceTypeDTO;
17 17 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
18 18 import org.thingsboard.server.controller.BaseController;
19   -import org.thingsboard.server.dao.yunteng.service.YtDeviceTypeService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkDeviceTypeService;
20 20
21 21 import java.util.List;
22 22
... ... @@ -25,7 +25,7 @@ import java.util.List;
25 25 @RequiredArgsConstructor
26 26 @Api(value = "设备类型")
27 27 public class YtDeviceTypeController extends BaseController {
28   - private final YtDeviceTypeService deviceTypeService;
  28 + private final TkDeviceTypeService deviceTypeService;
29 29
30 30 @GetMapping
31 31 @ApiOperation(value = "获取当前用户的设备类型树形")
... ...
... ... @@ -7,7 +7,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
7 7 import org.springframework.web.bind.annotation.*;
8 8 import org.thingsboard.server.common.data.exception.ThingsboardException;
9 9 import org.thingsboard.server.common.data.yunteng.dto.FrpInfoDTO;
10   -import org.thingsboard.server.dao.yunteng.service.YtFrpInfoService;
  10 +import org.thingsboard.server.dao.yunteng.service.TkFrpInfoService;
11 11
12 12 @RestController
13 13 @RequestMapping("api/yt/frp")
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.dao.yunteng.service.YtFrpInfoService;
16 16 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
17 17 public class YtFrpInfoController {
18 18
19   - private final YtFrpInfoService frpInfoService;
  19 + private final TkFrpInfoService frpInfoService;
20 20
21 21 @GetMapping("/{proxyName}")
22 22 @ApiOperation("通过代理名称或SN获取内网穿透信息")
... ...
... ... @@ -10,7 +10,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
10 10 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
11 11 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
12 12 import org.thingsboard.server.controller.BaseController;
13   -import org.thingsboard.server.dao.yunteng.service.YtMailLogService;
  13 +import org.thingsboard.server.dao.yunteng.service.TkMailLogService;
14 14
15 15 import java.util.HashMap;
16 16
... ... @@ -21,7 +21,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
21 21 @RequiredArgsConstructor
22 22 public class YtMailLogController extends BaseController {
23 23
24   - private final YtMailLogService mailLogService;
  24 + private final TkMailLogService mailLogService;
25 25
26 26 @GetMapping(params = {PAGE_SIZE, PAGE})
27 27 public YtPageData<MailLogDTO> pageMessageConfig(
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
16 16 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
17 17 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
18 18 import org.thingsboard.server.controller.BaseController;
19   -import org.thingsboard.server.dao.yunteng.service.YtMessageConfigService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkMessageConfigService;
20 20
21 21 import java.util.HashMap;
22 22 import java.util.List;
... ... @@ -28,7 +28,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
28 28 @RequiredArgsConstructor
29 29 public class YtMessageConfigController extends BaseController {
30 30
31   - private final YtMessageConfigService messageConfigService;
  31 + private final TkMessageConfigService messageConfigService;
32 32
33 33 @GetMapping(params = {PAGE_SIZE, PAGE})
34 34 public YtPageData<MessageConfigDTO> pageMessageConfig(
... ...
... ... @@ -22,9 +22,9 @@ import org.thingsboard.server.common.data.yunteng.enums.ResponseCodeEnum;
22 22 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
23 23 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
24 24 import org.thingsboard.server.controller.BaseController;
25   -import org.thingsboard.server.dao.yunteng.service.YtMailService;
26   -import org.thingsboard.server.dao.yunteng.service.YtMessageTemplateService;
27   -import org.thingsboard.server.dao.yunteng.service.YtSmsService;
  25 +import org.thingsboard.server.dao.yunteng.service.TkMailService;
  26 +import org.thingsboard.server.dao.yunteng.service.TkMessageTemplateService;
  27 +import org.thingsboard.server.dao.yunteng.service.TkSmsService;
28 28
29 29 import java.util.HashMap;
30 30
... ... @@ -35,11 +35,11 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
35 35 @RequiredArgsConstructor
36 36 public class YtMessageTemplateController extends BaseController {
37 37
38   - private final YtMessageTemplateService messageTemplateService;
  38 + private final TkMessageTemplateService messageTemplateService;
39 39
40   - private final YtSmsService smsService;
  40 + private final TkSmsService smsService;
41 41
42   - private final YtMailService mailService;
  42 + private final TkMailService mailService;
43 43
44 44 @GetMapping(params = {PAGE_SIZE, PAGE})
45 45 public YtPageData<MessageTemplateDTO> pageMessageTemplate(
... ...
... ... @@ -33,11 +33,11 @@ import static org.thingsboard.server.common.data.yunteng.constant.FastIotConstan
33 33 @RequiredArgsConstructor
34 34 public class YtNoAuthController{
35 35
36   - private final YtSmsService smsService;
37   - private final YtUserService userService;
38   - private final YtFrpInfoService frpInfoService;
39   - private final YtDataComponentService ytDataComponentService;
40   - private final YtDataBoardService ytDataBoardService;
  36 + private final TkSmsService smsService;
  37 + private final TkUserService userService;
  38 + private final TkFrpInfoService frpInfoService;
  39 + private final TkDataComponentService ytDataComponentService;
  40 + private final TkDataBoardService ytDataBoardService;
41 41
42 42 @PostMapping("/send_login_code/{phoneNumber}")
43 43 public boolean sendVerificationCode(@PathVariable("phoneNumber") String phoneNumber) {
... ...
... ... @@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
15 15 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.controller.BaseController;
17 17 import org.thingsboard.server.dao.yunteng.entities.TkOpinionEntity;
18   -import org.thingsboard.server.dao.yunteng.service.YtOpinionService;
  18 +import org.thingsboard.server.dao.yunteng.service.TkOpinionService;
19 19
20 20 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
21 21
... ... @@ -25,7 +25,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
25 25 @RequiredArgsConstructor
26 26 public class YtOpinionController extends BaseController {
27 27
28   - private final YtOpinionService opinionService;
  28 + private final TkOpinionService opinionService;
29 29
30 30 @GetMapping(params = {PAGE_SIZE, PAGE})
31 31 @ApiOperation("分页")
... ...
... ... @@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.common.UpdateGroup;
15 15 import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO;
16 16 import org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO;
17 17 import org.thingsboard.server.controller.BaseController;
18   -import org.thingsboard.server.dao.yunteng.service.YtOrganizationService;
  18 +import org.thingsboard.server.dao.yunteng.service.TkOrganizationService;
19 19
20 20 import java.net.URI;
21 21 import java.util.List;
... ... @@ -27,7 +27,7 @@ import java.util.Optional;
27 27 @RequiredArgsConstructor
28 28 public class YtOrganizationController extends BaseController {
29 29
30   - private final YtOrganizationService organizationService;
  30 + private final TkOrganizationService organizationService;
31 31
32 32 @PostMapping
33 33 @PreAuthorize("@check.checkPermissions({},{'api:yt:organization:post'})")
... ...
... ... @@ -21,7 +21,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
21 21 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
22 22 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
23 23 import org.thingsboard.server.controller.BaseController;
24   -import org.thingsboard.server.dao.yunteng.service.YtReportFormConfigService;
  24 +import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService;
25 25
26 26 import java.sql.Timestamp;
27 27 import java.util.HashMap;
... ... @@ -36,7 +36,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
36 36 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
37 37 public class YtReportFormConfigController extends BaseController {
38 38
39   - private final YtReportFormConfigService reportFormConfigService;
  39 + private final TkReportFormConfigService reportFormConfigService;
40 40
41 41 @GetMapping(params = {PAGE_SIZE, PAGE})
42 42 @ApiOperation("分页")
... ...
... ... @@ -22,8 +22,8 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
22 22 import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
23 23 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
24 24 import org.thingsboard.server.controller.BaseController;
25   -import org.thingsboard.server.dao.yunteng.service.YtReportFormConfigService;
26   -import org.thingsboard.server.dao.yunteng.service.YtReportGenerateRecordService;
  25 +import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService;
  26 +import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService;
27 27
28 28 import java.sql.Timestamp;
29 29 import java.util.ArrayList;
... ... @@ -40,8 +40,8 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
40 40 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
41 41 public class YtReportGenerateRecordController extends BaseController {
42 42
43   - private final YtReportGenerateRecordService reportFormGenerateRecordService;
44   - private final YtReportFormConfigService ytReportFormConfigService;
  43 + private final TkReportGenerateRecordService reportFormGenerateRecordService;
  44 + private final TkReportFormConfigService tkReportFormConfigService;
45 45
46 46 @GetMapping(params = {PAGE_SIZE, PAGE})
47 47 @ApiOperation("分页")
... ... @@ -104,7 +104,7 @@ public class YtReportGenerateRecordController extends BaseController {
104 104 JacksonUtil.convertValue(
105 105 json.get(FastIotConstants.CHART_EXECUTE_CONDITION), QueryConditionDTO.class);
106 106 List<ExecuteAttributesDTO> list = new ArrayList<>();
107   - ytReportFormConfigService.getExecuteConditionAndAttribute(
  107 + tkReportFormConfigService.getExecuteConditionAndAttribute(
108 108 json.get(FastIotConstants.CHART_EXECUTE_ATTRIBUTES), list);
109 109
110 110 map.put(FastIotConstants.CHART_EXECUTE_CONDITION, queryConditionDTO);
... ...
... ... @@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
15 15 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.controller.BaseController;
17 17 import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity;
18   -import org.thingsboard.server.dao.yunteng.service.YtRpcRecordService;
  18 +import org.thingsboard.server.dao.yunteng.service.TkRpcRecordService;
19 19
20 20 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
21 21
... ... @@ -27,7 +27,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
27 27 @Api(tags = {"命令下发记录"})
28 28 @RequiredArgsConstructor
29 29 public class YtRpcRecordController extends BaseController {
30   - private final YtRpcRecordService recordService;
  30 + private final TkRpcRecordService recordService;
31 31
32 32 @GetMapping(params = {PAGE_SIZE, PAGE})
33 33 @ApiOperation("分页")
... ...
... ... @@ -11,14 +11,14 @@ import org.thingsboard.server.common.data.exception.ThingsboardException;
11 11 import org.thingsboard.server.common.data.id.TenantId;
12 12 import org.thingsboard.server.common.data.rule.RuleChainType;
13 13 import org.thingsboard.server.controller.BaseController;
14   -import org.thingsboard.server.dao.yunteng.service.YtRuleChainService;
  14 +import org.thingsboard.server.dao.yunteng.service.TkRuleChainService;
15 15
16 16 @RestController
17 17 @RequiredArgsConstructor
18 18 @RequestMapping("api/yt/rule_chain")
19 19 @Api(tags = {"规则链管理"})
20 20 public class YtRuleChainController extends BaseController {
21   - private final YtRuleChainService chainService;
  21 + private final TkRuleChainService chainService;
22 22
23 23
24 24
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.controller.BaseController;
17 17 import org.thingsboard.server.dao.model.ModelConstants;
18 18 import org.thingsboard.server.dao.yunteng.entities.SysLogEntity;
19   -import org.thingsboard.server.dao.yunteng.service.YtSysLogService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkSysLogService;
20 20
21 21 import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.*;
22 22
... ... @@ -26,7 +26,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
26 26 @RequiredArgsConstructor
27 27 public class YtSyslogController extends BaseController {
28 28
29   - private final YtSysLogService logService;
  29 + private final TkSysLogService logService;
30 30
31 31 @GetMapping("{entityId}")
32 32 @PreAuthorize("@check.checkPermissions({},{})")
... ...
... ... @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.UserDTO;
14 14 import org.thingsboard.server.common.data.yunteng.dto.request.SendResetPasswordEmailMsg;
15 15 import org.thingsboard.server.common.data.yunteng.enums.MessageTypeEnum;
16 16 import org.thingsboard.server.dao.user.UserService;
17   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
18 18 import org.thingsboard.server.service.security.model.SecurityUser;
19 19 import org.thingsboard.server.service.security.system.SystemSecurityService;
20 20
... ... @@ -24,12 +24,12 @@ import java.util.UUID;
24 24 @RequestMapping("/api/yt/tenant")
25 25 public class YtTenantController extends AbstractUserAccount {
26 26
27   - private final YtUserService userService;
  27 + private final TkUserService userService;
28 28 private final AccountProperties accountProperties;
29 29 public YtTenantController(UserService tbUserService, ApplicationEventPublisher eventPublisher,
30 30 SystemSecurityService systemSecurityService,
31 31 BCryptPasswordEncoder passwordEncoder,
32   - YtUserService userService,
  32 + TkUserService userService,
33 33 AccountProperties accountProperties) {
34 34 super(tbUserService,eventPublisher,systemSecurityService,passwordEncoder);
35 35 this.userService = userService;
... ...
... ... @@ -24,8 +24,8 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
24 24 import org.thingsboard.server.controller.BaseController;
25 25 import org.thingsboard.server.dao.exception.DataValidationException;
26 26 import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity;
27   -import org.thingsboard.server.dao.yunteng.service.YtThirdPlatformService;
28   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  27 +import org.thingsboard.server.dao.yunteng.service.TkThirdPlatformService;
  28 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
29 29 import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository;
30 30 import org.thingsboard.server.service.security.auth.yunteng.YtLoginResponse;
31 31 import org.thingsboard.server.service.security.model.SecurityUser;
... ... @@ -48,8 +48,8 @@ public class YtThirdPlatformController extends BaseController {
48 48
49 49 private final JwtTokenFactory tokenFactory;
50 50 private final RefreshTokenRepository refreshTokenRepository;
51   - private final YtThirdPlatformService thirdService;
52   - private final YtUserService ytUserService;
  51 + private final TkThirdPlatformService thirdService;
  52 + private final TkUserService tkUserService;
53 53
54 54 @GetMapping(params = {PAGE_SIZE, PAGE})
55 55 @ApiOperation("分页")
... ... @@ -105,7 +105,7 @@ public class YtThirdPlatformController extends BaseController {
105 105 @ApiOperation("组态用户认证")
106 106 public YtLoginResponse unionidLogin(@PathVariable("userId") String userId)
107 107 throws ThingsboardException {
108   - UserDTO userDto = ytUserService.findUserInfoById(userId);
  108 + UserDTO userDto = tkUserService.findUserInfoById(userId);
109 109 if (userDto == null) {
110 110 return new YtLoginResponse().setThirdUserId(userId);
111 111 }
... ... @@ -121,7 +121,7 @@ public class YtThirdPlatformController extends BaseController {
121 121 if(!authrizeKey.equals(dto.getAuthrizeKey()) || !authrizeSecret.equals(dto.getAuthrizeSecret())){
122 122 throw new DataValidationException( ErrorMessage.NO_PERMISSION.getMessage());
123 123 }
124   - UserDTO userDto = ytUserService.accountExist(dto.getUserName());
  124 + UserDTO userDto = tkUserService.accountExist(dto.getUserName());
125 125 if (userDto == null) {
126 126 return new YtLoginResponse().setThirdUserId(dto.getAuthrizeKey());
127 127 }
... ... @@ -135,7 +135,7 @@ public class YtThirdPlatformController extends BaseController {
135 135 if (userDto != null && StringUtils.isNotEmpty(userDto.getTbUser())) {
136 136 UserId userId = new UserId(UUID.fromString(userDto.getTbUser()));
137 137 User user = userService.findUserById(null, userId);
138   - List<UserDetailsDTO> userDetailsDTOS = ytUserService.findUserDetailsByUsername(userDto.getUsername(),userDto.getTenantId());
  138 + List<UserDetailsDTO> userDetailsDTOS = tkUserService.findUserDetailsByUsername(userDto.getUsername(),userDto.getTenantId());
139 139 user.setUserDetailsDTO(userDetailsDTOS.get(0));
140 140 UserCredentials credentials = userService.findUserCredentialsByUserId(user.getTenantId(), userId);
141 141 String email = user.getEmail();
... ...
... ... @@ -40,7 +40,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
40 40 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
41 41 import org.thingsboard.server.dao.user.UserService;
42 42 import org.thingsboard.server.dao.yunteng.entities.SysUserEntity;
43   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  43 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
44 44 import org.thingsboard.server.service.security.model.SecurityUser;
45 45 import org.thingsboard.server.service.security.permission.Operation;
46 46 import org.thingsboard.server.service.security.permission.Resource;
... ... @@ -59,12 +59,12 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
59 59 @Api(value = "用户接口")
60 60 public class YtUserController extends AbstractUserAccount {
61 61
62   - private final YtUserService userService;
  62 + private final TkUserService userService;
63 63 private final AccountProperties accountProperties;
64 64 public YtUserController(UserService tbUserService, ApplicationEventPublisher eventPublisher,
65 65 SystemSecurityService systemSecurityService,
66 66 BCryptPasswordEncoder passwordEncoder,
67   - YtUserService userService,
  67 + TkUserService userService,
68 68 AccountProperties accountProperties) {
69 69 super(tbUserService,eventPublisher,systemSecurityService,passwordEncoder);
70 70 this.userService = userService;
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.ResponseResult;
16 16 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
17 17 import org.thingsboard.server.controller.BaseController;
18 18 import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity;
19   -import org.thingsboard.server.dao.yunteng.service.YtVideoService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkVideoService;
20 20
21 21 import java.util.HashMap;
22 22 import java.util.Map;
... ... @@ -30,7 +30,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
30 30 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
31 31 public class YtVideoController extends BaseController {
32 32
33   - private final YtVideoService videoService;
  33 + private final TkVideoService videoService;
34 34
35 35 @GetMapping(params = {PAGE_SIZE, PAGE})
36 36 @ApiOperation("分页")
... ...
... ... @@ -15,7 +15,7 @@ import org.thingsboard.server.common.data.yunteng.enums.OrderTypeEnum;
15 15 import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.controller.BaseController;
17 17 import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity;
18   -import org.thingsboard.server.dao.yunteng.service.YtVideoPlatformService;
  18 +import org.thingsboard.server.dao.yunteng.service.TkVideoPlatformService;
19 19
20 20 import java.util.List;
21 21
... ... @@ -28,7 +28,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
28 28 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{})")
29 29 public class YtVideoPlatformController extends BaseController {
30 30
31   - private final YtVideoPlatformService videoPlatformService;
  31 + private final TkVideoPlatformService videoPlatformService;
32 32
33 33 @GetMapping(params = {PAGE_SIZE, PAGE})
34 34 @ApiOperation("分页")
... ...
... ... @@ -16,7 +16,6 @@
16 16 package org.thingsboard.server.service.security.auth.jwt;
17 17
18 18 import lombok.RequiredArgsConstructor;
19   -import org.springframework.beans.factory.annotation.Autowired;
20 19 import org.springframework.security.authentication.AuthenticationProvider;
21 20 import org.springframework.security.authentication.BadCredentialsException;
22 21 import org.springframework.security.authentication.CredentialsExpiredException;
... ... @@ -34,11 +33,10 @@ import org.thingsboard.server.common.data.id.EntityId;
34 33 import org.thingsboard.server.common.data.id.TenantId;
35 34 import org.thingsboard.server.common.data.id.UserId;
36 35 import org.thingsboard.server.common.data.security.Authority;
37   -import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants;
38 36 import org.thingsboard.server.common.data.yunteng.core.utils.AccountProperties;
39 37 import org.thingsboard.server.common.data.yunteng.dto.UserDTO;
40 38 import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO;
41   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  39 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
42 40 import org.thingsboard.server.service.security.auth.RefreshAuthenticationToken;
43 41 import org.thingsboard.server.service.security.auth.TokenOutdatingService;
44 42 import org.thingsboard.server.service.security.model.SecurityUser;
... ... @@ -59,7 +57,7 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide
59 57 private final UserService userService;
60 58 private final CustomerService customerService;
61 59 private final TokenOutdatingService tokenOutdatingService;
62   - private final YtUserService ytUserService;
  60 + private final TkUserService tkUserService;
63 61 private final AccountProperties accountProperties;
64 62
65 63 @Override
... ... @@ -107,7 +105,7 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide
107 105
108 106 UserPrincipal userPrincipal = new UserPrincipal(UserPrincipal.Type.USER_NAME, user.getEmail());
109 107 String userName = user.getEmail().indexOf("@") != -1 ?user.getEmail().split("@")[0]:user.getEmail();
110   - List<UserDetailsDTO> userDetailsDTOS = ytUserService.findUserDetailsByUsername(userName,
  108 + List<UserDetailsDTO> userDetailsDTOS = tkUserService.findUserDetailsByUsername(userName,
111 109 user.getTenantId().getId().toString());
112 110 user.setUserDetailsDTO(null != userDetailsDTOS && userDetailsDTOS.size()>0 ? userDetailsDTOS.get(0):null);
113 111 securityUser = new SecurityUser(user, userCredentials.isEnabled(), userPrincipal);
... ... @@ -116,7 +114,7 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide
116 114 }
117 115
118 116 private SecurityUser authenticateByPlatFormUserId(UserId userId){
119   - UserDTO userDTO =ytUserService.findUserInfoById(userId.getId().toString());
  117 + UserDTO userDTO = tkUserService.findUserInfoById(userId.getId().toString());
120 118 if(null != userDTO){
121 119 String email = userDTO.getUsername() + "@" +accountProperties.getEmailSuffix();
122 120 UserPrincipal userPrincipal = new UserPrincipal(UserPrincipal.Type.USER_NAME, email);
... ... @@ -125,7 +123,7 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide
125 123 user.setTenantId(TenantId.fromUUID(EntityId.NULL_UUID));
126 124 user.setId(userId);
127 125 user.setEmail(email);
128   - List<UserDetailsDTO> userDetailsDTOS = ytUserService.findUserDetailsByUsername(userDTO.getUsername(),
  126 + List<UserDetailsDTO> userDetailsDTOS = tkUserService.findUserDetailsByUsername(userDTO.getUsername(),
129 127 user.getTenantId().getId().toString());
130 128 user.setUserDetailsDTO(null != userDetailsDTOS && userDetailsDTOS.size()>0 ? userDetailsDTOS.get(0):null);
131 129 SecurityUser securityUser = new SecurityUser(user, true, userPrincipal);
... ...
... ... @@ -49,7 +49,7 @@ import org.thingsboard.server.service.security.model.SecurityUser;
49 49 import org.thingsboard.server.service.security.model.UserPrincipal;
50 50 import org.thingsboard.server.service.security.system.SystemSecurityService;
51 51 import org.thingsboard.server.dao.user.UserService;
52   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  52 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
53 53 import ua_parser.Client;
54 54
55 55 import java.time.LocalDateTime;
... ... @@ -279,12 +279,12 @@ public class RestAuthenticationProvider implements AuthenticationProvider {
279 279 device);
280 280 }
281 281
282   - @Autowired private YtUserService ytUserService;
  282 + @Autowired private TkUserService tkUserService;
283 283 @Autowired private CacheUtils cacheUtils;
284 284 @Autowired private PasswordEncoder passwordEncoder;
285 285
286 286 private Optional<UserDetailsDTO> ytUserDetailsByUserName(String username, String password) {
287   - List<UserDetailsDTO> users = ytUserService.findUserDetailsByUsername(username,null);
  287 + List<UserDetailsDTO> users = tkUserService.findUserDetailsByUsername(username,null);
288 288
289 289 if (users.isEmpty()) {
290 290 throw new UsernameNotFoundException("User not found: " + username);
... ... @@ -304,7 +304,7 @@ public class RestAuthenticationProvider implements AuthenticationProvider {
304 304
305 305 private Authentication ytUserDetailsByPhone(
306 306 Authentication authentication, UserPrincipal userPrincipal, String phoneNumber, String code) {
307   - List<UserDetailsDTO> users = ytUserService.getUserByPhoneNumber(phoneNumber);
  307 + List<UserDetailsDTO> users = tkUserService.getUserByPhoneNumber(phoneNumber);
308 308 if (users.isEmpty()) {
309 309 throw new UsernameNotFoundException("phone number not found: " + phoneNumber);
310 310 }
... ...
... ... @@ -75,7 +75,7 @@ import org.thingsboard.server.dao.device.provision.ProvisionResponse;
75 75 import org.thingsboard.server.dao.ota.OtaPackageService;
76 76 import org.thingsboard.server.dao.relation.RelationService;
77 77 import org.thingsboard.server.dao.tenant.TbTenantProfileCache;
78   -import org.thingsboard.server.dao.yunteng.service.YtDeviceService;
  78 +import org.thingsboard.server.dao.yunteng.service.TkDeviceService;
79 79 import org.thingsboard.server.gen.transport.TransportProtos;
80 80 import org.thingsboard.server.gen.transport.TransportProtos.DeviceInfoProto;
81 81 import org.thingsboard.server.gen.transport.TransportProtos.GetDeviceCredentialsRequestMsg;
... ... @@ -127,7 +127,7 @@ public class DefaultTransportApiService implements TransportApiService {
127 127 private final TbTenantProfileCache tenantProfileCache;
128 128 private final TbApiUsageStateService apiUsageStateService;
129 129 private final DeviceService deviceService;
130   - private final YtDeviceService ytDeviceService;
  130 + private final TkDeviceService ytDeviceService;
131 131 private final RelationService relationService;
132 132 private final DeviceCredentialsService deviceCredentialsService;
133 133 private final DbCallbackExecutorService dbCallbackExecutorService;
... ...
... ... @@ -10,7 +10,4 @@ public class BaseModelDTO {
10 10
11 11 @ApiModelProperty("标识符")
12 12 private String identifier;
13   -
14   - @ApiModelProperty("备注")
15   - private String remark;
16 13 }
... ...
... ... @@ -5,13 +5,14 @@ import io.swagger.annotations.ApiModel;
5 5 import io.swagger.annotations.ApiModelProperty;
6 6 import lombok.Data;
7 7 import lombok.EqualsAndHashCode;
  8 +import org.thingsboard.server.common.data.yunteng.enums.DeviceEventTypeEnum;
8 9
9 10 @EqualsAndHashCode(callSuper = true)
10 11 @Data
11 12 @ApiModel("事件模型")
12 13 public class EventModelDTO extends BaseModelDTO {
13   - @ApiModelProperty("时间类型:0 信息 1告警 2故障")
14   - private Integer type;
  14 + @ApiModelProperty("时间类型:INFO信息 ALERT告警 ERROR故障")
  15 + private DeviceEventTypeEnum eventType;
15 16
16 17 @ApiModelProperty("输出参数")
17 18 private JsonNode outputData;
... ...
... ... @@ -5,13 +5,14 @@ import io.swagger.annotations.ApiModel;
5 5 import io.swagger.annotations.ApiModelProperty;
6 6 import lombok.Data;
7 7 import lombok.EqualsAndHashCode;
  8 +import org.thingsboard.server.common.data.yunteng.enums.CallTypeEnum;
8 9
9 10 @EqualsAndHashCode(callSuper = true)
10 11 @Data
11 12 @ApiModel("服务模型")
12 13 public class ServiceModelDTO extends BaseModelDTO {
13   - @ApiModelProperty("调用方式:0 同步 1异步")
14   - private Integer method;
  14 + @ApiModelProperty("调用方式:sync同步 async异步")
  15 + private CallTypeEnum callType;
15 16
16 17 @ApiModelProperty("输入参数")
17 18 private JsonNode inputData;
... ...
  1 +package org.thingsboard.server.common.data.yunteng.utils;
  2 +
  3 +import java.time.LocalDateTime;
  4 +import java.time.OffsetDateTime;
  5 +import java.time.format.DateTimeFormatter;
  6 +
  7 +/**
  8 + * @version V1.0 @Description : 1.其它地方抛出异常,交由控制层统一处理 2.服务层注意持久化的事务管理 @Dependency: 依赖包 @Author:
  9 + * junlianglee @Date Created in 2021/12/28$ @Copyright 2016-2018 - Powered By 李唐源研发中心
  10 + */
  11 +public class DateTimeUtils {
  12 + public static final String PATTERN_DATE_FORMATE = "yyyy-MM-dd HH:mm:ss";
  13 +
  14 + public static String format(Long nacosTime) {
  15 + if (nacosTime == null) {
  16 + return null;
  17 + }
  18 + LocalDateTime createTime =
  19 + LocalDateTime.ofEpochSecond(nacosTime / 1000, 0, OffsetDateTime.now().getOffset());
  20 + return createTime.format(DateTimeFormatter.ofPattern(PATTERN_DATE_FORMATE));
  21 + }
  22 +}
... ...
1   -package org.thingsboard.server.common.data.yunteng.utils;
2   -
3   -import javax.servlet.http.HttpServletRequest;
4   -
5   -public class RequestUtils {
6   - public static String getClientIpAddr(HttpServletRequest request) {
7   - String ip = request.getHeader("X-Forwarded-For");
8   - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
9   - ip = request.getHeader("Proxy-Client-IP");
10   - }
11   - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
12   - ip = request.getHeader("WL-Proxy-Client-IP");
13   - }
14   - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
15   - ip = request.getHeader("HTTP_CLIENT_IP");
16   - }
17   - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
18   - ip = request.getHeader("HTTP_X_FORWARDED_FOR");
19   - }
20   - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
21   - ip = request.getRemoteAddr();
22   - }
23   - return ip;
24   - }
25   -}
1   -package org.thingsboard.server.common.data.yunteng.utils;
2   -
3   -import java.time.LocalDateTime;
4   -import java.time.OffsetDateTime;
5   -import java.time.format.DateTimeFormatter;
6   -
7   -/**
8   - * @version V1.0
9   - * @Description :
10   - * 1.其它地方抛出异常,交由控制层统一处理
11   - * 2.服务层注意持久化的事务管理
12   - * @Dependency: 依赖包
13   - * @Author: junlianglee
14   - * @Date Created in 2021/12/28$
15   - * @Copyright 2016-2018 - Powered By 李唐源研发中心
16   - */
17   -public class YtDateTimeUtils {
18   - public static final String PATTERN_DATE_FORMATE="yyyy-MM-dd HH:mm:ss";
19   -
20   - public static String formate(Long nacosTime) {
21   - if(nacosTime == null){
22   - return null;
23   - }
24   - LocalDateTime createTime = LocalDateTime.ofEpochSecond(nacosTime/1000,0, OffsetDateTime.now().getOffset());
25   - return createTime.format(DateTimeFormatter.ofPattern(PATTERN_DATE_FORMATE));
26   - }
27   -
28   -}
... ... @@ -45,7 +45,7 @@ import org.thingsboard.server.dao.service.Validator;
45 45 import org.thingsboard.server.dao.usagerecord.ApiUsageStateService;
46 46 import org.thingsboard.server.dao.user.UserService;
47 47 import org.thingsboard.server.dao.widget.WidgetsBundleService;
48   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
  48 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
49 49
50 50 import static org.thingsboard.server.dao.service.Validator.validateId;
51 51
... ... @@ -104,7 +104,7 @@ public class TenantServiceImpl extends AbstractEntityService implements TenantSe
104 104 @Autowired
105 105 private DataValidator<Tenant> tenantValidator;
106 106 @Autowired
107   - private YtDeviceProfileService ytDeviceProfileService;
  107 + private TkDeviceProfileService ytDeviceProfileService;
108 108 @Override
109 109 public Tenant findTenantById(TenantId tenantId) {
110 110 log.trace("Executing findTenantById [{}]", tenantId);
... ...
... ... @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.enums.StatusEnum;
13 13 import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils;
14 14 import org.thingsboard.server.dao.yunteng.entities.SysJobEntity;
15 15 import org.thingsboard.server.dao.yunteng.entities.SysJobLogEntity;
16   -import org.thingsboard.server.dao.yunteng.service.YtSysJobLogService;
  16 +import org.thingsboard.server.dao.yunteng.service.TkSysJobLogService;
17 17
18 18 import java.time.LocalDateTime;
19 19 import java.time.ZoneOffset;
... ... @@ -74,7 +74,7 @@ public abstract class AbstractQuartzJob implements Job {
74 74 }
75 75
76 76 // 写入数据库当中
77   - SpringBeanUtils.getBean(YtSysJobLogService.class)
  77 + SpringBeanUtils.getBean(TkSysJobLogService.class)
78 78 .saveOrUpdateSysJobLog(sysJobLog.getDTO(SysJobLogDTO.class));
79 79 }
80 80
... ...
... ... @@ -6,8 +6,8 @@ import org.thingsboard.server.common.data.yunteng.dto.ReportGenerateRecordDTO;
6 6 import org.thingsboard.server.common.data.yunteng.enums.JobGroupEnum;
7 7 import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils;
8 8 import org.thingsboard.server.dao.yunteng.entities.SysJobEntity;
9   -import org.thingsboard.server.dao.yunteng.service.YtReportFormConfigService;
10   -import org.thingsboard.server.dao.yunteng.service.YtReportGenerateRecordService;
  9 +import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService;
  10 +import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService;
11 11
12 12 import java.lang.reflect.InvocationTargetException;
13 13 import java.lang.reflect.Method;
... ... @@ -30,10 +30,10 @@ public class JobInvokeUtil {
30 30 && sysJob.getJobGroup().equals(JobGroupEnum.REPORT.toString())) {
31 31 // 写入报表生成记录
32 32 ReportFormConfigDTO formConfigDTO =
33   - SpringBeanUtils.getBean(YtReportFormConfigService.class)
  33 + SpringBeanUtils.getBean(TkReportFormConfigService.class)
34 34 .findReportFormConfigById(sysJob.getSourceId(), sysJob.getTenantId());
35 35 ReportGenerateRecordDTO dto =
36   - SpringBeanUtils.getBean(YtReportGenerateRecordService.class)
  36 + SpringBeanUtils.getBean(TkReportGenerateRecordService.class)
37 37 .generateReportRecord(formConfigDTO, sysJob.getId());
38 38 reportGenerateRecordId = dto.getId();
39 39 }
... ...
... ... @@ -6,17 +6,17 @@ import org.springframework.stereotype.Component;
6 6 import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants;
7 7 import org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO;
8 8 import org.thingsboard.server.common.data.yunteng.dto.request.ExecuteAttributesDTO;
9   -import org.thingsboard.server.dao.yunteng.service.YtReportFormConfigService;
10   -import org.thingsboard.server.dao.yunteng.service.YtReportGenerateRecordService;
  9 +import org.thingsboard.server.dao.yunteng.service.TkReportFormConfigService;
  10 +import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService;
11 11 import java.util.*;
12 12
13 13 @Component("reportTask")
14 14 @RequiredArgsConstructor
15 15 @Slf4j
16 16 public class ReportTask {
17   - private final YtReportFormConfigService ytReportFormConfigService;
  17 + private final TkReportFormConfigService tkReportFormConfigService;
18 18
19   - private final YtReportGenerateRecordService ytReportGenerateRecordService;
  19 + private final TkReportGenerateRecordService tkReportGenerateRecordService;
20 20
21 21 public void multipleParams(String s, Boolean b, Long l, Double d, Integer i) {
22 22 System.out.println("执行多参方法: s=" + s + "b=" + b + "l=" + l + "d" + d + "i=" + i);
... ... @@ -33,7 +33,7 @@ public class ReportTask {
33 33
34 34 public void generateReport(String reportId, String reportGenerateRecordId) {
35 35 ReportFormConfigDTO formConfigDTO =
36   - ytReportFormConfigService.findReportFormConfigById(reportId);
  36 + tkReportFormConfigService.findReportFormConfigById(reportId);
37 37 // 关联设备
38 38 List<ExecuteAttributesDTO> dtoList = formConfigDTO.getExecuteAttributes();
39 39 if (!dtoList.isEmpty()) {
... ... @@ -61,7 +61,7 @@ public class ReportTask {
61 61 ExecuteAttributesDTO dto,
62 62 String reportGenerateRecordId,
63 63 int surplus) {
64   - ytReportGenerateRecordService.generateExcelUpdateReportRecord(
  64 + tkReportGenerateRecordService.generateExcelUpdateReportRecord(
65 65 formConfigDTO, dto, reportGenerateRecordId, surplus);
66 66 }
67 67 }
... ...
... ... @@ -4,13 +4,11 @@ import com.baomidou.mybatisplus.annotation.TableField;
4 4 import com.baomidou.mybatisplus.annotation.TableId;
5 5 import com.baomidou.mybatisplus.annotation.TableName;
6 6 import com.fasterxml.jackson.databind.JsonNode;
7   -import io.swagger.annotations.ApiModelProperty;
8 7 import lombok.Data;
9 8 import org.thingsboard.server.common.data.alarm.AlarmSeverity;
10 9 import org.thingsboard.server.common.data.alarm.AlarmStatus;
11   -import org.thingsboard.server.common.data.yunteng.utils.YtDateTimeUtils;
  10 +import org.thingsboard.server.common.data.yunteng.utils.DateTimeUtils;
12 11
13   -import javax.validation.constraints.NotEmpty;
14 12 import java.util.UUID;
15 13
16 14 import static org.thingsboard.server.dao.model.ModelConstants.ALARM_COLUMN_FAMILY_NAME;
... ... @@ -84,26 +82,26 @@ public class TkAlarmEntity {
84 82 private String organizationName;
85 83
86 84 public String getStartTs() {
87   - return YtDateTimeUtils.formate(this.startTs);
  85 + return DateTimeUtils.format(this.startTs);
88 86 }
89 87
90 88 public String getEndTs() {
91   - return YtDateTimeUtils.formate(this.endTs);
  89 + return DateTimeUtils.format(this.endTs);
92 90 }
93 91
94 92 public String getAckTs() {
95   - return YtDateTimeUtils.formate(this.ackTs);
  93 + return DateTimeUtils.format(this.ackTs);
96 94 }
97 95
98 96 public String getClearTs() {
99   - return YtDateTimeUtils.formate(this.clearTs);
  97 + return DateTimeUtils.format(this.clearTs);
100 98 }
101 99
102 100 public String getCreatedTime() {
103   - return YtDateTimeUtils.formate(this.createdTime);
  101 + return DateTimeUtils.format(this.createdTime);
104 102 }
105 103
106 104 public String getUpdatedTime() {
107   - return YtDateTimeUtils.formate(this.updatedTime);
  105 + return DateTimeUtils.format(this.updatedTime);
108 106 }
109 107 }
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.dao.yunteng.entities.SysJobLogEntity;
17 17 import org.thingsboard.server.dao.yunteng.mapper.SysJobLogMapper;
18 18 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
19   -import org.thingsboard.server.dao.yunteng.service.YtSysJobLogService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkSysJobLogService;
20 20 import java.util.Map;
21 21 import java.util.Optional;
22 22
... ... @@ -25,7 +25,7 @@ import java.util.Optional;
25 25 @RequiredArgsConstructor
26 26 @Slf4j
27 27 public class SysJobLogServiceImpl extends AbstractBaseService<SysJobLogMapper, SysJobLogEntity>
28   - implements YtSysJobLogService {
  28 + implements TkSysJobLogService {
29 29
30 30 @Override
31 31 public YtPageData<SysJobLogDTO> sysJobLogPageByJobId(Map<String, Object> queryMap) {
... ...
... ... @@ -26,7 +26,7 @@ import java.util.*;
26 26 @Service
27 27 @RequiredArgsConstructor
28 28 public class SysJobServiceImpl extends AbstractBaseService<SysJobMapper, SysJobEntity>
29   - implements YtSysJobService {
  29 + implements TkSysJobService {
30 30 private final Scheduler scheduler;
31 31
32 32 /** 项目启动时,初始化定时器 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据) */
... ...
... ... @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
11 11 import org.thingsboard.server.dao.yunteng.entities.SysLogEntity;
12 12 import org.thingsboard.server.dao.yunteng.mapper.SysLogMapper;
13 13 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
14   -import org.thingsboard.server.dao.yunteng.service.YtSysLogService;
  14 +import org.thingsboard.server.dao.yunteng.service.TkSysLogService;
15 15
16 16 import java.util.ArrayList;
17 17 import java.util.List;
... ... @@ -20,7 +20,7 @@ import java.util.List;
20 20 @Service
21 21 @RequiredArgsConstructor
22 22 public class SysLogServiceImpl extends AbstractBaseService<SysLogMapper, SysLogEntity>
23   - implements YtSysLogService {
  23 + implements TkSysLogService {
24 24
25 25
26 26 @Override
... ...
... ... @@ -58,7 +58,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.ModelConstants
58 58 @Slf4j
59 59 @RequiredArgsConstructor
60 60 public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserEntity>
61   - implements YtUserService {
  61 + implements TkUserService {
62 62
63 63 private final AdminSettingMapper adminSettingMapper;
64 64 private final ObjectMapper mapper;
... ... @@ -67,9 +67,9 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE
67 67 private final UserRoleMapper userRoleMapper;
68 68 private final TenantRoleMapper tenantRoleMapper;
69 69
70   - private final YtSmsService ytSmsService;
71   - private final YtMessageTemplateService messageTemplateService;
72   - private final YtOrganizationService organizationService;
  70 + private final TkSmsService tkSmsService;
  71 + private final TkMessageTemplateService messageTemplateService;
  72 + private final TkOrganizationService organizationService;
73 73 private final UserOrganizationMappingService userOrganizationMappingService;
74 74 private final SceneLinkageService sceneLinkageService;
75 75 private final SceneLinkageMapper sceneLinkageMapper;
... ... @@ -544,7 +544,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE
544 544 params.put("code", accountProperties.getDefaultPassword());
545 545 smsReqDTO.setParams(params);
546 546 smsReqDTO.setTemplatePurpose(messageTemplateDTO.getTemplatePurpose());
547   - ytSmsService.sendSms(smsReqDTO);
  547 + tkSmsService.sendSms(smsReqDTO);
548 548 }
549 549 }
550 550
... ...
... ... @@ -6,14 +6,13 @@ import com.fasterxml.jackson.databind.JsonNode;
6 6 import com.fasterxml.jackson.databind.node.ObjectNode;
7 7 import lombok.RequiredArgsConstructor;
8 8 import org.apache.commons.lang3.StringUtils;
  9 +import org.springframework.beans.BeanUtils;
9 10 import org.springframework.stereotype.Service;
10 11 import org.springframework.transaction.annotation.Transactional;
11 12 import org.thingsboard.server.common.data.yunteng.constant.FastIotConstants;
12 13 import org.thingsboard.server.common.data.yunteng.core.exception.YtDataValidationException;
13 14 import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage;
14   -import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO;
15   -import org.thingsboard.server.common.data.yunteng.dto.DeviceProfileDTO;
16   -import org.thingsboard.server.common.data.yunteng.dto.ThingsModelDTO;
  15 +import org.thingsboard.server.common.data.yunteng.dto.*;
17 16 import org.thingsboard.server.common.data.yunteng.enums.DataTypeEnum;
18 17 import org.thingsboard.server.common.data.yunteng.enums.DeviceTypeEnum;
19 18 import org.thingsboard.server.common.data.yunteng.enums.FunctionTypeEnum;
... ... @@ -24,7 +23,7 @@ import org.thingsboard.server.dao.yunteng.entities.TkThingsModelEntity;
24 23 import org.thingsboard.server.dao.yunteng.mapper.ThingsModelMapper;
25 24 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
26 25 import org.thingsboard.server.dao.yunteng.service.ThingsModelService;
27   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
  26 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
28 27
29 28 import java.util.*;
30 29 import java.util.stream.Collectors;
... ... @@ -34,7 +33,7 @@ import java.util.stream.Collectors;
34 33 public class ThingsModelServiceImpl
35 34 extends AbstractBaseService<ThingsModelMapper, TkThingsModelEntity>
36 35 implements ThingsModelService {
37   - private final YtDeviceProfileService ytDeviceProfileService;
  36 + private final TkDeviceProfileService ytDeviceProfileService;
38 37
39 38 @Override
40 39 public YtPageData<ThingsModelDTO> page(
... ... @@ -152,17 +151,44 @@ public class ThingsModelServiceImpl
152 151 @Override
153 152 public JsonNode getTingsModelTSL(
154 153 FunctionTypeEnum typeEnum, String tenantId, String deviceProfileId) {
155   - JsonNode jsonNode = null;
  154 + JsonNode jsonNode;
156 155 DeviceProfileDTO deviceProfileDTO =
157 156 ytDeviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
158   -
  157 + if (null == deviceProfileDTO) {
  158 + throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
  159 + }
159 160 List<ThingsModelDTO> thingsModelDTOS =
160 161 selectByDeviceProfileId(typeEnum, tenantId, deviceProfileId);
  162 +
  163 + DeviceTypeEnum deviceType = deviceProfileDTO.getDeviceType();
161 164 if (typeEnum.equals(FunctionTypeEnum.properties)) {
162   - DeviceTypeEnum deviceType = deviceProfileDTO.getDeviceType();
163 165 jsonNode = getAttributeTSL(thingsModelDTOS, deviceType);
164   - } else if (typeEnum.equals(FunctionTypeEnum.services)) {
165   - // TODO 服务
  166 + } else {
  167 + if (typeEnum.equals(FunctionTypeEnum.services)) {
  168 + List<ServiceModelDTO> serviceList = new ArrayList<>();
  169 + for (ThingsModelDTO thingsModelDTO : thingsModelDTOS) {
  170 + ServiceModelDTO serviceDTO = new ServiceModelDTO();
  171 + BeanUtils.copyProperties(thingsModelDTO, serviceDTO);
  172 + JsonNode functionJson = thingsModelDTO.getFunctionJson();
  173 + if (null != functionJson) {
  174 + serviceDTO.setInputData(functionJson.get("inputData"));
  175 + serviceDTO.setOutputData(functionJson.get("outputData"));
  176 + }
  177 + serviceList.add(serviceDTO);
  178 + }
  179 + jsonNode = JacksonUtil.convertValue(serviceList, JsonNode.class);
  180 + } else {
  181 + List<EventModelDTO> eventList = new ArrayList<>();
  182 + for (ThingsModelDTO thingsModelDTO : thingsModelDTOS) {
  183 + EventModelDTO eventDTO = new EventModelDTO();
  184 + BeanUtils.copyProperties(thingsModelDTO, eventDTO);
  185 + JsonNode functionJson = thingsModelDTO.getFunctionJson();
  186 + if (null != functionJson) {
  187 + eventDTO.setOutputData(functionJson.get("outputData"));
  188 + }
  189 + }
  190 + jsonNode = JacksonUtil.convertValue(eventList, JsonNode.class);
  191 + }
166 192 }
167 193
168 194 return jsonNode;
... ...
... ... @@ -20,7 +20,7 @@ import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper;
20 20 import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper;
21 21 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
22 22 import org.thingsboard.server.dao.yunteng.service.UserOrganizationMappingService;
23   -import org.thingsboard.server.dao.yunteng.service.YtAlarmContactService;
  23 +import org.thingsboard.server.dao.yunteng.service.TkAlarmContactService;
24 24
25 25 import java.util.*;
26 26 import java.util.stream.Collectors;
... ... @@ -31,7 +31,7 @@ import java.util.stream.Collectors;
31 31 @Service
32 32 @RequiredArgsConstructor
33 33 public class TkAlarmContactServiceImpl extends AbstractBaseService<AlarmContactMapper, TkAlarmContactEntity>
34   - implements YtAlarmContactService {
  34 + implements TkAlarmContactService {
35 35 /** mapper注入 自带方法加入,继承的baseMapper */
36 36 private final AlarmContactMapper alarmContactMapper;
37 37
... ...
... ... @@ -21,7 +21,7 @@ import org.thingsboard.server.dao.model.ModelConstants;
21 21 import org.thingsboard.server.dao.yunteng.entities.TkAlarmEntity;
22 22 import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper;
23 23 import org.thingsboard.server.dao.yunteng.mapper.TkAlarmMapper;
24   -import org.thingsboard.server.dao.yunteng.service.YtAlarmInfoService;
  24 +import org.thingsboard.server.dao.yunteng.service.TkAlarmInfoService;
25 25
26 26 import java.util.ArrayList;
27 27 import java.util.List;
... ... @@ -36,7 +36,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.QueryConstant.
36 36 @Service
37 37 @RequiredArgsConstructor
38 38 @Slf4j
39   -public class TkAlarmInfoServiceImpl implements YtAlarmInfoService {
  39 +public class TkAlarmInfoServiceImpl implements TkAlarmInfoService {
40 40
41 41 private final TkAlarmMapper ytJpaAarmDao;
42 42 private final OrganizationMapper organizationMapper;
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.dao.yunteng.entities.TkAlarmContactEntity;
17 17 import org.thingsboard.server.dao.yunteng.mapper.AlarmContactMapper;
18 18 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
19   -import org.thingsboard.server.dao.yunteng.service.YtAlarmService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkAlarmService;
20 20
21 21 import java.util.List;
22 22 import java.util.Map;
... ... @@ -30,7 +30,7 @@ import java.util.Set;
30 30 */
31 31 @Service
32 32 @RequiredArgsConstructor
33   -public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, TkAlarmContactEntity> implements YtAlarmService {
  33 +public class TkAlarmServiceImpl extends AbstractBaseService<AlarmContactMapper, TkAlarmContactEntity> implements TkAlarmService {
34 34 /**
35 35 * mapper注入 自带方法加入,继承的baseMapper
36 36 */
... ...
... ... @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationActDTO;
14 14 import org.thingsboard.server.dao.yunteng.entities.TkConfigurationActEntity;
15 15 import org.thingsboard.server.dao.yunteng.mapper.ConfigurationActMapper;
16 16 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
17   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationActService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationActService;
18 18
19 19 import java.util.List;
20 20 import java.util.stream.Collectors;
... ... @@ -27,7 +27,7 @@ import java.util.stream.Collectors;
27 27 @RequiredArgsConstructor
28 28 public class TkConfigurationActServiceImpl
29 29 extends AbstractBaseService<ConfigurationActMapper, TkConfigurationActEntity>
30   - implements YtConfigurationActService {
  30 + implements TkConfigurationActService {
31 31
32 32
33 33 @Override
... ...
... ... @@ -17,8 +17,8 @@ import org.thingsboard.server.dao.yunteng.mapper.ConfigurationCenterMapper;
17 17 import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper;
18 18 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
19 19 import org.thingsboard.server.dao.yunteng.service.UserOrganizationMappingService;
20   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationCenterService;
21   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationContentService;
  20 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationCenterService;
  21 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationContentService;
22 22 import java.util.HashSet;
23 23 import java.util.List;
24 24 import java.util.Map;
... ... @@ -29,9 +29,9 @@ import java.util.stream.Collectors;
29 29 @RequiredArgsConstructor
30 30 public class TkConfigurationCenterServiceImpl
31 31 extends AbstractBaseService<ConfigurationCenterMapper, TkConfigurationCenterEntity>
32   - implements YtConfigurationCenterService {
  32 + implements TkConfigurationCenterService {
33 33 private final OrganizationMapper organizationMapper;
34   - private final YtConfigurationContentService ytConfigurationContentService;
  34 + private final TkConfigurationContentService ytConfigurationContentService;
35 35 private final UserOrganizationMappingService userOrganizationMappingService;
36 36
37 37 @Override
... ...
... ... @@ -19,7 +19,7 @@ import org.thingsboard.server.dao.yunteng.mapper.ConfigurationContentMapper;
19 19 import org.thingsboard.server.dao.yunteng.mapper.ConfigurationDatasourceMapper;
20 20 import org.thingsboard.server.dao.yunteng.mapper.ConfigurationEventMapper;
21 21 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
22   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationContentService;
  22 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationContentService;
23 23 import java.util.List;
24 24 import java.util.Set;
25 25
... ... @@ -28,7 +28,7 @@ import java.util.Set;
28 28 @RequiredArgsConstructor
29 29 public class TkConfigurationContentServiceImpl
30 30 extends AbstractBaseService<ConfigurationContentMapper, TkConfigurationContentEntity>
31   - implements YtConfigurationContentService {
  31 + implements TkConfigurationContentService {
32 32 private final ConfigurationDatasourceMapper datasourceMapper;
33 33 private final ConfigurationEventMapper eventMapper;
34 34 private final ConfigurationActMapper actMapper;
... ...
... ... @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationDatasourceDTO
14 14 import org.thingsboard.server.dao.yunteng.entities.TkConfigurationDatasourceEntity;
15 15 import org.thingsboard.server.dao.yunteng.mapper.ConfigurationDatasourceMapper;
16 16 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
17   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationDatasourceService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationDatasourceService;
18 18
19 19 import java.util.List;
20 20 import java.util.stream.Collectors;
... ... @@ -27,7 +27,7 @@ import java.util.stream.Collectors;
27 27 @RequiredArgsConstructor
28 28 public class TkConfigurationDatasourceServiceImpl
29 29 extends AbstractBaseService<ConfigurationDatasourceMapper, TkConfigurationDatasourceEntity>
30   - implements YtConfigurationDatasourceService {
  30 + implements TkConfigurationDatasourceService {
31 31
32 32 @Override
33 33 @Transactional(rollbackFor = Exception.class)
... ...
... ... @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.ConfigurationEventDTO;
14 14 import org.thingsboard.server.dao.yunteng.entities.TkConfigurationEventEntity;
15 15 import org.thingsboard.server.dao.yunteng.mapper.ConfigurationEventMapper;
16 16 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
17   -import org.thingsboard.server.dao.yunteng.service.YtConfigurationEventService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkConfigurationEventService;
18 18
19 19 import java.util.List;
20 20 import java.util.stream.Collectors;
... ... @@ -27,7 +27,7 @@ import java.util.stream.Collectors;
27 27 @RequiredArgsConstructor
28 28 public class TkConfigurationEventServiceImpl
29 29 extends AbstractBaseService<ConfigurationEventMapper, TkConfigurationEventEntity>
30   - implements YtConfigurationEventService {
  30 + implements TkConfigurationEventService {
31 31
32 32
33 33 @Override
... ...
... ... @@ -21,7 +21,7 @@ import org.thingsboard.server.dao.yunteng.mapper.DataComponentMapper;
21 21 import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper;
22 22 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
23 23 import org.thingsboard.server.dao.yunteng.service.UserOrganizationMappingService;
24   -import org.thingsboard.server.dao.yunteng.service.YtDataBoardService;
  24 +import org.thingsboard.server.dao.yunteng.service.TkDataBoardService;
25 25
26 26 import java.util.*;
27 27 import java.util.stream.Collectors;
... ... @@ -29,7 +29,7 @@ import java.util.stream.Collectors;
29 29 @Service
30 30 @RequiredArgsConstructor
31 31 public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, TkDataBoardEntity>
32   - implements YtDataBoardService {
  32 + implements TkDataBoardService {
33 33 private final OrganizationMapper organizationMapper;
34 34 private final UserOrganizationMappingService userOrganizationMappingService;
35 35 private final DataComponentMapper dataComponentMapper;
... ...
... ... @@ -14,7 +14,7 @@ import org.thingsboard.server.common.data.yunteng.utils.JacksonUtil;
14 14 import org.thingsboard.server.dao.yunteng.entities.TkDataComponentEntity;
15 15 import org.thingsboard.server.dao.yunteng.mapper.DataComponentMapper;
16 16 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
17   -import org.thingsboard.server.dao.yunteng.service.YtDataComponentService;
  17 +import org.thingsboard.server.dao.yunteng.service.TkDataComponentService;
18 18
19 19 import java.util.ArrayList;
20 20 import java.util.List;
... ... @@ -25,7 +25,7 @@ import java.util.stream.Collectors;
25 25 @Service
26 26 public class TkDataComponentServiceImpl
27 27 extends AbstractBaseService<DataComponentMapper, TkDataComponentEntity>
28   - implements YtDataComponentService {
  28 + implements TkDataComponentService {
29 29 @Override
30 30 public List<DataComponentDTO> getDataComponentsByBoardId(String tenantId, String boardId) {
31 31 List<TkDataComponentEntity> dataComponentList =
... ...
... ... @@ -21,7 +21,7 @@ import org.thingsboard.server.dao.yunteng.jpa.dao.YtJpaDeviceProfileDao;
21 21 import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper;
22 22 import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper;
23 23 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
24   -import org.thingsboard.server.dao.yunteng.service.YtDeviceProfileService;
  24 +import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService;
25 25
26 26 import java.util.*;
27 27
... ... @@ -30,7 +30,7 @@ import java.util.*;
30 30 @Slf4j
31 31 public class TkDeviceProfileServiceImpl
32 32 extends AbstractBaseService<TkDeviceProfileMapper, TkDeviceProfileEntity>
33   - implements YtDeviceProfileService {
  33 + implements TkDeviceProfileService {
34 34
35 35 private final DeviceMapper deviceMapper;
36 36
... ...
... ... @@ -19,7 +19,7 @@ import org.thingsboard.server.dao.yunteng.entities.TkDeviceScriptEntity;
19 19 import org.thingsboard.server.dao.yunteng.mapper.TkDeviceProfileMapper;
20 20 import org.thingsboard.server.dao.yunteng.mapper.TkDeviceScriptMapper;
21 21 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
22   -import org.thingsboard.server.dao.yunteng.service.YtDeviceScriptService;
  22 +import org.thingsboard.server.dao.yunteng.service.TkDeviceScriptService;
23 23
24 24 import java.util.List;
25 25 import java.util.Optional;
... ... @@ -30,7 +30,7 @@ import java.util.stream.Collectors;
30 30 @RequiredArgsConstructor
31 31 @Slf4j
32 32 public class TkDeviceScriptServiceImpl extends AbstractBaseService<TkDeviceScriptMapper, TkDeviceScriptEntity>
33   - implements YtDeviceScriptService {
  33 + implements TkDeviceScriptService {
34 34
35 35
36 36 private final TkDeviceProfileMapper profileMapper;
... ...
... ... @@ -30,7 +30,7 @@ import org.thingsboard.server.dao.yunteng.entities.*;
30 30 import org.thingsboard.server.dao.yunteng.mapper.*;
31 31 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
32 32 import org.thingsboard.server.dao.yunteng.service.ThingsModelService;
33   -import org.thingsboard.server.dao.yunteng.service.YtDeviceService;
  33 +import org.thingsboard.server.dao.yunteng.service.TkDeviceService;
34 34
35 35 import java.time.LocalDateTime;
36 36 import java.util.*;
... ... @@ -40,7 +40,7 @@ import java.util.stream.Collectors;
40 40 @RequiredArgsConstructor
41 41 @Slf4j
42 42 public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDevice>
43   - implements YtDeviceService {
  43 + implements TkDeviceService {
44 44
45 45 private final DeviceProfileDao deviceProfileDao;
46 46
... ...
... ... @@ -13,13 +13,13 @@ import org.thingsboard.server.common.data.yunteng.utils.tree.TreeUtils;
13 13 import org.thingsboard.server.dao.yunteng.entities.TkDeviceTypeEntity;
14 14 import org.thingsboard.server.dao.yunteng.mapper.DeviceTypeMapper;
15 15 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
16   -import org.thingsboard.server.dao.yunteng.service.YtDeviceTypeService;
  16 +import org.thingsboard.server.dao.yunteng.service.TkDeviceTypeService;
17 17
18 18 import java.util.List;
19 19
20 20 @Service
21 21 public class TkDeviceTypeServiceImpl extends AbstractBaseService<DeviceTypeMapper, TkDeviceTypeEntity>
22   - implements YtDeviceTypeService {
  22 + implements TkDeviceTypeService {
23 23 @Override
24 24 public List<DeviceTypeDTO> getDeviceTypeTree(String tenantId) {
25 25 if (StringUtils.isEmpty(tenantId)) {
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.dao.yunteng.entities.TkFrpInfoEntity;
17 17 import org.thingsboard.server.dao.yunteng.mapper.FrpInfoMapper;
18 18 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
19   -import org.thingsboard.server.dao.yunteng.service.YtFrpInfoService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkFrpInfoService;
20 20
21 21 import java.net.UnknownHostException;
22 22 import java.time.LocalDateTime;
... ... @@ -26,7 +26,7 @@ import java.util.Optional;
26 26 @Service
27 27 @RequiredArgsConstructor
28 28 public class TkFrpInfoServiceImpl extends AbstractBaseService<FrpInfoMapper, TkFrpInfoEntity>
29   - implements YtFrpInfoService {
  29 + implements TkFrpInfoService {
30 30
31 31 private final FrpServerProperties frpServerProperties;
32 32
... ...
... ... @@ -31,8 +31,8 @@ import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper;
31 31 import org.thingsboard.server.dao.yunteng.mapper.UserMapper;
32 32 import org.thingsboard.server.dao.yunteng.mapper.TkAlarmMapper;
33 33 import org.thingsboard.server.dao.yunteng.service.HomePageService;
34   -import org.thingsboard.server.dao.yunteng.service.YtTenantService;
35   -import org.thingsboard.server.dao.yunteng.service.YtUserService;
  34 +import org.thingsboard.server.dao.yunteng.service.TkTenantService;
  35 +import org.thingsboard.server.dao.yunteng.service.TkUserService;
36 36
37 37 import java.time.LocalDate;
38 38 import java.time.LocalDateTime;
... ... @@ -50,7 +50,7 @@ public class TkHomePageServiceImpl implements HomePageService {
50 50
51 51 private final DeviceMapper deviceMapper;
52 52
53   - private final YtTenantService tenantService;
  53 + private final TkTenantService tenantService;
54 54
55 55 private final UserMapper userMapper;
56 56
... ... @@ -60,7 +60,7 @@ public class TkHomePageServiceImpl implements HomePageService {
60 60
61 61 private final TimeseriesService timeseriesService;
62 62
63   - private final YtUserService ytUserService;
  63 + private final TkUserService tkUserService;
64 64
65 65 private final TkAlarmMapper ytJpaAarmDao;
66 66
... ... @@ -380,7 +380,7 @@ public class TkHomePageServiceImpl implements HomePageService {
380 380 tsValueCompletableFuture = tenantService.findTenantsByTs(startTime, endTime, ts);
381 381 }
382 382 if (trend == TrendType.CUSTOMER_TREND) {
383   - tsValueCompletableFuture = ytUserService.findUsersAsyncByTs(startTime, endTime, ts);
  383 + tsValueCompletableFuture = tkUserService.findUsersAsyncByTs(startTime, endTime, ts);
384 384 }
385 385 }
386 386 futures.add(tsValueCompletableFuture);
... ...
... ... @@ -11,7 +11,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
11 11 import org.thingsboard.server.dao.yunteng.entities.TkMailLogEntity;
12 12 import org.thingsboard.server.dao.yunteng.mapper.MaiLogMapper;
13 13 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
14   -import org.thingsboard.server.dao.yunteng.service.YtMailLogService;
  14 +import org.thingsboard.server.dao.yunteng.service.TkMailLogService;
15 15
16 16 import java.time.LocalDateTime;
17 17 import java.time.format.DateTimeFormatter;
... ... @@ -22,7 +22,7 @@ import java.util.Set;
22 22 @Service
23 23 @RequiredArgsConstructor
24 24 public class TkMailLogServiceImpl extends AbstractBaseService<MaiLogMapper, TkMailLogEntity>
25   - implements YtMailLogService {
  25 + implements TkMailLogService {
26 26 @Override
27 27 public YtPageData<MailLogDTO> page(String tenantId, Map<String, Object> queryMap) {
28 28 DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
... ...
... ... @@ -24,7 +24,7 @@ import org.thingsboard.server.dao.yunteng.entities.TkMessageTemplateEntity;
24 24 import org.thingsboard.server.dao.yunteng.mapper.MaiLogMapper;
25 25 import org.thingsboard.server.dao.yunteng.mapper.MessageConfigMapper;
26 26 import org.thingsboard.server.dao.yunteng.mapper.MessageTemplateMapper;
27   -import org.thingsboard.server.dao.yunteng.service.YtMailService;
  27 +import org.thingsboard.server.dao.yunteng.service.TkMailService;
28 28
29 29 import java.io.File;
30 30 import java.io.IOException;
... ... @@ -35,7 +35,7 @@ import java.util.Properties;
35 35 @Slf4j
36 36 @Service
37 37 @RequiredArgsConstructor
38   -public class TkMailServiceImpl implements YtMailService {
  38 +public class TkMailServiceImpl implements TkMailService {
39 39
40 40 private final MessageTemplateMapper messageTemplateMapper;
41 41
... ...
... ... @@ -16,7 +16,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
16 16 import org.thingsboard.server.dao.yunteng.entities.TkMessageConfigEntity;
17 17 import org.thingsboard.server.dao.yunteng.mapper.MessageConfigMapper;
18 18 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
19   -import org.thingsboard.server.dao.yunteng.service.YtMessageConfigService;
  19 +import org.thingsboard.server.dao.yunteng.service.TkMessageConfigService;
20 20
21 21 import java.util.List;
22 22 import java.util.Map;
... ... @@ -27,7 +27,7 @@ import java.util.Set;
27 27 @RequiredArgsConstructor
28 28 public class TkMessageConfigServiceImpl
29 29 extends AbstractBaseService<MessageConfigMapper, TkMessageConfigEntity>
30   - implements YtMessageConfigService {
  30 + implements TkMessageConfigService {
31 31
32 32 @Override
33 33 public YtPageData<MessageConfigDTO> page(String tenantId, Map<String, Object> queryMap) {
... ...
... ... @@ -13,7 +13,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
13 13 import org.thingsboard.server.dao.yunteng.entities.TkMessageTemplateEntity;
14 14 import org.thingsboard.server.dao.yunteng.mapper.MessageTemplateMapper;
15 15 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
16   -import org.thingsboard.server.dao.yunteng.service.YtMessageTemplateService;
  16 +import org.thingsboard.server.dao.yunteng.service.TkMessageTemplateService;
17 17
18 18 import java.util.List;
19 19 import java.util.Map;
... ... @@ -24,7 +24,7 @@ import java.util.Set;
24 24 @RequiredArgsConstructor
25 25 public class TkMessageTemplateServiceImpl
26 26 extends AbstractBaseService<MessageTemplateMapper, TkMessageTemplateEntity>
27   - implements YtMessageTemplateService {
  27 + implements TkMessageTemplateService {
28 28 @Override
29 29 public YtPageData<MessageTemplateDTO> page(Map<String, Object> queryMap) {
30 30 IPage<TkMessageTemplateEntity> configIPage = getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME,false);
... ...
... ... @@ -7,12 +7,12 @@ import org.thingsboard.server.common.data.yunteng.dto.AlarmInfoDTO;
7 7 import org.thingsboard.server.common.data.yunteng.dto.request.EmailReqDTO;
8 8 import org.thingsboard.server.common.data.yunteng.dto.request.SmsReqDTO;
9 9 import org.thingsboard.server.common.data.yunteng.enums.*;
10   -import org.thingsboard.server.common.data.yunteng.utils.YtDateTimeUtils;
  10 +import org.thingsboard.server.common.data.yunteng.utils.DateTimeUtils;
11 11 import org.thingsboard.server.dao.yunteng.entities.*;
12 12 import org.thingsboard.server.dao.yunteng.mapper.*;
13   -import org.thingsboard.server.dao.yunteng.service.YtMailService;
14   -import org.thingsboard.server.dao.yunteng.service.YtNoticeService;
15   -import org.thingsboard.server.dao.yunteng.service.YtSmsService;
  13 +import org.thingsboard.server.dao.yunteng.service.TkMailService;
  14 +import org.thingsboard.server.dao.yunteng.service.TkNoticeService;
  15 +import org.thingsboard.server.dao.yunteng.service.TkSmsService;
16 16
17 17 import java.util.*;
18 18 import java.util.stream.Collectors;
... ... @@ -29,7 +29,7 @@ import java.util.stream.Collectors;
29 29 */
30 30 @Service
31 31 @RequiredArgsConstructor
32   -public class TkNoticeServiceImpl implements YtNoticeService {
  32 +public class TkNoticeServiceImpl implements TkNoticeService {
33 33
34 34 private final DeviceMapper deviceMapper;
35 35 private final OrganizationMapper organizationMapper;
... ... @@ -37,8 +37,8 @@ public class TkNoticeServiceImpl implements YtNoticeService {
37 37 private final AlarmContactMapper alarmContactMapper;
38 38 private final MessageTemplateMapper messageTemplateMapper;
39 39
40   - private final YtSmsService smsService;
41   - private final YtMailService mailService;
  40 + private final TkSmsService smsService;
  41 + private final TkMailService mailService;
42 42
43 43 @Override
44 44 public void alert(String profileId, AlarmInfoDTO alarmInfo) {
... ... @@ -145,7 +145,7 @@ public class TkNoticeServiceImpl implements YtNoticeService {
145 145 params.put("device_name", alarmInfo.getDeviceName());
146 146 params.put("severity", alarmInfo.getSeverity());
147 147 params.put("organization", organization != null ? organization.getName() : "");
148   - params.put("createtime", YtDateTimeUtils.formate(alarmInfo.getCreateTs()));
  148 + params.put("createtime", DateTimeUtils.format(alarmInfo.getCreateTs()));
149 149 info.setParams(params);
150 150 contacts.stream().parallel().forEach(item -> {
151 151 if (!item.getPhone().isEmpty()) {
... ... @@ -175,7 +175,7 @@ public class TkNoticeServiceImpl implements YtNoticeService {
175 175 info.setTo(emailReceivers.toArray(new String[emailReceivers.size()]));
176 176 info.setSubject(String.format("【%s】告警通知", alarmInfo.getDeviceName()));
177 177 String body = String.format("%s位于【%s】的设备【%s】触发【%s】级的【%s】,请尽快处理!"
178   - , YtDateTimeUtils.formate(alarmInfo.getCreateTs())
  178 + , DateTimeUtils.format(alarmInfo.getCreateTs())
179 179 , organization != null ? organization.getName() : ""
180 180 , alarmInfo.getDeviceName()
181 181 , alarmInfo.getSeverity()
... ... @@ -207,7 +207,7 @@ public class TkNoticeServiceImpl implements YtNoticeService {
207 207 params.put("device_name", alarmInfo.getDeviceName());
208 208 params.put("severity", alarmInfo.getSeverity());
209 209 params.put("organization", organization != null ? organization.getName() : "");
210   - params.put("createtime", YtDateTimeUtils.formate(alarmInfo.getCreateTs()));
  210 + params.put("createtime", DateTimeUtils.format(alarmInfo.getCreateTs()));
211 211 info.setParams(params);
212 212 info.setTemplatePurpose(MsgTemplatePurposeEnum.FOR_ALARM_NOTICE.name());
213 213 contacts.stream().parallel().forEach(item -> {
... ... @@ -237,7 +237,7 @@ public class TkNoticeServiceImpl implements YtNoticeService {
237 237 params.put("device_name", alarmInfo.getDeviceName());
238 238 params.put("severity", alarmInfo.getSeverity());
239 239 params.put("organization", organization != null ? organization.getName() : "");
240   - params.put("createtime", YtDateTimeUtils.formate(alarmInfo.getCreateTs()));
  240 + params.put("createtime", DateTimeUtils.format(alarmInfo.getCreateTs()));
241 241 info.setParams(params);
242 242 info.setTemplatePurpose(MsgTemplatePurposeEnum.FOR_ALARM_NOTICE.name());
243 243 contacts.stream().parallel().forEach(item -> {
... ...
... ... @@ -23,7 +23,7 @@ import java.util.List;
23 23 @Service
24 24 @RequiredArgsConstructor
25 25 public class TkOpinionServiceImpl extends AbstractBaseService<TkOpinionMapper, TkOpinionEntity>
26   - implements YtOpinionService {
  26 + implements TkOpinionService {
27 27
28 28 private final UserOrganizationMappingService userOrganizationMappingService;
29 29
... ...
... ... @@ -18,7 +18,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tree.TreeUtils;
18 18 import org.thingsboard.server.dao.yunteng.entities.*;
19 19 import org.thingsboard.server.dao.yunteng.mapper.*;
20 20 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
21   -import org.thingsboard.server.dao.yunteng.service.YtOrganizationService;
  21 +import org.thingsboard.server.dao.yunteng.service.TkOrganizationService;
22 22
23 23 import java.util.*;
24 24 import java.util.stream.Collectors;
... ... @@ -26,7 +26,7 @@ import java.util.stream.Collectors;
26 26 @Service
27 27 @RequiredArgsConstructor
28 28 public class TkOrganizationServiceImpl extends AbstractBaseService<OrganizationMapper, TkOrganizationEntity>
29   - implements YtOrganizationService {
  29 + implements TkOrganizationService {
30 30
31 31 private final UserOrganizationMappingMapper userOrganizationMappingMapper;
32 32 private final UserMapper userMapper;
... ...
... ... @@ -33,10 +33,10 @@ import java.util.stream.Collectors;
33 33 @RequiredArgsConstructor
34 34 public class TkReportFromConfigServiceImpl
35 35 extends AbstractBaseService<ReportFormConfigMapper, TkReportFormConfigEntity>
36   - implements YtReportFormConfigService {
  36 + implements TkReportFormConfigService {
37 37 private final OrganizationMapper organizationMapper;
38   - private final YtSysJobService ytSysJobService;
39   - private final YtReportGenerateRecordService ytReportGenerateRecordService;
  38 + private final TkSysJobService tkSysJobService;
  39 + private final TkReportGenerateRecordService tkReportGenerateRecordService;
40 40 private final UserOrganizationMappingService userOrganizationMappingService;
41 41
42 42 @Override
... ... @@ -196,14 +196,14 @@ public class TkReportFromConfigServiceImpl
196 196 Objects.equals(reportFormConfig.getExecuteWay(), FastIotConstants.MagicNumber.ZERO);
197 197 String cronExpression = reportFormConfig.getExecuteContent();
198 198 // 查看之前是否创建了定时任务
199   - SysJobDTO sysJobDTO = ytSysJobService.findSysJobBySourceId(reportFormConfig.getId());
  199 + SysJobDTO sysJobDTO = tkSysJobService.findSysJobBySourceId(reportFormConfig.getId());
200 200 boolean enableStatus =
201 201 Objects.equals(reportFormConfig.getStatus(), StatusEnum.ENABLE.getIndex());
202 202 if (null != sysJobDTO) {
203 203 // 立即执行
204 204 if (isNowExecute) {
205 205 // 删除定时任务
206   - ytSysJobService.deleteJob(sysJobDTO);
  206 + tkSysJobService.deleteJob(sysJobDTO);
207 207 if (enableStatus) {
208 208 // 立即执行报表生成,并创建一条报表执行记录
209 209 // 生成Excel,并更新报表执行记录
... ... @@ -216,7 +216,7 @@ public class TkReportFromConfigServiceImpl
216 216 reportFormConfig.getStatus() == null
217 217 ? StatusEnum.DISABLE.getIndex()
218 218 : reportFormConfig.getStatus());
219   - ytSysJobService.saveOrUpdateJob(sysJobDTO);
  219 + tkSysJobService.saveOrUpdateJob(sysJobDTO);
220 220 }
221 221 } else {
222 222 if (isNowExecute) {
... ... @@ -236,7 +236,7 @@ public class TkReportFromConfigServiceImpl
236 236 throw new YtDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
237 237 }
238 238 // 检查cron表达式是否标准
239   - if (!ytSysJobService.checkCronExpressionIsValid(cronExpression)) {
  239 + if (!tkSysJobService.checkCronExpressionIsValid(cronExpression)) {
240 240 throw new YtDataValidationException(ErrorMessage.CRON_INVALID.getMessage());
241 241 }
242 242 }
... ... @@ -259,7 +259,7 @@ public class TkReportFromConfigServiceImpl
259 259 sysJobDTO.setCronExpression(cronExpression);
260 260 sysJobDTO.setConcurrent(StatusEnum.ENABLE.getIndex());
261 261 sysJobDTO.setInvokeTarget("reportTask.generateReport(\"" + reportId + "\")");
262   - ytSysJobService.saveOrUpdateJob(sysJobDTO);
  262 + tkSysJobService.saveOrUpdateJob(sysJobDTO);
263 263 }
264 264 }
265 265
... ... @@ -271,9 +271,9 @@ public class TkReportFromConfigServiceImpl
271 271 private void checkAndDeleteJob(String id) throws SchedulerException {
272 272 TkReportFormConfigEntity config = baseMapper.selectById(id);
273 273 if (null != config) {
274   - SysJobDTO sysJobDTO = ytSysJobService.findSysJobBySourceId(id);
  274 + SysJobDTO sysJobDTO = tkSysJobService.findSysJobBySourceId(id);
275 275 if (null != sysJobDTO) {
276   - ytSysJobService.deleteJob(sysJobDTO);
  276 + tkSysJobService.deleteJob(sysJobDTO);
277 277 }
278 278 }
279 279 }
... ... @@ -299,11 +299,11 @@ public class TkReportFromConfigServiceImpl
299 299 }
300 300 // 立即执行报表生成,并创建一条报表执行记录
301 301 ReportGenerateRecordDTO recordDTO =
302   - ytReportGenerateRecordService.generateReportRecord(reportFormConfigDTO, null);
  302 + tkReportGenerateRecordService.generateReportRecord(reportFormConfigDTO, null);
303 303 // 生成Excel,并更新报表执行记录
304 304 int surplus = reportFormConfigDTO.getExecuteAttributes().size();
305 305 for (ExecuteAttributesDTO dto : reportFormConfigDTO.getExecuteAttributes()) {
306   - ytReportGenerateRecordService.generateExcelUpdateReportRecord(
  306 + tkReportGenerateRecordService.generateExcelUpdateReportRecord(
307 307 reportFormConfigDTO, dto, recordDTO.getId(), surplus);
308 308 surplus--;
309 309 }
... ...
... ... @@ -38,8 +38,8 @@ import org.thingsboard.server.dao.yunteng.entities.TkReportGenerateRecordEntity;
38 38 import org.thingsboard.server.dao.yunteng.mapper.ReportGenerateRecordMapper;
39 39 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
40 40 import org.thingsboard.server.dao.yunteng.service.UserOrganizationMappingService;
41   -import org.thingsboard.server.dao.yunteng.service.YtOrganizationService;
42   -import org.thingsboard.server.dao.yunteng.service.YtReportGenerateRecordService;
  41 +import org.thingsboard.server.dao.yunteng.service.TkOrganizationService;
  42 +import org.thingsboard.server.dao.yunteng.service.TkReportGenerateRecordService;
43 43
44 44 import java.io.ByteArrayInputStream;
45 45 import java.io.ByteArrayOutputStream;
... ... @@ -56,11 +56,11 @@ import java.util.stream.Collectors;
56 56 @Slf4j
57 57 public class TkReportGenerateRecordServiceImpl
58 58 extends AbstractBaseService<ReportGenerateRecordMapper, TkReportGenerateRecordEntity>
59   - implements YtReportGenerateRecordService {
  59 + implements TkReportGenerateRecordService {
60 60
61 61 private static final String CONTENT_TYPE =
62 62 "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
63   - private final YtOrganizationService ytOrganizationService;
  63 + private final TkOrganizationService tkOrganizationService;
64 64 private final TimeseriesService tsService;
65 65 private final FileStorageService fileStorageService;
66 66 private final UserOrganizationMappingService userOrganizationMappingService;
... ... @@ -149,7 +149,7 @@ public class TkReportGenerateRecordServiceImpl
149 149 throw new YtDataValidationException(ErrorMessage.EXPORT_CONFIG_NON_EXISTENT.getMessage());
150 150 }
151 151 OrganizationDTO organizationDTO =
152   - ytOrganizationService.findOrganizationById(
  152 + tkOrganizationService.findOrganizationById(
153 153 reportFormConfigDTO.getOrganizationId(), reportFormConfigDTO.getTenantId());
154 154 // 创建报表生成记录
155 155 ReportGenerateRecordDTO dto = new ReportGenerateRecordDTO();
... ...
... ... @@ -12,7 +12,7 @@ import org.thingsboard.server.dao.yunteng.entities.TkRpcRecordEntity;
12 12 import org.thingsboard.server.dao.yunteng.mapper.OrganizationMapper;
13 13 import org.thingsboard.server.dao.yunteng.mapper.TkRpcRecordMapper;
14 14 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
15   -import org.thingsboard.server.dao.yunteng.service.YtRpcRecordService;
  15 +import org.thingsboard.server.dao.yunteng.service.TkRpcRecordService;
16 16
17 17 import java.util.ArrayList;
18 18 import java.util.List;
... ... @@ -25,7 +25,7 @@ import java.util.stream.Collectors;
25 25 @Service
26 26 @RequiredArgsConstructor
27 27 public class TkRpcRecordServiceImpl extends AbstractBaseService<TkRpcRecordMapper, TkRpcRecordEntity>
28   - implements YtRpcRecordService {
  28 + implements TkRpcRecordService {
29 29
30 30
31 31 private final OrganizationMapper organizationMapper;
... ...
... ... @@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.rule.RuleChain;
7 7 import org.thingsboard.server.common.data.rule.RuleChainType;
8 8 import org.thingsboard.server.dao.service.Validator;
9 9 import org.thingsboard.server.dao.yunteng.jpa.dao.YtJpaRuleChainDao;
10   -import org.thingsboard.server.dao.yunteng.service.YtRuleChainService;
  10 +import org.thingsboard.server.dao.yunteng.service.TkRuleChainService;
11 11
12 12 import java.util.List;
13 13
... ... @@ -23,7 +23,7 @@ import java.util.List;
23 23 */
24 24 @Service
25 25 @RequiredArgsConstructor
26   -public class TkRuleChainServiceImpl implements YtRuleChainService {
  26 +public class TkRuleChainServiceImpl implements TkRuleChainService {
27 27 private final YtJpaRuleChainDao ruleChainDao;
28 28
29 29
... ...
... ... @@ -31,7 +31,7 @@ import org.thingsboard.server.dao.yunteng.mapper.MessageConfigMapper;
31 31 import org.thingsboard.server.dao.yunteng.mapper.MessageTemplateMapper;
32 32 import org.thingsboard.server.dao.yunteng.mapper.SmsLogMapper;
33 33 import org.thingsboard.server.dao.yunteng.mapper.UserMapper;
34   -import org.thingsboard.server.dao.yunteng.service.YtSmsService;
  34 +import org.thingsboard.server.dao.yunteng.service.TkSmsService;
35 35
36 36 import java.time.LocalDateTime;
37 37 import java.util.LinkedHashMap;
... ... @@ -43,7 +43,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.FastIotConstan
43 43 @Slf4j
44 44 @Service
45 45 @RequiredArgsConstructor
46   -public class TkSmsServiceImpl implements YtSmsService {
  46 +public class TkSmsServiceImpl implements TkSmsService {
47 47
48 48 private final MessageTemplateMapper messageTemplateMapper;
49 49
... ...
... ... @@ -30,20 +30,20 @@ import java.util.stream.Collectors;
30 30 @Service
31 31 @RequiredArgsConstructor
32 32 public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTenantEntity>
33   - implements YtTenantService {
  33 + implements TkTenantService {
34 34
35 35 private final MenuMapper menuMapper;
36 36 private final RoleMapper roleMapper;
37 37 private final UserMapper userMapper;
38 38 private final TenantMenuMapper tenantMenuMapper;
39 39 private final TenantRoleMapper tenantRoleMapper;
40   - private final YtOrganizationService ytOrganizationService;
41   - private final YtDeviceService ytDeviceService;
42   - private final YtMessageTemplateService ytMessageTemplateService;
43   - private final YtMessageConfigService ytMessageConfigService;
44   - private final YtMailLogService ytMailLogService;
  40 + private final TkOrganizationService tkOrganizationService;
  41 + private final TkDeviceService ytDeviceService;
  42 + private final TkMessageTemplateService tkMessageTemplateService;
  43 + private final TkMessageConfigService ytMessageConfigService;
  44 + private final TkMailLogService ytMailLogService;
45 45 private final SmsLogService smsLogService;
46   - private final YtAlarmContactService ytAlarmContactService;
  46 + private final TkAlarmContactService ytAlarmContactService;
47 47 private final AlarmProfileMapper alarmProfileMapper;
48 48 private final SysNoticeService sysNoticeService;
49 49 private final SysNoticeUserService sysNoticeUserService;
... ... @@ -137,11 +137,11 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe
137 137 // 5. TELL RULE ENGINE TO STOP TENANT
138 138 // 6. DELETE OTHER RESOURCES IF ANY
139 139 // 7. DELETE ORGANIZATION
140   - ytOrganizationService.deleteDataByTenantIds(tenantIds);
  140 + tkOrganizationService.deleteDataByTenantIds(tenantIds);
141 141 // 8. DELETE DEVICE
142 142 ytDeviceService.deleteDataByTenantIds(tenantIds);
143 143 // 9. DELETE MESSAGE_TEMPLATE MESSAGE_CONFIG SEND_RECORDS
144   - ytMessageTemplateService.deleteDataByTenantIds(tenantIds);
  144 + tkMessageTemplateService.deleteDataByTenantIds(tenantIds);
145 145 ytMessageConfigService.deleteDataByTenantIds(tenantIds);
146 146 ytMailLogService.deleteDataByTenantIds(tenantIds);
147 147 smsLogService.deleteDataByTenantIds(tenantIds);
... ...
... ... @@ -31,7 +31,7 @@ import org.thingsboard.server.dao.yunteng.entities.TkThirdUserEntity;
31 31 import org.thingsboard.server.dao.yunteng.mapper.UserMapper;
32 32 import org.thingsboard.server.dao.yunteng.mapper.TkThirdPlatformMapper;
33 33 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
34   -import org.thingsboard.server.dao.yunteng.service.YtThirdPlatformService;
  34 +import org.thingsboard.server.dao.yunteng.service.TkThirdPlatformService;
35 35
36 36 import java.util.Objects;
37 37 import java.util.Optional;
... ... @@ -43,7 +43,7 @@ import static org.thingsboard.server.common.data.yunteng.constant.FastIotConstan
43 43 @Service
44 44 @RequiredArgsConstructor
45 45 public class TkThirdPlatformServiceImpl extends AbstractBaseService<TkThirdPlatformMapper, TkThirdUserEntity>
46   - implements YtThirdPlatformService {
  46 + implements TkThirdPlatformService {
47 47
48 48 private final UserMapper userMapper;
49 49 private final CacheUtils cacheUtils;
... ...
... ... @@ -17,8 +17,8 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
17 17 import org.thingsboard.server.dao.yunteng.entities.TkVideoPlatformEntity;
18 18 import org.thingsboard.server.dao.yunteng.mapper.TkVideoPlatformMapper;
19 19 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
20   -import org.thingsboard.server.dao.yunteng.service.YtVideoPlatformService;
21   -import org.thingsboard.server.dao.yunteng.service.YtVideoService;
  20 +import org.thingsboard.server.dao.yunteng.service.TkVideoPlatformService;
  21 +import org.thingsboard.server.dao.yunteng.service.TkVideoService;
22 22
23 23 import java.util.List;
24 24 import java.util.stream.Collectors;
... ... @@ -27,9 +27,9 @@ import java.util.stream.Collectors;
27 27 @Service
28 28 @RequiredArgsConstructor
29 29 public class TkVideoPlatformServiceImpl extends AbstractBaseService<TkVideoPlatformMapper, TkVideoPlatformEntity>
30   - implements YtVideoPlatformService {
  30 + implements TkVideoPlatformService {
31 31
32   - private final YtVideoService ytVideoService;
  32 + private final TkVideoService tkVideoService;
33 33
34 34 @Override
35 35 public YtPageData<TkVideoPlatformDTO> page(IPage<TkVideoPlatformEntity> pageInfo,
... ... @@ -68,7 +68,7 @@ public class TkVideoPlatformServiceImpl extends AbstractBaseService<TkVideoPlatf
68 68 @Override
69 69 @Transactional(rollbackFor = Exception.class)
70 70 public boolean deleteDataByIds(DeleteDTO deleteDTO) {
71   - boolean result = ytVideoService.checkConfigIdsIsUseForVideo(deleteDTO.getIds());
  71 + boolean result = tkVideoService.checkConfigIdsIsUseForVideo(deleteDTO.getIds());
72 72 if(result){
73 73 throw new YtDataValidationException(ErrorMessage.VIDEO_PLATFORM_USED.getMessage());
74 74 }
... ...
... ... @@ -21,7 +21,7 @@ import org.thingsboard.server.dao.yunteng.entities.TkVideoEntity;
21 21 import org.thingsboard.server.dao.yunteng.mapper.TkVideoMapper;
22 22 import org.thingsboard.server.dao.yunteng.service.AbstractBaseService;
23 23 import org.thingsboard.server.dao.yunteng.service.UserOrganizationMappingService;
24   -import org.thingsboard.server.dao.yunteng.service.YtVideoService;
  24 +import org.thingsboard.server.dao.yunteng.service.TkVideoService;
25 25
26 26 import java.util.List;
27 27 import java.util.Set;
... ... @@ -30,7 +30,7 @@ import java.util.Set;
30 30 @Service
31 31 @RequiredArgsConstructor
32 32 public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVideoEntity>
33   - implements YtVideoService {
  33 + implements TkVideoService {
34 34
35 35 private final UserOrganizationMappingService userOrganizationMappingService;
36 36
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkAlarmContactService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtAlarmContactService.java
... ... @@ -8,7 +8,7 @@ import java.util.List;
8 8 import java.util.Map;
9 9
10 10 /** @Description 告警联系人的操作方法 @Author cxy @Date 2021/11/2 14:46 */
11   -public interface YtAlarmContactService extends BaseService<TkAlarmContactEntity> {
  11 +public interface TkAlarmContactService extends BaseService<TkAlarmContactEntity> {
12 12 /**
13 13 * 查询全部的告警联系人
14 14 *
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkAlarmInfoService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtAlarmInfoService.java
... ... @@ -16,7 +16,7 @@ import java.util.UUID;
16 16 /**
17 17 * @Description 告警中心数据业务层 @Author cxy @Date 2021/11/10 16:51
18 18 */
19   -public interface YtAlarmInfoService {
  19 +public interface TkAlarmInfoService {
20 20
21 21
22 22 /**
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkAlarmService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtAlarmService.java
... ... @@ -13,7 +13,7 @@ import java.util.Map;
13 13 * @Date 2021/11/2 14:46
14 14 */
15 15
16   -public interface YtAlarmService {
  16 +public interface TkAlarmService {
17 17 /**
18 18 * 查询全部的告警联系人
19 19 *
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkConfigurationActService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtConfigurationActService.java
... ... @@ -7,7 +7,7 @@ import java.util.List;
7 7 /**
8 8 * @author Administrator
9 9 */
10   -public interface YtConfigurationActService {
  10 +public interface TkConfigurationActService {
11 11
12 12 /**
13 13 * 保存节点动画效果信息,每种事件类型只会有1个
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkConfigurationCenterService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtConfigurationCenterService.java
... ... @@ -7,7 +7,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
7 7
8 8 import java.util.Map;
9 9
10   -public interface YtConfigurationCenterService {
  10 +public interface TkConfigurationCenterService {
11 11 YtPageData<ConfigurationCenterDTO> page(Map<String, Object> queryMap,boolean tenantAdmin);
12 12
13 13 ConfigurationCenterDTO saveConfiguration(ConfigurationCenterDTO configurationCenterDTO);
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkConfigurationContentService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtConfigurationContentService.java
... ... @@ -5,7 +5,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO;
5 5
6 6 import java.util.Set;
7 7
8   -public interface YtConfigurationContentService {
  8 +public interface TkConfigurationContentService {
9 9
10 10 ConfigurationContentDTO saveConfigurationContent(ConfigurationContentDTO configurationContentDTO);
11 11
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkConfigurationDatasourceService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtConfigurationDatasourceService.java
... ... @@ -9,7 +9,7 @@ import java.util.List;
9 9 /**
10 10 * @author Administrator
11 11 */
12   -public interface YtConfigurationDatasourceService {
  12 +public interface TkConfigurationDatasourceService {
13 13
14 14 /**
15 15 * 保存节点数据源,只会有1个
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkConfigurationEventService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtConfigurationEventService.java
... ... @@ -7,7 +7,7 @@ import java.util.List;
7 7 /**
8 8 * @author Administrator
9 9 */
10   -public interface YtConfigurationEventService {
  10 +public interface TkConfigurationEventService {
11 11
12 12 /**
13 13 * 保存节点数据交互信息,每种事件类型只会有1个
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkDataBoardService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtDataBoardService.java
... ... @@ -8,7 +8,7 @@ import org.thingsboard.server.common.data.yunteng.utils.tools.YtPageData;
8 8 import java.util.List;
9 9 import java.util.Map;
10 10
11   -public interface YtDataBoardService {
  11 +public interface TkDataBoardService {
12 12 /**
13 13 * 数据看板分页
14 14 *
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkDataComponentService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtDataComponentService.java
... ... @@ -6,7 +6,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeleteDTO;
6 6 import java.util.List;
7 7 import java.util.Set;
8 8
9   -public interface YtDataComponentService {
  9 +public interface TkDataComponentService {
10 10 /**
11 11 * 查询数据看板下的所有组件
12 12 * @param tenantId 租户id
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkDeviceProfileService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtDeviceProfileService.java
... ... @@ -8,7 +8,7 @@ import java.util.List;
8 8 import java.util.Optional;
9 9 import java.util.Set;
10 10
11   -public interface YtDeviceProfileService {
  11 +public interface TkDeviceProfileService {
12 12
13 13 DeviceProfileDTO insertOrUpdate(DeviceProfileDTO deviceDTO);
14 14
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkDeviceScriptService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtDeviceScriptService.java
... ... @@ -9,7 +9,7 @@ import java.util.List;
9 9 import java.util.Optional;
10 10 import java.util.Set;
11 11
12   -public interface YtDeviceScriptService extends BaseService<TkDeviceScriptEntity>{
  12 +public interface TkDeviceScriptService extends BaseService<TkDeviceScriptEntity>{
13 13
14 14 /**
15 15 * 查找脚本解析的脚本内容
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkDeviceService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtDeviceService.java
... ... @@ -14,7 +14,7 @@ import java.util.Map;
14 14 import java.util.Optional;
15 15 import java.util.Set;
16 16
17   -public interface YtDeviceService extends BaseService<TkDevice> {
  17 +public interface TkDeviceService extends BaseService<TkDevice> {
18 18 DeviceDTO insertOrUpdate(String tenantId, DeviceDTO deviceDTO);
19 19
20 20 void deleteDevices(String tenantId, Set<String> ids);
... ...
dao/src/main/java/org/thingsboard/server/dao/yunteng/service/TkDeviceTypeService.java renamed from dao/src/main/java/org/thingsboard/server/dao/yunteng/service/YtDeviceTypeService.java
... ... @@ -6,7 +6,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeviceTypeDTO;
6 6
7 7 import java.util.List;
8 8
9   -public interface YtDeviceTypeService {
  9 +public interface TkDeviceTypeService {
10 10 /**
11 11 * 获取当前租户设备类型的树形结构
12 12 * @param tenantId 租户Code
... ...