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
5c9dc64a
Commit
5c9dc64a
authored
Dec 22, 2022
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1222 部署
parent
8278dcff
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
344 行增加
和
127 行删除
+344
-127
CommonJpEquipmentInventory.cs
JmpModel/Model/CommonJpEquipmentInventory.cs
+6
-0
JunmppolicesqlContext.cs
JmpModel/Model/DataContext/JunmppolicesqlContext.cs
+15
-0
VScrapView.cs
JmpModel/Model/VScrapView.cs
+6
-0
ViewEquipment.cs
JmpModel/Model/ViewEquipment.cs
+6
-0
BorrowController.cs
JunmpPoliceStation/Controllers/BorrowController.cs
+82
-82
EquipmentDetailController.cs
JunmpPoliceStation/Controllers/EquipmentDetailController.cs
+12
-1
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+139
-41
NoticeController.cs
JunmpPoliceStation/Controllers/NoticeController.cs
+75
-0
ViewController.cs
JunmpPoliceStation/Controllers/ViewController.cs
+3
-3
没有找到文件。
JmpModel/Model/CommonJpEquipmentInventory.cs
View file @
5c9dc64a
...
...
@@ -135,6 +135,12 @@ namespace JmpModel.Model
public
string
BagInventoryId
{
get
;
set
;
}
[
Column
(
"is_need_push_update"
)]
public
bool
?
IsNeedPushUpdate
{
get
;
set
;
}
/// <summary>
/// 是否继续使用
/// </summary>
[
Required
]
[
Column
(
"is_continue_use"
)]
public
bool
?
IsContinueUse
{
get
;
set
;
}
[
ForeignKey
(
nameof
(
BagInventoryId
))]
[
InverseProperty
(
nameof
(
CommonJpBagInventory
.
CommonJpEquipmentInventories
))]
...
...
JmpModel/Model/DataContext/JunmppolicesqlContext.cs
View file @
5c9dc64a
...
...
@@ -392,6 +392,7 @@ namespace JmpModel.Model.DataContext
entity
.
HasOne
(
d
=>
d
.
Apply
)
.
WithMany
(
p
=>
p
.
CommonJpBorrowReturns
)
.
HasForeignKey
(
d
=>
d
.
ApplyId
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
HasConstraintName
(
"common_jp_borrow_return_ibfk_6"
);
entity
.
HasOne
(
d
=>
d
.
Org
)
...
...
@@ -449,6 +450,7 @@ namespace JmpModel.Model.DataContext
entity
.
HasOne
(
d
=>
d
.
Estimate
)
.
WithMany
(
p
=>
p
.
CommonJpBorrowReturnDetailEstimates
)
.
HasForeignKey
(
d
=>
d
.
EstimateId
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
HasConstraintName
(
"common_jp_borrow_return_detail_estimate_ibfk_5"
);
entity
.
HasOne
(
d
=>
d
.
Size
)
...
...
@@ -478,6 +480,7 @@ namespace JmpModel.Model.DataContext
entity
.
HasOne
(
d
=>
d
.
Estimate
)
.
WithMany
(
p
=>
p
.
CommonJpBorrowReturnDetailRealities
)
.
HasForeignKey
(
d
=>
d
.
EstimateId
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
HasConstraintName
(
"common_jp_borrow_return_detail_reality_ibfk_7"
);
entity
.
HasOne
(
d
=>
d
.
Reality
)
...
...
@@ -609,6 +612,10 @@ namespace JmpModel.Model.DataContext
entity
.
Property
(
e
=>
e
.
IsBorrowed
).
HasDefaultValueSql
(
"b'0'"
);
entity
.
Property
(
e
=>
e
.
IsContinueUse
)
.
HasDefaultValueSql
(
"b'0'"
)
.
HasComment
(
"是否继续使用"
);
entity
.
Property
(
e
=>
e
.
IsInBox
).
HasDefaultValueSql
(
"b'0'"
);
entity
.
Property
(
e
=>
e
.
IsNeedPushUpdate
).
HasDefaultValueSql
(
"b'0'"
);
...
...
@@ -1416,6 +1423,10 @@ namespace JmpModel.Model.DataContext
{
entity
.
ToView
(
"v_scrap_view"
);
entity
.
Property
(
e
=>
e
.
IsContinueUse
)
.
HasDefaultValueSql
(
"b'0'"
)
.
HasComment
(
"是否继续使用"
);
entity
.
Property
(
e
=>
e
.
IsScrap
)
.
UseCollation
(
"utf8mb4_general_ci"
)
.
HasCharSet
(
"utf8mb4"
);
...
...
@@ -1472,6 +1483,10 @@ namespace JmpModel.Model.DataContext
entity
.
Property
(
e
=>
e
.
InventoryState
).
HasDefaultValueSql
(
"'normal'"
);
entity
.
Property
(
e
=>
e
.
IsContinueUse
)
.
HasDefaultValueSql
(
"b'0'"
)
.
HasComment
(
"是否继续使用"
);
entity
.
Property
(
e
=>
e
.
IsMap
).
HasDefaultValueSql
(
"'0'"
);
entity
.
Property
(
e
=>
e
.
Price
).
HasPrecision
(
12
,
2
);
...
...
JmpModel/Model/VScrapView.cs
View file @
5c9dc64a
...
...
@@ -15,6 +15,12 @@ namespace JmpModel.Model
[
Column
(
"id"
)]
[
StringLength
(
36
)]
public
string
Id
{
get
;
set
;
}
/// <summary>
/// 是否继续使用
/// </summary>
[
Required
]
[
Column
(
"isContinueUse"
)]
public
bool
?
IsContinueUse
{
get
;
set
;
}
[
Column
(
"epc"
)]
[
StringLength
(
128
)]
public
string
Epc
{
get
;
set
;
}
...
...
JmpModel/Model/ViewEquipment.cs
View file @
5c9dc64a
...
...
@@ -78,5 +78,10 @@ namespace JmpModel.Model
public
int
?
SafeLevel
{
get
;
set
;
}
[
Column
(
"is_map"
,
TypeName
=
"smallint(6)"
)]
public
short
?
IsMap
{
get
;
set
;
}
/// <summary>
/// 是否继续使用
/// </summary>
[
Column
(
"is_continue_use"
)]
public
bool
?
IsContinueUse
{
get
;
set
;
}
}
}
\ No newline at end of file
JunmpPoliceStation/Controllers/BorrowController.cs
View file @
5c9dc64a
...
...
@@ -1428,117 +1428,117 @@ namespace JunmpPoliceStation.Controllers
lock
(
BorrowSign
)
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
if
(
entity
==
null
)
{
return
JsonManager
.
SimpleCustResponse
(
$"model is null"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
id
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"id is require"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
orgId
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"orgId is require"
);
}
else
if
(
jdata
!=
null
)
{
var
id
=
(
string
)(
entity
.
id
);
var
flowState
=
(
string
)(
entity
.
flowState
).
ToLower
();
var
orderInfo
=
_unitOfWork
.
DbContext
.
CommonJpBorrowReturnApplies
.
Include
(
p
=>
p
.
ProcessCurrent
).
FirstOrDefault
(
t
=>
t
.
Id
==
id
);
if
(
orderInfo
.
ProcessCurrent
.
FlowState
==
"ture"
)
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
if
(
entity
==
null
)
{
return
JsonManager
.
Simple
StatusResponse
(
ResultCode
.
ORDER_OPERATE_ERROR
);
return
JsonManager
.
Simple
CustResponse
(
$"model is null"
);
}
if
(
orderInfo
==
null
)
else
if
(
string
.
IsNullOrEmpty
(
entity
.
id
??
""
)
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
return
JsonManager
.
SimpleCustResponse
(
$"id is require"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
orgId
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"orgId is require"
);
}
else
{
bool
processResult
=
_unitOfWork
.
CheckProcess
(
orderInfo
.
Id
);
if
(
processResult
)
var
id
=
(
string
)(
entity
.
id
);
var
flowState
=
(
string
)(
entity
.
flowState
).
ToLower
();
var
orderInfo
=
_unitOfWork
.
DbContext
.
CommonJpBorrowReturnApplies
.
Include
(
p
=>
p
.
ProcessCurrent
).
FirstOrDefault
(
t
=>
t
.
Id
==
id
);
if
(
orderInfo
.
ProcessCurrent
.
FlowState
==
"ture"
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
ORDER_OPERATE_ERROR
);
}
if
(
orderInfo
==
null
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
else
{
bool
processResult
=
_unitOfWork
.
CheckProcess
(
orderInfo
.
Id
);
if
(
processResult
)
{
_unitOfWork
.
ApproveMessage
(
orderInfo
.
Id
);
_unitOfWork
.
AuditProcess
((
string
)
entity
.
actionType
,
orderInfo
.
Id
,
(
string
)
entity
.
userType
,
(
string
)
entity
.
userInfo
,
(
string
)
entity
.
dataScope
,
(
string
)
entity
.
nextStepId
,
(
string
)
entity
.
currentStepName
,
flowState
,
(
string
)
entity
.
approvalMsg
,
(
string
)
entity
.
auditUser
,
(
string
)
entity
.
auditUserName
,
""
,
"approve"
);
orderInfo
.
ApprovalTime
=
DateTime
.
Now
;
_unitOfWork
.
ApproveMessage
(
orderInfo
.
Id
);
_unitOfWork
.
AuditProcess
((
string
)
entity
.
actionType
,
orderInfo
.
Id
,
(
string
)
entity
.
userType
,
(
string
)
entity
.
userInfo
,
(
string
)
entity
.
dataScope
,
(
string
)
entity
.
nextStepId
,
(
string
)
entity
.
currentStepName
,
flowState
,
(
string
)
entity
.
approvalMsg
,
(
string
)
entity
.
auditUser
,
(
string
)
entity
.
auditUserName
,
""
,
"approve"
);
orderInfo
.
ApprovalTime
=
DateTime
.
Now
;
if
(
flowState
.
Equals
(
"false"
))
{
orderInfo
.
ApprovalMsg
=
entity
.
approvalMsg
;
}
else
{
List
<
CommonJpBorrowReturn
>
detailsList
=
new
List
<
CommonJpBorrowReturn
>();
CommonJpBorrowReturn
borrowReturn
=
new
CommonJpBorrowReturn
();
borrowReturn
.
Id
=
Guid
.
NewGuid
().
ToString
();
borrowReturn
.
ActionType
=
orderInfo
.
ActionType
;
borrowReturn
.
WarehouseId
=
orderInfo
.
WarehouseId
;
borrowReturn
.
OrderCode
=
orderInfo
.
OrderCode
;
borrowReturn
.
CurrentState
=
(
int
)
CurrentState
.
未出去
;
borrowReturn
.
ApplyId
=
orderInfo
.
Id
;
borrowReturn
.
OrgId
=
orderInfo
.
OrgId
;
borrowReturn
.
CreateTime
=
DateTime
.
Now
;
borrowReturn
.
CreateUser
=
entity
.
auditUser
;
borrowReturn
.
IsWork
=
false
;
var
DetailEstimates
=
_unitOfWork
.
BorrowReturnDetailEstimateRepository
.
GetList
(
p
=>
p
.
EstimateId
.
Equals
(
id
));
foreach
(
var
item
in
DetailEstimates
)
if
(
flowState
.
Equals
(
"false"
))
{
//int.TryParse(item.quantity, out int qty);
borrowReturn
.
CommonJpBorrowReturnDetailRealities
.
Add
(
new
CommonJpBorrowReturnDetailReality
()
orderInfo
.
ApprovalMsg
=
entity
.
approvalMsg
;
}
else
{
List
<
CommonJpBorrowReturn
>
detailsList
=
new
List
<
CommonJpBorrowReturn
>();
CommonJpBorrowReturn
borrowReturn
=
new
CommonJpBorrowReturn
();
borrowReturn
.
Id
=
Guid
.
NewGuid
().
ToString
();
borrowReturn
.
ActionType
=
orderInfo
.
ActionType
;
borrowReturn
.
WarehouseId
=
orderInfo
.
WarehouseId
;
borrowReturn
.
OrderCode
=
orderInfo
.
OrderCode
;
borrowReturn
.
CurrentState
=
(
int
)
CurrentState
.
未出去
;
borrowReturn
.
ApplyId
=
orderInfo
.
Id
;
borrowReturn
.
OrgId
=
orderInfo
.
OrgId
;
borrowReturn
.
CreateTime
=
DateTime
.
Now
;
borrowReturn
.
CreateUser
=
entity
.
auditUser
;
borrowReturn
.
IsWork
=
false
;
var
DetailEstimates
=
_unitOfWork
.
BorrowReturnDetailEstimateRepository
.
GetList
(
p
=>
p
.
EstimateId
.
Equals
(
id
));
foreach
(
var
item
in
DetailEstimates
)
{
Id
=
Guid
.
NewGuid
().
ToString
(),
SizeId
=
item
.
SizeId
,
EquipmentDetailId
=
item
.
EquipmentId
,
RealityId
=
borrowReturn
.
Id
,
State
=
(
int
)
CurrentState
.
未出去
,
EstimateId
=
id
,
EquipmentCount
=
item
.
EquipmentCount
,
//int.TryParse(item.quantity, out int qty);
SupplierId
=
item
.
SupplierId
borrowReturn
.
CommonJpBorrowReturnDetailRealities
.
Add
(
new
CommonJpBorrowReturnDetailReality
()
{
Id
=
Guid
.
NewGuid
().
ToString
(),
SizeId
=
item
.
SizeId
,
EquipmentDetailId
=
item
.
EquipmentId
,
RealityId
=
borrowReturn
.
Id
,
State
=
(
int
)
CurrentState
.
未出去
,
EstimateId
=
id
,
EquipmentCount
=
item
.
EquipmentCount
,
});
//transferCom.CommonJpTransferDetailRealities = transferDetailsList;
SupplierId
=
item
.
SupplierId
});
//transferCom.CommonJpTransferDetailRealities = transferDetailsList;
detailsList
.
Add
(
borrowReturn
);
}
detailsList
.
Add
(
borrowReturn
);
}
orderInfo
.
CommonJpBorrowReturns
=
detailsList
;
}
bool
result
=
_unitOfWork
.
BorrowReturnApplyRepository
.
Update
(
orderInfo
);
if
(
result
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
orderInfo
.
CommonJpBorrowReturns
=
detailsList
;
}
bool
result
=
_unitOfWork
.
BorrowReturnApplyRepository
.
Update
(
orderInfo
);
if
(
result
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA
_ERROR
);
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
APPROVE
_ERROR
);
}
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
APPROVE_ERROR
);
}
}
}
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
}
catch
(
Exception
ex
)
...
...
JunmpPoliceStation/Controllers/EquipmentDetailController.cs
View file @
5c9dc64a
...
...
@@ -114,6 +114,7 @@ namespace JunmpPoliceStation.Controllers
c
.
UpdateTime
,
c
.
UpdateUser
,
c
.
UnitType
,
c
.
AliasName
,
supplierList
=
c
.
BaseJpSupplierEquipments
.
Select
(
t
=>
new
{
t
.
SupplierCode
})
}
).
ToList
();
...
...
@@ -207,6 +208,7 @@ namespace JunmpPoliceStation.Controllers
c
.
Id
,
c
.
Sort
,
c
.
Name
,
c
.
AliasName
,
c
.
EquipmentId
,
EquipmentName
=
c
.
Equipment
?.
Name
,
c
.
Unit
,
...
...
@@ -323,6 +325,7 @@ namespace JunmpPoliceStation.Controllers
c
.
Id
,
c
.
Sort
,
c
.
Name
,
c
.
AliasName
,
c
.
EquipmentId
,
c
.
Code
,
EquipmentName
=
c
.
Equipment
?.
Name
,
...
...
@@ -437,6 +440,7 @@ namespace JunmpPoliceStation.Controllers
c
.
Id
,
c
.
Sort
,
c
.
Name
,
c
.
AliasName
,
c
.
EquipmentId
,
EquipmentName
=
c
.
Equipment
?.
Name
,
c
.
Unit
,
...
...
@@ -522,7 +526,14 @@ namespace JunmpPoliceStation.Controllers
if
(
updateObject
!=
null
)
{
updateObject
.
AliasName
=
entity
.
aliasName
;
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
if
(
_unitOfWork
.
EquipmentDetailRepository
.
Update
(
updateObject
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_SUCCESS
);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
else
{
...
...
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
5c9dc64a
...
...
@@ -1562,11 +1562,11 @@ namespace JunmpPoliceStation.Controllers
// && t.WarehouseCode != warehouseId
// &&(t.CurrentState==0)
// && (t.LostFlag == false || t.LostFlag == null)).ToList();
if
(
wz_info
.
Count
()
<=
0
)
{
return
JsonManager
.
SimpleCustResponse
(
"未找到物资信息"
);
}
else
//
if (wz_info.Count() <= 0)
//
{
//
return JsonManager.SimpleCustResponse("未找到物资信息");
//
}
//
else
{
var
newList
=
wz_info
.
Select
(
t
=>
new
{
...
...
@@ -2933,7 +2933,7 @@ namespace JunmpPoliceStation.Controllers
string
orderNo
=
entity
.
orderNo
;
string
type
=
entity
.
type
;
string
orgId
=
entity
.
orgId
;
string
policeId
=
entity
.
policeId
;
string
policeId
=
string
.
IsNullOrEmpty
(
entity
.
policeId
)
?
null
:
entity
.
policeId
;
string
warehouseId
=
entity
.
warehouseId
;
string
outInState
=
entity
.
outInState
;
...
...
@@ -3194,51 +3194,149 @@ namespace JunmpPoliceStation.Controllers
}
//#endregion
var
resultEpc
=
UpdateEpc
?.
Select
(
p
=>
new
{
p
.
Epc
,
p
.
CurrentState
}).
ToList
();
//更新的库存信息
var
resultInsertEpc
=
InsertEpc
?.
Select
(
p
=>
new
//提取所有上下文跟踪出入库信息
var
newInvStateList
=
_unitOfWork
.
DbContext
.
ChangeTracker
.
Entries
()
.
Where
(
x
=>
x
.
Entity
is
CommonJpEquipmentState
)
.
Select
(
x
=>
x
.
Entity
as
CommonJpEquipmentState
)
.
ToList
();
foreach
(
var
newInvState
in
newInvStateList
)
{
p
.
Epc
,
p
.
CurrentState
}).
ToList
();
//新增的库存信息
var
resultErrorEpc
=
ErrorEq
?.
Select
(
p
=>
new
newInvState
.
PoliceId
=
string
.
IsNullOrEmpty
(
entity
.
policeId
)
?
null
:
newInvState
.
PoliceId
;
}
using
(
var
scope
=
_unitOfWork
.
BeginTransaction
())
{
Epc
=
p
,
CurrentState
=
11
}).
ToList
();
//不在该仓库的物资信息
try
{
var
resultEpc
=
UpdateEpc
?.
Select
(
p
=>
new
{
p
.
Epc
,
p
.
CurrentState
}).
ToList
();
//更新的库存信息
var
resultInsertEpc
=
InsertEpc
?.
Select
(
p
=>
new
{
p
.
Epc
,
p
.
CurrentState
}).
ToList
();
//新增的库存信息
var
resultErrorEpc
=
ErrorEq
?.
Select
(
p
=>
new
{
Epc
=
p
,
CurrentState
=
11
}).
ToList
();
//不在该仓库的物资信息
resultEpc
.
AddRange
(
resultInsertEpc
);
resultEpc
.
AddRange
(
resultErrorEpc
);
resultEpc
.
AddRange
(
resultInsertEpc
);
resultEpc
.
AddRange
(
resultErrorEpc
);
//跨仓库出库业务清空存放位置(只有update.currentState=1:调拨中 8:领用中 15跨仓库借用中 17跨仓库归还中)
if
(
outInState
.
Equals
(
"出库"
))
{
foreach
(
var
inventory
in
UpdateEpc
.
Where
(
x
=>
new
[]
{
1
,
8
,
15
,
17
}.
Contains
(
x
.
CurrentState
)))
{
inventory
.
ShelfId
=
null
;
inventory
.
ShelfRange
=
null
;
inventory
.
ShelfRow
=
null
;
inventory
.
ShelfColumn
=
null
;
}
_unitOfWork
.
EquipmentInventoryRepository
.
Update
(
UpdateEpc
);
}
//跨仓库出库业务清空存放位置(只有update.currentState=1:调拨中 8:领用中 15跨仓库借用中 17跨仓库归还中)
if
(
outInState
.
Equals
(
"出库"
))
{
foreach
(
var
inventory
in
UpdateEpc
.
Where
(
x
=>
new
[]
{
1
,
8
,
15
,
17
}.
Contains
(
x
.
CurrentState
)))
{
inventory
.
ShelfId
=
null
;
inventory
.
ShelfRange
=
null
;
inventory
.
ShelfRow
=
null
;
inventory
.
ShelfColumn
=
null
;
}
_unitOfWork
.
EquipmentInventoryRepository
.
Update
(
UpdateEpc
);
}
//计算阈值
var
sizeList
=
InsertEpc
.
Select
(
x
=>
x
.
EquipmentSizecode
).
ToList
();
sizeList
.
AddRange
(
UpdateEpc
.
Select
(
x
=>
x
.
EquipmentSizecode
).
ToList
());
_unitOfWork
.
CalcThreshold
(
sizeList
.
Distinct
().
ToList
(),
orgId
,
warehouseId
);
//上报数据
var
pushData
=
new
List
<
object
>();
pushData
.
AddRange
(
InsertEpc
.
Select
(
x
=>
new
{
editType
=
"ADD"
,
id
=
x
.
Id
,
supplierCode
=
x
.
SupplierCode
,
epc
=
x
.
Epc
,
policeCode
=
x
.
PoliceCode
,
equipmentCode
=
x
.
EquipmentCode
,
warehouseCode
=
x
.
WarehouseCode
,
cabinetId
=
x
.
CabinetId
,
equipmentSizecode
=
x
.
EquipmentSizecode
,
equipmentLocation
=
x
.
EquipmentLocation
,
currentState
=
x
.
CurrentState
,
createTime
=
x
.
CreateTime
,
warrantyCycle
=
x
.
WarrantyCycle
,
repairCycle
=
x
.
RepairCycle
,
productTime
=
x
.
ProductTime
,
useTime
=
x
.
UseTime
,
price
=
x
.
Price
,
isBorrowed
=
x
.
IsBorrowed
,
lostFlag
=
x
.
LostFlag
,
inventoryState
=
x
.
InventoryState
,
isInBox
=
x
.
IsInBox
,
boxMarkId
=
x
.
BoxMarkId
,
instantiationState
=
x
.
InstantiationState
,
}));
pushData
.
AddRange
(
UpdateEpc
.
Select
(
x
=>
new
{
editType
=
"UPDATE"
,
id
=
x
.
Id
,
supplierCode
=
x
.
SupplierCode
,
epc
=
x
.
Epc
,
policeCode
=
x
.
PoliceCode
,
equipmentCode
=
x
.
EquipmentCode
,
warehouseCode
=
x
.
WarehouseCode
,
cabinetId
=
x
.
CabinetId
,
equipmentSizecode
=
x
.
EquipmentSizecode
,
equipmentLocation
=
x
.
EquipmentLocation
,
currentState
=
x
.
CurrentState
,
createTime
=
x
.
CreateTime
,
warrantyCycle
=
x
.
WarrantyCycle
,
repairCycle
=
x
.
RepairCycle
,
productTime
=
x
.
ProductTime
,
useTime
=
x
.
UseTime
,
price
=
x
.
Price
,
isBorrowed
=
x
.
IsBorrowed
,
lostFlag
=
x
.
LostFlag
,
inventoryState
=
x
.
InventoryState
,
isInBox
=
x
.
IsInBox
,
boxMarkId
=
x
.
BoxMarkId
,
instantiationState
=
x
.
InstantiationState
,
}));
var
httpResult
=
_httpHelper
.
GetHtml
(
new
HttpItem
()
{
URL
=
_httpHelper
.
_centerServerAddress
+
"/api/Print/EditInventory"
,
Encoding
=
Encoding
.
UTF8
,
Method
=
"POST"
,
ContentType
=
"application/json"
,
Timeout
=
5000
,
Postdata
=
_httpHelper
.
CreatePostData
(
JsonConvert
.
SerializeObject
(
new
{
data
=
pushData
}))
});
if
(
httpResult
.
StatusCode
!=
HttpStatusCode
.
OK
||
string
.
IsNullOrEmpty
(
httpResult
.
Html
))
{
scope
.
Rollback
();
return
JsonManager
.
SimpleCustResponse
(
"远端上报数据失败"
);
}
var
obj
=
JsonConvert
.
DeserializeObject
<
JmpBaseResponse
<
object
>>(
httpResult
.
Html
);
if
(
obj
.
code
!=
"10000"
)
{
scope
.
Rollback
();
return
JsonManager
.
SimpleCustResponse
(
obj
.
msg
);
}
scope
.
Commit
();
//计算阈值
var
sizeList
=
InsertEpc
.
Select
(
x
=>
x
.
EquipmentSizecode
).
ToList
();
sizeList
.
AddRange
(
UpdateEpc
.
Select
(
x
=>
x
.
EquipmentSizecode
).
ToList
());
_unitOfWork
.
CalcThreshold
(
sizeList
.
Distinct
().
ToList
(),
orgId
,
warehouseId
);
return
JsonManager
.
ReturnSuccessResponse
(
resultEpc
);
return
JsonManager
.
ReturnSuccessResponse
(
resultEpc
);
}
catch
(
Exception
e
)
{
scope
.
Rollback
();
throw
;
}
}
}
else
{
...
...
JunmpPoliceStation/Controllers/NoticeController.cs
View file @
5c9dc64a
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
...
...
@@ -207,6 +208,7 @@ namespace JunmpPoliceStation.Controllers
/// "days":7,
/// "scrap":true,
/// "position":"全部 仓库 库外 单警柜",
/// "isContinueUse":"是否继续使用 true",
/// }
/// </remarks>
[
HttpPost
(
"GetTreeScrapMsg"
)]
...
...
@@ -227,6 +229,7 @@ namespace JunmpPoliceStation.Controllers
DateTime
startTime
=
default
;
DateTime
endTime
=
default
;
bool
.
TryParse
(
entity
?.
scrap
??
"false"
,
out
bool
scrap
);
bool
.
TryParse
(
entity
?.
isContinueUse
??
"false"
,
out
bool
isContinueUse
);
if
(
string
.
IsNullOrEmpty
(
orgId
))
{
return
JsonManager
.
SimpleCustResponse
(
"orgId is require"
);
...
...
@@ -283,6 +286,9 @@ namespace JunmpPoliceStation.Controllers
}
}
//继续使用
expression
=
expression
.
AndAlso
(
x
=>
x
.
IsContinueUse
==
isContinueUse
);
var
scrapList
=
_unitOfWork
.
ScrapViewRepository
.
GetPage
(
expression
,
"WarrantyTime"
,
0
,
999999
);
var
data
=
scrapList
.
content
.
GroupBy
(
x
=>
new
{
x
.
WarehouseName
,
x
.
WarehouseId
,
x
.
EquName
,
x
.
SizeName
})
...
...
@@ -296,6 +302,7 @@ namespace JunmpPoliceStation.Controllers
children
=
s
.
Select
(
y
=>
new
{
id
=
y
.
Id
,
equId
=
y
.
EquId
,
epc
=
y
.
Epc
,
sizeId
=
y
.
SizeId
,
sizeName
=
y
.
SizeName
,
...
...
@@ -335,6 +342,74 @@ namespace JunmpPoliceStation.Controllers
}
/// <summary>
/// 更新是否继续使用状态
/// </summary>
/// <param name="jdata"></param>
/// <returns></returns>
/// <remarks>
///
/// ## 例子
/// {
/// "isContinueUse":"是否继续使用 true",
/// "detailList":[
/// {
/// "id":"装备id"
/// }]
/// }
///
/// </remarks>
[
HttpPost
(
"UpdateEquIsContinueUse"
)]
public
async
Task
<
HttpResponseMessage
>
UpdateEquIsContinueUse
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
var
idList
=
new
List
<
string
>();
if
(
entity
.
detailList
is
IEnumerable
)
{
foreach
(
var
obj
in
entity
.
detailList
)
{
idList
.
Add
(
obj
.
id
);
}
}
if
(!
bool
.
TryParse
(
entity
?.
isContinueUse
,
out
bool
isContinueUse
))
{
return
JsonManager
.
SimpleCustResponse
(
"isContinueUse is require"
);
}
var
invList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
x
=>
idList
.
Contains
(
x
.
Id
)).
ToList
();
foreach
(
var
inv
in
invList
)
{
inv
.
IsContinueUse
=
isContinueUse
;
}
if
(
_unitOfWork
.
EquipmentInventoryRepository
.
Update
(
invList
))
{
return
JsonManager
.
ReturnSuccessResponse
(
ResultCode
.
OPERATE_SUCCESS
);
}
else
{
return
JsonManager
.
ReturnSuccessResponse
(
ResultCode
.
OPERATE_FAILED
);
}
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
{
return
JsonManager
.
SimpleCustResponse
(
ex
.
ToString
());
}
});
}
/// <summary>
/// 获取借用超期明细
/// </summary>
/// <param name="jdata"></param>
...
...
JunmpPoliceStation/Controllers/ViewController.cs
View file @
5c9dc64a
...
...
@@ -223,7 +223,7 @@ namespace JunmpPoliceStation.Controllers
//即将报废
jjbfCount
=
ViewEquipmentList
.
Where
(
c
=>
c
.
ParentName
.
Equals
(
parentName
)
&&
c
.
SafeLevel
.
Equals
(
1
)
&&
!
c
.
CurrentState
.
Equals
(
6
)).
Count
();
//已超期未报废
ycqCount
=
ViewEquipmentList
.
Where
(
c
=>
c
.
ParentName
.
Equals
(
parentName
)
&&
c
.
SafeLevel
.
Equals
(
2
)
&&
!
c
.
CurrentState
.
Equals
(
6
)).
Count
();
ycqCount
=
ViewEquipmentList
.
Where
(
c
=>
c
.
ParentName
.
Equals
(
parentName
)
&&
c
.
SafeLevel
.
Equals
(
2
)
&&
!
c
.
CurrentState
.
Equals
(
6
)
&&
c
.
IsContinueUse
!=
true
).
Count
();
//超期未还
cqwhCount
=
Convert
.
ToInt32
(
_unitOfWork
.
BorrowViewRepository
.
Count
(
x
=>
...
...
@@ -244,7 +244,7 @@ namespace JunmpPoliceStation.Controllers
//即将报废
jjbfCount
=
ViewEquipmentList
.
Where
(
c
=>
c
.
SafeLevel
.
Equals
(
1
)
&&
!
c
.
CurrentState
.
Equals
(
6
)).
Count
();
//已超期未报废
ycqCount
=
ViewEquipmentList
.
Where
(
c
=>
c
.
SafeLevel
.
Equals
(
2
)
&&
!
c
.
CurrentState
.
Equals
(
6
)).
Count
();
ycqCount
=
ViewEquipmentList
.
Where
(
c
=>
c
.
SafeLevel
.
Equals
(
2
)
&&
!
c
.
CurrentState
.
Equals
(
6
)
&&
c
.
IsContinueUse
!=
true
).
Count
();
//超期未还
cqwhCount
=
Convert
.
ToInt32
(
_unitOfWork
.
BorrowViewRepository
.
Count
(
x
=>
...
...
@@ -1329,7 +1329,7 @@ namespace JunmpPoliceStation.Controllers
}).
ToList
();
var
data
=
groupData
.
GroupBy
(
t
=>
new
{
t
.
id
,
t
.
PoliceCode
,
t
.
Name
}).
Where
(
c
=>
!
string
.
IsNullOrEmpty
(
c
.
Key
.
id
)).
Select
(
c
=>
new
var
data
=
groupData
.
GroupBy
(
t
=>
new
{
t
.
id
,
t
.
PoliceCode
,
t
.
Name
}).
Where
(
c
=>
!
string
.
IsNullOrEmpty
(
c
.
Key
.
id
)).
Select
(
c
=>
new
{
c
.
Key
.
id
,
c
.
Key
.
PoliceCode
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论