Commit 7562303f by 陶然

优化

parent cd9f739c
...@@ -17,35 +17,39 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -17,35 +17,39 @@ namespace Kivii.Finances.Seeyon.Extensions
if (client == null) throw new ArgumentNullException("client"); if (client == null) throw new ArgumentNullException("client");
if (loginName.IsNullOrEmpty()) throw new ArgumentNullException("loginName"); if (loginName.IsNullOrEmpty()) throw new ArgumentNullException("loginName");
var request = new RequestRestToken(); try
request.userName = Configs.restUserName; {
request.password = Configs.restPassword; var request = new RequestRestToken();
request.loginName = loginName; request.userName = Configs.restUserName;
var rtns = client.Post<ResponseToken>($"{Configs.RouteRestToken}", request); request.password = Configs.restPassword;
return rtns; request.loginName = loginName;
var rtns = client.Post<ResponseToken>($"{Configs.RouteRestToken}", request);
return rtns;
}
catch (Exception ex)
{
throw new Exception($"{ex.Message},可能原因:当前登录人{loginName},无法与OA账号对应,请联系管理员确认!");
}
} }
public static Form_InvoiceApply ConvertToForm(this InvoiceApply apply) public static Form_InvoiceApply ConvertToForm(this InvoiceApply apply)
{ {
var rtns = new Form_InvoiceApply(); var rtns = new Form_InvoiceApply();
var settlementType = "code|MonthlySettlement";//默认月结 //var settlementType = "code|MonthlySettlement";//默认月结
rtns.业务类型 = typeof(BillApply).FullName; rtns.业务类型 = typeof(BillApply).FullName;
rtns.业务编号 = apply.Kvid.ToString(); rtns.业务编号 = apply.Kvid.ToString();
rtns.申请人 = KiviiContext.CurrentMember.FullName; rtns.单据编号 = apply.SerialNumber;
rtns.申请科室 = KiviiContext.CurrentMember.DepartmentName; rtns.日期 = DateTime.Now.ToString("yyyy-MM-dd");
rtns.申请日期 = DateTime.Now.ToString("yyyy-MM-dd"); rtns.所属部门 = KiviiContext.CurrentMember.DepartmentName;
rtns.企业名称 = apply.PayerName; rtns.经办人 = apply.OperatorName;
rtns.地址 = apply.PayerCompanyAddress; rtns.付款单位名称 = apply.PayerName;
rtns.联系人 = apply.PayerRegisteredBank; rtns.纳税人识别号 = apply.PayerTaxNumber;
rtns.联系电话 = apply.PayerPhone; rtns.地址电话 = $"{apply.PayerCompanyAddress}{apply.PayerPhone}";
rtns.收费 = apply.Amount.ToString(); rtns.开户行及账号 = $"{apply.PayerRegisteredBank}{apply.PayerBankAccount}";
rtns.结算方式 = settlementType; rtns.发票类型 = apply.Type == "增值税专用发票" ? "-4189929216282050282" : "4529935671729733794";
rtns.开始日期 = DateTime.Now.ToString("yyyy-MM-dd"); rtns.申请原因 = apply.Remark;
rtns.结束日期 = DateTime.Now.AddDays(10).ToString("yyyy-MM-dd"); ; rtns.数量 = "1";
rtns.合同负责人 = apply.OperatorName; rtns.金额 = apply.Amount.ToString();
rtns.附加备注 = apply.Remark;
rtns.是否定制价 = "2";
rtns.说明 = apply.Remark;
return rtns; return rtns;
} }
...@@ -53,17 +57,17 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -53,17 +57,17 @@ namespace Kivii.Finances.Seeyon.Extensions
{ {
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");
var token = client.RequestRestToken(session.UserAuthName); var token = client.RequestRestToken(session.FullName);
var request = new RequestForm<RequestForm_InvoiceApply>(); var request = new RequestForm<RequestForm_InvoiceApply>();
request.appName = Configs.appName;//"collaboration"; request.appName = Configs.appName;//"collaboration";
request.data = new RequestData<RequestForm_InvoiceApply>(); request.data = new RequestData<RequestForm_InvoiceApply>();
request.data.templateCode = Configs.templateCode;//"JYHTSQ"; request.data.templateCode = Configs.templateCode;//"JYHTSQ";
request.data.draft = "1"; request.data.draft = "1";
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_0061 = new Form_InvoiceApply(); request.data.data.formmain_0318 = new Form_InvoiceApply();
request.data.data.formmain_0061 = form; request.data.data.formmain_0318 = form;
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;
} }
......
...@@ -8,17 +8,17 @@ namespace Kivii.Finances.Seeyon ...@@ -8,17 +8,17 @@ namespace Kivii.Finances.Seeyon
{ {
internal static class Configs internal static class Configs
{ {
internal static string BaseUrl = "";//"http://zyoa.jst-gov.com"; internal static string BaseUrl = "http://61.132.52.110:82";//"http://zyoa.jst-gov.com";
public const string TableNameApply = "FINA_Applies"; public const string TableNameApply = "FINA_Applies";
internal static string RouteRequestForm = "";//"/seeyon/rest/bpm/process/start"; internal static string RouteRequestForm = "/seeyon/rest/bpm/process/start";
internal static string RouteRestToken = "";//"/seeyon/rest/token"; internal static string RouteRestToken = "/seeyon/rest/token";
internal static string appName = "";//"collaboration";//"collaboration";//OA提供 internal static string appName = "collaboration";//"collaboration";//OA提供
internal static string templateCode = "";//"JYHTSQ";//"JYHTSQ";//OA提供 internal static string templateCode = "AdvanceInvoice";//"JYHTSQ";//OA提供
internal static string restUserName = "";//"rest"; internal static string restUserName = "settlement";//"rest";
internal static string restPassword = "";//"fba09671-2b1e-4c8c-9aaf-de16821070df"; internal static string restPassword = "53aab6e3-05e5-4f6f-9084-38247e6142b6";//"fba09671-2b1e-4c8c-9aaf-de16821070df";
} }
} }
...@@ -113,7 +113,7 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -113,7 +113,7 @@ namespace Kivii.Finances.Seeyon.Entities
public class RequestForm_InvoiceApply public class RequestForm_InvoiceApply
{ {
public Form_InvoiceApply formmain_0061 { get; set; } public Form_InvoiceApply formmain_0318 { get; set; }
} }
public class Form_InvoiceApply public class Form_InvoiceApply
{ {
...@@ -127,38 +127,28 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -127,38 +127,28 @@ namespace Kivii.Finances.Seeyon.Entities
/// </summary> /// </summary>
public string 业务类型 { get; set; } public string 业务类型 { get; set; }
/// <summary> /// <summary>
/// 人员登陆名 /// 单据编号
/// </summary> /// </summary>
public string 申请人 { get; set; } public string 单据编号 { get; set; }
/// <summary> /// <summary>
/// 部门编码 /// 格式:2023-10-11
/// </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; } public string 地址电话 { get; set; }
public string 开户行及账号 { get; set; }
/// <summary> /// <summary>
/// 折扣 /// 发票类型{普通:4529935671729733794 专票:-4189929216282050282}
/// </summary> /// </summary>
public string 收费 { get; set; } public string 发票类型 { get; set; }
/// <summary> public string 申请原因 { get; set; }
/// 形如code|xxx,MonthlySettlement月结,BatchSettlement批结,QuarterlySettlement季结 public string 数量 { get; set; }
/// </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; }
/// <summary>
/// 0是 1否 2其他
/// </summary>
public string 是否定制价 { get; set; }
public string 说明 { get; set; }
} }
} }
...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices; ...@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2023.9250")] [assembly: AssemblyVersion("5.4.2023.10110")]
[assembly: AssemblyFileVersion("5.4.2023.9250")] [assembly: AssemblyFileVersion("5.4.2023.10110")]
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