Commit 55f78cab by zxw

统计报表新增单警柜信息统计

parent e07e7f17
...@@ -8394,8 +8394,8 @@ namespace JunmpPoliceStation.Controllers ...@@ -8394,8 +8394,8 @@ namespace JunmpPoliceStation.Controllers
var data = equipmentList.GroupBy(t => new { t.OrgId, t.WarehouseCode, t.EquipmentSizecode }).Select(c => new var data = equipmentList.GroupBy(t => new { t.OrgId, t.WarehouseCode, t.EquipmentSizecode }).Select(c => new
{ {
c.FirstOrDefault().OrgId, c.FirstOrDefault().OrgId,
WarehouseCode=c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseCode ?? "00000000-0000-0000-0000-000000000000", WarehouseCode = c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseCode ?? "00000000-0000-0000-0000-000000000000",
WarehouseName=c.FirstOrDefault(x => x.WarehouseCode != null)?.WarehouseName ?? "", 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,
...@@ -8484,7 +8484,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -8484,7 +8484,7 @@ namespace JunmpPoliceStation.Controllers
"WarehouseCodeNavigation.Orgization" "WarehouseCodeNavigation.Orgization"
}; };
Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId.Equals(t.WarehouseCodeNavigation.OrgizationId); Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId.Equals(t.OrgId);
expression = LambdaExtensions.AndAlso(expression, t => t.InventoryState != "loss"); expression = LambdaExtensions.AndAlso(expression, t => t.InventoryState != "loss");
//orgList.Add(orgInfo.Id);//查询所有组织机构仓库库存信息 //orgList.Add(orgInfo.Id);//查询所有组织机构仓库库存信息
...@@ -8536,7 +8536,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -8536,7 +8536,7 @@ namespace JunmpPoliceStation.Controllers
id = x.Key.WarehouseCode + x.Key.EquipmentSizecode, id = x.Key.WarehouseCode + x.Key.EquipmentSizecode,
warehouseName = x.FirstOrDefault().WarehouseCodeNavigation?.Name, warehouseName = x.FirstOrDefault().WarehouseCodeNavigation?.Name,
equipmentName = x.FirstOrDefault().EquipmentCodeNavigation?.Name, equipmentName = x.FirstOrDefault().EquipmentCodeNavigation?.Name,
warehouseId = x.FirstOrDefault().WarehouseCodeNavigation?.Id, warehouseId = x.FirstOrDefault().WarehouseCodeNavigation?.Id ?? "00000000-0000-0000-0000-000000000000",
equipmentSizeName = x.FirstOrDefault().EquipmentSizecodeNavigation?.SizeName, equipmentSizeName = x.FirstOrDefault().EquipmentSizecodeNavigation?.SizeName,
equipmentSizeId = x.FirstOrDefault().EquipmentSizecodeNavigation?.Id, equipmentSizeId = x.FirstOrDefault().EquipmentSizecodeNavigation?.Id,
sumCount = x.Count(), sumCount = x.Count(),
......
...@@ -633,8 +633,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -633,8 +633,7 @@ namespace JunmpPoliceStation.Controllers
string equipmentSizecode = entity.equipmentSizecode; string equipmentSizecode = entity.equipmentSizecode;
var idList = OrgTreeModel.GetOrgIdList(orgModelList, org.Id); var idList = OrgTreeModel.GetOrgIdList(orgModelList, org.Id);
//expressionPoliceman = t => idList.Contains(t.OrgId); expressionPoliceman = t => idList.Contains(t.OrgId);
expressionPoliceman = t => t.OrgId== org.Id;
if (!String.IsNullOrEmpty(typeId)) if (!String.IsNullOrEmpty(typeId))
{ {
...@@ -664,6 +663,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -664,6 +663,10 @@ 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(),
djgCount = c.Count(x => x.CurrentState == 3),
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),
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
{ {
...@@ -673,11 +676,15 @@ namespace JunmpPoliceStation.Controllers ...@@ -673,11 +676,15 @@ 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(),
djgCount = c.Count(x => x.CurrentState == 3),
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).ToList() }).Where(f => f.id != null && (f.zsCount != 0 || f.bfCount != 0)).ToList()
}).ToList(); }).ToList();
data = data.Where(c => c.zsCount != 0) data = data.Where(c => c.zsCount != 0 || c.bfCount != 0)
.OrderBy(c => c.FindCode.Length) .OrderBy(c => c.FindCode.Length)
.ThenBy(c => c.FindCode) .ThenBy(c => c.FindCode)
.ThenBy(c => c.OrgCode) .ThenBy(c => c.OrgCode)
...@@ -690,6 +697,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -690,6 +697,10 @@ namespace JunmpPoliceStation.Controllers
zkCount = data.Sum(c => c.zkCount), zkCount = data.Sum(c => c.zkCount),
ckCount = data.Sum(c => c.ckCount), ckCount = data.Sum(c => c.ckCount),
bfCount = data.Sum(c => c.bfCount), bfCount = data.Sum(c => c.bfCount),
djgCount = data.Sum(c => c.djgCount),
djgckCount = data.Sum(c => c.djgckCount),
priceCount = data.Sum(c => c.priceCount), priceCount = data.Sum(c => c.priceCount),
content = data.Skip(page * size).Take(size) content = data.Skip(page * size).Take(size)
}; };
...@@ -707,6 +718,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -707,6 +718,10 @@ 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(),
djgCount = c.Count(x => x.CurrentState == 3),
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),
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
{ {
...@@ -716,11 +731,15 @@ namespace JunmpPoliceStation.Controllers ...@@ -716,11 +731,15 @@ 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(),
djgCount = c.Count(x => x.CurrentState == 3),
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).ToList() }).Where(f => f.id != null && (f.zsCount != 0 || f.bfCount != 0)).ToList()
}).ToList(); }).ToList();
data = data.Where(c => c.zsCount != 0) data = data.Where(c => c.zsCount != 0 || c.bfCount != 0)
.OrderBy(c => c.FindCode.Length) .OrderBy(c => c.FindCode.Length)
.ThenBy(c => c.FindCode) .ThenBy(c => c.FindCode)
.ThenBy(c => c.OrgCode) .ThenBy(c => c.OrgCode)
...@@ -733,6 +752,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -733,6 +752,10 @@ namespace JunmpPoliceStation.Controllers
zkCount = data.Sum(c => c.zkCount), zkCount = data.Sum(c => c.zkCount),
ckCount = data.Sum(c => c.ckCount), ckCount = data.Sum(c => c.ckCount),
bfCount = data.Sum(c => c.bfCount), bfCount = data.Sum(c => c.bfCount),
djgCount = data.Sum(c => c.djgCount),
djgckCount = data.Sum(c => c.djgckCount),
priceCount = data.Sum(c => c.priceCount), priceCount = data.Sum(c => c.priceCount),
content = data.Skip(page * size).Take(size) content = data.Skip(page * size).Take(size)
}; };
...@@ -1526,7 +1549,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -1526,7 +1549,7 @@ namespace JunmpPoliceStation.Controllers
MemoryCacheHelper.AddMemoryCache("orgModelList", orgModelList, 1440); MemoryCacheHelper.AddMemoryCache("orgModelList", orgModelList, 1440);
} }
var idList = OrgTreeModel.GetOrgIdList(orgModelList, orgizationCode); var idList = OrgTreeModel.GetOrgIdList(orgModelList, orgizationCode);
expressionPoliceman = t => idList.Contains(t.OrgId) && t.CurrentState != 5 && t.CurrentState != 6; expressionPoliceman = t => idList.Contains(t.OrgId) && t.CurrentState != 5 && t.CurrentState != 6;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论