From a80e2acfdbdd667a6bc849b40ead00c495a03164 Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Fri, 20 Sep 2024 21:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/RepairErrorCodeConstants.java | 2 +- .../admin/DlRepairTicketsController.java | 28 ++++++++++++++++--- .../tickets/entity/DlRepairTickets.java | 12 ++++++-- .../tickets/mapper/DlRepairTicketsMapper.java | 12 ++++++++ .../service/DlRepairTicketsService.java | 12 ++++++++ .../impl/DlRepairTicketsServiceImpl.java | 17 +++++++++++ .../mapper/tickets/DlRepairTicketsMapper.xml | 17 +++++++++-- 7 files changed, 90 insertions(+), 10 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairErrorCodeConstants.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairErrorCodeConstants.java index fe641e7a..56b70b86 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairErrorCodeConstants.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairErrorCodeConstants.java @@ -9,5 +9,5 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; **/ public interface RepairErrorCodeConstants { ErrorCode GOODS_IS_EMPTY = new ErrorCode(500, "商品为空"); - ErrorCode ITEM_IS_EMPTY = new ErrorCode(500, "工单内容"); + ErrorCode ITEM_IS_EMPTY = new ErrorCode(500, "工单内容为空"); } 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 b9107a63..7739bc4a 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 @@ -2,16 +2,18 @@ package cn.iocoder.yudao.module.tickets.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; +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.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + /** * 维修工单表(DlRepairTickets)表控制层 * @author 小李 @@ -39,5 +41,23 @@ public class DlRepairTicketsController { dlRepairTicketsService.createTickets(ticketsRespVO); return CommonResult.ok(); } + + /** + * 维修工单表 分页 + * + * @author 小李 + * @date 20:51 2024/9/20 + * @param repairTicketsReqVO 查询对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/page") + @Operation(summary = "维修工单表 分页") + public CommonResult getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, + @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairTicketsService.getTicketsPage(repairTicketsReqVO, page)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java index d0cb2f53..21646be6 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlRepairTickets.java @@ -100,9 +100,14 @@ public class DlRepairTickets extends TenantBaseDO { private String repairAdvice; /** - * 质保说明 + * 质保说明(公里) */ - private String qualityExplain; + private String qualityMileage; + + /** + * 质保说明(天数) + */ + private String qualityDay; /** * 是否终检(字典yes_no);已存在于系统中(是:0,否:1) @@ -148,4 +153,7 @@ public class DlRepairTickets extends TenantBaseDO { /** 工单总价 */ private BigDecimal totalPrice; + + /** 是否已结算 */ + private String ticketsStatus; } 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 b55826f6..fd13a7a6 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 @@ -1,8 +1,12 @@ package cn.iocoder.yudao.module.tickets.mapper; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 针对表【dl_repair_tickets(维修工单表)】的数据库操作Mapper @@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DlRepairTicketsMapper extends BaseMapper { + /** + * 维修工单表 分页 + * + * @author 小李 + * @date 20:51 2024/9/20 + * @param repairTicketsReqVO 查询对象 + **/ + IPage getTicketsPage(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO, Page page); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java index 0bed0861..347ee14e 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTicketsService.java @@ -1,7 +1,10 @@ package cn.iocoder.yudao.module.tickets.service; import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; /** @@ -20,4 +23,13 @@ public interface DlRepairTicketsService extends IService { * @param ticketsRespVO 新增对象 **/ void createTickets(DlRepairTicketsRespVO ticketsRespVO); + + /** + * 维修工单表 分页 + * + * @author 小李 + * @date 20:51 2024/9/20 + * @param repairTicketsReqVO 查询对象 + **/ + IPage getTicketsPage(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 afaba428..107496fb 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 @@ -7,7 +7,11 @@ import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import cn.iocoder.yudao.module.tickets.mapper.DlRepairTicketsMapper; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; +import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO; import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; @@ -38,6 +42,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getTicketsPage(DlRepairTicketsReqVO repairTicketsReqVO, Page page){ + return baseMapper.getTicketsPage(repairTicketsReqVO, page); + } } 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 be4b3493..9b95ca65 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -21,7 +21,8 @@ - + + @@ -33,6 +34,7 @@ + @@ -52,7 +54,8 @@ adviser_name, pay_type, repair_advice, - quality_explain, + quality_mileage, + quality_day, end_check, part_disposal, remark, @@ -63,8 +66,16 @@ project_price, part_price, other_price, - total_price + total_price, + tickets_status from dl_repair_tickets drt where drt.deleted = '0' + +