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
8dcce85e
Commit
8dcce85e
authored
Jun 22, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品采购
parent
210d19f4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
404 additions
and
4 deletions
+404
-4
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+20
-1
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+8
-0
RB_Goods_Proxy_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Proxy_Extend.cs
+4
-1
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+221
-1
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+9
-0
RB_Goods_ProxyRepository.cs
Mall.Repository/Product/RB_Goods_ProxyRepository.cs
+58
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+84
-1
No files found.
Mall.Model/Entity/Product/RB_Goods.cs
View file @
8dcce85e
...
...
@@ -387,6 +387,25 @@ namespace Mall.Model.Entity.Product
/// 供应商id
/// </summary>
public
int
SupplierId
{
get
;
set
;
}
/// <summary>
/// 商品是否可代理 1是 2否
/// </summary>
public
int
?
IsProxy
{
get
;
set
;
}
/// <summary>
/// 代理成本上浮类型 1百分比 2固定金额
/// </summary>
public
int
?
ProxyType
{
get
;
set
;
}
/// <summary>
/// 价格上涨
/// </summary>
public
decimal
?
ProxyRises
{
get
;
set
;
}
/// <summary>
/// 代理价格
/// </summary>
public
decimal
?
ProxyMoney
{
get
;
set
;
}
/// <summary>
/// 是否是采购商品 1是 2否
/// </summary>
public
int
?
IsProcurement
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
8dcce85e
...
...
@@ -22,6 +22,14 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 采购商品id
/// </summary>
public
int
?
ProcurementGoodsId
{
get
;
set
;
}
/// <summary>
/// 其他商户
/// </summary>
public
int
?
NotTenantId
{
get
;
set
;
}
/// <summary>
/// 商品购买的数量
/// </summary>
public
int
?
GoodsBuyNum
{
get
;
set
;
}
...
...
Mall.Model/Extend/Product/RB_Goods_Proxy_Extend.cs
View file @
8dcce85e
...
...
@@ -13,6 +13,9 @@ namespace Mall.Model.Extend.Product
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_Proxy_Extend
:
RB_Goods_Proxy
{
/// <summary>
/// 商品ids
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
8dcce85e
This diff is collapsed.
Click to expand it.
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
8dcce85e
...
...
@@ -27,6 +27,9 @@ namespace Mall.Repository.Product
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
}
"
;
}
...
...
@@ -54,6 +57,12 @@ namespace Mall.Repository.Product
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
}
"
;
}
string
sql
=
$@"select g.* from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId
...
...
Mall.Repository/Product/RB_Goods_ProxyRepository.cs
0 → 100644
View file @
8dcce85e
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
using
Mall.Model.Entity.User
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品代理仓储层
/// </summary>
public
class
RB_Goods_ProxyRepository
:
RepositoryBase
<
RB_Goods_Proxy
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Proxy_Extend
>
GetList
(
RB_Goods_Proxy_Extend
dmodel
)
{
string
where
=
$" 1=1 and Status =0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
ProxyTenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
ProxyTenantId
)}
=
{
dmodel
.
ProxyTenantId
}
"
;
}
if
(
dmodel
.
ProxyMallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
ProxyMallBaseId
)}
=
{
dmodel
.
ProxyMallBaseId
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(
dmodel
.
ProxyGoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
ProxyGoodsId
)}
=
{
dmodel
.
ProxyGoodsId
}
"
;
}
string
sql
=
$@"SELECT * FROM RB_Goods_Proxy where
{
where
}
order by Id asc"
;
return
Get
<
RB_Goods_Proxy_Extend
>(
sql
).
ToList
();
}
}
}
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
8dcce85e
...
...
@@ -1091,6 +1091,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
SalesNum
,
x
.
GoodsBuyNum
,
x
.
IsQuickBuy
,
x
.
IsProxy
,
x
.
IsProcurement
,
x
.
GoodsStatus
,
x
.
TenantId
,
x
.
MallBaseId
,
...
...
@@ -1384,6 +1386,11 @@ namespace Mall.WebApi.Controllers.MallBase
model
.
SeparateSetMember
,
model
.
IsQuickBuy
,
model
.
SupplierId
,
model
.
IsProxy
,
model
.
ProxyType
,
model
.
ProxyRises
,
model
.
ProxyMoney
,
model
.
IsProcurement
,
CategoryList
=
model
.
CategoryList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
CategoryId
,
...
...
@@ -1859,6 +1866,25 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
GoodsType
??=
Common
.
Enum
.
Goods
.
OrderTypeEnum
.
Mall
;
demodel
.
GoodsStatus
??=
2
;
demodel
.
IsProxy
??=
2
;
demodel
.
ProxyType
??=
1
;
demodel
.
ProxyRises
??=
0
;
demodel
.
ProxyMoney
??=
0
;
demodel
.
IsProcurement
=
2
;
//新增时
if
(
demodel
.
IsProxy
==
1
&&
demodel
.
CostPrice
>
0
)
{
decimal
ProxyMoney
=
0
;
if
(
demodel
.
ProxyType
==
1
)
{
ProxyMoney
=
Math
.
Round
((
demodel
.
CostPrice
??
0
)
*
(
1
+
(
demodel
.
ProxyRises
??
0
)),
2
,
MidpointRounding
.
AwayFromZero
);
}
else
{
ProxyMoney
=
(
demodel
.
CostPrice
??
0
)
+
(
demodel
.
ProxyRises
??
0
);
}
if
(
ProxyMoney
!=
(
demodel
.
ProxyMoney
??
0
))
{
return
ApiResult
.
ParamIsNull
(
"代理价格不正确"
);
}
}
bool
flag
=
productModule
.
SetProductGoodsInfo
(
demodel
);
if
(
flag
)
{
...
...
@@ -1939,6 +1965,63 @@ namespace Mall.WebApi.Controllers.MallBase
#
endregion
#
region
商品代理
/// <summary>
/// 商品代理分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductGoodsProxyPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
NotTenantId
=
parms
.
TenantId
;
//demodel.MallBaseId = parms.MallBaseId;
demodel
.
IsProxy
=
1
;
demodel
.
IsProcurement
=
2
;
var
list
=
productModule
.
GetProductGoodsProxyPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
Sort
,
x
.
CoverImage
,
CategoryList
=
x
.
CategoryList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
CategoryName
}),
x
.
ProxyMoney
,
x
.
InventoryNum
,
SalesNum
=
(
x
.
SalesNum
??
0
)
+
(
x
.
GoodsBuyNum
??
0
),
x
.
IsProcurement
,
x
.
ProcurementGoodsId
,
x
.
GoodsStatus
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 设置商品代理
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetProductGoodsProxy
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
return
productModule
.
SetProductGoodsProxy
(
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
}
#
endregion
#
region
商品导入
/// <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