Showing
3 changed files
with
7 additions
and
6 deletions
... | ... | @@ -14,6 +14,7 @@ import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; |
14 | 14 | import org.thingsboard.server.common.data.yunteng.dto.TkDeviceAccountDTO; |
15 | 15 | import org.thingsboard.server.common.data.yunteng.dto.TkRepairOrderDTO; |
16 | 16 | import org.thingsboard.server.common.data.yunteng.enums.RepairOrderStatusEnum; |
17 | +import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils; | |
17 | 18 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
18 | 19 | import org.thingsboard.server.controller.BaseController; |
19 | 20 | import org.thingsboard.server.dao.yunteng.service.TkDeviceAccountService; |
... | ... | @@ -92,6 +93,8 @@ public class TkRepairOrderController extends BaseController { |
92 | 93 | throws ThingsboardException { |
93 | 94 | params.put(PAGE, page); |
94 | 95 | params.put(PAGE_SIZE, pageSize); |
96 | + String currentUserId = getCurrentUser().getCurrentUserId(); | |
97 | + params.put("userId", currentUserId); | |
95 | 98 | return tkRepairOrderService.page(params); |
96 | 99 | } |
97 | 100 | ... | ... |
... | ... | @@ -9,11 +9,7 @@ import org.apache.commons.collections4.CollectionUtils; |
9 | 9 | import org.apache.commons.lang3.StringUtils; |
10 | 10 | import org.springframework.stereotype.Service; |
11 | 11 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
12 | -import org.thingsboard.server.common.data.id.TenantId; | |
13 | 12 | import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
14 | -import org.thingsboard.server.common.data.yunteng.dto.DeviceDTO; | |
15 | -import org.thingsboard.server.common.data.yunteng.dto.TkDeviceAccountDTO; | |
16 | -import org.thingsboard.server.common.data.yunteng.dto.TkPreserveRecordDTO; | |
17 | 13 | import org.thingsboard.server.common.data.yunteng.dto.TkRepairOrderDTO; |
18 | 14 | import org.thingsboard.server.common.data.yunteng.enums.RepairOrderStatusEnum; |
19 | 15 | import org.thingsboard.server.common.data.yunteng.utils.SpringBeanUtils; |
... | ... | @@ -30,7 +26,6 @@ import java.time.LocalDateTime; |
30 | 26 | import java.util.HashMap; |
31 | 27 | import java.util.Map; |
32 | 28 | import java.util.Optional; |
33 | -import java.util.UUID; | |
34 | 29 | |
35 | 30 | @Service |
36 | 31 | @RequiredArgsConstructor | ... | ... |
... | ... | @@ -53,9 +53,12 @@ |
53 | 53 | inner join qg_device_account da on da.id=o.device_id |
54 | 54 | inner join sys_user su2 on su2.id=da.director_id |
55 | 55 | <where> |
56 | - <if test="queryMap.id !=null "> | |
56 | + <if test="queryMap.id !=null and queryMap.id !=''"> | |
57 | 57 | AND o.id = #{queryMap.id} |
58 | 58 | </if> |
59 | + <if test="queryMap.userId !=null and queryMap.userId !=''"> | |
60 | + AND (o.report_by = #{queryMap.userId} or o.creator=#{queryMap.userId} or da.director_id=#{queryMap.userId}) | |
61 | + </if> | |
59 | 62 | <if test="queryMap.tenantId !=null and queryMap.tenantId !=''"> |
60 | 63 | AND o.tenant_id = #{queryMap.tenantId} |
61 | 64 | </if> | ... | ... |