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
04e62a54
Commit
04e62a54
authored
Sep 02, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
feaf5d53
575b41e6
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
374 additions
and
337 deletions
+374
-337
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+5
-0
RB_ImageCommonModel.cs
Mall.Model/Extend/Product/RB_ImageCommonModel.cs
+5
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+3
-3
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+201
-6
EmployeeModule.cs
Mall.Module.User/EmployeeModule.cs
+1
-1
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+5
-0
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+3
-185
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+151
-142
No files found.
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
04e62a54
...
...
@@ -230,5 +230,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
List
<
object
>
SupplierSpecificationList
{
get
;
set
;
}
/// <summary>
/// 是否直查询有视频商品(1-是)HK0902新增
/// </summary>
public
int
IsVideo
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_ImageCommonModel.cs
View file @
04e62a54
...
...
@@ -24,5 +24,10 @@ namespace Mall.Model.Extend.Product
/// 路径
/// </summary>
public
string
Path
{
get
;
set
;
}
/// <summary>
/// 1-视频
/// </summary>
public
int
Type
{
get
;
set
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
04e62a54
...
...
@@ -6956,14 +6956,14 @@ namespace Mall.Module.Product
if
(
model
.
Type
==
2
)
{
var
oeModel
=
goods_OrderExpressRepository
.
GetList
(
new
RB_Goods_OrderExpress_Extend
()
{
AfterSaleOrderId
=
model
.
ReOrderId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
oeModel
.
Type
==
1
)
if
(
oeModel
!=
null
&&
oeModel
.
Type
==
1
)
{
var
leModel
=
logistics_ExpressRepository
.
GetEntity
(
oeModel
.
ExpressId
);
ExpressList
.
Add
(
new
{
Name
=
uModel
.
Name
??
""
,
ExpressName
=
leModel
.
Name
??
""
,
oeModel
.
ExpressNumber
,
ExpressNumber
=
oeModel
?.
ExpressNumber
??
""
,
Type
=
1
});
}
...
...
@@ -6973,7 +6973,7 @@ namespace Mall.Module.Product
{
Name
=
uModel
.
Name
??
""
,
ExpressName
=
""
,
ExpressNumber
=
oeModel
.
Remark
,
ExpressNumber
=
oeModel
?.
Remark
??
""
,
Type
=
2
});
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
04e62a54
...
...
@@ -1572,6 +1572,16 @@ namespace Mall.Module.Product
//轮播
model
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
VideoAddress
))
{
model
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
0
,
Name
=
""
,
Type
=
1
,
Path
=
model
.
VideoAddress
});
}
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
CarouselImage
);
...
...
@@ -2370,7 +2380,8 @@ namespace Mall.Module.Product
pic_url
=
model
.
CarouselImageList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
pic_url
=
x
.
Path
pic_url
=
x
.
Path
,
type
=
x
.
Type
}),
share
=
model
.
MaxShare
,
//分销佣金
myBuyCommission
=
MyBuyCommission
,
//粉象模式 自购返利
...
...
@@ -4020,7 +4031,7 @@ namespace Mall.Module.Product
/// <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
)
public
List
<
RB_Goods_Extend
>
GetProductGoodsPageList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
,
int
SmallShopsId
=
0
)
{
if
(!
string
.
IsNullOrEmpty
(
demodel
.
CategoryIds
)
&&
!
demodel
.
CategoryIds
.
Contains
(
','
))
{
...
...
@@ -4050,8 +4061,17 @@ namespace Mall.Module.Product
var
list
=
goodsRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
//查询分类
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
List
<
RB_Goods_SpecificationPrice_Extend
>
spriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
//商品Id
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
if
(
SmallShopsId
>
0
)
{
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
ids
});
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
ids
});
}
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
)
...
...
@@ -4068,6 +4088,89 @@ namespace Mall.Module.Product
}
item
.
GoodsBuyNum
=
olist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
;
#
region
微店价格
if
(
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
#
endregion
}
}
return
list
;
...
...
@@ -4122,13 +4225,22 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsList
(
RB_Goods_Extend
demodel
)
public
List
<
RB_Goods_Extend
>
GetProductGoodsList
(
RB_Goods_Extend
demodel
,
int
SmallShopsId
=
0
)
{
var
list
=
goodsRepository
.
GetList
(
demodel
);
if
(
list
.
Any
())
{
//查询分类
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
List
<
RB_Goods_SpecificationPrice_Extend
>
spriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
SmallShopsId
>
0
)
{
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
ids
});
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
ids
});
}
var
clist
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
list
)
{
...
...
@@ -4142,6 +4254,90 @@ namespace Mall.Module.Product
item
.
CoverImage
=
CarouselIdList
[
0
];
//轮播图
}
#
region
微店价格
if
(
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
#
endregion
}
}
return
list
;
...
...
@@ -6716,7 +6912,6 @@ namespace Mall.Module.Product
}
#
endregion
#
region
分类包邮规则信息
/// <summary>
/// 物流规则列表
...
...
Mall.Module.User/EmployeeModule.cs
View file @
04e62a54
...
...
@@ -233,7 +233,7 @@ namespace Mall.Module.User
{
{
nameof
(
RB_Employee_Extend
.
Status
),
1
},
};
bool
flag
=
rol
eRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Employee_Extend
.
EmpId
),
EmpId
));
bool
flag
=
employe
eRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Employee_Extend
.
EmpId
),
EmpId
));
return
flag
;
}
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
04e62a54
...
...
@@ -411,6 +411,11 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
if
(
dmodel
.
IsVideo
>
0
)
{
where
+=
$@" and IFNULL(g.
{
nameof
(
RB_Goods_Extend
.
VideoAddress
)}
<>'' "
;
}
//默认综合【升序】
string
orderBy
=
$" order by g.
{
nameof
(
RB_Goods_Extend
.
Sort
)}
asc"
;
//上架时间【降序】
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
04e62a54
...
...
@@ -197,98 +197,8 @@ namespace Mall.WebApi.Controllers
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
,
GoodsStatus
=
1
});
#
region
微店价格
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
if
(
SmallShopsId
>
0
&&
tempGoodsList
.
Any
())
{
string
goodsId
=
string
.
Join
(
","
,
tempGoodsList
.
Select
(
x
=>
x
.
Id
));
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
goodsId
});
var
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
goodsId
});
foreach
(
var
item
in
tempGoodsList
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
}
#
endregion
},
SmallShopsId
:
SmallShopsId
);
List
<
GoodsDetailsItem2
>
newGoodsList
=
new
List
<
GoodsDetailsItem2
>();
foreach
(
var
goodItem
in
childItem
.
goodsList
)
{
...
...
@@ -317,99 +227,7 @@ namespace Mall.WebApi.Controllers
MallBaseId
=
MallBaseId
,
CategoryIds
=
childItem
.
id
.
ToString
(),
GoodsStatus
=
1
});
#
region
微店价格
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
if
(
SmallShopsId
>
0
&&
catGoodsList
.
Any
())
{
string
goodsId
=
string
.
Join
(
","
,
catGoodsList
.
Select
(
x
=>
x
.
Id
));
smallModel
=
smallShops_InfoRepository
.
GetEntity
<
RB_SmallShops_Info_Extend
>(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsIds
=
goodsId
});
var
spriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
goodsId
});
foreach
(
var
item
in
catGoodsList
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
var
spList
=
spriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
if
(
spList
.
Any
())
{
foreach
(
var
qitem
in
spList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
qitem
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
qitem
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
qitem
.
SellingPrice
=
(
qitem
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
item
.
SellingPrice
=
spList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
spList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
MaxPrice
+=
Math
.
Ceiling
(
MaxPrice
/
10
);
if
(
MaxPrice
>
item
.
OriginalPrice
)
{
item
.
OriginalPrice
=
MaxPrice
;
}
}
else
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
item
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
item
.
OriginalPrice
=
(
item
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
}
#
endregion
},
SmallShopsId
:
SmallShopsId
);
if
(
catGoodsList
!=
null
&&
catGoodsList
.
Count
>
0
)
{
foreach
(
var
gItem
in
catGoodsList
)
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
04e62a54
...
...
@@ -88,9 +88,13 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请传递文件路径"
);
}
//HK2020-09-01修改
if
(
demodel
.
Type
==
1
)
{
demodel
.
Path
=
Config
.
GetFilePath
(
demodel
.
Path
);
demodel
.
Image
=
Config
.
GetFilePath
(
demodel
.
Image
);
}
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
...
...
@@ -1447,7 +1451,10 @@ namespace Mall.WebApi.Controllers.MallBase
}
var
model
=
productModule
.
GetProductGoodsInfo
(
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
new
object
obj
=
new
object
();
if
(
model
!=
null
)
{
obj
=
new
{
model
?.
Id
,
model
?.
Name
,
...
...
@@ -1500,7 +1507,7 @@ namespace Mall.WebApi.Controllers.MallBase
model
?.
IsProcurement
,
model
?.
Commission
,
model
?.
IsLiveGoods
,
model
.
SendArea
,
model
?
.
SendArea
,
CategoryList
=
model
?.
CategoryList
.
Select
(
x
=>
new
{
x
.
Id
,
...
...
@@ -1590,7 +1597,9 @@ namespace Mall.WebApi.Controllers.MallBase
model
?.
MarketingLogo
,
model
?.
ShelvesDate
,
model
?.
DownDate
,
});
};
}
return
ApiResult
.
Success
(
""
,
obj
);
}
/// <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