This commit is contained in:
zpc 2025-09-16 02:51:42 +08:00
parent a631ec2a5a
commit 5b2b9b7de8
9 changed files with 85 additions and 8 deletions

View File

@ -971,6 +971,9 @@ namespace CoreCms.Net.Configuration
/// </summary> /// </summary>
[Description("服务订单")] [Description("服务订单")]
ServiceOrder = 5, ServiceOrder = 5,
[Description("鸽子费")]
GeZiFei = 6,
} }
/// <summary> /// <summary>
/// 付款单状态【对应CoreCmsBillPayments.status字段】 /// 付款单状态【对应CoreCmsBillPayments.status字段】

View File

@ -13,6 +13,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.Configuration; using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository; using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
@ -26,13 +27,17 @@ using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions; using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper; using CoreCms.Net.Utility.Helper;
using CoreCms.Net.WeChat.Service.Options; using CoreCms.Net.WeChat.Service.Options;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NLog; using NLog;
using SqlSugar; using SqlSugar;
@ -227,6 +232,22 @@ namespace CoreCms.Net.Services
jm.status = true; jm.status = true;
jm.data = dto; jm.data = dto;
} }
else if (type == (int)GlobalEnumVars.BillPaymentsType.GeZiFei)
{
dto.money = 10;
if (@params != null && @params.ContainsKey("money"))
{
dto.money = @params["money"].ObjectToDecimal(0); //充值金额
}
dto.rel.Add(new rel()
{
sourceId = orderId,
money = dto.money
});
jm.status = true;
jm.data = dto;
}
else if (false) else if (false)
{ {
@ -382,6 +403,7 @@ namespace CoreCms.Net.Services
jm.data = dto; jm.data = dto;
} }
else if (false) else if (false)
{ {
//todo 其他业务逻辑 //todo 其他业务逻辑
@ -466,6 +488,7 @@ namespace CoreCms.Net.Services
if (paymentCode == GlobalEnumVars.PaymentsTypes.wechatpay.ToString()) if (paymentCode == GlobalEnumVars.PaymentsTypes.wechatpay.ToString())
{ {
jm = await weChatPayServices.PubPay(billPayments); jm = await weChatPayServices.PubPay(billPayments);
} }
//支付宝支付 //支付宝支付
else if (paymentCode == GlobalEnumVars.PaymentsTypes.alipay.ToString()) else if (paymentCode == GlobalEnumVars.PaymentsTypes.alipay.ToString())
@ -561,7 +584,7 @@ namespace CoreCms.Net.Services
var paymentRelData = new CheckPayDTO(); var paymentRelData = new CheckPayDTO();
var sourceStrArr = sourceStr.Split(","); var sourceStrArr = sourceStr.Split(",");
if (sourceStrArr.Length > 0) if (!string.IsNullOrEmpty(sourceStr) && sourceStrArr.Length > 0)
{ {
var paymentRel = await BatchFormatPaymentRel(sourceStrArr, type, @params); var paymentRel = await BatchFormatPaymentRel(sourceStrArr, type, @params);
if (paymentRel.status == false) if (paymentRel.status == false)
@ -750,6 +773,9 @@ namespace CoreCms.Net.Services
break; break;
case (int)GlobalEnumVars.BillPaymentsType.ServiceOrder: case (int)GlobalEnumVars.BillPaymentsType.ServiceOrder:
break; break;
case (int)GlobalEnumVars.BillPaymentsType.GeZiFei:
res = "鸽子费";
break;
default: default:
break; break;
} }

View File

@ -10,6 +10,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using CoreCms.Net.Auth.HttpContextUser; using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration; using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository; using CoreCms.Net.IRepository;
@ -18,10 +19,13 @@ using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions; using CoreCms.Net.Utility.Extensions;
using Essensoft.Paylink.WeChatPay; using Essensoft.Paylink.WeChatPay;
using Essensoft.Paylink.WeChatPay.V2; using Essensoft.Paylink.WeChatPay.V2;
using Essensoft.Paylink.WeChatPay.V2.Request; using Essensoft.Paylink.WeChatPay.V2.Request;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@ -129,7 +133,7 @@ namespace CoreCms.Net.Services
jm.status = true; jm.status = true;
jm.msg = "支付成功"; jm.msg = "支付成功";
jm.data = parameter; jm.data = parameter;
jm.otherData = response; //jm.otherData = response;
} }
else else
{ {

View File

@ -5528,7 +5528,7 @@
微信小程序消息模板 微信小程序消息模板
</summary> </summary>
</member> </member>
<member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsUserWeChatMsgTemplateController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsUserWeChatMsgTemplateServices)"> <member name="M:CoreCms.Net.Web.Admin.Controllers.CoreCmsUserWeChatMsgTemplateController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ICoreCmsUserWeChatMsgTemplateServices,CoreCms.Net.Caching.AutoMate.RedisCache.IRedisOperationRepository)">
<summary> <summary>
构造函数 构造函数
</summary> </summary>

