Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
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
黄奎
mall.oytour.com
Commits
8cf94c51
Commit
8cf94c51
authored
Jun 18, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增强制取消接口
parent
1870eeaf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
315 additions
and
5 deletions
+315
-5
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+234
-4
UserModule.cs
Mall.Module.User/UserModule.cs
+1
-1
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+80
-0
No files found.
Mall.Module.Product/OrderModule.cs
View file @
8cf94c51
This diff is collapsed.
Click to expand it.
Mall.Module.User/UserModule.cs
View file @
8cf94c51
...
...
@@ -1919,7 +1919,7 @@ namespace Mall.Module.User
}
};
bool
flag
=
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
if
(
flag
&&
uid
==
"1"
)
{
//提现审核通过 自动生成财务单据
OrderIncomeFinanceModule
(
remitId
,
Convert
.
ToInt32
(
uid
),
mallBaseId
,
remark
);
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
8cf94c51
...
...
@@ -538,6 +538,86 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 后台订单强制取消
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderForcedToCancel
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
//string Remark = parms.GetStringValue("Remark");
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
omodel
=
orderModule
.
GetOrderInfo
(
OrderId
);
if
(
omodel
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在"
);
}
if
(
omodel
.
Status
==
1
)
{
return
ApiResult
.
Failed
(
"订单已删除"
);
}
if
(
omodel
.
Recycled
==
1
)
{
return
ApiResult
.
Failed
(
"订单已进入回收站无法操作"
);
}
if
(
omodel
.
OrderStatus
!=
OrderStatusEnum
.
NonPayment
&&
omodel
.
OrderStatus
!=
OrderStatusEnum
.
WaitSendGoods
)
{
return
ApiResult
.
Failed
(
"该订单已无法取消"
);
}
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
if
(
IsNormalServer
==
1
&&
omodel
.
OrderStatus
==
OrderStatusEnum
.
WaitSendGoods
)
{
//获取小程序信息
var
mallModel
=
orderModule
.
GetMiniProgramExtend
(
req
.
MallBaseId
);
int
RefundNum
=
orderModule
.
GetOrderRefundOnlineTradeNum
(
OrderId
,
req
.
TenantId
,
req
.
MallBaseId
);
string
RefundOrderNo
=
omodel
.
OrderNo
+
(
RefundNum
+
1
);
var
pram
=
new
Common
.
Pay
.
WeChatPat
.
PayParam
()
{
TotalFee
=
Convert
.
ToInt32
((
omodel
.
Income
??
0
)
*
100
),
RefundFee
=
Convert
.
ToInt32
((
omodel
.
Income
??
0
)
*
100
),
OrderNumber
=
omodel
.
MerchantsNo
,
RefundNumber
=
RefundOrderNo
};
var
Robj
=
new
App_Code
.
PayUtil
().
Refund
(
pram
,
mallModel
,
_accessor
);
if
(
Robj
.
IsSuccess
)
{
bool
flag
=
orderModule
.
SetOrderForcedToCancel
(
omodel
,
RefundOrderNo
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
else
{
LogHelper
.
Write
(
JsonConvert
.
SerializeObject
(
Robj
));
return
ApiResult
.
Failed
();
}
}
else
{
bool
flag
=
orderModule
.
SetOrderForcedToCancel
(
omodel
,
""
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
}
/// <summary>
/// 修改订单明细价格
/// </summary>
...
...
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