新增会员中心

development
温天培 9 months ago
parent c7f95f1047
commit 9329ca8926

@ -7,10 +7,15 @@ namespace GDZZ.Application.Entity
/// <summary> /// <summary>
/// 邀请用户表 /// 邀请用户表
/// </summary> /// </summary>
[SugarTable("Invite_user_pos")] [SugarTable("mini_Invite_user_pos")]
[Description("邀请用户表")] [Description("邀请用户表")]
public class InviteUserPos : PrimaryKeyEntity public class InviteUserPos
{ {
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary> /// <summary>
/// 邀请码ID /// 邀请码ID
/// </summary> /// </summary>

@ -43,5 +43,13 @@ namespace GDZZ.Application.Entity
/// 年龄 /// 年龄
/// </summary> /// </summary>
public string AgeValue { get; set; } public string AgeValue { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; } = 100;
/// <summary>
/// 结束时间
/// </summary>
public DateTime ExpirationTime { get; set; }
} }
} }

@ -2,6 +2,8 @@
using SqlSugar; using SqlSugar;
using System.ComponentModel; using System.ComponentModel;
using GDZZ.Core.Entity; using GDZZ.Core.Entity;
using GDZZ.Application.Enum;
namespace GDZZ.Application.Entity namespace GDZZ.Application.Entity
{ {
/// <summary> /// <summary>
@ -27,5 +29,9 @@ namespace GDZZ.Application.Entity
/// 金额 /// 金额
/// </summary> /// </summary>
public decimal PaymentMoney { get; set; } public decimal PaymentMoney { get; set; }
/// <summary>
/// 支付类型
/// </summary>
public PayTypeEnum Type { get; set; }
} }
} }

@ -15,12 +15,12 @@ namespace GDZZ.Application
[Description("待审核")] Pending = 0, [Description("待审核")] Pending = 0,
/// <summary> /// <summary>
/// 联系费用 /// 审核通过
/// </summary> /// </summary>
[Description("审核通过")] Approved = 1, [Description("审核通过")] Approved = 1,
/// <summary> /// <summary>
/// 联系费用 /// 审核未通过
/// </summary> /// </summary>
[Description("审核未通过")] Rejected = 2, [Description("审核未通过")] Rejected = 2,
} }

@ -0,0 +1,23 @@
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 PayTypeEnum
{
/// <summary>
/// 充值支付
/// </summary>
[Description("充值支付")] RECHARGE = 0,
/// <summary>
/// 购买支付
/// </summary>
[Description("购买支付")] BUY = 10,
}
}

