Commit b5febb2f by 赵剑炜

修复统计报表信息

parent f18553b0
......@@ -4,7 +4,6 @@ using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using JmpModel.Model;
using JmpModel.TempModel;
namespace JmpModel.Model.DataContext
{
......@@ -24,7 +23,6 @@ namespace JmpModel.Model.DataContext
public virtual DbSet<BaseCharge> BaseCharges { get; set; }
public virtual DbSet<BaseJpBag> BaseJpBags { get; set; }
public virtual DbSet<BaseJpBagMap> BaseJpBagMaps { get; set; }
public virtual DbSet<useCountResult> useCountResult { get; set; }
public virtual DbSet<BaseJpCabinet> BaseJpCabinets { get; set; }
public virtual DbSet<BaseJpCabinetInvErrorMsg> BaseJpCabinetInvErrorMsgs { get; set; }
public virtual DbSet<BaseJpCabinetOutinlog> BaseJpCabinetOutinlogs { get; set; }
......@@ -127,7 +125,7 @@ namespace JmpModel.Model.DataContext
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseSqlServer("Data Source=192.168.3.188;Initial Catalog=junmppolicesql1115_3;Persist Security Info=True;User ID=sa;Password=Junmp123");
optionsBuilder.UseSqlServer("Data Source=192.168.3.188;Initial Catalog=junmppolicesqldev;Persist Security Info=True;User ID=sa;Password=Junmp123");
}
}
......@@ -927,10 +925,7 @@ Smart:智能货架
entity.Property(e => e.ParentName).IsUnicode(false);
});
modelBuilder.Entity<useCountResult>(entity =>
{
entity.HasNoKey();
});
modelBuilder.Entity<ColumnConfig>(entity =>
{
entity.Property(e => e.ColumnName).IsUnicode(false);
......@@ -3265,6 +3260,8 @@ Warehouse:仓库");
entity.Property(e => e.Name).IsUnicode(false);
entity.Property(e => e.NameJc).IsUnicode(false);
entity.Property(e => e.OrgCode).IsUnicode(false);
entity.Property(e => e.OrgId).IsUnicode(false);
......@@ -3275,6 +3272,8 @@ Warehouse:仓库");
entity.Property(e => e.SizeName).IsUnicode(false);
entity.Property(e => e.SortCode).IsUnicode(false);
entity.Property(e => e.TypeName).IsUnicode(false);
entity.Property(e => e.TypeOneId).IsUnicode(false);
......
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated>
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace JmpModel.Model
{
[Table("useCount")]
public partial class useCountResult
{
[Column("result")]
public string result { get; set; }
}
}
......@@ -9,10 +9,16 @@ namespace JmpModel.Model
{
public partial class ViewEquipment
{
[Column("nameJc")]
[StringLength(64)]
public string NameJc { get; set; }
[Required]
[Column("org_id")]
[StringLength(36)]
public string OrgId { get; set; }
[Column("sortCode")]
[StringLength(36)]
public string SortCode { get; set; }
[Required]
[Column("org_name")]
[StringLength(255)]
......
......@@ -8,6 +8,7 @@
"ModelNamespace": null,
"OutputContextPath": "Model\/DataContext",
"OutputPath": "Model",
"PreserveCasingWithRegex": true,
"ProjectRootNamespace": "JmpModel",
"Schemas": null,
"SelectedHandlebarsLanguage": 0,
......@@ -418,7 +419,7 @@
"ObjectType": 3
}
],
"UiHint": "PC.junmppolicesql1115_3",
"UiHint": "PC.junmppolicesqldev",
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false,
"UseDbContextSplitting": false,
......@@ -435,5 +436,6 @@
"UseNodaTime": false,
"UseNullableReferences": false,
"UseSchemaFolders": false,
"UseSpatial": false
"UseSpatial": false,
"UseT4": false
}
\ No newline at end of file
......@@ -607,7 +607,7 @@ namespace JunmpPoliceStation.Controllers
dataList = GetClassID(orgizationCode);
dataList = dataList.ToList().Concat(ListEq.Where(c => c.Id.Equals(orgizationCode))).ToList();
Expression<Func<ViewEquipment, bool>> expressionPoliceman = null;
string typeId = entity.typeId;
......@@ -634,15 +634,17 @@ namespace JunmpPoliceStation.Controllers
}
List<ViewEquipment> equipmentList = _unitOfWork.ViewEquipmentRepository.GetList(expressionPoliceman).OrderBy(c => c.FindCode.Length).ToList();
if (findcode.Length == 6)
{
var data = equipmentList.GroupBy(t => t.OrgName).Select(c => new
var data = equipmentList.GroupBy(t => t.OrgCode).Select(c => new
{
c.FirstOrDefault().OrgName,
OrgName = c.OrderBy(f => f.OrgCode).FirstOrDefault().OrgName,
NameJc = c.OrderBy(f => f.OrgCode).FirstOrDefault().NameJc,
c.FirstOrDefault().FindCode,
c.FirstOrDefault().OrgCode,
zsCount = c.Count(f => f.CurrentState != null),
c.FirstOrDefault().SortCode,
zsCount = c.Count(f => f.CurrentState != null && f.InventoryState != "loss"),
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(),
......@@ -651,7 +653,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != null && f.InventoryState != "loss"),
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(),
......@@ -660,7 +662,7 @@ namespace JunmpPoliceStation.Controllers
}).ToList();
data = data.Where(c => c.zsCount != 0)
.OrderBy(c => c.FindCode.Length)
.OrderBy(c => c.SortCode.Length)
.ThenBy(c => c.FindCode)
.ThenBy(c => c.OrgCode)
.ToList();
......@@ -680,12 +682,15 @@ namespace JunmpPoliceStation.Controllers
else
{
var codeLen = findcode.Length + 2;
var data = equipmentList.GroupBy(t => t.FindCode.PadLeft(codeLen, '0').Substring(0, codeLen)).Select(c => new
//var data = equipmentList.GroupBy(t => t.FindCode.PadLeft(codeLen, '0').Substring(0, codeLen)).Select(c => new
var data = equipmentList.GroupBy(t => t.OrgCode).Select(c => new
{
OrgName = c.OrderBy(f => f.OrgCode).FirstOrDefault().AreaName,
OrgName = c.OrderBy(f => f.OrgCode).FirstOrDefault().OrgName,
NameJc = c.OrderBy(f => f.OrgCode).FirstOrDefault().NameJc,
c.OrderBy(f => f.OrgCode).FirstOrDefault().FindCode,
c.OrderBy(f => f.OrgCode).FirstOrDefault().OrgCode,
zsCount = c.Count(f => f.CurrentState != null),
c.FirstOrDefault().SortCode,
zsCount = c.Count(f => f.CurrentState != null && f.InventoryState != "loss"),
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(),
......@@ -694,7 +699,7 @@ namespace JunmpPoliceStation.Controllers
{
id = c.FirstOrDefault().EquipmentCode,
name = c.FirstOrDefault().EquipmentName,
zsCount = c.Count(f => f.CurrentState != null),
zsCount = c.Count(f => f.CurrentState != null && f.InventoryState != "loss"),
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(),
......@@ -703,7 +708,7 @@ namespace JunmpPoliceStation.Controllers
}).ToList();
data = data.Where(c => c.zsCount != 0)
.OrderBy(c => c.FindCode.Length)
.OrderBy(c => c.SortCode.Length)
.ThenBy(c => c.FindCode)
.ThenBy(c => c.OrgCode)
.ToList();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论