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
a5d91c0b
Commit
a5d91c0b
authored
Aug 10, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
21640522
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
5 deletions
+60
-5
PropertyModule.cs
Mall.Module.Property/PropertyModule.cs
+12
-0
RB_Supplies_InventoryRepository.cs
Mall.Repository/Property/RB_Supplies_InventoryRepository.cs
+10
-3
RB_Supplies_MaterialRepository.cs
Mall.Repository/Property/RB_Supplies_MaterialRepository.cs
+32
-0
WarehouseOutController.cs
Mall.WebApi/Controllers/Property/WarehouseOutController.cs
+6
-2
No files found.
Mall.Module.Property/PropertyModule.cs
View file @
a5d91c0b
...
...
@@ -1305,6 +1305,18 @@ namespace Mall.Module.Property
{
return
supplies_MaterialRepository
.
GetList
(
dmodel
);
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Material_Extend
>
GetHaveInventory
(
RB_Supplies_Material_Extend
dmodel
)
{
return
supplies_MaterialRepository
.
GetHaveInventory
(
dmodel
);
}
#
endregion
...
...
Mall.Repository/Property/RB_Supplies_InventoryRepository.cs
View file @
a5d91c0b
...
...
@@ -24,8 +24,9 @@ namespace Mall.Repository.Property
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND {0}={1}"
,
nameof
(
RB_Supplies_Inventory_Extend
.
Status
),
0
);
where
+=
$@" and RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
WarehouseId
>
0
)
{
where
+=
$@" and RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
WarehouseId
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Inventory_Extend
.
WarehouseId
)
+
$" =
{
dmodel
.
WarehouseId
}
"
;
}
if
(
dmodel
.
SuppliesId
>
0
)
...
...
@@ -56,7 +57,8 @@ namespace Mall.Repository.Property
{
where
+=
" and "
+
nameof
(
RB_Supplies_Inventory_Extend
.
SuppliesId
)
+
$" =
{
dmodel
.
SuppliesId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
WarehouseIdStr
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
WarehouseIdStr
))
{
where
+=
" and "
+
nameof
(
RB_Supplies_Inventory_Extend
.
WarehouseId
)
+
$" in(
{
dmodel
.
WarehouseIdStr
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
SuppliesIdStr
))
...
...
@@ -87,6 +89,11 @@ left join rb_supplies_material sm on si.SuppliesId=sm.Id
return
Get
<
RB_Supplies_Inventory_Extend
>(
sql
).
FirstOrDefault
()?.
Number
??
0
;
}
/// <summary>
/// 获取库存日志
/// </summary>
...
...
Mall.Repository/Property/RB_Supplies_MaterialRepository.cs
View file @
a5d91c0b
...
...
@@ -116,5 +116,37 @@ left join rb_property_category pc on sm.CategoryId=pc.Id
return
Get
<
RB_Supplies_Material_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Material_Extend
>
GetHaveInventory
(
RB_Supplies_Material_Extend
dmodel
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND sm.{0}={1}"
,
nameof
(
RB_Supplies_Material
.
Status
),
0
);
where
+=
$@" and sm.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and sm.
{
nameof
(
RB_Supplies_Material
.
GoodsId
)}
in (
{
dmodel
.
GoodsIds
}
)"
;
}
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
" and sm."
+
nameof
(
RB_Supplies_Material_Extend
.
TenantId
)
+
"="
+
dmodel
.
TenantId
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
" and sm."
+
nameof
(
RB_Supplies_Material_Extend
.
MallBaseId
)
+
"="
+
dmodel
.
MallBaseId
;
}
string
sql
=
$@" select sm.*,si.Number as InventoryNum
from rb_supplies_material sm
LEFT join RB_Supplies_Inventory si on si.SuppliesId=sm.Id AND si.Status=0
{
where
}
order by si.Id desc"
;
return
Get
<
RB_Supplies_Material_Extend
>(
sql
).
ToList
();
}
}
}
Mall.WebApi/Controllers/Property/WarehouseOutController.cs
View file @
a5d91c0b
...
...
@@ -146,8 +146,8 @@ namespace Mall.WebApi.Controllers.Property
//获取商品的出库规格物料信息
var
goodsIds
=
string
.
Join
(
","
,
demodel
.
WarehouseOutGoodsList
.
Select
(
x
=>
x
.
NewGoodsId
));
var
materialList
=
propertyModule
.
GetSuppliesMaterialList
(
new
RB_Supplies_Material_Extend
{
GoodsIds
=
goodsIds
,
RB_Group_Id
=
requestParm
.
ERPGroupId
,
TenantId
=
requestParm
.
TenantId
,
MallBaseId
=
requestParm
.
MallBaseId
});
var
materialList
=
propertyModule
.
GetSuppliesMaterialList
(
new
RB_Supplies_Material_Extend
{
GoodsIds
=
goodsIds
,
RB_Group_Id
=
requestParm
.
ERPGroupId
,
TenantId
=
requestParm
.
TenantId
,
MallBaseId
=
requestParm
.
MallBaseId
});
// var materialList = propertyModule.GetHaveInventory(new RB_Supplies_Material_Extend { GoodsIds = goodsIds, RB_Group_Id = requestParm.ERPGroupId, TenantId = requestParm.TenantId, MallBaseId = requestParm.MallBaseId });
foreach
(
var
item
in
demodel
.
WarehouseOutGoodsList
)
{
if
(
item
.
NewNumber
<=
0
)
...
...
@@ -164,6 +164,10 @@ namespace Mall.WebApi.Controllers.Property
{
return
ApiResult
.
Failed
(
"订单号:"
+
orderGoodsDetail
?.
OrderNo
+
"的商品:"
+
orderGoodsDetail
?.
GoodsName
+
"不存在物料请先同步"
);
}
//if (!materialModel.InventoryNum.HasValue || (materialModel.InventoryNum ?? 0) <= 0)
//{
// return ApiResult.Failed("订单号:" + orderGoodsDetail?.OrderNo + "的商品:" + orderGoodsDetail?.GoodsName + "库存不足");
//}
item
.
NewSpecificationSort
=
materialModel
.
SpecificationKey
;
item
.
NewSpecification
=
materialModel
.
SpecificationName
;
}
...
...
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