Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Property
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
liudong1993
Property
Commits
f925c6c6
Commit
f925c6c6
authored
Jul 16, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
c8575570
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
152 additions
and
0 deletions
+152
-0
WarehouseController.cs
Property.WebApi/Controllers/Mall/WarehouseController.cs
+152
-0
No files found.
Property.WebApi/Controllers/Mall/WarehouseController.cs
0 → 100644
View file @
f925c6c6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Property.Model.Extend
;
using
Property.Model.Extend.Mall
;
using
Property.Module.FixedAssets
;
using
Property.Module.Mall
;
using
Property.WebApi.Filter
;
using
REBORN.Common.API
;
using
REBORN.Common.Plugin
;
namespace
Property.WebApi.Controllers.Mall
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
WarehouseController
:
ControllerBase
{
private
readonly
SuppliesModule
suppliesModule
=
new
SuppliesModule
();
private
readonly
WarehouseOutModule
warehouseOutModule
=
new
WarehouseOutModule
();
/// <summary>
/// 获取申请单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetWarehouseOutApply
(
object
requestMsg
)
{
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
RB_WarehouseOut_Apply_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_WarehouseOut_Apply_Extend
>(
requestParm
.
msg
.
ToString
());
if
(
demodel
.
ID
<=
0
)
{
return
ApiResult
.
Failed
(
"请选择您要操作的数据"
);
}
var
oldModel
=
warehouseOutModule
.
GetApplyEntity
(
demodel
.
ID
).
RefMapperTo
<
RB_WarehouseOut_Apply_Extend
>();
if
(
oldModel
!=
null
)
{
oldModel
.
WarehouseOutGoodsList
=
new
List
<
RB_WarehouseOut_Goods_Extend
>();
oldModel
.
WarehouseOutGoodsList
=
warehouseOutModule
.
GetWarehouseOutList
(
new
RB_WarehouseOut_Goods_Extend
{
ApplyId
=
demodel
.
ID
});
}
return
ApiResult
.
Success
(
""
,
oldModel
);
}
/// <summary>
/// 获取出库单分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStockOutPageList
(
object
requestMsg
)
{
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
RB_Supplies_StockOut_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_StockOut_Extend
>(
requestParm
.
msg
.
ToString
());
List
<
RB_Supplies_StockOut_Extend
>
list
=
suppliesModule
.
GetStockOutPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
demodel
,
out
long
count
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
StockOutState
,
StockOutStateStr
=
x
.
StockOutState
.
GetEnumName
(),
StockOutDate
=
x
.
StockOutDate
.
HasValue
?
x
.
StockOutDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
,
x
.
StockOutNum
,
x
.
WareHouseName
,
x
.
WarehouseId
,
x
.
Remark
,
x
.
EmployeeId
,
EmName
=
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
EmployeeId
)?.
EmName
??
""
,
DetailList
=
x
.
DetailList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
CategoryName
,
z
.
Number
,
z
.
SuppliesName
,
z
.
SuppliesNum
,
z
.
BrandName
,
z
.
SuppliesModel
,
z
.
SuppliesId
,
z
.
Units
,
z
.
Remark
,
z
.
InventoryNum
,
z
.
GoodsSpecificationList
,
z
.
GoodsCategoryList
}),
UpdateBy
=
(
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
UpdateBy
)?.
EmName
??
""
),
UpdateDate
=
x
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取采购单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProcurementInfo
(
object
requestMsg
)
{
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
ProcurementId
=
parms
.
GetInt
(
"ProcurementId"
,
0
);
int
RB_Group_id
=
parms
.
GetInt
(
"RB_Group_id"
,
0
);
if
(
ProcurementId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
var
model
=
suppliesModule
.
GetProcurementInfo
(
ProcurementId
,
RB_Group_id
);
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
WareHouseId
,
model
.
WareHouseName
,
model
.
TotalCostMoney
,
model
.
TotalNumber
,
model
.
Remark
,
model
.
StockInStatus
,
DetailList
=
model
.
DetailList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
MaterialId
,
y
.
CostMoney
,
y
.
Number
,
y
.
StockInNum
,
MaterialModel
=
new
{
y
.
MaterialModel
.
Name
,
y
.
MaterialModel
.
SuppliesNum
,
y
.
MaterialModel
.
Units
,
y
.
MaterialModel
.
Money
,
y
.
MaterialModel
.
GoodsSpecificationList
,
y
.
MaterialModel
.
GoodsCategoryList
,
y
.
MaterialModel
.
GoodsId
,
y
.
MaterialModel
.
SpecificationKey
,
y
.
MaterialModel
.
ImageList
}
}),
model
.
FinanceId
});
}
}
}
\ No newline at end of file
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