Commit a3247efc authored by liudong1993's avatar liudong1993

1同业提现

parent f3888c27
......@@ -65,5 +65,16 @@ namespace Edu.Common.Enum.Course
[EnumField("活动退款")]
ActivityExpenditure = 10,
/// <summary>
/// 教育同业返佣
/// </summary>
[EnumField("教育同业返佣")]
B2BCommission = 11,
/// <summary>
/// 教育同业幸福存折
/// </summary>
[EnumField("教育同业幸福存折")]
HappinessPassbook = 12
}
}
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 同业提款账户实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer_Account
{
/// <summary>
/// id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 客户资料id
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 银行名称
/// </summary>
public string BankName { get; set; }
/// <summary>
/// 银行卡号
/// </summary>
public string BankCardNo { get; set; }
/// <summary>
/// 开户人
/// </summary>
public string AccountHolder { get; set; }
/// <summary>
/// 开户行
/// </summary>
public string AccountBank { get; set; }
/// <summary>
/// Logo
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 状态 0正常,1删除
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime UpdateTime { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Customer
{
/// <summary>
/// 同业提现实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Customer_Remit
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 同业id
/// </summary>
public int CustomerId { get; set; }
/// <summary>
/// 类型 1佣金 2幸福存折
/// </summary>
public int Type { get; set; }
/// <summary>
/// 申请金额
/// </summary>
public decimal AppliedMoney { get; set; }
/// <summary>
/// 打款金额
/// </summary>
public decimal RemitMoney { get; set; }
/// <summary>
/// 审核状态 1申请中 2同意申请,待打款 3已打款 4拒绝
/// </summary>
public int AuditStatus { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public DateTime? AuditDate { get; set; }
/// <summary>
/// 打款时间
/// </summary>
public DateTime? RemitDate { get; set; }
/// <summary>
/// 驳回时间
/// </summary>
public DateTime? RejectDate { get; set; }
/// <summary>
/// 审核备注
/// </summary>
public string AuditRemark { get; set; }
/// <summary>
/// 打款备注
/// </summary>
public string RemitRemark { get; set; }
/// <summary>
/// 拒绝备注
/// </summary>
public string RejectRemark { get; set; }
/// <summary>
/// 集团ID
/// </summary>
public int GroupId { get; set; }
/// <summary>
/// CreateDate
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 提款账户Id
/// </summary>
public int BankAccountId { get; set; }
/// <summary>
/// 财务单据id
/// </summary>
public int FinanceId { get; set; }
/// <summary>
/// 关联的订单id
/// </summary>
public string ReOrderIds { get; set; }
/// <summary>
/// 幸福存折年份
/// </summary>
public int Year { get; set; }
}
}
......@@ -138,5 +138,10 @@ namespace Edu.Model.Entity.Finance
/// 公司名称
/// </summary>
public string RB_BranchName { get; set; }
/// <summary>
/// 教育同业提款账户ID
/// </summary>
public int EduRemitAccountId { get; set; }
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 同业提款账户扩展类
/// </summary>
public class RB_Customer_Account_Extend : RB_Customer_Account
{
/// <summary>
/// 银行账户Ids
/// </summary>
public string BankIds { get; set; }
}
}
using Edu.Model.Entity.Customer;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Customer
{
/// <summary>
/// 同业提现扩展类
/// </summary>
public class RB_Customer_Remit_Extend : RB_Customer_Remit
{
/// <summary>
/// 银行账户
/// </summary>
public string BankName { get; set; }
/// <summary>
/// 银行卡号
/// </summary>
public string BankCardNo { get; set; }
/// <summary>
/// 银行图标
/// </summary>
public string BankIcon { get; set; }
/// <summary>
/// 开户人
/// </summary>
public string AccountHolder { get; set; }
/// <summary>
/// 正常正常的提现
/// </summary>
public int Q_SelectNormal { get; set; }
/// <summary>
/// 同业名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 同业电话
/// </summary>
public string ContactNumber { get; set; }
/// <summary>
/// 同业电话
/// </summary>
public string CustomerImage { get; set; }
}
}
This diff is collapsed.
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using VT.FW.DB.Dapper;
using Edu.Common.Enum;
namespace Edu.Repository.Customer
{
/// <summary>
/// 同业提款账号仓储层对象
/// </summary>
public class RB_Customer_AccountRepository : BaseRepository<RB_Customer_Account>
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Account_Extend> GetAccountPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Account_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Customer_Account AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Account_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Account_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.BankName))
{
builder.AppendFormat(" AND A.{0} LIKE @BankName ", nameof(RB_Customer_Account_Extend.BankName));
parameters.Add("BankName", "%" + query.BankName.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.AccountHolder))
{
builder.AppendFormat(" AND A.{0} LIKE @AccountHolder ", nameof(RB_Customer_Account_Extend.AccountHolder));
parameters.Add("AccountHolder", "%" + query.AccountHolder.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.BankCardNo))
{
builder.AppendFormat(" AND A.{0} LIKE @BankCardNo ", nameof(RB_Customer_Account_Extend.BankCardNo));
parameters.Add("BankCardNo", "%" + query.BankCardNo.Trim() + "%");
}
}
return GetPage<RB_Customer_Account_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Account_Extend> GetAccountListRepository(RB_Customer_Account_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Customer_Account AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Account_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Account_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.BankName))
{
builder.AppendFormat(" AND A.{0} LIKE @BankName ", nameof(RB_Customer_Account_Extend.BankName));
parameters.Add("BankName", "%" + query.BankName.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.AccountHolder))
{
builder.AppendFormat(" AND A.{0} LIKE @AccountHolder ", nameof(RB_Customer_Account_Extend.AccountHolder));
parameters.Add("AccountHolder", "%" + query.AccountHolder.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.BankCardNo))
{
builder.AppendFormat(" AND A.{0} LIKE @BankCardNo ", nameof(RB_Customer_Account_Extend.BankCardNo));
parameters.Add("BankCardNo", "%" + query.BankCardNo.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.BankIds))
{
builder.AppendFormat(" AND A.{0} in({1}) ", nameof(RB_Customer_Account_Extend.Id), query.BankIds);
}
}
return Get<RB_Customer_Account_Extend>(builder.ToString(), parameters).ToList();
}
}
}
using Edu.Model.Entity.Customer;
using Edu.Model.ViewModel.Customer;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Customer
{
/// <summary>
/// 同业提现仓储层对象
/// </summary>
public class RB_Customer_RemitRepository : BaseRepository<RB_Customer_Remit>
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Remit_Extend> GetRemitPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Customer_Remit_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,c.CustomerName,c.ContactNumber,c.Image as CustomerImage
FROM RB_Customer_Remit AS A
inner join rb_customer c on A.CustomerId = c.CustomerId
WHERE 1=1
");
if (query != null)
{
if (query.GroupId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.GroupId), query.GroupId);
}
if (query.CustomerId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.CustomerId), query.CustomerId);
}
if (query.Type > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.Type), query.Type);
}
if (query.AuditStatus > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.AuditStatus), query.AuditStatus);
}
}
builder.AppendFormat(" order by A.Id desc");
return GetPage<RB_Customer_Remit_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Remit_Extend> GetRemitListRepository(RB_Customer_Remit_Extend query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Customer_Remit AS A
WHERE 1=1
");
if (query != null)
{
if (query.GroupId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.GroupId), query.GroupId);
}
if (query.CustomerId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.CustomerId), query.CustomerId);
}
if (query.Type > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.Type), query.Type);
}
if (query.AuditStatus > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.AuditStatus), query.AuditStatus);
}
if (query.Q_SelectNormal == 1)
{
builder.AppendFormat(" AND A.{0} <>4 ", nameof(RB_Customer_Remit_Extend.AuditStatus));
}
if (query.Year > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Remit_Extend.Year), query.Year);
}
}
builder.AppendFormat(" order by A.Id desc");
return Get<RB_Customer_Remit_Extend>(builder.ToString(), parameters).ToList();
}
}
}
......@@ -61,6 +61,11 @@ namespace Edu.Repository.Finance
{
where += string.Format(" AND " + nameof(RB_ClientBankAccount.CardNum) + " like '%{0}%' ", model.CardNum);
}
if (model.EduRemitAccountId > 0)
{
where += string.Format(" AND " + nameof(RB_ClientBankAccount.EduRemitAccountId) + "={0}", model.EduRemitAccountId);
}
return Get<RB_ClientBankAccount>("select * from " + TableName + " " + where).ToList();
}
}
......
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Customer;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Customer;
using Edu.Module.Customer;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Edu.WebApi.Controllers.Customer
{
[Route("api/[controller]/[action]")]
[ApiExceptionFilter]
[ApiController]
[EnableCors("AllowCors")]
public class B2BRemitController : BaseController
{
/// <summary>
/// 提现
/// </summary>
private readonly CustomerRemitModule customerRemitModule = new CustomerRemitModule();
#region 提现管理
/// <summary>
/// 获取同业提现申请分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCustomerRemitPageList() {
var userInfo = base.UserInfo;
ResultPageModel pmodel = JsonHelper.DeserializeObject<ResultPageModel>(base.RequestParm.Msg.ToString());
RB_Customer_Remit_Extend demodel = JsonHelper.DeserializeObject<RB_Customer_Remit_Extend>(base.RequestParm.Msg.ToString());
demodel.GroupId = userInfo.Group_Id;
var list = customerRemitModule.GetCustomerRemitPageList(pmodel.PageIndex, pmodel.PageSize, out long count, demodel);
pmodel.Count = Convert.ToInt32(count);
pmodel.PageData = list.Select(x => new
{
x.Id,
x.CustomerId,
x.CustomerName,
x.CustomerImage,
x.ContactNumber,
x.Type,
x.AppliedMoney,
x.RemitMoney,
x.AuditStatus,
AuditDate = x.AuditDate.HasValue ? x.AuditDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
RemitDate = x.RemitDate.HasValue ? x.RemitDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
RejectDate = x.RejectDate.HasValue ? x.RejectDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.AuditRemark,
x.RemitRemark,
x.RejectRemark,
CreateDate = x.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
x.Year,
x.BankAccountId,
x.BankName,
x.BankIcon,
x.BankCardNo,
x.AccountHolder
});
return ApiResult.Success("", pmodel);
}
/// <summary>
/// 设置同业提现申请状态
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCustomerRemitState() {
var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int RemitId = parms.GetInt("RemitId", 0);
int State = parms.GetInt("State", 1);//状态 1审核通过 2审核驳回
string Remark = parms.GetStringValue("Remark");//备注
if (RemitId <= 0) {
return ApiResult.ParamIsNull("请传递提现ID");
}
string msg = customerRemitModule.SetCustomerRemitState(RemitId, State, Remark, userInfo);
if (msg == "")
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed(msg);
}
}
#endregion
}
}
......@@ -34,8 +34,8 @@
"MongoDBName": "Edu",
"WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/",
"FinanceKey": "FinanceMallInsertToERPViitto2020",
"PaymentFinanceApi": "http://192.168.20.6:8083/api/Mall/InsertFinanceBatchForMallOut",
"IncomeFinanceApi": "http://192.168.20.6:8083/api/Mall/InsertFinanceBatchForMallIn",
"PaymentFinanceApi": "http://192.168.10.65:8083/api/Mall/InsertFinanceBatchForMallOut",
"IncomeFinanceApi": "http://192.168.10.65:8083/api/Mall/InsertFinanceBatchForMallIn",
"sTenpayNotifyUrl": "http://eduapi.oytour.com/api/WeChatPay/WxPayCallback", //下单回调地址
"sTenpayNotifyRefundUrl": "http://eduapi.oytour.com/api/WeChatPay/Refunds", //退款回调地址
"FinanceDateBase": "reborn_finance",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment