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
69f5a72e
Commit
69f5a72e
authored
Jun 24, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品采购
parent
b70a9f50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
428 additions
and
95 deletions
+428
-95
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+337
-94
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+53
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+34
-1
No files found.
Mall.Model/Entity/Product/RB_Goods.cs
View file @
69f5a72e
...
...
@@ -407,5 +407,9 @@ namespace Mall.Model.Entity.Product
/// 是否是采购商品 1是 2否
/// </summary>
public
int
?
IsProcurement
{
get
;
set
;
}
/// <summary>
/// 采购状态 1正常 2代理下架
/// </summary>
public
int
?
ProcurementStatus
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
69f5a72e
This diff is collapsed.
Click to expand it.
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
69f5a72e
...
...
@@ -178,6 +178,59 @@ where {where} group by g.Id order by g.CreateDate desc";
return
Get
<
RB_Goods_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetSingleListForGoodsId
(
RB_Goods_Extend
dmodel
)
{
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
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
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsNameStr
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Name
)}
in (
{
dmodel
.
GoodsNameStr
}
)"
;
}
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
.
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"
}
'"
;
}
string
sql
=
$@"select g.Id from RB_Goods g where
{
where
}
"
;
return
Get
<
RB_Goods_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 小程序获取商品列表
/// </summary>
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
69f5a72e
...
...
@@ -1093,6 +1093,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
IsQuickBuy
,
x
.
IsProxy
,
x
.
IsProcurement
,
x
.
ProcurementStatus
,
x
.
GoodsStatus
,
x
.
TenantId
,
x
.
MallBaseId
,
...
...
@@ -1996,6 +1997,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
InventoryNum
,
SalesNum
=
(
x
.
SalesNum
??
0
)
+
(
x
.
GoodsBuyNum
??
0
),
x
.
IsProcurement
,
x
.
ProcurementStatus
,
x
.
ProcurementGoodsId
,
x
.
GoodsStatus
,
x
.
TenantId
,
...
...
@@ -2014,11 +2016,42 @@ namespace Mall.WebApi.Controllers.MallBase
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
string
CategoryStr
=
parms
.
GetStringValue
(
"CategoryStr"
);
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
if
(
string
.
IsNullOrEmpty
(
CategoryStr
))
{
return
ApiResult
.
ParamIsNull
(
"请选择分类"
);
}
List
<
int
>
CategoryList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
CategoryStr
);
return
productModule
.
SetProductGoodsProxy
(
GoodsId
,
CategoryList
,
req
.
TenantId
,
req
.
MallBaseId
);
}
/// <summary>
/// 取消商品代理
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CancelGoodsProxy
()
{
return
productModule
.
SetProductGoodsProxy
(
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
//类型 1原商品id 2代理商品id
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
bool
flag
=
productModule
.
CancelGoodsProxy
(
GoodsId
,
Type
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
...
...
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