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
dbe550e8
Commit
dbe550e8
authored
Jul 28, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
耗材盘点
parent
91012ee6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
398 additions
and
3 deletions
+398
-3
SuppliesCheckBetchDataHelper.cs
Property.DataHelper/Import/SuppliesCheckBetchDataHelper.cs
+61
-0
RB_Supplies_CheckDetail_Extend.cs
...y.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
+4
-0
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+124
-1
RB_Supplies_CheckDetailRepository.cs
....Repository/Supplies/RB_Supplies_CheckDetailRepository.cs
+4
-1
FileController.cs
Property.WebApi/Controllers/Property/FileController.cs
+64
-1
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+141
-0
No files found.
Property.DataHelper/Import/SuppliesCheckBetchDataHelper.cs
0 → 100644
View file @
dbe550e8
using
Property.Model.Extend
;
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
namespace
REBORN.DataHelper
{
public
class
SuppliesCheckBetchDataHelper
{
/// <summary>
/// 导入模板
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
public
static
List
<
RB_Supplies_CheckDetail_Extend
>
ImportClaimData
(
string
fileName
)
{
List
<
RB_Supplies_CheckDetail_Extend
>
list
=
new
List
<
RB_Supplies_CheckDetail_Extend
>();
var
dt
=
REBORN
.
Common
.
Plugin
.
NPOIHelper
.
ImportExceltoDt
(
fileName
,
0
,
0
,
true
);
if
(
dt
!=
null
&&
dt
.
Rows
.
Count
>
0
)
{
foreach
(
DataRow
dr
in
dt
.
Rows
)
{
RB_Supplies_CheckDetail_Extend
model
=
DataRowToModel
(
dr
);
list
.
Add
(
model
);
}
}
return
list
;
}
/// <summary>
/// DataRow转实体
/// </summary>
/// <param name="dr"></param>
/// <returns></returns>
public
static
RB_Supplies_CheckDetail_Extend
DataRowToModel
(
DataRow
dr
)
{
RB_Supplies_CheckDetail_Extend
model
=
new
RB_Supplies_CheckDetail_Extend
();
if
(
dr
!=
null
)
{
if
(
dr
.
Table
.
Columns
.
Contains
(
"ID"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"ID"
].
ToString
()))
{
model
.
Id
=
Convert
.
ToInt32
(
dr
[
"ID"
].
ToString
());
}
if
(
dr
.
Table
.
Columns
.
Contains
(
"UserId"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"UserId"
].
ToString
()))
{
model
.
CheckEmpId
=
Convert
.
ToInt32
(
dr
[
"UserId"
].
ToString
());
}
if
(
dr
.
Table
.
Columns
.
Contains
(
"盘点数量"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"盘点数量"
].
ToString
()))
{
model
.
RealityNum
=
Convert
.
ToInt32
(
dr
[
"盘点数量"
].
ToString
());
}
if
(
dr
.
Table
.
Columns
.
Contains
(
"盘点备注"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"盘点备注"
].
ToString
()))
{
model
.
Remark
=
dr
[
"盘点备注"
].
ToString
();
}
}
return
model
;
}
}
}
\ No newline at end of file
Property.Model/Extend/Supplies/RB_Supplies_CheckDetail_Extend.cs
View file @
dbe550e8
...
...
@@ -42,5 +42,9 @@ namespace Property.Model.Extend
/// 只看有库存的
/// </summary>
public
int
?
IsSelectHaveInventory
{
get
;
set
;
}
/// <summary>
/// ids
/// </summary>
public
string
CheckDetailIds
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
dbe550e8
...
...
@@ -1520,7 +1520,7 @@ namespace Property.Module.FixedAssets
item
.
SpecialList
=
aslist
.
Where
(
x
=>
x
.
ApplyforId
==
item
.
Id
).
ToList
();
}
return
list
;
}
}
/// <summary>
/// 设置耗材申请时间
...
...
@@ -2275,6 +2275,15 @@ namespace Property.Module.FixedAssets
return
true
;
}
/// <summary>
/// 获取盘点明细
/// </summary>
/// <param name="checkDetailId"></param>
/// <returns></returns>
public
RB_Supplies_CheckDetail_Extend
GetSuppliesCheckDetailInfo
(
int
checkDetailId
)
{
return
supplies_CheckDetailRepository
.
GetEntity
<
RB_Supplies_CheckDetail_Extend
>(
checkDetailId
);
}
/// <summary>
/// 设置盘点明细 耗材实盘数量
/// </summary>
...
...
@@ -2291,6 +2300,9 @@ namespace Property.Module.FixedAssets
if
(
dmodel
==
null
)
{
return
false
;
}
if
(
type
==
1
)
{
if
(
dmodel
.
CheckStatus
!=
PropertyCheckStatusEnum
.
NoInventory
&&
dmodel
.
CheckStatus
!=
PropertyCheckStatusEnum
.
HaveInventory
&&
dmodel
.
DealStatus
==
1
)
{
return
false
;
}
//更新实际数量
PropertyCheckStatusEnum
pcs
=
PropertyCheckStatusEnum
.
HaveInventory
;
if
(
reality
==
(
dmodel
.
InventoryNum
??
0
))
{
...
...
@@ -2352,6 +2364,117 @@ namespace Property.Module.FixedAssets
}
}
/// <summary>
/// 批量设置盘点
/// </summary>
/// <param name="list"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetBatchSuppliesCheckDetailReality
(
List
<
RB_Supplies_CheckDetail_Extend
>
list
,
UserInfo
userInfo
,
int
Type
=
1
)
{
string
checkdetailIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
dlist
=
supplies_CheckDetailRepository
.
GetList
(
new
RB_Supplies_CheckDetail_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
CheckDetailIds
=
checkdetailIds
});
if
(
dlist
.
Select
(
x
=>
x
.
CheckId
).
Distinct
().
Count
()
!=
1
)
{
return
false
;
}
foreach
(
var
item
in
dlist
)
{
int
reality
=
list
.
Where
(
x
=>
x
.
Id
==
item
.
Id
).
FirstOrDefault
()?.
RealityNum
??
0
;
if
(
item
.
CheckStatus
!=
PropertyCheckStatusEnum
.
NoInventory
&&
item
.
CheckStatus
!=
PropertyCheckStatusEnum
.
HaveInventory
&&
item
.
DealStatus
==
1
)
{
continue
;
}
//更新实际数量
PropertyCheckStatusEnum
pcs
=
PropertyCheckStatusEnum
.
HaveInventory
;
if
(
reality
==
(
item
.
InventoryNum
??
0
))
{
pcs
=
PropertyCheckStatusEnum
.
HaveInventory
;
}
else
if
(
reality
>
(
item
.
InventoryNum
??
0
))
{
pcs
=
PropertyCheckStatusEnum
.
InventoryProfit
;
}
else
if
(
reality
<
(
item
.
InventoryNum
??
0
))
{
pcs
=
PropertyCheckStatusEnum
.
InventoryLosses
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_CheckDetail
.
RealityNum
),
reality
},
{
nameof
(
RB_Supplies_CheckDetail
.
CheckStatus
),
pcs
},
{
nameof
(
RB_Supplies_CheckDetail
.
CheckEmpId
),
userInfo
.
EmployeeId
},
{
nameof
(
RB_Supplies_CheckDetail
.
CheckDate
),
DateTime
.
Now
},
};
if
(
Type
==
2
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
Remark
))
{
keyValues
.
Add
(
nameof
(
RB_Supplies_CheckDetail
.
Remark
),
item
.
Remark
);
}
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_CheckDetail
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
supplies_CheckDetailRepository
.
Update
(
keyValues
,
wheres
);
}
return
true
;
}
/// <summary>
/// 设置盘点单完成
/// </summary>
/// <param name="checkId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetSuppliesCheckComplete
(
int
checkId
,
UserInfo
userInfo
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_Check_Extend
.
CheckState
),
SuppliesCheckStatusEnum
.
Completed
},
{
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
)
{
//未盘的 直接盘亏处理
var
list
=
supplies_CheckDetailRepository
.
GetList
(
new
RB_Supplies_CheckDetail_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
CheckId
=
checkId
,
CheckStatus
=
PropertyCheckStatusEnum
.
NoInventory
});
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
flies1
=
new
Dictionary
<
string
,
object
>();
if
((
item
.
InventoryNum
??
0
)
>
(
item
.
RealityNum
??
0
))
{
flies1
.
Add
(
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
),
PropertyCheckStatusEnum
.
InventoryLosses
);
}
else
if
((
item
.
InventoryNum
??
0
)
==
(
item
.
RealityNum
??
0
))
{
flies1
.
Add
(
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
),
PropertyCheckStatusEnum
.
HaveInventory
);
}
else
if
((
item
.
InventoryNum
??
0
)
<
(
item
.
RealityNum
??
0
))
{
flies1
.
Add
(
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
),
PropertyCheckStatusEnum
.
InventoryProfit
);
}
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Property_CheckDetail_Extend
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
supplies_CheckDetailRepository
.
Update
(
flies1
,
wheres1
);
}
}
return
flag
;
}
#
endregion
}
}
Property.Repository/Supplies/RB_Supplies_CheckDetailRepository.cs
View file @
dbe550e8
...
...
@@ -92,7 +92,10 @@ left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
" in(3,4)"
;
}
string
sql
=
$@" select cd.*,pi.Name as SuppliesName,pi.SuppliesNo,pi.SpecificationName from RB_Supplies_CheckDetail cd
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CheckDetailIds
))
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
Id
)
+
" in("
+
dmodel
.
CheckDetailIds
+
")"
;
}
string
sql
=
$@" select cd.*,pi.Name as SuppliesName,pi.SuppliesNum as 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"
;
return
Get
<
RB_Supplies_CheckDetail_Extend
>(
sql
).
ToList
();
...
...
Property.WebApi/Controllers/Property/FileController.cs
View file @
dbe550e8
...
...
@@ -10,6 +10,8 @@ using Microsoft.AspNetCore.Cors;
using
Property.Model.Extend
;
using
System.Collections.Generic
;
using
System.Linq
;
using
REBORN.Common
;
using
Newtonsoft.Json
;
namespace
Property.WebApi.Controllers.User
{
...
...
@@ -19,7 +21,7 @@ namespace Property.WebApi.Controllers.User
[
EnableCors
(
"AllowCors"
)]
public
class
FileController
:
ControllerBase
{
PropertyModule
propertyModule
=
new
Property
Module
();
SuppliesModule
suppliesModule
=
new
Supplies
Module
();
/// <summary>
...
...
@@ -86,5 +88,66 @@ namespace Property.WebApi.Controllers.User
}
}
/// <summary>
/// 上传盘点
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
LocalFileUploadImportForSuppliesCheck
()
{
try
{
var
files
=
Request
.
Form
.
Files
;
if
(
files
.
Count
==
0
)
{
return
new
ApiResult
{
resultCode
=
(
int
)
ResultCode
.
Fail
,
message
=
"未选择文件"
,
data
=
""
};
}
string
filename
=
files
[
0
].
FileName
;
string
fileExtention
=
System
.
IO
.
Path
.
GetExtension
(
files
[
0
].
FileName
);
string
path
=
Guid
.
NewGuid
().
ToString
()
+
fileExtention
;
string
basepath
=
AppContext
.
BaseDirectory
;
string
path_server
=
basepath
+
"\\upfile\\"
+
path
;
if
(!
Directory
.
Exists
(
basepath
+
"\\upfile"
))
{
Directory
.
CreateDirectory
(
basepath
+
"\\upfile"
);
}
using
(
FileStream
fstream
=
new
FileStream
(
path_server
,
FileMode
.
OpenOrCreate
,
FileAccess
.
ReadWrite
))
{
files
[
0
].
CopyTo
(
fstream
);
}
//处理文件内容读取
List
<
RB_Supplies_CheckDetail_Extend
>
list
=
REBORN
.
DataHelper
.
SuppliesCheckBetchDataHelper
.
ImportClaimData
(
path_server
);
System
.
IO
.
File
.
Delete
(
path_server
);
var
model
=
list
.
FirstOrDefault
();
var
dmodel
=
suppliesModule
.
GetSuppliesCheckDetailInfo
(
model
.
Id
);
if
(
dmodel
==
null
)
{
return
ApiResult
.
Failed
(
"盘点不存在"
);
}
var
pmodel
=
suppliesModule
.
GetSuppliesCheck
(
dmodel
.
CheckId
??
0
);
if
(
pmodel
==
null
)
{
return
ApiResult
.
Failed
(
"盘点不存在"
);
}
if
(
pmodel
.
CheckState
!=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
InTheInventory
)
{
return
ApiResult
.
Failed
(
"盘点已结束"
);
}
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
((
model
.
CheckEmpId
??
0
).
ToString
());
//更新盘点数量
bool
flag
=
suppliesModule
.
SetBatchSuppliesCheckDetailReality
(
list
,
userInfo
,
2
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"LocalFileUploadImportForSuppliesCheck"
);
return
ApiResult
.
Failed
();
}
}
}
}
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
dbe550e8
...
...
@@ -1724,6 +1724,43 @@ namespace Property.WebApi.Controllers.User
}
}
/// <summary>
/// 盘点完成
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetSuppliesCheckComplete
()
{
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
.
SetSuppliesCheckComplete
(
CheckId
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取盘点明细列表
/// </summary>
...
...
@@ -1796,6 +1833,12 @@ namespace Property.WebApi.Controllers.User
return
ApiResult
.
Failed
(
"该盘点单已整单完成/取消,无法操作"
);
}
var
sdmodel
=
suppliesModule
.
GetSuppliesCheckDetailInfo
(
CheckDetailId
);
if
(
sdmodel
==
null
)
{
return
ApiResult
.
Failed
(
"盘点单不存在"
);
}
if
(
Type
==
1
&&
(
sdmodel
.
CheckStatus
==
REBORN
.
Common
.
Enum
.
PropertyCheckStatusEnum
.
InventoryProfit
||
sdmodel
.
CheckStatus
==
REBORN
.
Common
.
Enum
.
PropertyCheckStatusEnum
.
InventoryLosses
)
&&
sdmodel
.
DealStatus
==
1
)
{
return
ApiResult
.
Failed
(
"该耗材已报溢/报损处理,无法修改数量"
);
}
bool
flag
=
suppliesModule
.
SetSuppliesCheckDetailReality
(
CheckDetailId
,
Type
,
Reality
,
ImagesList
,
Remark
,
userInfo
);
if
(
flag
)
{
...
...
@@ -1807,6 +1850,104 @@ namespace Property.WebApi.Controllers.User
}
}
/// <summary>
/// 批量更新盘点明细实际数量
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetBatchSuppliesCheckDetailReality
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
List
<
RB_Supplies_CheckDetail_Extend
>
list
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Supplies_CheckDetail_Extend
>>(
requestParm
.
msg
.
ToString
());
if
(!
list
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递列表"
);
}
foreach
(
var
item
in
list
)
{
if
(
item
.
Id
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递盘点单明细id"
);
}
if
((
item
.
RealityNum
??
0
)
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递实际库存数量"
);
}
}
bool
flag
=
suppliesModule
.
SetBatchSuppliesCheckDetailReality
(
list
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 盘点明细导出Excel
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
FileContentResult
GetSuppliesCheckDetailToExcel
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
RB_Supplies_CheckDetail_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_CheckDetail_Extend
>(
requestParm
.
msg
.
ToString
());
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"ID"
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"UserId"
){
CellWidth
=
10
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"盘点状态"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"耗材编码"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"耗材名称"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"耗材规格"
){
CellWidth
=
25
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"当前库存"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"盘点数量"
){
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"盘点备注"
){
CellWidth
=
25
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
},
};
slist
.
Add
(
header
);
try
{
demodel
.
CheckId
=
12
;
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
var
list
=
suppliesModule
.
GetSuppliesCheckDetailPageList
(
1
,
99999
,
demodel
,
out
long
count
);
#
region
组装数据
foreach
(
var
item
in
list
)
{
string
SpName
=
string
.
Join
(
","
,
item
.
SpecificationList
);
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
item
.
Id
.
ToString
()){
},
new
ExcelColumn
(
value
:
userInfo
.
EmployeeId
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
CheckStatus
.
GetEnumName
()){
},
new
ExcelColumn
(
value
:
item
.
SuppliesNo
??
""
){
},
new
ExcelColumn
(
value
:
item
.
SuppliesName
??
""
){
},
new
ExcelColumn
(
value
:
SpName
??
""
){
},
new
ExcelColumn
(
value
:(
item
.
InventoryNum
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
RealityNum
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
Remark
??
""
){
}
},
ColumnHight
=
30
};
slist
.
Add
(
datarow
);
}
#
endregion
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
"耗材盘点.xls"
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetSuppliesCheckDetailToExcel: {0}"
,
JsonHelper
.
Serialize
(
requestParm
)));
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
"耗材盘点.xls"
);
}
}
#
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