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
07f2c83a
Commit
07f2c83a
authored
Jun 08, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
a17caffb
c4396400
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
445 additions
and
17 deletions
+445
-17
RB_Goods_OrderCommission_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderCommission_Extend.cs
+8
-0
RB_Member_User_Extend.cs
Mall.Model/Extend/User/RB_Member_User_Extend.cs
+5
-0
MiniprogramTemplateModule.cs
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
+1
-1
FinanceModule.cs
Mall.Module.Product/FinanceModule.cs
+7
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+104
-0
UserModule.cs
Mall.Module.User/UserModule.cs
+122
-15
RB_FinancialInstitutionsRepository.cs
....Repository/Finance/RB_FinancialInstitutionsRepository.cs
+3
-0
RB_Goods_OrderCommissionRepository.cs
....Repository/Product/RB_Goods_OrderCommissionRepository.cs
+70
-0
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+3
-0
ERPOrderCommissionController.cs
...ebApi/Controllers/Finance/ERPOrderCommissionController.cs
+111
-0
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+1
-1
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+3
-0
Startup.cs
Mall.WebApi/Startup.cs
+3
-0
appsettings.json
Mall.WebApi/appsettings.json
+4
-0
No files found.
Mall.Model/Extend/Product/RB_Goods_OrderCommission_Extend.cs
View file @
07f2c83a
...
...
@@ -34,6 +34,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
string
Mobile
{
get
;
set
;
}
/// <summary>
/// 用户头像
/// </summary>
public
string
Photo
{
get
;
set
;
}
/// <summary>
/// 等级描述
/// </summary>
public
string
GradeDescription
{
get
;
set
;
}
...
...
@@ -45,5 +49,9 @@ namespace Mall.Model.Extend.Product
/// 订单明细列表
/// </summary>
public
List
<
RB_Goods_OrderDetail_Extend
>
OrderDetailList
{
get
;
set
;
}
/// <summary>
/// 待返佣金额
/// </summary>
public
decimal
WaitCommission
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Member_User_Extend.cs
View file @
07f2c83a
...
...
@@ -58,6 +58,11 @@ namespace Mall.Model.Extend.User
/// </summary>
public
decimal
Price
{
get
;
set
;
}
/// <summary>
/// 待结算
/// </summary>
public
decimal
WaitCommission
{
get
;
set
;
}
/// <summary>
/// 总佣金
/// </summary>
...
...
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
View file @
07f2c83a
...
...
@@ -154,7 +154,7 @@ namespace Mall.Module.MarketingCenter
item
.
data
=
new
rubikItem
()
{
hotspot
=
new
List
<
hotspotItem
>(),
list
=
new
List
<
rubikDetailItem
>()
{
new
rubikDetailItem
()
{
link
=
new
List
<
rubikLinkItem
>()
}
},
list
=
new
List
<
rubikDetailItem
>()
{
new
rubikDetailItem
()
{
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()}
}
},
};
}
break
;
...
...
Mall.Module.Product/FinanceModule.cs
View file @
07f2c83a
...
...
@@ -63,6 +63,11 @@ namespace Mall.Module.Finance
};
}
else
{
int
TypeId
=
0
;
if
(
fmodel
.
Type
==
1
)
{
var
backModel
=
backAccountRepository
.
GetAccountList
(
new
RB_BackAccount_Extend
()
{
BankType
=
fmodel
.
AccountType
,
ID
=
fmodel
.
AccountId
??
0
,
RB_Group_Id
=
2
}).
FirstOrDefault
();
TypeId
=
backModel
?.
TypeId
??
0
;
}
return
new
{
Status
=
2
,
...
...
@@ -70,6 +75,7 @@ namespace Mall.Module.Finance
{
fmodel
.
Id
,
fmodel
.
IsPublic
,
TypeId
,
fmodel
.
AccountType
,
fmodel
.
AccountId
,
fmodel
.
RemitterName
,
...
...
@@ -180,6 +186,7 @@ namespace Mall.Module.Finance
return
list
.
Select
(
x
=>
new
{
Id
=
x
.
ID
,
x
.
IsPublic
,
x
.
Name
});
}
...
...
Mall.Module.Product/OrderModule.cs
View file @
07f2c83a
...
...
@@ -3969,12 +3969,116 @@ namespace Mall.Module.Product
}
}
var
HpgradeList
=
new
List
<
RB_Distributor_HPGradeInfo_Extend
>();
if
(
oclist
.
Where
(
x
=>
x
.
Type
==
2
).
Any
())
{
string
gradeIds
=
string
.
Join
(
","
,
oclist
.
Where
(
x
=>
x
.
Type
==
2
).
Select
(
x
=>
x
.
Grade
).
Distinct
());
HpgradeList
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
GradeIds
=
gradeIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
},
true
);
}
foreach
(
var
item
in
oclist
)
{
var
umodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
item
.
UserId
).
FirstOrDefault
();
item
.
UserName
=
umodel
?.
Name
??
""
;
item
.
Mobile
=
umodel
?.
Moblie
??
""
;
item
.
Photo
=
umodel
?.
Photo
??
""
;
item
.
OrderDetailList
=
dlist
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
ToList
();
if
(
item
.
Type
==
1
)
{
if
(
item
.
Grade
==
0
)
{
item
.
GradeDescription
=
"自购返利"
;
}
else
if
(
item
.
Grade
==
1
)
{
item
.
GradeDescription
=
"一级佣金"
;
}
else
if
(
item
.
Grade
==
2
)
{
item
.
GradeDescription
=
"二级佣金"
;
}
else
if
(
item
.
Grade
==
3
)
{
item
.
GradeDescription
=
"三级佣金"
;
}
}
else
if
(
item
.
Type
==
2
)
{
var
hpGModel
=
HpgradeList
.
Where
(
x
=>
x
.
Id
==
item
.
Grade
).
FirstOrDefault
();
item
.
GradeDescription
=
hpGModel
?.
GradeName
??
"暂无等级"
;
}
}
}
return
oclist
;
}
/// <summary>
/// 获取用户分销订单
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderCommission_Extend
>
GetERPDistributionOrdersPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderCommission_Extend
demodel
)
{
var
oclist
=
goods_OrderCommissionRepository
.
GetListGroupByUser_V3
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
oclist
.
Any
())
{
//获取用户
var
ulist
=
member_UserRepository
.
GetList
(
new
RB_Member_User_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
UserIds
=
string
.
Join
(
","
,
oclist
.
Select
(
x
=>
x
.
UserId
).
Distinct
())
});
string
orderIds
=
string
.
Join
(
","
,
oclist
.
Select
(
x
=>
x
.
OrderId
).
Distinct
());
//查询订单明细
var
dlist
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
OrderIds
=
orderIds
});
//查询图片
List
<
RB_Material_Info_Extend
>
Mlist
=
new
List
<
RB_Material_Info_Extend
>();
if
(
dlist
.
Any
())
{
foreach
(
var
item
in
dlist
)
{
item
.
CoverImagePath
=
item
.
CoverImage
;
}
}
var
HpgradeList
=
new
List
<
RB_Distributor_HPGradeInfo_Extend
>();
if
(
oclist
.
Where
(
x
=>
x
.
Type
==
2
).
Any
())
{
string
gradeIds
=
string
.
Join
(
","
,
oclist
.
Where
(
x
=>
x
.
Type
==
2
).
Select
(
x
=>
x
.
Grade
).
Distinct
());
HpgradeList
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
GradeIds
=
gradeIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
},
true
);
}
foreach
(
var
item
in
oclist
)
{
var
umodel
=
ulist
.
Where
(
x
=>
x
.
Id
==
item
.
UserId
).
FirstOrDefault
();
item
.
UserName
=
umodel
?.
Name
??
""
;
item
.
Mobile
=
umodel
?.
Moblie
??
""
;
item
.
OrderDetailList
=
dlist
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
ToList
();
if
(
item
.
Type
==
1
)
{
if
(
item
.
Grade
==
0
)
{
item
.
GradeDescription
=
"自购返利"
;
}
else
if
(
item
.
Grade
==
1
)
{
item
.
GradeDescription
=
"一级佣金"
;
}
else
if
(
item
.
Grade
==
2
)
{
item
.
GradeDescription
=
"二级佣金"
;
}
else
if
(
item
.
Grade
==
3
)
{
item
.
GradeDescription
=
"三级佣金"
;
}
}
else
if
(
item
.
Type
==
2
)
{
var
hpGModel
=
HpgradeList
.
Where
(
x
=>
x
.
Id
==
item
.
Grade
).
FirstOrDefault
();
item
.
GradeDescription
=
hpGModel
?.
GradeName
??
"暂无等级"
;
}
}
}
...
...
Mall.Module.User/UserModule.cs
View file @
07f2c83a
...
...
@@ -119,6 +119,7 @@ namespace Mall.Module.User
/// </summary>
private
readonly
RB_Distributor_HPGradeRatioRepository
distributor_HPGradeRatioRepository
=
new
RB_Distributor_HPGradeRatioRepository
();
#
region
基础配置
/// <summary>
/// 获取用户分页列表
...
...
@@ -1779,6 +1780,8 @@ namespace Mall.Module.User
return
flag
?
""
:
"操作失败"
;
}
#
endregion
#
region
收货地址
/// <summary>
...
...
@@ -2238,14 +2241,12 @@ namespace Mall.Module.User
if
(
CustomModel
==
null
)
{
return
""
;
}
string
HeadImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
HeadImage
)?.
Path
??
""
;
string
BottomImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
BottomImage
)?.
Path
??
""
;
return
new
{
CustomModel
=
new
{
HeadImage
,
BottomImage
,
CustomModel
.
HeadImage
,
CustomModel
.
BottomImage
,
CustomModel
.
DistributionApplication
,
CustomModel
.
ApplicationAgreement
,
CustomModel
.
ButtonFilletPX
,
...
...
@@ -2326,11 +2327,6 @@ namespace Mall.Module.User
{
return
""
;
}
string
DistributionCommissionImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
DistributionCommissionImage
)?.
Path
??
""
;
string
DistributionOrderImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
DistributionOrderImage
)?.
Path
??
""
;
string
WithdrawDetialsImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
WithdrawDetialsImage
)?.
Path
??
""
;
string
MyTeamImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
MyTeamImage
)?.
Path
??
""
;
string
PromoteQRCodeImage
=
material_InfoRepository
.
GetEntity
(
CustomModel
.
PromoteQRCodeImage
)?.
Path
??
""
;
var
basicsModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
return
new
...
...
@@ -2338,15 +2334,15 @@ namespace Mall.Module.User
CustomModel
=
new
{
CustomModel
.
DistributionCommissionName
,
DistributionCommissionImage
,
CustomModel
.
DistributionCommissionImage
,
CustomModel
.
DistributionOrderName
,
DistributionOrderImage
,
CustomModel
.
DistributionOrderImage
,
CustomModel
.
WithdrawDetialsName
,
WithdrawDetialsImage
,
CustomModel
.
WithdrawDetialsImage
,
CustomModel
.
MyTeamName
,
MyTeamImage
,
CustomModel
.
MyTeamImage
,
CustomModel
.
PromoteQRCodeName
,
PromoteQRCodeImage
,
CustomModel
.
PromoteQRCodeImage
,
CustomModel
.
ReferrerName
,
CustomModel
.
CommissionForWithdrawalName
,
CustomModel
.
WithdrawDepositName
,
...
...
@@ -2358,6 +2354,7 @@ namespace Mall.Module.User
{
UserId
=
umodel
.
Id
,
UserName
=
umodel
.
Name
,
umodel
.
Photo
,
GradeName
,
SuperiorId
,
SuperiorName
,
...
...
@@ -2784,6 +2781,30 @@ namespace Mall.Module.User
parent_name
=
member_UserRepository
.
GetEntity
<
RB_Member_User_Extend
>(
umodel
.
SuperiorId
)?.
Name
??
""
;
}
}
#
region
和平分销
-
是否显示分销中心
//获取是否开启和平分销
int
IsShowDistributionCenter
=
1
;
//默认显示
var
IsHpFX
=
GetHpDistributorIsEnabled
(
umodel
?.
TenantId
??
0
,
umodel
?.
MallBaseId
??
0
);
if
(
IsHpFX
==
1
)
{
//验证如果其上级为二级分销商 则无法看到分销中心
if
(
umodel
.
IsDistributor
!=
1
&&
umodel
.
SuperiorId
>
0
)
{
var
SdisModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
umodel
.
SuperiorId
,
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
}).
FirstOrDefault
();
if
(
SdisModel
!=
null
)
{
var
glist
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
});
int
MinId
=
glist
.
Where
(
x
=>
(
x
.
IsGuest
??
0
)
!=
1
).
Max
(
x
=>
x
.
Grade
??
0
);
var
sdisgM
=
glist
.
Where
(
x
=>
x
.
Id
==
SdisModel
.
HPGradeId
).
FirstOrDefault
();
if
(
MinId
==
(
sdisgM
?.
Grade
??
0
))
{
IsShowDistributionCenter
=
2
;
//其上级为最后一级 和平下不能显示分销中心
}
}
}
}
#
endregion
objData
=
new
{
//昵称
nickname
=
umodel
?.
Name
??
""
,
...
...
@@ -2820,7 +2841,8 @@ namespace Mall.Module.User
WaitReceiving
=
olist
.
Where
(
x
=>
x
.
OrderStatus
==
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
WaitReceiving
).
FirstOrDefault
()?.
OrderNum
??
0
,
WaitCommentNum
,
AfterSaleNum
}
},
isShowDistributionCenter
=
IsShowDistributionCenter
};
}
return
objData
;
...
...
@@ -3529,5 +3551,90 @@ namespace Mall.Module.User
}
#
endregion
#
region
ERP
查询用户返佣
/// <summary>
/// 获取用户返佣列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
object
GetDistributionCommissionPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Member_User_Extend
dmodel
)
{
var
list
=
member_UserRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
List
<
object
>
RList
=
new
List
<
object
>();
if
(
list
.
Any
())
{
int
HpEnabled
=
GetHpDistributorIsEnabled
(
dmodel
.
TenantId
,
dmodel
.
MallBaseId
);
//获取分销商信息
var
userIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
DisList
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserIds
=
userIds
,
TenantId
=
dmodel
.
TenantId
,
MallBaseId
=
dmodel
.
MallBaseId
});
List
<
RB_Distributor_Grade_Extend
>
GradeList
=
new
List
<
RB_Distributor_Grade_Extend
>();
List
<
RB_Distributor_HPGradeInfo_Extend
>
HpGradeList
=
new
List
<
RB_Distributor_HPGradeInfo_Extend
>();
if
(
DisList
.
Any
())
{
//获取分销商等级
if
(
HpEnabled
==
1
)
{
if
(
DisList
.
Where
(
x
=>
x
.
HPGradeId
>
0
).
Any
())
{
string
gradeIds
=
string
.
Join
(
","
,
DisList
.
Where
(
x
=>
x
.
HPGradeId
>
0
).
Select
(
x
=>
x
.
HPGradeId
));
HpGradeList
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
GradeIds
=
gradeIds
,
TenantId
=
dmodel
.
TenantId
,
MallBaseId
=
dmodel
.
MallBaseId
});
}
}
else
{
if
(
DisList
.
Where
(
x
=>
x
.
GradeId
>
0
).
Any
())
{
string
gradeIds
=
string
.
Join
(
","
,
DisList
.
Where
(
x
=>
x
.
GradeId
>
0
).
Select
(
x
=>
x
.
GradeId
));
GradeList
=
distributor_GradeRepository
.
GetList
(
new
RB_Distributor_Grade_Extend
()
{
GradeIds
=
gradeIds
,
TenantId
=
dmodel
.
TenantId
,
MallBaseId
=
dmodel
.
MallBaseId
});
}
}
}
//获取用户返佣统计
var
commList
=
goods_OrderCommissionRepository
.
GetUserCommissionStatistics
(
userIds
);
foreach
(
var
item
in
list
)
{
var
disModel
=
DisList
.
Where
(
x
=>
x
.
UserId
==
item
.
Id
).
FirstOrDefault
();
//分销商信息
item
.
MemberGradeName
=
"默认等级"
;
if
(
HpEnabled
==
1
)
{
if
((
disModel
?.
HPGradeId
??
0
)
>
0
)
{
item
.
MemberGradeName
=
HpGradeList
.
Where
(
x
=>
x
.
Id
==
(
disModel
?.
HPGradeId
??
0
)).
FirstOrDefault
()?.
GradeName
??
""
;
}
}
else
{
if
((
disModel
?.
GradeId
??
0
)
>
0
)
{
item
.
MemberGradeName
=
GradeList
.
Where
(
x
=>
x
.
Id
==
(
disModel
?.
GradeId
??
0
)).
FirstOrDefault
()?.
Name
??
""
;
}
}
item
.
TotalCommission
=
disModel
?.
TotalCommission
??
0
;
item
.
Price
=
disModel
?.
CommissionWithdrawal
??
0
;
var
commModel
=
commList
.
Where
(
x
=>
x
.
UserId
==
item
.
Id
).
FirstOrDefault
();
//用户返佣
item
.
WaitCommission
=
commModel
?.
WaitCommission
??
0
;
item
.
Commission
=
commModel
?.
Commission
??
0
;
}
}
return
list
.
Select
(
x
=>
new
{
UserId
=
x
.
Id
,
x
.
Name
,
x
.
Moblie
,
GradeName
=
x
.
MemberGradeName
,
x
.
TotalCommission
,
CommissionWithdrawal
=
x
.
Price
,
x
.
WaitCommission
,
x
.
Commission
});
}
#
endregion
}
}
Mall.Repository/Finance/RB_FinancialInstitutionsRepository.cs
View file @
07f2c83a
...
...
@@ -33,6 +33,9 @@ namespace Mall.Repository.Finance
{
where
+=
string
.
Format
(
" AND t."
+
nameof
(
RB_BackAccount_Extend
.
TypeId
)
+
" ={0}"
,
model
.
TypeId
);
}
if
(
model
.
BankType
>
0
)
{
where
+=
string
.
Format
(
" AND t."
+
nameof
(
RB_BackAccount_Extend
.
BankType
)
+
" ={0}"
,
model
.
BankType
);
}
if
(!
string
.
IsNullOrEmpty
(
model
.
Alias
))
{
where
+=
string
.
Format
(
" AND t."
+
nameof
(
RB_BackAccount_Extend
.
Alias
)
+
" like '%{0}%' "
,
model
.
Alias
);
...
...
Mall.Repository/Product/RB_Goods_OrderCommissionRepository.cs
View file @
07f2c83a
...
...
@@ -128,6 +128,57 @@ where {where} group by oc.OrderId,o.OrderNo,oc.UserId,oc.Grade order by oc.Order
return
GetPage
<
RB_Goods_OrderCommission_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取用户返佣
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderCommission_Extend
>
GetListGroupByUser_V3
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_OrderCommission_Extend
dmodel
)
{
string
where
=
$" 1=1 and o.Recycled=2 and oa.ReOrderId is null"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and oc.
{
nameof
(
RB_Goods_OrderCommission
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and oc.
{
nameof
(
RB_Goods_OrderCommission
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
OrderId
>
0
)
{
where
+=
$@" and oc.
{
nameof
(
RB_Goods_OrderCommission
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and oc.
{
nameof
(
RB_Goods_OrderCommission
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderIds
))
{
where
+=
$@" and oc.
{
nameof
(
RB_Goods_OrderCommission
.
OrderId
)}
in(
{
dmodel
.
OrderIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderNo
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
='
{
dmodel
.
OrderNo
}
'"
;
}
if
(
dmodel
.
CommissionState
>
0
)
{
switch
(
dmodel
.
CommissionState
)
{
case
2
:
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderStatus
)}
=
{(
int
)
OrderStatusEnum
.
Completed
}
"
;
break
;
case
1
:
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderStatus
)}
in(1,2,3,4,6)"
;
break
;
}
}
string
sql
=
$@"SELECT oc.OrderId,o.OrderNo,o.UserId,oc.Grade,o.OrderStatus as DistrbutionOrderSelectStatus,SUM(oc.Commission) as Commission
FROM RB_Goods_OrderCommission oc
inner join rb_goods_order o on oc.OrderId = o.OrderId
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
where
{
where
}
group by oc.OrderId,o.OrderNo,oc.UserId,oc.Grade order by oc.OrderId desc"
;
return
GetPage
<
RB_Goods_OrderCommission_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 订单返佣
/// </summary>
...
...
@@ -145,5 +196,24 @@ INNER JOIN rb_goods_order o on oc.OrderId=o.OrderId
}
return
0
;
}
/// <summary>
/// 订单返佣
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public
List
<
RB_Goods_OrderCommission_Extend
>
GetUserCommissionStatistics
(
string
userIds
)
{
string
sql
=
$@"SELECT oc.UserId
,SUM(case when oc.CommissionState =1 then oc.Commission else 0 end) as WaitCommission
,SUM(case when oc.CommissionState =2 then oc.Commission else 0 end) as Commission
FROM rb_goods_ordercommission oc
INNER JOIN rb_goods_order o on oc.OrderId=o.OrderId
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
WHERE oc.UserId in(
{
userIds
}
) and o.OrderStatus in (1,2,3,4,5,6) and o.Recycled=2 and oa.ReOrderId is null
group by oc.UserId"
;
return
Get
<
RB_Goods_OrderCommission_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
07f2c83a
...
...
@@ -52,6 +52,9 @@ namespace Mall.Repository.User
if
(
dmodel
.
SuperiorId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
SuperiorId
)}
=
{
dmodel
.
SuperiorId
}
"
;
}
if
(
dmodel
.
IsDistributor
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
IsDistributor
)}
=
{
dmodel
.
IsDistributor
}
"
;
}
if
(
dmodel
.
IsEmptyUserPhoto
==
1
)
{
where
+=
$@" and IFNULL(
{
nameof
(
RB_Member_User
.
Photo
)}
,'')=''"
;
}
...
...
Mall.WebApi/Controllers/Finance/ERPOrderCommissionController.cs
0 → 100644
View file @
07f2c83a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Model.Extend.User
;
using
Mall.Module.User
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Mall.Common.Plugin
;
using
Mall.Common.Enum.User
;
using
Newtonsoft.Json.Linq
;
using
Mall.Common
;
using
Mall.Module.Finance
;
using
Mall.Model.Extend.Finance
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
using
Mall.Model.Extend.Product
;
using
Mall.Module.Product
;
namespace
Mall.WebApi.Controllers.Finance
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
ERPOrderCommissionController
:
ControllerBase
{
private
readonly
UserModule
userModule
=
new
UserModule
();
private
readonly
OrderModule
orderModule
=
new
OrderModule
();
#
region
erp
查询分销情况
/// <summary>
/// 用户返佣列表
/// </summary>
/// <returns></returns>
[
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
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FinanceSetting"
)[
"TenantId"
]);
demodel
.
MallBaseId
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FinanceSetting"
)[
"MallBaseId"
]);
demodel
.
IsDistributor
=
1
;
var
list
=
userModule
.
GetDistributionCommissionPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 用户订单返佣列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetDistributionOrderCommissionPageList
(
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_Goods_OrderCommission_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_OrderCommission_Extend
>(
requestParm
.
msg
.
ToString
());
if
((
demodel
.
UserId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递用户id"
);
}
demodel
.
TenantId
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FinanceSetting"
)[
"TenantId"
]);
demodel
.
MallBaseId
=
Convert
.
ToInt32
(
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FinanceSetting"
)[
"MallBaseId"
]);
var
list
=
orderModule
.
GetERPDistributionOrdersPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
OrderId
,
x
.
OrderNo
,
x
.
Grade
,
x
.
GradeDescription
,
DetailList
=
x
.
OrderDetailList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
CoverImagePath
,
y
.
OrderType
,
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
y
.
GoodsName
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
),
y
.
ProductCode
,
y
.
Final_Price
,
y
.
Number
}),
x
.
UserId
,
x
.
UserName
,
x
.
Mobile
,
x
.
Remark
,
x
.
Commission
,
x
.
CommissionState
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
07f2c83a
...
...
@@ -2090,7 +2090,7 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
RequestParm
.
OpenId
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
RequestParm
.
OpenId
))
{
var
memberModel
=
userModule
.
GetAppletUserCenterStatistics
(
RequestParm
.
OpenId
);
user_info
=
memberModel
;
user_info
=
memberModel
;
}
var
data
=
new
object
();
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
07f2c83a
...
...
@@ -770,6 +770,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
OrderId
,
x
.
OrderNo
,
x
.
Grade
,
x
.
GradeDescription
,
DetailList
=
x
.
OrderDetailList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
CoverImagePath
,
...
...
@@ -783,8 +784,10 @@ namespace Mall.WebApi.Controllers.MallBase
}),
x
.
UserId
,
x
.
UserName
,
x
.
Photo
,
x
.
Mobile
,
x
.
Remark
,
x
.
Commission
,
x
.
CommissionState
,
StatusName
=
x
.
DistrbutionOrderSelectStatus
==
1
?
"待付款"
:
x
.
DistrbutionOrderSelectStatus
==
5
?
"已完成"
:
"已付款"
,
x
.
TenantId
,
...
...
Mall.WebApi/Startup.cs
View file @
07f2c83a
...
...
@@ -49,6 +49,9 @@ namespace Mall.WebApi
"http://localhost:8082"
,
"http://127.0.0.1:50512"
,
"http://127.0.0.1:20224"
,
"http://www.test.com:8080"
,
"http://www.test.com:8081"
,
"http://yx.oytour.com"
,
"http://mall.oytour.com"
,
"http://testmall.oytour.com"
};
...
...
Mall.WebApi/appsettings.json
View file @
07f2c83a
...
...
@@ -40,6 +40,10 @@
},
"VirtualDirectory"
:
"WebFile"
,
"FileService"
:
"2"
,
"FinanceSetting"
:
{
"TenantId"
:
1
,
"MallBaseId"
:
1
},
"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