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
baf03e11
Commit
baf03e11
authored
Dec 22, 2022
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
663e2ed5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
396 行增加
和
99 行删除
+396
-99
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+10
-1
ShelfController.cs
JunmpPoliceStation/Controllers/ShelfController.cs
+15
-9
ChannelExtension.cs
JunmpPoliceStation/Extensions/ChannelExtension.cs
+370
-87
JunmpPoliceStation.csproj
JunmpPoliceStation/JunmpPoliceStation.csproj
+0
-1
Program.cs
JunmpPoliceStation/Program.cs
+1
-1
没有找到文件。
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
baf03e11
...
...
@@ -7459,6 +7459,15 @@ namespace JunmpPoliceStation.Controllers
_unitOfWork
.
EquipmentInventoryRepository
.
Update
(
UpdateEpc
);
}
if
(
currentState
.
Equals
(
"0"
)
&&
UpdateEpc
.
Count
>
0
)
//出库+物资更新
{
//更新redis上货架相关数据
if
(!
ChannelExtension
.
UpdateOpenOrderInvInfo
(
_unitOfWork
,
warehouseId
,
""
,
""
,
out
string
msg
))
{
_logger
.
LogError
(
"更新redis上货架相关数据失败:"
+
msg
);
}
}
//计算阈值
var
sizeList
=
InsertEpc
.
Select
(
x
=>
x
.
EquipmentSizecode
).
ToList
();
sizeList
.
AddRange
(
UpdateEpc
.
Select
(
x
=>
x
.
EquipmentSizecode
).
ToList
());
...
...
@@ -9344,7 +9353,7 @@ namespace JunmpPoliceStation.Controllers
}
var
EquipmentList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
c
=>
c
.
CreateTime
,
false
,
param
)
.
OrderBy
(
x
=>
x
.
EquipmentCodeNavigation
.
Code
)
.
OrderBy
(
x
=>
x
.
EquipmentCodeNavigation
.
Code
)
.
ToList
();
var
datas
=
EquipmentList
.
Select
(
equipment
=>
new
...
...
JunmpPoliceStation/Controllers/ShelfController.cs
View file @
baf03e11
...
...
@@ -183,6 +183,10 @@ namespace JunmpPoliceStation.Controllers
"CommonJpEquipmentInventories.EquipmentCodeNavigation.Equipment"
,
};
var
allEquList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
z
=>
z
.
ShelfRow
!=
null
&&
z
.
CurrentState
!=
6
&&
z
.
InventoryState
!=
"loss"
)
.
ToList
();
var
dataList
=
_unitOfWork
.
BaseJpShelfInfoRepository
.
GetList
(
expression
,
x
=>
x
.
Url
,
false
,
param
)
.
Select
(
x
=>
new
...
...
@@ -212,15 +216,9 @@ namespace JunmpPoliceStation.Controllers
Name
=
x
.
FirstOrDefault
().
EquipmentCodeNavigation
.
Name
,
Count
=
x
.
Count
(),
row
=
string
.
Join
(
','
,
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
z
=>
z
.
EquipmentCode
==
x
.
Key
&&
z
.
ShelfId
==
c
.
Id
&&
z
.
ShelfRow
!=
null
&&
z
.
CurrentState
!=
6
&&
z
.
InventoryState
!=
"loss"
)
allEquList
.
Where
(
z
=>
z
.
EquipmentCode
==
x
.
Key
&&
z
.
ShelfId
==
c
.
Id
)
.
GroupBy
(
z
=>
z
.
ShelfRow
)
.
Select
(
z
=>
z
.
Key
)
)
})
.
OrderBy
(
x
=>
x
.
Name
)
...
...
@@ -296,7 +294,10 @@ namespace JunmpPoliceStation.Controllers
{
if
(!
string
.
IsNullOrEmpty
(
pushClientId
))
{
mqttServer
.
ServerPublishMqttTopic
(
pushClientId
,
$"/C|ResponseShelfGetOrder|
{{}}
"
);
mqttServer
.
ServerPublishMqttTopic
(
pushClientId
,
@
$"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
warehouseId
,
})}
"
);
}
return
JsonManager
.
SimpleCustResponse
(
"无开启单据"
,
"10000"
);
}
...
...
@@ -390,6 +391,7 @@ namespace JunmpPoliceStation.Controllers
{
mqttServer
.
ServerPublishMqttTopic
(
pushClientId
,
$@"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
data
.
warehouseId
,
orderCode
=
data
.
OrderCode
,
data
=
list
})}
"
);
...
...
@@ -522,6 +524,7 @@ namespace JunmpPoliceStation.Controllers
{
mqttServer
.
ServerPublishMqttTopic
(
pushClientId
,
$@"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
data
.
warehouseId
,
orderCode
=
data
.
order
,
data
=
list
})}
"
);
...
...
@@ -532,7 +535,10 @@ namespace JunmpPoliceStation.Controllers
{
if
(!
string
.
IsNullOrEmpty
(
pushClientId
))
{
mqttServer
.
ServerPublishMqttTopic
(
pushClientId
,
$"/C|ResponseShelfGetOrder|
{{}}
"
);
mqttServer
.
ServerPublishMqttTopic
(
pushClientId
,
@
$"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
warehouseId
,
})}
"
);
}
return
JsonManager
.
SimpleCustResponse
(
"异常OrderType"
);
}
...
...
JunmpPoliceStation/Extensions/ChannelExtension.cs
View file @
baf03e11
...
...
@@ -14,6 +14,11 @@ using Microsoft.EntityFrameworkCore;
using
Microsoft.Extensions.Logging
;
using
Rextec.SOA.Infrastructure
;
using
System.Linq.Expressions
;
using
Microsoft.Extensions.DependencyInjection
;
using
Newtonsoft.Json.Linq
;
using
JmpCommon.Tools
;
using
MQTTnet.Server
;
using
Hangfire.MemoryStorage.Database
;
namespace
JunmpPoliceStation.Extensions
{
...
...
@@ -498,7 +503,7 @@ namespace JunmpPoliceStation.Extensions
{
realityItem
.
Reality
.
CurrentState
=
1
;
//更新redis上货架相关数据
UpdateOpenOrderInvInfo
(
_unitOfWork
,
warehouseId
,
"none"
,
""
,
out
string
msg
);
//
UpdateOpenOrderInvInfo(_unitOfWork, warehouseId, "none", "", out string msg);
}
UpdateTrReal
.
Add
(
realityItem
);
tempReality
.
Add
(
realityItem
);
...
...
@@ -722,7 +727,7 @@ namespace JunmpPoliceStation.Extensions
{
realityItem
.
Reality
.
CurrentState
=
1
;
//更新redis上货架相关数据
UpdateOpenOrderInvInfo
(
_unitOfWork
,
warehouseId
,
"none"
,
""
,
out
string
msg
);
//
UpdateOpenOrderInvInfo(_unitOfWork, warehouseId, "none", "", out string msg);
}
UpdateBoReal
.
Add
(
realityItem
);
borrowtempReality
.
Add
(
realityItem
);
...
...
@@ -1134,7 +1139,7 @@ namespace JunmpPoliceStation.Extensions
{
realityItem
.
Reality
.
CurrentState
=
1
;
//更新redis上货架相关数据
UpdateOpenOrderInvInfo
(
_unitOfWork
,
warehouseId
,
"none"
,
""
,
out
string
msg
);
//
UpdateOpenOrderInvInfo(_unitOfWork, warehouseId, "none", "", out string msg);
}
UpdateBoReal
.
Add
(
realityItem
);
borrowGetTempReality
.
Add
(
realityItem
);
...
...
@@ -1541,115 +1546,393 @@ namespace JunmpPoliceStation.Extensions
}
public
static
bool
UpdateOpenOrderInvInfo
(
UnitOfWork
_unitOfWork
,
string
warehouseId
,
string
orderType
,
string
orderCode
,
out
string
msg
)
{
//替换为mqtt推送
try
{
msg
=
""
;
OutOrderInfo
orders
=
new
OutOrderInfo
();
//var res = _unitOfWork.VOrderInfoRepository.Get(expression);
switch
(
orderType
)
using
(
var
scope
=
Startup
.
ServiceLocator
.
Instance
.
CreateScope
())
{
case
"none"
:
//所有单据都关闭
orders
.
orderCode
=
""
;
orders
.
data
=
new
List
<
OutOrderGoods
>();
return
RedisCacheHelper
.
SetStringValue
(
"Order"
+
warehouseId
,
JsonConvert
.
SerializeObject
(
orders
),
ref
msg
);
var
mqttServer
=
scope
.
ServiceProvider
.
GetService
<
MQTTServer
>();
var
statusList
=
mqttServer
.
mqttServer
.
GetClientStatusAsync
().
Result
.
Where
(
x
=>
x
.
ClientId
.
Length
>
2
&&
x
.
ClientId
.
Substring
(
0
,
2
)
==
"SS"
)
//货架展示屏标识:SS
.
ToList
(
);
case
"借用"
:
case
"领用"
:
Expression
<
Func
<
VOrderInfo
,
bool
>>
expression
=
x
=>
x
.
IsWork
==
true
;
expression
=
expression
.
AndAlso
(
x
=>
x
.
WarehouseId
==
warehouseId
);
var
res
=
_unitOfWork
.
VOrderInfoRepository
.
Get
(
expression
);
if
(
res
==
null
)
{
foreach
(
var
status
in
statusList
)
{
var
t
=
_unitOfWork
.
DbContext
.
CommonJpBorrowReturnApplies
.
Include
(
"CommonJpBorrowReturns"
)
.
Include
(
"CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities"
)
.
Include
(
"CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities.EquipmentDetail"
)
.
First
(
x
=>
x
.
OrderCode
==
orderCode
);
mqttServer
.
ServerPublishMqttTopic
(
status
.
ClientId
,
@
$"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
warehouseId
,
})}
"
);
}
msg
=
"无开启的单据"
;
return
true
;
}
var
data
=
new
switch
(
res
.
OrderType
)
{
case
"借用"
:
case
"领用"
:
{
t
.
OrderCode
,
applyResult
=
t
.
CommonJpBorrowReturns
?.
Select
(
p
=>
new
var
t
=
_unitOfWork
.
DbContext
.
CommonJpBorrowReturnApplies
.
Include
(
"Warehouse"
)
.
Include
(
"CommonJpBorrowReturnDetailEstimates"
)
.
Include
(
"CommonJpBorrowReturnDetailEstimates.Equipment"
)
.
Include
(
"CommonJpBorrowReturnDetailEstimates.Size"
)
.
Include
(
"CommonJpBorrowReturnDetailEstimates.Supplier"
)
.
Include
(
"CommonJpBorrowReturns"
)
.
Include
(
"CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities"
)
.
Include
(
"CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities.EquipmentDetail"
)
.
Include
(
"CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities.Size"
)
.
Include
(
"CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities.Supplier"
)
.
First
(
x
=>
x
.
Id
==
res
.
ApplyId
);
var
data
=
new
{
resultList
=
p
.
CommonJpBorrowReturnDetailRealities
?.
Select
(
q
=>
new
type
=
t
.
ActionType
.
Equals
(
0
)
?
2
:
3
,
//2借用,3领用
t
.
ActionType
,
t
.
ChangeFlag
,
id
=
t
.
Id
,
warehouseId
=
t
.
WarehouseId
,
applyId
=
t
.
ApplyUser
,
applyName
=
t
.
ApplyUserName
,
applyTime
=
t
.
ApplyTime
,
note
=
t
.
Note
,
t
.
PoliceNote
,
createTime
=
t
.
CreateTime
,
warehouseName
=
t
.
Warehouse
?.
Name
,
t
.
OrderCode
,
expectedTime
=
t
.
ExpectedReturnTime
,
detailList
=
t
.
CommonJpBorrowReturnDetailEstimates
?.
Select
(
x
=>
new
{
quantity
=
q
.
EquipmentCount
,
equipmentName
=
q
.
EquipmentDetail
?.
Name
,
q
.
RealCount
,
})
}).
FirstOrDefault
()
};
var
list
=
new
List
<
object
>();
foreach
(
var
obj
in
data
.
applyResult
.
resultList
)
{
var
count
=
obj
.
quantity
-
obj
.
RealCount
;
if
(
count
==
0
)
id
=
x
.
Id
,
equipmentId
=
x
.
Equipment
?.
Id
,
equipmentName
=
x
.
Equipment
?.
Name
,
equipmentSizeId
=
x
.
Size
?.
Id
,
equipmentSizeName
=
x
.
Size
?.
SizeName
,
quantity
=
x
.
EquipmentCount
,
supplierId
=
x
.
Supplier
?.
Id
,
supplierName
=
x
.
Supplier
?.
Name
,
sizeCount
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
p
=>
p
.
EquipmentCode
.
Equals
(
x
.
EquipmentId
)
&&
p
.
WarehouseCode
.
Equals
(
t
.
Warehouse
.
Id
)).
Count
()
}),
applyResult
=
t
.
CommonJpBorrowReturns
?.
Select
(
p
=>
new
{
p
.
CurrentState
,
resultList
=
p
.
CommonJpBorrowReturnDetailRealities
?.
Select
(
q
=>
new
{
realityId
=
q
.
Id
,
quantity
=
q
.
EquipmentCount
,
equipmentId
=
q
.
EquipmentDetail
?.
Id
,
equipmentName
=
q
.
EquipmentDetail
?.
Name
,
equipmentCode
=
q
.
EquipmentDetail
?.
Code
,
equipmentSizeId
=
q
.
Size
?.
Id
,
equipmentSizeName
=
q
.
Size
?.
SizeName
,
//applyQuantity = t.CommonJpBorrowReturnDetailEstimates?.Where(x => q.SizeId.Equals(x.SizeId) && q.EquipmentDetailId.Equals(x.EquipmentId))?.FirstOrDefault().EquipmentCount,
supplierId
=
q
.
Supplier
?.
Id
,
supplierName
=
q
.
Supplier
?.
Name
,
q
.
RealCount
,
q
.
InsideRealCount
,
q
.
State
})
}).
FirstOrDefault
()
};
var
list
=
new
List
<
object
>();
foreach
(
var
obj
in
data
.
applyResult
.
resultList
)
{
continue
;
var
count
=
obj
.
quantity
-
obj
.
RealCount
;
if
(
count
==
0
)
{
continue
;
}
list
.
Add
(
new
{
Name
=
obj
.
equipmentName
,
Count
=
count
});
}
list
.
Add
(
new
foreach
(
var
status
in
statusList
)
{
Name
=
obj
.
equipmentName
,
Count
=
count
});
mqttServer
.
ServerPublishMqttTopic
(
status
.
ClientId
,
$@"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
data
.
warehouseId
,
orderCode
=
data
.
OrderCode
,
data
=
list
})}
"
);
}
return
true
;
}
orders
.
orderCode
=
data
.
OrderCode
;
orders
.
data
=
list
;
return
RedisCacheHelper
.
SetStringValue
(
"Order"
+
warehouseId
,
JsonConvert
.
SerializeObject
(
orders
),
ref
msg
);
}
case
"库存调拨"
:
{
Expression
<
Func
<
CommonJpProcessCurrent
,
bool
>>
expressionTrans
=
p
=>
p
.
OrderId
!=
null
;
var
t
=
_unitOfWork
.
DbContext
.
CommonJpTransferApplies
.
Include
(
"CommonJpTransferDetailRealities"
)
.
Include
(
"CommonJpTransferDetailRealities.EquipmentDetail"
)
.
FirstOrDefault
(
p
=>
p
.
Order
.
Equals
(
orderCode
));
var
data
=
new
case
"跨库借用"
:
case
"跨库归还"
:
case
"库存调拨"
:
{
OrderCode
=
t
.
Order
,
realityDetailList
=
t
.
CommonJpTransferDetailRealities
.
Select
(
x
=>
new
{
equipmentDetailName
=
x
.
EquipmentDetail
?.
Name
,
quantity
=
x
.
EquipmentCount
,
x
.
RealCount
,
})
};
var
list
=
new
List
<
object
>();
foreach
(
var
obj
in
data
.
realityDetailList
)
{
var
count
=
obj
.
quantity
-
obj
.
RealCount
;
if
(
count
==
0
)
Expression
<
Func
<
CommonJpProcessCurrent
,
bool
>>
expressionTrans
=
p
=>
p
.
OrderId
!=
null
;
if
(
res
.
OrderType
.
Equals
(
"库存调拨"
)
||
res
.
OrderType
.
Equals
(
"跨库借用"
))
{
continue
;
expressionTrans
=
expressionTrans
.
And
(
p
=>
p
.
OrderId
.
Equals
(
res
.
ApplyId
)
||
p
.
CommonJpTransferApplies
.
Any
(
c
=>
c
.
Order
.
Equals
(
res
.
ApplyId
)))
;
}
list
.
Add
(
new
else
if
(
res
.
OrderType
.
Equals
(
"跨库归还"
))
{
Name
=
obj
.
equipmentDetailName
,
Count
=
count
});
}
orders
.
orderCode
=
data
.
OrderCode
;
orders
.
data
=
list
;
return
RedisCacheHelper
.
SetStringValue
(
"Order"
+
warehouseId
,
JsonConvert
.
SerializeObject
(
orders
),
ref
msg
);
expressionTrans
=
expressionTrans
.
And
(
p
=>
p
.
OrderId
.
Equals
(
res
.
ApplyId
)
||
p
.
CommonJpTransferApplies
.
FirstOrDefault
().
CommonJpTransfers
.
Any
(
q
=>
q
.
Order
.
Equals
(
res
.
ApplyId
)));
}
}
default
:
{
msg
=
"异常"
;
return
false
;
var
t
=
_unitOfWork
.
DbContext
.
CommonJpProcessCurrents
.
Include
(
"CommonJpTransferApplies"
)
.
Include
(
"CommonJpTransferApplies.TransferWarehouseNavigation"
)
.
Include
(
"CommonJpTransferApplies.Transfer"
)
.
Include
(
"CommonJpTransferApplies.Target"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailEstimates"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailEstimates.EquipmentSize"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailEstimates.EquipmentDetail"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailEstimates.Supplier"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailRealities"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailRealities.Size"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailRealities.EquipmentDetail"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailRealities.Warehouse"
)
.
Include
(
"CommonJpTransferApplies.CommonJpTransferDetailRealities.Supplier"
)
.
FirstOrDefault
(
expressionTrans
);
string
value
=
RedisCacheHelper
.
GetStringValue
(
t
.
CommonJpTransferApplies
.
FirstOrDefault
()?.
Order
);
//获取数据
dynamic
entity
=
new
object
();
if
(!
string
.
IsNullOrEmpty
(
value
))
{
entity
=
JObject
.
Parse
(
value
.
ToString
());
}
}
var
data
=
new
{
type
=
t
.
CommonJpTransferApplies
.
First
().
ActionType
.
ToString
().
Equals
(
"0"
)
?
0
:
t
.
CommonJpTransferApplies
.
First
().
ActionType
.
ToString
().
Equals
(
"1"
)
?
7
:
9
,
t
.
UserInfo
,
t
.
UserType
,
t
.
DataScope
,
t
.
OrgId
,
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
UpdateTime
,
t
.
CurrentStepName
,
expectedReturnTime
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
ExpectedReturnTime
,
CurrentOrg
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
TransferId
,
id
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Id
,
applyId
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
ApplyUser
,
applyName
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
ApplyUserName
,
applyTime
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
ApplyTime
,
note
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Reason
,
createTime
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
CreateTime
,
warehouseName
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()
?.
TransferWarehouseNavigation
?.
Name
,
warehouseId
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
TransferWarehouse
,
order
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
CommonJpTransfers
?.
FirstOrDefault
()
?.
Order
==
null
?
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Order
:
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
CommonJpTransfers
?.
FirstOrDefault
()?.
Order
,
transferName
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Transfer
?.
Name
,
transferId
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Transfer
?.
Id
,
targetName
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Target
?.
Name
,
targetId
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
Target
?.
Id
,
detailList
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()
?.
CommonJpTransferDetailEstimates
?.
Select
(
x
=>
new
{
equipmentSizeId
=
x
.
EquipmentSize
?.
Id
,
equipmentSizeName
=
x
.
EquipmentSize
?.
SizeName
,
equipmentDetailId
=
x
.
EquipmentDetail
?.
Id
,
equipmentDetailName
=
x
.
EquipmentDetail
?.
Name
,
quantity
=
x
.
EquipmentCount
,
supplierId
=
x
.
Supplier
?.
Id
,
supplierName
=
x
.
Supplier
?.
Name
,
}).
OrderBy
(
p
=>
p
.
equipmentDetailName
),
realityDetailList
=
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()?.
CommonJpTransferDetailRealities
.
Count
()
==
0
?
entity
.
realityDetailList
:
t
.
CommonJpTransferApplies
?.
FirstOrDefault
()
?.
CommonJpTransferDetailRealities
?.
Select
(
x
=>
new
{
realityId
=
x
.
Id
,
equipmentSizeId
=
x
.
Size
?.
Id
,
equipmentSizeName
=
x
.
Size
?.
SizeName
,
equipmentDetailId
=
x
.
EquipmentDetail
?.
Id
,
equipmentDetailCode
=
x
.
EquipmentDetail
?.
Code
,
warehouseId
=
x
.
WarehouseId
,
warehouseName
=
x
.
Warehouse
?.
Name
,
equipmentDetailName
=
x
.
EquipmentDetail
?.
Name
,
quantity
=
x
.
EquipmentCount
,
x
.
RealCount
,
InsideRealCount
=
x
.
InsideRealCount
??
0
,
x
.
State
,
supplierId
=
x
.
Supplier
?.
Id
,
supplierName
=
x
.
Supplier
?.
Name
,
}).
OrderBy
(
p
=>
p
.
equipmentDetailName
)
};
var
list
=
new
List
<
object
>();
foreach
(
var
obj
in
data
.
realityDetailList
)
{
var
count
=
obj
.
quantity
-
obj
.
RealCount
;
if
(
count
==
0
)
{
continue
;
}
list
.
Add
(
new
{
Name
=
obj
.
equipmentDetailName
,
Count
=
count
});
}
foreach
(
var
status
in
statusList
)
{
mqttServer
.
ServerPublishMqttTopic
(
status
.
ClientId
,
$@"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
data
.
warehouseId
,
orderCode
=
data
.
order
,
data
=
list
})}
"
);
}
return
true
;
}
default
:
{
foreach
(
var
status
in
statusList
)
{
mqttServer
.
ServerPublishMqttTopic
(
status
.
ClientId
,
@
$"/C|ResponseShelfGetOrder|
{
JsonConvert
.
SerializeObject
(
new
{
warehouseId
=
warehouseId
,
})}
"
);
}
msg
=
"异常OrderType"
;
return
false
;
}
}
}
}
catch
(
Exception
e
x
)
catch
(
Exception
e
)
{
msg
=
e
x
.
ToString
();
msg
=
e
.
ToString
();
return
false
;
}
//try
//{
// msg = "";
// OutOrderInfo orders = new OutOrderInfo();
// //var res = _unitOfWork.VOrderInfoRepository.Get(expression);
// switch (orderType)
// {
// case "none"://所有单据都关闭
// orders.orderCode = "";
// orders.data = new List<OutOrderGoods>();
// return RedisCacheHelper.SetStringValue("Order" + warehouseId, JsonConvert.SerializeObject(orders), ref msg);
// case "借用":
// case "领用":
// {
// var t = _unitOfWork.DbContext.CommonJpBorrowReturnApplies
// .Include("CommonJpBorrowReturns")
// .Include("CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities")
// .Include("CommonJpBorrowReturns.CommonJpBorrowReturnDetailRealities.EquipmentDetail")
// .First(x => x.OrderCode == orderCode);
// var data = new
// {
// t.OrderCode,
// applyResult = t.CommonJpBorrowReturns?.Select(p => new
// {
// resultList = p.CommonJpBorrowReturnDetailRealities?.Select(q => new
// {
// quantity = q.EquipmentCount,
// equipmentName = q.EquipmentDetail?.Name,
// q.RealCount,
// })
// }).FirstOrDefault()
// };
// var list = new List<object>();
// foreach (var obj in data.applyResult.resultList)
// {
// var count = obj.quantity - obj.RealCount;
// if (count == 0)
// {
// continue;
// }
// list.Add(new
// {
// Name = obj.equipmentName,
// Count = count
// });
// }
// orders.orderCode = data.OrderCode;
// orders.data = list;
// return RedisCacheHelper.SetStringValue("Order" + warehouseId, JsonConvert.SerializeObject(orders), ref msg);
// }
// case "库存调拨":
// {
// Expression<Func<CommonJpProcessCurrent, bool>> expressionTrans = p => p.OrderId != null;
// var t = _unitOfWork.DbContext.CommonJpTransferApplies
// .Include("CommonJpTransferDetailRealities")
// .Include("CommonJpTransferDetailRealities.EquipmentDetail")
// .FirstOrDefault(p => p.Order.Equals(orderCode));
// var data = new
// {
// OrderCode = t.Order,
// realityDetailList =
// t.CommonJpTransferDetailRealities
// .Select(x => new
// {
// equipmentDetailName = x.EquipmentDetail?.Name,
// quantity = x.EquipmentCount,
// x.RealCount,
// })
// };
// var list = new List<object>();
// foreach (var obj in data.realityDetailList)
// {
// var count = obj.quantity - obj.RealCount;
// if (count == 0)
// {
// continue;
// }
// list.Add(new
// {
// Name = obj.equipmentDetailName,
// Count = count
// });
// }
// orders.orderCode = data.OrderCode;
// orders.data = list;
// return RedisCacheHelper.SetStringValue("Order" + warehouseId, JsonConvert.SerializeObject(orders), ref msg);
// }
// default:
// {
// msg = "异常";
// return false;
// }
// }
//}
//catch (Exception ex)
//{
// msg = ex.ToString();
// return false;
//}
}
/// <summary>
...
...
JunmpPoliceStation/JunmpPoliceStation.csproj
View file @
baf03e11
...
...
@@ -116,7 +116,6 @@
<ItemGroup>
<ProjectReference Include="..\JmpCommon\JmpCommon.csproj" />
<ProjectReference Include="..\JmpModel\JmpModel.csproj" />
<ProjectReference Include="..\JmpMsgService\JmpMsgService.csproj" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
...
...
JunmpPoliceStation/Program.cs
View file @
baf03e11
...
...
@@ -35,7 +35,7 @@ namespace JunmpPoliceStation
#if DEBUG
CreateWebHostBuilder
(
args
).
Build
().
Run
();
#else
CreateWebHostBuilder
(
args
).
Build
().
Run
AsService
();
CreateWebHostBuilder
(
args
).
Build
().
Run
();
#endif
}
catch
(
Exception
ex
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论