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
Show 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
REBORN.Common.AOP
;
using
REBORN.Common.Enum
;
using
REBORN.Common.Plugin
;
namespace
Property.Model.Entity
...
...
@@ -72,7 +73,7 @@ namespace Property.Model.Entity
/// <summary>
/// 盘点期数状态
/// </summary>
public
int
?
CheckState
public
SuppliesCheckStatusEnum
?
CheckState
{
get
;
set
;
...
...
Property.Model/Entity/Supplies/RB_Supplies_CheckDetail.cs
View file @
48770a79
...
...
@@ -55,14 +55,6 @@ namespace Property.Model.Entity
set
;
}
/// <summary>
/// 审核状态
/// </summary>
public
int
?
AuditStatus
{
get
;
set
;
}
/// <summary>
/// 盘点状态
/// </summary>
public
PropertyCheckStatusEnum
?
CheckStatus
...
...
@@ -87,22 +79,6 @@ namespace Property.Model.Entity
set
;
}
/// <summary>
/// 审核人
/// </summary>
public
int
?
AuditEmpId
{
get
;
set
;
}
/// <summary>
/// 审核时间
/// </summary>
public
DateTime
?
AuditDate
{
get
;
set
;
}
/// <summary>
/// 盘点图片列表 json格式
/// </summary>
public
string
Images
...
...
Property.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
View file @
48770a79
...
...
@@ -29,10 +29,18 @@ namespace Property.Model.Extend
/// 耗材的规格
/// </summary>
public
List
<
string
>
SpecificationList
{
get
;
set
;
}
/// <summary>
/// 图片列表
/// </summary>
public
List
<
string
>
ImageList
{
get
;
set
;
}
/// <summary>
/// 查询盘亏盘盈 1是
/// </summary>
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
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_Check_Extend
:
RB_Supplies_Check
{
/// <summary>
/// 仓库
/// </summary>
public
RB_Supplies_WareHouse_Extend
WModel
{
get
;
set
;
}
/// <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
...
...
@@ -68,9 +68,17 @@ namespace Property.Module.FixedAssets
/// 采购单明细
/// </summary>
private
readonly
RB_Procurement_DetailRepository
procurement_DetailRepository
=
new
RB_Procurement_DetailRepository
();
/// <summary>
/// 盘点单
/// </summary>
private
readonly
RB_Supplies_CheckRepository
supplies_CheckRepository
=
new
RB_Supplies_CheckRepository
();
/// <summary>
/// 盘点明细
/// </summary>
private
readonly
RB_Supplies_CheckDetailRepository
supplies_CheckDetailRepository
=
new
RB_Supplies_CheckDetailRepository
();
#
region
基础配置
/// <summary>
/// 获取物料详情
...
...
@@ -111,7 +119,7 @@ namespace Property.Module.FixedAssets
/// <returns></returns>
public
List
<
RB_Supplies_Material_Extend
>
GetMaterialPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_Material_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_MaterialRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
var
list
=
supplies_MaterialRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
List
<
RB_Supplies_Inventory_Extend
>
iList
=
new
List
<
RB_Supplies_Inventory_Extend
>();
if
(
demodel
.
WareHouseId
>
0
&&
list
.
Any
())
{
...
...
@@ -333,7 +341,7 @@ namespace Property.Module.FixedAssets
/// <returns></returns>
public
List
<
RB_Supplies_StockIn_Extend
>
GetStockInPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_StockIn_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_StockInRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
var
list
=
supplies_StockInRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
List
<
RB_Supplies_StockInDetail_Extend
>
sdList
=
new
List
<
RB_Supplies_StockInDetail_Extend
>();
if
(
list
.
Any
())
{
//查询出所有的耗材详细
...
...
@@ -484,7 +492,7 @@ namespace Property.Module.FixedAssets
model
.
UpdateBy
=
demodel
.
UpdateBy
;
model
.
UpdateDate
=
demodel
.
UpdateDate
;
model
.
StockInState
=
StockInStatusEnum
.
StockIn
;
bool
flag
=
supplies_StockInRepository
.
Update
(
model
,
trans
);
bool
flag
=
supplies_StockInRepository
.
Update
(
model
,
trans
);
if
(
flag
)
{
//更新明细
var
list
=
supplies_StockInDetailRepository
.
GetList
(
new
RB_Supplies_StockInDetail_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
StockInId
=
demodel
.
Id
});
...
...
@@ -685,7 +693,7 @@ namespace Property.Module.FixedAssets
{
//生产编号
demodel
.
StockInState
=
StockInStatusEnum
.
StockIn
;
int
Id
=
supplies_StockInRepository
.
Insert
(
demodel
,
trans
);
int
Id
=
supplies_StockInRepository
.
Insert
(
demodel
,
trans
);
if
(
Id
>
0
)
{
//编码自动生成
string
BMStr
=
Id
.
ToString
();
...
...
@@ -714,7 +722,7 @@ namespace Property.Module.FixedAssets
OperatorEnum
=
OperatorEnum
.
Equal
}
};
supplies_StockInRepository
.
Update
(
files
,
wheres
,
trans
);
supplies_StockInRepository
.
Update
(
files
,
wheres
,
trans
);
//新增明细
foreach
(
var
item
in
demodel
.
DetailList
)
{
...
...
@@ -734,7 +742,7 @@ namespace Property.Module.FixedAssets
UnitPrice
=
item
.
UnitPrice
,
UpdateBy
=
demodel
.
UpdateBy
,
UpdateDate
=
demodel
.
UpdateDate
},
trans
);
},
trans
);
//新增库存表数据
var
ilist
=
supplies_InventoryRepository
.
GetList
(
new
RB_Supplies_Inventory_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
WarehouseId
=
demodel
.
WarehouseId
,
SuppliesId
=
item
.
SuppliesId
});
...
...
@@ -743,7 +751,7 @@ namespace Property.Module.FixedAssets
var
iModel
=
ilist
.
FirstOrDefault
();
iModel
.
Number
+=
item
.
Number
;
//增加库存
iModel
.
Money
+=
item
.
Money
;
var
iflag
=
supplies_InventoryRepository
.
Update
(
iModel
,
trans
);
var
iflag
=
supplies_InventoryRepository
.
Update
(
iModel
,
trans
);
if
(
iflag
)
{
//增加库存明细
supplies_InventoryDetailRepository
.
Insert
(
new
RB_Supplies_InventoryDetail
()
...
...
@@ -752,7 +760,7 @@ namespace Property.Module.FixedAssets
CreateDate
=
DateTime
.
Now
,
InventoryId
=
iModel
.
Id
,
Number
=
item
.
Number
,
Money
=
item
.
Money
,
Money
=
item
.
Money
,
RB_Branch_Id
=
demodel
.
RB_Branch_Id
,
RB_Group_Id
=
demodel
.
RB_Group_Id
,
Status
=
0
,
...
...
@@ -778,7 +786,7 @@ namespace Property.Module.FixedAssets
UpdateBy
=
demodel
.
UpdateBy
,
UpdateDate
=
demodel
.
UpdateDate
,
WarehouseId
=
demodel
.
WarehouseId
},
trans
);
},
trans
);
if
(
iId
>
0
)
{
//增加库存明细
supplies_InventoryDetailRepository
.
Insert
(
new
RB_Supplies_InventoryDetail
()
...
...
@@ -787,7 +795,7 @@ namespace Property.Module.FixedAssets
CreateDate
=
DateTime
.
Now
,
InventoryId
=
iId
,
Number
=
item
.
Number
,
Money
=
item
.
Money
,
Money
=
item
.
Money
,
RB_Branch_Id
=
demodel
.
RB_Branch_Id
,
RB_Group_Id
=
demodel
.
RB_Group_Id
,
Status
=
0
,
...
...
@@ -820,7 +828,7 @@ namespace Property.Module.FixedAssets
/// <returns></returns>
public
RB_Supplies_StockOutDetail_Extend
GetRecipientsQueryTotal
(
RB_Supplies_StockOutDetail_Extend
demodel
)
{
var
list
=
supplies_StockOutDetailRepository
.
GetRecipientsQueryTotal
(
demodel
);
var
list
=
supplies_StockOutDetailRepository
.
GetRecipientsQueryTotal
(
demodel
);
return
list
.
FirstOrDefault
();
}
...
...
@@ -834,7 +842,7 @@ namespace Property.Module.FixedAssets
/// <returns></returns>
public
List
<
RB_Supplies_StockOutDetail_Extend
>
GetRecipientsQueryPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_StockOutDetail_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_StockOutDetailRepository
.
GetRecipientsQueryPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
var
list
=
supplies_StockOutDetailRepository
.
GetRecipientsQueryPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
List
<
RB_Branch_Extend
>
blist
=
new
List
<
RB_Branch_Extend
>();
List
<
RB_Department_Extend
>
dlist
=
new
List
<
RB_Department_Extend
>();
if
(
list
.
Any
())
{
...
...
@@ -878,7 +886,7 @@ namespace Property.Module.FixedAssets
string
wstr
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
WarehouseId
??
0
).
Distinct
());
string
sstr
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
SuppliesId
??
0
).
Distinct
());
//查询仓库
var
wlist
=
supplies_WareHouseRepository
.
GetList
(
new
RB_Supplies_WareHouse_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
WareHouseIdStr
=
wstr
});
var
wlist
=
supplies_WareHouseRepository
.
GetList
(
new
RB_Supplies_WareHouse_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
WareHouseIdStr
=
wstr
});
//查询耗材
var
mlist
=
supplies_MaterialRepository
.
GetList
(
new
RB_Supplies_Material_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
SuppliesIdStr
=
sstr
},
true
);
...
...
@@ -1213,7 +1221,7 @@ namespace Property.Module.FixedAssets
},
trans
);
//新增库存表数据
if
(
ilist
.
Any
()&&
demodel
.
StockOutState
==
StockOutStatusEnum
.
StockOut
)
if
(
ilist
.
Any
()
&&
demodel
.
StockOutState
==
StockOutStatusEnum
.
StockOut
)
{
var
iModel
=
ilist
.
FirstOrDefault
();
iModel
.
Number
-=
item
.
Number
;
//减少库存
...
...
@@ -1486,6 +1494,8 @@ namespace Property.Module.FixedAssets
return
flag
;
}
#
endregion
#
region
耗材申请日期设置
/// <summary>
/// 耗材申请设置分页列表
...
...
@@ -1497,7 +1507,7 @@ namespace Property.Module.FixedAssets
/// <returns></returns>
public
List
<
RB_Supplies_Applyfor_Extend
>
GetApplyForSetPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_Applyfor_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_ApplyforRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
var
list
=
supplies_ApplyforRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
var
slist
=
new
List
<
RB_Supplies_ApplyforWeekday_Extend
>();
var
aslist
=
new
List
<
RB_Supplies_ApplyforSpecial_Extend
>();
if
(
list
.
Any
())
{
...
...
@@ -1524,7 +1534,7 @@ namespace Property.Module.FixedAssets
{
if
(
demodel
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
files
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_Applyfor_Extend
.
BranchId
),
demodel
.
BranchId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
...
...
@@ -1540,7 +1550,7 @@ namespace Property.Module.FixedAssets
var
aslist
=
supplies_ApplyforSpecialRepository
.
GetList
(
new
RB_Supplies_ApplyforSpecial_Extend
()
{
ApplyforId
=
demodel
.
Id
});
//删除所有工作日信息
foreach
(
var
item
in
slist
)
{
supplies_ApplyforWeekdayRepository
.
Delete
(
item
,
trans
);
supplies_ApplyforWeekdayRepository
.
Delete
(
item
,
trans
);
}
//再新增
foreach
(
var
item
in
demodel
.
WeekdayList
)
...
...
@@ -1592,7 +1602,7 @@ namespace Property.Module.FixedAssets
//新增
demodel
.
Status
=
0
;
demodel
.
Enabled
=
1
;
//默认启用
int
Id
=
supplies_ApplyforRepository
.
Insert
(
demodel
,
trans
);
int
Id
=
supplies_ApplyforRepository
.
Insert
(
demodel
,
trans
);
if
(
Id
>
0
)
{
//写入工作日
...
...
@@ -1805,7 +1815,7 @@ namespace Property.Module.FixedAssets
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
RB_Procurement_Extend
GetProcurementInfo
(
int
procurementId
,
int
ERPGroupId
)
public
RB_Procurement_Extend
GetProcurementInfo
(
int
procurementId
,
int
ERPGroupId
)
{
var
pmodel
=
procurementRepository
.
GetEntity
<
RB_Procurement_Extend
>(
procurementId
);
//查询明细
...
...
@@ -1943,7 +1953,7 @@ namespace Property.Module.FixedAssets
return
new
{
Status
=
0
,
Msg
=
"查询成功"
,
Msg
=
"查询成功"
,
GoodsModel
=
new
{
WarehouseId
,
SuppliesId
,
...
...
@@ -1956,7 +1966,7 @@ namespace Property.Module.FixedAssets
materialModel
.
Units
,
StockInId
,
stockInModel
.
StockInNum
,
StockInDate
=
stockInModel
.
StockInDate
.
HasValue
?
stockInModel
.
StockInDate
.
Value
.
ToString
(
"yyyy-MM-dd"
):
""
,
StockInDate
=
stockInModel
.
StockInDate
.
HasValue
?
stockInModel
.
StockInDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
,
detModel
.
UnitPrice
}
};
...
...
@@ -2066,5 +2076,189 @@ namespace Property.Module.FixedAssets
}
#
endregion
#
region
盘点
/// <summary>
/// 获取盘点单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="demodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Check_Extend
>
GetSuppliesCheckPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_Check_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_CheckRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
if
(
list
.
Any
())
{
//查询仓库
var
wlist
=
supplies_WareHouseRepository
.
GetList
(
new
RB_Supplies_WareHouse_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
WareHouseIdStr
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
WarehouseId
??
0
).
Distinct
())
});
foreach
(
var
item
in
list
)
{
var
wmodel
=
wlist
.
Where
(
x
=>
x
.
Id
==
item
.
WarehouseId
).
FirstOrDefault
();
item
.
WarehouseName
=
wmodel
?.
Name
??
""
;
}
}
return
list
;
}
/// <summary>
/// 新增修改盘点单
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
SetSuppliesCheck
(
RB_Supplies_Check_Extend
demodel
)
{
var
trans
=
supplies_CheckRepository
.
DbTransaction
;
try
{
if
(
demodel
.
Id
>
0
)
{
var
model
=
supplies_CheckRepository
.
GetEntity
(
demodel
.
Id
);
model
.
StartDate
=
demodel
.
StartDate
;
model
.
EndDate
=
demodel
.
EndDate
;
model
.
UpdateBy
=
demodel
.
UpdateBy
;
model
.
UpdateDate
=
demodel
.
UpdateDate
;
var
flag
=
supplies_CheckRepository
.
Update
(
model
,
trans
);
supplies_CheckRepository
.
DBSession
.
Commit
();
return
true
;
}
else
{
demodel
.
Periods
=
DateTime
.
Now
.
ToString
(
"yyyyMMdd"
);
int
Id
=
supplies_CheckRepository
.
Insert
(
demodel
,
trans
);
if
(
Id
>
0
)
{
//根据仓库 查询出所有物料的库存
var
list
=
supplies_MaterialRepository
.
GetSuppliesCheckMaterialList
(
demodel
.
WarehouseId
,
demodel
.
RB_Group_Id
);
foreach
(
var
item
in
list
)
{
supplies_CheckDetailRepository
.
Insert
(
new
RB_Supplies_CheckDetail
()
{
CheckStatus
=
PropertyCheckStatusEnum
.
NoInventory
,
CheckDate
=
null
,
CheckEmpId
=
0
,
CheckId
=
Id
,
Id
=
0
,
CreateBy
=
demodel
.
CreateBy
,
CreateDate
=
demodel
.
CreateDate
,
SuppliesId
=
item
.
Id
,
RB_Branch_Id
=
demodel
.
RB_Branch_Id
,
RB_Group_Id
=
demodel
.
RB_Group_Id
,
Remark
=
""
,
Status
=
0
,
UpdateBy
=
demodel
.
UpdateBy
,
UpdateDate
=
demodel
.
UpdateDate
,
DealStatus
=
2
,
FinanceId
=
0
,
Images
=
""
,
InventoryNum
=
item
.
InventoryNum
,
RealityNum
=
0
},
trans
);
}
}
supplies_CheckRepository
.
DBSession
.
Commit
();
return
true
;
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"SetSuppliesCheck"
);
supplies_CheckRepository
.
DBSession
.
Rollback
();
return
false
;
}
}
/// <summary>
/// 获取盘点单
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Supplies_Check_Extend
GetSuppliesCheck
(
int
Id
)
{
return
supplies_CheckRepository
.
GetEntity
<
RB_Supplies_Check_Extend
>(
Id
);
}
/// <summary>
/// 取消盘点
/// </summary>
/// <param name="checkId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
CancelSuppliesCheck
(
int
checkId
,
UserInfo
userInfo
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_Check_Extend
.
CheckState
),
SuppliesCheckStatusEnum
.
Cancel
},
{
nameof
(
RB_Supplies_Check_Extend
.
UpdateBy
),
userInfo
.
EmployeeId
},
{
nameof
(
RB_Supplies_Check_Extend
.
UpdateDate
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_Check_Extend
.
Id
),
FiledValue
=
checkId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
supplies_CheckRepository
.
Update
(
keyValues
,
wheres
);
return
flag
;
}
/// <summary>
/// 盘点单复盘
/// </summary>
/// <param name="checkId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
RepeatSuppliesCheck
(
int
checkId
,
UserInfo
userInfo
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_Check_Extend
.
CheckState
),
SuppliesCheckStatusEnum
.
InTheInventory
},
{
nameof
(
RB_Supplies_Check_Extend
.
UpdateBy
),
userInfo
.
EmployeeId
},
{
nameof
(
RB_Supplies_Check_Extend
.
UpdateDate
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_Check_Extend
.
Id
),
FiledValue
=
checkId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
supplies_CheckRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//是否需要重置盘点明细的盘点状态
}
return
flag
;
}
/// <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
>
GetSuppliesCheckDetailPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_CheckDetail_Extend
demodel
,
out
long
count
)
{
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
);
}
}
}
return
list
;
}
#
endregion
}
}
Property.Repository/Supplies/RB_
Property
_CheckDetailRepository.cs
→
Property.Repository/Supplies/RB_
Supplies
_CheckDetailRepository.cs
View file @
48770a79
...
...
@@ -37,10 +37,6 @@ namespace Property.Repository
{
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
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
...
...
@@ -53,6 +49,9 @@ namespace Property.Repository
{
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
left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
where
}
order by cd.Id desc"
;
...
...
@@ -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
+
"%'"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
AuditStatus
)
+
"="
+
dmodel
.
AuditStatus
;
}
if
(
dmodel
.
CheckStatus
>
0
)
{
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
if
(
dmodel
.
WarehouseId
>
0
)
{
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"
;
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
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
{
readonly
SuppliesModule
suppliesModule
=
new
SuppliesModule
();
#
region
基础配置
/// <summary>
/// 获取物料档案分页列表
...
...
@@ -1155,6 +1156,7 @@ namespace Property.WebApi.Controllers.User
}
}
#
endregion
#
region
耗材申请日期
...
...
@@ -1575,5 +1577,190 @@ namespace Property.WebApi.Controllers.User
}
#
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