会员完善信息

This commit is contained in:
Vinjor 2024-09-27 17:56:51 +08:00
parent d00c1570b3
commit 0398b33eb3
2 changed files with 5 additions and 6 deletions

View File

@ -6,10 +6,12 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@ -40,6 +42,8 @@ public class CustomerAPI {
private CustomerMainService customerMainService;
@Resource
private AdminAuthService loginService;
@Resource
private AdminUserApi adminUserApi;
/**
* 新增客户
@ -55,6 +59,7 @@ public class CustomerAPI {
// 获取当前登录用户
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
saveReqVO.setUserId(loginUser.getId());
saveReqVO.setPhoneNumber(adminUserApi.getUser(loginUser.getId()).getMobile());
//客户类型统一为私人客户
saveReqVO.setTypeCode("01");
//客户来源统一为04-维修

View File

@ -155,12 +155,6 @@ public class CustomerMainServiceImpl extends ServiceImpl<CustomerMainMapper, Cus
user.setId(userId);
} else {
userId = user.getId();
if(StringUtils.isNotEmpty(saveReqVO.getOpenId())){
//穿了openId更新openId
user.setOpenId(saveReqVO.getOpenId());
//更新用户表
adminUserApi.setOpenId(user.getId(),saveReqVO.getOpenId());
}
}
//客户表绑定用户id
main.setUserId(userId);