From f2c0fbf010b204ec397097091381af5255804c93 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Fri, 18 Oct 2024 15:32:05 +0800 Subject: [PATCH 1/5] =?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 --- .../cn/iocoder/yudao/common/BaseConstants.java | 7 ++++--- .../admin/DlRepairTitemController.java | 13 +++++++++++++ .../tickets/service/DlRepairTitemService.java | 12 ++++++++++++ .../service/impl/DlRepairTitemServiceImpl.java | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java index 564a4167..c4e307a0 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/common/BaseConstants.java @@ -119,7 +119,8 @@ public class BaseConstants { public static final String REPAIR_RECORD_TYPE_ZJ = "zj"; /**结束工单*/ public static final String REPAIR_RECORD_TYPE_JSGD = "jsgd"; - - - + /** 开始施工 */ + public static final String REPAIR_RECORD_TYPE_KSSG = "kssg"; + /** 施工中 */ + public static final String REPAIR_RECORD_TYPE_SGZ = "sgz"; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java index b6bbc2fa..072e1a0c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlRepairTitemController.java @@ -48,5 +48,18 @@ public class DlRepairTitemController { Page page = new Page<>(pageNo, pageSize); return success(dlRepairTitemService.getTItemPage(repairTitemRespVO, page)); } + + /** + * 获取当前操作人操作的工单中的项目 + * + * @author 小李 + * @date 15:01 2024/10/18 + * @param ticketId 工单ID + **/ + @GetMapping("/listProject") + @Operation(summary = "获取当前操作人操作的工单中的项目") + public CommonResult getProjectList(@RequestParam("ticketId") String ticketId){ + return success(dlRepairTitemService.getProjectList(ticketId)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java index fea0013d..82bd2045 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlRepairTitemService.java @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * 针对表【dl_repair_titem(维修工单子表)】的数据库操作Service * @@ -22,4 +24,14 @@ public interface DlRepairTitemService extends IService { * @param repairTitemRespVO 查询对象 **/ IPage getTItemPage(DlRepairTitemRespVO repairTitemRespVO, Page page); + + /** + * 获取当前操作人操作的工单中的项目 + * + * @param ticketId 工单ID + * @author 小李 + * @date 15:01 2024/10/18 + **/ + List getProjectList(String ticketId); + } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java index b972b1d2..c2f0a9b5 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTitemServiceImpl.java @@ -4,11 +4,14 @@ import cn.iocoder.yudao.module.tickets.entity.DlRepairTitem; import cn.iocoder.yudao.module.tickets.mapper.DlRepairTitemMapper; import cn.iocoder.yudao.module.tickets.service.DlRepairTitemService; import cn.iocoder.yudao.module.tickets.vo.DlRepairTitemRespVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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; +import java.util.List; + /** * 针对表【dl_repair_titem(维修工单子表)】的数据库操作Service实现 * @@ -30,6 +33,21 @@ public class DlRepairTitemServiceImpl extends ServiceImpl getTItemPage(DlRepairTitemRespVO repairTitemRespVO, Page page){ return baseMapper.getTItemPage(repairTitemRespVO, page); } + + /** + * 获取当前操作人操作的工单中的项目 + * + * @param ticketId 工单ID + * @author 小李 + * @date 15:01 2024/10/18 + **/ + @Override + public List getProjectList(String ticketId){ + return baseMapper.selectList(new LambdaQueryWrapper().and(item -> { + item.eq(DlRepairTitem::getItemType, "01") + .eq(DlRepairTitem::getTicketId, ticketId); + })); + } } From bbcd90f9d5d32a98bb9127fc6f1f4aa67ff9382d Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Fri, 18 Oct 2024 16:36:09 +0800 Subject: [PATCH 2/5] =?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 --- .../admin/DlRepairTicketsController.java | 14 ++++++++++ .../service/DlRepairTicketsService.java | 10 +++++++ .../impl/DlRepairTicketsServiceImpl.java | 27 +++++++++++++++++++ .../tickets/vo/DlRepairTicketsRespVO.java | 6 +++++ 4 files changed, 57 insertions(+) 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..14977811 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 @@ -213,5 +213,19 @@ public class DlRepairTicketsController { dlRepairTicketsService.updateRepair(reqVO); return CommonResult.ok(); } + + /** + * 更新工单状态 + * + * @author 小李 + * @date 15:46 2024/10/18 + * @param respVO 请求对象 + **/ + @GetMapping("/updateStatus") + @Operation(summary = "更新工单状态") + public CommonResult updateStatus(@RequestBody DlRepairTicketsRespVO respVO){ + dlRepairTicketsService.updateStatus(respVO); + return CommonResult.ok(); + } } 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 e835c805..c8c24f75 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 @@ -116,4 +116,14 @@ public interface DlRepairTicketsService extends IService { * @param reqVO 请求对象 **/ void updateRepair(DlRepairTicketsReqVO reqVO); + + /** + * 更新工单状态 + * + * @param respVO 请求对象 + * @author 小李 + * @date 15:46 2024/10/18 + **/ + void updateStatus(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 8cc502f6..cdf3867f 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 @@ -9,6 +9,7 @@ import cn.iocoder.yudao.common.TicketsStatusEnum; import cn.iocoder.yudao.common.TicketsWorkStatusEnum; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.base.entity.RepairWorker; +import cn.iocoder.yudao.module.base.service.RepairRecordsService; import cn.iocoder.yudao.module.base.service.RepairWorkerService; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; @@ -135,6 +136,9 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl() + .set(DlRepairTickets::getTicketsWorkStatus, respVO.getTicketsWorkStatus()) + .eq(DlRepairTickets::getId, respVO.getId()) + ); + // 更新工单子表 + titemService.update(new LambdaUpdateWrapper() + .set(DlRepairTitem::getItemStatus, respVO.getItem().getItemStatus()) + .eq(DlRepairTitem::getId, respVO.getItem().getId()) + ); + // 记录日志 + recordsService.saveRepairRecord(respVO.getId(), respVO.getItem().getId(), "", respVO.getRemark(), respVO.getImage()); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java index 7a842e9b..8ab3e9eb 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java @@ -25,4 +25,10 @@ public class DlRepairTicketsRespVO extends DlRepairTickets { /** 预约记录ID */ private String bookingId; + + /** 图片路径 */ + private String image; + + /** 子表单条数据 */ + private DlRepairTitem item; } From 524a66e6f1162f4bb96fcb721578f02a05266e1f Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 17:48:29 +0800 Subject: [PATCH 3/5] 1 --- .../src/main/java/cn/iocoder/yudao/common/RepairCons.java | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java 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 new file mode 100644 index 00000000..8a5a45c4 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java @@ -0,0 +1,2 @@ +package cn.iocoder.yudao.common;public class RepairCons { +} From 457c896ce815d9dac73d4132d81641bf2c24d296 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 17:50:45 +0800 Subject: [PATCH 4/5] 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 + + +