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
7b1ffc81
Commit
7b1ffc81
authored
May 06, 2023
by
zxw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0506
parent
96a67afe
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
520 行增加
和
17 行删除
+520
-17
JunmppolicesqlContext.cs
JmpModel/Model/DataContext/JunmppolicesqlContext.cs
+3
-2
ViewEquipmentType.cs
JmpModel/Model/ViewEquipmentType.cs
+3
-0
EquipmentSizeController.cs
JunmpPoliceStation/Controllers/EquipmentSizeController.cs
+1
-1
InventoryController.cs
JunmpPoliceStation/Controllers/InventoryController.cs
+204
-6
PolicemanController.cs
JunmpPoliceStation/Controllers/PolicemanController.cs
+291
-1
TjController.cs
JunmpPoliceStation/Controllers/TjController.cs
+11
-5
ViewController.cs
JunmpPoliceStation/Controllers/ViewController.cs
+7
-2
没有找到文件。
JmpModel/Model/DataContext/JunmppolicesqlContext.cs
View file @
7b1ffc81
...
@@ -1706,6 +1706,7 @@ Smart:智能货架
...
@@ -1706,6 +1706,7 @@ Smart:智能货架
entity
.
HasOne
(
d
=>
d
.
TrueWarehouse
)
entity
.
HasOne
(
d
=>
d
.
TrueWarehouse
)
.
WithMany
(
p
=>
p
.
CommonJpEquipmentFailWarehouseStateTrueWarehouses
)
.
WithMany
(
p
=>
p
.
CommonJpEquipmentFailWarehouseStateTrueWarehouses
)
.
HasForeignKey
(
d
=>
d
.
TrueWarehouseId
)
.
HasForeignKey
(
d
=>
d
.
TrueWarehouseId
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
HasConstraintName
(
"FK__common_jp__trueW__438BFA74"
);
.
HasConstraintName
(
"FK__common_jp__trueW__438BFA74"
);
});
});
...
@@ -2564,7 +2565,6 @@ Warehouse:仓库");
...
@@ -2564,7 +2565,6 @@ Warehouse:仓库");
entity
.
HasOne
(
d
=>
d
.
Warehouse
)
entity
.
HasOne
(
d
=>
d
.
Warehouse
)
.
WithMany
(
p
=>
p
.
CommonJpInventoryTables
)
.
WithMany
(
p
=>
p
.
CommonJpInventoryTables
)
.
HasForeignKey
(
d
=>
d
.
WarehouseId
)
.
HasForeignKey
(
d
=>
d
.
WarehouseId
)
.
OnDelete
(
DeleteBehavior
.
ClientSetNull
)
.
HasConstraintName
(
"FK_common_jp_inventory_table_base_jp_warehouse"
);
.
HasConstraintName
(
"FK_common_jp_inventory_table_base_jp_warehouse"
);
});
});
...
@@ -2768,7 +2768,6 @@ Warehouse:仓库");
...
@@ -2768,7 +2768,6 @@ Warehouse:仓库");
entity
.
HasOne
(
d
=>
d
.
ApplyPolice
)
entity
.
HasOne
(
d
=>
d
.
ApplyPolice
)
.
WithMany
(
p
=>
p
.
CommonJpPoliceShiftJobsApplies
)
.
WithMany
(
p
=>
p
.
CommonJpPoliceShiftJobsApplies
)
.
HasForeignKey
(
d
=>
d
.
ApplyPoliceId
)
.
HasForeignKey
(
d
=>
d
.
ApplyPoliceId
)
.
OnDelete
(
DeleteBehavior
.
SetNull
)
.
HasConstraintName
(
"FK__common_jp__apply__569ECEE8"
);
.
HasConstraintName
(
"FK__common_jp__apply__569ECEE8"
);
entity
.
HasOne
(
d
=>
d
.
ProcessCurrent
)
entity
.
HasOne
(
d
=>
d
.
ProcessCurrent
)
...
@@ -3712,6 +3711,8 @@ Warehouse:仓库");
...
@@ -3712,6 +3711,8 @@ Warehouse:仓库");
entity
.
ToView
(
"view_equipment_type"
);
entity
.
ToView
(
"view_equipment_type"
);
entity
.
Property
(
e
=>
e
.
EquCode
).
IsUnicode
(
false
);
entity
.
Property
(
e
=>
e
.
EquipmentCode
).
IsUnicode
(
false
);
entity
.
Property
(
e
=>
e
.
EquipmentCode
).
IsUnicode
(
false
);
entity
.
Property
(
e
=>
e
.
EquipmentName
).
IsUnicode
(
false
);
entity
.
Property
(
e
=>
e
.
EquipmentName
).
IsUnicode
(
false
);
...
...
JmpModel/Model/ViewEquipmentType.cs
View file @
7b1ffc81
...
@@ -17,6 +17,9 @@ namespace JmpModel.Model
...
@@ -17,6 +17,9 @@ namespace JmpModel.Model
[
Column
(
"equipment_code"
)]
[
Column
(
"equipment_code"
)]
[
StringLength
(
36
)]
[
StringLength
(
36
)]
public
string
EquipmentCode
{
get
;
set
;
}
public
string
EquipmentCode
{
get
;
set
;
}
[
Column
(
"equ_code"
)]
[
StringLength
(
36
)]
public
string
EquCode
{
get
;
set
;
}
[
Column
(
"equipment_name"
)]
[
Column
(
"equipment_name"
)]
[
StringLength
(
64
)]
[
StringLength
(
64
)]
public
string
EquipmentName
{
get
;
set
;
}
public
string
EquipmentName
{
get
;
set
;
}
...
...
JunmpPoliceStation/Controllers/EquipmentSizeController.cs
View file @
7b1ffc81
...
@@ -74,7 +74,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -74,7 +74,7 @@ namespace JunmpPoliceStation.Controllers
List
<
BaseJpEquipmentSize
>
dataList
=
_unitOfWork
.
EquipmentSizeRepository
.
GetList
(
expression
,
t
=>
t
.
UpdateTime
,
false
,
param
).
ToList
();
List
<
BaseJpEquipmentSize
>
dataList
=
_unitOfWork
.
EquipmentSizeRepository
.
GetList
(
expression
,
t
=>
t
.
UpdateTime
,
false
,
param
).
ToList
();
var
i
=
0
;
var
i
=
0
;
var
data
=
dataList
.
Select
(
c
=>
new
var
data
=
dataList
.
OrderBy
(
c
=>
c
.
SizeName
).
Select
(
c
=>
new
{
{
c
.
Id
,
c
.
Id
,
c
.
SizeName
,
c
.
SizeName
,
...
...
JunmpPoliceStation/Controllers/InventoryController.cs
View file @
7b1ffc81
...
@@ -8359,6 +8359,8 @@ namespace JunmpPoliceStation.Controllers
...
@@ -8359,6 +8359,8 @@ namespace JunmpPoliceStation.Controllers
/// {
/// {
/// "findCode":"当前组织机构代码",
/// "findCode":"当前组织机构代码",
/// "equipmentId":"装备名称",
/// "equipmentId":"装备名称",
/// "orgId":"组织机构过滤",
/// "sizeId":"型号过滤",
/// }
/// }
///
///
/// </remarks>
/// </remarks>
...
@@ -8379,6 +8381,9 @@ namespace JunmpPoliceStation.Controllers
...
@@ -8379,6 +8381,9 @@ namespace JunmpPoliceStation.Controllers
string
equipmentId
=
entity
.
equipmentId
;
string
equipmentId
=
entity
.
equipmentId
;
string
orgCode
=
entity
.
orgCode
;
string
orgCode
=
entity
.
orgCode
;
string
orgId
=
entity
.
orgId
;
string
sizeId
=
entity
.
sizeId
;
Expression
<
Func
<
ViewEquipment
,
bool
>>
expressionPoliceman
=
null
;
Expression
<
Func
<
ViewEquipment
,
bool
>>
expressionPoliceman
=
null
;
expressionPoliceman
=
t
=>
t
.
FindCode
.
Contains
(
findcode
)
&&
t
.
EquipmentCode
.
Equals
(
equipmentId
);
expressionPoliceman
=
t
=>
t
.
FindCode
.
Contains
(
findcode
)
&&
t
.
EquipmentCode
.
Equals
(
equipmentId
);
...
@@ -8389,14 +8394,24 @@ namespace JunmpPoliceStation.Controllers
...
@@ -8389,14 +8394,24 @@ namespace JunmpPoliceStation.Controllers
expressionPoliceman
=
LambdaExtensions
.
AndAlso
(
expressionPoliceman
,
t
=>
t
.
OrgCode
.
Equals
(
orgCode
));
expressionPoliceman
=
LambdaExtensions
.
AndAlso
(
expressionPoliceman
,
t
=>
t
.
OrgCode
.
Equals
(
orgCode
));
}
}
if
(!
string
.
IsNullOrEmpty
(
orgId
))
{
expressionPoliceman
=
LambdaExtensions
.
AndAlso
(
expressionPoliceman
,
t
=>
t
.
OrgId
.
Equals
(
orgId
));
}
if
(!
string
.
IsNullOrEmpty
(
sizeId
))
{
expressionPoliceman
=
LambdaExtensions
.
AndAlso
(
expressionPoliceman
,
t
=>
t
.
EquipmentSizecode
.
Equals
(
sizeId
));
}
List
<
ViewEquipment
>
equipmentList
=
_unitOfWork
.
ViewEquipmentRepository
.
GetList
(
expressionPoliceman
).
OrderBy
(
c
=>
c
.
FindCode
.
Length
).
ToList
();
List
<
ViewEquipment
>
equipmentList
=
_unitOfWork
.
ViewEquipmentRepository
.
GetList
(
expressionPoliceman
).
OrderBy
(
c
=>
c
.
FindCode
.
Length
).
ToList
();
var
data
=
equipmentList
.
GroupBy
(
t
=>
new
{
t
.
OrgId
,
t
.
WarehouseCode
,
t
.
EquipmentSizecode
}).
Select
(
c
=>
new
var
data
=
equipmentList
.
GroupBy
(
t
=>
new
{
t
.
OrgId
,
t
.
EquipmentSizecode
}).
Select
(
c
=>
new
{
{
c
.
FirstOrDefault
().
OrgId
,
c
.
FirstOrDefault
().
OrgId
,
c
.
FirstOrDefault
().
OrgName
,
c
.
FirstOrDefault
().
OrgName
,
WarehouseCode
=
c
.
FirstOrDefault
(
x
=>
x
.
WarehouseCode
!=
null
)?.
WarehouseCode
??
"00000000-0000-0000-0000-000000000000"
,
c
.
FirstOrDefault
().
OrgCode
,
WarehouseName
=
c
.
FirstOrDefault
(
x
=>
x
.
WarehouseCode
!=
null
)?.
WarehouseName
??
""
,
//WarehouseCode = c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseCode ?? "00000000-0000-0000-0000-000000000000",
//WarehouseName = c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseName ?? "",
c
.
FirstOrDefault
().
EquipmentCode
,
c
.
FirstOrDefault
().
EquipmentCode
,
c
.
FirstOrDefault
().
EquipmentName
,
c
.
FirstOrDefault
().
EquipmentName
,
c
.
FirstOrDefault
().
EquipmentSizecode
,
c
.
FirstOrDefault
().
EquipmentSizecode
,
...
@@ -8405,7 +8420,9 @@ namespace JunmpPoliceStation.Controllers
...
@@ -8405,7 +8420,9 @@ namespace JunmpPoliceStation.Controllers
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
3
)).
Count
(),
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
(),
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
()
bfCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
6
)).
Count
()
}).
Where
(
c
=>
c
.
OrgId
!=
null
).
ToList
();
}).
Where
(
c
=>
c
.
OrgId
!=
null
)
.
OrderBy
(
x
=>
x
.
SizeName
)
.
ThenByDescending
(
x
=>
x
.
OrgCode
).
ToList
();
return
JsonManager
.
ReturnSuccessResponse
(
data
);
return
JsonManager
.
ReturnSuccessResponse
(
data
);
}
}
else
else
...
@@ -8972,6 +8989,185 @@ namespace JunmpPoliceStation.Controllers
...
@@ -8972,6 +8989,185 @@ namespace JunmpPoliceStation.Controllers
}
}
/// <summary>
/// <summary>
/// 获取本组织机构型号对应物资信息详情
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "size":10,
/// "page":0,
/// "orgId":"当前组织机构代码",
/// "equipmentSizeId":"装备型号",
/// "shelfId":"货架id",
/// "range":"货架排位置",
/// "row":"货架行位置",
/// "column":"货架列位置",
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
HttpPost
(
"GetListEquipmentByOrgSizeV2"
)]
//[NoSign]
public
async
Task
<
HttpResponseMessage
>
GetListEquipmentByOrgSizeV2
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
string
orgCode
=
entity
.
orgId
;
int
.
TryParse
(
entity
.
page
,
out
int
page
);
int
.
TryParse
(
entity
.
size
,
out
int
size
);
if
(
size
==
0
)
{
size
=
10
;
}
string
OrgId
=
Guid
.
Empty
.
ToString
();
if
(
String
.
IsNullOrEmpty
(
entity
.
equipmentSizeId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
if
(
String
.
IsNullOrEmpty
(
entity
.
orgId
))
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
else
{
OrgId
=
entity
.
orgId
;
}
var
param
=
new
string
[]
{
"EquipmentSizecodeNavigation"
,
"EquipmentCodeNavigation"
,
"WarehouseCodeNavigation"
,
"Org"
,
"CommonJpEquipmentStates"
,
"SupplierCodeNavigation"
,
"Cabinet"
,
"Shelf"
};
Expression
<
Func
<
CommonJpEquipmentInventory
,
bool
>>
expression
=
t
=>
OrgId
.
Equals
(
t
.
OrgId
);
expression
=
LambdaExtensions
.
AndAlso
(
expression
,
t
=>
t
.
InventoryState
!=
"loss"
);
//orgList.Add(orgInfo.Id);//查询所有组织机构仓库库存信息
//装备型号
if
(!
String
.
IsNullOrEmpty
(
entity
.
equipmentSizeId
))
{
string
equipmentSizeId
=
entity
.
equipmentSizeId
;
expression
=
LambdaExtensions
.
AndAlso
(
expression
,
t
=>
t
.
EquipmentSizecode
.
Contains
(
equipmentSizeId
));
}
//位置
if
(!
string
.
IsNullOrEmpty
(
entity
.
shelfId
))
{
string
shelfId
=
entity
.
shelfId
;
expression
=
expression
.
AndAlso
(
t
=>
t
.
ShelfId
==
shelfId
);
if
(
int
.
TryParse
(
entity
.
range
,
out
int
range
)
&&
range
>
0
)
{
expression
=
expression
.
AndAlso
(
t
=>
t
.
ShelfRange
==
range
);
}
if
(
int
.
TryParse
(
entity
.
row
,
out
int
row
)
&&
row
>
0
)
{
expression
=
expression
.
AndAlso
(
t
=>
t
.
ShelfRow
==
row
);
}
if
(
int
.
TryParse
(
entity
.
column
,
out
int
column
)
&&
column
>
0
)
{
expression
=
expression
.
AndAlso
(
t
=>
t
.
ShelfColumn
==
column
);
}
}
var
EquipmentList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
c
=>
c
.
CreateTime
,
false
,
param
).
ToList
();
var
datas
=
EquipmentList
.
Select
(
equipment
=>
new
{
equipment
.
Id
,
equipment
.
Epc
,
equipment
.
UseDirection
,
equipment
.
WarrantyCycle
,
equipment
.
ProductTime
,
equipment
.
UseTime
,
equipment
.
CurrentState
,
shelfId
=
equipment
.
ShelfId
,
shelfCode
=
equipment
.
Shelf
?.
Code
,
shelfName
=
equipment
.
Shelf
?.
Name
,
shelf
=
equipment
.
Shelf
==
null
?
null
:
new
{
equipment
.
Shelf
.
Id
,
equipment
.
Shelf
.
CreateTime
,
equipment
.
Shelf
.
Name
,
equipment
.
Shelf
.
Code
,
equipment
.
Shelf
.
Type
,
equipment
.
Shelf
.
WarehouseId
,
equipment
.
Shelf
.
Row
,
equipment
.
Shelf
.
Column
,
equipment
.
Shelf
.
Range
,
},
range
=
equipment
.
ShelfRange
,
row
=
equipment
.
ShelfRow
,
column
=
equipment
.
ShelfColumn
,
safeLevel
=
equipment
.
SafeLevel
,
equipment
.
Address
,
sizeName
=
equipment
.
EquipmentSizecodeNavigation
?.
SizeName
,
equipment
.
EquipmentSizecode
,
equipmentName
=
equipment
.
EquipmentCodeNavigation
?.
Name
,
equipment
.
EquipmentCode
,
warehouseName
=
equipment
.
WarehouseCodeNavigation
?.
Name
,
equipment
.
WarehouseCode
,
equipment
.
Org
.
Name
,
equipment
.
OrgId
,
supplierName
=
equipment
.
SupplierCodeNavigation
?.
Name
,
equipment
.
SupplierCode
,
cabinetID
=
equipment
.
Cabinet
?.
Id
,
CabinetChildNum
=
equipment
.
Cabinet
?.
CabinetChildNum
+
"号柜"
,
equipment
.
Cabinet
?.
CabinetNum
,
equipment
.
Price
,
equipment
.
RepairCycle
}
);
var
content
=
new
{
totalElements
=
datas
.
Count
(),
content
=
datas
.
Skip
(
page
*
size
).
Take
(
size
).
ToList
()
};
return
JsonManager
.
ReturnSuccessResponse
(
content
);
// return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
});
}
/// <summary>
/// 批量修改本组织机构仓库下型号对应物资信息详情
/// 批量修改本组织机构仓库下型号对应物资信息详情
/// </summary>
/// </summary>
/// <remarks>
/// <remarks>
...
@@ -9789,13 +9985,15 @@ namespace JunmpPoliceStation.Controllers
...
@@ -9789,13 +9985,15 @@ namespace JunmpPoliceStation.Controllers
warehouseCode
=
x
.
Key
.
WarehouseCode
,
warehouseCode
=
x
.
Key
.
WarehouseCode
,
warehouseName
=
x
.
FirstOrDefault
()?.
WarehouseCodeNavigation
?.
Name
,
warehouseName
=
x
.
FirstOrDefault
()?.
WarehouseCodeNavigation
?.
Name
,
equipmentCode
=
x
.
Key
.
EquipmentCode
,
equipmentCode
=
x
.
Key
.
EquipmentCode
,
equCode
=
x
.
FirstOrDefault
().
EquipmentCodeNavigation
?.
Code
,
equipmentName
=
x
.
FirstOrDefault
()?.
EquipmentCodeNavigation
?.
Name
,
equipmentName
=
x
.
FirstOrDefault
()?.
EquipmentCodeNavigation
?.
Name
,
equipmentSizecode
=
x
.
Key
.
EquipmentSizecode
,
equipmentSizecode
=
x
.
Key
.
EquipmentSizecode
,
equSizecode
=
x
.
FirstOrDefault
()?.
EquipmentSizecodeNavigation
?.
SizeName
,
equipmentSizeName
=
x
.
FirstOrDefault
()?.
EquipmentSizecodeNavigation
?.
SizeName
,
equipmentSizeName
=
x
.
FirstOrDefault
()?.
EquipmentSizecodeNavigation
?.
SizeName
,
count
=
x
.
Count
()
count
=
x
.
Count
()
})
})
.
OrderBy
(
x
=>
x
.
equ
ipment
Code
)
.
OrderBy
(
x
=>
x
.
equCode
)
.
ThenBy
(
x
=>
x
.
equ
ipment
Sizecode
)
.
ThenBy
(
x
=>
x
.
equSizecode
)
.
ThenBy
(
x
=>
x
.
orgizationCode
)
.
ThenBy
(
x
=>
x
.
orgizationCode
)
.
ThenBy
(
x
=>
x
.
warehouseCode
);
.
ThenBy
(
x
=>
x
.
warehouseCode
);
...
...
JunmpPoliceStation/Controllers/PolicemanController.cs
View file @
7b1ffc81
...
@@ -532,7 +532,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -532,7 +532,7 @@ namespace JunmpPoliceStation.Controllers
/// <summary>
/// <summary>
/// 添加或修改警员信息
/// 添加或修改警员信息
(第三方使用)
/// </summary>
/// </summary>
/// <remarks>
/// <remarks>
///
///
...
@@ -823,6 +823,296 @@ namespace JunmpPoliceStation.Controllers
...
@@ -823,6 +823,296 @@ namespace JunmpPoliceStation.Controllers
});
});
}
}
/// <summary>
/// 添加或修改警员信息(主平台使用)
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "id" : "编号",
/// "name":"姓名",
/// "idCardNo":"身份证",
/// "orgizationCode":"组织机构",
/// "policeCode":"警号编号",
/// "sex" : "姓别",
/// "cabinetId":"单警柜ID",
/// "photo": "人脸照片路径",
/// "phone" : "手机号码",
/// "updateUser":"操作用户ID",
/// "isCreatedAccount":"是否注册账户",
/// "account":"注册账户名(缺省为姓名)",
/// "thirdPoliceId":"第三方自建平台创建警员id(新增用)"
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[
HttpPost
(
"AddOrUpdatePolicemanFromHost"
)]
//[NoSign]
public
async
Task
<
HttpResponseMessage
>
AddOrUpdatePolicemanFromHost
([
FromBody
]
JObject
jdata
)
{
return
await
Task
.
Run
(()
=>
{
try
{
if
(
jdata
!=
null
)
{
var
entity
=
JsonManager
.
GetJsonEntity
(
jdata
);
string
id
=
entity
?.
id
??
""
;
if
(
entity
==
null
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
//第三方调用接口验证orgId正确性
if
(!
string
.
IsNullOrEmpty
(
entity
.
_PUSHORG
))
{
if
(
entity
.
orgizationCode
?.
ToString
()
!=
entity
.
_PUSHORG
.
ToString
())
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
ORGANIZATION_ERROR
);
}
}
if
(
string
.
IsNullOrEmpty
(
entity
.
name
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"Name is require"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
policeCode
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"PoliceCode is require"
);
}
else
if
(
entity
.
policeCode
.
Length
>
9
)
{
return
JsonManager
.
SimpleCustResponse
(
$"PoliceCode長度不能超過9位"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
orgizationCode
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"OrgizationCode is require"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
phone
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"Phone is require"
);
}
else
if
(
string
.
IsNullOrEmpty
(
entity
.
sex
??
""
))
{
return
JsonManager
.
SimpleCustResponse
(
$"Sex is require"
);
}
else
if
(!
string
.
IsNullOrEmpty
(
id
))
{
Expression
<
Func
<
BaseJpPoliceman
,
bool
>>
expression
=
t
=>
t
.
Id
.
Equals
(
id
);
BaseJpPoliceman
updateObject
=
_unitOfWork
.
PolicemanRepository
.
Get
(
expression
);
if
(
updateObject
!=
null
)
{
updateObject
.
Name
=
entity
.
name
;
updateObject
.
OrgizationCode
=
entity
.
orgizationCode
;
updateObject
.
PoliceCode
=
entity
.
policeCode
;
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
{
updateObject
.
CabinetId
=
entity
.
cabinetId
;
}
updateObject
.
Sex
=
entity
.
sex
;
updateObject
.
Photo
=
entity
.
photo
;
updateObject
.
Phone
=
entity
.
phone
;
updateObject
.
UpdateTime
=
System
.
DateTime
.
Now
;
updateObject
.
UpdateUser
=
entity
.
updateUser
;
updateObject
.
IdCardNo
=
entity
.
idCardNo
;
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
if
(
Convert
.
ToBoolean
(
entity
.
isCreatedAccount
))
{
if
(
updateObject
.
IsCreatedAccount
)
{
//已创建账户,过滤
}
else
{
//注册账户
string
name
=
string
.
IsNullOrEmpty
(
entity
.
account
)
?
entity
.
name
:
entity
.
account
;
var
old
=
_unitOfWork
.
CommonJpUserRepository
.
Get
(
predicate
:
x
=>
x
.
Username
==
name
);
if
(
old
!=
null
)
{
return
JsonManager
.
SimpleCustResponse
(
"重名注册"
);
}
var
userId
=
Guid
.
NewGuid
().
ToString
();
var
res
=
_unitOfWork
.
CommonJpUserRepository
.
Insert
(
new
CommonJpUser
()
{
Id
=
userId
,
Password
=
"e10adc3949ba59abbe56e057f20f883e"
,
Username
=
name
,
Phone
=
entity
.
phone
,
CreateTime
=
DateTime
.
Now
,
NickName
=
entity
.
name
,
OrganizationId
=
entity
.
orgizationCode
,
Enabled
=
1
,
PoliceId
=
updateObject
.
Id
});
if
(!
res
)
{
return
JsonManager
.
SimpleCustResponse
(
"注册失败,请稍后再试"
);
}
_unitOfWork
.
UsersRoleRepository
.
Insert
(
new
UsersRole
{
RoleId
=
6
,
UserId
=
userId
});
updateObject
.
IsCreatedAccount
=
true
;
}
}
bool
result
=
_unitOfWork
.
PolicemanRepository
.
Update
(
updateObject
);
if
(
result
)
{
return
JsonManager
.
ReturnSuccessResponse
(
new
{
id
=
updateObject
.
Id
,
name
=
updateObject
.
Name
,
orgizationCode
=
updateObject
.
OrgizationCode
,
phone
=
updateObject
.
Phone
,
policeCode
=
updateObject
.
PoliceCode
,
sex
=
updateObject
.
Sex
,
});
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
else
{
string
cabinetId
=
null
;
if
(
string
.
IsNullOrEmpty
(
entity
.
cabinetId
))
{
cabinetId
=
null
;
}
else
{
cabinetId
=
entity
.
cabinetId
;
}
string
policeCode
=
entity
.
policeCode
;
Expression
<
Func
<
BaseJpPoliceman
,
bool
>>
expression
=
t
=>
t
.
PoliceCode
.
Equals
(
policeCode
);
BaseJpPoliceman
cfObject
=
_unitOfWork
.
PolicemanRepository
.
Get
(
expression
);
if
(
cfObject
!=
null
)
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
POLICE_C_ERROR
);
}
//新增数据
BaseJpPoliceman
addObject
=
new
BaseJpPoliceman
()
{
Id
=
string
.
IsNullOrEmpty
(
entity
.
thirdPoliceId
)
?
Guid
.
NewGuid
().
ToString
()
:
entity
.
thirdPoliceId
,
Sort
=
null
,
Name
=
entity
.
name
,
CabinetId
=
cabinetId
,
OrgizationCode
=
entity
.
orgizationCode
,
PoliceCode
=
entity
.
policeCode
,
Sex
=
entity
.
sex
,
FingerInfo1
=
null
,
FaceInfo
=
null
,
Photo
=
entity
.
photo
,
Phone
=
entity
.
phone
,
CreateTime
=
System
.
DateTime
.
Now
,
UpdateTime
=
System
.
DateTime
.
Now
,
UpdateUser
=
entity
.
updateUser
,
IdCardNo
=
entity
.
idCardNo
,
};
bool
result
=
false
;
if
(
Convert
.
ToBoolean
(
entity
.
isCreatedAccount
))
{
//注册账户
string
name
=
string
.
IsNullOrEmpty
(
entity
.
account
)
?
entity
.
name
:
entity
.
account
;
var
old
=
_unitOfWork
.
CommonJpUserRepository
.
Get
(
predicate
:
x
=>
x
.
Username
==
name
);
if
(
old
!=
null
)
{
return
JsonManager
.
SimpleCustResponse
(
"重名注册"
);
}
var
userId
=
Guid
.
NewGuid
().
ToString
();
_unitOfWork
.
CommonJpUserRepository
.
Insert
(
new
CommonJpUser
()
{
Id
=
userId
,
Password
=
"e10adc3949ba59abbe56e057f20f883e"
,
Username
=
name
,
Phone
=
entity
.
phone
,
CreateTime
=
DateTime
.
Now
,
NickName
=
entity
.
name
,
OrganizationId
=
entity
.
orgizationCode
,
Enabled
=
1
,
PoliceId
=
addObject
.
Id
},
false
);
_unitOfWork
.
UsersRoleRepository
.
Insert
(
new
UsersRole
{
RoleId
=
6
,
UserId
=
userId
},
false
);
addObject
.
IsCreatedAccount
=
true
;
_unitOfWork
.
PolicemanRepository
.
Insert
(
addObject
,
false
);
result
=
_unitOfWork
.
DbContext
.
SaveChanges
()
>
0
;
if
(!
result
)
{
return
JsonManager
.
SimpleCustResponse
(
"注册失败,请稍后再试"
);
}
}
else
{
result
=
_unitOfWork
.
PolicemanRepository
.
Insert
(
addObject
);
}
if
(
result
)
{
return
JsonManager
.
ReturnSuccessResponse
(
new
{
id
=
addObject
.
Id
,
name
=
addObject
.
Name
,
orgizationCode
=
addObject
.
OrgizationCode
,
phone
=
addObject
.
Phone
,
policeCode
=
addObject
.
PoliceCode
,
sex
=
addObject
.
Sex
,
});
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
}
else
{
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
REQUEST_DATA_ERROR
);
}
}
catch
(
Exception
ex
)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return
JsonManager
.
SimpleStatusResponse
(
ResultCode
.
OPERATE_FAILED
);
}
});
}
/// <summary>
/// <summary>
/// 删除警员信息
/// 删除警员信息
...
...
JunmpPoliceStation/Controllers/TjController.cs
View file @
7b1ffc81
...
@@ -662,6 +662,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -662,6 +662,7 @@ namespace JunmpPoliceStation.Controllers
OrgName
=
string
.
IsNullOrEmpty
(
c
.
FirstOrDefault
().
DName
)
?
c
.
FirstOrDefault
().
OrgName
:
c
.
FirstOrDefault
().
DName
,
OrgName
=
string
.
IsNullOrEmpty
(
c
.
FirstOrDefault
().
DName
)
?
c
.
FirstOrDefault
().
OrgName
:
c
.
FirstOrDefault
().
DName
,
c
.
FirstOrDefault
().
FindCode
,
c
.
FirstOrDefault
().
FindCode
,
c
.
FirstOrDefault
().
OrgCode
,
c
.
FirstOrDefault
().
OrgCode
,
c
.
FirstOrDefault
().
OrgId
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
...
@@ -674,6 +675,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -674,6 +675,7 @@ namespace JunmpPoliceStation.Controllers
children
=
c
.
OrderBy
(
z
=>
z
.
TypeOneId
).
ThenBy
(
z
=>
z
.
TypeTwoId
).
ThenBy
(
z
=>
z
.
TypeThreeId
).
GroupBy
(
a
=>
a
.
EquipmentCode
).
Select
(
c
=>
new
children
=
c
.
OrderBy
(
z
=>
z
.
TypeOneId
).
ThenBy
(
z
=>
z
.
TypeTwoId
).
ThenBy
(
z
=>
z
.
TypeThreeId
).
GroupBy
(
a
=>
a
.
EquipmentCode
).
Select
(
c
=>
new
{
{
id
=
c
.
FirstOrDefault
().
EquipmentCode
,
id
=
c
.
FirstOrDefault
().
EquipmentCode
,
code
=
c
.
FirstOrDefault
().
EquipmentCode1
,
name
=
c
.
FirstOrDefault
().
EquipmentName
,
name
=
c
.
FirstOrDefault
().
EquipmentName
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
...
@@ -684,7 +686,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -684,7 +686,7 @@ namespace JunmpPoliceStation.Controllers
djgckCount
=
c
.
Count
(
x
=>
x
.
CurrentState
==
7
),
djgckCount
=
c
.
Count
(
x
=>
x
.
CurrentState
==
7
),
priceCount
=
c
.
Where
(
f
=>
!
f
.
CurrentState
.
Equals
(
6
)
&&
f
.
Price
!=
null
).
Sum
(
k
=>
k
.
Price
)
priceCount
=
c
.
Where
(
f
=>
!
f
.
CurrentState
.
Equals
(
6
)
&&
f
.
Price
!=
null
).
Sum
(
k
=>
k
.
Price
)
}).
Where
(
f
=>
f
.
id
!=
null
&&
(
f
.
zsCount
!=
0
||
f
.
bfCount
!=
0
)).
ToList
()
}).
Where
(
f
=>
f
.
id
!=
null
&&
(
f
.
zsCount
!=
0
||
f
.
bfCount
!=
0
)).
OrderBy
(
f
=>
f
.
code
).
ToList
()
}).
ToList
();
}).
ToList
();
data
=
data
.
Where
(
c
=>
c
.
zsCount
!=
0
||
c
.
bfCount
!=
0
)
data
=
data
.
Where
(
c
=>
c
.
zsCount
!=
0
||
c
.
bfCount
!=
0
)
...
@@ -725,6 +727,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -725,6 +727,7 @@ namespace JunmpPoliceStation.Controllers
OrgName
=
string
.
IsNullOrEmpty
(
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
DName
)
?
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgName
:
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
DName
,
OrgName
=
string
.
IsNullOrEmpty
(
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
DName
)
?
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgName
:
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
DName
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
FindCode
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
FindCode
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgCode
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgCode
,
c
.
OrderBy
(
f
=>
f
.
OrgCode
).
FirstOrDefault
().
OrgId
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
ckCount
=
c
.
Where
(
f
=>
!(
f
.
CurrentState
==
null
||
f
.
CurrentState
.
Equals
(
0
)
||
f
.
CurrentState
.
Equals
(
6
))).
Count
(),
...
@@ -737,6 +740,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -737,6 +740,7 @@ namespace JunmpPoliceStation.Controllers
children
=
c
.
OrderBy
(
z
=>
z
.
TypeOneId
).
ThenBy
(
z
=>
z
.
TypeTwoId
).
ThenBy
(
z
=>
z
.
TypeThreeId
).
GroupBy
(
a
=>
a
.
EquipmentCode
).
Select
(
c
=>
new
children
=
c
.
OrderBy
(
z
=>
z
.
TypeOneId
).
ThenBy
(
z
=>
z
.
TypeTwoId
).
ThenBy
(
z
=>
z
.
TypeThreeId
).
GroupBy
(
a
=>
a
.
EquipmentCode
).
Select
(
c
=>
new
{
{
id
=
c
.
FirstOrDefault
().
EquipmentCode
,
id
=
c
.
FirstOrDefault
().
EquipmentCode
,
code
=
c
.
FirstOrDefault
().
EquipmentCode1
,
name
=
c
.
FirstOrDefault
().
EquipmentName
,
name
=
c
.
FirstOrDefault
().
EquipmentName
,
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zsCount
=
c
.
Count
(
f
=>
f
.
CurrentState
!=
6
&&
f
.
CurrentState
!=
null
),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
zkCount
=
c
.
Where
(
f
=>
f
.
CurrentState
.
Equals
(
0
)).
Count
(),
...
@@ -747,7 +751,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -747,7 +751,7 @@ namespace JunmpPoliceStation.Controllers
djgckCount
=
c
.
Count
(
x
=>
x
.
CurrentState
==
7
),
djgckCount
=
c
.
Count
(
x
=>
x
.
CurrentState
==
7
),
priceCount
=
c
.
Where
(
f
=>
!
f
.
CurrentState
.
Equals
(
6
)
&&
f
.
Price
!=
null
).
Sum
(
k
=>
k
.
Price
)
priceCount
=
c
.
Where
(
f
=>
!
f
.
CurrentState
.
Equals
(
6
)
&&
f
.
Price
!=
null
).
Sum
(
k
=>
k
.
Price
)
}).
Where
(
f
=>
f
.
id
!=
null
&&
(
f
.
zsCount
!=
0
||
f
.
bfCount
!=
0
)).
ToList
()
}).
Where
(
f
=>
f
.
id
!=
null
&&
(
f
.
zsCount
!=
0
||
f
.
bfCount
!=
0
)).
OrderBy
(
f
=>
f
.
code
).
ToList
()
}).
ToList
();
}).
ToList
();
data
=
data
.
Where
(
c
=>
c
.
zsCount
!=
0
||
c
.
bfCount
!=
0
)
data
=
data
.
Where
(
c
=>
c
.
zsCount
!=
0
||
c
.
bfCount
!=
0
)
...
@@ -870,7 +874,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -870,7 +874,7 @@ namespace JunmpPoliceStation.Controllers
var
EquipmentList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
).
ToList
();
var
EquipmentList
=
_unitOfWork
.
EquipmentInventoryRepository
.
GetList
(
expression
,
null
,
false
,
param
).
ToList
();
var
datas
=
EquipmentList
.
GroupBy
(
p
=>
p
.
EquipmentCode
).
Select
(
c
=>
new
var
datas
=
EquipmentList
.
GroupBy
(
p
=>
p
.
EquipmentCode
).
Select
(
c
=>
new
{
{
code
=
c
.
FirstOrDefault
().
EquipmentCodeNavigation
?.
Equipment
?.
Code
,
code
=
c
.
FirstOrDefault
().
EquipmentCodeNavigation
?.
Code
,
equipmentCode
=
c
.
Key
,
equipmentCode
=
c
.
Key
,
equipmentName
=
c
.
FirstOrDefault
().
EquipmentCodeNavigation
.
Name
,
equipmentName
=
c
.
FirstOrDefault
().
EquipmentCodeNavigation
.
Name
,
sumCount
=
c
.
Where
(
p
=>
p
.
CurrentState
!=
6
).
Count
(),
sumCount
=
c
.
Where
(
p
=>
p
.
CurrentState
!=
6
).
Count
(),
...
@@ -1659,6 +1663,8 @@ namespace JunmpPoliceStation.Controllers
...
@@ -1659,6 +1663,8 @@ namespace JunmpPoliceStation.Controllers
TypeTwoId
=
c
.
FirstOrDefault
().
TypeTwoId
,
TypeTwoId
=
c
.
FirstOrDefault
().
TypeTwoId
,
TypeThreeId
=
c
.
FirstOrDefault
().
TypeThreeId
,
TypeThreeId
=
c
.
FirstOrDefault
().
TypeThreeId
,
EquipmentCode
=
c
.
FirstOrDefault
().
EquipmentCode
,
EquipmentCode
=
c
.
FirstOrDefault
().
EquipmentCode
,
EquCode
=
c
.
FirstOrDefault
().
EquCode
,
EquipmentSizecode
=
c
.
FirstOrDefault
().
EquipmentSizecode
,
EquipmentSizecode
=
c
.
FirstOrDefault
().
EquipmentSizecode
,
ParentName
=
c
.
FirstOrDefault
().
Name
,
ParentName
=
c
.
FirstOrDefault
().
Name
,
EquipmentName
=
c
.
FirstOrDefault
().
EquipmentName
,
EquipmentName
=
c
.
FirstOrDefault
().
EquipmentName
,
...
@@ -1670,8 +1676,8 @@ namespace JunmpPoliceStation.Controllers
...
@@ -1670,8 +1676,8 @@ namespace JunmpPoliceStation.Controllers
).
OrderBy
(
x
=>
x
.
id
)
).
OrderBy
(
x
=>
x
.
id
)
.
ThenBy
(
x
=>
x
.
TypeTwoId
)
.
ThenBy
(
x
=>
x
.
TypeTwoId
)
.
ThenBy
(
x
=>
x
.
TypeThreeId
)
.
ThenBy
(
x
=>
x
.
TypeThreeId
)
.
ThenBy
(
x
=>
x
.
Equ
ipment
Code
)
.
ThenBy
(
x
=>
x
.
EquCode
)
.
ThenBy
(
x
=>
x
.
EquipmentSizecod
e
)
.
ThenBy
(
x
=>
x
.
SizeNam
e
)
.
ToList
();
.
ToList
();
return
JsonManager
.
ReturnSuccessResponse
(
new
return
JsonManager
.
ReturnSuccessResponse
(
new
...
...
JunmpPoliceStation/Controllers/ViewController.cs
View file @
7b1ffc81
...
@@ -482,7 +482,12 @@ namespace JunmpPoliceStation.Controllers
...
@@ -482,7 +482,12 @@ namespace JunmpPoliceStation.Controllers
IQueryable
<
ViewEquipment
>
ViewEquipmentList
=
_unitOfWork
.
ViewEquipmentRepository
.
GetArray
(
ViewEquipmentExpression
,
t
=>
t
.
FindCode
,
false
);
IQueryable
<
ViewEquipment
>
ViewEquipmentList
=
_unitOfWork
.
ViewEquipmentRepository
.
GetArray
(
ViewEquipmentExpression
,
t
=>
t
.
FindCode
,
false
);
var
groupList
=
ViewEquipmentList
.
GroupBy
(
c
=>
c
.
ParentName
).
Select
(
g
=>
new
{
name
=
g
.
Key
,
value
=
g
.
Count
()
}).
ToList
();
var
groupList
=
ViewEquipmentList
.
GroupBy
(
c
=>
new
{
c
.
TypeOneId
,
c
.
ParentName
})
.
Select
(
g
=>
new
{
id
=
g
.
Key
.
TypeOneId
,
name
=
g
.
Key
.
ParentName
,
value
=
g
.
Count
()
})
.
ToList
()
.
OrderBy
(
x
=>
x
.
id
)
.
ToList
();
return
JsonManager
.
ReturnSuccessResponse
(
groupList
);
return
JsonManager
.
ReturnSuccessResponse
(
groupList
);
...
@@ -1147,7 +1152,7 @@ namespace JunmpPoliceStation.Controllers
...
@@ -1147,7 +1152,7 @@ namespace JunmpPoliceStation.Controllers
List
<
Object
>
tList
=
new
List
<
Object
>();
List
<
Object
>
tList
=
new
List
<
Object
>();
for
(
var
i
=
0
;
i
<
data
.
Count
;
i
++)
for
(
var
i
=
0
;
i
<
data
.
Count
;
i
++)
{
{
var
t
=
new
{
ParentName
=
data
[
i
].
ParentName
,
近三个月报废数
=
data
[
i
].
WeekP
,
近半年
使
报废数
=
data
[
i
].
MonthP
};
var
t
=
new
{
ParentName
=
data
[
i
].
ParentName
,
近三个月报废数
=
data
[
i
].
WeekP
,
近半年报废数
=
data
[
i
].
MonthP
};
tList
.
Add
(
t
);
tList
.
Add
(
t
);
}
}
return
JsonManager
.
ReturnSuccessResponse
(
tList
);
return
JsonManager
.
ReturnSuccessResponse
(
tList
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论