From 257d66798aa538f8737980f13d94c547bf0b51ea Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期三, 15 一月 2025 15:37:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 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 b1df1da..951f527 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
@@ -1,5 +1,6 @@
package com.ruoyi.other.service.impl;
+import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,6 +9,7 @@
import com.ruoyi.account.api.feignClient.AppUserShopClient;
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.api.model.AppUserShop;
+import com.ruoyi.account.api.model.UserAddress;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.page.PageInfo;
import com.ruoyi.common.security.service.TokenService;
@@ -70,10 +72,16 @@
Optional<AppUserShop> first = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() == 3).findFirst();
Integer technicianId = null;
if(first.isPresent()){
- AppUserShop appUserShop = first.get();
- Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId())
- .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 1));
- technicianId = technician.getId();
+ //既是店员又是技师,需要取员工身份获取列表数据
+ Optional<AppUserShop> first1 = data.stream().filter(s -> s.getShopId() == shopId.intValue() && s.getRoleType() != 3).findFirst();
+ if(!first1.isPresent()){
+ AppUserShop appUserShop = first.get();
+ Technician technician = technicianService.getOne(new LambdaQueryWrapper<Technician>().eq(Technician::getAppUserId, appUserShop.getAppUserId())
+ .eq(Technician::getShopId, appUserShop.getShopId()).eq(Technician::getDelFlag, 0).eq(Technician::getStatus, 2));
+ if(null != technician){
+ technicianId = technician.getId();
+ }
+ }
}
List<TechnicianSubscribeVO> list = technicianSubscribeMapper.getTechnicianSubscribeByUserAndShop(pageInfo, shopId, status, technicianId);
for (TechnicianSubscribeVO technicianSubscribeVO : list) {
@@ -82,6 +90,11 @@
AppUser appUser = appUserClient.getAppUserById(technicianSubscribe.getAppUserId());
technicianSubscribeVO.setUserName(appUser.getName());
technicianSubscribeVO.setPhone(appUser.getPhone());
+ Integer serviceMode = technicianSubscribeVO.getServiceMode();
+ if(1 == serviceMode){
+ UserAddress userAddress = JSON.parseObject(technicianSubscribeVO.getUserAddress(), UserAddress.class);
+ technicianSubscribeVO.setUserAddress(userAddress.getProvince() + userAddress.getCity() + userAddress.getDistrict() + userAddress.getRecieveAddress());
+ }
}
return pageInfo.setRecords(list);
}
--
Gitblit v1.7.1