development
温天培 2 years ago
parent d201c7fdf2
commit 40b305e418

@ -23,5 +23,9 @@ namespace GDZZ.Application.Entity
/// 邀请人ID
/// </summary>
public long InviteUserID { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreatedTime { get; set; }
}
}

@ -23,5 +23,9 @@ namespace GDZZ.Application.Entity
/// 充值状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 充值类型
/// </summary>
public int Type { get; set; }
}
}

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GDZZ.Application.Enum
{
public enum RechargeTypeEnum
{
/// <summary>
/// 奖励
/// </summary>
[Description("奖励")] Reward = 10,
/// <summary>
/// 储值
/// </summary>
[Description("储值")] StoredValue = 20,
}
}

@ -234,6 +234,11 @@
邀请人ID
</summary>
</member>
<member name="P:GDZZ.Application.Entity.InviteUserPos.CreatedTime">
<summary>
创建时间
</summary>
</member>
<member name="T:GDZZ.Application.Entity.LiveHistoryContacts">
<summary>
聊天历史任务列表
@ -409,6 +414,11 @@
充值状态
</summary>
</member>
<member name="P:GDZZ.Application.Entity.MiniRecharge.Type">
<summary>
充值类型
</summary>
</member>
<member name="T:GDZZ.Application.Entity.MiniResume">
<summary>
小程序招聘列表
@ -574,6 +584,16 @@
联系费用
</summary>
</member>
<member name="F:GDZZ.Application.Enum.RechargeTypeEnum.Reward">
<summary>
奖励
</summary>
</member>
<member name="F:GDZZ.Application.Enum.RechargeTypeEnum.StoredValue">
<summary>
储值
</summary>
</member>
<member name="F:GDZZ.Application.Enum.ResumeStatusEnum.Release">
<summary>
已发布
@ -1662,16 +1682,6 @@
主键Id
</summary>
</member>
<member name="P:GDZZ.Application.InvitationCodeOutput.EnterpriseID">
<summary>
企业ID
</summary>
</member>
<member name="P:GDZZ.Application.InvitationCodeOutput.Code">
<summary>
邀请码
</summary>
</member>
<member name="T:GDZZ.Application.InvitationCodeService">
<summary>
邀请码表服务
@ -1705,6 +1715,13 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.InvitationCodeService.GetNumber">
<summary>
获取邀请码
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:GDZZ.Application.LiveHistoryContactsDto">
<summary>
聊天历史任务列表输出参数

@ -12,15 +12,11 @@ namespace GDZZ.Application
/// </summary>
public long Id { get; set; }
/// <summary>
/// 企业ID
/// </summary>
public long EnterpriseID { get; set; }
public string Name { get; set; }
/// <summary>
/// 邀请码
/// </summary>
public long Code { get; set; }
public string Avatar { get; set; }
public DateTime dateTime { get; set; }
}
}

