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
01d28121
Commit
01d28121
authored
Jul 07, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购单
parent
6689189e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
5 deletions
+107
-5
PropertyModule.cs
Mall.Module.Property/PropertyModule.cs
+55
-1
RB_EmployeeRepository.cs
Mall.Repository/User/RB_EmployeeRepository.cs
+3
-0
PropertyController.cs
Mall.WebApi/Controllers/Property/PropertyController.cs
+49
-4
No files found.
Mall.Module.Property/PropertyModule.cs
View file @
01d28121
...
...
@@ -85,6 +85,7 @@ namespace Mall.Module.Property
private
readonly
RB_Supplies_WareHouseRepository
supplies_WareHouseRepository
=
new
RB_Supplies_WareHouseRepository
();
#
region
获取采购单
/// <summary>
...
...
@@ -132,7 +133,7 @@ namespace Mall.Module.Property
}
}
}
var
elist
=
employeeRepository
.
GetEmployeeListRepository
(
new
RB_Employee_Extend
()
{
EmployeeIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
CreateBy
??
0
).
Distinct
())
});
var
elist
=
employeeRepository
.
GetEmployeeListRepository
(
new
Model
.
Entity
.
User
.
RB_Employee_Extend
()
{
EmployeeIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
CreateBy
??
0
).
Distinct
())
});
var
wlist
=
supplies_WareHouseRepository
.
GetList
(
new
RB_Supplies_WareHouse_Extend
()
{
WareHouseIdStr
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
WareHouseId
??
0
).
Distinct
())
});
foreach
(
var
item
in
list
)
{
item
.
DetailList
=
pdList
.
Where
(
x
=>
x
.
ProcurementId
==
item
.
Id
).
ToList
();
...
...
@@ -143,6 +144,59 @@ namespace Mall.Module.Property
return
list
;
}
/// <summary>
/// 获取采购单详情
/// </summary>
/// <param name="procurementId"></param>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
RB_Procurement_Extend
GetProcurementInfo
(
int
procurementId
,
int
TenantId
,
int
MallBaseId
)
{
var
pmodel
=
procurementRepository
.
GetEntity
<
RB_Procurement_Extend
>(
procurementId
);
//查询明细
var
pdList
=
procurement_DetailRepository
.
GetList
(
new
RB_Procurement_Detail_Extend
()
{
ProcurementId
=
procurementId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
//查询物料
if
(
pdList
.
Any
())
{
string
MaterialIds
=
string
.
Join
(
","
,
pdList
.
Select
(
x
=>
x
.
MaterialId
).
Distinct
());
var
mList
=
supplies_MaterialRepository
.
GetList
(
new
RB_Supplies_Material_Extend
()
{
SuppliesIdStr
=
MaterialIds
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
pdList
)
{
item
.
MaterialModel
=
mList
.
Where
(
x
=>
x
.
Id
==
item
.
MaterialId
).
FirstOrDefault
();
if
(
item
.
MaterialModel
!=
null
)
{
item
.
MaterialModel
.
GoodsSpecificationList
=
new
List
<
string
>();
item
.
MaterialModel
.
GoodsCategoryList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
MaterialModel
.
SpecificationName
))
{
item
.
MaterialModel
.
GoodsSpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
MaterialModel
.
SpecificationName
);
}
if
(!
string
.
IsNullOrEmpty
(
item
.
MaterialModel
.
GoodsCategoryName
))
{
item
.
MaterialModel
.
GoodsCategoryList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
MaterialModel
.
GoodsCategoryName
);
}
if
(
item
.
MaterialModel
.
Images
==
""
||
item
.
MaterialModel
.
Images
==
null
)
{
item
.
MaterialModel
.
Images
=
"[]"
;
}
var
imglist
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
MaterialModel
.
Images
);
item
.
MaterialModel
.
ImageList
=
new
List
<
string
>();
}
else
{
item
.
MaterialModel
=
new
RB_Supplies_Material_Extend
();
}
}
}
var
wlist
=
supplies_WareHouseRepository
.
GetList
(
new
RB_Supplies_WareHouse_Extend
()
{
WareHouseIdStr
=
(
pmodel
.
WareHouseId
??
0
).
ToString
()
});
pmodel
.
DetailList
=
pdList
;
pmodel
.
WareHouseName
=
wlist
.
FirstOrDefault
()?.
Name
??
""
;
return
pmodel
;
}
/// <summary>
/// 提交采购单
/// </summary>
...
...
Mall.Repository/User/RB_EmployeeRepository.cs
View file @
01d28121
...
...
@@ -69,6 +69,9 @@ namespace Mall.Repository.User
{
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Employee_Extend
.
EmpName
),
query
.
EmpName
.
Trim
());
}
if
(!
string
.
IsNullOrEmpty
(
query
.
EmployeeIds
))
{
builder
.
AppendFormat
(
" AND {0} in({1}) "
,
nameof
(
RB_Employee_Extend
.
EmpId
),
query
.
EmployeeIds
);
}
return
Get
<
RB_Employee_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.WebApi/Controllers/Property/PropertyController.cs
View file @
01d28121
...
...
@@ -78,14 +78,59 @@ namespace Mall.WebApi.Controllers.MallBase
}
/// <summary>
/// 获取
商品规格列表
/// 获取
采购单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGoodsToProcurementPageList
()
{
public
ApiResult
GetProcurementInfo
()
{
var
requestParm
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
ProcurementId
=
parms
.
GetInt
(
"ProcurementId"
,
0
);
if
(
ProcurementId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
var
model
=
propertyModule
.
GetProcurementInfo
(
ProcurementId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
WareHouseId
,
model
.
WareHouseName
,
model
.
TotalCostMoney
,
model
.
TotalNumber
,
model
.
Remark
,
DetailList
=
model
.
DetailList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
MaterialId
,
y
.
CostMoney
,
y
.
Number
,
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
});
}
/// <summary>
/// 获取商品规格列表
/// </summary>
/// <returns></returns>
//[HttpPost]
//public ApiResult GetGoodsToProcurementPageList() {
//}
/// <summary>
/// 提交采购单
/// </summary>
...
...
@@ -122,7 +167,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
string
msg
=
propertyModule
.
SetProcurementInfo
(
demodel
,
requestParm
.
ERPEmpId
,
requestParm
.
ERPBranchId
,
requestParm
.
ERPGroupId
,
requestParm
.
EmpId
);
string
msg
=
propertyModule
.
SetProcurementInfo
(
demodel
,
requestParm
.
ERPEmpId
,
requestParm
.
ERPBranchId
,
requestParm
.
ERPGroupId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
EmpId
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
...
...
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