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
48770a79
Commit
48770a79
authored
Jul 27, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盘点明细
parent
f17dab63
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
466 additions
and
67 deletions
+466
-67
SuppliesCheckStatusEnum.cs
Property.Common/Enum/Property/SuppliesCheckStatusEnum.cs
+26
-0
RB_Supplies_Check.cs
Property.Model/Entity/Supplies/RB_Supplies_Check.cs
+2
-1
RB_Supplies_CheckDetail.cs
Property.Model/Entity/Supplies/RB_Supplies_CheckDetail.cs
+0
-24
RB_Supplies_CheckDetail_Extend.cs
...y.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
+8
-0
RB_Supplies_Check_Extend.cs
Property.Model/Extend/Supplies/RB_Supplies_Check_Extend.cs
+2
-7
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+221
-27
RB_Supplies_CheckDetailRepository.cs
....Repository/Supplies/RB_Supplies_CheckDetailRepository.cs
+3
-8
RB_Supplies_CheckRepository.cs
Property.Repository/Supplies/RB_Supplies_CheckRepository.cs
+3
-0
RB_Supplies_MaterialRepository.cs
...rty.Repository/Supplies/RB_Supplies_MaterialRepository.cs
+14
-0
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+187
-0
No files found.
Property.Common/Enum/Property/SuppliesCheckStatusEnum.cs
0 → 100644
View file @
48770a79
using
REBORN.Common.Plugin
;
namespace
REBORN.Common.Enum
{
/// <summary>
/// 数据状态
/// </summary>
public
enum
SuppliesCheckStatusEnum
{
/// <summary>
/// 盘点中
/// </summary>
[
EnumField
(
"盘点中"
)]
InTheInventory
=
1
,
/// <summary>
/// 已完成
/// </summary>
[
EnumField
(
"已完成"
)]
Completed
=
2
,
/// <summary>
/// 已取消
/// </summary>
[
EnumField
(
"已取消"
)]
Cancel
=
3
}
}
Property.Model/Entity/Supplies/RB_Supplies_Check.cs
View file @
48770a79
using
System
;
using
System
;
using
REBORN.Common.AOP
;
using
REBORN.Common.AOP
;
using
REBORN.Common.Enum
;
using
REBORN.Common.Plugin
;
using
REBORN.Common.Plugin
;
namespace
Property.Model.Entity
namespace
Property.Model.Entity
...
@@ -72,7 +73,7 @@ namespace Property.Model.Entity
...
@@ -72,7 +73,7 @@ namespace Property.Model.Entity
/// <summary>
/// <summary>
/// 盘点期数状态
/// 盘点期数状态
/// </summary>
/// </summary>
public
int
?
CheckState
public
SuppliesCheckStatusEnum
?
CheckState
{
{
get
;
get
;
set
;
set
;
...
...
Property.Model/Entity/Supplies/RB_Supplies_CheckDetail.cs
View file @
48770a79
...
@@ -55,14 +55,6 @@ namespace Property.Model.Entity
...
@@ -55,14 +55,6 @@ namespace Property.Model.Entity
set
;
set
;
}
}
/// <summary>
/// <summary>
/// 审核状态
/// </summary>
public
int
?
AuditStatus
{
get
;
set
;
}
/// <summary>
/// 盘点状态
/// 盘点状态
/// </summary>
/// </summary>
public
PropertyCheckStatusEnum
?
CheckStatus
public
PropertyCheckStatusEnum
?
CheckStatus
...
@@ -87,22 +79,6 @@ namespace Property.Model.Entity
...
@@ -87,22 +79,6 @@ namespace Property.Model.Entity
set
;
set
;
}
}
/// <summary>
/// <summary>
/// 审核人
/// </summary>
public
int
?
AuditEmpId
{
get
;
set
;
}
/// <summary>
/// 审核时间
/// </summary>
public
DateTime
?
AuditDate
{
get
;
set
;
}
/// <summary>
/// 盘点图片列表 json格式
/// 盘点图片列表 json格式
/// </summary>
/// </summary>
public
string
Images
public
string
Images
...
...
Property.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
View file @
48770a79
...
@@ -29,10 +29,18 @@ namespace Property.Model.Extend
...
@@ -29,10 +29,18 @@ namespace Property.Model.Extend
/// 耗材的规格
/// 耗材的规格
/// </summary>
/// </summary>
public
List
<
string
>
SpecificationList
{
get
;
set
;
}
public
List
<
string
>
SpecificationList
{
get
;
set
;
}
/// <summary>
/// 图片列表
/// </summary>
public
List
<
string
>
ImageList
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 查询盘亏盘盈 1是
/// 查询盘亏盘盈 1是
/// </summary>
/// </summary>
public
int
?
IsSelectCheckLoss
{
get
;
set
;
}
public
int
?
IsSelectCheckLoss
{
get
;
set
;
}
/// <summary>
/// 只看有库存的
/// </summary>
public
int
?
IsSelectHaveInventory
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Property.Model/Extend/Supplies/RB_Supplies_Check_Extend.cs
View file @
48770a79
...
@@ -12,14 +12,9 @@ namespace Property.Model.Extend
...
@@ -12,14 +12,9 @@ namespace Property.Model.Extend
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_Check_Extend
:
RB_Supplies_Check
public
class
RB_Supplies_Check_Extend
:
RB_Supplies_Check
{
{
/// <summary>
/// 仓库
/// </summary>
public
RB_Supplies_WareHouse_Extend
WModel
{
get
;
set
;
}
/// <summary>
/// <summary>
///
耗
材
///
仓
库名称
/// </summary>
/// </summary>
public
RB_Supplies_Material_Extend
SModel
{
get
;
set
;
}
public
string
WarehouseName
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
48770a79
This diff is collapsed.
Click to expand it.
Property.Repository/Supplies/RB_
Property
_CheckDetailRepository.cs
→
Property.Repository/Supplies/RB_
Supplies
_CheckDetailRepository.cs
View file @
48770a79
...
@@ -37,10 +37,6 @@ namespace Property.Repository
...
@@ -37,10 +37,6 @@ namespace Property.Repository
{
{
where
+=
" and pi."
+
nameof
(
RB_Supplies_Material
.
Name
)
+
" like '%"
+
dmodel
.
SuppliesName
+
"%'"
;
where
+=
" and pi."
+
nameof
(
RB_Supplies_Material
.
Name
)
+
" like '%"
+
dmodel
.
SuppliesName
+
"%'"
;
}
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
AuditStatus
)
+
"="
+
dmodel
.
AuditStatus
;
}
if
(
dmodel
.
CheckStatus
>
0
)
if
(
dmodel
.
CheckStatus
>
0
)
{
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
...
@@ -53,6 +49,9 @@ namespace Property.Repository
...
@@ -53,6 +49,9 @@ namespace Property.Repository
{
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
" in(3,4)"
;
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
" in(3,4)"
;
}
}
if
(
dmodel
.
IsSelectHaveInventory
==
1
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
InventoryNum
)
+
">0"
;
}
string
sql
=
$@" select cd.*,pi.Name as SuppliesName,pi.SuppliesNo,pi.SpecificationName from RB_Supplies_CheckDetail cd
string
sql
=
$@" select cd.*,pi.Name as SuppliesName,pi.SuppliesNo,pi.SpecificationName from RB_Supplies_CheckDetail cd
left join rb_supplies_material pi on cd.SuppliesId=pi.Id
left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
where
}
order by cd.Id desc"
;
{
where
}
order by cd.Id desc"
;
...
@@ -81,10 +80,6 @@ left join rb_supplies_material pi on cd.SuppliesId=pi.Id
...
@@ -81,10 +80,6 @@ left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
{
where
+=
" and pi."
+
nameof
(
RB_Supplies_Material
.
Name
)
+
" like '%"
+
dmodel
.
SuppliesName
+
"%'"
;
where
+=
" and pi."
+
nameof
(
RB_Supplies_Material
.
Name
)
+
" like '%"
+
dmodel
.
SuppliesName
+
"%'"
;
}
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
AuditStatus
)
+
"="
+
dmodel
.
AuditStatus
;
}
if
(
dmodel
.
CheckStatus
>
0
)
if
(
dmodel
.
CheckStatus
>
0
)
{
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
...
...
Property.Repository/Supplies/RB_Supplies_CheckRepository.cs
View file @
48770a79
...
@@ -35,6 +35,9 @@ namespace Property.Repository
...
@@ -35,6 +35,9 @@ namespace Property.Repository
if
(
dmodel
.
WarehouseId
>
0
)
{
if
(
dmodel
.
WarehouseId
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
}
}
if
(
dmodel
.
CheckState
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
CheckState
)
+
"="
+
(
int
)
dmodel
.
CheckState
;
}
string
sql
=
$@" select * from RB_Supplies_Check
{
where
}
order by Id desc"
;
string
sql
=
$@" select * from RB_Supplies_Check
{
where
}
order by Id desc"
;
return
GetPage
<
RB_Supplies_Check_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
return
GetPage
<
RB_Supplies_Check_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
...
...
Property.Repository/Supplies/RB_Supplies_MaterialRepository.cs
View file @
48770a79
...
@@ -96,5 +96,19 @@ left join rb_property_category pc on sm.CategoryId=pc.Id
...
@@ -96,5 +96,19 @@ left join rb_property_category pc on sm.CategoryId=pc.Id
return
Get
<
RB_Supplies_Material_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Supplies_Material_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 获取仓库下所有的物料
/// </summary>
/// <param name="warehouseId"></param>
/// <param name="rB_Group_Id"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Material_Extend
>
GetSuppliesCheckMaterialList
(
int
?
warehouseId
,
int
?
rB_Group_Id
)
{
string
sql
=
$@" select sm.*,si.Number as InventoryNum from RB_Supplies_Material sm
inner join rb_supplies_inventory si on sm.Id = si.SuppliesId
where sm.Status=0 and si.WarehouseId =
{
warehouseId
}
and sm.RB_Group_Id =
{
rB_Group_Id
}
order by sm.Id desc"
;
return
Get
<
RB_Supplies_Material_Extend
>(
sql
).
ToList
();
}
}
}
}
}
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
48770a79
...
@@ -16,6 +16,7 @@ namespace Property.WebApi.Controllers.User
...
@@ -16,6 +16,7 @@ namespace Property.WebApi.Controllers.User
{
{
readonly
SuppliesModule
suppliesModule
=
new
SuppliesModule
();
readonly
SuppliesModule
suppliesModule
=
new
SuppliesModule
();
#
region
基础配置
/// <summary>
/// <summary>
/// 获取物料档案分页列表
/// 获取物料档案分页列表
...
@@ -1155,6 +1156,7 @@ namespace Property.WebApi.Controllers.User
...
@@ -1155,6 +1156,7 @@ namespace Property.WebApi.Controllers.User
}
}
}
}
#
endregion
#
region
耗材申请日期
#
region
耗材申请日期
...
@@ -1575,5 +1577,190 @@ namespace Property.WebApi.Controllers.User
...
@@ -1575,5 +1577,190 @@ namespace Property.WebApi.Controllers.User
}
}
#
endregion
#
endregion
#
region
耗材盘点
/// <summary>
/// 获取盘点单分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSuppliesCheckPageList
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
RB_Supplies_Check_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Check_Extend
>(
requestParm
.
msg
.
ToString
());
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
var
list
=
suppliesModule
.
GetSuppliesCheckPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
demodel
,
out
long
count
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Periods
,
x
.
WarehouseName
,
x
.
WarehouseId
,
StartDate
=
x
.
StartDate
.
HasValue
?
x
.
StartDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
EndDate
=
x
.
EndDate
.
HasValue
?
x
.
EndDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
CheckState
,
CheckStateName
=
x
.
CheckState
.
GetEnumName
(),
x
.
Remark
,
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
SetSuppliesCheck
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
RB_Supplies_Check_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Check_Extend
>(
requestParm
.
msg
.
ToString
());
if
((
demodel
.
WarehouseId
??
0
)
<=
0
)
{
return
ApiResult
.
Failed
(
"请选择仓库"
);
}
if
(!
demodel
.
StartDate
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请选择开始时间"
);
}
if
(!
demodel
.
EndDate
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请选择结束时间"
);
}
demodel
.
Status
=
0
;
demodel
.
CheckState
=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
InTheInventory
;
demodel
.
RB_Branch_Id
=
userInfo
.
RB_Branch_id
;
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
demodel
.
CreateBy
=
userInfo
.
EmployeeId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateBy
=
userInfo
.
EmployeeId
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
suppliesModule
.
SetSuppliesCheck
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 取消盘点
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
CancelSuppliesCheck
()
{
RequestParm
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
CheckId
=
parms
.
GetInt
(
"CheckId"
,
0
);
if
(
CheckId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数id"
);
}
var
cmodel
=
suppliesModule
.
GetSuppliesCheck
(
CheckId
);
if
(
cmodel
==
null
)
{
return
ApiResult
.
Failed
(
"盘点单不存在"
);
}
if
(
cmodel
.
CheckState
!=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
InTheInventory
)
{
return
ApiResult
.
Failed
(
"盘点单无法取消"
);
}
bool
flag
=
suppliesModule
.
CancelSuppliesCheck
(
CheckId
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 盘点单复盘
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
RepeatSuppliesCheck
()
{
RequestParm
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
CheckId
=
parms
.
GetInt
(
"CheckId"
,
0
);
if
(
CheckId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数id"
);
}
var
cmodel
=
suppliesModule
.
GetSuppliesCheck
(
CheckId
);
if
(
cmodel
==
null
)
{
return
ApiResult
.
Failed
(
"盘点单不存在"
);
}
if
(
cmodel
.
CheckState
!=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
Completed
)
{
return
ApiResult
.
Failed
(
"盘点单无法复盘"
);
}
bool
flag
=
suppliesModule
.
RepeatSuppliesCheck
(
CheckId
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取盘点明细列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSuppliesCheckDetailPageList
()
{
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
;
var
list
=
suppliesModule
.
GetSuppliesCheckDetailPageList
(
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
.
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"
)
:
""
,
DealStatus
=
x
.
DealStatus
??
0
,
UpdateBy
=
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
UpdateBy
)?.
EmName
??
""
,
UpdateDate
=
x
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
});
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