Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
JunmpPoliceStation
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
zxw
JunmpPoliceStation
Commits
a6211cdb
Commit
a6211cdb
authored
Jan 06, 2023
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公共柜获取绑定信息
3d大屏接口调整
parent
8d9db90e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
242 行增加
和
291 行删除
+242
-291
CabinetController.cs
JunmpPoliceStation/Controllers/CabinetController.cs
+59
-1
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+4
-4
Screen3DShowController.cs
JunmpPoliceStation/Controllers/Screen3DShowController.cs
+179
-286
没有找到文件。
JunmpPoliceStation/Controllers/CabinetController.cs
View file @
a6211cdb
...
...
@@ -457,7 +457,13 @@ namespace JunmpPoliceStation.Controllers
_unitOfWork
.
DbContext
.
BaseJpCabinetWorklogs
.
Where
(
x
=>
x
.
DeviceNo
==
oldCabinetRealNum
)
.
UpdateFromQuery
(
x
=>
new
BaseJpCabinetWorklog
{
DeviceNo
=
replaceCabinetNum
});
if
(
first
.
Type
==
2
)
{
//公共柜更新表base_jp_cabinet_policeman_multiple
_unitOfWork
.
DbContext
.
BaseJpCabinetPolicemanMultiples
.
Where
(
x
=>
x
.
CabinetRealId
==
oldCabinetRealNum
)
.
UpdateFromQuery
(
x
=>
new
BaseJpCabinetPolicemanMultiple
{
CabinetRealId
=
replaceCabinetNum
});
}
}
transaction
.
Commit
();
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
...
...
@@ -3872,6 +3878,58 @@ namespace JunmpPoliceStation.Controllers
}
/// <summary>
/// 获取公共柜下绑定的警员信息 公共柜使用
/// </summary>
/// <remarks>
/// ## 例子
///
/// {
/// cabinetRealID://单警柜号
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
HttpPost
(
"GetCabinetPolicemanMultiple"
)]
[
NoSignAttribute
]
public
async
Task
<
HttpResponseMessage
>
GetCabinetPolicemanMultiple
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
string
cabinetRealID
=
entity
?.
cabinetRealID
??
""
;
var
res
=
_unitOfWork
.
CabinetPolicemanMultipleRepository
.
GetList
(
x
=>
x
.
CabinetRealId
==
cabinetRealID
,
null
,
false
)
.
ToList
();
var
data
=
res
.
Select
(
x
=>
new
{
x
.
CabinetRealId
,
x
.
BoxNo
,
x
.
UserId
,
x
.
UserName
});
return
JsonManager
.
ReturnSuccessResponse
(
data
);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
});
}
/// <summary>
/// 绑定单警柜和警员信息
/// </summary>
/// <remarks>
...
...
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
a6211cdb
...
...
@@ -11909,10 +11909,10 @@ namespace JunmpPoliceStation.Controllers
{
return
JsonManager
.
SimpleCustResponse
(
$"orgId is require"
);
}
if
(!
bOutInState
)
{
return
JsonManager
.
SimpleCustResponse
(
$"outInState is require"
);
}
//if (!bOutInState) //异常入库无outInState
//
{
//
return JsonManager.SimpleCustResponse($"outInState is require");
//
}
if
(!
bState
)
{
return
JsonManager
.
SimpleCustResponse
(
$"state is require"
);
...
...
JunmpPoliceStation/Controllers/Screen3DShowController.cs
View file @
a6211cdb
...
...
@@ -15,6 +15,7 @@ using JunmpPoliceStation.App_Start;
using
Newtonsoft.Json.Serialization
;
using
Newtonsoft.Json
;
using
System.Text
;
using
System.Web.Http
;
namespace
JunmpPoliceStation.Controllers
{
...
...
@@ -47,92 +48,65 @@ namespace JunmpPoliceStation.Controllers
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
Http
Pos
t
(
"GetAllInventory"
)]
[
Http
Ge
t
(
"GetAllInventory"
)]
[
NoSign
]
public
async
Task
<
HttpResponseMessage
>
GetAllInventory
([
FromBody
]
JObject
jdata
)
public
HttpResponseMessage
GetAllInventory
(
string
warehouseId
,
string
shelfId
)
{
return
await
Task
.
Run
(()
=>
try
{
try
var
param
=
new
string
[]
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
int
.
TryParse
(
entity
.
page
,
out
int
page
);
int
.
TryParse
(
entity
.
size
,
out
int
size
);
if
(
size
==
0
)
{
size
=
10
;
}
var
param
=
new
string
[]
{
"EquipmentCodeNavigation"
,
};
string
warehouseId
=
entity
.
warehouseId
;
string
shelfId
=
entity
.
shelfId
;
if
(
String
.
IsNullOrEmpty
(
warehouseId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
x
=>
x
.
WarehouseCode
.
Equals
(
warehouseId
);
if
(!
string
.
IsNullOrEmpty
(
shelfId
))
{
expression
=
expression
.
AndAlso
(
x
=>
x
.
ShelfId
==
shelfId
);
}
var
equipmentStates
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderByDescending
(
x
=>
x
.
CreateTime
)
.
ToList
();
var
data
=
equipmentStates
.
GroupBy
(
x
=>
x
.
EquipmentCode
)
.
Select
(
x
=>
new
{
key
=
x
.
FirstOrDefault
()?.
EquipmentCodeNavigation
?.
Name
,
name
=
x
.
FirstOrDefault
()?.
EquipmentCodeNavigation
?.
Name
,
value
=
x
.
Count
(),
imgurl
=
"http://192.168.2.39:5000/Screen3DShow/1.png"
})
.
ToList
();
//var content = new
//{
// totalElements = data.Count,
// content = data.Skip(page * size).Take(size)
//};
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
"EquipmentCodeNavigation"
,
};
if
(
String
.
IsNullOrEmpty
(
warehouseId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
x
=>
x
.
WarehouseCode
.
Equals
(
warehouseId
);
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
if
(!
string
.
IsNullOrEmpty
(
shelfId
))
{
expression
=
expression
.
AndAlso
(
x
=>
x
.
ShelfId
==
shelfId
);
}
});
var
equipmentStates
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderByDescending
(
x
=>
x
.
CreateTime
)
.
ToList
();
var
data
=
equipmentStates
.
GroupBy
(
x
=>
x
.
EquipmentCode
)
.
Select
(
x
=>
new
{
key
=
x
.
FirstOrDefault
()?.
EquipmentCodeNavigation
?.
Name
,
name
=
x
.
FirstOrDefault
()?.
EquipmentCodeNavigation
?.
Name
,
value
=
x
.
Count
(),
imgurl
=
"http://192.168.2.39:5000/Screen3DShow/1.png"
})
.
ToList
();
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
/// <summary>
/// 获取出入库数据
/// 获取出入库数据
(展示最新30条)
/// </summary>
/// <remarks>
///
...
...
@@ -147,86 +121,60 @@ namespace JunmpPoliceStation.Controllers
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
Http
Pos
t
(
"GetInventoryInOutLog"
)]
[
Http
Ge
t
(
"GetInventoryInOutLog"
)]
[
NoSign
]
public
async
Task
<
HttpResponseMessage
>
GetInventoryInOutLog
([
FromBody
]
JObject
jdata
)
public
HttpResponseMessage
GetInventoryInOutLog
(
string
warehouseId
)
{
return
await
Task
.
Run
(()
=>
try
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
int
.
TryParse
(
entity
.
page
,
out
int
page
);
int
.
TryParse
(
entity
.
size
,
out
int
size
);
if
(
size
==
0
)
{
size
=
10
;
}
var
param
=
new
string
[]
{
"Eqiupment"
,
"Eqiupment.EquipmentCodeNavigation"
,
"Eqiupment.Shelf"
,
};
string
warehouseId
=
entity
.
warehouseId
;
string
shelfId
=
entity
.
shelfId
;
if
(
String
.
IsNullOrEmpty
(
warehouseId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
Expression
<
Func
<
CommonJpEquipmentState
,
bool
>>
expression
=
x
=>
x
.
WarehouseId
.
Equals
(
warehouseId
);
var
equipmentStates
=
_unitOfWork
.
EquipmentStateRepository
.
GetPage
(
expression
,
"-CreateTime"
,
page
,
size
,
false
,
param
);
var
data
=
equipmentStates
.
content
.
Select
(
x
=>
new
{
name
=
x
.
Eqiupment
?.
EquipmentCodeNavigation
?.
Name
,
from
=
x
.
Eqiupment
?.
Shelf
?.
Name
??
""
,
time
=
x
.
CreateTime
?.
ToString
(
"HH:mm:ss"
),
type
=
x
.
OutInState
==
0
?
"出"
:
"入"
,
imgurl
=
"http://192.168.2.39:5000/Screen3DShow/1.png"
})
.
ToList
();
//var content = new
//{
// totalElements = equipmentStates.totalElements,
// content = data
//};
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
var
param
=
new
string
[]
{
"Eqiupment"
,
"Eqiupment.EquipmentCodeNavigation"
,
"Eqiupment.Shelf"
,
};
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
if
(
String
.
IsNullOrEmpty
(
warehouseId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
});
Expression
<
Func
<
CommonJpEquipmentState
,
bool
>>
expression
=
x
=>
x
.
WarehouseId
.
Equals
(
warehouseId
)
&&
!
string
.
IsNullOrEmpty
(
x
.
EqiupmentId
);
var
equipmentStates
=
_unitOfWork
.
EquipmentStateRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderByDescending
(
x
=>
x
.
CreateTime
)
.
Take
(
30
)
.
ToList
();
var
data
=
equipmentStates
.
Select
(
x
=>
new
{
name
=
x
.
Eqiupment
?.
EquipmentCodeNavigation
?.
Name
,
from
=
x
.
Eqiupment
?.
Shelf
?.
Name
??
""
,
time
=
x
.
CreateTime
?.
ToString
(
"HH:mm:ss"
),
type
=
x
.
OutInState
==
0
?
"出"
:
"入"
,
imgurl
=
"http://192.168.2.39:5000/Screen3DShow/1.png"
})
.
ToList
();
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
/// <summary>
...
...
@@ -245,84 +193,56 @@ namespace JunmpPoliceStation.Controllers
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
Http
Pos
t
(
"GetInventoryState"
)]
[
Http
Ge
t
(
"GetInventoryState"
)]
[
NoSign
]
public
async
Task
<
HttpResponseMessage
>
GetInventoryState
([
FromBody
]
JObject
jdata
)
public
HttpResponseMessage
GetInventoryState
(
string
warehouseId
)
{
return
await
Task
.
Run
(()
=>
try
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
int
.
TryParse
(
entity
.
page
,
out
int
page
);
int
.
TryParse
(
entity
.
size
,
out
int
size
);
if
(
size
==
0
)
{
size
=
10
;
}
var
param
=
new
string
[]
{
"EquipmentCodeNavigation"
,
};
string
warehouseId
=
entity
.
warehouseId
;
string
shelfId
=
entity
.
shelfId
;
if
(
String
.
IsNullOrEmpty
(
warehouseId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
x
=>
x
.
WarehouseCode
.
Equals
(
warehouseId
);
expression
=
expression
.
AndAlso
(
x
=>
new
[]
{
0
,
1
,
2
,
3
,
4
,
6
,
7
,
8
,
14
}.
Contains
(
x
.
CurrentState
));
var
equipmentStates
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderBy
(
x
=>
x
.
CurrentState
)
.
ToList
();
var
data
=
equipmentStates
.
GroupBy
(
x
=>
x
.
CurrentState
)
.
Select
(
x
=>
new
{
name
=
((
InvState
)
x
.
Key
).
ToString
(),
value
=
x
.
Count
()
})
.
ToList
();
//var content = new
//{
// totalElements = data.Count,
// content = data.Skip(page * size).Take(size)
//};
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
var
param
=
new
string
[]
{
"EquipmentCodeNavigation"
,
};
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
if
(
String
.
IsNullOrEmpty
(
warehouseId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
});
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
x
=>
x
.
WarehouseCode
.
Equals
(
warehouseId
);
expression
=
expression
.
AndAlso
(
x
=>
new
[]
{
0
,
1
,
2
,
3
,
4
,
6
,
7
,
8
,
14
}.
Contains
(
x
.
CurrentState
));
var
equipmentStates
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderBy
(
x
=>
x
.
CurrentState
)
.
ToList
();
var
data
=
equipmentStates
.
GroupBy
(
x
=>
x
.
CurrentState
)
.
Select
(
x
=>
new
{
name
=
((
InvState
)
x
.
Key
).
ToString
(),
value
=
x
.
Count
()
})
.
ToList
();
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
/// <summary>
...
...
@@ -341,83 +261,56 @@ namespace JunmpPoliceStation.Controllers
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
Http
Pos
t
(
"GetAllInventoryByCabinet"
)]
[
Http
Ge
t
(
"GetAllInventoryByCabinet"
)]
[
NoSign
]
public
async
Task
<
HttpResponseMessage
>
GetAllInventoryByCabinet
([
FromBody
]
JObject
jdata
)
public
HttpResponseMessage
GetAllInventoryByCabinet
(
string
orgId
)
{
return
await
Task
.
Run
(()
=>
try
{
try
var
param
=
new
string
[]
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
)
;
"EquipmentCodeNavigation"
,
"Cabinet"
,
}
;
int
.
TryParse
(
entity
.
page
,
out
int
page
);
int
.
TryParse
(
entity
.
size
,
out
int
size
);
if
(
size
==
0
)
{
size
=
10
;
}
if
(
String
.
IsNullOrEmpty
(
orgId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
x
=>
x
.
Cabinet
.
OrganizationId
==
orgId
;
var
param
=
new
string
[]
{
"EquipmentCodeNavigation"
,
"Cabinet"
,
};
string
orgId
=
entity
.
orgId
;
var
equipmentStates
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderByDescending
(
x
=>
x
.
CreateTime
)
.
ToList
();
var
data
=
equipmentStates
.
Select
(
x
=>
new
string
[
3
]
{
x
.
EquipmentCodeNavigation
?.
Name
??
""
,
x
.
Cabinet
==
null
?
""
:
(
x
.
Cabinet
.
CabinetNum
+
"-"
+
x
.
Cabinet
.
CabinetChildNum
),
x
.
CurrentState
==
3
?
"在库"
:
"不在库"
})
.
ToList
();
if
(
String
.
IsNullOrEmpty
(
orgId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
x
=>
x
.
Cabinet
.
OrganizationId
==
orgId
;
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
var
equipmentStates
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
)
.
OrderByDescending
(
x
=>
x
.
CreateTime
)
.
ToList
();
var
data
=
equipmentStates
.
Select
(
x
=>
new
string
[
3
]
{
x
.
EquipmentCodeNavigation
?.
Name
??
""
,
x
.
Cabinet
==
null
?
""
:
(
x
.
Cabinet
.
CabinetNum
+
"-"
+
x
.
Cabinet
.
CabinetChildNum
),
x
.
CurrentState
==
3
?
"在库"
:
"不在库"
})
.
ToList
();
//var content = new
//{
// totalElements = data.Count,
// content = data.Skip(page * size).Take(size)
//};
JsonSerializerSettings
setting
=
new
JsonSerializerSettings
();
setting
.
DateFormatHandling
=
DateFormatHandling
.
MicrosoftDateFormat
;
setting
.
DateFormatString
=
"yyyy-MM-dd HH:mm:ss"
;
setting
.
ContractResolver
=
new
CamelCasePropertyNamesContractResolver
();
setting
.
MaxDepth
=
10
;
//设置序列化的最大层数
setting
.
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
;
return
new
HttpResponseMessage
{
Content
=
new
StringContent
(
JsonConvert
.
SerializeObject
(
data
,
Formatting
.
Indented
,
setting
),
Encoding
.
GetEncoding
(
"UTF-8"
),
"application/json"
)
};
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
});
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论