diff --git a/GDZZ.Application/Entity/BaseUser.cs b/GDZZ.Application/Entity/BaseUser.cs
index 1cc44ca..bd01271 100644
--- a/GDZZ.Application/Entity/BaseUser.cs
+++ b/GDZZ.Application/Entity/BaseUser.cs
@@ -46,7 +46,7 @@ namespace GDZZ.Application.Entity
///
/// 公司ID
///
- public long CompanyID { get; set; }
+ public long? CompanyID { get; set; }
///
/// 描述
///
diff --git a/GDZZ.Application/Entity/Company.cs b/GDZZ.Application/Entity/Company.cs
index 5dceb3f..a8a2fbc 100644
--- a/GDZZ.Application/Entity/Company.cs
+++ b/GDZZ.Application/Entity/Company.cs
@@ -30,18 +30,34 @@ namespace GDZZ.Application.Entity
///
/// 审核状态
///
- public int ApprovalStatus { get; set; }
+ public CompanyEnum ApprovalStatus { get; set; }
///
/// 审核人
///
- public string Approver { get; set; }
+ public string? Approver { get; set; }
///
/// 审核时间
///
- public DateTime ApprovalTime { get; set; }
+ public DateTime? ApprovalTime { get; set; }
///
/// 公司地址
///
public string Address { get; set; }
+ ///
+ /// 执照图片地址
+ ///
+ public string? LicenseUrl { get; set; }
+ ///
+ /// 机构代码
+ ///
+ public string Code { get; set; }
+ ///
+ /// 企业电话
+ ///
+ public string Phone { get; set; }
+ ///
+ /// 备注
+ ///
+ public string Remark { get; set; }
}
}
\ No newline at end of file
diff --git a/GDZZ.Application/Entity/CompanyUserScope.cs b/GDZZ.Application/Entity/CompanyUserScope.cs
new file mode 100644
index 0000000..502c703
--- /dev/null
+++ b/GDZZ.Application/Entity/CompanyUserScope.cs
@@ -0,0 +1,23 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using GDZZ.Core.Entity;
+namespace GDZZ.Application.Entity
+{
+ ///
+ /// 公司数据范围表
+ ///
+ [SugarTable("mini_company_user_scope")]
+ [Description("公司数据范围表")]
+ public class CompanyUserScope
+ {
+ ///
+ /// 用户ID
+ ///
+ public long MiniUserID { get; set; }
+ ///
+ /// 公司ID
+ ///
+ public long MiniCompanyID { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/GDZZ.Application/Entity/MiniResume.cs b/GDZZ.Application/Entity/MiniResume.cs
index 7d1d71b..f67a6a7 100644
--- a/GDZZ.Application/Entity/MiniResume.cs
+++ b/GDZZ.Application/Entity/MiniResume.cs
@@ -32,7 +32,7 @@ namespace GDZZ.Application.Entity
///
/// 所属公司
///
- public long CompanyID { get; set; }
+ public long? CompanyID { get; set; }
///
/// 地区ID
///
diff --git a/GDZZ.Application/GDZZ.Application.xml b/GDZZ.Application/GDZZ.Application.xml
index 418f99b..2a7cdc7 100644
--- a/GDZZ.Application/GDZZ.Application.xml
+++ b/GDZZ.Application/GDZZ.Application.xml
@@ -139,6 +139,41 @@
公司地址
+
+
+ 执照图片地址
+
+
+
+
+ 机构代码
+
+
+
+
+ 企业电话
+
+
+
+
+ 备注
+
+
+
+
+ 公司数据范围表
+
+
+
+
+ 用户ID
+
+
+
+
+ 公司ID
+
+
消费记录
@@ -904,6 +939,11 @@
AccessToken
+
+
+ 二维码生成
+
+
用户类型枚举
@@ -1026,6 +1066,18 @@
+
+
+ 存储二维码bate[]
+
+
+
+
+
+ 存储二维码bate[]
+
+
+
发送验证码
@@ -1409,6 +1461,12 @@
退款回调
+
+
+ 商户转账
+
+
+
折扣
@@ -1494,6 +1552,16 @@
退款消息
+
+
+ 商户ID
+
+
+
+
+ 转账金额
+
+
基础用户服务
@@ -1771,7 +1839,7 @@
- 分页查询套餐管理
+ 分页查询公司
@@ -1783,13 +1851,27 @@
-
+
获取公司属性
+
+
+ 创建公司
+
+
+
+
+
+
+ 绑定公司
+
+ 公司信息
+
+
公司属性输出参数
@@ -1865,6 +1947,51 @@
公司地址
+
+
+ 审核状态
+
+
+
+
+ 审核人
+
+
+
+
+ 审核时间
+
+
+
+
+ 执照图片地址
+
+
+
+
+ 机构代码
+
+
+
+
+ 企业电话
+
+
+
+
+ 备注
+
+
+
+
+ 主键Id
+
+
+
+
+ 验证码
+
+
主键Id
diff --git a/GDZZ.Application/Service/Auth/AuthService.cs b/GDZZ.Application/Service/Auth/AuthService.cs
index 2faa6b8..8591648 100644
--- a/GDZZ.Application/Service/Auth/AuthService.cs
+++ b/GDZZ.Application/Service/Auth/AuthService.cs
@@ -120,7 +120,6 @@ namespace GDZZ.Application.Service.Auth
-
//账号不存在 生成系统账号
if (sysUser.IsEmpty())
{
@@ -174,16 +173,16 @@ namespace GDZZ.Application.Service.Auth
else
{
//如果是企业账号,应该是绑定了企业租户信息
- if (wxUser.IsEmpty()|| wxUser.CompanyID.IsNullOrZero())
- throw Oops.Oh(ErrorCode.xg1002);
-
- wxUser.Type= (int)UserEnum.ADVERTISE;
- var bsUser = await this.Baseuser.UpdateAsync(wxUser);
+ wxUser.Type = (int)UserEnum.ADVERTISE;
+ var bsUser = await this.Baseuser.UpdateAsync(wxUser);
+ //企业用户情况下,允许后续补充公司信息
+ //if (wxUser.IsEmpty()|| wxUser.CompanyID.IsNullOrZero())
+ // throw Oops.Oh(ErrorCode.xg1002);
- //获取公司信息
- company = await this.CompanyRep.SingleAsync(x=>x.Id == wxUser.CompanyID);
- authUserOut.companyDto = company.Adapt();
+ ////获取公司信息
+ //company = await this.CompanyRep.SingleAsync(x=>x.Id == wxUser.CompanyID);
+ //authUserOut.companyDto = company.Adapt();
}
diff --git a/GDZZ.Application/Service/Company/CompanyService.cs b/GDZZ.Application/Service/Company/CompanyService.cs
index 633f82a..c93b24a 100644
--- a/GDZZ.Application/Service/Company/CompanyService.cs
+++ b/GDZZ.Application/Service/Company/CompanyService.cs
@@ -3,10 +3,15 @@ using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Mvc;
-using SqlSugar;
using System.Linq;
using System.Threading.Tasks;
using GDZZ.Application.Entity;
+using GDZZ.Core.Entity;
+using GDZZ.Core.OAuth;
+using GDZZ.Application.Help;
+using System;
+using System.Collections.Generic;
+
namespace GDZZ.Application
{
///
@@ -16,15 +21,21 @@ namespace GDZZ.Application
public class CompanyService : ICompanyService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository _rep;
+ private readonly SqlSugarRepository companyUserRep;
+ private readonly ICacheService cacheService;
- public CompanyService(SqlSugarRepository rep)
+ public CompanyService(SqlSugarRepository rep,
+ ICacheService cacheService,
+ SqlSugarRepository companyUserRep)
{
_rep = rep;
+ this.cacheService= cacheService;
+ this.companyUserRep= companyUserRep;
}
///
- /// 分页查询套餐管理
+ /// 分页查询公司
///
///
///
@@ -33,17 +44,17 @@ namespace GDZZ.Application
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchValue), u => u.Name.Contains(input.SearchValue.Trim()))
- .Select((u) => new MiniResumeOutput()
- {
- CompanyID = u.Id,
- CompanyName = u.Name,
- Logo = u.logo,
- Id = u.Id,
- Info = u.Info,
- Title = u.Name,
- Time = u.CreatedTime.Value.ToString("yyyy/MM/dd"),
-
- })
+ .WhereIF(!string.IsNullOrWhiteSpace(input.SearchValue), u => u.Code.Contains(input.SearchValue.Trim()))
+ //.Select((u) => new CompanyInput()
+ //{
+ // CompanyID = u.Id,
+ // CompanyName = u.Name,
+ // Logo = u.logo,
+ // Id = u.Id,
+ // Info = u.Info,
+ // Title = u.Name,
+ // Time = u.CreatedTime.Value.ToString("yyyy/MM/dd"),
+ //})
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}
@@ -67,15 +78,50 @@ namespace GDZZ.Application
///
///
///
- [HttpGet("/Mini/CompanyDetail")]
- public async Task Get([FromQuery] QueryeCompanyInput input)
+ [HttpGet("/Mini/Company/Detail")]
+ public async Task Get()
{
//获取公司相关的招聘信息
- return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
+ return await _rep.FirstOrDefaultAsync(u => u.Id == UserManager.UserId);
}
+ ///
+ /// 创建公司
+ ///
+ ///
+ ///
+ [HttpPost("/Mini/Company/install")]
+ public async Task InstallAsync(AddCompanyInput input)
+ {
+ var entity = input.Adapt();
+ await _rep.InsertAsync(entity);
+ }
+ ///
+ /// 绑定公司
+ ///
+ /// 公司信息
+ ///
+ [HttpGet("/Mini/Comapany/Bing")]
+ public async Task BingCompany([FromQuery] AddCompanyInput input)
+ {
+
+ //验证电话和验证码一致
+ var verIfy = await this.cacheService.GetVerifyCode(input.Phone);
+ if (verIfy != input.Checking)
+ throw new Exception("验证码错误");
+
+ var companyUser = new CompanyUserScope
+ {
+ MiniCompanyID = input.Id,
+ MiniUserID = UserManager.UserId,
+ };
+ await this.companyUserRep.InsertAsync(companyUser);
+
+ //关系表插入信息
+
+ }
}
diff --git a/GDZZ.Application/Service/Company/Dto/CompanyInput.cs b/GDZZ.Application/Service/Company/Dto/CompanyInput.cs
index 61d4ee0..c653da6 100644
--- a/GDZZ.Application/Service/Company/Dto/CompanyInput.cs
+++ b/GDZZ.Application/Service/Company/Dto/CompanyInput.cs
@@ -39,10 +39,49 @@ namespace GDZZ.Application
///
public string Address { get; set; }
+ ///
+ /// 审核状态
+ ///
+ public CompanyEnum ApprovalStatus { get; set; }
+ ///
+ /// 审核人
+ ///
+ public string Approver { get; set; }
+ ///
+ /// 审核时间
+ ///
+ public DateTime ApprovalTime { get; set; }
+
+ ///
+ /// 执照图片地址
+ ///
+ public string LicenseUrl { get; set; }
+ ///
+ /// 机构代码
+ ///
+ public string Code { get; set; }
+ ///
+ /// 企业电话
+ ///
+ public string Phone { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string Remark { get; set; }
}
public class AddCompanyInput : CompanyInput
{
+ ///
+ /// 主键Id
+ ///
+ [Required(ErrorMessage = "主键Id不能为空")]
+ public long Id { get; set; }
+ ///
+ /// 验证码
+ ///
+ public string Checking { get; set; }
}
public class DeleteCompanyInput
diff --git a/GDZZ.Application/Service/Company/ICompanyService.cs b/GDZZ.Application/Service/Company/ICompanyService.cs
index 5d17623..8329bb4 100644
--- a/GDZZ.Application/Service/Company/ICompanyService.cs
+++ b/GDZZ.Application/Service/Company/ICompanyService.cs
@@ -7,7 +7,7 @@ namespace GDZZ.Application
public interface ICompanyService
{
- Task Get([FromQuery] QueryeCompanyInput input);
+ Task Get();
Task Update(UpdateCompanyInput input);
}
diff --git a/GDZZ.Application/Service/MiniResume/MiniResumeService.cs b/GDZZ.Application/Service/MiniResume/MiniResumeService.cs
index cfc2dcb..c9ada91 100644
--- a/GDZZ.Application/Service/MiniResume/MiniResumeService.cs
+++ b/GDZZ.Application/Service/MiniResume/MiniResumeService.cs
@@ -216,7 +216,6 @@ namespace GDZZ.Application
public async Task GetSelfResumeList([FromQuery] MiniResumeInput input)
{
var entities = await _rep.AsQueryable()
-
.LeftJoin((u, y) => u.CompanyID == y.Id) //关联公司信息
.Where(u => u.CreatedUserId == UserManager.UserId)
.Select((u, y) => new MiniResumeOutput
diff --git a/GDZZ.Core/GDZZ.Core.xml b/GDZZ.Core/GDZZ.Core.xml
index 510e34b..0164721 100644
--- a/GDZZ.Core/GDZZ.Core.xml
+++ b/GDZZ.Core/GDZZ.Core.xml
@@ -357,6 +357,11 @@
默认
+
+
+ 默认
+
+
数据库配置