From c3e5879c395c2ade44d25c05f599e4b362867272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Wed, 12 Jul 2023 15:06:40 +0800 Subject: [PATCH] =?UTF-8?q?ticket=20=E4=B8=A4=E7=A5=A8=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StandardTicketInfoServiceImpl.java | 4 +++- .../standardTicket/utils/OperationWordHelper.java | 2 ++ .../service/impl/TicketCountServiceImpl.java | 28 +++++++++++++++------- .../service/impl/WorkTicketInfoServiceImpl.java | 5 +++- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java index 22dd9ab..eb971a1 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java @@ -712,7 +712,9 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl selectStandardTicketByDeptIdWithTicketType(List createDept, String ticketType, String dateTime) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(StandardTicketInfoEntity::getTicketType, ticketType); - queryWrapper.lambda().in(StandardTicketInfoEntity::getCreateDept, createDept); + if (CollectionUtils.isNotEmpty(createDept)){ + queryWrapper.lambda().in(StandardTicketInfoEntity::getCreateDept, createDept); + } queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}", dateTime); return baseMapper.selectList(queryWrapper); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java index eb1b45b..803e2c1 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java @@ -44,8 +44,10 @@ public class OperationWordHelper { switch (status) { case 1: result = "电气操作票.docx"; + break; default: result = "电气操作票.docx"; + break; } return result; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java index 4594890..eda0445 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java @@ -82,9 +82,13 @@ public class TicketCountServiceImpl extends BaseServiceImpl createDept = userClient.getDataScope(user.getUserId()); + + LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); + queryWrapper1.eq(TicketCount::getDateTime, dateTime); //根据月份查询统计的数据 CompletableFuture> ticketCountsCompletableFuture = CompletableFuture.supplyAsync(() -> { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -92,6 +96,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl ticketCounts = baseMapper.selectList(queryWrapper); return ticketCounts; }, executor); + //第一种工作票 CompletableFuture oneTicketCompletableFuture = ticketCountsCompletableFuture.thenAcceptAsync((items) -> { //查询第一种工作票 @@ -324,10 +329,15 @@ public class TicketCountServiceImpl extends BaseServiceImpl deptName = systemClient.getDeptName(entry.getKey()); - if (deptName.isSuccess()) { - ticketCount.setDeptName(deptName.getData()); + if (entry.getKey() == null) { + continue; + } + if (entry.getKey() != null) { + //根据id获取部门名称 + R deptName = systemClient.getDeptName(entry.getKey()); + if (deptName.isSuccess()) { + ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData()); + } } List values = entry.getValue(); ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getTicketType() : ticketType); @@ -389,10 +399,12 @@ public class TicketCountServiceImpl extends BaseServiceImpl deptName = systemClient.getDeptName(entry.getKey()); - if (deptName.isSuccess()) { - ticketCount.setDeptName(deptName.getData()); + if (entry.getKey() != null) { + //根据id获取部门名称 + R deptName = systemClient.getDeptName(entry.getKey()); + if (deptName.isSuccess()) { + ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData()); + } } List values = entry.getValue(); ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getType() : ticketType); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java index 5dbca58..e1333c2 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -1104,7 +1104,10 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl selectTicketByDeptIdWithTicketType(List createDept, String ticketType, String dateTime) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(WorkTicketInfoEntity::getType, ticketType); - queryWrapper.lambda().in(BaseEntity::getCreateDept, createDept); + if (CollectionUtils.isNotEmpty(createDept)) { + queryWrapper.lambda().in(BaseEntity::getCreateDept, createDept); + } + queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}" , dateTime); return baseMapper.selectList(queryWrapper); }