From acb3262ca28e7d1629ad10801d92fcda379044be Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Wed, 23 Oct 2024 14:29:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=E6=9A=82?= =?UTF-8?q?=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DlRepairSoServiceImpl.java | 4 ++- .../admin/DlRepairTicketsController.java | 19 ++++++++++++++ .../service/DlRepairTicketsService.java | 10 +++++++ .../impl/DlRepairTicketsServiceImpl.java | 26 ++++++++++++++++++- 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java index 1f1dd665..fa9dbe31 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/stockOperate/service/impl/DlRepairSoServiceImpl.java @@ -171,6 +171,7 @@ public class DlRepairSoServiceImpl extends ServiceImpl i.getGoodsId().equals(item.getPartId())).findFirst().ifPresent(i -> { titem.setItemCount(item.getItemCount() - i.getGoodsCount()); - titem.setItemMoney(new BigDecimal(titem.getItemCount()).multiply(item.getItemPrice()).multiply(item.getItemDiscount())); + BigDecimal itemDiscount = ObjectUtil.isNotEmpty(item.getItemDiscount()) ? item.getItemDiscount() : BigDecimal.ONE; + titem.setItemMoney(new BigDecimal(titem.getItemCount()).multiply(item.getItemPrice()).multiply(itemDiscount)); }); return titem; }).collect(Collectors.toList()); 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 9e29197e..093efbac 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 @@ -247,5 +247,24 @@ public class DlRepairTicketsController { dlRepairTicketsService.updateShow(id, show); return CommonResult.ok(); } + + /** + * 查待总检或待出厂检验的工单 + * 维修服务顾问和总检用的 + * + * @author 小李 + * @date 11:40 2024/10/23 + * @param repairTicketsReqVO 请求对象 + * @param pageNo 页码 + * @param pageSize 条数 + **/ + @GetMapping("/pageByRole") + @Operation(summary = "查待总检或待出厂检验的工单") + public CommonResult getPageByRole(DlRepairTicketsReqVO repairTicketsReqVO, + @RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo, + @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ + Page page = new Page<>(pageNo, pageSize); + return success(dlRepairTicketsService.getPageByRole(repairTicketsReqVO, page)); + } } 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 bfae38a6..bb8ed44e 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 @@ -135,4 +135,14 @@ public interface DlRepairTicketsService extends IService { * @param show 是否可见 **/ void updateShow(String id, String show); + + /** + * 查待总检或待出厂检验的工单 + * 维修服务顾问和总检用的 + * + * @author 小李 + * @date 11:40 2024/10/23 + * @param repairTicketsReqVO 请求对象 + **/ + IPage getPageByRole(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 20caceac..f6b70473 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 @@ -621,7 +621,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl() .set(DlRepairTickets::getNowRepairId, user.getId()) - .eq(DlRepairTickets::getNowRepairName, user.getNickname())); + .set(DlRepairTickets::getNowRepairName, user.getNickname()) + .eq(DlRepairTickets::getId, respVO.getId())); repairWorkerService.sentMessage(user.getId(), "您有新的工单需要总检"); } else { ids.forEach(id -> { @@ -679,6 +680,29 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getPageByRole(DlRepairTicketsReqVO repairTicketsReqVO, Page page){ + String userRoleCode = getUserRole(); + // 维修服务顾问 + if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())){ + + }else if (userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())){ + // 总检 + }else { + return null; + } + // 还是用分类查询,不过需要重新构造查询条件 todo + return baseMapper.getPageType(repairTicketsReqVO, page); + } }