Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
Njzj.Biz.Bocoms.Openapis.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
陶然
Njzj.Biz.Bocoms.Openapis.V4.5
Commits
ad45c2a5
Commit
ad45c2a5
authored
Jan 05, 2024
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
a4129a2c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
0 deletions
+76
-0
RestfulMpng.cs
RestfulMpng.cs
+76
-0
No files found.
RestfulMpng.cs
View file @
ad45c2a5
...
@@ -216,4 +216,80 @@ namespace Njzj.Bocoms.Openapis
...
@@ -216,4 +216,80 @@ namespace Njzj.Bocoms.Openapis
return
rtns
;
return
rtns
;
}
}
}
}
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
public
class
ReceiveCodeDelete
:
RestfulExecution
<
ReceiveCode
>
{
public
string
PayMerTranNo
{
get
;
set
;
}
public
List
<
string
>
PayMerTranNos
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
{
(
PayMerTranNo
.
IsNullOrEmpty
()
&&
PayMerTranNos
.
IsNullOrEmpty
()).
ThrowIfTrue
(
"请传入订单号!"
);
if
(
PayMerTranNos
.
IsNullOrEmpty
())
PayMerTranNos
=
new
List
<
string
>();
if
(!
PayMerTranNos
.
IsNullOrEmpty
())
PayMerTranNos
.
Add
(
PayMerTranNo
);
var
rtns
=
new
RestfulExecutionResponse
<
ReceiveCode
>();
rtns
.
Results
=
new
List
<
ReceiveCode
>();
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
ReceiveCode
>();
var
existCodes
=
conn
.
Select
<
ReceiveCode
>(
o
=>
Sql
.
In
(
o
.
pay_mer_tran_no
,
PayMerTranNos
));
if
(!
existCodes
.
IsNullOrEmpty
())
{
foreach
(
var
existCode
in
existCodes
)
{
if
(
existCode
.
tran_state
.
ToUpper
()
!=
"SUCCESS"
)
//查出来已经成功付款了 直接返回
{
try
{
var
order
=
Extension
.
GetReceiveCodeOrder
(
existCode
.
pay_mer_tran_no
);
if
(
order
.
rsp_body
.
tran_state
.
ToUpper
()
==
"SUCCESS"
)
//成功付款的情况
{
existCode
.
tran_state
=
order
.
rsp_body
.
tran_state
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
tran_state
);
existCode
.
tran_state_code
=
order
.
rsp_body
.
tran_state_code
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
tran_state_code
);
existCode
.
tran_state_msg
=
order
.
rsp_body
.
tran_state_msg
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
tran_state_msg
);
existCode
.
mer_memo
=
order
.
rsp_body
.
mer_memo
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
mer_memo
);
existCode
.
total_amount
=
order
.
rsp_body
.
total_amount
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
total_amount
);
existCode
.
order_status
=
order
.
rsp_body
.
order_status
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
order_status
);
existCode
.
tran_content
=
order
.
rsp_body
.
tran_content
;
existCode
.
AddOnlyProperties
(
o
=>
o
.
tran_content
);
conn
.
UpdateOnly
(
existCode
);
existCode
.
RemoveAllOnlyProperties
();
var
th
=
KiviiContext
.
NewThread
(()
=>
{
existCode
.
ReceiveCodePaied
();
});
th
.
Start
();
throw
new
Exception
(
"存在账单已经支付完成"
);
}
else
if
(
order
.
rsp_body
.
tran_state
.
ToUpper
()
==
"PROCESS"
)
//仍然在操作中的情况
{
existCode
.
ReceiveCodeDelete
();
//超过6分钟 二维码已经过期,直接删除
rtns
.
Results
.
Add
(
existCode
);
}
else
//失败的情况
{
existCode
.
ReceiveCodeDelete
();
//超过6分钟 二维码已经过期,直接删除
rtns
.
Results
.
Add
(
existCode
);
}
}
catch
(
Exception
ex
)
{
//existCode.ReceiveCodeDelete();
//rtns.Results.Add(existCode);
throw
ex
;
}
}
}
}
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