@ -294,6 +294,11 @@
邀请用户表 邀请用户表
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.Entity.InviteUserPos.Id">
<summary>
主键
</summary>
</member>
<member name="P:GDZZ.Application.Entity.InviteUserPos.InviteID"> <member name="P:GDZZ.Application.Entity.InviteUserPos.InviteID">
<summary> <summary>
邀请码ID 邀请码ID
@ -359,6 +364,16 @@
年龄 年龄
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.Entity.JobHunt.Sort">
<summary>
排序
</summary>
</member>
<member name="P:GDZZ.Application.Entity.JobHunt.ExpirationTime">
<summary>
结束时间
</summary>
</member>
<member name="T:GDZZ.Application.Entity.LiveHistoryContacts"> <member name="T:GDZZ.Application.Entity.LiveHistoryContacts">
<summary> <summary>
聊天历史任务列表 聊天历史任务列表
@ -514,6 +529,11 @@
金额 金额
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.Entity.MiniPayTake.Type">
<summary>
支付类型
</summary>
</member>
<member name="T:GDZZ.Application.Entity.MiniRecharge"> <member name="T:GDZZ.Application.Entity.MiniRecharge">
<summary> <summary>
充值表 充值表
@ -934,6 +954,16 @@
系统错误 系统错误
</summary> </summary>
</member> </member>
<member name="F:GDZZ.Application.Enum.PayTypeEnum.RECHARGE">
<summary>
充值支付
</summary>
</member>
<member name="F:GDZZ.Application.Enum.PayTypeEnum.BUY">
<summary>
购买支付
</summary>
</member>
<member name="F:GDZZ.Application.Enum.ResumeTypeEnum.Hot"> <member name="F:GDZZ.Application.Enum.ResumeTypeEnum.Hot">
<summary> <summary>
热招 热招
@ -961,12 +991,12 @@
</member> </member>
<member name="F:GDZZ.Application.CompanyEnum.Approved"> <member name="F:GDZZ.Application.CompanyEnum.Approved">
<summary> <summary>
联系费用 审核通过
</summary> </summary>
</member> </member>
<member name="F:GDZZ.Application.CompanyEnum.Rejected"> <member name="F:GDZZ.Application.CompanyEnum.Rejected">
<summary> <summary>
联系费用 审核未通过
</summary> </summary>
</member> </member>
<member name="F:GDZZ.Application.ConsumeEnum.Contact"> <member name="F:GDZZ.Application.ConsumeEnum.Contact">
@ -1704,6 +1734,13 @@
<param name="authUserInput">商品Id</param> <param name="authUserInput">商品Id</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Application.Service.WXPay.WXPayService.wxCardPay(GDZZ.Application.AuthUserInput)">
<summary>
卡消费支付
</summary>
<param name="authUserInput">商品Id</param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.Service.WXPay.WXPayService.NotifyUrl"> <member name="M:GDZZ.Application.Service.WXPay.WXPayService.NotifyUrl">
<summary> <summary>
微信小程序支付回调 微信小程序支付回调
@ -2267,7 +2304,7 @@
<param name="input"></param> <param name="input"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Application.CompanyService.InstallAsync(GDZZ.Application.AddCompanyInput)"> <member name="M:GDZZ.Application.CompanyService.UpdateOrInstall(GDZZ.Application.AddCompanyInput)">
<summary> <summary>
创建公司 创建公司
</summary> </summary>
@ -2281,6 +2318,13 @@
<param name="input">公司信息</param> <param name="input">公司信息</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:GDZZ.Application.CompanyService.CompanyApprove(GDZZ.Application.UpdateCompanyInput)">
<summary>
更新公司属性
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:GDZZ.Application.CompanyDto"> <member name="T:GDZZ.Application.CompanyDto">
<summary> <summary>
公司属性输出参数 公司属性输出参数
@ -2411,6 +2455,11 @@
主键Id 主键Id
</summary> </summary>
</member> </member>
<member name="P:GDZZ.Application.UpdateCompanyInput.IsCompanyApprove">
<summary>
是否通过
</summary>
</member>
<member name="T:GDZZ.Application.CompanyOutput"> <member name="T:GDZZ.Application.CompanyOutput">
<summary> <summary>
公司属性输出参数 公司属性输出参数

@ -109,7 +109,7 @@ namespace GDZZ.Application.Service.Auth
Company company = new Company(); Company company = new Company();
try try
{ {
this.UserScope.BeginTran(); //开启事务 this.UserScope.CurrentBeginTran(); //开启事务
//读取凭证 //读取凭证
var tokenModel = await this._wechatOAuth.GetCode2SessionAsync(phoneModel.Code); var tokenModel = await this._wechatOAuth.GetCode2SessionAsync(phoneModel.Code);
//解析电话 //解析电话

@ -78,11 +78,26 @@ namespace GDZZ.Application
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="input"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("/Mini/Company/install")] [HttpPost("/Mini/Company/UpdateOrInstall")]
public async Task InstallAsync(AddCompanyInput input) public async Task UpdateOrInstall(AddCompanyInput input)
{ {
var entity = input.Adapt<Company>(); var company =await this._rep.AsQueryable().Where(x => x.Code == input.Code && x.Name == input.Name).FirstAsync();
await _rep.InsertAsync(entity); if(company == null)
{
var entity = input.Adapt<Company>();
entity.CompanyInfoUrl = entity.CompanyInfoUrl.TrimEnd(',');
await _rep.InsertAsync(entity);
}
else
{
var entity = input.Adapt<Company>();
entity.CompanyInfoUrl = entity.CompanyInfoUrl.TrimEnd(',');
entity.ApprovalStatus = CompanyEnum.Pending;
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
} }
/// <summary> /// <summary>
@ -111,5 +126,19 @@ namespace GDZZ.Application
} }
/// <summary>
/// 更新公司属性
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/Mini/Company/CompanyApprove")]
public async Task CompanyApprove(UpdateCompanyInput input)
{
var entity = input.Adapt<Company>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
} }
} }

