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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
86 deletions
+64
-86
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
+46
-69
No files found.
Src/Configs.cs
View file @
96f5c613
...
...
@@ -20,7 +20,7 @@ namespace Kivii.Third.Scjgj
public
const
string
TableNamePlanUp
=
"PM_PLAN_UP"
;
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
ConnectionProviderName
=
"Oracle"
;
//
public const string ConnectionString = "Data Source=218.94.159.228:8083/sjdb;User Id=sjqzsfzydbl;Password=admin;";
//
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.Lims.Entities
;
using
Kivii.Linq
;
using
Kivii.Third.Scjgj.Entities
;
using
System
;
...
...
@@ -25,6 +24,7 @@ namespace Kivii.Third.Scjgj
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetSampling
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
break
;
case
"2"
:
...
...
@@ -33,6 +33,7 @@ namespace Kivii.Third.Scjgj
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetSampling
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
break
;
case
"3"
:
...
...
@@ -50,6 +51,7 @@ namespace Kivii.Third.Scjgj
rtns
.
ConvertGetCary
(
item
);
rtns
.
ConvertGetPro
(
item
);
rtns
.
ConvertGetGoods
(
item
);
rtns
.
ConvertGetSampling
(
item
);
rtns
.
ConvertGetRemarks
(
item
);
break
;
default
:
...
...
@@ -70,8 +72,7 @@ namespace Kivii.Third.Scjgj
if
(
conn
==
null
)
{
connDispose
=
true
;
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
conn
=
factory
.
OpenDbConnection
();
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>();
}
item
.
Plan
=
GetPlan
(
conn
,
item
.
PLAN_CODE
);
item
.
Plan
.
TaskSource
=
GetTaskSource
(
conn
,
item
.
Plan
.
TASK_SOURCE
);
...
...
@@ -319,6 +320,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
...
@@ -349,6 +351,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
...
@@ -379,6 +382,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
...
@@ -414,6 +418,7 @@ namespace Kivii.Third.Scjgj
item
.
ProduceUnit
=
new
ProduceUnit
();
item
.
ExecUint
=
new
ExecUint
();
item
.
Other
=
new
Other
();
item
.
EcPlatform
=
new
EcPlatform
();
if
(
item
.
CARY_ID
!=
null
)
{
item
.
Cary
=
GetCaryById
(
conn
,
item
.
CARY_ID
);
...
...
@@ -682,7 +687,8 @@ namespace Kivii.Third.Scjgj
rtns
.
Metadata
[
"Protection"
]
=
item
.
GOODS_PROTECTION_REQ
;
// 防护保存
rtns
.
Metadata
[
"IsExport"
]
=
item
.
GOODS_EXPORT
;
// 是否出口
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
;
// 委托加工
return
rtns
;
}
...
...
@@ -723,7 +729,7 @@ namespace Kivii.Third.Scjgj
//rtns.Metadata["PurchaseAmount"] = item.PRO_JH_KC; // 进货量
//rtns.Metadata["InventoryAmount"] = item.PRO_JH_KC; // 存货量
//rtns.Metadata["SalesAmount"] = // 销售量
rtns
.
Metadata
[
"SalesPrice"
]
=
item
.
GOODS_UNIT
_PRICE
;
// 销售价
rtns
.
Metadata
[
"SalesPrice"
]
=
item
.
SALE
_PRICE
;
// 销售价
//rtns.Metadata["TechParameter"] = // 工艺参数
return
rtns
;
}
...
...
@@ -735,8 +741,8 @@ namespace Kivii.Third.Scjgj
internal
static
Report
ConvertGetSampling
(
this
Report
rtns
,
PlanDetail
item
)
{
if
(
rtns
.
Metadata
.
IsNullOrEmpty
())
rtns
.
Metadata
=
new
Dictionary
<
string
,
string
>();
//rtns.Metadata["InvoiceNo"] =
// 发票号
//rtns.Metadata["BillingCompany"] =
// 开票单位
rtns
.
Metadata
[
"InvoiceNo"
]
=
item
.
INVOICE_CODE
;
// 发票号
rtns
.
Metadata
[
"BillingCompany"
]
=
item
.
INVOICE_UNIT
;
// 开票单位
//rtns.Metadata["ShopLicense"] = // 直播 ID 号
//rtns.Metadata["MarketingName"] = // 直播昵称
rtns
.
Metadata
[
"SamplingPlatform"
]
=
item
.
EcPlatform
.
EC_PLATFORM_NAME
;
// 所属平台
...
...
Src/Kivii.Third.Scjgj.V4.5.csproj
View file @
96f5c613
...
...
@@ -55,18 +55,13 @@
<ItemGroup>
<Compile
Include=
"Configs.cs"
/>
<Compile
Include=
"Entities\OtherEntity.cs"
/>
<Compile
Include=
"Entities\Report.cs"
/>
<Compile
Include=
"Extensions.cs"
/>
<Compile
Include=
"Entities\Plan.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"RestfulPlan.cs"
/>
</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=
"packages.config"
/>
<None
Include=
"Resources\抽样系统中间库数据接口文档-v20210219.docx"
/>
...
...
Src/Properties/AssemblyInfo.cs
View file @
96f5c613
...
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.62
7
0")]
[assembly: AssemblyFileVersion("5.4.2024.62
7
0")]
[assembly: AssemblyVersion("5.4.2024.62
8
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.Third.Scjgj.Entities
;
using
Kivii.Web
;
...
...
@@ -26,27 +25,24 @@ namespace Kivii.Third.Scjgj
{
var
rtns
=
new
RestfulQueryResponse
<
Plan
>();
rtns
.
Results
=
new
List
<
Plan
>();
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
using
(
var
conn
=
factory
.
OpenDbConnection
())
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>(
);
try
{
try
{
var
query
=
conn
.
From
<
Plan
>();
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
);
rtns
.
Results
=
conn
.
Select
(
query
);
var
query
=
conn
.
From
<
Plan
>();
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
);
rtns
.
Results
=
conn
.
Select
(
query
);
rtns
.
Total
=
conn
.
Scalar
<
Plan
,
int
>(
o
=>
Sql
.
Count
(
o
.
ID
));
}
catch
(
Exception
ex
)
{
}
rtns
.
Total
=
conn
.
Scalar
<
Plan
,
int
>(
o
=>
Sql
.
Count
(
o
.
ID
));
}
catch
(
Exception
ex
)
{
throw
ex
;
}
return
rtns
;
}
}
...
...
@@ -86,43 +82,27 @@ namespace Kivii.Third.Scjgj
{
var
rtns
=
new
RestfulQueryResponse
<
PlanDetail
>();
rtns
.
Results
=
new
List
<
PlanDetail
>();
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
using
(
var
conn
=
factory
.
OpenDbConnection
())
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>(
);
try
{
try
{
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
);
int
total
=
0
;
if
(!
QueryValues
.
IsNullOrEmpty
())
total
=
conn
.
Scalar
<
PlanDetail
,
int
>(
o
=>
Sql
.
Count
(
o
.
ID
),
o
=>
o
.
PLAN_CODE
.
Contains
(
QueryValues
));
else
total
=
conn
.
Scalar
<
PlanDetail
,
int
>(
o
=>
Sql
.
Count
(
o
.
ID
));
rtns
.
Results
=
results
;
rtns
.
Total
=
total
;
}
catch
(
Exception
ex
)
{
}
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
);
int
total
=
0
;
if
(!
QueryValues
.
IsNullOrEmpty
())
total
=
conn
.
Scalar
<
PlanDetail
,
int
>(
o
=>
Sql
.
Count
(
o
.
ID
),
o
=>
o
.
PLAN_CODE
.
Contains
(
QueryValues
));
else
total
=
conn
.
Scalar
<
PlanDetail
,
int
>(
o
=>
Sql
.
Count
(
o
.
ID
));
rtns
.
Results
=
results
;
rtns
.
Total
=
total
;
}
catch
(
Exception
ex
)
{
throw
ex
;
}
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,27 +119,24 @@ namespace Kivii.Third.Scjgj
BatchNumber
.
ThrowIfNullOrEmpty
(
"请传入计划编号"
);
PlanNumber
.
ThrowIfNullOrEmpty
(
"请传入批次号"
);
var
result
=
new
PlanDetail
();
var
factory
=
Kivii
.
Linq
.
LinqUtils
.
GetLinqConnectionFactory
(
Configs
.
ConnectionString
,
Configs
.
ConnectionProviderName
);
using
(
var
conn
=
factory
.
OpenDbConnection
())
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Plan
>(
);
try
{
try
{
var
query
=
conn
.
From
<
PlanDetail
>();
query
.
Where
(
o
=>
o
.
PLAN_CODE
==
BatchNumber
&&
o
.
LOT_NUM
==
PlanNumber
);
var
planDetail
=
conn
.
Single
(
query
);
if
(
planDetail
==
null
)
throw
new
Exception
(
"未找到此任务单"
);
result
=
planDetail
.
DataFilling
(
conn
);
}
catch
(
Exception
ex
)
{
throw
ex
;
}
var
query
=
conn
.
From
<
PlanDetail
>();
query
.
Where
(
o
=>
o
.
PLAN_CODE
==
BatchNumber
&&
o
.
LOT_NUM
==
PlanNumber
);
var
planDetail
=
conn
.
Single
(
query
);
if
(
planDetail
==
null
)
throw
new
Exception
(
"未找到此任务单"
);
result
=
planDetail
.
DataFilling
(
conn
);
}
catch
(
Exception
ex
)
{
throw
ex
;
}
if
(!
ToReport
)
{
var
rtns
=
new
RestfulReadResponse
<
PlanDetail
>();
var
rtns
=
new
RestfulReadResponse
<
PlanDetail
>();
rtns
.
Result
=
result
;
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