From d3af9838737bc2aceb438aecbf6e175acc05f211 Mon Sep 17 00:00:00 2001 From: xiaofajia <1665375861@qq.com> Date: Mon, 18 Nov 2024 16:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E7=94=B3=E8=AF=B7=E5=8D=95?= =?UTF-8?q?=E5=AD=90=E9=A1=B9=E5=8F=AF=E4=BB=A5=E6=90=9C=E7=B4=A2=E3=80=81?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E7=BB=99=E4=B8=8D=E7=BB=99?= =?UTF-8?q?=E4=BF=9D=E9=99=A9=E5=85=AC=E5=8F=B8=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/DlTicketWaresController.java | 14 +++++++++++ .../module/tickets/entity/DlTicketWares.java | 12 +++++++++ .../tickets/service/DlTicketWaresService.java | 9 +++++++ .../impl/DlTicketWaresServiceImpl.java | 25 +++++++++++++++++++ .../mapper/tickets/DlTicketWaresMapper.xml | 10 +++++++- 5 files changed, 69 insertions(+), 1 deletion(-) 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 b45aee45..26726bac 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 @@ -181,5 +181,19 @@ public class DlTicketWaresController { public CommonResult getById(@RequestParam("id") String id){ return success(dlTicketWaresService.getById(id)); } + + /** + * 修改是否传给保险公司 + * + * @author 小李 + * @date 15:48 2024/11/18 + * @param respVO 对象 + **/ + @PostMapping("/updateSafe") + @Operation(summary = "修改是否传给保险公司") + public CommonResult updateSafe(@RequestBody DlTicketWaresRespVO respVO){ + dlTicketWaresService.updateSafe(respVO); + return CommonResult.ok(); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java index bf15ed68..7a76be51 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/entity/DlTicketWares.java @@ -68,4 +68,16 @@ public class DlTicketWares extends TenantBaseDO { /** 多个图片地址,英文逗号分隔(拍照上传配件申请单时用) */ private String images; + + /** 是否传给保险公司(字典yes_no,1:是,0:否,默认0) */ + private String toSafe; + + /** 保险公司名称 */ + private String safeName; + + /** 保险公司联系人 */ + private String safeContact; + + /** 保险公司联系电话 */ + private String safeMobile; } \ No newline at end of file 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 dd15fa14..c2f0cf73 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 @@ -104,4 +104,13 @@ public interface DlTicketWaresService extends IService { * @date 15:38 2024/10/22 **/ Map getWorkerTodo(); + + /** + * 修改是否传给保险公司 + * + * @author 小李 + * @date 15:48 2024/11/18 + * @param respVO 对象 + **/ + void updateSafe(DlTicketWaresRespVO respVO); } 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 27ba510d..21130d39 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 @@ -37,6 +37,7 @@ import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.context.annotation.Lazy; @@ -627,6 +628,30 @@ public class DlTicketWaresServiceImpl extends ServiceImpl lambdaUpdate = Wrappers.lambdaUpdate(DlTicketWares.class); + lambdaUpdate.eq(DlTicketWares::getId, respVO.getId()); + lambdaUpdate.set(DlTicketWares::getToSafe, respVO.getToSafe()); + // 根据状态更新 + if (toSafe.equals("1")){ + lambdaUpdate.set(DlTicketWares::getSafeName, respVO.getSafeName()); + lambdaUpdate.set(DlTicketWares::getSafeContact, respVO.getSafeContact()); + lambdaUpdate.set(DlTicketWares::getSafeMobile, respVO.getSafeMobile()); + } + // 更新 + baseMapper.update(lambdaUpdate); + } } diff --git a/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml b/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml index b5c39221..25bdb30d 100644 --- a/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml @@ -22,6 +22,10 @@ + + + + @@ -42,7 +46,11 @@ dtw.status, dtw.remark, dtw.create_time, - dtw.images + dtw.images, + dtw.to_safe, + dtw.safe_name, + dtw.safe_contact, + dtw.safe_mobile from dl_ticket_wares dtw left join dl_repair_tickets drt on dtw.ticket_id = drt.id