Commit a3247efc authored by liudong1993's avatar liudong1993

1同业提现

parent f3888c27
...@@ -65,5 +65,16 @@ namespace Edu.Common.Enum.Course ...@@ -65,5 +65,16 @@ namespace Edu.Common.Enum.Course
[EnumField("活动退款")] [EnumField("活动退款")]
ActivityExpenditure = 10, 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 ...@@ -138,5 +138,10 @@ namespace Edu.Model.Entity.Finance
/// 公司名称 /// 公司名称
/// </summary> /// </summary>
public string RB_BranchName { get; set; } 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; }
}
}
using Edu.Common;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.Finance;
using Edu.Repository.Customer;
using Edu.Repository.Finance;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;
namespace Edu.Module.Customer
{
/// <summary>
/// 客户提现处理类
/// </summary>
public class CustomerRemitModule
{
/// <summary>
/// 客户幸福存折和返佣仓储层对象
/// </summary>
private readonly RB_Customer_BalanceDetailRepository customer_BalanceDetailRepository = new RB_Customer_BalanceDetailRepository();
/// <summary>
/// 同业
/// </summary>
private readonly RB_CustomerRepository customerRepository = new RB_CustomerRepository();
/// <summary>
/// 提现账号
/// </summary>
private readonly RB_Customer_AccountRepository customer_AccountRepository = new RB_Customer_AccountRepository();
/// <summary>
/// 提现
/// </summary>
private readonly RB_Customer_RemitRepository customer_RemitRepository = new RB_Customer_RemitRepository();
/// <summary>
/// 财务配置
/// </summary>
private readonly RB_Finance_ConfigRepository finance_ConfigRepository = new RB_Finance_ConfigRepository();
/// <summary>
/// 财务账户
/// </summary>
private readonly RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
#region 提现管理
/// <summary>
/// 获取提现分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Customer_Remit_Extend> GetCustomerRemitPageList(int pageIndex, int pageSize, out long count, RB_Customer_Remit_Extend demodel)
{
var list = customer_RemitRepository.GetRemitPageRepository(pageIndex, pageSize, out count, demodel);
if (list.Any())
{
string bankIds = string.Join(",", list.Select(x => x.BankAccountId).Distinct());
var blist = customer_AccountRepository.GetAccountListRepository(new RB_Customer_Account_Extend() { Group_Id = demodel.GroupId, BankIds = bankIds });
foreach (var item in list)
{
var bmodel = blist.Where(x => x.Id == item.BankAccountId).FirstOrDefault();
item.BankName = bmodel.BankName;
item.BankCardNo = bmodel.BankCardNo;
item.BankIcon = bmodel.Logo;
item.AccountHolder = bmodel.AccountHolder;
}
}
return list;
}
/// <summary>
/// 设置同业提现状态
/// </summary>
/// <param name="remitId"></param>
/// <param name="state"></param>
/// <param name="remark"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public string SetCustomerRemitState(int remitId, int state, string remark, UserInfo userInfo)
{
var rmodel = customer_RemitRepository.GetEntity(remitId);
if (rmodel == null) { return "提现不存在"; }
if (rmodel.AuditStatus != 1) { return "提现状态不正确"; }
Dictionary<string, object> keyValues = new Dictionary<string, object>();
if (state == 1)
{
//审核通过
keyValues.Add(nameof(RB_Customer_Remit_Extend.AuditStatus), 2);
keyValues.Add(nameof(RB_Customer_Remit_Extend.AuditRemark), remark);
keyValues.Add(nameof(RB_Customer_Remit_Extend.AuditDate), DateTime.Now);
}
else if (state == 2)
{
//审核驳回
keyValues.Add(nameof(RB_Customer_Remit_Extend.AuditStatus), 4);
keyValues.Add(nameof(RB_Customer_Remit_Extend.RejectRemark), remark);
keyValues.Add(nameof(RB_Customer_Remit_Extend.RejectDate), DateTime.Now);
}
else {
return "状态有误,请核实后再试";
}
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Customer_Remit_Extend.Id),
FiledValue = remitId,
OperatorEnum =OperatorEnum.Equal
}
};
bool flag = customer_RemitRepository.Update(keyValues, wheres);
if (flag) {
if (state == 1) {
var cmodel = customerRepository.GetEntity(rmodel.CustomerId);
var amodel = customer_AccountRepository.GetEntity(rmodel.BankAccountId);
//同意需要制财务单据
#region 新增财务单据
var fcmodel = new RB_Finance_Config_ViewModel();
if (rmodel.Type == 1)
{
fcmodel = finance_ConfigRepository.GetList(new RB_Finance_Config_ViewModel() { Group_Id = userInfo.Group_Id, Type = FinanceConfigTypeEnum.B2BCommission }).FirstOrDefault();
}
else
{
fcmodel = finance_ConfigRepository.GetList(new RB_Finance_Config_ViewModel() { Group_Id = userInfo.Group_Id, Type = FinanceConfigTypeEnum.HappinessPassbook }).FirstOrDefault();
}
if (fcmodel == null) { return "未配置制单流程"; }
//银行账户
var clientModel = clientBankAccountRepository.GetList(new RB_ClientBankAccount_Extend() { RB_Group_Id = userInfo.Group_Id, Type = Common.Enum.Finance.ClientTypeEnum.Other, EduRemitAccountId = rmodel.BankAccountId }).FirstOrDefault();
if (clientModel == null)
{
//新增付款对象
clientModel = new Model.Entity.Finance.RB_ClientBankAccount() {
ID = 0,
Status = Common.Enum.DateStateEnum.Normal,
AccountAlias = amodel.BankName,
CardNum = amodel.BankCardNo,
AccountHolder = amodel.AccountHolder,
OpenBankName = amodel.AccountBank,
AccountClassify = 2,
AccountType = 2,
BankId = 0,
CreateBy = 0,
CreateDate = DateTime.Now,
EduRemitAccountId = rmodel.BankAccountId,
RB_BranchName = "",
RB_Branch_Id = 0,
RB_CreateByName = "",
RB_Group_Id = userInfo.Group_Id,
Type = Common.Enum.Finance.ClientTypeEnum.Other
};
clientModel.ID = clientBankAccountRepository.Insert(clientModel);
}
else {
if (amodel.BankName != clientModel.AccountAlias || amodel.BankCardNo != clientModel.CardNum
|| amodel.AccountHolder != clientModel.AccountHolder || amodel.AccountBank != clientModel.OpenBankName)
{
//修改付款对象
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_ClientBankAccount_Extend.AccountAlias), amodel.BankName},
{ nameof(RB_ClientBankAccount_Extend.CardNum), amodel.BankCardNo},
{ nameof(RB_ClientBankAccount_Extend.AccountHolder), amodel.AccountHolder},
{ nameof(RB_ClientBankAccount_Extend.OpenBankName), amodel.AccountBank},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_ClientBankAccount_Extend.ID),
FiledValue = clientModel.ID,
OperatorEnum =OperatorEnum.Equal
}
};
clientBankAccountRepository.Update(keyValues1, wheres1);
}
}
var detailList = new List<object> { };
decimal TotalMoney = rmodel.AppliedMoney;
detailList.Add(new
{
fcmodel.CostTypeId,
Number = 1,
OriginalMoney = rmodel.AppliedMoney,
UnitPrice = rmodel.AppliedMoney,
Remark = "同业" + (rmodel.Type == 1 ? "佣金" : "幸福存折") + "提现:" + cmodel.CustomerName + "(" + cmodel.ContactNumber + ")"
});
string Remark = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "自动生成财务单据";
var financeObj = new
{
IsPublic = 0,
ClientType = (int)Common.Enum.Finance.ClientTypeEnum.Other,
ClientID = clientModel.ID,
fcmodel.CurrencyId,
WBMoney = TotalMoney,
PayDate = DateTime.Now.ToString("yyyy-MM-dd"),
TemplateId = fcmodel.TempleteId,
OrderSource = 17,
OtherType = 49,
ReFinanceId = rmodel.Id,
Remark,
detailList,
CreateBy = userInfo.Id,
RB_Branch_Id = userInfo.School_Id,
RB_Depart_Id = userInfo.DeptId,
RB_Group_Id = userInfo.Group_Id,
RB_CreateByName = userInfo.AccountName,
RB_DepartName = userInfo.DeptName,
RB_BranchName = userInfo.SchoolName,
RB_GroupName = userInfo.GroupName,
FinanceType = 2
};
string sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.ReadConfigKey("FinanceKey"));
var resultInfo = new
{
msg = sign
};
string apiResult = HttpHelper.HttpPost(Config.ReadConfigKey("PaymentFinanceApi"), JsonHelper.Serialize(resultInfo), "");
JObject parmsJob = JObject.Parse(apiResult);
string resultCode = parmsJob.GetStringValue("resultCode");
int frid = parmsJob.GetInt("data", 0);
if (resultCode == "1" && frid > 0)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{
{ nameof(RB_Customer_Remit_Extend.FinanceId), frid},
{ nameof(RB_Customer_Remit_Extend.AuditRemark), remark +" 自动生成财务单据:"+frid}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Customer_Remit_Extend.Id),
FiledValue = rmodel.Id,
OperatorEnum =OperatorEnum.Equal
}
};
customer_RemitRepository.Update(keyValues1, wheres1);
}
else
{
string message = parmsJob.GetStringValue("message");
LogHelper.Write("SetCustomerRemitState:" + message);
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{
{ nameof(RB_Customer_Remit_Extend.FinanceId), frid},
{ nameof(RB_Customer_Remit_Extend.AuditRemark), remark +" 自动生成财务单据失败,请联系管理员"}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName = nameof(RB_Customer_Remit_Extend.Id),
FiledValue = rmodel.Id,
OperatorEnum =OperatorEnum.Equal
}
};
customer_RemitRepository.Update(keyValues1, wheres1);
}
#endregion
}
}
return flag ? "" : "出错了,请联系管理员";
}
#endregion
/// <summary>
/// 获取客户幸福存折分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_BalanceDetail_ViewModel> GetCustomerBalanceDetailPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Customer_BalanceDetail_ViewModel query)
{
var list = customer_BalanceDetailRepository.GetCustomerBalanceDetailPageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
/// <summary>
/// 获取客户返佣或幸福存折列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_BalanceDetail_ViewModel> GetCustomerBalanceDetailListModule(RB_Customer_BalanceDetail_ViewModel query)
{
var list = customer_BalanceDetailRepository.GetCustomerBalanceDetailListRepository(query);
return list;
}
}
}
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 ...@@ -61,6 +61,11 @@ namespace Edu.Repository.Finance
{ {
where += string.Format(" AND " + nameof(RB_ClientBankAccount.CardNum) + " like '%{0}%' ", model.CardNum); 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(); 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 @@ ...@@ -34,8 +34,8 @@
"MongoDBName": "Edu", "MongoDBName": "Edu",
"WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/", "WkHtmlToPdfPath": "D:/wkhtmltopdf/bin/",
"FinanceKey": "FinanceMallInsertToERPViitto2020", "FinanceKey": "FinanceMallInsertToERPViitto2020",
"PaymentFinanceApi": "http://192.168.20.6:8083/api/Mall/InsertFinanceBatchForMallOut", "PaymentFinanceApi": "http://192.168.10.65:8083/api/Mall/InsertFinanceBatchForMallOut",
"IncomeFinanceApi": "http://192.168.20.6:8083/api/Mall/InsertFinanceBatchForMallIn", "IncomeFinanceApi": "http://192.168.10.65:8083/api/Mall/InsertFinanceBatchForMallIn",
"sTenpayNotifyUrl": "http://eduapi.oytour.com/api/WeChatPay/WxPayCallback", //下单回调地址 "sTenpayNotifyUrl": "http://eduapi.oytour.com/api/WeChatPay/WxPayCallback", //下单回调地址
"sTenpayNotifyRefundUrl": "http://eduapi.oytour.com/api/WeChatPay/Refunds", //退款回调地址 "sTenpayNotifyRefundUrl": "http://eduapi.oytour.com/api/WeChatPay/Refunds", //退款回调地址
"FinanceDateBase": "reborn_finance", "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