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
60cd6048
Commit
60cd6048
authored
Jun 09, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
0305fe6d
3e81b8e5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
407 additions
and
31 deletions
+407
-31
EncryptionHelper.cs
Mall.Common/Encrypt/EncryptionHelper.cs
+25
-25
RB_Finance_Configurine.cs
Mall.Model/Entity/Finance/RB_Finance_Configurine.cs
+4
-0
RB_Goods_OrderAfterSale.cs
Mall.Model/Entity/Product/RB_Goods_OrderAfterSale.cs
+4
-0
RB_Distributor_Remit.cs
Mall.Model/Entity/User/RB_Distributor_Remit.cs
+4
-0
FinanceModule.cs
Mall.Module.Product/FinanceModule.cs
+2
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+147
-0
UserModule.cs
Mall.Module.User/UserModule.cs
+137
-1
ERPOrderCommissionController.cs
...ebApi/Controllers/Finance/ERPOrderCommissionController.cs
+76
-3
FinanceController.cs
Mall.WebApi/Controllers/Finance/FinanceController.cs
+3
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+1
-1
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+1
-0
appsettings.json
Mall.WebApi/appsettings.json
+3
-1
No files found.
Mall.Common/Encrypt/EncryptionHelper.cs
View file @
60cd6048
...
...
@@ -260,6 +260,31 @@ namespace Mall.Common
return
Convert
.
ToBase64String
(
resultArray
,
0
,
resultArray
.
Length
);
}
/// <summary>
/// AES 解密
/// </summary>
/// <param name="str">明文(待解密)</param>
/// <param name="key">密文</param>
/// <returns></returns>
public
static
string
AesDecrypt
(
string
str
,
string
key
)
{
if
(
string
.
IsNullOrEmpty
(
str
))
return
null
;
Byte
[]
toEncryptArray
=
Convert
.
FromBase64String
(
str
);
RijndaelManaged
rm
=
new
RijndaelManaged
{
Key
=
Encoding
.
UTF8
.
GetBytes
(
key
),
Mode
=
CipherMode
.
ECB
,
Padding
=
PaddingMode
.
PKCS7
};
ICryptoTransform
cTransform
=
rm
.
CreateDecryptor
();
Byte
[]
resultArray
=
cTransform
.
TransformFinalBlock
(
toEncryptArray
,
0
,
toEncryptArray
.
Length
);
return
Encoding
.
UTF8
.
GetString
(
resultArray
);
}
/// <summary>
/// AES加密
/// </summary>
...
...
@@ -424,31 +449,6 @@ namespace Mall.Common
return
decrypt
;
}
/// <summary>
/// AES 解密
/// </summary>
/// <param name="str">明文(待解密)</param>
/// <param name="key">密文</param>
/// <returns></returns>
public
static
string
AesDecrypt
(
string
str
,
string
key
)
{
if
(
string
.
IsNullOrEmpty
(
str
))
return
null
;
Byte
[]
toEncryptArray
=
Convert
.
FromBase64String
(
str
);
RijndaelManaged
rm
=
new
RijndaelManaged
{
Key
=
Encoding
.
UTF8
.
GetBytes
(
key
),
Mode
=
CipherMode
.
ECB
,
Padding
=
PaddingMode
.
PKCS7
};
ICryptoTransform
cTransform
=
rm
.
CreateDecryptor
();
Byte
[]
resultArray
=
cTransform
.
TransformFinalBlock
(
toEncryptArray
,
0
,
toEncryptArray
.
Length
);
return
Encoding
.
UTF8
.
GetString
(
resultArray
);
}
#
endregion
#
region
RC2
加密算法
...
...
Mall.Model/Entity/Finance/RB_Finance_Configurine.cs
View file @
60cd6048
...
...
@@ -95,6 +95,10 @@ namespace Mall.Model.Entity.User
set
;
}
/// <summary>
/// 运杂费用id
/// </summary>
public
int
?
ExpensesCostTypeId
{
get
;
set
;
}
/// <summary>
/// RemitCostTypeId
/// </summary>
public
int
?
RemitCostTypeId
...
...
Mall.Model/Entity/Product/RB_Goods_OrderAfterSale.cs
View file @
60cd6048
...
...
@@ -183,5 +183,9 @@ namespace Mall.Model.Entity.Product
/// 商家备注
/// </summary>
public
string
ReRemark
{
get
;
set
;
}
/// <summary>
/// 财务单据id
/// </summary>
public
int
?
FinanceId
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_Remit.cs
View file @
60cd6048
...
...
@@ -158,5 +158,9 @@ namespace Mall.Model.Entity.User
/// 提现订单号
/// </summary>
public
string
OrderNum
{
get
;
set
;
}
/// <summary>
/// 财务单据id
/// </summary>
public
int
?
FinanceId
{
get
;
set
;
}
}
}
Mall.Module.Product/FinanceModule.cs
View file @
60cd6048
...
...
@@ -99,6 +99,7 @@ namespace Mall.Module.Finance
fmodel
.
FreightCostTypeId
,
fmodel
.
RefundCostTypeId
,
fmodel
.
CBCostTypeId
,
fmodel
.
ExpensesCostTypeId
,
fmodel
.
RemitCostTypeId
,
fmodel
.
WorkFlowId
,
fmodel
.
Type
,
...
...
@@ -133,6 +134,7 @@ namespace Mall.Module.Finance
{
nameof
(
RB_Finance_Configurine_Extend
.
FreightCostTypeId
),
demodel
.
FreightCostTypeId
},
{
nameof
(
RB_Finance_Configurine_Extend
.
RefundCostTypeId
),
demodel
.
RefundCostTypeId
},
{
nameof
(
RB_Finance_Configurine_Extend
.
CBCostTypeId
),
demodel
.
CBCostTypeId
},
{
nameof
(
RB_Finance_Configurine_Extend
.
ExpensesCostTypeId
),
demodel
.
ExpensesCostTypeId
},
{
nameof
(
RB_Finance_Configurine_Extend
.
RemitCostTypeId
),
demodel
.
RemitCostTypeId
},
{
nameof
(
RB_Finance_Configurine_Extend
.
WorkFlowId
),
demodel
.
WorkFlowId
},
{
nameof
(
RB_Finance_Configurine_Extend
.
StartTime
),
demodel
.
StartTime
},
...
...
Mall.Module.Product/OrderModule.cs
View file @
60cd6048
...
...
@@ -13,9 +13,12 @@ using Mall.Model.Extend.Product;
using
Mall.Model.Extend.User
;
using
Mall.Repository
;
using
Mall.Repository.BaseSetUp
;
using
Mall.Repository.Finance
;
using
Mall.Repository.MarketingCenter
;
using
Mall.Repository.Product
;
using
Mall.Repository.User
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
using
Newtonsoft.Json
;
namespace
Mall.Module.Product
...
...
@@ -189,6 +192,10 @@ namespace Mall.Module.Product
/// 商品限购区域
/// </summary>
private
readonly
RB_Goods_AreaRepository
goods_AreaRepository
=
new
RB_Goods_AreaRepository
();
/// <summary>
/// 财务单据规则
/// </summary>
private
static
RB_Finance_ConfigurineRepository
financeConfigurineRepository
=
new
RB_Finance_ConfigurineRepository
();
#
region
购物车
...
...
@@ -4461,6 +4468,7 @@ namespace Mall.Module.Product
bool
flag
=
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
OrderRefundFinanceModule
(
model
,
tenantId
,
mallBaseId
);
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
...
...
@@ -4476,6 +4484,145 @@ namespace Mall.Module.Product
return
ApiResult
.
Failed
();
}
/// <summary>
/// 生成退款单据
/// </summary>
/// <returns></returns>
public
bool
OrderRefundFinanceModule
(
RB_Goods_OrderAfterSale
dmodel
,
int
TenantId
,
int
MallBaseId
)
{
var
flag
=
false
;
try
{
decimal
Money
=
dmodel
.
Refund
??
0
;
//查询用户
var
umodel
=
member_UserRepository
.
GetEntity
(
dmodel
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
var
omodel
=
goods_OrderRepository
.
GetEntity
(
dmodel
.
OrderId
);
if
(
omodel
==
null
)
{
return
false
;
}
//先查询规则
var
financeConfigurineList
=
financeConfigurineRepository
.
GetList
(
new
Model
.
Extend
.
Finance
.
RB_Finance_Configurine_Extend
{
Type
=
3
});
string
dstr
=
"已收货,客人付款:"
+
(
dmodel
.
Income
??
0
)
+
"金额,申请退款:"
+
(
dmodel
.
Refund
??
0
);
if
(
financeConfigurineList
!=
null
&&
financeConfigurineList
.
Any
())
{
var
item
=
financeConfigurineList
.
FirstOrDefault
();
var
detailList
=
new
List
<
object
>()
{
new
{
CostTypeId
=
item
.
RemitCostTypeId
,
Number
=
1
,
OriginalMoney
=
Money
,
UnitPrice
=
Money
,
Remark
=
"订单号:"
+
omodel
.
OrderNo
+
"售后单号:"
+
(
dmodel
.
ReOrderNo
??
"暂无"
)
+
" "
+
dstr
}
};
item
.
IsPublic
=
8
;
//默认原路退款
var
financeObj
=
new
{
CreateBy
=
Config
.
NetworkDirector
,
item
.
IsPublic
,
ClientType
=
0
,
ClientID
=
0
,
item
.
CurrencyId
,
WBMoney
=
Money
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
Config
.
RB_Branch_Id
,
TemplateId
=
item
.
WorkFlowId
,
OrderSource
=
16
,
OtherType
=
11
,
ReFinanceId
=
dmodel
.
ReOrderId
,
Remark
=
"名称:"
+
umodel
.
Name
+
"("
+
umodel
.
Id
+
")"
+
" "
+
System
.
DateTime
.
Now
.
ToString
(
"yyyy年MM月dd日"
)
+
"自动生成财务单据"
,
detailList
};
string
sign
=
EncryptionHelper
.
AesEncrypt
(
JsonHelper
.
Serialize
(
financeObj
),
Config
.
FinanceKey
);
var
resultInfo
=
new
{
msg
=
sign
};
string
apiResult
=
Mall
.
Common
.
Plugin
.
HttpHelper
.
HttpPost
(
Config
.
PaymentFinanceApi
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
var
apir
=
JsonConvert
.
DeserializeObject
<
ApiResult
>(
apiResult
);
if
(
apir
.
resultCode
==
1
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReRemark
),
dmodel
.
ReRemark
+
" 自动生成财务退款单据:"
+
apir
.
data
.
ToString
()}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
dmodel
.
ReOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
),
FiledValue
=
dmodel
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
MallBaseId
),
FiledValue
=
dmodel
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"自动生成财务退款单据:"
+
apir
.
data
.
ToString
(),
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
dmodel
.
MallBaseId
,
ReOrderId
=
dmodel
.
ReOrderId
,
TenantId
=
dmodel
.
TenantId
,
Type
=
2
});
}
else
{
//记录自动生成失败,需手动新增财务单据
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_OrderAfterSale
.
ReRemark
),
dmodel
.
ReRemark
+
" 财务单据新增失败,请手动增加"
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
ReOrderId
),
FiledValue
=
dmodel
.
ReOrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
TenantId
),
FiledValue
=
dmodel
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_OrderAfterSale
.
MallBaseId
),
FiledValue
=
dmodel
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_OrderAfterSaleRepository
.
Update
(
keyValues
,
wheres
);
goods_OrderAfterSaleLogRepository
.
Insert
(
new
RB_Goods_OrderAfterSaleLog
()
{
Id
=
0
,
Content
=
"财务单据新增失败,请手动增加"
,
CreateDate
=
DateTime
.
Now
,
MallBaseId
=
dmodel
.
MallBaseId
,
ReOrderId
=
dmodel
.
ReOrderId
,
TenantId
=
dmodel
.
TenantId
,
Type
=
2
});
}
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
);
}
return
flag
;
}
/// <summary>
/// 获取售后订单实体
/// </summary>
...
...
Mall.Module.User/UserModule.cs
View file @
60cd6048
...
...
@@ -18,6 +18,7 @@ using Mall.Common.Enum.User;
using
Mall.Common.API
;
using
Newtonsoft.Json.Linq
;
using
System.Threading
;
using
Mall.Repository.Finance
;
namespace
Mall.Module.User
{
...
...
@@ -118,6 +119,10 @@ namespace Mall.Module.User
/// 和平返佣比例
/// </summary>
private
readonly
RB_Distributor_HPGradeRatioRepository
distributor_HPGradeRatioRepository
=
new
RB_Distributor_HPGradeRatioRepository
();
/// <summary>
/// 财务单据规则
/// </summary>
private
static
RB_Finance_ConfigurineRepository
financeConfigurineRepository
=
new
RB_Finance_ConfigurineRepository
();
#
region
基础配置
...
...
@@ -1694,7 +1699,11 @@ namespace Mall.Module.User
OperatorEnum
=
OperatorEnum
.
Equal
}
};
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//提现审核通过 自动生成财务单据
OrderIncomeFinanceModule
(
remitId
,
Convert
.
ToInt32
(
uid
),
mallBaseId
,
remark
);
}
}
else
if
(
type
==
2
)
{
...
...
@@ -1735,6 +1744,133 @@ namespace Mall.Module.User
return
""
;
}
/// <summary>
/// 生成提现单据
/// </summary>
/// <returns></returns>
public
bool
OrderIncomeFinanceModule
(
int
remitId
,
int
TenantId
,
int
MallBaseId
,
string
remark
)
{
var
flag
=
false
;
try
{
var
remitModel
=
distributor_RemitRepository
.
GetEntity
(
remitId
);
if
(
remitModel
==
null
)
{
return
false
;
}
decimal
Money
=
(
remitModel
.
AppliedMoney
??
0
)
-
(
remitModel
.
Fee
??
0
);
//查询用户
var
umodel
=
member_UserRepository
.
GetEntity
(
remitModel
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
//查询分销商
var
DisModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
remitModel
.
UserId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
DisModel
==
null
)
{
return
false
;
}
//先查询规则
var
financeConfigurineList
=
financeConfigurineRepository
.
GetList
(
new
Model
.
Extend
.
Finance
.
RB_Finance_Configurine_Extend
{
Type
=
4
});
//根据规则中的小程序,查询订单详情信息
string
dstr
=
""
;
if
(
remitModel
.
Fee
>
0
)
{
dstr
=
"申请:"
+
(
remitModel
.
AppliedMoney
??
0
)
+
"金额,手续费:"
+
(
remitModel
.
Fee
??
0
)
+
",实际打款:"
+
Money
;
}
if
(
financeConfigurineList
!=
null
&&
financeConfigurineList
.
Any
())
{
var
item
=
financeConfigurineList
.
FirstOrDefault
();
var
detailList
=
new
List
<
object
>()
{
new
{
CostTypeId
=
item
.
RemitCostTypeId
,
Number
=
1
,
OriginalMoney
=
Money
,
UnitPrice
=
Money
,
Remark
=
"提现单号:"
+(
remitModel
?.
OrderNum
??
"暂无"
)+
" "
+
dstr
}
};
item
.
IsPublic
=
5
;
//默认平台虚拟账户
var
financeObj
=
new
{
CreateBy
=
Config
.
NetworkDirector
,
item
.
IsPublic
,
ClientType
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FinanceSetting"
)[
"RemitTypeId"
]),
ClientID
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FinanceSetting"
)[
"RemitAccountId"
]),
item
.
CurrencyId
,
WBMoney
=
Money
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
Config
.
RB_Branch_Id
,
TemplateId
=
item
.
WorkFlowId
,
OrderSource
=
16
,
OtherType
=
11
,
ReFinanceId
=
remitId
,
Remark
=
"名称:"
+
umodel
.
Name
+
" 姓名:"
+
DisModel
.
Name
+
" 手机:"
+
DisModel
.
Mobile
+
" "
+
System
.
DateTime
.
Now
.
ToString
(
"yyyy年MM月dd日"
)
+
"自动生成财务单据"
,
detailList
};
string
sign
=
EncryptionHelper
.
AesEncrypt
(
JsonHelper
.
Serialize
(
financeObj
),
Config
.
FinanceKey
);
var
resultInfo
=
new
{
msg
=
sign
};
string
apiResult
=
Mall
.
Common
.
Plugin
.
HttpHelper
.
HttpPost
(
Config
.
PaymentFinanceApi
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
var
apir
=
JsonConvert
.
DeserializeObject
<
ApiResult
>(
apiResult
);
if
(
apir
.
resultCode
==
1
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
FinanceId
),
Convert
.
ToInt32
(
apir
.
data
.
ToString
())},
{
nameof
(
RB_Distributor_Remit
.
AuditRemark
),
remark
+
" 自动生成财务单据:"
+
apir
.
data
.
ToString
()},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Remit
.
Id
),
FiledValue
=
remitId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
//记录自动生成失败,需手动新增财务单据
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
AuditRemark
),
remark
+
" 自动生成财务单据失败,请手动添加财务单据!"
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Remit
.
Id
),
FiledValue
=
remitId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
}
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
);
}
return
flag
;
}
/// <summary>
/// 设置打款备注
/// </summary>
/// <param name="remitId"></param>
/// <param name="remark"></param>
/// <returns></returns>
public
bool
SetDistributorRemitRemark
(
int
remitId
,
string
remark
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Remit
.
RemitRemark
),
remark
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Remit
.
Id
),
FiledValue
=
remitId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 分销提现列表
/// </summary>
...
...
Mall.WebApi/Controllers/Finance/ERPOrderCommissionController.cs
View file @
60cd6048
...
...
@@ -19,6 +19,7 @@ using Microsoft.Extensions.Configuration;
using
Microsoft.Extensions.Configuration.Json
;
using
Mall.Model.Extend.Product
;
using
Mall.Module.Product
;
using
Microsoft.AspNetCore.Http
;
namespace
Mall.WebApi.Controllers.Finance
{
...
...
@@ -28,6 +29,17 @@ namespace Mall.WebApi.Controllers.Finance
[
EnableCors
(
"AllowCors"
)]
public
class
ERPOrderCommissionController
:
ControllerBase
{
private
readonly
IHttpContextAccessor
_accessor
;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="accessor"></param>
public
ERPOrderCommissionController
(
IHttpContextAccessor
accessor
)
{
_accessor
=
accessor
;
}
private
readonly
UserModule
userModule
=
new
UserModule
();
private
readonly
OrderModule
orderModule
=
new
OrderModule
();
...
...
@@ -40,9 +52,6 @@ namespace Mall.WebApi.Controllers.Finance
[
HttpPost
]
public
ApiResult
GetDistributionCommissionPageList
(
object
request
)
{
//处理数据
//byte[] data = System.Text.ASCIIEncoding.ASCII.GetBytes(request.ToString());
//var parms = System.Text.ASCIIEncoding.ASCII.GetString(Mall.Common.Plugin.RSAHelper.DecryptData(data));
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
request
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
RB_Member_User_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Member_User_Extend
>(
requestParm
.
msg
.
ToString
());
...
...
@@ -107,5 +116,69 @@ namespace Mall.WebApi.Controllers.Finance
}
#
endregion
#
region
erp
打款回调
/// <summary>
/// 分销提现申请审核
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetDistributorRemit
(
object
request
)
{
var
re
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
request
.
ToString
());
var
parms
=
JObject
.
Parse
(
re
.
msg
.
ToString
());
int
RemitId
=
parms
.
GetInt
(
"RemitId"
,
0
);
string
Remark
=
parms
.
GetStringValue
(
"Remark"
);
if
(
RemitId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递分销提现id"
);
}
var
model
=
userModule
.
GetDistributorEntity
(
RemitId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"该提现不存在,请核实后再试"
);
}
if
(
model
.
TenantId
!=
Convert
.
ToInt32
(
re
.
uid
))
{
return
ApiResult
.
Failed
(
"未查询到提现信息"
);
}
if
(
model
.
MallBaseId
!=
re
.
MallBaseId
)
{
return
ApiResult
.
Failed
(
"未查询到提现信息"
);
}
if
(
model
.
AuditStatus
!=
Common
.
Enum
.
User
.
DistributorRemitAuditStatusEnum
.
ToPlayWith
)
{
return
ApiResult
.
Failed
(
"状态不对,请核实后再试"
);
}
//执行发放金额
if
(
model
.
WithdrawalWay
==
DistrbutorWithdrawWayEnum
.
ZDDK
)
{
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
,
2
,
Remark
,
re
.
uid
,
re
.
MallBaseId
);
if
(
msg1
!=
""
)
{
LogHelper
.
Write
(
"提现:"
+
RemitId
+
",失败"
);
}
return
ApiResult
.
Success
();
}
else
{
userModule
.
SetDistributorRemitRemark
(
RemitId
,
"ERP打款失败,请手动操作打款"
);
return
ApiResult
.
Failed
(
"支付失败"
);
}
}
else
{
return
ApiResult
.
Failed
(
"暂不支持该类型打款"
);
}
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Finance/FinanceController.cs
View file @
60cd6048
...
...
@@ -100,6 +100,9 @@ namespace Mall.WebApi.Controllers.Finance
{
return
ApiResult
.
Failed
(
"请选择成本费用类型"
);
}
if
((
demodel
.
ExpensesCostTypeId
??
0
)
<=
0
)
{
return
ApiResult
.
Failed
(
"请选择运杂费用类型"
);
}
}
else
if
(
demodel
.
Type
==
3
)
{
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
60cd6048
...
...
@@ -175,7 +175,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
Recycled
=
1
;
demodel
.
Recycled
=
2
;
if
(
demodel
.
OrderStatus
==
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
WaitSendGoods
)
{
demodel
.
OrderStatusIds
=
"2,6"
;
//待处理也是待发货状态才有的
demodel
.
OrderStatus
=
0
;
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
60cd6048
...
...
@@ -1183,6 +1183,7 @@ namespace Mall.WebApi.Controllers.MallBase
VoucherList
=
string
.
IsNullOrEmpty
(
x
.
Voucher
)?
new
List
<
string
>()
:
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
Voucher
),
x
.
ReOrderStatus
,
ReOrderStatusName
=
x
.
ReOrderStatus
.
GetEnumName
(),
x
.
ReRemark
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
...
...
Mall.WebApi/appsettings.json
View file @
60cd6048
...
...
@@ -43,7 +43,9 @@
"FileService"
:
"2"
,
"FinanceSetting"
:
{
"TenantId"
:
1
,
"MallBaseId"
:
1
"MallBaseId"
:
1
,
"RemitTypeId"
:
10
,
"RemitAccountId"
:
3012
},
"InitializeImages"
:
{
"GradeEntranceImage"
:
"1234566778"
...
...
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