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
8fa4380a
Commit
8fa4380a
authored
Dec 07, 2022
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e4279208
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
178 行增加
和
86 行删除
+178
-86
CommonJpBorrowReturnApply.cs
JmpModel/Model/CommonJpBorrowReturnApply.cs
+5
-0
JunmppolicesqlContext.cs
JmpModel/Model/DataContext/JunmppolicesqlContext.cs
+2
-0
AuthLoginAttribute.cs
JunmpPoliceStation/App_Start/AuthLoginAttribute.cs
+22
-2
BorrowController.cs
JunmpPoliceStation/Controllers/BorrowController.cs
+9
-6
CabinetController.cs
JunmpPoliceStation/Controllers/CabinetController.cs
+28
-26
FixReceiveApplyController.cs
JunmpPoliceStation/Controllers/FixReceiveApplyController.cs
+31
-11
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+0
-0
MessageReminderController.cs
JunmpPoliceStation/Controllers/MessageReminderController.cs
+28
-24
PolicemanController.cs
JunmpPoliceStation/Controllers/PolicemanController.cs
+9
-0
TjController.cs
JunmpPoliceStation/Controllers/TjController.cs
+10
-15
ChannelExtension.cs
JunmpPoliceStation/Extensions/ChannelExtension.cs
+24
-2
Startup.cs
JunmpPoliceStation/Startup.cs
+10
-0
没有找到文件。
JmpModel/Model/CommonJpBorrowReturnApply.cs
View file @
8fa4380a
...
...
@@ -100,6 +100,11 @@ namespace JmpModel.Model
[
Column
(
"file_url"
)]
[
StringLength
(
255
)]
public
string
FileUrl
{
get
;
set
;
}
/// <summary>
/// 是否绑定单警柜(领用)
/// </summary>
[
Column
(
"is_bind_cabinet"
)]
public
bool
?
IsBindCabinet
{
get
;
set
;
}
[
ForeignKey
(
nameof
(
ApplyId
))]
[
InverseProperty
(
nameof
(
BaseJpPoliceman
.
CommonJpBorrowReturnApplyApplies
))]
...
...
JmpModel/Model/DataContext/JunmppolicesqlContext.cs
View file @
8fa4380a
...
...
@@ -1221,6 +1221,8 @@ Smart:智能货架
.
IsUnicode
(
false
)
.
HasComment
(
"单据附加文件地址(上传)"
);
entity
.
Property
(
e
=>
e
.
IsBindCabinet
).
HasComment
(
"是否绑定单警柜(领用)"
);
entity
.
Property
(
e
=>
e
.
Note
).
IsUnicode
(
false
);
entity
.
Property
(
e
=>
e
.
OrderCode
).
IsUnicode
(
false
);
...
...
JunmpPoliceStation/App_Start/AuthLoginAttribute.cs
View file @
8fa4380a
...
...
@@ -3,6 +3,7 @@ using JmpCommon.Tools;
using
JmpModel.Model
;
using
JmpModel.Model.Repository
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc.Controllers
;
using
Microsoft.AspNetCore.Mvc.Filters
;
...
...
@@ -34,13 +35,13 @@ namespace JunmpPoliceStation.App_Start
private
readonly
INacosNamingClient
_serverNamingClient
;
private
readonly
IHttpClientFactory
_clientFactory
;
public
IConfiguration
Configuration
{
get
;
}
private
ILogger
<
PrintController
>
_logger
;
private
ILogger
<
AuthLoginAttribute
>
_logger
;
private
Boolean
flg
;
ApiConfig
apicfg
;
string
urlGetSecretKey
=
string
.
Empty
;
//获取seckey的路由
string
urlCheckApp
=
string
.
Empty
;
//获取审核的路由
public
AuthLoginAttribute
(
IConfiguration
configuration
,
ApiConfig
apicfg
,
INacosServerManager
_serverManager
,
INacosNamingClient
_serverNamingClient
,
IHttpClientFactory
_clientFactory
,
Boolean
AuthFlg
=
true
)
public
AuthLoginAttribute
(
IConfiguration
configuration
,
ApiConfig
apicfg
,
INacosServerManager
_serverManager
,
INacosNamingClient
_serverNamingClient
,
IHttpClientFactory
_clientFactory
,
ILogger
<
AuthLoginAttribute
>
_logger
,
Boolean
AuthFlg
=
true
)
{
flg
=
AuthFlg
;
this
.
apicfg
=
apicfg
;
...
...
@@ -48,6 +49,7 @@ namespace JunmpPoliceStation.App_Start
this
.
_serverNamingClient
=
_serverNamingClient
;
this
.
_clientFactory
=
_clientFactory
;
this
.
Configuration
=
configuration
;
this
.
_logger
=
_logger
;
_serverNamingClient
.
RegisterInstanceAsync
(
new
RegisterInstanceRequest
{
ServiceName
=
apicfg
.
serviceName
,
...
...
@@ -65,6 +67,14 @@ namespace JunmpPoliceStation.App_Start
public
override
void
OnActionExecuting
(
ActionExecutingContext
context
)
{
//获取访问ip
var
userHostAddress
=
context
.
HttpContext
.
Connection
.
RemoteIpAddress
?.
MapToIPv4
().
ToString
();
if
(!
string
.
IsNullOrEmpty
(
userHostAddress
)
&&
IsIP
(
userHostAddress
))
{
//有效ip
_logger
.
LogDebug
(
"获取访问ip:"
+
userHostAddress
);
}
if
(
bool
.
TryParse
(
Configuration
.
GetSection
(
"Auth:NoSign"
).
Value
,
out
bool
noSignFlag
)
&&
noSignFlag
)
{
return
;
...
...
@@ -191,6 +201,16 @@ namespace JunmpPoliceStation.App_Start
}
}
/// <summary>
/// 检查IP地址格式
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
private
static
bool
IsIP
(
string
ip
)
{
return
System
.
Text
.
RegularExpressions
.
Regex
.
IsMatch
(
ip
,
@"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$"
);
}
}
public
class
PlaInfo
{
...
...
JunmpPoliceStation/Controllers/BorrowController.cs
View file @
8fa4380a
...
...
@@ -750,6 +750,7 @@ namespace JunmpPoliceStation.Controllers
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
string
id
=
entity
?.
id
??
""
;
bool
bExpectedTime
=
DateTime
.
TryParse
(
entity
?.
expectedTime
??
""
,
out
DateTime
expectedTime
);
bool
bIsBindCabinet
=
bool
.
TryParse
(
entity
?.
isBindCabinet
??
""
,
out
bool
isBindCabinet
);
if
(
entity
==
null
)
{
return
JsonManager
.
SimpleCustResponse
(
$"model is null"
);
...
...
@@ -795,6 +796,7 @@ namespace JunmpPoliceStation.Controllers
order
.
PoliceNote
=
entity
.
policeNote
;
order
.
PoliceId
=
entity
.
policeId
;
order
.
FileUrl
=
string
.
IsNullOrEmpty
(
entity
.
fileUrl
)
?
null
:
entity
.
fileUrl
;
order
.
IsBindCabinet
=
isBindCabinet
;
List
<
string
>
tmpList
=
JsonManager
.
GetDetails
(
entity
.
detailList
);
List
<
string
>
tmpList2
=
JsonManager
.
GetDetailIds
(
entity
.
detailList
);
...
...
@@ -959,7 +961,8 @@ namespace JunmpPoliceStation.Controllers
Note
=
entity
.
note
,
PoliceNote
=
entity
.
policeNote
,
PoliceId
=
entity
.
policeId
,
FileUrl
=
string
.
IsNullOrEmpty
(
entity
.
fileUrl
)
?
null
:
entity
.
fileUrl
FileUrl
=
string
.
IsNullOrEmpty
(
entity
.
fileUrl
)
?
null
:
entity
.
fileUrl
,
IsBindCabinet
=
isBindCabinet
};
//if (entity.police!=null)
...
...
@@ -1409,7 +1412,7 @@ namespace JunmpPoliceStation.Controllers
order
.
ApplyUser
=
entity
.
applyId
;
order
.
ApplyUserName
=
entity
.
applyName
;
order
.
PoliceNote
=
entity
.
policeNote
;
order
.
PoliceId
=
entity
.
policeId
;
order
.
PoliceId
=
string
.
IsNullOrEmpty
(
entity
.
policeId
)
?
null
:
entity
.
policeId
;
order
.
ExpectedReturnTime
=
expectedTime
;
...
...
@@ -1540,7 +1543,7 @@ namespace JunmpPoliceStation.Controllers
string
flowState
=
(
string
)
entity
.
flowState
.
ToLower
();
bool
processResult
=
_unitOfWork
.
AddProcess
(
processCurrentId
,
orderID
,
(
string
)
entity
.
userType
,
(
string
)
entity
.
userInfo
,
(
string
)
entity
.
dataScope
,
(
string
)
entity
.
nextStepId
,
(
string
)
entity
.
currentStepName
,
(
string
)
entity
.
flowType
,
(
string
)
entity
.
flowName
,
(
string
)
entity
.
flowId
,
flowState
,
(
string
)
entity
.
orgId
,
(
string
)
entity
.
note
,
(
string
)(
string
)
entity
.
applyId
,
(
string
)
entity
.
applyName
,
OrderCode
);
//新增数据
CommonJpBorrowReturnApply
order
=
new
CommonJpBorrowReturnApply
()
{
...
...
@@ -1558,7 +1561,7 @@ namespace JunmpPoliceStation.Controllers
ProcessCurrentId
=
processCurrentId
,
ExpectedReturnTime
=
expectedTime
,
PoliceNote
=
entity
.
policeNote
,
PoliceId
=
entity
.
policeId
PoliceId
=
string
.
IsNullOrEmpty
(
entity
.
policeId
)
?
null
:
entity
.
policeId
};
List
<
CommonJpBorrowReturnDetailEstimate
>
detailsList
=
new
List
<
CommonJpBorrowReturnDetailEstimate
>();
foreach
(
var
item
in
entity
.
detailList
)
...
...
@@ -1607,7 +1610,7 @@ namespace JunmpPoliceStation.Controllers
borrowReturn
.
CreateTime
=
DateTime
.
Now
;
borrowReturn
.
CreateUser
=
entity
.
auditUser
;
borrowReturn
.
IsWork
=
false
;
borrowReturn
.
PolicemanId
=
order
.
PoliceId
;
borrowReturn
.
PolicemanId
=
order
.
PoliceId
;
foreach
(
var
item
in
detailsList
)
{
//int.TryParse(item.quantity, out int qty);
...
...
@@ -2018,7 +2021,7 @@ namespace JunmpPoliceStation.Controllers
t
.
PoliceId
,
policeName
=
t
.
Police
?.
Name
,
processActionType
=
t
.
ProcessCurrent
?.
ActionType
,
fileUrl
=
t
.
FileUrl
,
fileUrl
=
t
.
FileUrl
,
historyList
=
t
.
ProcessCurrent
?.
CommonJpProcessHistories
?.
Select
(
x
=>
new
{
x
.
Id
,
...
...
JunmpPoliceStation/Controllers/CabinetController.cs
View file @
8fa4380a
...
...
@@ -285,7 +285,7 @@ namespace JunmpPoliceStation.Controllers
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
string
currentCabinetNum
=
entity
?.
currentCabinetNum
??
""
;
bool
bType
=
int
.
TryParse
(
entity
?.
type
,
out
int
type
);
bool
bType
=
int
.
TryParse
(
entity
?.
type
,
out
int
type
);
var
param
=
new
string
[]
{
"Cabinet"
,
...
...
@@ -294,7 +294,7 @@ namespace JunmpPoliceStation.Controllers
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
if
(!
bType
||
type
>
2
)
if
(!
bType
||
type
>
2
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
...
...
@@ -969,14 +969,16 @@ namespace JunmpPoliceStation.Controllers
// stateCode = s.CurrentState,
// epc = s.Epc
//}).ToList(),
equList
=
cab
.
CommonJpEquipmentInventories
?.
Select
(
s
=>
new
{
id
=
s
.
Id
,
name
=
s
.
EquipmentCodeNavigation
?.
Name
,
size
=
s
.
Cabinet
?.
BaseJpPolicemen
.
First
().
Id
==
s
.
PoliceCode
?
s
.
EquipmentSizecodeNavigation
?.
SizeName
:
s
.
EquipmentSizecodeNavigation
?.
SizeName
+
"("
+
s
.
Cabinet
?.
BaseJpPolicemen
.
First
().
Name
+
")"
,
stateCode
=
s
.
CurrentState
,
epc
=
s
.
Epc
}).
ToList
()
equList
=
cab
.
CommonJpEquipmentInventories
?
.
Where
(
s
=>
s
.
CurrentState
==
3
||
s
.
CurrentState
==
7
)
.
Select
(
s
=>
new
{
id
=
s
.
Id
,
name
=
s
.
EquipmentCodeNavigation
?.
Name
,
size
=
s
.
Cabinet
?.
BaseJpPolicemen
.
First
().
Id
==
s
.
PoliceCode
?
s
.
EquipmentSizecodeNavigation
?.
SizeName
:
s
.
EquipmentSizecodeNavigation
?.
SizeName
+
"("
+
s
.
Cabinet
?.
BaseJpPolicemen
.
First
().
Name
+
")"
,
stateCode
=
s
.
CurrentState
,
epc
=
s
.
Epc
}).
ToList
()
};
return
JsonManager
.
ReturnSuccessResponse
(
data
);
}
...
...
@@ -2715,7 +2717,7 @@ namespace JunmpPoliceStation.Controllers
ActionState
=
5
,
OutInState
=
0
,
OrgId
=
cabinet
.
OrganizationId
,
PoliceId
=
policeman
!=
null
?
policeman
.
Id
:
null
};
InsertState
.
Add
(
history
);
...
...
@@ -2734,7 +2736,7 @@ namespace JunmpPoliceStation.Controllers
//{
// editEquipment.PoliceCode = policeman != null ? policeman.Id : null;
//}
editEquipment
.
CabinetId
=
cabinet
.
Id
;
editEquipment
.
OutTime
=
DateTime
.
Now
;
//todo 临时使用
CommonJpEquipmentState
history
=
new
CommonJpEquipmentState
...
...
@@ -2776,8 +2778,8 @@ namespace JunmpPoliceStation.Controllers
{
editEpcEquipment
=
EpcEquipments
.
Where
(
p
=>
p
.
Epc
.
Contains
(
rfid
)).
FirstOrDefault
();
if
(
editEpcEquipment
==
null
)
if
(
editEpcEquipment
==
null
)
{
continue
;
}
...
...
@@ -2807,7 +2809,7 @@ namespace JunmpPoliceStation.Controllers
InsertState
.
Add
(
history
);
}
//SendMsg errEquipmentDic = new SendMsg();
//errEquipmentDic.State = "error";
//errEquipmentDic.Time = time;
...
...
@@ -2850,7 +2852,7 @@ namespace JunmpPoliceStation.Controllers
//{
// editEquipment.PoliceCode = policeman != null ? policeman.Id : null;
//}
editEquipment
.
OrgId
=
cabinet
.
OrganizationId
;
editEquipment
.
WarehouseCode
=
null
;
OutEpc
.
Add
(
editEquipment
);
...
...
@@ -2889,7 +2891,7 @@ namespace JunmpPoliceStation.Controllers
}
if
(
rebind
.
Equals
(
"true"
))
{
var
CurrentBindEquipments
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
t
=>
t
.
InventoryState
!=
"loss"
&&
(
t
.
CabinetId
.
Equals
(
cabinet
.
Id
)||
t
.
PoliceCode
==
cabinet
.
BaseJpPolicemen
.
FirstOrDefault
().
Id
),
null
,
false
,
param
);
//单警柜的东西
var
CurrentBindEquipments
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
t
=>
t
.
InventoryState
!=
"loss"
&&
(
t
.
CabinetId
.
Equals
(
cabinet
.
Id
)
||
t
.
PoliceCode
==
cabinet
.
BaseJpPolicemen
.
FirstOrDefault
().
Id
),
null
,
false
,
param
);
//单警柜的东西
SendMsg
equipmentDic
=
new
SendMsg
();
equipmentDic
.
State
=
"rebind"
;
equipmentDic
.
Msg
=
""
;
...
...
@@ -2902,7 +2904,7 @@ namespace JunmpPoliceStation.Controllers
{
if
(!
Rfids
.
Contains
(
item
.
Epc
))
{
if
(
item
.
PoliceCode
==
policeman
.
Id
)
if
(
item
.
PoliceCode
==
policeman
.
Id
)
{
item
.
PoliceCode
=
null
;
OutEpc
.
Add
(
item
);
...
...
@@ -2918,12 +2920,12 @@ namespace JunmpPoliceStation.Controllers
equipmentDic
.
EPC
=
string
.
IsNullOrEmpty
(
equipmentDic
.
EPC
)
?
item
.
Epc
:
equipmentDic
.
EPC
+
","
+
item
.
Epc
;
equipmentDic
.
Name
=
string
.
IsNullOrEmpty
(
equipmentDic
.
Name
)
?
item
.
EquipmentCodeNavigation
.
Name
+
"-"
+
item
.
EquipmentSizecodeNavigation
.
SizeName
:
equipmentDic
.
Name
+
","
+
item
.
EquipmentCodeNavigation
.
Name
+
"-"
+
item
.
EquipmentSizecodeNavigation
.
SizeName
;
}
}
}
if
(
invBind
.
Count
>
0
)
if
(
invBind
.
Count
>
0
)
{
foreach
(
var
item
in
invBind
)
{
...
...
@@ -2936,7 +2938,7 @@ namespace JunmpPoliceStation.Controllers
}
}
}
if
(!
string
.
IsNullOrEmpty
(
equipmentDic
.
EPC
))
if
(!
string
.
IsNullOrEmpty
(
equipmentDic
.
EPC
))
{
InvStates
.
Add
(
equipmentDic
);
}
...
...
@@ -2957,11 +2959,11 @@ namespace JunmpPoliceStation.Controllers
var
CurrentEI
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
p
=>
p
.
InventoryState
!=
"loss"
&&
p
.
Cabinet
.
CabinetRealNum
.
Equals
(
cabinetID
)
&&
p
.
Cabinet
.
CabinetChildNum
.
Equals
(
Convert
.
ToInt32
(
cabinetChildID
)),
null
,
false
,
param
);
var
InsideEI
=
CurrentEI
.
Where
(
p
=>
p
.
CurrentState
.
Equals
(
3
)).
ToList
();
//在单警柜中的物资
var
errReturnEI
=
InsideEI
.
Where
(
p
=>
p
.
Cabinet
.
BaseJpPolicemen
.
FirstOrDefault
().
Id
!=
p
.
PoliceCode
).
ToList
();
var
errReturnEI
=
InsideEI
.
Where
(
p
=>
p
.
Cabinet
.
BaseJpPolicemen
.
FirstOrDefault
().
Id
!=
p
.
PoliceCode
).
ToList
();
var
OutsideEI
=
CurrentEI
.
Where
(
p
=>
p
.
CurrentState
.
Equals
(
7
)).
ToList
();
//在单警柜外的物资
if
(
rebind
.
Equals
(
"false"
)
&&
(
InsertState
.
Where
(
p
=>
p
.
ActionState
.
Equals
(
5
)
&&
p
.
OutInState
.
Equals
(
1
)).
ToList
().
Count
>
0
&&
InsertState
.
Where
(
p
=>
p
.
ActionState
.
Equals
(
5
)
&&
p
.
OutInState
.
Equals
(
0
)).
ToList
().
Count
<=
0
&&
OutsideEI
.
Count
()
>
0
))
//放入了物资 少还了物资
if
(
rebind
.
Equals
(
"false"
)
&&
(
InsertState
.
Where
(
p
=>
p
.
ActionState
.
Equals
(
5
)
&&
p
.
OutInState
.
Equals
(
1
)).
ToList
().
Count
>
0
&&
InsertState
.
Where
(
p
=>
p
.
ActionState
.
Equals
(
5
)
&&
p
.
OutInState
.
Equals
(
0
)).
ToList
().
Count
<=
0
&&
OutsideEI
.
Count
()
>
0
))
//放入了物资 少还了物资
{
if
(
policeman
!=
null
)
{
...
...
JunmpPoliceStation/Controllers/FixReceiveApplyController.cs
View file @
8fa4380a
...
...
@@ -12,6 +12,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
using
Microsoft.Extensions.Logging
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
StackExchange.Redis
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -652,12 +653,21 @@ namespace JunmpPoliceStation.Controllers
{
detail
.
State
=
1
;
}
//生成流水表
GenerateRecord
(
order
);
//反写库存状态
UpdateInvState
(
order
.
CommonJpFixReceiveApplyDetails
?.
Select
(
x
=>
x
.
Epc
).
ToList
(),
order
.
Action
,
order
.
OrderCode
,
false
);
//江北仓库特殊处理
if
(
order
.
OrgId
==
"E05CC28D-C189-4389-8081-DD0D6E483B40"
)
{
//生成流水表
GenerateRecordMK2
(
order
);
//反写库存状态
UpdateInvStateMK2
(
order
.
CommonJpFixReceiveApplyDetails
?.
Select
(
x
=>
x
.
Epc
).
ToList
(),
order
.
Action
,
order
.
OrderCode
,
false
);
}
else
{
//生成流水表
GenerateRecord
(
order
);
//反写库存状态
UpdateInvState
(
order
.
CommonJpFixReceiveApplyDetails
?.
Select
(
x
=>
x
.
Epc
).
ToList
(),
order
.
Action
,
order
.
OrderCode
,
false
);
}
}
bool
result
=
_unitOfWork
.
FixReceiveApplyRepository
.
Insert
(
order
,
true
);
...
...
@@ -1032,11 +1042,21 @@ namespace JunmpPoliceStation.Controllers
{
detail
.
State
=
1
;
}
//生成流水表
GenerateRecord
(
orderInfo
);
//反写库存状态
UpdateInvState
(
orderInfo
.
CommonJpFixReceiveApplyDetails
?.
Select
(
x
=>
x
.
Epc
).
ToList
(),
orderInfo
.
Action
,
orderInfo
.
OrderCode
,
isLost
);
//江北仓库特殊处理
if
(
orderInfo
.
OrgId
==
"E05CC28D-C189-4389-8081-DD0D6E483B40"
)
{
//生成流水表
GenerateRecordMK2
(
orderInfo
);
//反写库存状态
UpdateInvStateMK2
(
orderInfo
.
CommonJpFixReceiveApplyDetails
?.
Select
(
x
=>
x
.
Epc
).
ToList
(),
orderInfo
.
Action
,
orderInfo
.
OrderCode
,
false
);
}
else
{
//生成流水表
GenerateRecord
(
orderInfo
);
//反写库存状态
UpdateInvState
(
orderInfo
.
CommonJpFixReceiveApplyDetails
?.
Select
(
x
=>
x
.
Epc
).
ToList
(),
orderInfo
.
Action
,
orderInfo
.
OrderCode
,
false
);
}
}
...
...
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
8fa4380a
差异被折叠。
点击展开。
JunmpPoliceStation/Controllers/MessageReminderController.cs
View file @
8fa4380a
...
...
@@ -210,7 +210,7 @@ namespace JunmpPoliceStation.Controllers
IsPushParentWithBorrow
=
isPushParentWithBorrow
,
IsPushParentWithFailWarehouse
=
isPushParentWithFailWarehouse
,
Enable
=
enable
,
EquipmentJson
=
equipmentJson
,
EquipmentJson
=
equipmentJson
,
});
if
(
_unitOfWork
.
SaveChanges
()
>
0
)
{
...
...
@@ -343,36 +343,40 @@ namespace JunmpPoliceStation.Controllers
var
bjLogList
=
_unitOfWork
.
DbContext
.
BaseJpMessageReminderLogs
.
Where
(
x
=>
x
.
OrgId
==
orgId
)
.
Where
(
x
=>
x
.
OrgId
==
orgId
&&
x
.
EquCount
!=
0
)
.
ToList
();
var
xjLogList
=
_unitOfWork
.
DbContext
.
BaseJpMessageReminderLogs
.
Where
(
x
=>
x
.
ParentOrgId
==
orgId
&&
x
.
IsNeedPushParent
)
.
Where
(
x
=>
x
.
ParentOrgId
==
orgId
&&
x
.
IsNeedPushParent
&&
x
.
EquCount
!=
0
)
.
ToList
();
return
JsonManager
.
ReturnSuccessResponse
(
new
var
message
=
new
List
<
string
>();
foreach
(
var
log
in
bjLogList
)
{
bj
=
bjLogList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
createTime
=
x
.
CreateTime
,
type
=
x
.
Type
,
orgId
=
x
.
OrgId
,
orgName
=
x
.
OrgName
,
equCount
=
x
.
EquCount
,
configId
=
x
.
ConfigId
,
}),
xj
=
xjLogList
.
Select
(
x
=>
new
switch
(
log
.
Type
)
{
id
=
x
.
Id
,
createTime
=
x
.
CreateTime
,
type
=
x
.
Type
,
orgId
=
x
.
OrgId
,
orgName
=
x
.
OrgName
,
equCount
=
x
.
EquCount
,
configId
=
x
.
ConfigId
,
})
});
case
0
:
{
//已超期未报废
message
.
Add
(
$"已超期未报废装备共
{
log
.
EquCount
}
件,请尽快处理"
);
break
;
}
case
1
:
{
//超期未归还
message
.
Add
(
$"超期未归还装备共
{
log
.
EquCount
}
件,请尽快处理"
);
break
;
}
case
2
:
{
//非本仓库装备
message
.
Add
(
$"本仓库存在其他仓库装备
{
log
.
EquCount
}
件,请尽快处理"
);
break
;
}
}
}
return
JsonManager
.
ReturnSuccessResponse
(
message
);
}
else
{
...
...
JunmpPoliceStation/Controllers/PolicemanController.cs
View file @
8fa4380a
...
...
@@ -615,6 +615,15 @@ namespace JunmpPoliceStation.Controllers
if
(
string
.
IsNullOrEmpty
(
entity
.
cabinetId
))
{
updateObject
.
CabinetId
=
null
;
//解绑装备
var
equList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
x
=>
x
.
PoliceCode
==
updateObject
.
Id
&&
(
x
.
CurrentState
==
3
||
x
.
CurrentState
==
7
))
.
ToList
();
foreach
(
var
inventory
in
equList
)
{
inventory
.
PoliceCode
=
null
;
}
_unitOfWork
.
EquipmentInventoryRepository
.
Update
(
equList
,
false
);
}
else
{
...
...
JunmpPoliceStation/Controllers/TjController.cs
View file @
8fa4380a
...
...
@@ -637,14 +637,12 @@ namespace JunmpPoliceStation.Controllers
if
(
findcode
.
Length
==
6
)
{
var
data
=
equipmentList
.
GroupBy
(
t
=>
t
.
Org
Cod
e
).
Select
(
c
=>
new
var
data
=
equipmentList
.
GroupBy
(
t
=>
t
.
Org
Nam
e
).
Select
(
c
=>
new
{
OrgName
=
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgName
,
NameJc
=
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
NameJc
,
c
.
FirstOrDefault
().
OrgName
,
c
.
FirstOrDefault
().
FindCode
,
c
.
FirstOrDefault
().
OrgCode
,
c
.
FirstOrDefault
().
SortCode
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
&&
f
.
InventoryState
!=
"loss"
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
bfCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
6
)).
Count
(),
...
...
@@ -653,7 +651,7 @@ namespace JunmpPoliceStation.Controllers
{
id
=
c
.
FirstOrDefault
().
EquipmentCode
,
name
=
c
.
FirstOrDefault
().
EquipmentName
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
&&
f
.
InventoryState
!=
"loss"
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
bfCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
6
)).
Count
(),
...
...
@@ -662,7 +660,7 @@ namespace JunmpPoliceStation.Controllers
}).
ToList
();
data
=
data
.
Where
(
c
=>
c
.
zsCount
!=
0
)
.
OrderBy
(
c
=>
c
.
Sort
Code
.
Length
)
.
OrderBy
(
c
=>
c
.
Find
Code
.
Length
)
.
ThenBy
(
c
=>
c
.
FindCode
)
.
ThenBy
(
c
=>
c
.
OrgCode
)
.
ToList
();
...
...
@@ -682,15 +680,12 @@ namespace JunmpPoliceStation.Controllers
else
{
var
codeLen
=
findcode
.
Length
+
2
;
//var data = equipmentList.GroupBy(t => t.FindCode.PadLeft(codeLen, '0').Substring(0, codeLen)).Select(c => new
var
data
=
equipmentList
.
GroupBy
(
t
=>
t
.
OrgCode
).
Select
(
c
=>
new
var
data
=
equipmentList
.
GroupBy
(
t
=>
t
.
FindCode
.
PadLeft
(
codeLen
,
'0'
).
Substring
(
0
,
codeLen
)).
Select
(
c
=>
new
{
OrgName
=
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgName
,
NameJc
=
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
NameJc
,
OrgName
=
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
AreaName
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
FindCode
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgCode
,
c
.
FirstOrDefault
().
SortCode
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
&&
f
.
InventoryState
!=
"loss"
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
bfCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
6
)).
Count
(),
...
...
@@ -699,7 +694,7 @@ namespace JunmpPoliceStation.Controllers
{
id
=
c
.
FirstOrDefault
().
EquipmentCode
,
name
=
c
.
FirstOrDefault
().
EquipmentName
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
&&
f
.
InventoryState
!=
"loss"
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
bfCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
6
)).
Count
(),
...
...
@@ -708,7 +703,7 @@ namespace JunmpPoliceStation.Controllers
}).
ToList
();
data
=
data
.
Where
(
c
=>
c
.
zsCount
!=
0
)
.
OrderBy
(
c
=>
c
.
Sort
Code
.
Length
)
.
OrderBy
(
c
=>
c
.
Find
Code
.
Length
)
.
ThenBy
(
c
=>
c
.
FindCode
)
.
ThenBy
(
c
=>
c
.
OrgCode
)
.
ToList
();
...
...
JunmpPoliceStation/Extensions/ChannelExtension.cs
View file @
8fa4380a
...
...
@@ -956,6 +956,7 @@ namespace JunmpPoliceStation.Extensions
InsideItem
.
EquipmentLocation
=
0
;
InsideItem
.
UpdateUser
=
policeId
;
InsideItem
.
WarehouseCode
=
warehouseId
;
InsideItem
.
PoliceCode
=
null
;
//借用归还清空人员绑定
if
(
borrowIntoRealDetailEpcItem
.
InsideRealCount
==
null
)
{
borrowIntoRealDetailEpcItem
.
InsideRealCount
=
0
;
...
...
@@ -1069,9 +1070,30 @@ namespace JunmpPoliceStation.Extensions
{
brCount
++;
invenItem
.
CurrentState
=
8
;
invenItem
.
EquipmentLocation
=
3
;
//外出
invenItem
.
PoliceCode
=
realityItem
.
Reality
?.
Apply
?.
PoliceId
;
if
(
realityItem
.
Reality
?.
Apply
?.
IsBindCabinet
==
true
)
{
var
police
=
_unitOfWork
.
PolicemanRepository
.
Get
(
invenItem
.
PoliceCode
);
if
(
police
!=
null
&&
!
string
.
IsNullOrEmpty
(
police
.
CabinetId
))
{
//绑定单警柜
invenItem
.
CabinetId
=
police
.
CabinetId
;
invenItem
.
CurrentState
=
7
;
invenItem
.
EquipmentLocation
=
3
;
//外出
}
else
{
//无效设置,不绑定单警柜
invenItem
.
CurrentState
=
8
;
invenItem
.
EquipmentLocation
=
3
;
//外出
}
}
else
{
invenItem
.
CurrentState
=
8
;
invenItem
.
EquipmentLocation
=
3
;
//外出
}
invenItem
.
UpdateUser
=
policeId
;
if
(
reRealEpcDetailList
.
Count
.
Equals
(
0
))
{
...
...
JunmpPoliceStation/Startup.cs
View file @
8fa4380a
...
...
@@ -35,6 +35,7 @@ using Nacos.AspNetCore;
using
NLog.Extensions.Logging
;
using
Rextec.SOA.Infrastructure
;
using
IHostingEnvironment
=
Microsoft
.
AspNetCore
.
Hosting
.
IHostingEnvironment
;
using
Microsoft.AspNetCore.HttpOverrides
;
namespace
JunmpPoliceStation
{
...
...
@@ -147,6 +148,13 @@ namespace JunmpPoliceStation
.
UseMemoryStorage
());
//使用内存
services
.
AddHangfireServer
();
//添加hangfire服务
services
.
AddScoped
<
CronJob
>();
//注册执行类
services
.
Configure
<
ForwardedHeadersOptions
>(
options
=>
{
options
.
ForwardedHeaders
=
ForwardedHeaders
.
XForwardedFor
|
ForwardedHeaders
.
XForwardedProto
;
options
.
KnownNetworks
.
Clear
();
options
.
KnownProxies
.
Clear
();
});
}
}
...
...
@@ -204,6 +212,8 @@ namespace JunmpPoliceStation
RecurringJob
.
AddOrUpdate
(()
=>
cronJob
.
UpdateMessageReminderData
(),
"0 0 2 1/1 * *"
,
TimeZoneInfo
.
Local
);
}
app
.
UseForwardedHeaders
();
//app.UseMvc(routes =>
//{
// routes.MapRoute(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论