Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
JPSMysql
概览
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
JPSMysql
Commits
182d6cbf
Commit
182d6cbf
authored
Jan 06, 2023
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏调用接口转发主平台
调整定时任务调用的数据库模式
parent
5c9dc64a
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
158 行增加
和
4 行删除
+158
-4
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+151
-0
ViewController.cs
JunmpPoliceStation/Controllers/ViewController.cs
+0
-0
CronJob.cs
JunmpPoliceStation/Extensions/CronJob.cs
+7
-4
没有找到文件。
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
182d6cbf
...
...
@@ -2085,6 +2085,157 @@ namespace JunmpPoliceStation.Controllers
}
/// <summary>
/// 通过箱标/件标epc获取件标epc(混装 智能货架使用)
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "epcList":[
/// {"epc":"箱标/件标epc"},
/// {"epc":"箱标/件标epc"},
/// ]
///
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
HttpPost
(
"GetEpcListByEpc"
)]
public
async
Task
<
HttpResponseMessage
>
GetEpcListByEpc
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
Expression
<
Func
<
CommonJpEquipmentBoxMark
,
bool
>>
xbExpression
=
t
=>
t
.
ReloadBoxingState
!=
1
;
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
jbExpression
=
t
=>
t
.
InventoryState
!=
"loss"
&&
t
.
CurrentState
==
0
;
var
xbEpcList
=
new
List
<
string
>();
var
jbEpcList
=
new
List
<
string
>();
foreach
(
var
epc
in
entity
.
epcList
)
{
if
(!
string
.
IsNullOrEmpty
(
epc
.
epc
))
{
if
(
epc
.
epc
.
Length
==
24
)
{
//旧版箱标
xbEpcList
.
Add
(
epc
.
epc
);
continue
;
}
var
buffer
=
EpcConvert
.
ToHexByte
(
epc
.
epc
);
var
epc_info
=
EpcConvert
.
EpcAnlysing
(
buffer
);
if
(
epc_info
.
TagType
==
0x00
)
{
//件标
jbEpcList
.
Add
(
epc
.
epc
);
}
else
{
xbEpcList
.
Add
(
epc
.
epc
);
}
}
}
if
(
xbEpcList
.
Count
==
0
&&
jbEpcList
.
Count
==
0
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
xbExpression
=
xbExpression
.
AndAlso
(
x
=>
xbEpcList
.
Contains
(
x
.
Epc
)
||
xbEpcList
.
Contains
(
x
.
OldEpc
));
jbExpression
=
jbExpression
.
AndAlso
(
x
=>
jbEpcList
.
Contains
(
x
.
Epc
));
var
param
=
new
string
[]
{
"Warehouse"
,
"EquipmentDetail"
,
"Size"
,
"Supplier"
,
"CommonJpEquipmentInventories"
};
var
param2
=
new
string
[]
{
"WarehouseCodeNavigation"
,
"EquipmentCodeNavigation"
,
"EquipmentSizecodeNavigation"
,
"SupplierCodeNavigation"
,
};
var
data
=
_unitOfWork
.
EquipmentBoxMarkRepository
.
GetList
(
xbExpression
,
includes
:
param
).
ToList
();
var
data2
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
jbExpression
,
includes
:
param2
).
ToList
();
var
res
=
new
List
<
object
>();
res
.
AddRange
(
data
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
createTime
=
x
.
CreateTime
,
epc
=
x
.
Epc
,
oneBoxNum
=
x
.
OneBoxNum
,
warehouseId
=
x
.
WarehouseId
,
warehouseName
=
x
.
Warehouse
.
Name
,
orgizationId
=
x
.
Warehouse
.
OrgizationId
,
equipmentInfoId
=
x
.
EquipmentDetail
.
EquipmentId
,
equipmentDetailId
=
x
.
EquipmentDetailId
,
equipmentDetailName
=
x
.
EquipmentDetail
.
Name
,
equipmentDetailCode
=
x
.
EquipmentDetail
.
Code
,
sizeId
=
x
.
SizeId
,
sizeName
=
x
.
Size
.
SizeName
,
sizeCode
=
x
.
Size
.
SizeCode
,
sizeEpcType
=
x
.
Size
.
EpcType
,
supplierId
=
x
.
SupplierId
,
supplierCode
=
x
.
Supplier
.
SupplierCode
,
supplierName
=
x
.
Supplier
.
Name
,
oldEpc
=
x
.
OldEpc
,
epcList
=
x
.
CommonJpEquipmentInventories
.
Select
(
y
=>
y
.
Epc
)
}).
ToList
());
res
.
AddRange
(
data2
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
createTime
=
x
.
CreateTime
,
epc
=
x
.
Epc
,
oneBoxNum
=
1
,
warehouseId
=
x
.
WarehouseCode
,
warehouseName
=
x
.
WarehouseCodeNavigation
.
Name
,
orgizationId
=
x
.
WarehouseCodeNavigation
.
OrgizationId
,
equipmentInfoId
=
x
.
EquipmentCodeNavigation
.
EquipmentId
,
equipmentDetailId
=
x
.
EquipmentCode
,
equipmentDetailName
=
x
.
EquipmentCodeNavigation
.
Name
,
equipmentDetailCode
=
x
.
EquipmentCodeNavigation
.
Code
,
sizeId
=
x
.
EquipmentSizecode
,
sizeName
=
x
.
EquipmentSizecodeNavigation
.
SizeName
,
sizeCode
=
x
.
EquipmentSizecodeNavigation
.
SizeCode
,
sizeEpcType
=
x
.
EquipmentSizecodeNavigation
.
EpcType
,
supplierId
=
x
.
SupplierCode
,
supplierCode
=
x
.
SupplierCodeNavigation
.
SupplierCode
,
supplierName
=
x
.
SupplierCodeNavigation
.
Name
,
oldEpc
=
(
string
)
null
,
epcList
=
new
List
<
string
>()
{
x
.
Epc
}
}).
ToList
());
return
JsonManager
.
ReturnSuccessResponse
(
res
);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
});
}
/// <summary>
/// 根据装备包实例id获取物资出入流水记录
/// </summary>
/// <remarks>
...
...
JunmpPoliceStation/Controllers/ViewController.cs
View file @
182d6cbf
差异被折叠。
点击展开。
JunmpPoliceStation/Extensions/CronJob.cs
View file @
182d6cbf
...
...
@@ -28,12 +28,15 @@ namespace JunmpPoliceStation.Extensions
HttpHelper
_httpHelper
;
private
IConfiguration
Configuration
;
private
ILogger
<
CronJob
>
_logger
;
public
CronJob
(
JunmppolicesqlContext
dbContext
,
IConfiguration
configuration
,
ILogger
<
CronJob
>
logger
,
HttpHelper
httpHelper
)
public
CronJob
(
IConfiguration
configuration
,
ILogger
<
CronJob
>
logger
,
HttpHelper
httpHelper
)
{
_dbContext
=
dbContext
;
_httpHelper
=
httpHelper
;
Configuration
=
configuration
;
_logger
=
logger
;
var
options
=
new
DbContextOptionsBuilder
<
JunmppolicesqlContext
>();
options
.
UseMySQL
(
Configuration
.
GetConnectionString
(
"MySqlConnection"
));
_dbContext
=
new
JunmppolicesqlContext
(
options
.
Options
);
}
public
void
SyncEquipmentState
()
...
...
@@ -169,9 +172,9 @@ namespace JunmpPoliceStation.Extensions
Postdata
=
reqData
,
IsNoTIP
=
true
});
if
(
res
.
StatusCode
!=
HttpStatusCode
.
Created
)
if
(
res
.
StatusCode
!=
HttpStatusCode
.
Created
)
{
_logger
.
LogError
(
"获取ACCESS_TOKEN失败 code:"
+
res
.
StatusCode
+
JsonConvert
.
SerializeObject
(
res
));
_logger
.
LogError
(
"获取ACCESS_TOKEN失败 code:"
+
res
.
StatusCode
+
JsonConvert
.
SerializeObject
(
res
));
return
false
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论