Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Third.Finances.Seeyon.V4.5
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶然
Kivii.Third.Finances.Seeyon.V4.5
Commits
36bfa20b
Commit
36bfa20b
authored
Apr 02, 2024
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级支持oa部门收入数据上传功能
parent
41292e7f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
41 deletions
+68
-41
ApplyExtension.cs
Src/ApplyExtension.cs
+28
-17
OaIncome.cs
Src/Entities/OaIncome.cs
+17
-0
Kivii.Third.Finances.Seeyon.V4.5.csproj
Src/Kivii.Third.Finances.Seeyon.V4.5.csproj
+1
-5
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulApply.cs
Src/RestfulApply.cs
+0
-15
RestfulIncome.cs
Src/RestfulIncome.cs
+20
-2
No files found.
Src/ApplyExtension.cs
View file @
36bfa20b
...
...
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using
System.Diagnostics.Contracts
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
Kivii.Finances.Seeyon.Extensions
...
...
@@ -108,6 +109,9 @@ namespace Kivii.Finances.Seeyon.Extensions
request
.
userName
=
Configs
.
restUserName
;
request
.
password
=
Configs
.
restPassword
;
request
.
loginName
=
loginName
;
Console
.
WriteLine
(
"---------------------------------------------------------"
);
Console
.
WriteLine
(
loginName
);
Console
.
WriteLine
(
"---------------------------------------------------------"
);
var
rtns
=
client
.
Post
<
ResponseToken
>(
$"
{
Configs
.
RouteRestToken
}
"
,
request
);
return
rtns
;
}
...
...
@@ -432,25 +436,32 @@ namespace Kivii.Finances.Seeyon.Extensions
}
}
public
static
string
RequestUploadFormXml
(
this
JsonServiceClient
client
,
string
loginName
,
ResponseToken
token
)
public
static
string
RequestUploadFormXml
(
this
JsonServiceClient
client
,
List
<
OaDepartIncome
>
list
,
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
);
var
rtns
=
string
.
Empty
;
foreach
(
var
item
in
list
)
{
var
data
=
GetSendXml
(
item
);
var
body
=
new
Dictionary
<
string
,
string
>();
body
.
Add
(
"templateCode"
,
Configs
.
templateCodeIncome
);
body
.
Add
(
"loginName"
,
loginName
);
body
.
Add
(
"dataXml"
,
data
);
Console
.
WriteLine
(
"---------------------------------------------------------"
);
Console
.
WriteLine
(
$"
{
Configs
.
RouteFormImport
}{
Configs
.
templateCodeIncome
}
?token=
{
token
.
id
}
"
);
Console
.
WriteLine
(
"---------------------------------------------------------"
);
Console
.
WriteLine
(
JsonSerializer
.
SerializeToString
(
body
));
Console
.
WriteLine
(
"---------------------------------------------------------"
);
var
resp
=
client
.
Post
<
string
>(
$"
{
Configs
.
RouteFormImport
}{
Configs
.
templateCodeIncome
}
?token=
{
token
.
id
}
"
,
body
);
rtns
=
resp
;
Thread
.
Sleep
(
200
);
}
return
rtns
;
}
catch
(
Exception
ex
)
...
...
@@ -461,19 +472,19 @@ namespace Kivii.Finances.Seeyon.Extensions
}
private
static
string
GetSendXml
(
List
<
string
>
list
)
private
static
string
GetSendXml
(
OaDepartIncome
item
)
{
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
(
$"<column name=\"年份\"><value>
<![CDATA[
{
item
.
Year
}
]]></value></column><column name=\"部门\"><value><![CDATA[
{
item
.
DepartId
}
]]></value></column><column name=\"核算业务总收入\"><value><![CDATA[
{
item
.
AmountTotal
}
]]></value></column><column name=\"年度业务目标\"><value><![CDATA[
{
item
.
AmountTarget
}
]]></value></column><column name=\"完成率\"><value><![CDATA[
{
item
.
Rate
}
]]></value></column><column name=\"日期\"><value><![CDATA[
{
item
.
OperateTime
:
yyyy
-
MM
-
dd
}
]]>
</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
)
foreach
(
var
detail
in
item
.
Details
)
{
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
(
$"<row><column name=\"序号\"><value>
<![CDATA[
{
item
.
Details
.
IndexOf
(
detail
)}
]]></value></column><column name=\"收入类型\"><value><![CDATA[
{
detail
.
Type
}
]]></value></column><column name=\"认领\"><value><![CDATA[
{
detail
.
AmountClaim
}
]]></value></column><column name=\"划入\"><value><![CDATA[
{
detail
.
AmountIn
}
]]></value></column><column name=\"划出\"><value><![CDATA[
{
detail
.
AmountOut
}
]]></value></column><column name=\"小计\"><value><![CDATA[
{
detail
.
AmountTotal
}
]]>
</value></column></row>"
);
}
sb
.
Append
(
"</values></subForm></subForms></formExport></forms>"
);
...
...
Src/Entities/Oa
Depart
Income.cs
→
Src/Entities/OaIncome.cs
View file @
36bfa20b
...
...
@@ -8,5 +8,22 @@ namespace Kivii.Finances.Seeyon.Entities
{
public
class
OaDepartIncome
{
public
string
Year
{
get
;
set
;
}
public
string
Depart
{
get
;
set
;
}
public
string
DepartId
{
get
;
set
;
}
public
decimal
AmountTotal
{
get
;
set
;
}
public
decimal
AmountTarget
{
get
;
set
;
}
public
string
Rate
{
get
;
set
;
}
public
DateTime
OperateTime
{
get
;
set
;
}
public
List
<
OaDepartIncomeDetail
>
Details
{
get
;
set
;
}
}
public
class
OaDepartIncomeDetail
{
public
string
Type
{
get
;
set
;
}
public
decimal
AmountClaim
{
get
;
set
;
}
public
decimal
AmountIn
{
get
;
set
;
}
public
decimal
AmountOut
{
get
;
set
;
}
public
decimal
AmountTotal
{
get
;
set
;
}
}
}
Src/Kivii.Third.Finances.Seeyon.V4.5.csproj
View file @
36bfa20b
...
...
@@ -53,16 +53,12 @@
<Compile
Include=
"ApplyExtension.cs"
/>
<Compile
Include=
"Configs.cs"
/>
<Compile
Include=
"Entities\Apply.cs"
/>
<Compile
Include=
"Entities\Oa
Depart
Income.cs"
/>
<Compile
Include=
"Entities\OaIncome.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"RestfulApply.cs"
/>
<Compile
Include=
"RestfulIncome.cs"
/>
</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"
>
<Project>
{8d9479e9-5c4f-4d96-8bc1-c771be0d91b1}
</Project>
<Name>
Kivii.Biz.Finances.V2.0
</Name>
...
...
Src/Properties/AssemblyInfo.cs
View file @
36bfa20b
...
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.
115
0")]
[assembly: AssemblyFileVersion("5.4.2024.
115
0")]
[assembly: AssemblyVersion("5.4.2024.
402
0")]
[assembly: AssemblyFileVersion("5.4.2024.
402
0")]
Src/RestfulApply.cs
View file @
36bfa20b
...
...
@@ -481,19 +481,4 @@ namespace Kivii.Finances.Seeyon
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
;
}
}
}
Src/RestfulIncome.cs
View file @
36bfa20b
using
System
;
using
Kivii.Finances.Seeyon.Entities
;
using
Kivii.Finances.Seeyon.Extensions
;
using
Kivii.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -6,7 +9,22 @@ using System.Threading.Tasks;
namespace
Kivii.Finances.Seeyon
{
internal
class
RestfulIncome
public
class
OaDepartIncomeUpload
:
RestfulExecution
<
OaDepartIncome
>
{
public
List
<
OaDepartIncome
>
Items
{
get
;
set
;
}
public
string
loginName
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
{
var
client
=
new
JsonServiceClient
(
Configs
.
BaseUrl
);
var
token
=
client
.
RequestRestToken
(
loginName
);
var
reps
=
client
.
RequestUploadFormXml
(
Items
,
loginName
,
token
);
var
rtns
=
new
RestfulExecutionResponse
<
string
>();
rtns
.
Results
=
new
List
<
string
>();
rtns
.
Results
.
Add
(
reps
);
return
rtns
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment