Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Third.Scjgj
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.Scjgj
Commits
96f5c613
Commit
96f5c613
authored
Jun 28, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
de39ea68
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
47 deletions
+25
-47
Configs.cs
Src/Configs.cs
+2
-2
Report.cs
Src/Entities/Report.cs
+0
-0
Extensions.cs
Src/Extensions.cs
+13
-7
Kivii.Third.Scjgj.V4.5.csproj
Src/Kivii.Third.Scjgj.V4.5.csproj
+1
-6
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
RestfulPlan.cs
Src/RestfulPlan.cs
+7
-30
No files found.
Src/Configs.cs
View file @
96f5c613
...
@@ -20,7 +20,7 @@ namespace Kivii.Third.Scjgj
...
@@ -20,7 +20,7 @@ namespace Kivii.Third.Scjgj
public
const
string
TableNamePlanUp
=
"PM_PLAN_UP"
;
public
const
string
TableNamePlanUp
=
"PM_PLAN_UP"
;
public
const
string
TableNameTaskSource
=
"PM_TASK_SOURCE"
;
public
const
string
TableNameTaskSource
=
"PM_TASK_SOURCE"
;
public
const
string
ConnectionString
=
"Data Source=218.94.159.228:8083/sjdb;User Id=sjqzsfzydbl;Password=admin;"
;
//
public const string ConnectionString = "Data Source=218.94.159.228:8083/sjdb;User Id=sjqzsfzydbl;Password=admin;";
public
const
string
ConnectionProviderName
=
"Oracle"
;
//
public const string ConnectionProviderName = "Oracle";
}
}
}
}
Src/Entities/Report.cs
0 → 100644
View file @
96f5c613
This diff is collapsed.
Click to expand it.
Src/Extensions.cs
View file @
96f5c613
using
Kivii.Funq
;
using
Kivii.Funq
;
using
Kivii.Lims.Entities
;
using
Kivii.Linq
;
using
Kivii.Linq
;
using
Kivii.Third.Scjgj.Entities
;
using
Kivii.Third.Scjgj.Entities
;
using
System
;
using
System
;
...
@@ -25,6 +24,7 @@ namespace Kivii.Third.Scjgj
...
@@ -25,6 +24,7 @@ namespace Kivii.Third.Scjgj
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetSampling
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
break
;
break
;
case
"2"
:
case
"2"
:
...
@@ -33,6 +33,7 @@ namespace Kivii.Third.Scjgj
...
@@ -33,6 +33,7 @@ namespace Kivii.Third.Scjgj
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetSampling
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
break
;
break
;
case
"3"
:
case
"3"
:
...
@@ -50,6 +51,7 @@ namespace Kivii.Third.Scjgj
...
@@ -50,6 +51,7 @@ namespace Kivii.Third.Scjgj
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetSampling
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
break
;
break
;
default
:
default
:
...
@@ -70,8 +72,7 @@ namespace Kivii.Third.Scjgj
...
@@ -70,8 +72,7 @@ namespace Kivii.Third.Scjgj
if
(
conn
==
null
)
if
(
conn
==
null
)
{
{
connDispose
=
true
;
connDispose
=
true
;
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>();
conn
=
factory
.
OpenDbConnection
();
}
}
item
.
Plan
=
GetPlan
(
conn
,
item
.
PLAN_CODE
);
item
.
Plan
=
GetPlan
(
conn
,
item
.
PLAN_CODE
);
item
.
Plan
.
TaskSource
=
GetTaskSource
(
conn
,
item
.
Plan
.
TASK_SOURCE
);
item
.
Plan
.
TaskSource
=
GetTaskSource
(
conn
,
item
.
Plan
.
TASK_SOURCE
);
...
@@ -319,6 +320,7 @@ namespace Kivii.Third.Scjgj
...
@@ -319,6 +320,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
if
(
item
.
CARY_ID
!=
null
)
{
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
@@ -349,6 +351,7 @@ namespace Kivii.Third.Scjgj
...
@@ -349,6 +351,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
if
(
item
.
CARY_ID
!=
null
)
{
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
@@ -379,6 +382,7 @@ namespace Kivii.Third.Scjgj
...
@@ -379,6 +382,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
if
(
item
.
CARY_ID
!=
null
)
{
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
@@ -414,6 +418,7 @@ namespace Kivii.Third.Scjgj
...
@@ -414,6 +418,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
if
(
item
.
CARY_ID
!=
null
)
{
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
@@ -682,7 +687,8 @@ namespace Kivii.Third.Scjgj
...
@@ -682,7 +687,8 @@ namespace Kivii.Third.Scjgj
rtns
.
Metadata
[
"Protection"
]
=
item
.
GOODS_PROTECTION_REQ
;
// 防护保存
rtns
.
Metadata
[
"Protection"
]
=
item
.
GOODS_PROTECTION_REQ
;
// 防护保存
rtns
.
Metadata
[
"IsExport"
]
=
item
.
GOODS_EXPORT
;
// 是否出口
rtns
.
Metadata
[
"IsExport"
]
=
item
.
GOODS_EXPORT
;
// 是否出口
rtns
.
Metadata
[
"IsReturn"
]
=
item
.
GOODS_NEEDS_RETREAT
;
// 是否退样
rtns
.
Metadata
[
"IsReturn"
]
=
item
.
GOODS_NEEDS_RETREAT
;
// 是否退样
rtns
.
Metadata
[
"IsQualifiedAndPending"
]
=
item
.
GOODS_CAN_SALE
;
// 合格待销
bool
.
TryParse
(
item
.
GOODS_CAN_SALE
,
out
var
IsQualifiedAndPending
);
rtns
.
Metadata
[
"IsQualifiedAndPending"
]
=
IsQualifiedAndPending
?
"true"
:
"false"
;
// 合格待销
rtns
.
Metadata
[
"IsCommissionProcess"
]
=
item
.
GOODS_MAN_CONSIGNMENT
;
// 委托加工
rtns
.
Metadata
[
"IsCommissionProcess"
]
=
item
.
GOODS_MAN_CONSIGNMENT
;
// 委托加工
return
rtns
;
return
rtns
;
}
}
...
@@ -723,7 +729,7 @@ namespace Kivii.Third.Scjgj
...
@@ -723,7 +729,7 @@ namespace Kivii.Third.Scjgj
//rtns.Metadata["PurchaseAmount"] = item.PRO_JH_KC; // 进货量
//rtns.Metadata["PurchaseAmount"] = item.PRO_JH_KC; // 进货量
//rtns.Metadata["InventoryAmount"] = item.PRO_JH_KC; // 存货量
//rtns.Metadata["InventoryAmount"] = item.PRO_JH_KC; // 存货量
//rtns.Metadata["SalesAmount"] = // 销售量
//rtns.Metadata["SalesAmount"] = // 销售量
rtns
.
Metadata
[
"SalesPrice"
]
=
item
.
GOODS_UNIT
_PRICE
;
// 销售价
rtns
.
Metadata
[
"SalesPrice"
]
=
item
.
SALE
_PRICE
;
// 销售价
//rtns.Metadata["TechParameter"] = // 工艺参数
//rtns.Metadata["TechParameter"] = // 工艺参数
return
rtns
;
return
rtns
;
}
}
...
@@ -735,8 +741,8 @@ namespace Kivii.Third.Scjgj
...
@@ -735,8 +741,8 @@ namespace Kivii.Third.Scjgj
internal
static
Report
ConvertGetSampling
(
this
Report
rtns
,
PlanDetail
item
)
internal
static
Report
ConvertGetSampling
(
this
Report
rtns
,
PlanDetail
item
)
{
{
if
(
rtns
.
Metadata
.
IsNullOrEmpty
())
rtns
.
Metadata
=
new
Dictionary
<
string
,
string
>();
if
(
rtns
.
Metadata
.
IsNullOrEmpty
())
rtns
.
Metadata
=
new
Dictionary
<
string
,
string
>();
//rtns.Metadata["InvoiceNo"] =
// 发票号
rtns
.
Metadata
[
"InvoiceNo"
]
=
item
.
INVOICE_CODE
;
// 发票号
//rtns.Metadata["BillingCompany"] =
// 开票单位
rtns
.
Metadata
[
"BillingCompany"
]
=
item
.
INVOICE_UNIT
;
// 开票单位
//rtns.Metadata["ShopLicense"] = // 直播 ID 号
//rtns.Metadata["ShopLicense"] = // 直播 ID 号
//rtns.Metadata["MarketingName"] = // 直播昵称
//rtns.Metadata["MarketingName"] = // 直播昵称
rtns
.
Metadata
[
"SamplingPlatform"
]
=
item
.
EcPlatform
.
EC_PLATFORM_NAME
;
// 所属平台
rtns
.
Metadata
[
"SamplingPlatform"
]
=
item
.
EcPlatform
.
EC_PLATFORM_NAME
;
// 所属平台
...
...
Src/Kivii.Third.Scjgj.V4.5.csproj
View file @
96f5c613
...
@@ -55,18 +55,13 @@
...
@@ -55,18 +55,13 @@
<ItemGroup>
<ItemGroup>
<Compile
Include=
"Configs.cs"
/>
<Compile
Include=
"Configs.cs"
/>
<Compile
Include=
"Entities\OtherEntity.cs"
/>
<Compile
Include=
"Entities\OtherEntity.cs"
/>
<Compile
Include=
"Entities\Report.cs"
/>
<Compile
Include=
"Extensions.cs"
/>
<Compile
Include=
"Extensions.cs"
/>
<Compile
Include=
"Entities\Plan.cs"
/>
<Compile
Include=
"Entities\Plan.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"RestfulPlan.cs"
/>
<Compile
Include=
"RestfulPlan.cs"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference
Include=
"..\..\Kivii.Biz.Lims\Src\Kivii.Biz.Lims.V4.5.csproj"
>
<Project>
{a1971816-ee6f-4558-8923-b1b85779cb7f}
</Project>
<Name>
Kivii.Biz.Lims.V4.5
</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None
Include=
"App.config"
/>
<None
Include=
"App.config"
/>
<None
Include=
"packages.config"
/>
<None
Include=
"packages.config"
/>
<None
Include=
"Resources\抽样系统中间库数据接口文档-v20210219.docx"
/>
<None
Include=
"Resources\抽样系统中间库数据接口文档-v20210219.docx"
/>
...
...
Src/Properties/AssemblyInfo.cs
View file @
96f5c613
...
@@ -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.2024.62
7
0")]
[assembly: AssemblyVersion("5.4.2024.62
8
0")]
[assembly: AssemblyFileVersion("5.4.2024.62
7
0")]
[assembly: AssemblyFileVersion("5.4.2024.62
8
0")]
Src/RestfulPlan.cs
View file @
96f5c613
using
Kivii.Lims.Entities
;
using
Kivii.Linq
;
using
Kivii.Linq
;
using
Kivii.Testing
;
using
Kivii.Testing
;
using
Kivii.Third.Scjgj.Entities
;
using
Kivii.Third.Scjgj.Entities
;
using
Kivii.Web
;
using
Kivii.Web
;
...
@@ -26,9 +25,7 @@ namespace Kivii.Third.Scjgj
...
@@ -26,9 +25,7 @@ namespace Kivii.Third.Scjgj
{
{
var
rtns
=
new
RestfulQueryResponse
<
Plan
>();
var
rtns
=
new
RestfulQueryResponse
<
Plan
>();
rtns
.
Results
=
new
List
<
Plan
>();
rtns
.
Results
=
new
List
<
Plan
>();
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>();
using
(
var
conn
=
factory
.
OpenDbConnection
())
{
try
try
{
{
var
query
=
conn
.
From
<
Plan
>();
var
query
=
conn
.
From
<
Plan
>();
...
@@ -43,10 +40,9 @@ namespace Kivii.Third.Scjgj
...
@@ -43,10 +40,9 @@ namespace Kivii.Third.Scjgj
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
throw
ex
;
}
}
}
return
rtns
;
return
rtns
;
}
}
}
}
...
@@ -86,9 +82,7 @@ namespace Kivii.Third.Scjgj
...
@@ -86,9 +82,7 @@ namespace Kivii.Third.Scjgj
{
{
var
rtns
=
new
RestfulQueryResponse
<
PlanDetail
>();
var
rtns
=
new
RestfulQueryResponse
<
PlanDetail
>();
rtns
.
Results
=
new
List
<
PlanDetail
>();
rtns
.
Results
=
new
List
<
PlanDetail
>();
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>();
using
(
var
conn
=
factory
.
OpenDbConnection
())
{
try
try
{
{
var
query
=
conn
.
From
<
PlanDetail
>();
var
query
=
conn
.
From
<
PlanDetail
>();
...
@@ -105,24 +99,10 @@ namespace Kivii.Third.Scjgj
...
@@ -105,24 +99,10 @@ namespace Kivii.Third.Scjgj
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
throw
ex
;
}
}
}
return
rtns
;
return
rtns
;
//var conn = KiviiContext.GetOpenedDbConnection<Plan>();
//var query = conn.From<PlanDetail>();
//if (!QueryValues.IsNullOrEmpty()) query.Where(o => o.PLAN_CODE.Contains(QueryValues));
//if (Skip.HasValue && Skip.Value >= 0) query.Skip(Skip.Value);
//if (Take.HasValue && Take.Value > 0) query.Take(Take.Value);
//if (!OrderBy.IsNullOrEmpty()) query.OrderBy(OrderBy);
//var results = conn.Select(query);
//var total = conn.Scalar<PlanDetail, int>(o => Sql.Count(o.ID));
//var rtns = new RestfulQueryResponse<PlanDetail>();
//rtns.Results = new List<PlanDetail>();
//rtns.Results = results;
//rtns.Total = total;
//return rtns;
}
}
}
}
...
@@ -139,9 +119,7 @@ namespace Kivii.Third.Scjgj
...
@@ -139,9 +119,7 @@ namespace Kivii.Third.Scjgj
BatchNumber
.
ThrowIfNullOrEmpty
(
"请传入计划编号"
);
BatchNumber
.
ThrowIfNullOrEmpty
(
"请传入计划编号"
);
PlanNumber
.
ThrowIfNullOrEmpty
(
"请传入批次号"
);
PlanNumber
.
ThrowIfNullOrEmpty
(
"请传入批次号"
);
var
result
=
new
PlanDetail
();
var
result
=
new
PlanDetail
();
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>();
using
(
var
conn
=
factory
.
OpenDbConnection
())
{
try
try
{
{
var
query
=
conn
.
From
<
PlanDetail
>();
var
query
=
conn
.
From
<
PlanDetail
>();
...
@@ -156,10 +134,9 @@ namespace Kivii.Third.Scjgj
...
@@ -156,10 +134,9 @@ namespace Kivii.Third.Scjgj
throw
ex
;
throw
ex
;
}
}
}
if
(!
ToReport
)
if
(!
ToReport
)
{
{
var
rtns
=
new
RestfulReadResponse
<
PlanDetail
>();
var
rtns
=
new
RestfulReadResponse
<
PlanDetail
>();
rtns
.
Result
=
result
;
rtns
.
Result
=
result
;
return
rtns
;
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