Binary file not shown.

View File

@ -51,6 +51,7 @@ using System.Text.RegularExpressions;
using CoreCms.Net.Model.ViewModels.User; using CoreCms.Net.Model.ViewModels.User;
using CoreCms.Net.Repository.UnitOfWork; using CoreCms.Net.Repository.UnitOfWork;
using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IRepository.UnitOfWork;
using Newtonsoft.Json.Linq;
namespace CoreCms.Net.Web.WebApi.Controllers namespace CoreCms.Net.Web.WebApi.Controllers
{ {
@ -1266,6 +1267,43 @@ namespace CoreCms.Net.Web.WebApi.Controllers
return jm; return jm;
} }
/// <summary>
/// 支付
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize]
public async Task<WebApiCallBack> UsePay([FromBody] JObject @params)
{
var jm = new WebApiCallBack();
var userId = _user.ID;
if (@params == null || !@params.ContainsKey("money"))
{
jm.status = false;
jm.msg = "参数不全";
return jm;
}
if (@params.ContainsKey("nonce"))
{
@params.Remove("nonce");
}
if (@params.ContainsKey("sign"))
{
@params.Remove("sign");
}
if (!@params.ContainsKey("trade_type"))
{
@params.Add("trade_type", "JSAPI_OFFICIAL");
}
//生成支付单,并发起支付
jm = await _billPaymentsServices.Pay("", "wechatpay", _user.ID, 6, @params);
return jm;
}
#endregion #endregion
#region #region

View File

@ -1133,6 +1133,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.UsePay(Newtonsoft.Json.Linq.JObject)">
<summary>
支付
</summary>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.OrderEvaluate(CoreCms.Net.Model.ViewModels.DTO.OrderEvaluatePost)"> <member name="M:CoreCms.Net.Web.WebApi.Controllers.UserController.OrderEvaluate(CoreCms.Net.Model.ViewModels.DTO.OrderEvaluatePost)">
<summary> <summary>
订单评价 订单评价

Binary file not shown.

View File

@ -92,16 +92,16 @@
"WeChatPay": { "WeChatPay": {
// //
// AppIdAppIdAppIdCorpId // AppIdAppIdAppIdCorpId
"AppId": "", "AppId": "wxa17265f5fe8374b1",
// //
// //
"MchId": "", "MchId": "1727621532",
// API // API
// APIAPIv3 // APIAPIv3
"APIKey": "", "APIKey": "zZ1uE0kU3iU5pB0tF4vA9xJ3oK7kR4cZ",
// APIv3 // APIv3
// APIv3APIv3 // APIv3APIv3
"APIv3Key": "", "APIv3Key": "mU8rK7iV0zK1wV9iE1iW5nH5bT8dC9nU",
// API(.p12) // API(.p12)
// API(.p12)v3 // API(.p12)v3
// (.p12) / (.p12)base64 // (.p12) / (.p12)base64
@ -109,7 +109,7 @@
"Certificate": "WxPayCert\\apiclient_cert.p12", "Certificate": "WxPayCert\\apiclient_cert.p12",
// RSA // RSA
// "企业付款到银行卡API"使"获取RSA加密公钥API" // "企业付款到银行卡API"使"获取RSA加密公钥API"
"RsaPublicKey": "" "RsaPublicKey": "PUB_KEY_ID_0117276215322025091500291681003001"
}, },
// //
// AlipayOptions // AlipayOptions