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
ffa25b8e
Commit
ffa25b8e
authored
Feb 20, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品低利润
parent
0f424d07
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
519 additions
and
2 deletions
+519
-2
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+5
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+5
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+1
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+7
-0
LiveHouseController.cs
Mall.WebApi/Controllers/AppletWeChat/LiveHouseController.cs
+474
-1
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+24
-1
appsettings.json
Mall.WebApi/appsettings.json
+3
-0
No files found.
Mall.Model/Entity/Product/RB_Goods.cs
View file @
ffa25b8e
...
...
@@ -579,5 +579,10 @@ namespace Mall.Model.Entity.Product
/// 是否为不可开发票商品,1-是
/// </summary>
public
int
IsNoTax
{
get
;
set
;
}
/// <summary>
/// 最低利润率
/// </summary>
public
decimal
MinProfitRate
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
ffa25b8e
...
...
@@ -16,6 +16,11 @@ namespace Mall.Model.Extend.Product
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_Extend
:
RB_Goods
{
/// <summary>
/// 是否查询低利润商品 1是 其他否
/// </summary>
public
int
IsSelectLowProfit
{
get
;
set
;
}
/// <summary>
/// 课程是否已付款
/// </summary>
...
...
Mall.Module.Product/ProductModule.cs
View file @
ffa25b8e
...
...
@@ -7013,6 +7013,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods
.
Remark
),
demodel
.
Remark
},
{
nameof
(
RB_Goods
.
GoodsPageType
),
demodel
.
GoodsPageType
},
{
nameof
(
RB_Goods
.
IsNoTax
),
demodel
.
IsNoTax
},
{
nameof
(
RB_Goods
.
MinProfitRate
),
demodel
.
MinProfitRate
},
};
if
(
goodsModel
.
IsProcurement
==
1
)
{
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
ffa25b8e
...
...
@@ -99,6 +99,9 @@ namespace Mall.Repository.Product
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
}
if
(
dmodel
.
MinProfitRate
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MinProfitRate
)}
<
{
dmodel
.
MinProfitRate
}
"
;
}
if
(
dmodel
.
GoodsPageType
.
HasValue
)
{
if
(
dmodel
.
GoodsPageType
==
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
)
...
...
@@ -608,6 +611,10 @@ where {where} group by g.Id order by {orderBy}";
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
}
if
(
dmodel
.
MinProfitRate
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MinProfitRate
)}
<
{
dmodel
.
MinProfitRate
}
"
;
}
if
(
dmodel
.
GoodsPageType
.
HasValue
)
{
if
(
dmodel
.
GoodsPageType
==
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
)
...
...
Mall.WebApi/Controllers/AppletWeChat/LiveHouseController.cs
View file @
ffa25b8e
This diff is collapsed.
Click to expand it.
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
ffa25b8e
...
...
@@ -16,6 +16,8 @@ using Newtonsoft.Json.Linq;
using
Mall.Common
;
using
Mall.Module.Product
;
using
Mall.AOP
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
namespace
Mall.WebApi.Controllers.MallBase
{
...
...
@@ -1222,6 +1224,15 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
decimal
MinProfitRate
=
0
;
if
(
demodel
.
TenantId
==
1
)
{
//MinProfitRate = Convert.ToDecimal(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("MinProfitRate")["TenantId1"]);
}
if
(
demodel
.
IsSelectLowProfit
==
1
)
{
demodel
.
MinProfitRate
=
MinProfitRate
;
}
var
list
=
productModule
.
GetProductGoodsPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
...
...
@@ -1247,7 +1258,8 @@ namespace Mall.WebApi.Controllers.MallBase
GoodsPageTypeStr
=
x
.
GoodsPageType
.
GetEnumName
(),
CarouselImageList
=
x
.
CarouselImageList
.
Select
(
qitem
=>
qitem
.
Path
).
ToList
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
IsNoTax
x
.
IsNoTax
,
IsLowProfit
=
MinProfitRate
>
0
?
x
.
MinProfitRate
<
MinProfitRate
?
1
:
2
:
2
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -1306,6 +1318,15 @@ namespace Mall.WebApi.Controllers.MallBase
{
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
decimal
MinProfitRate
=
0
;
if
(
demodel
.
TenantId
==
1
)
{
//MinProfitRate = Convert.ToDecimal(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("MinProfitRate")["TenantId1"]);
}
if
(
demodel
.
IsSelectLowProfit
==
1
)
{
demodel
.
MinProfitRate
=
MinProfitRate
;
}
var
list
=
productModule
.
GetProductGoodsListForExcel
(
demodel
);
#
region
组装数据
int
Num
=
0
;
...
...
@@ -1800,6 +1821,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
InventoryNum
??=
0
;
List
<
Model
.
Extend
.
User
.
RB_Distributor_Grade_Extend
>
DGradeList
=
null
;
List
<
Model
.
Extend
.
User
.
RB_Member_Grade_Extend
>
MGradeList
=
null
;
demodel
.
MinProfitRate
=
0
;
if
(
demodel
.
IsCustomSpecification
==
1
)
{
demodel
.
InventoryNum
=
0
;
...
...
@@ -1899,6 +1921,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
demodel
.
SellingPrice
=
SellingPrice
;
}
demodel
.
MinProfitRate
=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
&&
x
.
CostMoney
>
0
&&
x
.
Commission
>
0
)?.
Min
(
x
=>
Math
.
Round
(((
x
.
SellingPrice
??
0
)
-
x
.
CostMoney
-
x
.
Commission
)
/
(
x
.
SellingPrice
??
0
),
2
,
MidpointRounding
.
AwayFromZero
))
??
0
;
}
//分销佣金
...
...
Mall.WebApi/appsettings.json
View file @
ffa25b8e
...
...
@@ -84,6 +84,9 @@
"ProcurementDepartment"
:
331
,
"ProcurementCurrencyId"
:
1
},
"MinProfitRate"
:
{
"TenantId1"
:
0.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