diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java index 7c8e291f..29036f23 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/controller/admin/DlTicketWaresController.java @@ -46,6 +46,19 @@ public class DlTicketWaresController { return success(dlTicketWaresService.getPage(reqVO, page)); } + /** + * 查询当前工单下的配件申请单 + * @author PQZ + * @date 13:43 2024/10/19 + * @param reqVO DlTicketWaresReqVO实体 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @GetMapping("/list") + @Operation(summary = "不分页查询待审批的配件申请单") + public CommonResult list(DlTicketWaresReqVO reqVO){ + return success(dlTicketWaresService.listByTicket(reqVO)); + } + /** * 新增、修改 * diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlTicketWaresService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlTicketWaresService.java index 12de0b0e..ed4a6a8a 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlTicketWaresService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/DlTicketWaresService.java @@ -7,6 +7,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_ticket_wares(工单配件申请/退回表)】的数据库操作Service * @@ -24,6 +26,15 @@ public interface DlTicketWaresService extends IService { **/ IPage getPage(DlTicketWaresReqVO reqVO, Page page); + /** + * 查询当前工单下的配件申请单 + * @author PQZ + * @date 13:44 2024/10/19 + * @param reqVO DlTicketWaresReqVO + * @return java.util.List + **/ + List listByTicket(DlTicketWaresReqVO reqVO); + /** * 新增、修改 * diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java index c0e5de94..049e6389 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java @@ -33,6 +33,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -120,6 +121,31 @@ public class DlTicketWaresServiceImpl extends ServiceImpl + * @author PQZ + * @date 13:44 2024/10/19 + **/ + @Override + public List listByTicket(DlTicketWaresReqVO reqVO) { + // 确认查看者身份 + String userRoleCode = repairTicketsService.getUserRole(); + List result = new ArrayList<>(); + //维修业务管理员、总检、服务顾问均可以进行审批 + if (userRoleCode.equals(RepairRoleEnum.ADMIN.getCode())|| userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())||userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())){ + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(DlTicketWares::getTicketId,reqVO.getTicketId()); + if (null != reqVO.getStatus()){ + lambdaQueryWrapper.eq(DlTicketWares::getStatus,reqVO.getStatus()); + } + result = list(lambdaQueryWrapper); + } + return result; + } + /** * 新增、修改 *