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
286855d3
Commit
286855d3
authored
Oct 13, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分销订单调整
parent
0c2c258a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
195 additions
and
2 deletions
+195
-2
OrderModule_Part.cs
Mall.Module.Product/OrderModule_Part.cs
+3
-1
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+40
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+125
-0
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+1
-1
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+26
-0
No files found.
Mall.Module.Product/OrderModule_Part.cs
View file @
286855d3
...
...
@@ -878,11 +878,12 @@ namespace Mall.Module.Product
if
(
gmodel
.
GoodsClassify
!=
2
)
{
return
ApiResult
.
Failed
(
"有非网课类商品"
);
}
var
categoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
ToList
();
item
.
CommissionPrice
=
gmodel
.
Commission
;
// 粉象 返佣金额
item
.
CostMoney
=
(
gmodel
.
CostPrice
??
0
);
item
.
Specification
=
"[]"
;
item
.
SpecificationSort
=
"0"
;
item
.
PresentFXGrade
=
gmodel
.
PresentFXGrade
??
0
;
//赠送粉象分销等级
item
.
PresentFXMonth
=
gmodel
.
PresentFXMonth
??
0
;
...
...
@@ -1310,6 +1311,7 @@ namespace Mall.Module.Product
}
}
}
item
.
EducationCouponId
=
0
;
if
(
demodel
.
Use_Education_Id
>
0
)
{
var
couponModel
=
GoodsCouponList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
FirstOrDefault
();
...
...
Mall.Module.Product/ProductModule.cs
View file @
286855d3
...
...
@@ -4881,6 +4881,46 @@ 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
>
GetProductGoodsDialogList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
{
var
list
=
goodsRepository
.
GetProductGoodsDialogList_V2
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
foreach
(
var
item
in
list
)
{
//轮播图
item
.
CoverImage
=
""
;
item
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
CarouselIdList
[
0
];
//轮播图
//轮播图
foreach
(
var
qitem
in
CarouselIdList
)
{
item
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
0
,
Name
=
""
,
Path
=
qitem
});
}
}
}
}
return
list
;
}
/// <summary>
/// 获取后台商品分页列表
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
286855d3
...
...
@@ -144,7 +144,132 @@ where {where} group by g.Id order by {orderBy}";
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowCount"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsDialogList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Goods_Extend
dmodel
)
{
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 "
;
where
+=
$@" and g.GoodsClassify <> 1"
;
//排除司导的
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
NotTenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
<>
{
dmodel
.
NotTenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
GoodsStatus
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
GoodsStatus
)}
=
{
dmodel
.
GoodsStatus
}
"
;
}
if
(
dmodel
.
IsSelectSellOut
==
1
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
InventoryNum
)}
<=0"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIds
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Category
.
CategoryId
)}
in(
{
dmodel
.
CategoryIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
if
(
dmodel
.
IsProcurement
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsProcurement
)}
=
{
dmodel
.
IsProcurement
}
"
;
}
if
(
dmodel
.
IsProxy
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsProxy
)}
=
{
dmodel
.
IsProxy
}
"
;
}
if
(
dmodel
.
SupplierId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
}
if
(
dmodel
.
GoodsPageType
.
HasValue
)
{
if
(
dmodel
.
GoodsPageType
==
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
GoodsPageType
)}
in(0,1)"
;
}
else
if
(
dmodel
.
GoodsPageType
==
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
GoodsPageType
)}
in(0,2)"
;
}
}
string
orderBy
=
" g.CreateDate desc"
;
if
(
dmodel
.
OrderBy
==
1
)
{
//id升序
orderBy
=
" g.Id asc"
;
}
else
if
(
dmodel
.
OrderBy
==
2
)
{
//id降序
orderBy
=
" g.Id desc"
;
}
else
if
(
dmodel
.
OrderBy
==
3
)
{
//排序升序
orderBy
=
" g.Sort asc"
;
}
else
if
(
dmodel
.
OrderBy
==
4
)
{
//排序降序
orderBy
=
" g.Sort desc"
;
}
else
if
(
dmodel
.
OrderBy
==
5
)
{
//售价升序
orderBy
=
" g.SellingPrice asc"
;
}
else
if
(
dmodel
.
OrderBy
==
6
)
{
//售价降序
orderBy
=
" g.SellingPrice desc"
;
}
else
if
(
dmodel
.
OrderBy
==
7
)
{
//库存升序
orderBy
=
" g.InventoryNum asc"
;
}
else
if
(
dmodel
.
OrderBy
==
8
)
{
//库存降序
orderBy
=
" g.InventoryNum desc"
;
}
string
sql
=
$@"select g.Id,g.Name,g.CarouselImage,g.SellingPrice from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId
where
{
where
}
group by g.Id order by
{
orderBy
}
"
;
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 分页列表
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
286855d3
...
...
@@ -2301,7 +2301,7 @@ namespace Mall.WebApi.Controllers.MallBase
y
.
OrderType
,
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
y
.
GoodsName
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
),
SpecificationList
=
!
string
.
IsNullOrEmpty
(
y
.
Specification
)?
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
):
new
List
<
string
>(
),
y
.
ProductCode
,
y
.
Final_Price
,
y
.
Number
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
286855d3
...
...
@@ -1445,6 +1445,32 @@ namespace Mall.WebApi.Controllers.MallBase
}
/// <summary>
/// 获取商品列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductGoodsDialogList_V2
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetProductGoodsDialogList_V2
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
CoverImage
,
x
.
CarouselImageList
,
x
.
SellingPrice
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <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