Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Third.OnlineCustomization.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.OnlineCustomization.V4.5
Commits
a80eddaa
Commit
a80eddaa
authored
Jun 03, 2025
by
任天宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
3959ce33
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
17 deletions
+113
-17
Configs.cs
Src/Configs.cs
+7
-5
OnlineOrder.cs
Src/Entities/OnlineOrder.cs
+91
-3
OrderExtension.cs
Src/Extensions/OrderExtension.cs
+6
-6
OrderRequest.cs
Src/Requests/OrderRequest.cs
+9
-3
No files found.
Src/Configs.cs
View file @
a80eddaa
...
...
@@ -13,18 +13,20 @@ namespace Kivii.OnlineCustomization
//正式环境
public
const
string
_defaultUrl
=
"http://jstonline.kivii.org"
;
public
const
string
_token
=
"E026CBA4E0B970973490FB39DD1EB627"
;
public
const
string
_secret
=
"$2y$13$rIiP4vdNuYua2ksnvJlbhuVhkZaxd2Xwvy/qIQaD9RqQ9h5FOVera"
;
//public const string _token = "E026CBA4E0B970973490FB39DD1EB627";
//public const string _secret = "$2y$13$rIiP4vdNuYua2ksnvJlbhuVhkZaxd2Xwvy/qIQaD9RqQ9h5FOVera";
public
const
string
_token
=
null
;
public
const
string
_secret
=
null
;
//public const string _ownerName = "绫致时装(天津)有限公司";
//public const string _ownerKvid = "0A02263D-50C9-43B5-B27A-E732FD6D8BDE";
//public const string RouteCloseWts = "/thirdapi/wtsapi/coord-wts/close-wts";
//public const string RouteUpdateWtsReport = "/thirdapi/wtsapi/coord-wts/update-wts-report";
public
const
string
RouteUpdateWtsResult
=
"/
thirdapi/wtsapi/coord-wts/update-wts-result
"
;
public
const
string
RouteRejectWts
=
"/
thirdapi/wtsapi/coord-wts/reject-wts
"
;
public
const
string
RouteUpdateWtsResult
=
"/
Restful/Kivii.OnlineCustomization.Entities.Order/SubmitThird
"
;
public
const
string
RouteRejectWts
=
"/
Restful/Kivii.OnlineCustomization.Entities.Order/RejectThird
"
;
//public const string RouteAcceptWts = "/thirdapi/wtsapi/coord-wts/accept-wts";
public
const
string
RouteGetWtsList
=
"/
thirdapi/wtsapi/coord-wts/get-wts-list
"
;
public
const
string
RouteGetWtsList
=
"/
Restful/Kivii.OnlineCustomization.Entities.Order/GetThird
"
;
//public const string RouteGetWtsData = "/thirdapi/wtsapi/coord-wts/get-wts-data";
}
}
Src/Entities/OnlineOrder.cs
View file @
a80eddaa
...
...
@@ -24,9 +24,11 @@ namespace Kivii.OnlineCustomization.Entities
public
string
Category
{
get
;
set
;
}
[
ApiMember
(
Description
=
"订单总金额"
)]
[
DecimalLength
(
10
,
2
)]
public
decimal
TotalAmount
{
get
;
set
;
}
[
ApiMember
(
Description
=
"所属Kvid"
)]
[
DefaultEmptyGuid
]
public
Guid
OwnerKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"买家单位"
)]
...
...
@@ -53,14 +55,21 @@ namespace Kivii.OnlineCustomization.Entities
[
ApiMember
(
Description
=
"备注"
)]
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 订单关联的报告地址
/// </summary>
public
List
<
string
>
Urls
{
get
;
set
;
}
#
region
创建
/
更新人
[
ApiMember
(
Description
=
"创建人Kvid"
)]
[
CurrentMemberKvid
]
public
Guid
CreatorKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"创建人"
)]
public
string
CreatorName
{
get
;
set
;
}
[
ApiMember
(
Description
=
"更新人Kvid"
)]
[
CurrentMemberKvid
]
public
Guid
UpdaterKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"更新人"
)]
...
...
@@ -73,9 +82,8 @@ namespace Kivii.OnlineCustomization.Entities
get
=>
(
OrderStatusType
)
Status
;
set
=>
Status
=
(
int
)
value
;
}
[
Ignore
]
public
List
<
OnlineOrderItem
>
Order
Items
{
get
;
set
;
}
public
List
<
OnlineOrderItem
>
Items
{
get
;
set
;
}
#
endregion
#
region
Interface
...
...
@@ -88,7 +96,80 @@ namespace Kivii.OnlineCustomization.Entities
if
(
third
.
ThirdType
!=
typeof
(
OnlineOrder
).
FullName
)
return
null
;
if
(
third
.
Metadata
==
null
)
return
null
;
var
order
=
third
.
Metadata
.
DicToObject
();
return
new
Report
();
var
report
=
new
Report
();
report
.
Metadata
=
new
Dictionary
<
string
,
string
>();
// 安全获取字典值的辅助方法
string
GetMetadataValue
(
string
key
)
=>
order
.
Metadata
?.
ContainsKey
(
key
)
==
true
?
order
.
Metadata
[
key
]
:
""
;
// 委托方信息
report
.
DemanderName
=
GetMetadataValue
(
"DemanderName"
);
report
.
DemanderContactName
=
GetMetadataValue
(
"DemanderContactName"
);
report
.
DemanderContactNumber
=
GetMetadataValue
(
"DemanderContactNumber"
);
report
.
Metadata
[
"DemanderContactOfficePhone"
]
=
GetMetadataValue
(
"DemanderContactOfficePhone"
);
report
.
Metadata
[
"DemanderEmail"
]
=
GetMetadataValue
(
"DemanderEmail"
);
report
.
DemanderContactAddress
=
GetMetadataValue
(
"DemanderFullAddress"
);
report
.
Metadata
[
"DemanderPostcode"
]
=
GetMetadataValue
(
"DemanderZipCode"
);
// 生产方信息
report
.
SampleManufacturerName
=
GetMetadataValue
(
"SampleManufacturerName"
);
report
.
SampleManufacturerContactName
=
GetMetadataValue
(
"SampleManufacturerContactName"
);
report
.
SampleManufacturerContactNumber
=
GetMetadataValue
(
"SampleManufacturerContactNumber"
);
report
.
Metadata
[
"SampleManufacturerContactOfficePhone"
]
=
GetMetadataValue
(
"SampleManufacturerContactOfficePhone"
);
report
.
Metadata
[
"SampleManufacturerEmail"
]
=
GetMetadataValue
(
"SampleManufacturerEmail"
);
report
.
SampleManufacturerAddress
=
GetMetadataValue
(
"ManufacturerFullAddress"
);
// 付款单位
report
.
PayerName
=
GetMetadataValue
(
"FullName"
);
// 样品信息
report
.
SampleName
=
GetMetadataValue
(
"SampleName"
);
report
.
SampleModel
=
GetMetadataValue
(
"SampleModel"
);
report
.
SampleBatchNumber
=
GetMetadataValue
(
"SampleBatchNumber"
);
report
.
Metadata
[
"SampleDescriptionEx"
]
=
GetMetadataValue
(
"SampleDescriptionEx"
);
report
.
SampleGrade
=
GetMetadataValue
(
"SampleGrade"
);
report
.
SampleGradeSafety
=
GetMetadataValue
(
"SampleGradeSafety"
);
report
.
Metadata
[
"SampleSelfColor"
]
=
GetMetadataValue
(
"SampleSelfColor"
);
report
.
Metadata
[
"FibreContent"
]
=
GetMetadataValue
(
"FibreContent"
);
report
.
Metadata
[
"TechParameter"
]
=
GetMetadataValue
(
"TechParameter"
);
report
.
SampleQuantityUnit
=
GetMetadataValue
(
"SampleQuantityUnit"
);
// 备注信息
report
.
Remark
=
GetMetadataValue
(
"remark"
);
// 检测项目Kvids - 将字符串格式转换为List<Guid>
var
detectionKvidsStr
=
GetMetadataValue
(
"DetectionKvids"
);
if
(!
string
.
IsNullOrEmpty
(
detectionKvidsStr
))
{
try
{
// 移除开头和结尾的方括号
var
cleanStr
=
detectionKvidsStr
.
Trim
(
'['
,
']'
);
if
(!
string
.
IsNullOrEmpty
(
cleanStr
))
{
// 按逗号分割并转换为Guid列表
report
.
DetectionKvids
=
cleanStr
.
Split
(
','
)
.
Where
(
s
=>
!
string
.
IsNullOrWhiteSpace
(
s
))
.
Select
(
s
=>
Guid
.
Parse
(
s
.
Trim
()))
.
ToList
();
}
else
{
report
.
DetectionKvids
=
new
List
<
Guid
>();
}
}
catch
(
Exception
)
{
// 如果转换失败,设置为空列表
report
.
DetectionKvids
=
new
List
<
Guid
>();
}
}
else
{
report
.
DetectionKvids
=
new
List
<
Guid
>();
}
return
report
;
}
public
object
OnPullThirdReport
()
...
...
@@ -264,6 +345,12 @@ namespace Kivii.OnlineCustomization.Entities
[
ApiMember
(
Description
=
"备注"
)]
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 所要创建的项目的kvid,来源于标准库中的检验项目
/// </summary>
public
List
<
Guid
>
DetectionKvids
{
get
;
set
;
}
public
List
<
string
>
Detections
{
get
;
set
;
}
#
region
创建
/
更新人
[
ApiMember
(
Description
=
"创建人Kvid"
)]
public
Guid
CreatorKvid
{
get
;
set
;
}
...
...
@@ -277,6 +364,7 @@ namespace Kivii.OnlineCustomization.Entities
[
ApiMember
(
Description
=
"更新人"
)]
public
string
UpdaterName
{
get
;
set
;
}
#
endregion
}
public
enum
OrderStatusType
...
...
Src/Extensions/OrderExtension.cs
View file @
a80eddaa
...
...
@@ -27,8 +27,8 @@ namespace Kivii.OnlineCustomization.Extensions
public
static
RestfulQueryResponse
<
OnlineOrder
>
PullOrders
(
this
JsonHttpClient
_client
,
string
apptoken
,
string
appsecret
,
DateTime
?
beginTime
=
null
,
DateTime
?
endTime
=
null
,
int
length
=
200
)
{
(
_client
==
null
).
ThrowIfTrue
(
"PullOrders:请传入_client"
);
(
apptoken
.
IsNullOrEmpty
()).
ThrowIfTrue
(
"PullOrders:请传入apptoken"
);
(
appsecret
.
IsNullOrEmpty
()).
ThrowIfTrue
(
"PullOrders:请传入appsecret"
);
//
(apptoken.IsNullOrEmpty()).ThrowIfTrue("PullOrders:请传入apptoken");
//
(appsecret.IsNullOrEmpty()).ThrowIfTrue("PullOrders:请传入appsecret");
//var client = new JsonServiceClient(baseUrl);
//var timeStamp = GetTimeStamp();
...
...
@@ -37,8 +37,8 @@ namespace Kivii.OnlineCustomization.Extensions
var
getWtsListRequest
=
new
OnlineOrderGetWtsList
();
getWtsListRequest
.
Take
=
length
;
//getWtsListRequest.status = 0;
if
(
beginTime
!=
null
&&
beginTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
BeginTime
=
beginTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)
;
if
(
endTime
!=
null
&&
endTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
EndTime
=
endTime
.
Value
.
ToString
(
"yyyy-MM-dd"
)
;
if
(
beginTime
!=
null
&&
beginTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
BeginTime
=
beginTime
;
if
(
endTime
!=
null
&&
endTime
.
Value
!=
DateTime
.
MinValue
)
getWtsListRequest
.
EndTime
=
endTime
;
var
response
=
_client
.
Get
(
getWtsListRequest
);
return
response
;
...
...
@@ -146,9 +146,9 @@ namespace Kivii.OnlineCustomization.Extensions
continue
;
}
if
(
propertyInfo
.
Name
==
"
Order
Items"
)
if
(
propertyInfo
.
Name
==
"Items"
)
{
var
items
=
item
.
Order
Items
;
var
items
=
item
.
Items
;
if
(
items
.
IsNullOrEmpty
())
items
=
new
List
<
OnlineOrderItem
>();
third
.
Metadata
.
Add
(
propertyInfo
.
Name
,
JsonSerializer
.
SerializeToString
(
items
));
continue
;
...
...
Src/Requests/OrderRequest.cs
View file @
a80eddaa
...
...
@@ -30,9 +30,15 @@ namespace Kivii.OnlineCustomization.Requests
public
string
QueryValues
{
get
;
set
;
}
public
string
BeginTime
{
get
;
set
;
}
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 开始日期
/// </summary>
public
DateTime
?
BeginTime
{
get
;
set
;
}
/// <summary>
/// 结束日期
/// </summary>
public
DateTime
?
EndTime
{
get
;
set
;
}
}
[
Route
(
Configs
.
RouteUpdateWtsResult
)]
...
...
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