Commit 5bea2a2f by 陶然

配置优化

parent db2418b8
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using Kivii.Finances.Entities; using Kivii.Finances.Entities;
using Kivii.Finances.Seeyon.Entities; using Kivii.Finances.Seeyon.Entities;
using Kivii.Seeyon.Entities; using Kivii.Seeyon.Entities;
using Kivii.Text;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -97,12 +98,12 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -97,12 +98,12 @@ 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.FullName); var token = client.RequestRestToken(session.UserAuthName);
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 = "0";
//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();
...@@ -110,6 +111,10 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -110,6 +111,10 @@ namespace Kivii.Finances.Seeyon.Extensions
request.data.data.formmain_0171 = form; request.data.data.formmain_0171 = form;
request.data.data.formson_0172 = new List<Form_InvoiceApplyDetail>(); request.data.data.formson_0172 = new List<Form_InvoiceApplyDetail>();
request.data.data.formson_0172 = details; request.data.data.formson_0172 = details;
Console.WriteLine($"----------------------Route:{Configs.RouteRequestForm}?token={token.id}----------------------------------------");
Console.WriteLine($"----------------------Request----------------------------------------");
Console.WriteLine($"{JsonSerializer.SerializeToString(request)}");
Console.WriteLine($"----------------------End----------------------------------------");
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,7 +8,7 @@ namespace Kivii.Finances.Seeyon ...@@ -8,7 +8,7 @@ namespace Kivii.Finances.Seeyon
{ {
internal static class Configs internal static class Configs
{ {
internal static string BaseUrl = "http://61.132.52.110:82";//"http://zyoa.jst-gov.com"; internal static string BaseUrl = "http://zyoa.jst-gov.com";
public const string TableNameApply = "FINA_Applies"; public const string TableNameApply = "FINA_Applies";
...@@ -16,9 +16,9 @@ namespace Kivii.Finances.Seeyon ...@@ -16,9 +16,9 @@ namespace Kivii.Finances.Seeyon
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 = "AdvanceInvoice";//"JYHTSQ";//OA提供 internal static string templateCode = "JPSQ";//"JYHTSQ";//OA提供
internal static string restUserName = "settlement";//"rest"; internal static string restUserName = "rest";
internal static string restPassword = "53aab6e3-05e5-4f6f-9084-38247e6142b6";//"fba09671-2b1e-4c8c-9aaf-de16821070df"; internal static string restPassword = "fba09671-2b1e-4c8c-9aaf-de16821070df";
} }
} }
...@@ -179,8 +179,8 @@ namespace Kivii.Finances.Seeyon.Entities ...@@ -179,8 +179,8 @@ namespace Kivii.Finances.Seeyon.Entities
applys.ThrowIfNullOrEmpty("未找到借票信息!"); applys.ThrowIfNullOrEmpty("未找到借票信息!");
if (applys.Exists(o => o.Status > (int)InvoiceApplyStatus.ProcessAdoption)) throw new Exception("当前账单借票非待审批状态,无法申请审批!"); if (applys.Exists(o => o.Status > (int)InvoiceApplyStatus.ProcessAdoption)) throw new Exception("当前账单借票非待审批状态,无法申请审批!");
var groupPayer = applys.GroupBy(a => a.PayerName); //var groupPayer = applys.GroupBy(a => a.PayerName);
if (groupPayer.Count() != 1) throw new Exception("不允许多个借票抬头同时申请!"); //if (groupPayer.Count() != 1) throw new Exception("不允许多个借票抬头同时申请!");
//var applySum = new InvoiceApply(); //var applySum = new InvoiceApply();
//applySum.PopulateWith(applys[0]); //applySum.PopulateWith(applys[0]);
//applySum.Amount = applys.Sum(a => a.Amount); //applySum.Amount = applys.Sum(a => a.Amount);
......
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