From a76a19816129290f9b5a2189b83267a338cf9dc6 Mon Sep 17 00:00:00 2001 From: PQZ Date: Sat, 19 Oct 2024 16:07:17 +0800 Subject: [PATCH 1/2] 1111 --- .../admin/DlTicketWaresController.java | 13 ++++++++++ .../tickets/service/DlTicketWaresService.java | 11 ++++++++ .../impl/DlTicketWaresServiceImpl.java | 26 +++++++++++++++++++ 3 files changed, 50 insertions(+) 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; + } + /** * 新增、修改 * From 78147d738215af09a683f6ce02524a246cbb9ed5 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Sat, 19 Oct 2024 18:09:16 +0800 Subject: [PATCH 2/2] 1 --- .../admin/RepairRecordsController.java | 39 ++++- .../base/mapper/RepairRecordsMapper.java | 10 +- .../base/service/RepairRecordsService.java | 9 ++ .../impl/RepairRecordsServiceImpl.java | 14 ++ .../mapper/base/RepairRecordsMapper.xml | 16 ++ .../mapper/tickets/DlRepairTicketsMapper.xml | 139 ++++++++++-------- 6 files changed, 159 insertions(+), 68 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java index 755a6ab0..b9328637 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/controller/admin/RepairRecordsController.java @@ -1,12 +1,16 @@ package cn.iocoder.yudao.module.base.controller.admin; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.base.entity.RepairRecordsItem; +import cn.iocoder.yudao.module.base.service.RepairRecordsItemService; import cn.iocoder.yudao.module.base.service.RepairRecordsService; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; /** * 维修记录 管理 API @@ -20,6 +24,37 @@ public class RepairRecordsController { @Resource private RepairRecordsService repairRecordsService; + @Resource + private RepairRecordsItemService repairRecordsItemService; + + /** + * 根据当前用户和工单主表id查询当前在维修的项目信息 + * @author vinjor-M + * @date 13:50 2024/10/19 + * @param ticketId 工单ID + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @GetMapping("/listByTicketId") + @Operation(summary = "根据当前用户和工单主表id查询当前在维修的项目信息") + public CommonResult selectNowRepairByTicketId(@RequestParam("ticketId") String ticketId) { + return repairRecordsService.selectNowRepairByTicketId(ticketId); + } + + /** + * 维修记录图片授权客户查看接口--收回查看权限也走这个 + * @author vinjor-M + * @date 13:50 2024/10/19 + * @param itemList 子表集和 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + @PostMapping("/updateItemBatch") + @Operation(summary = "维修记录图片授权客户查看接口--收回查看权限也走这个") + public CommonResult updateItemBatch(@RequestBody List itemList) { + if(!itemList.isEmpty()){ + repairRecordsItemService.updateBatchById(itemList); + } + return CommonResult.success(""); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java index d37a3b0e..f38b5410 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/mapper/RepairRecordsMapper.java @@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 维修记录 Mapper @@ -26,6 +27,13 @@ public interface RepairRecordsMapper extends BaseMapper { */ List queryRepairRecords(@Param("entity") RepairRecordsPageReqVO entity); - + /** + * 根据当前用户和工单主表id查询当前在维修的项目信息 + * @author vinjor-M + * @date 13:36 2024/10/19 + * @param ticketId 工单ID + * @return java.util.Map + **/ + Map selectNowRepairByTicketId(@Param("ticketId")String ticketId); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java index 742c36fb..81830573 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/RepairRecordsService.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.base.service; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.base.entity.RepairRecords; import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO; import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO; @@ -36,4 +37,12 @@ public interface RepairRecordsService extends IService { **/ List queryList(RepairRecordsPageReqVO pageReqVO); + /** + * 根据当前用户和工单主表id查询当前在维修的项目信息 + * @author vinjor-M + * @date 13:35 2024/10/19 + * @param ticketId 工单id + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult + **/ + CommonResult selectNowRepairByTicketId(String ticketId); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java index b04a9d8b..ceca1561 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/base/service/impl/RepairRecordsServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.base.service.impl; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.base.entity.RepairRecords; import cn.iocoder.yudao.module.base.entity.RepairRecordsItem; @@ -88,4 +89,17 @@ public class RepairRecordsServiceImpl extends ServiceImpl + * @author vinjor-M + * @date 13:35 2024/10/19 + **/ + @Override + public CommonResult selectNowRepairByTicketId(String ticketId) { + return CommonResult.success(repairRecordsMapper.selectNowRepairByTicketId(ticketId)); + } } diff --git a/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml b/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml index 4885f903..639bcf69 100644 --- a/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/base/RepairRecordsMapper.xml @@ -29,5 +29,21 @@ order by create_time desc + diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml index 72a44b68..809307fb 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlRepairTicketsMapper.xml @@ -46,28 +46,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + @@ -157,30 +181,9 @@ order by drt.create_time desc - + select drt.* from dl_repair_tickets drt - left join dl_repair_titem drti - on drt.id = drti.ticket_id AND drti.deleted = '0' where drt.deleted = '0' and ( @@ -215,27 +218,32 @@ order by drt.create_time desc - + select drti.id , + drti.ticket_id , + drti.item_name , + drti.item_count , + drti.item_unit , + drti.item_price , + drti.item_discount , + drti.item_money , + drti.repair_ids , + drti.repair_names , + drti.sale_id , + drti.sale_name , + drti.item_type , + drti.project_id , + drti.part_id , + drti.other_id , + drti.item_type_id , + drti.item_status , + drti.remark + from dl_repair_titem drti + where drti.ticket_id = #{id} AND drti.deleted = '0' + + +