@ -102,6 +102,13 @@ namespace GDZZ.Application
[Required(ErrorMessage = "主键Id不能为空")] [Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; } public long Id { get; set; }
/// <summary>
/// 是否通过
/// </summary>
public bool IsCompanyApprove { get; set; }
} }
public class QueryeCompanyInput : DeleteCompanyInput public class QueryeCompanyInput : DeleteCompanyInput

@ -32,7 +32,10 @@ namespace GDZZ.Application
public async Task<dynamic> Page([FromQuery] JobHuntInput input) public async Task<dynamic> Page([FromQuery] JobHuntInput input)
{ {
var entities = await _rep.AsQueryable() var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.Address), u => u.Address.Contains(input.Address.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Tags), u => u.Tags == input.Tags) .WhereIF(!string.IsNullOrWhiteSpace(input.Tags), u => u.Tags == input.Tags)
.WhereIF(!string.IsNullOrWhiteSpace(input.Position), u => u.Position == input.Position)
.OrderBy(u => u.Sort)
.ToPagedListAsync(input.PageNo, input.PageSize); .ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult(); return entities.XnPagedResult();
} }

@ -198,6 +198,7 @@ namespace GDZZ.Application.Service.WXPay
var payTake = await this.payTakeRep.InsertReturnEntityAsync(new MiniPayTake() var payTake = await this.payTakeRep.InsertReturnEntityAsync(new MiniPayTake()
{ {
PaymentMoney = authUserInput.Money, PaymentMoney = authUserInput.Money,
Type = Enum.PayTypeEnum.BUY,
OrderId = recharge.Id, OrderId = recharge.Id,
PaySn = "", PaySn = "",
PayStatus = PayStatusEnum.NotPaying PayStatus = PayStatusEnum.NotPaying
@ -238,6 +239,68 @@ namespace GDZZ.Application.Service.WXPay
} }
/// <summary>
/// 卡消费支付
/// </summary>
/// <param name="authUserInput">商品Id</param>
/// <returns></returns>
[HttpPost]
[Route("Mini/v1/wxCardPay")]
public async Task<dynamic> wxCardPay(AuthUserInput authUserInput)
{
var payres = await this.payTakeRep.AsQueryable().Where(x => x.Type == Enum.PayTypeEnum.BUY && (DateTime.Now - x.CreatedTime.Value).TotalDays < 30 && x.CreatedUserId == UserManager.UserId).FirstAsync();
if (!payres.IsEmpty())
return "已经购买";
var payTake = await this.payTakeRep.InsertReturnEntityAsync(new MiniPayTake()
{
PaymentMoney = authUserInput.Money,
OrderId = YitIdHelper.NextId(),
Type = Enum.PayTypeEnum.BUY,
PaySn = "",
PayStatus = PayStatusEnum.NotPaying
});
int pMoney = (int)(authUserInput.Money );
string sp_billno =
$"{Config.SenparcWeixinSetting.TenPayV3_MchId}{SystemTime.Now:yyyyMMddHHmmss}{TenPayV3Util.BuildRandomStr(6)}";
string timeStamp = TenPayV3Util.GetTimestamp();
string nonceStr = TenPayV3Util.GetNoncestr();
TenPayV3UnifiedorderRequestData xmlDataInfo = new TenPayV3UnifiedorderRequestData(Config.SenparcWeixinSetting.WxOpenAppId,
Config.SenparcWeixinSetting.TenPayV3_MchId, "开卡支付", sp_billno,
pMoney,
"127.0.0.1",
Config.SenparcWeixinSetting.TenPayV3_TenpayNotify, TenPayV3Type.JSAPI, authUserInput.OpenID,
Config.SenparcWeixinSetting.TenPayV3_Key, nonceStr, null, null, null, null, payTake.OrderId.ToString());
Console.WriteLine(xmlDataInfo.PackageRequestHandler.ParseXML());
var result = TenPayOldV3.Unifiedorder(xmlDataInfo);//调用统一订单接口
string packageStr = "prepay_id=" + result.prepay_id;
return new
{
success = true,
result.prepay_id,
appId = Config.SenparcWeixinSetting.WxOpenAppId,
timeStamp,
nonceStr,
package = packageStr,
signType = "MD5",
paySign = TenPayV3.GetJsPaySign(Config.SenparcWeixinSetting.WxOpenAppId, timeStamp, nonceStr,
packageStr, Config.SenparcWeixinSetting.TenPayV3_Key)
};
}
/// <summary> /// <summary>
/// 微信小程序支付回调 /// 微信小程序支付回调
/// </summary> /// </summary>
@ -267,36 +330,52 @@ namespace GDZZ.Application.Service.WXPay
var paymentId = long.Parse(resHandler.GetParameter("attach")); var paymentId = long.Parse(resHandler.GetParameter("attach"));
//业务处理 //业务处理
var paytake = await this.payTakeRep.Where(x => x.OrderId == paymentId).SingleAsync(); var paytake = await this.payTakeRep.Where(x => x.OrderId == paymentId).SingleAsync();
if (!paytake.IsEmpty())
{ if (paytake.IsEmpty())
paytake.PayStatus = PayStatusEnum.Paying; throw Oops.Oh("无此订单,回调失败");
this.payTakeRep.Update(paytake);
}
var recharge = await this.rechargeRep.Where(x => x.Id == paymentId).SingleAsync(); this.payTakeRep.BeginTran();
if (!recharge.IsEmpty()) paytake.PayStatus = PayStatusEnum.Paying;
switch (paytake.Type)
{ {
recharge.Status = RechargeEnum.Finish; case Enum.PayTypeEnum.RECHARGE:
this.rechargeRep.Update(recharge); var recharge = await this.rechargeRep.Where(x => x.Id == paymentId).SingleAsync();
var balan = await this.balance.AsQueryable().Filter("TenantId", true).Where(x => x.UserID == paytake.CreatedUserId).SingleAsync(); if (!recharge.IsEmpty())
if (!balan.IsEmpty())
{
balan.Amount = recharge.PaymentMoney;
this.balance.Update(balan);
}
else
{
this.balance.Insert(new Balance()
{ {
Amount = recharge.PaymentMoney, recharge.Status = RechargeEnum.Finish;
UserID = (long)paytake.CreatedUserId this.rechargeRep.Update(recharge);
}); var balan = await this.balance.AsQueryable().Filter("TenantId", true).Where(x => x.UserID == paytake.CreatedUserId).SingleAsync();
} if (!balan.IsEmpty())
{
balan.Amount = recharge.PaymentMoney;
this.balance.Update(balan);
}
else
{
this.balance.Insert(new Balance()
{
Amount = recharge.PaymentMoney,
UserID = (long)paytake.CreatedUserId
});
}
}
break;
case Enum.PayTypeEnum.BUY:
break;
default:
throw Oops.Oh("订单类型错误");
} }
this.payTakeRep.Update(paytake);
content.Content = string.Format(@"<xml> content.Content = string.Format(@"<xml>
<return_code><![CDATA[{0}]]></return_code> <return_code><![CDATA[{0}]]></return_code>
<return_msg><![CDATA[{1}]]></return_msg> <return_msg><![CDATA[{1}]]></return_msg>
</xml>", return_code, return_msg); </xml>", return_code, return_msg);
this.SendTemplate(0, return_code, resHandler); this.SendTemplate(0, return_code, resHandler);
this.payTakeRep.CommitTran();
} }
else else
{ {
@ -308,11 +387,14 @@ namespace GDZZ.Application.Service.WXPay
} }
catch (Exception ex) catch (Exception ex)
{ {
this.payTakeRep.RollbackTran();
content.Content = ex.Message; content.Content = ex.Message;
} }
return content; return content;
} }
#endregion #endregion

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Loading…
Cancel
Save