From 0b6fcf53d981dc8011817cc4ccfaec034d8880ee Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 22 Dec 2023 16:46:24 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=8F=8C=E7=A5=A8=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../twoTicket/service/impl/CensServiceImpl.java | 54 ++++++++++++---------- .../com/hnac/hzims/ticket/utils/ObjectUtils.java | 1 - 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java index a8a4018..e43c5e5 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java @@ -64,21 +64,24 @@ public class CensServiceImpl implements CensService { return new ArrayList<>(); } // 操作票查询 - LambdaQueryWrapper operateWrapper = Wrappers.lambdaQuery() - .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) - .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList())); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); if(!StringUtil.isEmpty(param.getFlowTaskName())){ - operateWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); + wrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); } - List operates = operateTicketService.list(operateWrapper); - // 工作票查询 - LambdaQueryWrapper workWrapper = Wrappers.lambdaQuery() - .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) - .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList())); - if(!StringUtil.isEmpty(param.getFlowTaskName())){ - workWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); + if(!StringUtil.isEmpty(param.getStartTime())){ + wrapper.ge("CREATE_TIME",param.getStartTime()); + } + if(!StringUtil.isEmpty(param.getEndTime())){ + wrapper.le("CREATE_TIME",param.getEndTime()); } - List works = workTicketInfoService.list(workWrapper); + if(!StringUtil.isEmpty(param.getDeptId())){ + wrapper.eq("CREATE_DEPT",param.getDeptId()); + }else{ + wrapper.in("CREATE_DEPT",depts.stream().map(Dept::getId).collect(Collectors.toList())); + } + List operates = operateTicketService.list(wrapper); + // 工作票查询 + List works = workTicketInfoService.list(wrapper); // 工作任务单 return depts.stream().map(dept->{ CensVo cens = new CensVo(); @@ -139,21 +142,24 @@ public class CensServiceImpl implements CensService { } // 操作票查询 - LambdaQueryWrapper operateWrapper = Wrappers.lambdaQuery() - .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) - .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList())); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); if(!StringUtil.isEmpty(param.getFlowTaskName())){ - operateWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); + wrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); } - List operates = operateTicketService.list(operateWrapper); - // 工作票查询 - LambdaQueryWrapper workWrapper = Wrappers.lambdaQuery() - .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) - .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList())); - if(!StringUtil.isEmpty(param.getFlowTaskName())){ - workWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); + if(!StringUtil.isEmpty(param.getStartTime())){ + wrapper.ge("CREATE_TIME",param.getStartTime()); + } + if(!StringUtil.isEmpty(param.getEndTime())){ + wrapper.le("CREATE_TIME",param.getEndTime()); } - List works = workTicketInfoService.list(workWrapper); + if(!StringUtil.isEmpty(param.getDeptId())){ + wrapper.eq("CREATE_DEPT",param.getDeptId()); + }else{ + wrapper.in("CREATE_DEPT",depts.stream().map(Dept::getId).collect(Collectors.toList())); + } + List operates = operateTicketService.list(wrapper); + // 工作票查询 + List works = workTicketInfoService.list(wrapper); return depts.stream().map(dept -> { CensYearVo censYear = new CensYearVo(); censYear.setDeptId(dept.getId()); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java index 4ca8a4c..e75fffc 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/utils/ObjectUtils.java @@ -6,7 +6,6 @@ import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ObjectUtil; import java.lang.reflect.Field; -import java.time.LocalDate; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors;