Commit 4c472374 by 赵剑炜

修正所有报表中错误的物资排序

parent 62993ca6
......@@ -9184,7 +9184,6 @@ namespace JunmpPoliceStation.Controllers
"EquipmentSizecodeNavigation.Detail" ,
"EquipmentCodeNavigation" ,
"WarehouseCodeNavigation" ,
"WarehouseCodeNavigation.Orgization",
"CommonJpEquipmentStates",
"SupplierCodeNavigation",
"Cabinet",
......@@ -9338,10 +9337,7 @@ namespace JunmpPoliceStation.Controllers
}
var EquipmentList = _unitOfWork.EquipmentInventoryRepository.GetList(expression, c => c.CreateTime, false, param)
.OrderBy(x => x.EquipmentCode)
.ThenBy(x => x.EquipmentSizecode)
.ThenBy(x => x.WarehouseCodeNavigation.Orgization.Code)
.ThenBy(x => x.WarehouseCode)
.OrderBy(x=>x.EquipmentCodeNavigation.Code)
.ToList();
var datas = EquipmentList.Select(equipment => new
......
......@@ -647,7 +647,7 @@ namespace JunmpPoliceStation.Controllers
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(),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price),
children = c.OrderBy(z => z.TypeOneId).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,
name = c.FirstOrDefault().EquipmentName,
......@@ -690,7 +690,7 @@ namespace JunmpPoliceStation.Controllers
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(),
priceCount = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null).Sum(k => k.Price),
children = c.OrderBy(z => z.TypeOneId).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,
name = c.FirstOrDefault().EquipmentName,
......@@ -784,12 +784,13 @@ namespace JunmpPoliceStation.Controllers
OrgId = entity.orgId;
}
var param = new string[] {
"EquipmentCodeNavigation" ,
"EquipmentCodeNavigation",
"Org" ,
"Org.BaseJpCabinetOutinlogs" ,
"CommonJpEquipmentStates"
};
"CommonJpEquipmentStates",
};
var Infoparam = new string[] { };
Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId == t.OrgId && (!t.InventoryState.Equals("loss"));
......@@ -799,17 +800,31 @@ namespace JunmpPoliceStation.Controllers
string equipmentCode = entity.equipmentCode;
expression = LambdaExtensions.AndAlso(expression, t => t.EquipmentCode.Equals(equipmentCode));
}
//var infoList=_unitOfWork.EquipmentInfoRepository.GetList(t=>t.Id!=null).ToList();
//var query = from t1 in infoList
// join t2 in infoList
// on t1.ParentId equals t2.Id
// join t3 in infoList
// on t2.ParentId equals t3.Id
// select new ViewEquipment
// {
// TypeOneId = t1.Id,
// TypeTwoId = t2.Id,
// TypeThreeId = t3.Id,
// };
var EquipmentList = _unitOfWork.EquipmentInventoryRepository.GetList(expression, null, false, param).ToList();
var datas = EquipmentList.GroupBy(p => p.EquipmentCode).Select(c => new
{
code = c.FirstOrDefault().EquipmentCodeNavigation?.Equipment?.Code,
equipmentCode = c.Key,
equipmentName = c.FirstOrDefault().EquipmentCodeNavigation.Name,
sumCount = c.Count(),
syCount = c.Sum(c => c.Org.BaseJpCabinetOutinlogs.Where(p => p.State == "out" && p.OperationTime >= Convert.ToDateTime(startTime) && p.OperationTime <= Convert.ToDateTime(endTime)).Count()) + c.Sum(c => c.CommonJpEquipmentStates.Where(f => (f.ActionState.Equals(2) || f.ActionState.Equals(3) || f.ActionState.Equals(5) || f.ActionState.Equals(14) || f.ActionState.Equals(15)) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count()),
wxCount = c.Sum(c => c.CommonJpEquipmentStates.Where(f => f.ActionState.Equals(6) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count())
}).OrderByDescending(f => f.syCount).ToList();
}).OrderBy(f => f.code).ToList();
//var content = new
//{
......@@ -1150,7 +1165,7 @@ namespace JunmpPoliceStation.Controllers
yearEndPrice = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null && f.CreateTime?.Year <= year).Sum(k => k.Price),
yearAddCount = c.Where(f => !f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
yearDelCount = c.Where(f => f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
children = c.OrderBy(z => z.TypeOneId).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,
name = c.FirstOrDefault().EquipmentName,
......@@ -1196,7 +1211,7 @@ namespace JunmpPoliceStation.Controllers
yearEndPrice = c.Where(f => !f.CurrentState.Equals(6) && f.Price != null && f.CreateTime?.Year <= year).Sum(k => k.Price),
yearAddCount = c.Where(f => !f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
yearDelCount = c.Where(f => f.CurrentState.Equals(6) && f.CreateTime?.Year == year).Count(),
children = c.OrderBy(z => z.TypeOneId).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,
name = c.FirstOrDefault().EquipmentName,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论