diff --git a/GDZZ.Application/Entity/InviteUserPos.cs b/GDZZ.Application/Entity/InviteUserPos.cs index db92fec..ec1ae5b 100644 --- a/GDZZ.Application/Entity/InviteUserPos.cs +++ b/GDZZ.Application/Entity/InviteUserPos.cs @@ -7,10 +7,15 @@ namespace GDZZ.Application.Entity /// /// 邀请用户表 /// - [SugarTable("Invite_user_pos")] + [SugarTable("mini_Invite_user_pos")] [Description("邀请用户表")] - public class InviteUserPos : PrimaryKeyEntity + public class InviteUserPos { + + /// + /// 主键 + /// + public long Id { get; set; } /// /// 邀请码ID /// diff --git a/GDZZ.Application/Entity/JobHunt.cs b/GDZZ.Application/Entity/JobHunt.cs index 47a3c1e..669d50f 100644 --- a/GDZZ.Application/Entity/JobHunt.cs +++ b/GDZZ.Application/Entity/JobHunt.cs @@ -43,5 +43,13 @@ namespace GDZZ.Application.Entity /// 年龄 /// public string AgeValue { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } = 100; + /// + /// 结束时间 + /// + public DateTime ExpirationTime { get; set; } } } \ No newline at end of file diff --git a/GDZZ.Application/Entity/MiniPayTake.cs b/GDZZ.Application/Entity/MiniPayTake.cs index b92cb7b..8828edc 100644 --- a/GDZZ.Application/Entity/MiniPayTake.cs +++ b/GDZZ.Application/Entity/MiniPayTake.cs @@ -2,6 +2,8 @@ using SqlSugar; using System.ComponentModel; using GDZZ.Core.Entity; +using GDZZ.Application.Enum; + namespace GDZZ.Application.Entity { /// @@ -27,5 +29,9 @@ namespace GDZZ.Application.Entity /// 金额 /// public decimal PaymentMoney { get; set; } + /// + /// 支付类型 + /// + public PayTypeEnum Type { get; set; } } } \ No newline at end of file diff --git a/GDZZ.Application/Enum/CompanyEnum.cs b/GDZZ.Application/Enum/CompanyEnum.cs index b9b0fce..42867cd 100644 --- a/GDZZ.Application/Enum/CompanyEnum.cs +++ b/GDZZ.Application/Enum/CompanyEnum.cs @@ -15,12 +15,12 @@ namespace GDZZ.Application [Description("待审核")] Pending = 0, /// - /// 联系费用 + /// 审核通过 /// [Description("审核通过")] Approved = 1, /// - /// 联系费用 + /// 审核未通过 /// [Description("审核未通过")] Rejected = 2, } diff --git a/GDZZ.Application/Enum/PayTypeEnum.cs b/GDZZ.Application/Enum/PayTypeEnum.cs new file mode 100644 index 0000000..f77318a --- /dev/null +++ b/GDZZ.Application/Enum/PayTypeEnum.cs @@ -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 + { + + /// + /// 充值支付 + /// + [Description("充值支付")] RECHARGE = 0, + + /// + /// 购买支付 + /// + [Description("购买支付")] BUY = 10, + } +} diff --git a/GDZZ.Application/GDZZ.Application.xml b/GDZZ.Application/GDZZ.Application.xml index 7d7399f..28a032d 100644 --- a/GDZZ.Application/GDZZ.Application.xml +++ b/GDZZ.Application/GDZZ.Application.xml @@ -294,6 +294,11 @@ 邀请用户表 + + + 主键 + + 邀请码ID @@ -359,6 +364,16 @@ 年龄 + + + 排序 + + + + + 结束时间 + + 聊天历史任务列表 @@ -514,6 +529,11 @@ 金额 + + + 支付类型 + + 充值表 @@ -934,6 +954,16 @@ 系统错误 + + + 充值支付 + + + + + 购买支付 + + 热招 @@ -961,12 +991,12 @@ - 联系费用 + 审核通过 - 联系费用 + 审核未通过 @@ -1704,6 +1734,13 @@ 商品Id + + + 卡消费支付 + + 商品Id + + 微信小程序支付回调 @@ -2267,7 +2304,7 @@ - + 创建公司 @@ -2281,6 +2318,13 @@ 公司信息 + + + 更新公司属性 + + + + 公司属性输出参数 @@ -2411,6 +2455,11 @@ 主键Id + + + 是否通过 + + 公司属性输出参数 diff --git a/GDZZ.Application/Service/Auth/AuthService.cs b/GDZZ.Application/Service/Auth/AuthService.cs index ee5f56b..ea2390b 100644 --- a/GDZZ.Application/Service/Auth/AuthService.cs +++ b/GDZZ.Application/Service/Auth/AuthService.cs @@ -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); //解析电话 diff --git a/GDZZ.Application/Service/Company/CompanyService.cs b/GDZZ.Application/Service/Company/CompanyService.cs index b5be59e..8724b0b 100644 --- a/GDZZ.Application/Service/Company/CompanyService.cs +++ b/GDZZ.Application/Service/Company/CompanyService.cs @@ -78,11 +78,26 @@ namespace GDZZ.Application /// /// /// - [HttpPost("/Mini/Company/install")] - public async Task InstallAsync(AddCompanyInput input) + [HttpPost("/Mini/Company/UpdateOrInstall")] + public async Task UpdateOrInstall(AddCompanyInput input) { - var entity = input.Adapt(); - 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(); + entity.CompanyInfoUrl = entity.CompanyInfoUrl.TrimEnd(','); + await _rep.InsertAsync(entity); + } + else + { + var entity = input.Adapt(); + entity.CompanyInfoUrl = entity.CompanyInfoUrl.TrimEnd(','); + entity.ApprovalStatus = CompanyEnum.Pending; + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + + + } /// @@ -111,5 +126,19 @@ namespace GDZZ.Application } + + /// + /// 更新公司属性 + /// + /// + /// + [HttpPost("/Mini/Company/CompanyApprove")] + public async Task CompanyApprove(UpdateCompanyInput input) + { + + var entity = input.Adapt(); + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + } } diff --git a/GDZZ.Application/Service/Company/Dto/CompanyInput.cs b/GDZZ.Application/Service/Company/Dto/CompanyInput.cs index c653da6..9044ef2 100644 --- a/GDZZ.Application/Service/Company/Dto/CompanyInput.cs +++ b/GDZZ.Application/Service/Company/Dto/CompanyInput.cs @@ -101,7 +101,14 @@ namespace GDZZ.Application /// [Required(ErrorMessage = "主键Id不能为空")] public long Id { get; set; } - + + + /// + /// 是否通过 + /// + public bool IsCompanyApprove { get; set; } + + } public class QueryeCompanyInput : DeleteCompanyInput diff --git a/GDZZ.Application/Service/JobHunt/JobHuntService.cs b/GDZZ.Application/Service/JobHunt/JobHuntService.cs index b588f87..464dfbd 100644 --- a/GDZZ.Application/Service/JobHunt/JobHuntService.cs +++ b/GDZZ.Application/Service/JobHunt/JobHuntService.cs @@ -32,7 +32,10 @@ namespace GDZZ.Application public async Task 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(); } diff --git a/GDZZ.Application/Service/WXPay/WXPayService.cs b/GDZZ.Application/Service/WXPay/WXPayService.cs index 4b70735..68e81aa 100644 --- a/GDZZ.Application/Service/WXPay/WXPayService.cs +++ b/GDZZ.Application/Service/WXPay/WXPayService.cs @@ -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 } + + + /// + /// 卡消费支付 + /// + /// 商品Id + /// + [HttpPost] + [Route("Mini/v1/wxCardPay")] + public async Task 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) + }; + + + } + + + /// /// 微信小程序支付回调 /// @@ -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(@" ", 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 diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519532407971910.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519532407971910.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519532407971910.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519532433125446.png b/GDZZ.Web.Entry/wwwroot/Upload/Default/519532433125446.png new file mode 100644 index 0000000..acab648 Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519532433125446.png differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519617217286214.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519617217286214.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519617217286214.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519936367706182.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519936367706182.jpg new file mode 100644 index 0000000..676cf44 Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519936367706182.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519944972664902.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519944972664902.jpg new file mode 100644 index 0000000..9e468db Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519944972664902.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519987658756165.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519987658756165.jpg new file mode 100644 index 0000000..5164fca Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519987658756165.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519989065781318.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989065781318.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989065781318.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519989110702150.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989110702150.jpg new file mode 100644 index 0000000..41f726e Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989110702150.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519989239701574.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989239701574.jpg new file mode 100644 index 0000000..5164fca Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989239701574.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519989249060934.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989249060934.jpg new file mode 100644 index 0000000..41f726e Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519989249060934.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519991406956614.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519991406956614.jpg new file mode 100644 index 0000000..5164fca Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519991406956614.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519991418265670.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519991418265670.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519991418265670.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519996676886598.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519996676886598.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519996676886598.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/519996690518086.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/519996690518086.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/519996690518086.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/520024039985222.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024039985222.jpg new file mode 100644 index 0000000..5164fca Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024039985222.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/520024051216454.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024051216454.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024051216454.jpg differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/520024615772230.png b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024615772230.png new file mode 100644 index 0000000..94637e2 Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024615772230.png differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/520024632635462.png b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024632635462.png new file mode 100644 index 0000000..acab648 Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/520024632635462.png differ diff --git a/GDZZ.Web.Entry/wwwroot/Upload/Default/520211221876805.jpg b/GDZZ.Web.Entry/wwwroot/Upload/Default/520211221876805.jpg new file mode 100644 index 0000000..767bc4b Binary files /dev/null and b/GDZZ.Web.Entry/wwwroot/Upload/Default/520211221876805.jpg differ