Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Third.Bestseller.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.Bestseller.V4.5
Commits
1306443d
Commit
1306443d
authored
Oct 29, 2024
by
Neo Turing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
78eaef0d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
22 deletions
+31
-22
BestsellerBase.cs
Src/Entities/BestsellerBase.cs
+9
-9
OrderExtension.cs
Src/Extensions/OrderExtension.cs
+12
-3
OrderJob.cs
Src/Jobs/OrderJob.cs
+8
-8
AssemblyInfo.cs
Src/Properties/AssemblyInfo.cs
+2
-2
No files found.
Src/Entities/BestsellerBase.cs
View file @
1306443d
...
...
@@ -49,7 +49,7 @@ namespace Kivii.Third.Bestseller.Entities
rtns
.
PayerName
=
order
.
PAYER_ORG_NAME
;
rtns
.
SampleName
=
order
.
SAMPLE_NAME
;
rtns
.
SampleName
=
order
.
PRD_NAME_CN
;
//order.
SAMPLE_NAME;
rtns
.
SampleBrand
=
order
.
BRAND_DISPLAY
;
rtns
.
SampleGradeSafety
=
order
.
CHECK_LEVEL_DISPLAY
;
rtns
.
SampleGrade
=
order
.
SAMPLE_GRADE_DISPLAY
;
...
...
@@ -110,14 +110,14 @@ namespace Kivii.Third.Bestseller.Entities
var
results
=
response
.
data
.
results
.
AcceptThirdContractOrder
(
Guid
.
Parse
(
Configs
.
_ownerKvid
),
Configs
.
_ownerName
,
conn
);
try
{
foreach
(
var
item
in
results
)
{
client
.
AcceptOrderConfirm
(
Configs
.
_token
,
Configs
.
_secret
,
item
.
SerialNumber
);
}
}
catch
{
}
//
try
//
{
//
foreach (var item in results)
//
{
//
client.AcceptOrderConfirm(Configs._token, Configs._secret, item.SerialNumber);
//
}
//
}
//
catch { }
rtns
.
Results
.
AddRange
(
results
);
rtns
.
Total
=
rtns
.
Results
.
Count
;
...
...
Src/Extensions/OrderExtension.cs
View file @
1306443d
...
...
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using
System.Data
;
using
System.Globalization
;
using
System.Linq
;
using
System.Net.Sockets
;
using
System.Security.Cryptography
;
using
System.Text
;
using
System.Threading
;
...
...
@@ -73,11 +74,11 @@ namespace Kivii.Third.Bestseller.Extensions
/// <param name="appsecret"></param>
/// <param name="orderNo"></param>
/// <returns></returns>
public
static
OrderResponse
AcceptOrderConfirm
(
this
JsonHttpClient
_client
,
string
apptoken
,
string
appsecret
,
string
orderNo
)
public
static
OrderResponse
AcceptOrderConfirm
(
this
JsonHttpClient
_client
,
string
orderNo
,
string
apptoken
=
null
,
string
appsecret
=
null
)
{
(
_client
==
null
).
ThrowIfTrue
(
"AcceptOrderConfirm:请传入_client"
);
(
apptoken
.
IsNullOrEmpty
())
.
ThrowIfTrue
(
"AcceptOrderConfirm:请传入apptoken"
);
(
appsecret
.
IsNullOrEmpty
())
.
ThrowIfTrue
(
"AcceptOrderConfirm:请传入appsecret"
);
if
(
apptoken
.
IsNullOrEmpty
())
apptoken
=
Configs
.
_token
;
//
.ThrowIfTrue("AcceptOrderConfirm:请传入apptoken");
if
(
appsecret
.
IsNullOrEmpty
())
appsecret
=
Configs
.
_secret
;
//
.ThrowIfTrue("AcceptOrderConfirm:请传入appsecret");
(
orderNo
.
IsNullOrEmpty
()).
ThrowIfTrue
(
"AcceptOrderConfirm:请传入orderNo"
);
//var client = new JsonServiceClient(baseUrl);
...
...
@@ -301,6 +302,8 @@ namespace Kivii.Third.Bestseller.Extensions
var
allReports
=
conn
.
Select
(
queryReports
);
if
(
allReports
.
IsNullOrEmpty
())
return
;
var
client
=
new
JsonHttpClient
(
Configs
.
_defaultUrl
);
foreach
(
var
third
in
thirds
)
{
var
reports
=
allReports
.
Where
(
o
=>
o
.
BizId
==
third
.
SerialNumber
).
ToList
();
...
...
@@ -359,6 +362,12 @@ namespace Kivii.Third.Bestseller.Extensions
third
.
IsAccepted
=
true
;
third
.
AddOnlyProperties
(
o
=>
o
.
IsAccepted
);
conn
.
UpdateOnly
(
third
);
try
{
client
.
AcceptOrderConfirm
(
third
.
SerialNumber
,
Configs
.
_token
,
Configs
.
_secret
);
}
catch
{
}
}
}
...
...
Src/Jobs/OrderJob.cs
View file @
1306443d
...
...
@@ -69,14 +69,14 @@ namespace Kivii.Third.Bestseller.Jobs
var
results
=
response
.
data
.
results
.
AcceptThirdContractOrder
(
ownerKvid
,
ownerName
,
conn
);
TaskContext
.
Message
=
$"新增
{
results
.
Count
}
条!"
;
try
{
foreach
(
var
item
in
results
)
{
client
.
AcceptOrderConfirm
(
token
,
secret
,
item
.
SerialNumber
);
}
}
catch
{
}
//
try
//
{
//
foreach (var item in results)
//
{
//
client.AcceptOrderConfirm(token, secret, item.SerialNumber);
//
}
//
}
//
catch { }
return
true
;
}
catch
(
Exception
ex
)
...
...
Src/Properties/AssemblyInfo.cs
View file @
1306443d
...
...
@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.102
2
0")]
[assembly: AssemblyFileVersion("5.4.2024.102
2
0")]
[assembly: AssemblyVersion("5.4.2024.102
8
0")]
[assembly: AssemblyFileVersion("5.4.2024.102
8
0")]
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