会员完善信息
This commit is contained in:
parent
d00c1570b3
commit
0398b33eb3
@ -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-维修
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user