Commit 41292e7f by 陶然

增加部门收入提交功能测试

parent d6d659f1
...@@ -5,6 +5,7 @@ using Kivii.Seeyon.Entities; ...@@ -5,6 +5,7 @@ using Kivii.Seeyon.Entities;
using Kivii.Text; using Kivii.Text;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -132,6 +133,7 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -132,6 +133,7 @@ namespace Kivii.Finances.Seeyon.Extensions
} }
} }
#region 账单申请发票 #region 账单申请发票
public static ResponseForm<ResponseData> RequestBillForm0710(this JsonServiceClient client, FormMain_OrdinaryInvoice0710 form, ResponseToken token) public static ResponseForm<ResponseData> RequestBillForm0710(this JsonServiceClient client, FormMain_OrdinaryInvoice0710 form, ResponseToken token)
...@@ -411,5 +413,72 @@ namespace Kivii.Finances.Seeyon.Extensions ...@@ -411,5 +413,72 @@ namespace Kivii.Finances.Seeyon.Extensions
} }
#endregion #endregion
#region 推送部门收入相关
public static string RequestGetFormXml(this JsonServiceClient client, ResponseToken token)
{
if (client == null) throw new ArgumentNullException("client");
try
{
var rtns = client.Get<string>($"{Configs.RouteFormExport}{Configs.templateCodeIncome}?token={token.id}&beginDateTime={DateTime.Now:yyyy-MM-dd}&endDateTime={DateTime.Now:yyyy-MM-dd}");
return rtns;
}
catch (Exception ex)
{
throw ex;
}
}
public static string RequestUploadFormXml(this JsonServiceClient client,string loginName, ResponseToken token)
{
if (client == null) throw new ArgumentNullException("client");
try
{
var list = new List<string>();
list.Add("xxx1");
list.Add("xxx2");
list.Add("xxx3");
list.Add("xxx4");
list.Add("xxx5");
list.Add("xxx6");
var data = GetSendXml(list);
var body = new Dictionary<string, string>();
body.Add("loginName", loginName);
body.Add("dataXml", data);
var rtns = client.Post<string>($"{Configs.RouteFormImport}{Configs.templateCodeIncome}?token={token.id}",body);
return rtns;
}
catch (Exception ex)
{
throw ex;
}
}
private static string GetSendXml(List<string> list)
{
StringBuilder sb = new StringBuilder();
sb.Append("<forms version=\"2.1\"><formExport><summary id=\"-8487669074587464173\" name=\"formmain_0928\"/><definitions><column id=\"field0005\" type=\"4\" name=\"年份\" isNullable=\"false\" length=\"20\"/><column id=\"field0006\" type=\"0\" name=\"部门\" isNullable=\"false\" length=\"20\"/><column id=\"field0007\" type=\"4\" name=\"核算业务总收入\" isNullable=\"false\" length=\"20\"/><column id=\"field0008\" type=\"4\" name=\"年度业务目标\" isNullable=\"false\" length=\"20\"/><column id=\"field0009\" type=\"4\" name=\"完成率\" isNullable=\"false\" length=\"20\"/><column id=\"field0050\" type=\"3\" name=\"日期\" isNullable=\"false\" length=\"255\"/></definitions><values>");
sb.Append($"<column name=\"年份\"><value>{2024}</value></column><column name=\"部门\"><value>{1}</value></column><column name=\"核算业务总收入\"><value>{100}</value></column><column name=\"年度业务目标\"><value>{1}</value></column><column name=\"完成率\"><value>{1}</value></column><column name=\"日期\"><value>{1}</value></column>");
sb.Append("</values><subForms><subForm><definitions><column id=\"field0051\" type=\"4\" name=\"序号\" isNullable=\"false\" length=\"20\"/><column id=\"field0056\" type=\"4\" name=\"收入类型\" isNullable=\"false\" length=\"20\"/><column id=\"field0052\" type=\"4\" name=\"认领\" isNullable=\"false\" length=\"20\"/><column id=\"field0053\" type=\"4\" name=\"划入\" isNullable=\"false\" length=\"20\"/><column id=\"field0054\" type=\"4\" name=\"划出\" isNullable=\"false\" length=\"20\"/><column id=\"field0055\" type=\"4\" name=\"小计\" isNullable=\"false\" length=\"20\"/><column id=\"field0051\" type=\"4\" name=\"序号\" isNullable=\"false\" length=\"20\"/><column id=\"field0056\" type=\"4\" name=\"收入类型\" isNullable=\"false\" length=\"20\"/><column id=\"field0052\" type=\"4\" name=\"认领\" isNullable=\"false\" length=\"20\"/><column id=\"field0053\" type=\"4\" name=\"划入\" isNullable=\"false\" length=\"20\"/><column id=\"field0054\" type=\"4\" name=\"划出\" isNullable=\"false\" length=\"20\"/><column id=\"field0055\" type=\"4\" name=\"小计\" isNullable=\"false\" length=\"20\"/><column id=\"field0051\" type=\"4\" name=\"序号\" isNullable=\"false\" length=\"20\"/><column id=\"field0056\" type=\"4\" name=\"收入类型\" isNullable=\"false\" length=\"20\"/><column id=\"field0052\" type=\"4\" name=\"认领\" isNullable=\"false\" length=\"20\"/><column id=\"field0053\" type=\"4\" name=\"划入\" isNullable=\"false\" length=\"20\"/><column id=\"field0054\" type=\"4\" name=\"划出\" isNullable=\"false\" length=\"20\"/><column id=\"field0055\" type=\"4\" name=\"小计\" isNullable=\"false\" length=\"20\"/><column id=\"field0051\" type=\"4\" name=\"序号\" isNullable=\"false\" length=\"20\"/><column id=\"field0056\" type=\"4\" name=\"收入类型\" isNullable=\"false\" length=\"20\"/><column id=\"field0052\" type=\"4\" name=\"认领\" isNullable=\"false\" length=\"20\"/><column id=\"field0053\" type=\"4\" name=\"划入\" isNullable=\"false\" length=\"20\"/><column id=\"field0054\" type=\"4\" name=\"划出\" isNullable=\"false\" length=\"20\"/><column id=\"field0055\" type=\"4\" name=\"小计\" isNullable=\"false\" length=\"20\"/><column id=\"field0051\" type=\"4\" name=\"序号\" isNullable=\"false\" length=\"20\"/><column id=\"field0056\" type=\"4\" name=\"收入类型\" isNullable=\"false\" length=\"20\"/><column id=\"field0052\" type=\"4\" name=\"认领\" isNullable=\"false\" length=\"20\"/><column id=\"field0053\" type=\"4\" name=\"划入\" isNullable=\"false\" length=\"20\"/><column id=\"field0054\" type=\"4\" name=\"划出\" isNullable=\"false\" length=\"20\"/><column id=\"field0055\" type=\"4\" name=\"小计\" isNullable=\"false\" length=\"20\"/><column id=\"field0051\" type=\"4\" name=\"序号\" isNullable=\"false\" length=\"20\"/><column id=\"field0056\" type=\"4\" name=\"收入类型\" isNullable=\"false\" length=\"20\"/><column id=\"field0052\" type=\"4\" name=\"认领\" isNullable=\"false\" length=\"20\"/><column id=\"field0053\" type=\"4\" name=\"划入\" isNullable=\"false\" length=\"20\"/><column id=\"field0054\" type=\"4\" name=\"划出\" isNullable=\"false\" length=\"20\"/><column id=\"field0055\" type=\"4\" name=\"小计\" isNullable=\"false\" length=\"20\"/></definitions><values>");
foreach (var item in list)
{
sb.Append($"<row><column name=\"序号\"><value>{list.IndexOf(item)}</value></column><column name=\"收入类型\"><value>{1}</value></column><column name=\"认领\"><value>{1}</value></column><column name=\"划入\"><value>{1}</value></column><column name=\"划出\"><value>{1}</value></column><column name=\"小计\"><value>{1}</value></column></row>");
}
sb.Append("</values></subForm></subForms></formExport></forms>");
return sb.ToString();
}
#endregion
} }
} }
...@@ -28,11 +28,15 @@ namespace Kivii.Finances.Seeyon ...@@ -28,11 +28,15 @@ namespace Kivii.Finances.Seeyon
/// </summary> /// </summary>
internal static string RouteOrgMember = "/seeyon/rest/orgMember"; internal static string RouteOrgMember = "/seeyon/rest/orgMember";
internal static string RouteFormImport = "/seeyon/rest/form/import/";
internal static string RouteFormExport = "/seeyon/rest/form/export/";
internal static string appName = "collaboration";//"collaboration";//OA提供 internal static string appName = "collaboration";//"collaboration";//OA提供
internal static string templateCodeAdvanceInvoice = "AdvanceInvoice";//OA提供 internal static string templateCodeAdvanceInvoice = "AdvanceInvoice";//OA提供
internal static string templateCodeOrdinaryInvoice = "OrdinaryInvoice";//OA提供 internal static string templateCodeOrdinaryInvoice = "OrdinaryInvoice";//OA提供
internal static string templateCodeInvoiceVoid = "InvoiceVoid";//OA提供 internal static string templateCodeInvoiceVoid = "InvoiceVoid";//OA提供
internal static string templateCodeInvoiceRedOffset = "InvoiceRedOffset";//OA提供 internal static string templateCodeInvoiceRedOffset = "InvoiceRedOffset";//OA提供
internal static string templateCodeIncome = "DEPARTMENTALREVENUE";//OA提供
internal static string restUserName = "settlement";//"rest"; internal static string restUserName = "settlement";//"rest";
internal static string restPassword = "53aab6e3-05e5-4f6f-9084-38247e6142b6";//"fba09671-2b1e-4c8c-9aaf-de16821070df"; internal static string restPassword = "53aab6e3-05e5-4f6f-9084-38247e6142b6";//"fba09671-2b1e-4c8c-9aaf-de16821070df";
......
<forms version="2.1">
<formExport>
<summary id="-8487669074587464173" name="formmain_0928"/>
<definitions>
<column id="field0005" type="4" name="年份" isNullable="false" length="20"/>
<column id="field0006" type="0" name="部门" isNullable="false" length="20"/>
<column id="field0007" type="4" name="核算业务总收入" isNullable="false" length="20"/>
<column id="field0008" type="4" name="年度业务目标" isNullable="false" length="20"/>
<column id="field0009" type="4" name="完成率" isNullable="false" length="20"/>
<column id="field0050" type="3" name="日期" isNullable="false" length="255"/>
</definitions>
<values>
</values>
<subForms>
<subForm>
<definitions>
<column id="field0051" type="4" name="序号" isNullable="false" length="20"/>
<column id="field0056" type="4" name="收入类型" isNullable="false" length="20"/>
<column id="field0052" type="4" name="认领" isNullable="false" length="20"/>
<column id="field0053" type="4" name="划入" isNullable="false" length="20"/>
<column id="field0054" type="4" name="划出" isNullable="false" length="20"/>
<column id="field0055" type="4" name="小计" isNullable="false" length="20"/>
<column id="field0051" type="4" name="序号" isNullable="false" length="20"/>
<column id="field0056" type="4" name="收入类型" isNullable="false" length="20"/>
<column id="field0052" type="4" name="认领" isNullable="false" length="20"/>
<column id="field0053" type="4" name="划入" isNullable="false" length="20"/>
<column id="field0054" type="4" name="划出" isNullable="false" length="20"/>
<column id="field0055" type="4" name="小计" isNullable="false" length="20"/>
<column id="field0051" type="4" name="序号" isNullable="false" length="20"/>
<column id="field0056" type="4" name="收入类型" isNullable="false" length="20"/>
<column id="field0052" type="4" name="认领" isNullable="false" length="20"/>
<column id="field0053" type="4" name="划入" isNullable="false" length="20"/>
<column id="field0054" type="4" name="划出" isNullable="false" length="20"/>
<column id="field0055" type="4" name="小计" isNullable="false" length="20"/>
<column id="field0051" type="4" name="序号" isNullable="false" length="20"/>
<column id="field0056" type="4" name="收入类型" isNullable="false" length="20"/>
<column id="field0052" type="4" name="认领" isNullable="false" length="20"/>
<column id="field0053" type="4" name="划入" isNullable="false" length="20"/>
<column id="field0054" type="4" name="划出" isNullable="false" length="20"/>
<column id="field0055" type="4" name="小计" isNullable="false" length="20"/>
<column id="field0051" type="4" name="序号" isNullable="false" length="20"/>
<column id="field0056" type="4" name="收入类型" isNullable="false" length="20"/>
<column id="field0052" type="4" name="认领" isNullable="false" length="20"/>
<column id="field0053" type="4" name="划入" isNullable="false" length="20"/>
<column id="field0054" type="4" name="划出" isNullable="false" length="20"/>
<column id="field0055" type="4" name="小计" isNullable="false" length="20"/>
<column id="field0051" type="4" name="序号" isNullable="false" length="20"/>
<column id="field0056" type="4" name="收入类型" isNullable="false" length="20"/>
<column id="field0052" type="4" name="认领" isNullable="false" length="20"/>
<column id="field0053" type="4" name="划入" isNullable="false" length="20"/>
<column id="field0054" type="4" name="划出" isNullable="false" length="20"/>
<column id="field0055" type="4" name="小计" isNullable="false" length="20"/>
</definitions>
<values>
</values>
</subForm>
</subForms>
</formExport>
</forms>
\ No newline at end of file
<column name="年份">
<value>
</value>
</column>
<column name="部门">
<value>
</value>
</column>
<column name="核算业务总收入">
<value>
</value>
</column>
<column name="年度业务目标">
<value>
</value>
</column>
<column name="完成率">
<value>
</value>
</column>
<column name="日期">
<value>
</value>
</column>
\ No newline at end of file
<row>
<column name="序号">
<value>
</value>
</column>
<column name="收入类型">
<value>
</value>
</column>
<column name="认领">
<value>
</value>
</column>
<column name="划入">
<value>
</value>
</column>
<column name="划出">
<value>
</value>
</column>
<column name="小计">
<value>
</value>
</column>
</row>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Finances.Seeyon.Entities
{
public class OaDepartIncome
{
}
}
...@@ -53,10 +53,16 @@ ...@@ -53,10 +53,16 @@
<Compile Include="ApplyExtension.cs" /> <Compile Include="ApplyExtension.cs" />
<Compile Include="Configs.cs" /> <Compile Include="Configs.cs" />
<Compile Include="Entities\Apply.cs" /> <Compile Include="Entities\Apply.cs" />
<Compile Include="Entities\OaDepartIncome.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RestfulApply.cs" /> <Compile Include="RestfulApply.cs" />
<Compile Include="RestfulIncome.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\NJZJ\Njzj.Biz.Connects\Src\Njzj.Biz.Connects.V4.5.csproj">
<Project>{6125eeb2-6604-40f0-9067-2e2e859c9c78}</Project>
<Name>Njzj.Biz.Connects.V4.5</Name>
</ProjectReference>
<ProjectReference Include="..\..\Kivii.Biz.Finances.V2.0\Src\Kivii.Biz.Finances.V2.0.csproj"> <ProjectReference Include="..\..\Kivii.Biz.Finances.V2.0\Src\Kivii.Biz.Finances.V2.0.csproj">
<Project>{8d9479e9-5c4f-4d96-8bc1-c771be0d91b1}</Project> <Project>{8d9479e9-5c4f-4d96-8bc1-c771be0d91b1}</Project>
<Name>Kivii.Biz.Finances.V2.0</Name> <Name>Kivii.Biz.Finances.V2.0</Name>
...@@ -67,6 +73,9 @@ ...@@ -67,6 +73,9 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Content\IncomeXml.txt" />
<EmbeddedResource Include="Content\formValue.txt" />
<EmbeddedResource Include="Content\rowValue.txt" />
<Content Include="Resources\南京市产品质量监督检验院OA接口文档.html" /> <Content Include="Resources\南京市产品质量监督检验院OA接口文档.html" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
...@@ -142,7 +142,8 @@ ...@@ -142,7 +142,8 @@
<li><span>接口状态: </span><span style="color: {{data.formatMark.color}};">{{data.formatMark.name}}</span> </li> <li><span>接口状态: </span><span style="color: {{data.formatMark.color}};">{{data.formatMark.name}}</span> </li>
{{/if}} {{/if}}
</ul> </ul>
{{if _.has(data, 'protos') && _.isObject(data.protos) && Object.values(data.protos).length > 0}} {{if _.has(data, 'protos') && _.isObject(data.protos) && Object.
(data.protos).length > 0}}
<h3 class="apipost-doc-wrap-para-title" data-text="方法列表" id="方法列表"> <h3 class="apipost-doc-wrap-para-title" data-text="方法列表" id="方法列表">
<i class="fa fa-wpforms"></i> <i class="fa fa-wpforms"></i>
<span>方法列表</span> <span>方法列表</span>
......
using Kivii.Finances.Entities; using Kivii.Finances.Entities;
using Kivii.Finances.Seeyon.Entities; using Kivii.Finances.Seeyon.Entities;
using Kivii.Finances.Seeyon.Extensions;
using Kivii.Linq; using Kivii.Linq;
using Kivii.Web; using Kivii.Web;
using System; using System;
...@@ -480,4 +481,19 @@ namespace Kivii.Finances.Seeyon ...@@ -480,4 +481,19 @@ namespace Kivii.Finances.Seeyon
return rtns; return rtns;
} }
} }
public class OaDepartIncomeGetFormXml : RestfulExecution<OaDepartIncome>
{
public override object OnExecution(IRequest req, IResponse res)
{
var client = new JsonServiceClient(Configs.BaseUrl);
var token = client.RequestRestToken("胡瑞");
var reps = client.RequestUploadFormXml("胡瑞",token);
var rtns = new RestfulExecutionResponse<string>();
rtns.Results = new List<string>();
rtns.Results.Add(reps);
return rtns;
}
}
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Finances.Seeyon
{
internal class RestfulIncome
{
}
}
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