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
610a5491
Commit
610a5491
authored
Jun 12, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加正式服务掉退款接口控制
parent
b22dc6fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
287 additions
and
46 deletions
+287
-46
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+166
-5
ERPOrderCommissionController.cs
...ebApi/Controllers/Finance/ERPOrderCommissionController.cs
+22
-10
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+75
-23
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+23
-8
appsettings.json
Mall.WebApi/appsettings.json
+1
-0
No files found.
Mall.Module.Product/OrderModule.cs
View file @
610a5491
This diff is collapsed.
Click to expand it.
Mall.WebApi/Controllers/Finance/ERPOrderCommissionController.cs
View file @
610a5491
...
@@ -158,23 +158,35 @@ namespace Mall.WebApi.Controllers.Finance
...
@@ -158,23 +158,35 @@ namespace Mall.WebApi.Controllers.Finance
//执行发放金额
//执行发放金额
if
(
model
.
WithdrawalWay
==
DistrbutorWithdrawWayEnum
.
ZDDK
)
if
(
model
.
WithdrawalWay
==
DistrbutorWithdrawWayEnum
.
ZDDK
)
{
{
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
MallBaseId
);
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
model
.
UserId
??
0
);
if
(
IsNormalServer
==
1
)
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
(
model
.
OrderNum
,
model
.
RemitMoney
??
0
,
(
model
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
);
if
(
flag
)
{
{
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
MallBaseId
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
model
.
UserId
??
0
);
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
(
model
.
OrderNum
,
model
.
RemitMoney
??
0
,
(
model
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
);
if
(
flag
)
{
string
msg1
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
2
,
Remark
,
TenantId
.
ToString
(),
MallBaseId
);
if
(
msg1
!=
""
)
{
LogHelper
.
Write
(
"提现:"
+
RemitId
+
",失败"
);
}
return
ApiResult
.
Success
();
}
else
{
userModule
.
SetDistributorRemitRemark
(
RemitId
,
"ERP打款失败,请手动操作打款"
);
return
ApiResult
.
Failed
(
"支付失败"
);
}
}
else
{
string
msg1
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
2
,
Remark
,
TenantId
.
ToString
(),
MallBaseId
);
string
msg1
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
2
,
Remark
,
TenantId
.
ToString
(),
MallBaseId
);
if
(
msg1
!=
""
)
if
(
msg1
!=
""
)
{
{
LogHelper
.
Write
(
"提现:"
+
RemitId
+
",失败"
);
return
ApiResult
.
Failed
(
"提现:"
+
RemitId
+
",失败"
);
}
}
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
userModule
.
SetDistributorRemitRemark
(
RemitId
,
"ERP打款失败,请手动操作打款"
);
return
ApiResult
.
Failed
(
"支付失败"
);
}
}
}
else
else
{
{
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
610a5491
...
@@ -17,6 +17,8 @@ using Mall.Common;
...
@@ -17,6 +17,8 @@ using Mall.Common;
using
Mall.Module.Product
;
using
Mall.Module.Product
;
using
Mall.Common.Enum.Goods
;
using
Mall.Common.Enum.Goods
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
namespace
Mall.WebApi.Controllers.MallBase
namespace
Mall.WebApi.Controllers.MallBase
{
{
...
@@ -665,14 +667,48 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -665,14 +667,48 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
omodel
.
IsApplyForCancel
!=
1
)
{
if
(
omodel
.
IsApplyForCancel
!=
1
)
{
return
ApiResult
.
Failed
(
"该订单未申请取消该订单"
);
return
ApiResult
.
Failed
(
"该订单未申请取消该订单"
);
}
}
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
bool
flag
=
orderModule
.
SetOrderApplyForCancelAudit
(
omodel
,
Type
,
Remark
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
Type
==
1
&&
IsNormalServer
==
1
)
if
(
flag
)
{
{
return
ApiResult
.
Success
();
//获取小程序信息
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
=
(
omodel
.
Income
??
0
),
OrderNumber
=
omodel
.
MerchantsNo
,
RefundNumber
=
RefundOrderNo
};
var
Robj
=
new
App_Code
.
PayUtil
().
Refund
(
pram
,
mallModel
,
_accessor
);
if
(
Robj
.
IsSuccess
)
{
bool
flag
=
orderModule
.
SetOrderApplyForCancelAudit
(
omodel
,
Type
,
Remark
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
else
{
return
ApiResult
.
Failed
();
}
}
}
else
{
else
return
ApiResult
.
Failed
();
{
bool
flag
=
orderModule
.
SetOrderApplyForCancelAudit
(
omodel
,
Type
,
Remark
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
}
}
}
...
@@ -1418,27 +1454,43 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1418,27 +1454,43 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
orderModel
==
null
)
{
if
(
orderModel
==
null
)
{
return
ApiResult
.
Failed
(
"未查询到订单信息"
);
return
ApiResult
.
Failed
(
"未查询到订单信息"
);
}
}
//获取小程序信息
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
var
mallModel
=
orderModule
.
GetMiniProgramExtend
(
req
.
MallBaseId
);
if
(
IsNormalServer
==
1
)
int
RefundNum
=
orderModule
.
GetOrderRefundOnlineTradeNum
(
ReModel
.
OrderId
??
0
,
req
.
TenantId
,
req
.
MallBaseId
);
string
RefundOrderNo
=
orderModel
.
OrderNo
+
(
RefundNum
+
1
);
var
pram
=
new
Common
.
Pay
.
WeChatPat
.
PayParam
()
{
{
TotalFee
=
Convert
.
ToInt32
(
Refund
*
100
),
//获取小程序信息
RefundFee
=
Refund
,
var
mallModel
=
orderModule
.
GetMiniProgramExtend
(
req
.
MallBaseId
);
OrderNumber
=
orderModel
.
MerchantsNo
,
int
RefundNum
=
orderModule
.
GetOrderRefundOnlineTradeNum
(
ReModel
.
OrderId
??
0
,
req
.
TenantId
,
req
.
MallBaseId
);
RefundNumber
=
RefundOrderNo
string
RefundOrderNo
=
orderModel
.
OrderNo
+
(
RefundNum
+
1
);
};
var
pram
=
new
Common
.
Pay
.
WeChatPat
.
PayParam
()
var
Robj
=
new
App_Code
.
PayUtil
().
Refund
(
pram
,
mallModel
,
_accessor
);
{
if
(
Robj
.
IsSuccess
)
{
TotalFee
=
Convert
.
ToInt32
(
Refund
*
100
),
RefundFee
=
Refund
,
OrderNumber
=
orderModel
.
MerchantsNo
,
RefundNumber
=
RefundOrderNo
};
var
Robj
=
new
App_Code
.
PayUtil
().
Refund
(
pram
,
mallModel
,
_accessor
);
if
(
Robj
.
IsSuccess
)
{
bool
flag
=
orderModule
.
SetOrderAfterSaleForRefunds
(
ReOrderId
,
Refund
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
==
false
)
{
//日志记录
LogHelper
.
Write
(
"售后订单:"
+
ReOrderId
+
",金额:"
+
Refund
+
" 退款记录失败"
);
}
return
ApiResult
.
Success
(
""
);
}
return
ApiResult
.
Failed
();
}
else
{
bool
flag
=
orderModule
.
SetOrderAfterSaleForRefunds
(
ReOrderId
,
Refund
,
req
.
TenantId
,
req
.
MallBaseId
);
bool
flag
=
orderModule
.
SetOrderAfterSaleForRefunds
(
ReOrderId
,
Refund
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
==
false
)
{
if
(
flag
)
//日志记录
{
LogHelper
.
Write
(
"售后订单:"
+
ReOrderId
+
",金额:"
+
Refund
+
" 退款记录失败"
);
return
ApiResult
.
Success
(
""
);
}
else
{
return
ApiResult
.
Failed
();
}
}
return
ApiResult
.
Success
(
""
);
}
}
return
ApiResult
.
Failed
();
}
}
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
610a5491
...
@@ -16,6 +16,8 @@ using Newtonsoft.Json.Linq;
...
@@ -16,6 +16,8 @@ using Newtonsoft.Json.Linq;
using
Mall.Common
;
using
Mall.Common
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
namespace
Mall.WebApi.Controllers.User
namespace
Mall.WebApi.Controllers.User
{
{
...
@@ -1813,21 +1815,34 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1813,21 +1815,34 @@ namespace Mall.WebApi.Controllers.User
//执行发放金额
//执行发放金额
if
(
model
.
WithdrawalWay
==
DistrbutorWithdrawWayEnum
.
ZDDK
)
if
(
model
.
WithdrawalWay
==
DistrbutorWithdrawWayEnum
.
ZDDK
)
{
{
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
re
.
MallBaseId
);
int
IsNormalServer
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"IsNormalServer"
).
Value
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
model
.
UserId
??
0
);
if
(
IsNormalServer
==
1
)
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
(
model
.
OrderNum
,
model
.
RemitMoney
??
0
,
(
model
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
);
if
(
flag
)
{
{
var
mallModel
=
userModule
.
GetMiniProgramExtend
(
re
.
MallBaseId
);
var
umodel
=
userModule
.
GetMemberUserInfo
(
model
.
UserId
??
0
);
var
flag
=
App_Code
.
PayUtil
.
GetTransfersOrder
(
model
.
OrderNum
,
model
.
RemitMoney
??
0
,
(
model
.
UserId
??
0
).
ToString
(),
umodel
.
OpenId
,
mallModel
,
_accessor
);
if
(
flag
)
{
string
msg1
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
Type
,
Remark
,
re
.
uid
,
re
.
MallBaseId
);
if
(
msg1
!=
""
)
{
LogHelper
.
Write
(
"提现:"
+
RemitId
+
",失败"
);
}
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
"支付失败"
);
}
}
else
{
string
msg1
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
Type
,
Remark
,
re
.
uid
,
re
.
MallBaseId
);
string
msg1
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
Type
,
Remark
,
re
.
uid
,
re
.
MallBaseId
);
if
(
msg1
!=
""
)
if
(
msg1
!=
""
)
{
{
LogHelper
.
Write
(
"提现:"
+
RemitId
+
",失败"
);
return
ApiResult
.
Failed
(
"提现:"
+
RemitId
+
",失败"
);
}
}
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
return
ApiResult
.
Failed
(
"支付失败"
);
}
}
}
else
else
{
{
...
...
Mall.WebApi/appsettings.json
View file @
610a5491
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
},
},
"VirtualDirectory"
:
"WebFile"
,
"VirtualDirectory"
:
"WebFile"
,
"FileService"
:
"2"
,
"FileService"
:
"2"
,
"IsNormalServer"
:
2
,
"FinanceSetting"
:
{
"FinanceSetting"
:
{
"TenantId"
:
1
,
"TenantId"
:
1
,
"MallBaseId"
:
1
,
"MallBaseId"
:
1
,
...
...
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