diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index 6bf8b3bf..213fa478 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -3450,5 +3450,61 @@ namespace CoreCms.Net.Configuration } #endregion + #region 微信支付-商家转账场景ID + /// + /// 微信支付-商家转账场景ID + /// + public enum WeChatPayTransferSceneId + { + /// + /// 现金营销 + /// + [Description("现金营销")] + 现金营销 = 1000, + + /// + /// 佣金报酬 + /// + [Description("佣金报酬")] + 佣金报酬 = 1005, + + /// + /// 采购货款 + /// + [Description("采购货款")] + 采购货款 = 1009, + + /// + /// 二手回收 + /// + [Description("二手回收")] + 二手回收 = 1010, + + /// + /// 企业赔付 + /// + [Description("企业赔付")] + 企业赔付 = 1011, + + /// + /// 行政补贴 + /// + [Description("行政补贴")] + 行政补贴 = 1002, + + /// + /// 公益补助 + /// + [Description("公益补助")] + 公益补助 = 1013, + + /// + /// 保险理赔 + /// + [Description("保险理赔")] + 保险理赔 = 1004, + } + #endregion + } } diff --git a/CoreCms.Net.IServices/User/ICoreCmsUserTocashServices.cs b/CoreCms.Net.IServices/User/ICoreCmsUserTocashServices.cs index f39ceaba..a01597eb 100644 --- a/CoreCms.Net.IServices/User/ICoreCmsUserTocashServices.cs +++ b/CoreCms.Net.IServices/User/ICoreCmsUserTocashServices.cs @@ -44,10 +44,12 @@ namespace CoreCms.Net.IServices /// /// 提现审核 /// - /// - /// + /// 数据序列 + /// 状态 + /// 提现方式 + /// 转账场景(只有微信支付商家转账时使用) /// - Task Examine(int id = 0, int status = 0, int type = (int)GlobalEnumVars.UserTocashType.银行线下转账); + Task Examine(int id = 0, int status = 0, int type = (int)GlobalEnumVars.UserTocashType.银行线下转账, int sceneId = 1000); #region 重写根据条件查询分页数据 diff --git a/CoreCms.Net.Model/CoreCms.Net.Model.xml b/CoreCms.Net.Model/CoreCms.Net.Model.xml index bdcbf0bd..b99f3527 100644 --- a/CoreCms.Net.Model/CoreCms.Net.Model.xml +++ b/CoreCms.Net.Model/CoreCms.Net.Model.xml @@ -10665,6 +10665,11 @@ 提现方式 + + + 转账场景(只有微信支付商家转账时使用) + + diff --git a/CoreCms.Net.Model/FromBody/FMUser.cs b/CoreCms.Net.Model/FromBody/FMUser.cs index f01b75ba..304c4816 100644 --- a/CoreCms.Net.Model/FromBody/FMUser.cs +++ b/CoreCms.Net.Model/FromBody/FMUser.cs @@ -160,6 +160,12 @@ namespace CoreCms.Net.Model.FromBody /// public int type { get; set; } + + /// + /// 转账场景(只有微信支付商家转账时使用) + /// + public int sceneId { get; set; } = 1000; + } } \ No newline at end of file diff --git a/CoreCms.Net.Services/User/CoreCmsUserTocashServices.cs b/CoreCms.Net.Services/User/CoreCmsUserTocashServices.cs index acfc67a6..3a35b3fa 100644 --- a/CoreCms.Net.Services/User/CoreCmsUserTocashServices.cs +++ b/CoreCms.Net.Services/User/CoreCmsUserTocashServices.cs @@ -253,10 +253,12 @@ namespace CoreCms.Net.Services /// /// 提现审核 /// - /// - /// + /// 数据序列 + /// 状态 + /// 提现方式 + /// 转账场景(只有微信支付商家转账时使用) /// - public async Task Examine(int id = 0, int status = 0, int type = (int)GlobalEnumVars.UserTocashType.银行线下转账) + public async Task Examine(int id = 0, int status = 0, int type = (int)GlobalEnumVars.UserTocashType.银行线下转账, int sceneId = 1000) { var jm = new WebApiCallBack(); @@ -575,7 +577,6 @@ namespace CoreCms.Net.Services request.AppId = config.appId; request.OutBillNumber = "usertocash" + info.id; - request.TransferSceneId = "1000"; request.OpenId = weChatUserInfo.openid; //按分计算 @@ -584,22 +585,138 @@ namespace CoreCms.Net.Services { request.UserName = info.accountName; } - - request.TransferRemark = "客户推广业务佣金提现处理"; request.NotifyUrl = config.transferBillsUrl; - request.TransferSceneReportInfoList = new List() - { - new CreateFundAppMerchantTransferBillRequest.Types.TransferSceneReportInfo() + + request.TransferSceneId = sceneId.ToString(); + switch (sceneId) + { + case (int)GlobalEnumVars.WeChatPayTransferSceneId.现金营销: + request.TransferRemark = "客户推广业务佣金提现处理"; + request.TransferSceneReportInfoList = new List() { - InfoType = "活动名称", - InfoContent = "分销佣金提现", - }, - new CreateFundAppMerchantTransferBillRequest.Types.TransferSceneReportInfo() + new() + { + InfoType = "活动名称", + InfoContent = "分销佣金提现", + }, + new() + { + InfoType = "奖励说明", + InfoContent = "用户分销佣金提现申请", + } + }; + + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.企业赔付: + request.TransferRemark = "企业赔付费用"; + request.TransferSceneReportInfoList = new List() { - InfoType = "奖励说明", - InfoContent = "用户分销佣金提现申请", - } - }; + new() + { + InfoType = "赔付原因", + InfoContent = "用户主动申请赔付提现转账", + } + }; + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.佣金报酬: + request.TransferRemark = "佣金报酬费用"; + request.TransferSceneReportInfoList = new List() + { + new() + { + InfoType = "岗位类型", + InfoContent = "业务人员", + }, + new() + { + InfoType = "报酬说明", + InfoContent = "用户主动申请报酬提现转账", + } + }; + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.采购货款: + request.TransferRemark = "采购货款费用"; + request.TransferSceneReportInfoList = new List() + { + new() + { + InfoType = "采购商品名称", + InfoContent = "未定义的商品名称提现转账", + } + }; + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.二手回收: + request.TransferRemark = "二手回收费用"; + request.TransferSceneReportInfoList = new List() + { + new() + { + InfoType = "回收商品名称", + InfoContent = "未定义的商品名称提现转账", + } + }; + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.公益补助: + request.TransferRemark = "公益补助费用"; + request.TransferSceneReportInfoList = new List() + { + new() + { + InfoType = "公益活动名称", + InfoContent = "未定义的活动名称", + }, + new() + { + InfoType = "公益活动备案编号", + InfoContent = "未定义的活动备案编号", + } + }; + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.行政补贴: + request.TransferRemark = "行政补贴费用"; + request.TransferSceneReportInfoList = new List() + { + new() + { + InfoType = "补贴类型", + InfoContent = "用户自主申请行政补贴费用提现", + } + }; + break; + + case (int)GlobalEnumVars.WeChatPayTransferSceneId.保险理赔: + request.TransferRemark = "保险理赔费用"; + request.TransferSceneReportInfoList = new List() + { + new() + { + InfoType = "保险产品备案编号", + InfoContent = "未定义的保险产品备案编号", + }, + new() + { + InfoType = "保险名称", + InfoContent = "未定义的保险名称", + }, + new() + { + InfoType = "保险操作单号", + InfoContent = "未定义的保险操作单号", + } + }; + break; + + default: + + break; + } + var response = await client.ExecuteCreateFundAppMerchantTransferBillAsync(request); if (response.IsSuccessful()) @@ -630,7 +747,6 @@ namespace CoreCms.Net.Services log.createTime = DateTime.Now; await _userTocashWeChatResponseServices.InsertAsync(log); - jm.status = bl; jm.data = status; } @@ -662,8 +778,6 @@ namespace CoreCms.Net.Services break; } return jm; - - } diff --git a/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserTocashController.cs b/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserTocashController.cs index a02c5754..56a8a794 100644 --- a/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserTocashController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/User/CoreCmsUserTocashController.cs @@ -294,12 +294,14 @@ namespace CoreCms.Net.Web.Admin.Controllers var userTocashStatus = EnumHelper.EnumToList(); var userTocashType = EnumHelper.EnumToList(); + var weChatPayTransferSceneId = EnumHelper.EnumToList(); jm.data = new { model, userTocashStatus, - userTocashType + userTocashType, + weChatPayTransferSceneId }; return jm; @@ -327,7 +329,7 @@ namespace CoreCms.Net.Web.Admin.Controllers return jm; } - var res = await _coreCmsUserTocashServices.Examine(entity.id, entity.status, entity.type); + var res = await _coreCmsUserTocashServices.Examine(entity.id, entity.status, entity.type, entity.sceneId); jm.code = res.status ? 0 : 1; jm.data = res.data; jm.msg = res.msg; @@ -360,12 +362,14 @@ namespace CoreCms.Net.Web.Admin.Controllers var userTocashStatus = EnumHelper.EnumToList(); var userTocashType = EnumHelper.EnumToList(); + var weChatPayTransferSceneId = EnumHelper.EnumToList(); jm.data = new { model, userTocashStatus, - userTocashType + userTocashType, + weChatPayTransferSceneId }; return jm; diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/edit.html b/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/edit.html index 99624983..52f0efb9 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/edit.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/edit.html @@ -23,13 +23,24 @@ +
+ +
+ +
+
1、微信提现需微信支付商户开通了企业付款到零钱功能。
2、只有【提现方式】为【银行卡】,才可主动设置成功失败。
3、微信提现方式下,将依据请求微信api接口返回信息,进行状态处理。
4、【微信提现付款到零钱】【微信提现付款到银行卡】再有异常的情况下,都可继续进行新的处理,可能会存在网络,微信支付商户余额,用户填写的银行卡信息错误等。
- 5、【微信提现付款到银行卡】需要配置【RsaPublicKey】,请自行添加,不然会报异常。 + 5、【微信提现付款到银行卡】需要配置【RsaPublicKey】,请自行添加,不然会报异常。
+ 6、【商家转账】请完善微信支付配置里面的相关【平台证书】或者【微信支付公钥】,请自行添加,不然会报异常,另外选择【商家转账】时,根据自己申请的【转账场景】选择上面【转账场景】的下拉数据,错误的转账场景也将导致转账失败。
@@ -43,6 +54,7 @@ layui.data.sendParams = function (d) { //开启调试情况下获取接口赋值数据 if (debug) { console.log(d.params.data); } + layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'], function () { var $ = layui.$ @@ -54,6 +66,7 @@ , coreHelper = layui.coreHelper; $('#selectStatusBox').hide(); + $('#selectSceneBox').hide(); form.on('select(selectType)', function (data) { console.log(data.value); //复选框value值,也可以通过data.elem.value得到 @@ -62,6 +75,13 @@ } else { $('#selectStatusBox').hide(); } + + if (data.value === '4') { + $('#selectSceneBox').show(); + } else { + $('#selectSceneBox').hide(); + } + }); diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/index.html index eb60937a..56416777 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/financial/usertocash/index.html @@ -239,7 +239,7 @@ admin.popup({ shadeClose: false, title: '提现操作', - area: ['500px', '400px'], + area: ['500px', '500px'], id: 'LAY-popup-CoreCmsUserTocash-edit', success: function (layero, index) { view(this.id).render('financial/usertocash/edit', { data: e.data }).done(function () { @@ -248,8 +248,6 @@ function (data) { var field = data.field; //获取提交的字段 - - if (debug) { console.log(field); } //开启调试返回数据 //提交 Ajax 成功后,关闭当前弹层并重载表格 coreHelper.Post("Api/CoreCmsUserTocash/SetStatus", field, function (e) {