Commit a0be93d8 authored by 黄奎's avatar 黄奎

页面修改

parent 19887680
......@@ -6,6 +6,7 @@ using Edu.Model.ViewModel.Customer;
using Edu.Model.ViewModel.Finance;
using Edu.Repository.Customer;
using Edu.Repository.Finance;
using Edu.Repository.User;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
......@@ -47,12 +48,17 @@ namespace Edu.Module.Customer
/// <summary>
/// 用户返佣
/// </summary>
private readonly Repository.User.RB_User_ReturnComissionRepository user_ReturnComissionRepository = new Repository.User.RB_User_ReturnComissionRepository();
private readonly RB_User_ReturnComissionRepository user_ReturnComissionRepository = new RB_User_ReturnComissionRepository();
/// <summary>
/// 订单返佣
/// </summary>
private readonly Repository.Sell.RB_Order_ReturnComissionRepository order_ReturnComissionRepository = new Repository.Sell.RB_Order_ReturnComissionRepository();
/// <summary>
/// 员工信息仓储层对象
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
#region 提现管理
......@@ -96,30 +102,32 @@ namespace Edu.Module.Customer
var rmodel = customer_RemitRepository.GetEntity(remitId);
if (rmodel == null) { return "提现不存在"; }
if (rmodel.AuditStatus != 1) { return "提现状态不正确"; }
Dictionary<string, object> keyValues = new Dictionary<string, object>();
Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{nameof(RB_Customer_Remit_Extend.AuditRemark), remark} ,
{nameof(RB_Customer_Remit_Extend.AuditDate), DateTime.Now}
};
//审核通过
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(){
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName = nameof(RB_Customer_Remit_Extend.Id),
FiledValue = remitId,
OperatorEnum =OperatorEnum.Equal
FiledValue = remitId,
OperatorEnum =OperatorEnum.Equal
}
};
bool flag = customer_RemitRepository.Update(keyValues, wheres);
......@@ -129,6 +137,7 @@ namespace Edu.Module.Customer
{
var cmodel = customerRepository.GetEntity(rmodel.CustomerId);
var amodel = customer_AccountRepository.GetEntity(rmodel.BankAccountId);
var employeeModel = accountRepository.GetEmployeeInfo(cmodel.CreateBy);
//同意需要制财务单据
#region 新增财务单据
var fcmodel = new RB_Finance_Config_ViewModel();
......@@ -180,11 +189,13 @@ namespace Edu.Module.Customer
{ nameof(RB_ClientBankAccount_Extend.AccountHolder), amodel.AccountHolder},
{ nameof(RB_ClientBankAccount_Extend.OpenBankName), amodel.AccountBank},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
List<WhereHelper> wheres1 = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName = nameof(RB_ClientBankAccount_Extend.ID),
FiledValue = clientModel.ID,
OperatorEnum =OperatorEnum.Equal
FiledValue = clientModel.ID,
OperatorEnum =OperatorEnum.Equal
}
};
clientBankAccountRepository.Update(keyValues1, wheres1);
......@@ -192,20 +203,11 @@ namespace Edu.Module.Customer
}
decimal TotalMoney = rmodel.AppliedMoney;
//var detailList = new
//{
// fcmodel.CostTypeId,
// Number = 1,
// OriginalMoney = rmodel.AppliedMoney,
// UnitPrice = rmodel.AppliedMoney,
// Remark = "同业" + (rmodel.Type == 1 ? "佣金" : "幸福存折") + "提现:" + cmodel.CustomerName + "(" + cmodel.ContactNumber + ")"
//};
var detailList = new List<object>
{
new
{
fcmodel.CostTypeId,
fcmodel.CostTypeId,
Number = 1,
OriginalMoney = rmodel.AppliedMoney,
UnitPrice =rmodel.AppliedMoney,
......@@ -227,14 +229,14 @@ namespace Edu.Module.Customer
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,
CreateBy = employeeModel.Id,
RB_Branch_Id = employeeModel.School_Id,
RB_Depart_Id = employeeModel.Dept_Id,
RB_Group_Id = employeeModel.Group_Id,
RB_CreateByName = employeeModel.EmployeeName,
RB_DepartName = employeeModel.DeptName,
RB_BranchName = employeeModel.SchoolName,
RB_GroupName = employeeModel.GroupName,
FinanceType = 2
};
string sign = EncryptionHelper.AesEncrypt(JsonHelper.Serialize(financeObj), Config.ReadConfigKey("FinanceKey"));
......@@ -255,11 +257,13 @@ namespace Edu.Module.Customer
{ nameof(RB_Customer_Remit_Extend.FinanceId), frid},
{ nameof(RB_Customer_Remit_Extend.AuditRemark), remark +" 自动生成财务单据:"+frid}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
List<WhereHelper> wheres1 = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName = nameof(RB_Customer_Remit_Extend.Id),
FiledValue = rmodel.Id,
OperatorEnum =OperatorEnum.Equal
FiledValue = rmodel.Id,
OperatorEnum =OperatorEnum.Equal
}
};
customer_RemitRepository.Update(keyValues1, wheres1);
......@@ -274,10 +278,11 @@ namespace Edu.Module.Customer
{ nameof(RB_Customer_Remit_Extend.AuditRemark), remark +" 自动生成财务单据失败,请联系管理员"}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
new WhereHelper()
{
FiledName = nameof(RB_Customer_Remit_Extend.Id),
FiledValue = rmodel.Id,
OperatorEnum =OperatorEnum.Equal
FiledValue = rmodel.Id,
OperatorEnum =OperatorEnum.Equal
}
};
customer_RemitRepository.Update(keyValues1, wheres1);
......@@ -290,25 +295,30 @@ namespace Edu.Module.Customer
var urmodel = user_ReturnComissionRepository.GetList(new Model.ViewModel.User.RB_User_ReturnComission_ViewModel() { GroupId = userInfo.Group_Id, UserId = rmodel.CustomerId, UserType = Common.Enum.User.StuCreateTypeEnum.CustomerInput, CommissionType = rmodel.Type }).FirstOrDefault();
if (urmodel != null)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{
{ nameof(Model.ViewModel.User.RB_User_ReturnComission_ViewModel.CanCashOutMoney), urmodel.CanCashOutMoney + rmodel.AppliedMoney},
{ nameof(Model.ViewModel.User.RB_User_ReturnComission_ViewModel.CashOutMoney), urmodel.CashOutMoney - rmodel.AppliedMoney}
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
List<WhereHelper> wheres1 = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName = nameof(Model.ViewModel.User.RB_User_ReturnComission_ViewModel.UserId),
FiledValue = urmodel.UserId,
OperatorEnum =OperatorEnum.Equal
FiledValue = urmodel.UserId,
OperatorEnum =OperatorEnum.Equal
},
new WhereHelper(){
new WhereHelper()
{
FiledName = nameof(Model.ViewModel.User.RB_User_ReturnComission_ViewModel.UserType),
FiledValue = urmodel.UserType,
OperatorEnum =OperatorEnum.Equal
FiledValue = urmodel.UserType,
OperatorEnum =OperatorEnum.Equal
},
new WhereHelper(){
new WhereHelper()
{
FiledName = nameof(Model.ViewModel.User.RB_User_ReturnComission_ViewModel.CommissionType),
FiledValue = urmodel.CommissionType,
OperatorEnum =OperatorEnum.Equal
FiledValue = urmodel.CommissionType,
OperatorEnum =OperatorEnum.Equal
},
};
user_ReturnComissionRepository.Update(keyValues1, wheres1);
......
......@@ -77,16 +77,17 @@ namespace Edu.WebApi.Controllers.Customer
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCustomerRemitState() {
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) {
if (RemitId <= 0)
{
return ApiResult.ParamIsNull("请传递提现ID");
}
string msg = customerRemitModule.SetCustomerRemitState(RemitId, State, Remark, userInfo);
if (msg == "")
{
......
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