|
|
|
@ -1,9 +1,7 @@
|
|
|
|
|
using AlibabaCloud.SDK.Dingtalkworkflow_1_0.Models;
|
|
|
|
|
using AngleSharp.Dom;
|
|
|
|
|
using AngleSharp.Dom;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Enums;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.Module.Core.Helpers;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
@ -13,28 +11,17 @@ using DS.WMS.Core.Fee.Interface;
|
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
|
using DS.WMS.Core.Flow.Interface;
|
|
|
|
|
using DS.WMS.Core.Info.Entity;
|
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
|
using DS.WMS.Core.QuarztJobs.Other;
|
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
|
using DS.WMS.Core.Sys.Interface;
|
|
|
|
|
using DS.WMS.Core.Sys.Method;
|
|
|
|
|
using DS.WMS.Core.TaskInteraction.Dtos;
|
|
|
|
|
using DS.WMS.Core.TaskInteraction.Interface;
|
|
|
|
|
using DS.WMS.Core.TaskPlat.Dtos;
|
|
|
|
|
using DS.WMS.Core.TaskPlat.Entity;
|
|
|
|
|
using LanguageExt.Common;
|
|
|
|
|
using LanguageExt.Pipes;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Masuit.Tools.Database;
|
|
|
|
|
using Masuit.Tools.Hardware;
|
|
|
|
|
using Masuit.Tools.Systems;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NPOI.POIFS.Crypt.Dsig;
|
|
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using static AnyDiff.DifferenceLines;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
{
|
|
|
|
@ -107,19 +94,55 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
return DataResult.Failed($"报销单状态不为未提交,不可修改");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var bank = tenantDb.Queryable<InfoClientBank>().Where(t => t.Id == req.InfoClientBankId).First();
|
|
|
|
|
|
|
|
|
|
if (bank == null) return DataResult.Failed($"报销银行账户信息未找到");
|
|
|
|
|
|
|
|
|
|
var data = req.Adapt<FeeReimbursement>();
|
|
|
|
|
|
|
|
|
|
data.PayeeName = user.UserName;
|
|
|
|
|
data.CodeName = bank.CodeName;
|
|
|
|
|
data.Currency = bank.Currency;
|
|
|
|
|
data.BankName = bank.BankName;
|
|
|
|
|
data.Account = bank.Account;
|
|
|
|
|
data.BankAccountNo = bank.BankAccountNo;
|
|
|
|
|
//如果银行卡Id不为空,则取银行卡信息给收款人
|
|
|
|
|
if (req.InfoClientBankId != null&& req.InfoClientBankId > 0)
|
|
|
|
|
{
|
|
|
|
|
var bank = tenantDb.Queryable<InfoClientBank>().Where(t => t.Id == req.InfoClientBankId).First();
|
|
|
|
|
|
|
|
|
|
if (bank == null) return DataResult.Failed($"报销银行账户信息未找到");
|
|
|
|
|
|
|
|
|
|
data.CodeName = bank.CodeName;
|
|
|
|
|
data.Currency = bank.Currency;
|
|
|
|
|
data.BankName = bank.BankName;
|
|
|
|
|
data.Account = bank.Account;
|
|
|
|
|
data.BankAccountNo = bank.BankAccountNo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//如果银行卡id信息为空,则使用传过来的收款人信息,用于钉钉
|
|
|
|
|
if (string.IsNullOrEmpty(req.PayeeName))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,收款人名称不可为空");
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(req.BankName))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,银行名称不可为空");
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(req.Account))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,开户行不可为空");
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(req.BankAccountNo))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,卡号不可为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data.CodeName = req.CodeName;
|
|
|
|
|
data.Currency = "RMB";
|
|
|
|
|
data.BankName = req.BankName;
|
|
|
|
|
data.Account = req.Account;
|
|
|
|
|
data.BankAccountNo = req.BankAccountNo;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.PayeeName = user.UserName;
|
|
|
|
|
|
|
|
|
|
data.UserId = user.UserId;
|
|
|
|
|
data.ReimbursementType = ReimbursementTypeEnums.NotSubmitted;
|
|
|
|
|
data.Reimburser = user.UserName;
|
|
|
|
@ -207,13 +230,53 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
|
|
|
|
|
var data = req.Adapt<FeeReimbursement>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果银行卡Id不为空,则取银行卡信息给收款人
|
|
|
|
|
if (req.InfoClientBankId != null && req.InfoClientBankId > 0)
|
|
|
|
|
{
|
|
|
|
|
bank = tenantDb.Queryable<InfoClientBank>().Where(t => t.Id == req.InfoClientBankId).First();
|
|
|
|
|
if (bank == null) return DataResult.Failed($"报销银行账户信息未找到");
|
|
|
|
|
|
|
|
|
|
data.CodeName = bank.CodeName;
|
|
|
|
|
data.Currency = bank.Currency;
|
|
|
|
|
data.BankName = bank.BankName;
|
|
|
|
|
data.Account = bank.Account;
|
|
|
|
|
data.BankAccountNo = bank.BankAccountNo;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//如果银行卡id信息为空,则使用传过来的收款人信息,用于钉钉
|
|
|
|
|
if (string.IsNullOrEmpty(req.PayeeName))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,收款人名称不可为空");
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(req.BankName))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,银行名称不可为空");
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(req.Account))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,开户行不可为空");
|
|
|
|
|
}
|
|
|
|
|
else if (string.IsNullOrEmpty(req.BankAccountNo))
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed($"InfoClientBankId为空时,卡号不可为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data.CodeName = req.CodeName;
|
|
|
|
|
data.Currency = "RMB";
|
|
|
|
|
data.BankName = req.BankName;
|
|
|
|
|
data.Account = req.Account;
|
|
|
|
|
data.BankAccountNo = req.BankAccountNo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data.InfoClientBankId = req.InfoClientBankId;
|
|
|
|
|
data.PayeeName = user.UserName;
|
|
|
|
|
data.CodeName = bank.CodeName;
|
|
|
|
|
data.Currency = bank.Currency;
|
|
|
|
|
data.BankName = bank.BankName;
|
|
|
|
|
data.Account = bank.Account;
|
|
|
|
|
data.BankAccountNo = bank.BankAccountNo;
|
|
|
|
|
//data.CodeName = bank.CodeName;
|
|
|
|
|
//data.Currency = bank.Currency;
|
|
|
|
|
//data.BankName = bank.BankName;
|
|
|
|
|
//data.Account = bank.Account;
|
|
|
|
|
//data.BankAccountNo = bank.BankAccountNo;
|
|
|
|
|
data.ExpenseCategory = req.ExpenseCategory;
|
|
|
|
|
data.UserId = user.UserId;
|
|
|
|
|
data.ReimbursementType = ReimbursementTypeEnums.NotSubmitted;
|
|
|
|
@ -235,11 +298,8 @@ namespace DS.WMS.Core.Fee.Method
|
|
|
|
|
inviceinfo.ReimbursementType = ReimbursementTypeEnums.UnderReview;
|
|
|
|
|
tenantDb.Updateable(inviceinfo).ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("添加成功!", info.Id, MultiLanguageConst.DataCreateSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return await Task.FromResult(DataResult.Successed("操作成功"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|