feat(contact): 添加联系表单销售线索功能支持

- 新增联系表单数据库表结构设计与实体类定义
- 实现联系表单提交接口,支持公开访问无需登录验证
- 添加后台管理接口,支持线索查询、状态更新和删除操作
- 集成企业微信和飞书机器人通知功能,实时推送新线索
- 在安全配置中开放联系表单提交接口访问权限
- 添加应用配置中的通知机器人Webhook配置项
This commit is contained in:
2026-03-30 11:30:29 +08:00
parent df7a41f3c4
commit 424929222f
3 changed files with 25 additions and 1 deletions

View File

@@ -67,13 +67,24 @@ public class AppUserController extends BaseController {
return fail("添加失败");
}
@Operation(summary = "邀请用户成为应用成员")
@Operation(summary = "邀请用户成为应用成员支持用户ID或手机号")
@PostMapping("/invite")
public ApiResult<?> invite(@RequestBody AppUser appUser) {
User loginUser = getLoginUser();
if (loginUser == null) {
return fail("请先登录");
}
// 支持手机号邀请:若 userId 为空但传了 phone则先按手机号查出用户
if (appUser.getUserId() == null && appUser.getPhone() != null && !appUser.getPhone().isEmpty()) {
User targetUser = appUserService.findUserByPhone(appUser.getPhone());
if (targetUser == null) {
return fail("手机号未注册,请确认后再试");
}
appUser.setUserId(targetUser.getUserId());
}
if (appUser.getUserId() == null) {
return fail("请输入用户ID或手机号");
}
try {
AppUser result = appUserService.inviteUser(
appUser.getWebsiteId(),

View File

@@ -57,4 +57,12 @@ public interface AppUserService extends IService<AppUser> {
*/
boolean isMember(Long websiteId, Integer userId);
/**
* 根据手机号查找系统用户(用于手机号邀请)
*
* @param phone 手机号
* @return 系统用户,不存在返回 null
*/
com.gxwebsoft.common.system.entity.User findUserByPhone(String phone);
}

View File

@@ -104,4 +104,9 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
return count > 0;
}
@Override
public User findUserByPhone(String phone) {
return userService.getByPhone(phone);
}
}