Commit 55f78cab by zxw

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

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