新增会员中心

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

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

@ -43,5 +43,13 @@ namespace GDZZ.Application.Entity
/// 年龄
/// </summary>
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 System.ComponentModel;
using GDZZ.Core.Entity;
using GDZZ.Application.Enum;
namespace GDZZ.Application.Entity
{
/// <summary>
@ -27,5 +29,9 @@ namespace GDZZ.Application.Entity
/// 金额
/// </summary>
public decimal PaymentMoney { get; set; }
/// <summary>
/// 支付类型
/// </summary>
public PayTypeEnum Type { get; set; }
}
}

@ -15,12 +15,12 @@ namespace GDZZ.Application
[Description("待审核")] Pending = 0,
/// <summary>
/// 联系费用
/// 审核通过
/// </summary>
[Description("审核通过")] Approved = 1,
/// <summary>
/// 联系费用
/// 审核未通过
/// </summary>
[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>
</member>
<member name="P:GDZZ.Application.Entity.InviteUserPos.Id">
<summary>
主键
</summary>
</member>
<member name="P:GDZZ.Application.Entity.InviteUserPos.InviteID">
<summary>
邀请码ID
@ -359,6 +364,16 @@
年龄
</summary>
</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">
<summary>
聊天历史任务列表
@ -514,6 +529,11 @@
金额
</summary>
</member>
<member name="P:GDZZ.Application.Entity.MiniPayTake.Type">
<summary>
支付类型
</summary>
</member>
<member name="T:GDZZ.Application.Entity.MiniRecharge">
<summary>
充值表
@ -934,6 +954,16 @@
系统错误
</summary>
</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">
<summary>
热招
@ -961,12 +991,12 @@
</member>
<member name="F:GDZZ.Application.CompanyEnum.Approved">
<summary>
联系费用
审核通过
</summary>
</member>
<member name="F:GDZZ.Application.CompanyEnum.Rejected">
<summary>
联系费用
审核未通过
</summary>
</member>
<member name="F:GDZZ.Application.ConsumeEnum.Contact">
@ -1704,6 +1734,13 @@
<param name="authUserInput">商品Id</param>
<returns></returns>
</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">
<summary>
微信小程序支付回调
@ -2267,7 +2304,7 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:GDZZ.Application.CompanyService.InstallAsync(GDZZ.Application.AddCompanyInput)">
<member name="M:GDZZ.Application.CompanyService.UpdateOrInstall(GDZZ.Application.AddCompanyInput)">
<summary>
创建公司
</summary>
@ -2281,6 +2318,13 @@
<param name="input">公司信息</param>
<returns></returns>
</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">
<summary>
公司属性输出参数
@ -2411,6 +2455,11 @@
主键Id
</summary>
</member>
<member name="P:GDZZ.Application.UpdateCompanyInput.IsCompanyApprove">
<summary>
是否通过
</summary>
</member>
<member name="T:GDZZ.Application.CompanyOutput">
<summary>
公司属性输出参数

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

@ -78,11 +78,26 @@ namespace GDZZ.Application
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/Mini/Company/install")]
public async Task InstallAsync(AddCompanyInput input)
[HttpPost("/Mini/Company/UpdateOrInstall")]
public async Task UpdateOrInstall(AddCompanyInput input)
{
var entity = input.Adapt<Company>();
await _rep.InsertAsync(entity);
var company =await this._rep.AsQueryable().Where(x => x.Code == input.Code && x.Name == input.Name).FirstAsync();
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>
@ -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不能为空")]
public long Id { get; set; }
/// <summary>
/// 是否通过
/// </summary>
public bool IsCompanyApprove { get; set; }
}
public class QueryeCompanyInput : DeleteCompanyInput

@ -32,7 +32,10 @@ namespace GDZZ.Application
public async Task<dynamic> Page([FromQuery] JobHuntInput input)
{
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.Position), u => u.Position == input.Position)
.OrderBy(u => u.Sort)
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}

@ -198,6 +198,7 @@ namespace GDZZ.Application.Service.WXPay
var payTake = await this.payTakeRep.InsertReturnEntityAsync(new MiniPayTake()
{
PaymentMoney = authUserInput.Money,
Type = Enum.PayTypeEnum.BUY,
OrderId = recharge.Id,
PaySn = "",
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>
@ -267,36 +330,52 @@ namespace GDZZ.Application.Service.WXPay
var paymentId = long.Parse(resHandler.GetParameter("attach"));
//业务处理
var paytake = await this.payTakeRep.Where(x => x.OrderId == paymentId).SingleAsync();
if (!paytake.IsEmpty())
{
paytake.PayStatus = PayStatusEnum.Paying;
this.payTakeRep.Update(paytake);
}
var recharge = await this.rechargeRep.Where(x => x.Id == paymentId).SingleAsync();
if (!recharge.IsEmpty())
if (paytake.IsEmpty())
throw Oops.Oh("无此订单,回调失败");
this.payTakeRep.BeginTran();
paytake.PayStatus = PayStatusEnum.Paying;
switch (paytake.Type)
{
recharge.Status = RechargeEnum.Finish;
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()
case Enum.PayTypeEnum.RECHARGE:
var recharge = await this.rechargeRep.Where(x => x.Id == paymentId).SingleAsync();
if (!recharge.IsEmpty())
{
Amount = recharge.PaymentMoney,
UserID = (long)paytake.CreatedUserId
});
}
recharge.Status = RechargeEnum.Finish;
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>
<return_code><![CDATA[{0}]]></return_code>
<return_msg><![CDATA[{1}]]></return_msg>
</xml>", return_code, return_msg);
this.SendTemplate(0, return_code, resHandler);
this.payTakeRep.CommitTran();
}
else
{
@ -308,11 +387,14 @@ namespace GDZZ.Application.Service.WXPay
}
catch (Exception ex)
{
this.payTakeRep.RollbackTran();
content.Content = ex.Message;
}
return content;
}
#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