From 457c896ce815d9dac73d4132d81641bf2c24d296 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 17:50:45 +0800 Subject: [PATCH] 1 --- .../cn/iocoder/yudao/common/RepairCons.java | 14 +++- .../admin/DlRepairTicketsController.java | 6 ++ .../tickets/mapper/DlRepairTicketsMapper.java | 10 ++- .../impl/DlRepairTicketsServiceImpl.java | 6 +- .../tickets/vo/DlRepairTicketsReqVO.java | 2 + .../mapper/tickets/DlRepairTicketsMapper.xml | 64 ++++++++++++++++--- 6 files changed, 91 insertions(+), 11 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java index 8a5a45c4..d0b8f61c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java @@ -1,2 +1,14 @@ -package cn.iocoder.yudao.common;public class RepairCons { +package cn.iocoder.yudao.common; + +/** + * 维修系统常量 + * @author vinjor-M + * @date 17:44 2024/10/18 +**/ +public class RepairCons { + + /**工单-待处理*/ + public static final String TICKETS_WAITING = "waiting"; + /**工单-所有*/ + public static final String TICKETS_ALL = "all"; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java index 659d5ad0..3ac7c5d2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTicketsController.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.tickets.controller.admin; +import cn.iocoder.yudao.common.RepairCons; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; @@ -9,6 +10,7 @@ import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; +import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -171,6 +173,10 @@ public class DlRepairTicketsController { @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ Page page = new Page<>(pageNo, pageSize); + if(StringUtils.isEmpty(repairTicketsReqVO.getSelectType())){ + //查询类型为空,默认查待处理的 + repairTicketsReqVO.setSelectType(RepairCons.TICKETS_WAITING); + } return success(dlRepairTicketsService.getPageType(repairTicketsReqVO, page)); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java index 23dec322..4a53a9f2 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/mapper/DlRepairTicketsMapper.java @@ -27,13 +27,21 @@ public interface DlRepairTicketsMapper extends BaseMapper { IPage getTicketsPage(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); /** - * 分类查询工单分页 + * 分类查询工单分页----待处理的 * * @author 小李 * @date 16:26 2024/10/12 * @param repairTicketsReqVO 查询对象 **/ IPage getPageType(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); + /** + * 分类查询工单分页----所有记录 + * + * @author 小李 + * @date 16:26 2024/10/12 + * @param repairTicketsReqVO 查询对象 + **/ + IPage getPageTypeAll(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 1c55d600..1b7b3aa4 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -421,7 +421,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl userIds; + /** 查询类型(waiting 待处理的 | all 所有数据) */ + private String selectType; } diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index 8272a711..3a2694cd 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -203,17 +203,65 @@ and drt.is_finish = #{map.isFinish} - and ( - - find_in_set(#{item}, drti.repair_ids) > 0 + and (drt.tickets_status = '05') + and (drt.now_repair_id in + + #{item} ) - - and (drt.now_repair_id in - - #{item} - + order by drt.create_time desc + + +