Commit ec36c9e2 by 陶然

优化

parent b5df7b68
...@@ -48,11 +48,14 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -48,11 +48,14 @@ namespace Kivii.Finances.Seeyon.Extensions
request.data.data = new RequestForm_InvoiceApply(); request.data.data = new RequestForm_InvoiceApply();
request.data.data.formmain_0710 = new FormMain_InvoiceApplication0710(); request.data.data.formmain_0710 = new FormMain_InvoiceApplication0710();
request.data.data.formmain_0710 = form; request.data.data.formmain_0710 = form;
Console.WriteLine("-------------------------------------------------------------------------");
Console.WriteLine(JsonSerializer.SerializeToString(request));
Console.WriteLine("-------------------------------------------------------------------------");
var rtns = client.Post<ResponseForm<ResponseData>>($"{Configs.RouteRequestForm}?token={token.id}", request); var rtns = client.Post<ResponseForm<ResponseData>>($"{Configs.RouteRequestForm}?token={token.id}", request);
return rtns; return rtns;
} }
public static ResponseForm<ResponseData> RequestBillForm0712(this JsonServiceClient client, FormMain_AdvanceInvoice0712 form, IAuthSession session) public static ResponseForm<ResponseData> RequestBillForm0318(this JsonServiceClient client, FormMain_AdvanceInvoice0318 form, IAuthSession session)
{ {
if (client == null) throw new ArgumentNullException("client"); if (client == null) throw new ArgumentNullException("client");
if (form == null) throw new ArgumentNullException("form"); if (form == null) throw new ArgumentNullException("form");
...@@ -65,8 +68,11 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -65,8 +68,11 @@ namespace Kivii.Finances.Seeyon.Extensions
//request.data.senderLoginName = token.bindingUser.loginName; //request.data.senderLoginName = token.bindingUser.loginName;
request.data.subject = $"预借发票申请({token.bindingUser.name} {DateTime.Now:yyyy-MM-dd HH:mm})"; request.data.subject = $"预借发票申请({token.bindingUser.name} {DateTime.Now:yyyy-MM-dd HH:mm})";
request.data.data = new RequestForm_InvoiceApply(); request.data.data = new RequestForm_InvoiceApply();
request.data.data.formmain_0712 = new FormMain_AdvanceInvoice0712(); request.data.data.formmain_0318 = new FormMain_AdvanceInvoice0318();
request.data.data.formmain_0712 = form; request.data.data.formmain_0318 = form;
Console.WriteLine("-------------------------------------------------------------------------");
Console.WriteLine(JsonSerializer.SerializeToString(request));
Console.WriteLine("-------------------------------------------------------------------------");
var rtns = client.Post<ResponseForm<ResponseData>>($"{Configs.RouteRequestForm}?token={token.id}", request); var rtns = client.Post<ResponseForm<ResponseData>>($"{Configs.RouteRequestForm}?token={token.id}", request);
return rtns; return rtns;
} }
...@@ -86,7 +92,7 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -86,7 +92,7 @@ namespace Kivii.Finances.Seeyon.Extensions
rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd"); rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd");
rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName; rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName;
rtns.申请人 = apply.OperatorName; rtns.申请人 = apply.OperatorName;
rtns.票据类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794"; rtns.发票类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794";
rtns.数量 = "1"; rtns.数量 = "1";
rtns.总金额 = amount.ToString(); rtns.总金额 = amount.ToString();
rtns.金额大写 = amount.ConvertToChinese(); rtns.金额大写 = amount.ConvertToChinese();
...@@ -94,12 +100,12 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -94,12 +100,12 @@ namespace Kivii.Finances.Seeyon.Extensions
rtns.纳税人识别号 = apply.PayerTaxNumber; rtns.纳税人识别号 = apply.PayerTaxNumber;
rtns.地址电话 = $"{apply.PayerCompanyAddress}{apply.PayerPhone}"; rtns.地址电话 = $"{apply.PayerCompanyAddress}{apply.PayerPhone}";
rtns.开户行及账号 = $"{apply.PayerRegisteredBank}{apply.PayerBankAccount}"; rtns.开户行及账号 = $"{apply.PayerRegisteredBank}{apply.PayerBankAccount}";
rtns.收款单位 = apply.PayeeName; rtns.收款单位名称 = apply.PayeeName;
rtns.收款单位纳税人识别号 = apply.PayeeTaxNumber; rtns.收款单位纳税人识别号 = apply.PayeeTaxNumber;
rtns.收款单位地址电话 = $"{apply.PayeeCompanyAddress}{apply.PayeePhone}"; rtns.收款单位地址电话 = $"{apply.PayeeCompanyAddress}{apply.PayeePhone}";
rtns.收款单位开户行及账号 = $"{apply.PayeeRegisteredBank}{apply.PayeeBankAccount}"; rtns.收款单位开户行及账号 = $"{apply.PayeeRegisteredBank}{apply.PayeeBankAccount}";
rtns.申请原因 = apply.Remark; rtns.申请原因 = apply.Remark;
rtns.收款单位 = apply.PayeeName; rtns.收款单位名称 = apply.PayeeName;
return rtns; return rtns;
} }
...@@ -115,7 +121,7 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -115,7 +121,7 @@ namespace Kivii.Finances.Seeyon.Extensions
rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd"); rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd");
rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName; rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName;
rtns.申请人 = apply.OperatorName; rtns.申请人 = apply.OperatorName;
rtns.票据类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794"; rtns.发票类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794";
rtns.数量 = "1"; rtns.数量 = "1";
rtns.总金额 = apply.Amount.ToString(); rtns.总金额 = apply.Amount.ToString();
rtns.金额大写 = apply.Amount.ConvertToChinese(); rtns.金额大写 = apply.Amount.ConvertToChinese();
...@@ -123,22 +129,22 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -123,22 +129,22 @@ namespace Kivii.Finances.Seeyon.Extensions
rtns.纳税人识别号 = apply.PayerTaxNumber; rtns.纳税人识别号 = apply.PayerTaxNumber;
rtns.地址电话 = $"{apply.PayerCompanyAddress}{apply.PayerPhone}"; rtns.地址电话 = $"{apply.PayerCompanyAddress}{apply.PayerPhone}";
rtns.开户行及账号 = $"{apply.PayerRegisteredBank}{apply.PayerBankAccount}"; rtns.开户行及账号 = $"{apply.PayerRegisteredBank}{apply.PayerBankAccount}";
rtns.收款单位 = apply.PayeeName; rtns.收款单位名称 = apply.PayeeName;
rtns.收款单位纳税人识别号 = apply.PayeeTaxNumber; rtns.收款单位纳税人识别号 = apply.PayeeTaxNumber;
rtns.收款单位地址电话 = $"{apply.PayeeCompanyAddress}{apply.PayeePhone}"; rtns.收款单位地址电话 = $"{apply.PayeeCompanyAddress}{apply.PayeePhone}";
rtns.收款单位开户行及账号 = $"{apply.PayeeRegisteredBank}{apply.PayeeBankAccount}"; rtns.收款单位开户行及账号 = $"{apply.PayeeRegisteredBank}{apply.PayeeBankAccount}";
rtns.申请原因 = apply.Remark; rtns.申请原因 = apply.Remark;
rtns.收款单位 = apply.PayeeName; rtns.收款单位名称 = apply.PayeeName;
return rtns; return rtns;
} }
public static FormMain_AdvanceInvoice0712 DebitConvertToForm(this List<InvoiceApply> applys) public static FormMain_AdvanceInvoice0318 DebitConvertToForm(this List<InvoiceApply> applys)
{ {
var apply = applys[0]; var apply = applys[0];
var bizKvids = applys.ConvertAll(o => o.Kvid.ToString()); var bizKvids = applys.ConvertAll(o => o.Kvid.ToString());
//var strBizKvids = JsonSerializer.SerializeToString(bizKvids); //var strBizKvids = JsonSerializer.SerializeToString(bizKvids);
var amount = applys.Sum(o => o.Amount); var amount = applys.Sum(o => o.Amount);
var rtns = new FormMain_AdvanceInvoice0712(); var rtns = new FormMain_AdvanceInvoice0318();
//var settlementType = "code|MonthlySettlement";//默认月结 //var settlementType = "code|MonthlySettlement";//默认月结
rtns.业务类型 = typeof(BillApply).FullName; rtns.业务类型 = typeof(BillApply).FullName;
rtns.业务编号 = bizKvids; rtns.业务编号 = bizKvids;
...@@ -146,7 +152,7 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -146,7 +152,7 @@ namespace Kivii.Finances.Seeyon.Extensions
rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd"); rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd");
rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName; rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName;
rtns.申请人 = apply.OperatorName; rtns.申请人 = apply.OperatorName;
rtns.票据类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794"; rtns.发票类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794";
rtns.数量 = "1"; rtns.数量 = "1";
rtns.总金额 = amount.ToString(); rtns.总金额 = amount.ToString();
rtns.金额大写 = amount.ConvertToChinese(); rtns.金额大写 = amount.ConvertToChinese();
...@@ -163,11 +169,11 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -163,11 +169,11 @@ namespace Kivii.Finances.Seeyon.Extensions
return rtns; return rtns;
} }
public static FormMain_AdvanceInvoice0712 DebitConvertToForm(this InvoiceApply apply) public static FormMain_AdvanceInvoice0318 DebitConvertToForm(this InvoiceApply apply)
{ {
var bizKvids = new List<string>(); var bizKvids = new List<string>();
bizKvids.Add(apply.Kvid.ToString()); bizKvids.Add(apply.Kvid.ToString());
var rtns = new FormMain_AdvanceInvoice0712(); var rtns = new FormMain_AdvanceInvoice0318();
//var settlementType = "code|MonthlySettlement";//默认月结 //var settlementType = "code|MonthlySettlement";//默认月结
rtns.业务类型 = typeof(BillApply).FullName; rtns.业务类型 = typeof(BillApply).FullName;
rtns.业务编号 = bizKvids; rtns.业务编号 = bizKvids;
...@@ -175,7 +181,7 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -175,7 +181,7 @@ namespace Kivii.Finances.Seeyon.Extensions
rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd"); rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd");
rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName; rtns.申请部门 = KiviiContext.CurrentMember.DepartmentName;
rtns.申请人 = apply.OperatorName; rtns.申请人 = apply.OperatorName;
rtns.票据类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794"; rtns.发票类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794";
rtns.数量 = "1"; rtns.数量 = "1";
rtns.总金额 = apply.Amount.ToString(); rtns.总金额 = apply.Amount.ToString();
rtns.金额大写 = apply.Amount.ConvertToChinese(); rtns.金额大写 = apply.Amount.ConvertToChinese();
...@@ -192,7 +198,6 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -192,7 +198,6 @@ namespace Kivii.Finances.Seeyon.Extensions
return rtns; return rtns;
} }
public static string ConvertToChinese(this decimal Num) public static string ConvertToChinese(this decimal Num)
{ {
string[] DX_SZ = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖", "拾" };//大写数字 string[] DX_SZ = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖", "拾" };//大写数字
......
...@@ -175,7 +175,7 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -175,7 +175,7 @@ namespace Kivii.Finances.Seeyon.Entities
else else
{ {
var applyForm = apply.DebitConvertToForm(); var applyForm = apply.DebitConvertToForm();
var resp = client.RequestBillForm0712(applyForm, session); var resp = client.RequestBillForm0318(applyForm, session);
if (resp.code != "0") throw new Exception($"OA接口调用失败,原因:{resp.message}"); if (resp.code != "0") throw new Exception($"OA接口调用失败,原因:{resp.message}");
apply.BizId = resp.data.subject; apply.BizId = resp.data.subject;
apply.AddOnlyProperties(o => o.BizId); apply.AddOnlyProperties(o => o.BizId);
...@@ -246,7 +246,7 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -246,7 +246,7 @@ namespace Kivii.Finances.Seeyon.Entities
else else
{ {
var applyForm = applys.DebitConvertToForm(); var applyForm = applys.DebitConvertToForm();
var resp = client.RequestBillForm0712(applyForm, session); var resp = client.RequestBillForm0318(applyForm, session);
if (resp.code != "0") throw new Exception($"OA接口调用失败,原因:{resp.message}"); if (resp.code != "0") throw new Exception($"OA接口调用失败,原因:{resp.message}");
foreach (var apply in applys) foreach (var apply in applys)
{ {
...@@ -275,7 +275,7 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -275,7 +275,7 @@ namespace Kivii.Finances.Seeyon.Entities
{ {
public FormMain_InvoiceApplication0710 formmain_0710 { get; set; } public FormMain_InvoiceApplication0710 formmain_0710 { get; set; }
public FormMain_AdvanceInvoice0712 formmain_0712 { get; set; } public FormMain_AdvanceInvoice0318 formmain_0318 { get; set; }
} }
#region OA表单 #region OA表单
...@@ -303,19 +303,30 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -303,19 +303,30 @@ namespace Kivii.Finances.Seeyon.Entities
/// </summary> /// </summary>
public string 申请日期 { get; set; } public string 申请日期 { get; set; }
public string 申请人 { get; set; }
public string 单位 { get; set; }
public string 申请部门 { get; set; } public string 申请部门 { get; set; }
public string 申请人 { get; set; } public string 收款单位名称 { get; set; }
public string 收款单位纳税人识别号 { get; set; }
public string 收款单位地址电话 { get; set; }
public string 收款单位开户行及账号 { get; set; }
/// <summary> /// <summary>
/// 票据类型{普通:4529935671729733794 专票:-4189929216282050282} /// 票据类型{普通:4529935671729733794 专票:-4189929216282050282}
/// </summary> /// </summary>
public string 票据类型 { get; set; } public string 发票类型 { get; set; }
public string 数量 { get; set; } public string 数量 { get; set; }
public string 总金额 { get; set; } public string 总金额 { get; set; }
public string 金额大写 { get; set; }
public string 付款单位名称 { get; set; } public string 付款单位名称 { get; set; }
public string 纳税人识别号 { get; set; } public string 纳税人识别号 { get; set; }
...@@ -324,16 +335,6 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -324,16 +335,6 @@ namespace Kivii.Finances.Seeyon.Entities
public string 开户行及账号 { get; set; } public string 开户行及账号 { get; set; }
public string 收款单位 { get; set; }
public string 收款单位纳税人识别号 { get; set; }
public string 收款单位地址电话 { get; set; }
public string 收款单位开户行及账号 { get; set; }
public string 金额大写 { get; set; }
public string 申请原因 { get; set; } public string 申请原因 { get; set; }
} }
...@@ -341,7 +342,7 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -341,7 +342,7 @@ namespace Kivii.Finances.Seeyon.Entities
/// <summary> /// <summary>
/// 发起流程表单接口【预借发票/收据申请】 /// 发起流程表单接口【预借发票/收据申请】
/// </summary> /// </summary>
public class FormMain_AdvanceInvoice0712 public class FormMain_AdvanceInvoice0318
{ {
/// <summary> /// <summary>
/// 唯一编号,BizKvid /// 唯一编号,BizKvid
...@@ -362,20 +363,11 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -362,20 +363,11 @@ namespace Kivii.Finances.Seeyon.Entities
/// </summary> /// </summary>
public string 申请日期 { get; set; } public string 申请日期 { get; set; }
public string 申请部门 { get; set; }
public string 申请人 { get; set; } public string 申请人 { get; set; }
/// <summary> public string 申请部门 { get; set; }
/// 票据类型{普通:4529935671729733794 专票:-4189929216282050282}
/// </summary>
public string 票据类型 { get; set; }
public string 数量 { get; set; }
public string 总金额 { get; set; }
public string 申请原因 { get; set; } public string 单位 { get; set; }
public string 付款单位名称 { get; set; } public string 付款单位名称 { get; set; }
...@@ -385,6 +377,17 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -385,6 +377,17 @@ namespace Kivii.Finances.Seeyon.Entities
public string 开户行及账号 { get; set; } public string 开户行及账号 { get; set; }
/// <summary>
/// 票据类型{普通:4529935671729733794 专票:-4189929216282050282}
/// </summary>
public string 发票类型 { get; set; }
public string 申请原因 { get; set; }
public string 数量 { get; set; }
public string 总金额 { get; set; }
public string 收款单位 { get; set; } public string 收款单位 { get; set; }
public string 收款单位纳税人识别号 { get; set; } public string 收款单位纳税人识别号 { get; set; }
......
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