From 30cf997c7b8e321d02a429cbeff12f5aec2a2d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 3 Apr 2025 10:01:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor(repository):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=9F=A5=E8=AF=A2=E5=92=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E5=AE=A1=E6=A0=B8=E7=9B=B8=E5=85=B3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改设备查询条件,使用 LIKE 模糊匹配 - 重命名 SolutionMeasuresVO 中的 audited 字段为 approved,优化审核状态表示 - 更新 TicketSolutionServiceImpl 中的审核状态判断逻辑 --- .../mobilebroken/common/pojo/vo/SolutionMeasuresVO.java | 4 ++-- .../service/impl/TicketSolutionServiceImpl.java | 4 ++-- .../src/main/resources/mapper/DeviceMapper.xml | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/SolutionMeasuresVO.java b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/SolutionMeasuresVO.java index 311d9c73..3c090dfd 100644 --- a/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/SolutionMeasuresVO.java +++ b/nflg-mobilebroken-common/src/main/java/com/nflg/mobilebroken/common/pojo/vo/SolutionMeasuresVO.java @@ -18,6 +18,6 @@ public class SolutionMeasuresVO { //是否是审核人 private boolean inAudit=false; - // 是否已审核 - private boolean audited=false; + // 是否审核通过,默认为null,表示未审核;false:不通过,true:通过 + private Boolean approved; } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TicketSolutionServiceImpl.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TicketSolutionServiceImpl.java index 360f6b95..38f4b2dd 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TicketSolutionServiceImpl.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/TicketSolutionServiceImpl.java @@ -61,9 +61,9 @@ public class TicketSolutionServiceImpl extends ServiceImpl> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemName, LinkedHashMap::new, Collectors.toList())); SolutionMeasuresVO vo=new SolutionMeasuresVO(); TicketSolutionAudit audit =ticketSolutionAuditService.getByTicketAndUser(ticketId,AdminUserUtil.getUserId()); - if (Objects.nonNull(audit)){ + if (Objects.nonNull(audit)) { vo.setInAudit(true); - vo.setAudited(Objects.nonNull(audit.getState())); + vo.setApproved(Objects.isNull(audit.getState()) ? null : Objects.equals(audit.getState(), 1)); } List items = new ArrayList<>(); if (CollectionUtil.isEmpty(groupedSolutions)) { diff --git a/nflg-mobilebroken-repository/src/main/resources/mapper/DeviceMapper.xml b/nflg-mobilebroken-repository/src/main/resources/mapper/DeviceMapper.xml index e9560453..8ba5b290 100644 --- a/nflg-mobilebroken-repository/src/main/resources/mapper/DeviceMapper.xml +++ b/nflg-mobilebroken-repository/src/main/resources/mapper/DeviceMapper.xml @@ -22,22 +22,23 @@ - and a.device_no=#{query.deviceNo} + and a.device_no LIKE concat('%', #{query.deviceNo}, '%') - and a.customer_name=#{query.customerName} + and a.customer_name LIKE concat('%', #{query.customerName}, '%') and a.agent_name=#{query.agentName} - and a.model_no=#{query.modelNo} + and a.model_no LIKE concat('%', #{query.modelNo}, '%') and a.warranty_state=#{query.warrantyState} - and a.start_warranty_date >= #{query.warrantyStartDate} and start_warranty_date <= #{query.warrantyEndDate} + and a.start_warranty_date >= #{query.warrantyStartDate} and start_warranty_date <= + #{query.warrantyEndDate}