From 2f566cfeb05ff3f3f3aa1f2a2ad119e53142e2ca Mon Sep 17 00:00:00 2001 From: Vinjor Date: Fri, 18 Oct 2024 23:47:21 +0800 Subject: [PATCH 1/2] 1 --- .../impl/DlRepairTicketsServiceImpl.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) 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 a3bea824..7b13e75b 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 @@ -54,6 +54,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.deepoove.poi.XWPFTemplate; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -552,16 +553,20 @@ 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()) - ); + if(StringUtils.isNotEmpty(respVO.getTicketsWorkStatus())){ + // 更新工单主表 + baseMapper.update(new LambdaUpdateWrapper() + .set(DlRepairTickets::getTicketsWorkStatus, respVO.getTicketsWorkStatus()) + .eq(DlRepairTickets::getId, respVO.getId()) + ); + } + if(null!=respVO.getItem() && StringUtils.isNotEmpty(respVO.getItem().getItemStatus())){ + // 更新工单子表 + titemService.update(new LambdaUpdateWrapper() + .set(DlRepairTitem::getItemStatus, respVO.getItem().getItemStatus()) + .eq(DlRepairTitem::getId, respVO.getItem().getId()) + ); + } // 记录日志 recordsService.saveRepairRecord(respVO.getId(), respVO.getItem().getId(), respVO.getRecordType(), respVO.getRemark(), respVO.getImage()); } From 8fcdb5ef18f031830eb25c7583ba8b4c10856948 Mon Sep 17 00:00:00 2001 From: PQZ Date: Fri, 18 Oct 2024 23:48:04 +0800 Subject: [PATCH 2/2] 111 --- .../tickets/service/impl/DlRepairTicketsServiceImpl.java | 2 ++ .../iocoder/yudao/module/tickets/vo/DlRepairTicketsRespVO.java | 3 +++ 2 files changed, 5 insertions(+) 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 a3b633d2..8f9ba188 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 @@ -273,6 +273,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl repairProjects = projectService.listByIds(ids); items.forEach(item -> repairProjects.stream().filter(i -> i.getId().equals(item.getProjectId())).findFirst().ifPresent(item::setProject)); } + result.setProjects(projects); // 取配件 List wares = items.stream().filter(item -> item.getItemType().equals("02")).collect(Collectors.toList()); @@ -281,6 +282,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl repairWares = waresService.listByIds(ids); items.forEach(item -> repairWares.stream().filter(i -> i.getId().equals(item.getPartId())).findFirst().ifPresent(item::setWare)); } + result.setWares(wares); // 取附加 List others = items.stream().filter(item -> item.getItemType().equals("03")).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(others)) { 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 1ec18ecf..ae23dd7c 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 @@ -45,4 +45,7 @@ public class DlRepairTicketsRespVO extends DlRepairTickets { private CustomerMain customerInfo; /** 车辆信息 */ private CarMainRespVO carInfo; + List wares; + List projects; + }