@ -11,6 +11,8 @@ using GDZZ.Application.Help;
using Furion.DistributedIDGenerator;
using Furion.FriendlyException;
using System;
using GDZZ.Core.Entity;
using System.Collections.Generic;
namespace GDZZ.Application
{
@ -24,9 +26,16 @@ namespace GDZZ.Application
private readonly SqlSugarRepository<InviteUserPos> inviteUserPosrep;
public InvitationCodeService(SqlSugarRepository<InvitationCode> rep, SqlSugarRepository<InviteUserPos> inviteUserPosrep)
private readonly SqlSugarRepository<SysUser> sysUserrep; //用户仓储
private readonly SqlSugarRepository<MiniRecharge> rechargeRep; //充值仓储
public InvitationCodeService(SqlSugarRepository<InvitationCode> rep,
SqlSugarRepository<MiniRecharge> rechargeRep,
SqlSugarRepository<SysUser> sysUserrep,
SqlSugarRepository<InviteUserPos> inviteUserPosrep)
{
_rep = rep;
this.sysUserrep = sysUserrep;
this.rechargeRep = rechargeRep;
this.inviteUserPosrep = inviteUserPosrep;
}
@ -81,12 +90,28 @@ namespace GDZZ.Application
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/InvitationCode/GetPNumber")]
public async Task<int> GetPNumber()
public async Task<List<InvitationCodeOutput>> GetPNumber()
{
List<InvitationCodeOutput> invitationCodes = new List<InvitationCodeOutput>();
var invitation = await this.inviteUserPosrep.Where(u => u.InviteUserID == UserManager.UserId).ToArrayAsync();
if (invitation.IsNullOrZero())
throw Oops.Oh("暂无邀请人");
return invitation.Count();
foreach (var item in invitation)
{
var sysUser =await this.sysUserrep.FirstOrDefaultAsync(x => x.Id == item.UserID);
invitationCodes.Add(new InvitationCodeOutput()
{
Id = item.Id,
Name = sysUser.Name,
Avatar = sysUser.Avatar,
dateTime = item.CreatedTime,
});
}
return invitationCodes;
}
@ -101,6 +126,10 @@ namespace GDZZ.Application
var incode = await this._rep.FirstOrDefaultAsync(x => x.InviteCode == input.InviteCode);
if (incode.IsNullOrZero())
throw Oops.Oh("无此邀请码!");
//奖励
this.inviteUserPosrep.Insert(new InviteUserPos()
{
InviteID = incode.Id,

@ -271,6 +271,10 @@ namespace GDZZ.Application
}
//设置消息支付状态 --存入reids
/// <summary>
/// 上传文件
/// </summary>

@ -13,6 +13,7 @@ using System;
using System.Collections.Generic;
using GDZZ.Core.Entity;
using Furion.FriendlyException;
using Senparc.CO2NET.Extensions;
namespace GDZZ.Application
{
@ -55,9 +56,11 @@ namespace GDZZ.Application
[AllowAnonymous]
public async Task<dynamic> GetResumeList([FromQuery] MiniResumeInput input)
{
var companys = await this.CompanyRep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(input.SearchValue), u => u.Name.Contains(input.SearchValue)).FirstAsync();
var entities =await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.RegionName), u => u.RegionName.Contains(input.RegionName.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchValue), u => u.Title.Contains(input.SearchValue))
.WhereIF(!companys.IsNullOrZero(),u => u.Title.Contains(input.SearchValue)|| u.CompanyID == companys.Id)
.WhereIF(!string.IsNullOrWhiteSpace(input.Record), u => u.Record.Contains(input.Record.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Level), u => u.Record.Contains(input.Level.Trim()))
.LeftJoin<Company>((u, y) => u.CompanyID == y.Id ) //关联公司信息

@ -94,7 +94,6 @@ namespace GDZZ.Application.Service.WXPay
var balan = await this.balance.AsQueryable().Filter("TenantId", true).SingleAsync(x => x.UserID == UserManager.UserId);
if (balan == null)
return null;
return new BalanceOut()
{
Amount = balan.Amount,
@ -126,7 +125,7 @@ namespace GDZZ.Application.Service.WXPay
var comrep = await this.ComsumeRep.Where(x=>x.ResumeID== ResumeID).FirstAsync();
if(!comrep.IsNullOrZero()) //已经消费过了
return true;
throw Oops.Oh("已经消费过了");
var ban = await this.balance.Where(x => x.UserID == UserManager.UserId).FirstAsync();
if (ban == null)
@ -146,7 +145,6 @@ namespace GDZZ.Application.Service.WXPay
return await this.balance.AsUpdateable(ban).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync()>0;
}
/// <summary>
/// 查询消费记录
/// </summary>
@ -160,7 +158,6 @@ namespace GDZZ.Application.Service.WXPay
}
/// <summary>
///微信小程序支付
/// </summary>
@ -171,11 +168,11 @@ namespace GDZZ.Application.Service.WXPay
public async Task<dynamic> WxPay(AuthUserInput authUserInput)
{
var recharge = await this.rechargeRep.InsertReturnEntityAsync(new MiniRecharge()
{
PaymentMoney = authUserInput.Money,
Status = (int)RechargeEnum.NoFinis,
Type = (int)RechargeTypeEnum.StoredValue,
TotalPrice = authUserInput.Money
});

@ -1,8 +1,4 @@
// See https://aka.ms/new-console-template for more information
using GDZZ.CodeFirst;
using GDZZ.Core;
using GDZZ.Core.Entity;
@ -13,9 +9,7 @@ using System.Reflection;
using System.Text;
var assembles = new string[] { "GDZZ.FlowCenter.dll", "GDZZ.Core.dll" };
var assembles = new string[] { "GDZZ.FlowCenter.dll", "GDZZ.Core.dll" , "GDZZ.Application.dll" };
//首先创建数据库
CreateDatabase();
//初始化表结构
@ -41,10 +35,10 @@ static void InitDatabase(string[] assembles) {
var conn = SqlSugarHelper.GetSetting();
var configIds = new List<string>();
configIds.Add(conn.DefaultDbNumber);
foreach (var item in conn.DbConfigs)
{
configIds.Add(item.DbNumber);
}
//foreach (var item in conn.DefaultDbString)
//{
// configIds.Add(conn.DefaultDbNumber);
//}
foreach (var item in assembles)
{

@ -4,10 +4,24 @@ using GDZZ.Core.Entity;
namespace GDZZ.CodeFirst;
public class SysUserSeedData : ISeedData, ISqlSugarEntitySeedData<SysUser>
{ public IEnumerable<SysUser> HasData()
{ string json = @"[{""Account"":""superAdmin"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""superAdmin"",""Name"":""超级管理员"",""Avatar"":""188632919339077"",""Birthday"":""1753-01-01T00:00:00"",""Sex"":1,""Email"":null,""Phone"":""18020030720"",""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2022-05-25T09:12:40.45"",""AdminType"":1,""Status"":0,""TenantId"":142307070918780,""CreatedTime"":null,""UpdatedTime"":""2021-08-06T10:49:21.047"",""CreatedUserId"":null,""CreatedUserName"":null,""UpdatedUserId"":142307070910551,""UpdatedUserName"":""superAdmin"",""IsDeleted"":false,""Id"":142307070910551},{""Account"":""toudou@qq.com"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""tdadmin"",""Name"":""tdadmin"",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":0,""Email"":""toudou@qq.com"",""Phone"":null,""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2022-04-16T00:42:43.103"",""AdminType"":2,""Status"":0,""TenantId"":175624014975045,""CreatedTime"":""2021-06-30T16:35:58.873"",""UpdatedTime"":null,""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":null,""UpdatedUserName"":null,""IsDeleted"":false,""Id"":175624015269957},{""Account"":""admin"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""admin"",""Name"":""管理员"",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":1,""Email"":null,""Phone"":""15959110752"",""Tel"":null,""LastLoginIp"":""0.0.0.1"",""LastLoginTime"":""2021-08-19T23:55:06.2"",""AdminType"":0,""Status"":0,""TenantId"":142307070918780,""CreatedTime"":""2021-07-05T11:59:16.617"",""UpdatedTime"":""2021-08-19T23:10:52.907"",""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":142307070910551,""UpdatedUserName"":""superAdmin"",""IsDeleted"":false,""Id"":177325484421189},{""Account"":""zhangsan"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""张三"",""Name"":""张三"",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":1,""Email"":null,""Phone"":""15959110751"",""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2021-07-19T15:13:27.183"",""AdminType"":0,""Status"":0,""TenantId"":142307070918780,""CreatedTime"":""2021-07-19T14:18:44.05"",""UpdatedTime"":null,""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":null,""UpdatedUserName"":null,""IsDeleted"":false,""Id"":182314279026757},{""Account"":""zuhutest"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""租户1管理员"",""Name"":""租户1管理员"",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":0,""Email"":""zuhutest"",""Phone"":null,""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2022-04-16T01:06:31.343"",""AdminType"":2,""Status"":0,""TenantId"":278024843046981,""CreatedTime"":""2022-04-16T01:06:00.993"",""UpdatedTime"":null,""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":null,""UpdatedUserName"":null,""IsDeleted"":false,""Id"":278024843153477}]
{
public IEnumerable<SysUser> HasData()
{
string json = @"[
{""Account"":""superAdmin"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",
""NickName"":""superAdmin"",""Name"":"""",""Avatar"":""188632919339077"",""Birthday"":""1753-01-01T00:00:00"",
""Sex"":1,""Email"":""zongzhi@zz.com"",""Phone"":""18020030720"",""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2022-05-25T09:12:40.45"",
""AdminType"":1,""Status"":0,""TenantId"":142307070918780,""CreatedTime"":null,""UpdatedTime"":""2021-08-06T10:49:21.047""
,""CreatedUserId"":null,""CreatedUserName"":null,""UpdatedUserId"":142307070910551,""UpdatedUserName"":""superAdmin"",
""IsDeleted"":false,""Id"":142307070910551},{""Account"":""toudou@qq.com"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",
""NickName"":""tdadmin"",""Name"":""tdadmin"",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":0,""Email"":""toudou@qq.com"",
""Phone"":null,""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2022-04-16T00:42:43.103"",""AdminType"":2,""Status"":0,
""TenantId"":175624014975045,""CreatedTime"":""2021-06-30T16:35:58.873"",""UpdatedTime"":null,""CreatedUserId"":142307070910551,
""CreatedUserName"":""superAdmin"",""UpdatedUserId"":null,""UpdatedUserName"":null,""IsDeleted"":false,""Id"":175624015269957},
{""Account"":""admin"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""admin"",""Name"":"""",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":1,""Email"":null,""Phone"":""15959110752"",""Tel"":null,""LastLoginIp"":""0.0.0.1"",""LastLoginTime"":""2021-08-19T23:55:06.2"",""AdminType"":0,""Status"":0,""TenantId"":142307070918780,""CreatedTime"":""2021-07-05T11:59:16.617"",""UpdatedTime"":""2021-08-19T23:10:52.907"",""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":142307070910551,""UpdatedUserName"":""superAdmin"",""IsDeleted"":false,""Id"":177325484421189},{""Account"":""zhangsan"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":"""",""Name"":"""",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":1,""Email"":null,""Phone"":""15959110751"",""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2021-07-19T15:13:27.183"",""AdminType"":0,""Status"":0,""TenantId"":142307070918780,""CreatedTime"":""2021-07-19T14:18:44.05"",""UpdatedTime"":null,""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":null,""UpdatedUserName"":null,""IsDeleted"":false,""Id"":182314279026757},{""Account"":""zuhutest"",""Password"":""e10adc3949ba59abbe56e057f20f883e"",""NickName"":""1"",""Name"":""1"",""Avatar"":null,""Birthday"":""1753-01-01T00:00:00"",""Sex"":0,""Email"":""zuhutest"",""Phone"":null,""Tel"":null,""LastLoginIp"":""127.0.0.1"",""LastLoginTime"":""2022-04-16T01:06:31.343"",""AdminType"":2,""Status"":0,""TenantId"":278024843046981,""CreatedTime"":""2022-04-16T01:06:00.993"",""UpdatedTime"":null,""CreatedUserId"":142307070910551,""CreatedUserName"":""superAdmin"",""UpdatedUserId"":null,""UpdatedUserName"":null,""IsDeleted"":false,""Id"":278024843153477}]
";
List<SysUser> list = JsonUtil.ToObject<List<SysUser>>(json);
return list;
}}
}
}

@ -2,6 +2,8 @@
using SqlSugar;
using System.ComponentModel;
using GDZZ.Core.Entity;
using System.ComponentModel.DataAnnotations;
namespace GDZZ.Core.Entity
{
/// <summary>
@ -14,62 +16,100 @@ namespace GDZZ.Core.Entity
/// <summary>
/// 账号
/// </summary>
[Required, MaxLength(20)]
[SugarColumn(ColumnDescription = "账号")]
public string Account { get; set; }
/// <summary>
/// 密码
/// 密码默认MD5加密
/// </summary>
[Required, MaxLength(50)]
[SugarColumn(ColumnDescription = "密码默认MD5加密")]
public string Password { get; set; }
/// <summary>
/// 昵称
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "昵称", IsNullable = true)]
public string NickName { get; set; }
/// <summary>
/// 姓名
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "姓名", IsNullable = true)]
public string Name { get; set; }
/// <summary>
/// 头像
/// </summary>
[SugarColumn(ColumnDescription = "头像", IsNullable = true)]
public string Avatar { get; set; }
/// <summary>
/// 生日
/// </summary>
[SugarColumn(ColumnDescription = "生日", IsNullable = true)]
public DateTime Birthday { get; set; }
/// <summary>
/// 性别-男_1、女_2
/// </summary>
[SugarColumn(ColumnDescription = "性别-男_1、女_2")]
public Gender Sex { get; set; }
/// <summary>
/// 邮箱
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "邮箱", IsNullable = true)]
public string Email { get; set; }
/// <summary>
/// 手机
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "手机", IsNullable = true)]
public string Phone { get; set; }
/// <summary>
/// 电话
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "电话", IsNullable = true)]
public string Tel { get; set; }
/// <summary>
/// 最后登录IP
/// </summary>
[MaxLength(20)]
[SugarColumn(ColumnDescription = "最后登录IP", IsNullable = true)]
public string LastLoginIp { get; set; }
/// <summary>
/// 最后登录时间
/// </summary>
[SugarColumn(ColumnDescription = "最后登录时间", IsNullable = true)]
public DateTime LastLoginTime { get; set; }
/// <summary>
/// 管理员类型-超级管理员_1、非管理员_2
/// </summary>
public AdminType AdminType { get; set; }
[SugarColumn(ColumnDescription = "管理员类型-超级管理员_1、非管理员_2")]
public AdminType? AdminType { get; set; }
/// <summary>
/// 状态-正常_0、停用_1、删除_2
/// </summary>
public CommonStatus Status { get; set; }
[SugarColumn(ColumnDescription = "状态-正常_0、停用_1、删除_2")]
public CommonStatus Status { get; set; } = CommonStatus.ENABLE;
/// <summary>
/// 简介
/// </summary>
[SugarColumn(ColumnDescription = "简介", IsNullable = true)]
public string Profile { get; set; }
}
}

