From 78147d738215af09a683f6ce02524a246cbb9ed5 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Sat, 19 Oct 2024 18:09:16 +0800 Subject: [PATCH] 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' + + +