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; }