@ -1912,7 +1912,7 @@
</member>
<member name="P:GDZZ.Core.Entity.SysUser.Password">
<summary>
密码
密码默认MD5加密
</summary>
</member>
<member name="P:GDZZ.Core.Entity.SysUser.NickName">

@ -7,6 +7,7 @@
//"DefaultDbString": "Server=.;Database=GDZZCodeFirst;User=sa;Password=123456;MultipleActiveResultSets=True;",
"DefaultDbType": "MySql",
"DefaultDbString": "Data Source=106.55.234.178;Database=magic;User ID=root;Password=zongzhi2022;pooling=true;port=3306;sslmode=none;CharSet=utf8;Convert Zero Datetime=True;Allow Zero Datetime=True;",
//"DefaultDbString": "Data Source=127.0.0.1;Database=magic;User ID=root;Password=zhongzhi2022;pooling=true;port=3306;sslmode=none;CharSet=utf8;Convert Zero Datetime=True;Allow Zero Datetime=True;",
"DbConfigs": [
{
"DbNumber": "1",
@ -15,6 +16,8 @@
}
]
}
//
//"Sqlite": "Data Source=./GDZZ.db"
//"SqlServer": "Server=.;Database=GDZZ;User=sa;Password=123456;MultipleActiveResultSets=True;",
//"MySql": "Data Source=localhost;Database=GDZZ;User ID=root;Password=123456;pooling=true;port=3306;sslmode=none;CharSet=utf8;Convert Zero Datetime=True;Allow Zero Datetime=True;"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save