From d5bf846770b001cac64ca27a3fe2886a9c5076b3 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期三, 15 一月 2025 19:47:29 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java index 951f527..93a1013 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java @@ -88,8 +88,10 @@ String id = technicianSubscribeVO.getId(); TechnicianSubscribe technicianSubscribe = this.getById(id); AppUser appUser = appUserClient.getAppUserById(technicianSubscribe.getAppUserId()); - technicianSubscribeVO.setUserName(appUser.getName()); - technicianSubscribeVO.setPhone(appUser.getPhone()); + if(null != appUser){ + technicianSubscribeVO.setUserName(appUser.getName()); + technicianSubscribeVO.setPhone(appUser.getPhone()); + } Integer serviceMode = technicianSubscribeVO.getServiceMode(); if(1 == serviceMode){ UserAddress userAddress = JSON.parseObject(technicianSubscribeVO.getUserAddress(), UserAddress.class); @@ -113,7 +115,14 @@ } @Override public IPage<TechnicianSubscribeVO> getTechnicianSubscribeByUser(Page<TechnicianSubscribe> page, Long userId, Integer status) { - return technicianSubscribeMapper.getTechnicianSubscribeByUser(page, userId, status); + IPage<TechnicianSubscribeVO> technicianSubscribeByUser = technicianSubscribeMapper.getTechnicianSubscribeByUser(page, userId, status); + technicianSubscribeByUser.getRecords().forEach(technicianSubscribeVO -> { + UserAddress userAddress = JSON.parseObject(technicianSubscribeVO.getUserAddress(), UserAddress.class); + if (userAddress != null){ + technicianSubscribeVO.setUserAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress()); + } + }); + return technicianSubscribeByUser; } @Override -- Gitblit v1.7.1