Compare commits

...

4 Commits

Author SHA1 Message Date
PQZ
0a2d105eb1 1 2024-09-24 18:18:00 +08:00
PQZ
aeae65bc6d 1 2024-09-24 18:05:37 +08:00
PQZ
d04b16a64e Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system 2024-09-24 17:17:25 +08:00
PQZ
4ddb4d34dd 1 2024-09-24 17:17:18 +08:00
3 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.app.customer.admin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.conf.entity.BaseType;
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 客户管理API
* @author PQZ
* @date 18:17 2024/9/24
**/
@RestController
@RequestMapping("/userClient/customer")
public class CustomerMainApi {
@Resource
private CustomerMainService customerMainService;
/**
* 查询当前登录客户信息
* @author PQZ
* @date 17:24 2024/9/24
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO>
**/
@GetMapping("/getUserCustomer")
@Operation(summary = "获取当前登录用户的客户信息")
public CommonResult<CustomerMainRespVO> getUserCustomer() {
return success(customerMainService.getUserCustomer());
}
}

View File

@ -50,6 +50,16 @@ public interface CustomerMainService extends IService<CustomerMain> {
**/
CustomerMainRespVO getCustomerById(String id);
/**
* 获取当前登录用户的客户信息
* @author PQZ
* @date 17:27 2024/9/24
* @return cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO
**/
CustomerMainRespVO getUserCustomer();
/**
* 根据经办人所属企业查询经办人信息
*

View File

@ -6,6 +6,8 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.custom.entity.CustomerCar;
import cn.iocoder.yudao.module.custom.entity.CustomerItem;
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
@ -190,6 +192,22 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
return result;
}
/**
* 获取当前登录用户的客户信息
*
* @return cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO
* @author PQZ
* @date 17:27 2024/9/24
**/
@Override
public CustomerMainRespVO getUserCustomer() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
LambdaQueryWrapper<CustomerMain> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(CustomerMain::getUserId,loginUser.getId()).eq(BaseDO::getDeleted,'0');
CustomerMain customerMain = getOne(lambdaQueryWrapper);
return getCustomerById(customerMain.getId());
}
/**
* 根据经办人所属企业查询经办人信息
*