Commit 7b1ffc81 by zxw

0506

parent 96a67afe
......@@ -1706,6 +1706,7 @@ Smart:智能货架
entity.HasOne(d => d.TrueWarehouse)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStateTrueWarehouses)
.HasForeignKey(d => d.TrueWarehouseId)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("FK__common_jp__trueW__438BFA74");
});
......@@ -2564,7 +2565,6 @@ Warehouse:仓库");
entity.HasOne(d => d.Warehouse)
.WithMany(p => p.CommonJpInventoryTables)
.HasForeignKey(d => d.WarehouseId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK_common_jp_inventory_table_base_jp_warehouse");
});
......@@ -2768,7 +2768,6 @@ Warehouse:仓库");
entity.HasOne(d => d.ApplyPolice)
.WithMany(p => p.CommonJpPoliceShiftJobsApplies)
.HasForeignKey(d => d.ApplyPoliceId)
.OnDelete(DeleteBehavior.SetNull)
.HasConstraintName("FK__common_jp__apply__569ECEE8");
entity.HasOne(d => d.ProcessCurrent)
......@@ -3712,6 +3711,8 @@ Warehouse:仓库");
entity.ToView("view_equipment_type");
entity.Property(e => e.EquCode).IsUnicode(false);
entity.Property(e => e.EquipmentCode).IsUnicode(false);
entity.Property(e => e.EquipmentName).IsUnicode(false);
......
......@@ -17,6 +17,9 @@ namespace JmpModel.Model
[Column("equipment_code")]
[StringLength(36)]
public string EquipmentCode { get; set; }
[Column("equ_code")]
[StringLength(36)]
public string EquCode { get; set; }
[Column("equipment_name")]
[StringLength(64)]
public string EquipmentName { get; set; }
......
......@@ -74,7 +74,7 @@ namespace JunmpPoliceStation.Controllers
List<BaseJpEquipmentSize> dataList = _unitOfWork.EquipmentSizeRepository.GetList(expression, t => t.UpdateTime, false, param).ToList();
var i = 0;
var data = dataList.Select(c => new
var data = dataList.OrderBy(c => c.SizeName).Select(c => new
{
c.Id,
c.SizeName,
......
......@@ -662,6 +662,7 @@ namespace JunmpPoliceStation.Controllers
OrgName = string.IsNullOrEmpty(c.FirstOrDefault().DName) ? c.FirstOrDefault().OrgName : c.FirstOrDefault().DName,
c.FirstOrDefault().FindCode,
c.FirstOrDefault().OrgCode,
c.FirstOrDefault().OrgId,
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
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(),
......@@ -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
{
id = c.FirstOrDefault().EquipmentCode,
code = c.FirstOrDefault().EquipmentCode1,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
zkCount = c.Where(f => f.CurrentState.Equals(0)).Count(),
......@@ -684,7 +686,7 @@ namespace JunmpPoliceStation.Controllers
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 || f.bfCount != 0)).ToList()
}).Where(f => f.id != null && (f.zsCount != 0 || f.bfCount != 0)).OrderBy(f => f.code).ToList()
}).ToList();
data = data.Where(c => c.zsCount != 0 || c.bfCount != 0)
......@@ -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,
c.OrderBy(f => f.OrgCode).FirstOrDefault().FindCode,
c.OrderBy(f => f.OrgCode).FirstOrDefault().OrgCode,
c.OrderBy(f => f.OrgCode).FirstOrDefault().OrgId,
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
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(),
......@@ -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
{
id = c.FirstOrDefault().EquipmentCode,
code = c.FirstOrDefault().EquipmentCode1,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != 6 && f.CurrentState != null),
zkCount = c.Where(f => f.CurrentState.Equals(0)).Count(),
......@@ -747,7 +751,7 @@ namespace JunmpPoliceStation.Controllers
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 || f.bfCount != 0)).ToList()
}).Where(f => f.id != null && (f.zsCount != 0 || f.bfCount != 0)).OrderBy(f => f.code).ToList()
}).ToList();
data = data.Where(c => c.zsCount != 0 || c.bfCount != 0)
......@@ -870,7 +874,7 @@ namespace JunmpPoliceStation.Controllers
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,
code = c.FirstOrDefault().EquipmentCodeNavigation?.Code,
equipmentCode = c.Key,
equipmentName = c.FirstOrDefault().EquipmentCodeNavigation.Name,
sumCount = c.Where(p => p.CurrentState != 6).Count(),
......@@ -1659,6 +1663,8 @@ namespace JunmpPoliceStation.Controllers
TypeTwoId = c.FirstOrDefault().TypeTwoId,
TypeThreeId = c.FirstOrDefault().TypeThreeId,
EquipmentCode = c.FirstOrDefault().EquipmentCode,
EquCode = c.FirstOrDefault().EquCode,
EquipmentSizecode = c.FirstOrDefault().EquipmentSizecode,
ParentName = c.FirstOrDefault().Name,
EquipmentName = c.FirstOrDefault().EquipmentName,
......@@ -1670,8 +1676,8 @@ namespace JunmpPoliceStation.Controllers
).OrderBy(x => x.id)
.ThenBy(x => x.TypeTwoId)
.ThenBy(x => x.TypeThreeId)
.ThenBy(x => x.EquipmentCode)
.ThenBy(x => x.EquipmentSizecode)
.ThenBy(x => x.EquCode)
.ThenBy(x => x.SizeName)
.ToList();
return JsonManager.ReturnSuccessResponse(new
......
......@@ -482,7 +482,12 @@ namespace JunmpPoliceStation.Controllers
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);
......@@ -1147,7 +1152,7 @@ namespace JunmpPoliceStation.Controllers
List<Object> tList = new List<Object>();
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);
}
return JsonManager.ReturnSuccessResponse(tList);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论