From 4920ad7b25254225eb0add076141f9c1eabfdada Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 13 Nov 2024 17:12:28 +0800 Subject: [PATCH] 1 --- .../iocoder/yudao/common/RecordTypeEnum.java | 3 +++ .../yudao/common/TicketsStatusEnum.java | 4 ++++ .../admin/DlRepairTicketsController.java | 13 +++++++++++ .../service/DlRepairTicketsService.java | 8 +++++++ .../impl/DlRepairTicketsServiceImpl.java | 22 +++++++++++++++++++ .../mapper/tickets/DlRepairTicketsMapper.xml | 9 ++++---- 6 files changed, 55 insertions(+), 4 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java index 9955cce4..e232af30 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RecordTypeEnum.java @@ -76,6 +76,9 @@ public enum RecordTypeEnum { /** 删除工单 */ SCGG("scgg", "删除工单"), + /** 删除工单 */ + JC("jc", "交车"), + /** 内返派工 */ NFPG("nfpg", "内返派工"); diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java index 26b53e87..ce29b4bb 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/TicketsStatusEnum.java @@ -27,6 +27,10 @@ public enum TicketsStatusEnum { * 待通知客户取车 */ WAITING_NOTICE("07","待通知客户取车"), + /** + * 已交车 + */ + OVER("08","已交车"), /** * 挂单/记账 */ 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 b9999f3b..2332f8d5 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 @@ -297,6 +297,19 @@ public class DlRepairTicketsController { return CommonResult.ok(); } + /** + * 服务顾问交车 + * @author vinjor-M + * @date 16:51 2024/11/13 + * @param respVO + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PostMapping("/overOrder") + @Operation(summary = "服务顾问交车") + public CommonResult overOrder(@RequestBody DlRepairTicketsRespVO respVO) { + dlRepairTicketsService.overOrder(respVO); + return CommonResult.ok(); + } /** * 从总检的角度差维修中、已完成的工单数量 * @author vinjor-M 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 1992f8c5..f7d0f273 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 @@ -235,4 +235,12 @@ public interface DlRepairTicketsService extends IService { * @param id 工单ID **/ void removeTicketById(String id); + + /** + * 服务顾问交车 + * @author vinjor-M + * @date 16:51 2024/11/13 + * @param respVO + **/ + void overOrder(DlRepairTicketsRespVO respVO); } 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 9f9a64a4..45b02a46 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 @@ -1637,6 +1637,28 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl() + .set(DlRepairTickets::getTicketsWorkStatus, TicketsWorkStatusEnum.END.getCode()) + .set(DlRepairTickets::getTicketsStatus, TicketsStatusEnum.OVER.getCode()) + //交车时才能把工单置为完成 + .set(DlRepairTickets::getIsFinish,"1") + .eq(DlRepairTickets::getId, respVO.getId()) + ); + + // 记录日志 + repairRecordsService.saveRepairRecord(respVO.getId(), null, RecordTypeEnum.JC.getCode(), respVO.getRemark(), respVO.getImage()); + } } 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 f162f649..ab9ede97 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -216,7 +216,7 @@ from dl_repair_tickets drt left join dl_repair_titem drti on drt.id = drti.ticket_id AND drti.deleted = '0' - where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07') + where (drt.deleted = '0') AND drt.tickets_status IN ('04','05','01','07','06','02') and ( drt.ticket_no like concat('%', #{map.ticketNo}, '%') @@ -255,10 +255,11 @@ ) + -- 服务顾问和仓管查待办都是查未结束的工单 -- + AND drt.is_finish = '0' - -- 查服务顾问 待处理的 工单未完成并且服务顾问是自己的 工单已完成且当前处理人是自己的-- - AND ( drt.is_finish = '0' AND drt.adviser_id = #{map.adviserId} ) - OR (drt.is_finish = '1' AND drt.now_repair_id = #{map.adviserId}) + -- 查服务顾问 当前处理人或服务顾问是自己的-- + AND ( drt.adviser_id = #{map.adviserId} OR drt.now_repair_id = #{map.adviserId}) -- 查总检待处理的 --