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 2cd16fc3..bc4ca37e 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; @@ -273,6 +274,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 +283,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)) { @@ -552,16 +555,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()); } 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; + }