Showing
6 changed files
with
25 additions
and
1 deletions
@@ -44,7 +44,8 @@ public class TkDataBoardController extends BaseController { | @@ -44,7 +44,8 @@ public class TkDataBoardController extends BaseController { | ||
44 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, | 44 | @RequestParam(value = ORDER_FILED, required = false) String orderBy, |
45 | @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType, | 45 | @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType, |
46 | @RequestParam(value = "organizationId", required = false) String organizationId, | 46 | @RequestParam(value = "organizationId", required = false) String organizationId, |
47 | - @RequestParam(value = "name", required = false) String name) | 47 | + @RequestParam(value = "name", required = false) String name, |
48 | + @RequestParam(value = "platform", required = false) String platform) | ||
48 | throws ThingsboardException { | 49 | throws ThingsboardException { |
49 | Map<String, Object> queryMap = new HashMap<>(); | 50 | Map<String, Object> queryMap = new HashMap<>(); |
50 | queryMap.put(PAGE_SIZE, pageSize); | 51 | queryMap.put(PAGE_SIZE, pageSize); |
@@ -58,6 +59,9 @@ public class TkDataBoardController extends BaseController { | @@ -58,6 +59,9 @@ public class TkDataBoardController extends BaseController { | ||
58 | if (StringUtils.isNotBlank(name)) { | 59 | if (StringUtils.isNotBlank(name)) { |
59 | queryMap.put("name", name); | 60 | queryMap.put("name", name); |
60 | } | 61 | } |
62 | + if (StringUtils.isNotBlank(platform)) { | ||
63 | + queryMap.put("platform", platform); | ||
64 | + } | ||
61 | queryMap.put("userId", getCurrentUser().getCurrentUserId()); | 65 | queryMap.put("userId", getCurrentUser().getCurrentUserId()); |
62 | TkPageData<DataBoardDTO> pageData = | 66 | TkPageData<DataBoardDTO> pageData = |
63 | tkDataBoardService.dataBoardPage(queryMap, getCurrentUser().isTenantAdmin()); | 67 | tkDataBoardService.dataBoardPage(queryMap, getCurrentUser().isTenantAdmin()); |
@@ -37,6 +37,7 @@ public class TkDataComponentController extends BaseController { | @@ -37,6 +37,7 @@ public class TkDataComponentController extends BaseController { | ||
37 | private final TkDataComponentService ytDataComponentService; | 37 | private final TkDataComponentService ytDataComponentService; |
38 | private final TkDataBoardService ytDataBoardService; | 38 | private final TkDataBoardService ytDataBoardService; |
39 | 39 | ||
40 | + | ||
40 | @GetMapping("/{boardId}") | 41 | @GetMapping("/{boardId}") |
41 | @ApiOperation(value = "查询看板下的所有组件信息") | 42 | @ApiOperation(value = "查询看板下的所有组件信息") |
42 | @PreAuthorize( | 43 | @PreAuthorize( |
@@ -50,6 +51,8 @@ public class TkDataComponentController extends BaseController { | @@ -50,6 +51,8 @@ public class TkDataComponentController extends BaseController { | ||
50 | getCurrentUser().getCurrentTenantId(), boardId); | 51 | getCurrentUser().getCurrentTenantId(), boardId); |
51 | moreDataComponentInfoDTO.setComponentLayout(dataBoardDTO.getLayout()); | 52 | moreDataComponentInfoDTO.setComponentLayout(dataBoardDTO.getLayout()); |
52 | moreDataComponentInfoDTO.setComponentData(data); | 53 | moreDataComponentInfoDTO.setComponentData(data); |
54 | + DataBoardDTO dataDto = ytDataBoardService.findDataBoardInfoById(boardId,getCurrentUser().getCurrentTenantId()); | ||
55 | + moreDataComponentInfoDTO.setPhoneModel(StringUtils.isEmpty(dataDto.getPhoneModel())?null:dataDto.getPhoneModel()); | ||
53 | return ResponseResult.success(moreDataComponentInfoDTO); | 56 | return ResponseResult.success(moreDataComponentInfoDTO); |
54 | } | 57 | } |
55 | 58 |
@@ -28,4 +28,10 @@ public class DataBoardDTO extends PublicCustomerDTO { | @@ -28,4 +28,10 @@ public class DataBoardDTO extends PublicCustomerDTO { | ||
28 | 28 | ||
29 | @ApiModelProperty(value = "组件数") | 29 | @ApiModelProperty(value = "组件数") |
30 | private Integer componentNum; | 30 | private Integer componentNum; |
31 | + | ||
32 | + @ApiModelProperty(value = "适用终端") | ||
33 | + private String platform; | ||
34 | + @ApiModelProperty(value = "手机型号") | ||
35 | + private String phoneModel; | ||
36 | + | ||
31 | } | 37 | } |
@@ -17,4 +17,8 @@ public class MoreDataComponentInfoDTO implements Serializable { | @@ -17,4 +17,8 @@ public class MoreDataComponentInfoDTO implements Serializable { | ||
17 | 17 | ||
18 | @ApiModelProperty("组件布局信息") | 18 | @ApiModelProperty("组件布局信息") |
19 | private List<ComponentLayoutDTO> componentLayout; | 19 | private List<ComponentLayoutDTO> componentLayout; |
20 | + | ||
21 | + @ApiModelProperty("设备型号") | ||
22 | + private String phoneModel; | ||
23 | + | ||
20 | } | 24 | } |
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | ||
5 | import com.baomidou.mybatisplus.annotation.TableName; | 5 | import com.baomidou.mybatisplus.annotation.TableName; |
6 | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | 6 | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
7 | import com.fasterxml.jackson.databind.JsonNode; | 7 | import com.fasterxml.jackson.databind.JsonNode; |
8 | +import io.swagger.annotations.ApiModelProperty; | ||
8 | import lombok.Data; | 9 | import lombok.Data; |
9 | import lombok.EqualsAndHashCode; | 10 | import lombok.EqualsAndHashCode; |
10 | import org.apache.ibatis.type.EnumTypeHandler; | 11 | import org.apache.ibatis.type.EnumTypeHandler; |
@@ -34,4 +35,8 @@ public class TkDataBoardEntity extends TenantBaseEntity { | @@ -34,4 +35,8 @@ public class TkDataBoardEntity extends TenantBaseEntity { | ||
34 | 35 | ||
35 | @TableField(updateStrategy = FieldStrategy.IGNORED) | 36 | @TableField(updateStrategy = FieldStrategy.IGNORED) |
36 | private String accessCredentials; | 37 | private String accessCredentials; |
38 | + | ||
39 | + private String platform; | ||
40 | + | ||
41 | + private String phoneModel; | ||
37 | } | 42 | } |
@@ -39,6 +39,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -39,6 +39,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
39 | public TkPageData<DataBoardDTO> dataBoardPage(Map<String, Object> queryMap, boolean tenantAdmin) { | 39 | public TkPageData<DataBoardDTO> dataBoardPage(Map<String, Object> queryMap, boolean tenantAdmin) { |
40 | int zero = FastIotConstants.MagicNumber.ZERO; | 40 | int zero = FastIotConstants.MagicNumber.ZERO; |
41 | String name = null != queryMap.get("name") ? queryMap.get("name").toString() : null; | 41 | String name = null != queryMap.get("name") ? queryMap.get("name").toString() : null; |
42 | + String platform = null != queryMap.get("platform") ? queryMap.get("platform").toString() : null; | ||
42 | String tenantId = | 43 | String tenantId = |
43 | Optional.ofNullable(queryMap.get("tenantId")) | 44 | Optional.ofNullable(queryMap.get("tenantId")) |
44 | .map(Object::toString) | 45 | .map(Object::toString) |
@@ -69,6 +70,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | @@ -69,6 +70,7 @@ public class TkDataBoardServiceImpl extends AbstractBaseService<DataBoardMapper, | ||
69 | getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false), | 70 | getPage(queryMap, FastIotConstants.DefaultOrder.CREATE_TIME, false), |
70 | new LambdaQueryWrapper<TkDataBoardEntity>() | 71 | new LambdaQueryWrapper<TkDataBoardEntity>() |
71 | .eq(TkDataBoardEntity::getTenantId, tenantId) | 72 | .eq(TkDataBoardEntity::getTenantId, tenantId) |
73 | + .eq(StringUtils.isNotEmpty(platform), TkDataBoardEntity::getPlatform, platform) | ||
72 | .like(StringUtils.isNotEmpty(name), TkDataBoardEntity::getName, name) | 74 | .like(StringUtils.isNotEmpty(name), TkDataBoardEntity::getName, name) |
73 | .in( | 75 | .in( |
74 | null != organizationIds && organizationIds.size() > zero, | 76 | null != organizationIds && organizationIds.size() > zero, |