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
65bbae6a
Commit
65bbae6a
authored
Jul 28, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报损/报溢列表
parent
a56a994f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
0 deletions
+110
-0
RB_Supplies_CheckDetail_Extend.cs
...y.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
+4
-0
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+39
-0
RB_Supplies_CheckDetailRepository.cs
....Repository/Supplies/RB_Supplies_CheckDetailRepository.cs
+22
-0
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+45
-0
No files found.
Property.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
View file @
65bbae6a
...
...
@@ -46,5 +46,9 @@ namespace Property.Model.Extend
/// ids
/// </summary>
public
string
CheckDetailIds
{
get
;
set
;
}
/// <summary>
/// 单价
/// </summary>
public
decimal
Unit_Money
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
65bbae6a
...
...
@@ -2259,6 +2259,45 @@ namespace Property.Module.FixedAssets
return
list
;
}
/// <summary>
/// 获取盘点报损/报溢列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="demodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_CheckDetail_Extend
>
GetSuppliesCheckDetailBreakagePageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_CheckDetail_Extend
demodel
,
out
long
count
)
{
var
cmodel
=
supplies_CheckRepository
.
GetEntity
(
demodel
.
CheckId
);
if
(
cmodel
==
null
)
{
count
=
0
;
return
new
List
<
RB_Supplies_CheckDetail_Extend
>();
}
var
list
=
supplies_CheckDetailRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
if
(
list
.
Any
())
{
//组装规格
foreach
(
var
item
in
list
)
{
item
.
SpecificationList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
SpecificationName
)
&&
item
.
SpecificationName
!=
"[]"
)
{
item
.
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
SpecificationName
);
}
item
.
ImageList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Images
)
&&
item
.
Images
!=
"[]"
)
{
item
.
ImageList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
Images
);
}
//查询最新入库价格
item
.
Unit_Money
=
supplies_CheckDetailRepository
.
GetSuppliesNewPrice
(
cmodel
.
WarehouseId
??
0
,
item
.
SuppliesId
??
0
);
}
}
return
list
;
}
/// <summary>
/// 验证盘点单状态
/// </summary>
...
...
Property.Repository/Supplies/RB_Supplies_CheckDetailRepository.cs
View file @
65bbae6a
...
...
@@ -4,6 +4,7 @@ using REBORN.Common.Enum;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System
;
namespace
Property.Repository
{
...
...
@@ -100,5 +101,26 @@ left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
where
}
order by cd.Id desc"
;
return
Get
<
RB_Supplies_CheckDetail_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取物料最新的价格
/// </summary>
/// <param name="WarehouseId"></param>
/// <param name="SuppliesId"></param>
/// <returns></returns>
public
decimal
GetSuppliesNewPrice
(
int
WarehouseId
,
int
SuppliesId
)
{
string
sql
=
$@"SELECT sd.UnitPrice FROM rb_supplies_stockin si
INNER JOIN rb_supplies_stockindetail sd on si.Id=sd.StockInId
WHERE si.WarehouseId=
{
WarehouseId
}
AND sd.SuppliesId=
{
SuppliesId
}
and si.StockInState=1 ORDER BY sd.CreateDate DESC LIMIT 1;"
;
var
obj
=
ExecuteScalar
(
sql
);
if
(
obj
!=
null
)
{
return
Convert
.
ToDecimal
(
obj
);
}
else
{
return
0
;
}
}
}
}
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
65bbae6a
...
...
@@ -1959,6 +1959,51 @@ namespace Property.WebApi.Controllers.User
}
}
/// <summary>
/// 获取盘点报损/报溢列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSuppliesCheckDetailBreakagePageList
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
RB_Supplies_CheckDetail_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_CheckDetail_Extend
>(
requestParm
.
msg
.
ToString
());
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
if
(
demodel
.
CheckStatus
!=
REBORN
.
Common
.
Enum
.
PropertyCheckStatusEnum
.
InventoryLosses
&&
demodel
.
CheckStatus
!=
REBORN
.
Common
.
Enum
.
PropertyCheckStatusEnum
.
InventoryProfit
)
{
demodel
.
IsSelectCheckLoss
=
1
;
}
if
(
demodel
.
CheckId
<=
0
)
{
return
ApiResult
.
Failed
(
"请传递盘点单id"
);
}
var
list
=
suppliesModule
.
GetSuppliesCheckDetailBreakagePageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
demodel
,
out
long
count
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
CheckStatus
,
CheckStatusName
=
x
.
CheckStatus
.
GetEnumName
(),
x
.
Remark
,
x
.
SuppliesNo
,
x
.
SuppliesId
,
x
.
SuppliesName
,
x
.
SpecificationList
,
x
.
InventoryNum
,
x
.
RealityNum
,
x
.
ImageList
,
x
.
Unit_Money
,
x
.
CheckEmpId
,
CheckEmpName
=
x
.
CheckEmpId
.
HasValue
&&
x
.
CheckEmpId
>
0
?
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
CheckEmpId
)?.
EmName
:
""
,
CheckDate
=
x
.
CheckDate
.
HasValue
?
x
.
CheckDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
DealStatus
=
x
.
DealStatus
??
0
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
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