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
d12e8a0b
Commit
d12e8a0b
authored
Jun 29, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c64260ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
1 deletion
+111
-1
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+55
-1
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+42
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+14
-0
No files found.
Mall.Module.Product/OrderModule.cs
View file @
d12e8a0b
...
...
@@ -2932,7 +2932,52 @@ namespace Mall.Module.Product
}
}
/// <summary>
/// 初始化返佣
/// </summary>
/// <param name="orderId"></param>
/// <param name="userId"></param>
/// <returns></returns>
public
bool
SetAppletOrderCommissionInitialize
(
int
orderId
,
int
userId
=
0
)
{
var
demodel
=
goods_OrderRepository
.
GetEntity
<
RB_Goods_Order_Extend
>(
orderId
);
if
(
demodel
==
null
)
{
return
false
;
}
userId
=
demodel
.
UserId
??
0
;
var
umodel
=
member_UserRepository
.
GetEntity
(
userId
);
if
(
umodel
==
null
)
{
return
false
;
}
var
detList
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
OrderId
=
orderId
});
demodel
.
DetailList
=
detList
;
string
GoodsIds
=
""
;
if
(
demodel
.
DetailList
.
Any
())
{
GoodsIds
=
string
.
Join
(
","
,
demodel
.
DetailList
.
Select
(
x
=>
x
.
GoodsId
));
var
gList
=
goodsRepository
.
GetList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
GoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
demodel
.
DetailList
)
{
var
gmodel
=
gList
.
Where
(
x
=>
x
.
Id
==
item
.
GoodsId
).
FirstOrDefault
();
if
(
gmodel
==
null
||
gmodel
.
GoodsStatus
!=
1
)
{
return
false
;
}
item
.
SeparateDistribution
=
gmodel
.
SeparateDistribution
;
item
.
SeparateDistributionType
=
gmodel
.
SeparateDistributionType
;
item
.
SeparateDistributionMoneyType
=
gmodel
.
SeparateDistributionMoneyType
;
item
.
IntegralPresent
=
gmodel
.
IntegralPresent
;
item
.
IntegralPresentType
=
gmodel
.
IntegralPresentType
;
}
}
InsertOrderCommission
(
demodel
,
umodel
,
GoodsIds
,
orderId
);
return
true
;
}
/// <summary>
/// 插入返佣
...
...
@@ -3166,6 +3211,14 @@ namespace Mall.Module.Product
}
if
(
OneUserId
>
0
)
{
#
region
临时处理
if
(
TwoUserId
>
0
&&
TwoUserId
<
20
)
{
TwoUserId
=
0
;
}
if
(
ThreeUserId
>
0
&&
ThreeUserId
<
20
)
{
ThreeUserId
=
0
;
}
#
endregion
if
(
OneUserId
>
0
)
{
OneDistributorGrade
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
UserId
=
OneUserId
})?.
FirstOrDefault
()?.
GradeId
??
0
;
...
...
@@ -3428,9 +3481,9 @@ namespace Mall.Module.Product
//gocList 合并用户金额
if
(
basicModel
.
IsCommissionResidue
==
1
)
{
gocfulList
=
new
List
<
RB_Goods_OrderCommission
>();
if
(
gocList
.
Count
()
!=
gocList
.
Select
(
x
=>
x
.
UserId
).
Distinct
().
Count
())
{
gocfulList
=
new
List
<
RB_Goods_OrderCommission
>();
//说明有用户可以合并
var
userIdList
=
gocList
.
Select
(
x
=>
x
.
UserId
).
Distinct
().
ToList
();
foreach
(
var
qitem
in
userIdList
)
...
...
@@ -3450,6 +3503,7 @@ namespace Mall.Module.Product
{
foreach
(
var
qitem
in
gocfulList
)
{
qitem
.
Commission
=
(
qitem
.
Commission
??
0
)
*
(
item
.
Number
??
0
);
goods_OrderCommissionRepository
.
Insert
(
qitem
,
trans
);
}
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
d12e8a0b
...
...
@@ -3205,6 +3205,48 @@ namespace Mall.Module.Product
return
list
;
}
/// <summary>
/// 首页查询使用
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsPageList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
{
if
(!
string
.
IsNullOrEmpty
(
demodel
.
CategoryIds
)
&&
!
demodel
.
CategoryIds
.
Contains
(
','
))
{
//获取该分类下所有子集分类
var
cmodel
=
goods_CategoryRepository
.
GetEntity
(
demodel
.
CategoryIds
);
//goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { TenantId });
}
var
list
=
goodsRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
//查询分类
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
clist
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
olist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
ids
);
foreach
(
var
item
in
list
)
{
item
.
CategoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
//轮播图
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
CarouselIdList
[
0
];
//轮播图
}
item
.
GoodsBuyNum
=
olist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
;
}
}
return
list
;
}
/// <summary>
/// 获取后台商品代理分页列表
/// </summary>
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
d12e8a0b
...
...
@@ -480,6 +480,20 @@ namespace Mall.WebApi.Controllers.MallBase
return
orderModule
.
SetAppletGoodsOrderInfo
(
demodel
);
}
/// <summary>
/// 返佣初始化
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetAppletOrderCommissionInitialize
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
bool
flag
=
orderModule
.
SetAppletOrderCommissionInitialize
(
OrderId
);
return
ApiResult
.
Success
(
""
,
flag
);
}
/// <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