1.
phpcjl
2024-12-09 097b9534a78606e113d58111fa7da285bacf3919
1.
3个文件已修改
32 ■■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianServiceImpl.java
@@ -1,11 +1,16 @@
package com.ruoyi.other.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.account.api.feignClient.UserAddressClient;
import com.ruoyi.account.api.model.UserAddress;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.mapper.TechnicianMapper;
import com.ruoyi.other.api.domain.Technician;
import com.ruoyi.other.service.TechnicianService;
import com.ruoyi.other.vo.TechnicianDetailVO;
import com.ruoyi.other.vo.TechnicianVO;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -23,6 +28,10 @@
public class TechnicianServiceImpl extends ServiceImpl<TechnicianMapper, Technician> implements TechnicianService {
    @Resource
    private TechnicianMapper technicianMapper;
    @Resource
    private TokenService tokenService;
    @Resource
    private UserAddressClient userAddressClient;
    @Override
    public List<TechnicianVO> getTechnicianListByShopId(Long shopId) {
@@ -31,6 +40,13 @@
    @Override
    public TechnicianDetailVO technicianDetail(Long technicianId) {
        return technicianMapper.selectTechnicianDetail(technicianId);
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        R<UserAddress> defaultUserAddressR = userAddressClient.getDefaultUserAddress(loginUserApplet.getUserid());
        if (R.isError(defaultUserAddressR)){
            throw new RuntimeException("获取默认地址失败");
        }
        TechnicianDetailVO technicianDetailVO = technicianMapper.selectTechnicianDetail(technicianId);
        technicianDetailVO.setAddress(defaultUserAddressR.getData());
        return technicianDetailVO;
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/TechnicianDetailVO.java
@@ -1,5 +1,6 @@
package com.ruoyi.other.vo;
import com.ruoyi.account.api.model.UserAddress;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -49,4 +50,13 @@
    @ApiModelProperty(value = "技师详情图")
    private String infoPicture;
    @ApiModelProperty(value = "预约状态(1=可预约,2=不可预约)")
    private Integer subscribeStatus;
    /**
     * 默认地址
     */
    @ApiModelProperty(value = "默认地址")
    private UserAddress address;
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TechnicianMapper.xml
@@ -16,7 +16,6 @@
        WHERE
          tt.`status` = 2
          AND tt.del_flag = 0
          AND tt.subscribe_status = 1
          AND tt.shop_id = #{shopId}
        GROUP BY
            tt.id,
@@ -27,6 +26,7 @@
    <select id="selectTechnicianDetail" resultType="com.ruoyi.other.vo.TechnicianDetailVO">
        SELECT
            tt.id,
            tt.subscribe_status,
            tt.`name`,
            tt.introduction,
            tt.home_picture,
@@ -41,10 +41,10 @@
        WHERE
          tt.`status` = 2
          AND tt.del_flag = 0
          AND tt.subscribe_status = 1
          AND tt.id = #{technicianId}
        GROUP BY
            tt.id,
            tt.subscribe_status,
            tt.`name`,
            tt.introduction,
            tt.home_picture,