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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
735 additions
and
86 deletions
+735
-86
Configs.cs
Src/Configs.cs
+2
-2
Report.cs
Src/Entities/Report.cs
+671
-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
using
Kivii.DataAnnotations
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Kivii.Third.Scjgj.Entities
{
public
enum
ReportStatusType
{
Unsupported
=
0
,
/// <summary>
/// 委托受理
/// </summary>
CommissionAccept
=
100
,
/// <summary>
/// 合同评审
/// </summary>
ContractReview
=
200
,
/// <summary>
/// 任务分派
/// </summary>
TaskAssign
=
300
,
/// <summary>
/// 数据录入
/// </summary>
DataEntry
=
400
,
/// <summary>
/// 报告编制
/// </summary>
ReportPreparation
=
500
,
/// <summary>
/// 报告审核
/// </summary>
ReportReview
=
600
,
/// <summary>
/// 报告签发
/// </summary>
ReportIssue
=
700
,
/// <summary>
/// 报告打印
/// </summary>
ReportPrint
=
800
,
/// <summary>
/// 报告归档
/// </summary>
ReportCollected
=
int
.
MaxValue
}
public
abstract
class
ReportBase
:
EntityWithMetadata
{
#
region
报告编号组成要素
[
DefaultEmptyGuid
]
public
Guid
BizKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"业务流水号"
)]
[
StringLength
(
200
)]
[
Default
(
""
)]
public
string
BizId
{
get
;
set
;
}
[
ApiMember
(
Description
=
"业务类型"
)]
[
StringLength
(
100
)]
[
Default
(
""
)]
public
string
BizType
{
get
;
set
;
}
/// <summary>
/// 报告编号,全系统唯一
/// </summary>
[
ApiMember
(
Description
=
"报告编号"
)]
//[Unique, IgnoreUpdate]//流水号本身就是支持Unique的,不需要重复写,并且报告号是允许更新的,万一他们写错了
[
StringLength
(
50
),
Default
(
""
),
SerialNumber
(
NumberField
=
nameof
(
ReportIdNumber
))]
public
string
ReportId
{
get
;
set
;
}
/// <summary>
/// 报告编号的流水号数字部分
/// </summary>
[
ApiMember
(
Description
=
"流水号"
)]
[
Default
(
0
)]
public
int
ReportIdNumber
{
get
;
set
;
}
/// <summary>
/// 报告类型
/// 纺织品报告(F),子部门报告(A、B、C、D)
/// </summary>
[
ApiMember
(
Description
=
"报告类型"
)]
[
StringLength
(
20
),
Default
(
""
)]
public
string
Type
{
get
;
set
;
}
/// <summary>
/// 报告类型后缀
/// 委托报告(W),监督报告(J)
/// </summary>
[
ApiMember
(
Description
=
"报告类型扩展"
)]
[
StringLength
(
20
),
Default
(
""
)]
public
string
TypeEx
{
get
;
set
;
}
/// <summary>
/// 报告类型名称中文显示
/// 委托送样,委托抽样
/// </summary>
[
ApiMember
(
Description
=
"报告类型名称"
)]
[
StringLength
(
20
),
Default
(
""
)]
public
string
TypeName
{
get
;
set
;
}
/// <summary>
/// 报告分类,现记录客户编码(报告后缀)UR......
/// </summary>
[
ApiMember
(
Description
=
"报告分类"
)]
[
StringLength
(
20
),
Default
(
""
)]
public
string
Category
{
get
;
set
;
}
#
endregion
#
region
供需双方信息
//供方可以是组织,也可以是部门
[
ApiMember
(
Description
=
"供方Kvid"
)]
[
DefaultEmptyGuid
]
public
Guid
SupplierKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"供方名称,即检测单位"
)]
[
StringLength
(
100
),
Required
]
public
string
SupplierName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"供方联系人Kvid"
)]
[
DefaultEmptyGuid
]
public
Guid
SupplierContactKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"供方联系人"
)]
[
StringLength
(
100
),
Default
(
""
)]
public
string
SupplierContactName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"供方联系电话"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SupplierContactNumber
{
get
;
set
;
}
[
ApiMember
(
Description
=
"供方联系地址"
)]
public
string
SupplierContactAddress
{
get
;
set
;
}
[
ApiMember
(
Description
=
"需方Kvid"
)]
[
DefaultEmptyGuid
]
public
Guid
DemanderKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"需方名称,即委托单位"
)]
[
StringLength
(
100
),
Required
]
public
string
DemanderName
{
get
;
set
;
}
[
DefaultEmptyGuid
]
public
Guid
DemanderContactKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"需方联系人"
)]
[
StringLength
(
100
),
Default
(
""
)]
public
string
DemanderContactName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"需方联系电话"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
DemanderContactNumber
{
get
;
set
;
}
[
ApiMember
(
Description
=
"需方联系地址"
)]
public
string
DemanderContactAddress
{
get
;
set
;
}
#
endregion
#
region
收付双方
Payer
付款单位
,
贷方
Payee
收款单位
,
借方
[
DefaultEmptyGuid
]
public
Guid
PayerKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"付款单位,贷方"
)]
[
StringLength
(
100
)]
public
string
PayerName
{
get
;
set
;
}
[
IgnoreUpdate
]
[
DefaultEmptyGuid
]
public
Guid
PayeeKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"收款单位,借方"
)]
[
IgnoreUpdate
]
[
StringLength
(
100
),
Required
]
public
string
PayeeName
{
get
;
set
;
}
#
endregion
#
region
样品相关,和
sample
冗余
[
ApiMember
(
Description
=
"样品Kvid"
)]
[
IgnoreUpdate
]
[
Required
]
public
Guid
SampleKvid
{
get
;
set
;
}
/// <summary>
/// 样品名称
/// </summary>
[
ApiMember
(
Description
=
"样品名称"
)]
[
StringLength
(
200
),
Required
]
public
string
SampleName
{
get
;
set
;
}
/// <summary>
/// 样品名称
/// </summary>
[
ApiMember
(
Description
=
"样品编号"
)]
//[SerialNumber]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SampleSerialNumber
{
get
;
set
;
}
/// <summary>
/// 样品批次号
/// </summary>
[
ApiMember
(
Description
=
"样品批次号"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleBatchNumber
{
get
;
set
;
}
/// <summary>
/// 样品品牌
/// </summary>
[
ApiMember
(
Description
=
"样品品牌"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleBrand
{
get
;
set
;
}
/// <summary>
/// 样品规格型号
/// </summary>
[
ApiMember
(
Description
=
"样品规格型号"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleModel
{
get
;
set
;
}
/// <summary>
/// 样品数量
/// </summary>
[
ApiMember
(
Description
=
"样品数量"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
SampleQuantity
{
get
;
set
;
}
/// <summary>
/// 数量单位,老数据的样品数量和单位记到metadata中了
/// </summary>
[
ApiMember
(
Description
=
"样品数量单位"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SampleQuantityUnit
{
get
;
set
;
}
/// <summary>
/// 样品品级
/// </summary>
[
ApiMember
(
Description
=
"样品品级"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleGrade
{
get
;
set
;
}
/// <summary>
/// 安全类别
/// </summary>
[
ApiMember
(
Description
=
"安全类别"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleGradeSafety
{
get
;
set
;
}
/// <summary>
/// 功能等级
/// </summary>
[
ApiMember
(
Description
=
"功能等级"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleGradeFunction
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位Kvid"
)]
[
DefaultEmptyGuid
]
public
Guid
SampleManufacturerKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位"
)]
[
StringLength
(
100
),
Default
(
""
)]
public
string
SampleManufacturerName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位联系人Kvid"
)]
[
DefaultEmptyGuid
]
[
IgnoreUpdate
]
public
Guid
SampleManufacturerContactKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位联系人姓名"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
SampleManufacturerContactName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位联系人电话"
)]
[
StringLength
(
50
),
Default
(
""
)]
//正则表达式验证:(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})
public
string
SampleManufacturerContactNumber
{
get
;
set
;
}
[
ApiMember
(
Description
=
"生产单位地址"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleManufacturerAddress
{
get
;
set
;
}
#
endregion
#
region
样品来源相关,和
SampleSource
冗余
[
DefaultEmptyGuid
]
public
Guid
SampleSourceKvid
{
get
;
set
;
}
/// <summary>
/// 样品来源编号,计划编号,快递号等
/// </summary>
[
ApiMember
(
Description
=
"来源编号"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
SampleSourceBatchNumber
{
get
;
set
;
}
#
endregion
#
region
检验相关
/// <summary>
/// 检验依据
/// </summary>
[
ApiMember
(
Description
=
"检验依据"
)]
[
StringLength
(
1000
),
Default
(
""
)]
public
string
TestStandards
{
get
;
set
;
}
/// <summary>
/// 检测项目
/// </summary>
[
ApiMember
(
Description
=
"检测项目"
)]
[
StringLength
(
3000
),
Default
(
""
)]
public
string
TestDetections
{
get
;
set
;
}
/// <summary>
/// 检验要求:判定、数据
/// </summary>
[
ApiMember
(
Description
=
"检验要求,是否需要判定"
)]
[
Required
]
public
bool
TestNeedJudge
{
get
;
set
;
}
/// <summary>
/// 产品质量综合判定
/// </summary>
[
ApiMember
(
Description
=
"产品质量综合判定"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
TestJudgement
{
get
;
set
;
}
#
endregion
#
region
日期相关
/// <summary>
/// 委托日期:默认为当天日期
/// </summary>
[
ApiMember
(
Description
=
"委托日期"
)]
[
DateOnly
]
[
NonClusteredIndex
]
public
DateTime
?
DealDate
{
get
;
set
;
}
/// <summary>
/// 完成日期(前台选择)
/// </summary>
[
ApiMember
(
Description
=
"要求完成日期"
)]
[
DateOnly
]
[
NonClusteredIndex
]
public
DateTime
?
DeadDate
{
get
;
set
;
}
/// <summary>
/// 评审日期
/// </summary>
[
ApiMember
(
Description
=
"评审日期"
)]
[
DateOnly
]
public
DateTime
?
ContractReviewDate
{
get
;
set
;
}
/// <summary>
/// 分派日期
/// </summary>
[
ApiMember
(
Description
=
"分派日期"
)]
[
DateOnly
]
public
DateTime
?
TaskAssignDate
{
get
;
set
;
}
/// <summary>
/// 检验开始日期(为委托的下达日期)
/// </summary>
[
ApiMember
(
Description
=
"检验开始日期"
)]
public
DateTime
?
TestStartDate
{
get
;
set
;
}
/// <summary>
/// 检验结束日期
/// 默认为编制时的当天日期
/// </summary>
[
ApiMember
(
Description
=
"检验结束日期"
)]
public
DateTime
?
TestFinishDate
{
get
;
set
;
}
/// <summary>
/// 编制日期
/// </summary>
[
ApiMember
(
Description
=
"编制日期"
)]
public
DateTime
?
PreparationDate
{
get
;
set
;
}
/// <summary>
/// 审核日期
/// </summary>
[
ApiMember
(
Description
=
"审核日期"
)]
[
DateOnly
]
public
DateTime
?
ReviewDate
{
get
;
set
;
}
/// <summary>
/// 签发日期
/// </summary>
[
ApiMember
(
Description
=
"签发日期"
)]
[
InternalSetter
]
[
DateOnly
]
[
NonClusteredIndex
]
public
DateTime
?
IssueDate
{
get
;
set
;
}
#
endregion
#
region
报告受理,编制,审核,签发人员信息
/// <summary>
/// 受理人Kvid
/// </summary>
[
DefaultEmptyGuid
]
public
Guid
OperatorKvid
{
get
;
set
;
}
/// <summary>
/// 受理人姓名,不一定是Creator(从第三方系统进来的报告)
/// </summary>
[
ApiMember
(
Description
=
"受理人"
)]
[
StringLength
(
20
),
Default
(
""
)]
public
string
OperatorName
{
get
;
set
;
}
/// <summary>
/// 主检人
/// </summary>
[
ApiMember
(
Description
=
"主检人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
ManagerName
{
get
;
set
;
}
/// <summary>
/// 主检人Kvid
/// </summary>
[
DefaultEmptyGuid
]
public
Guid
ManagerKvid
{
get
;
set
;
}
/// <summary>
/// 编制人Kvid
/// </summary>
[
DefaultEmptyGuid
]
public
Guid
PreparerKvid
{
get
;
set
;
}
/// <summary>
/// 编制人姓名
/// </summary>
[
ApiMember
(
Description
=
"编制人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
PreparerName
{
get
;
set
;
}
/// <summary>
/// 审核人Kvid
/// </summary>
[
DefaultEmptyGuid
]
public
Guid
ReviewerKvid
{
get
;
set
;
}
/// <summary>
/// 审核人姓名
/// </summary>
[
ApiMember
(
Description
=
"审核人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
ReviewerName
{
get
;
set
;
}
/// <summary>
/// 签发人Kvid
/// </summary>
[
DefaultEmptyGuid
]
public
Guid
IssuerKvid
{
get
;
set
;
}
/// <summary>
/// 签发人姓名
/// </summary>
[
ApiMember
(
Description
=
"签发人"
)]
[
StringLength
(
50
),
Default
(
""
)]
public
string
IssuerName
{
get
;
set
;
}
#
endregion
#
region
报告模板及格式份数
[
DefaultEmptyGuid
]
public
Guid
TemplateKvid
{
get
;
set
;
}
/// <summary>
/// 报告格式
/// </summary>
[
ApiMember
(
Description
=
"报告格式"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
TemplateName
{
get
;
set
;
}
/// <summary>
/// 报告份数
/// </summary>
[
ApiMember
(
Description
=
"报告份数"
)]
[
DecimalLength
(
4
,
2
),
Default
(
0
)]
public
decimal
Quantity
{
get
;
set
;
}
[
ApiMember
(
Description
=
"数量单位"
)]
[
Ignore
]
public
string
QuantityUnit
{
get
{
return
"份"
;
}
}
/// <summary>
/// 加急系数
/// </summary>
[
ApiMember
(
Description
=
"加急系数"
)]
[
DecimalLength
(
4
,
2
),
Default
(
1
)]
public
decimal
UrgentRate
{
get
;
set
;
}
=
1
;
/// <summary>
/// 报告是否显示生产单位
/// </summary>
//[ApiMember(Description = "报告是否显示生产单位")]
//public bool ShowProductOrg { get; set; }
#
endregion
#
region
费用相关信息
/// <summary>
/// 单价,仅指报告打印的单价
/// </summary>
[
ApiMember
(
Description
=
"单价"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
QuantityUnitPrice
{
get
;
set
;
}
/// <summary>
/// 理论单价
/// </summary>
[
ApiMember
(
Description
=
"理论单价"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
QuantityUnitPricePlan
{
get
;
set
;
}
/// <summary>
/// 检验费,ReportItem中的Amount总和
/// </summary>
[
ApiMember
(
Description
=
"检验费"
)]
[
InternalSetter
]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
AmountTest
{
get
;
set
;
}
/// <summary>
/// 理论检验费,ReportItem中的AmountPlan总和
/// </summary>
[
ApiMember
(
Description
=
"理论检验费"
)]
[
InternalSetter
]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
AmountTestPlan
{
get
;
set
;
}
/// <summary>
/// 报告的费用,N份报告的打印费用
/// </summary>
[
ApiMember
(
Description
=
"报告费"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
Amount
{
get
;
set
;
}
/// <summary>
/// 理论报告的费用
/// </summary>
[
ApiMember
(
Description
=
"理论报告费"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
public
decimal
AmountPlan
{
get
;
set
;
}
[
ApiMember
(
Description
=
"货币单位"
)]
[
IgnoreUpdate
]
[
StringLength
(
50
),
Required
]
public
CurrencyUnit
Currency
{
get
;
set
;
}
/// <summary>
/// 结算总费用:即实际费用结算的费用
/// </summary>
[
ApiMember
(
Description
=
"结算总费用"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
[
InternalSetter
]
public
decimal
AmountSettlement
{
get
;
set
;
}
/// <summary>
/// 已缴总费用:即费用结算后所缴纳的实际费用
/// </summary>
[
ApiMember
(
Description
=
"已缴总费用"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
[
InternalSetter
]
public
decimal
AmountPayment
{
get
;
set
;
}
/// <summary>
/// 执行的协议Kvid
/// </summary>
[
ApiMember
(
Description
=
"执行协议Kvid"
)]
[
DefaultEmptyGuid
]
[
IgnoreUpdate
]
public
Guid
QuotationKvid
{
get
;
set
;
}
/// <summary>
/// 执行的协议名称
/// </summary>
[
ApiMember
(
Description
=
"执行协议名称"
)]
[
StringLength
(
200
),
Default
(
""
)]
[
IgnoreUpdate
]
public
string
QuotationName
{
get
;
set
;
}
/// <summary>
/// 执行的协议的价格,若价格大于0,则以此价格为准
/// </summary>
[
ApiMember
(
Description
=
"执行协议价格"
)]
[
DecimalLength
(
10
,
2
),
Default
(
0
)]
[
IgnoreUpdate
]
public
decimal
QuotationAmount
{
get
;
set
;
}
/// <summary>
/// 协议的折扣,0-1之间
/// </summary>
[
ApiMember
(
Description
=
"协议折扣率"
)]
[
DecimalLength
(
4
,
2
),
Default
(
1
)]
[
IgnoreUpdate
]
public
decimal
?
QuotationDiscountRate
{
get
;
set
;
}
#
endregion
/// <summary>
/// 检验结论,报告的结论
/// </summary>
[
ApiMember
(
Description
=
"检验结论"
)]
[
StringLength
(
2000
),
Default
(
""
)]
public
string
Conclusion
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
[
ApiMember
(
Description
=
"备注"
)]
[
StringLength
(
2000
),
Default
(
""
)]
public
string
Remark
{
get
;
set
;
}
#
region
创建
/
更新人
V1
.
0
[
ApiMember
(
Description
=
"创建人Kvid "
)]
[
IgnoreUpdate
]
[
CurrentMemberKvid
]
public
Guid
CreatorKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"创建人"
)]
[
IgnoreUpdate
]
[
StringLength
(
50
),
CurrentMemberName
]
public
string
CreatorName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"更新人Kvid "
)]
[
CurrentMemberKvid
]
public
Guid
UpdaterKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"更新人"
)]
[
StringLength
(
50
),
CurrentMemberName
]
public
string
UpdaterName
{
get
;
set
;
}
#
endregion
[
Ignore
]
public
ReportStatusType
StatusType
{
get
{
return
(
ReportStatusType
)
Status
;
}
set
{
Status
=
(
int
)
value
;
}
}
}
[
Api
(
Description
=
"检验报告"
)]
public
class
Report
:
ReportBase
,
IEntityHasPayer
,
IEntityHasPayee
,
IEntityHasSettlement
,
IEntityHasPayment
,
IEntityHasDemander
,
IEntityHasSupplier
,
IEntityInAssemblyDb
{
}
}
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