质量统计
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.op.DTO;
|
||||
using ZR.Model.MES.op.ZR.Model.mes.md;
|
||||
using ZR.Model.MES.qc;
|
||||
|
||||
namespace ZR.Service.MES.op.IService
|
||||
{
|
||||
@@ -12,5 +13,7 @@ namespace ZR.Service.MES.op.IService
|
||||
{
|
||||
|
||||
public List<OpStatisticsDTO> GetAllData(string workshopID);
|
||||
|
||||
public (List<QcFqcDTO>,int) GueryQualityStatistics(string workorderid, int pageNum, int pageSize, int year = -1, int week = -1, int date = -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,12 @@ using ZR.Service.MES.op.IService;
|
||||
using ZR.Model.MES.op.DTO;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Org.BouncyCastle.Asn1.Esf;
|
||||
using ZR.Model.MES.qc;
|
||||
using SqlSugar;
|
||||
using ZR.Model.mes.pro;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using System.Drawing;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ZR.Service.MES.op
|
||||
{
|
||||
@@ -65,6 +71,50 @@ namespace ZR.Service.MES.op
|
||||
|
||||
return OpStatisticsDTOList;
|
||||
}
|
||||
|
||||
public (List<QcFqcDTO>,int) GueryQualityStatistics(string workorderid ,int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
|
||||
{
|
||||
var predicate = Expressionable.Create<QcFqcDTO>()
|
||||
.AndIF(year > 0, p => p.Year == year)
|
||||
.AndIF(week > 0, p => p.Week == week)
|
||||
.AndIF(date > 0, p => p.Date == date)
|
||||
.ToExpression();
|
||||
var predicate2 = Expressionable.Create<QcFqc>()
|
||||
.AndIF(!string.IsNullOrEmpty(workorderid),q=>q.FkWorkorderId== workorderid)
|
||||
.ToExpression();
|
||||
|
||||
int totalCount = 0;
|
||||
|
||||
var query5 = Context.Queryable<QcFqc>()
|
||||
.LeftJoin<ProWorkorder>((q, p) => q.FkWorkorderId == p.Id)
|
||||
.Where(predicate2)
|
||||
.Select((q, p) => new QcFqcDTO {
|
||||
Year = p.Year,
|
||||
Week = p.Week,
|
||||
Date = p.Date,
|
||||
Id = q.Id,
|
||||
FkWorkorderId = q.FkWorkorderId,
|
||||
ProductName = q.ProductName,
|
||||
Color = q.Color,
|
||||
Require = q.Require,
|
||||
LeftRight = q.LeftRight,
|
||||
Team = q.Team,
|
||||
QualifiedNum01 = q.QualifiedNum01,
|
||||
DefectNum01 = q.DefectNum01,
|
||||
PolishNum01 = q.PolishNum01,
|
||||
ScrapNum01 = q.ScrapNum01,
|
||||
QualifiedNum02 = q.QualifiedNum02,
|
||||
PolishNum02 = q.PolishNum02,
|
||||
ScrapNum02 = q.ScrapNum02,
|
||||
QualifiedNum03 = q.QualifiedNum03,
|
||||
PolishNum03 = q.PolishNum03,
|
||||
ScrapNum03 = q.ScrapNum03,
|
||||
}).MergeTable();
|
||||
|
||||
List<QcFqcDTO> QcFqcDTOList = query5.Where(predicate).ToPageList(pageNum, pageSize,ref totalCount);
|
||||
return (QcFqcDTOList, totalCount);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ZR.Model.MES.qc;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
@@ -19,8 +21,11 @@ namespace ZR.Service.mes.qc
|
||||
{
|
||||
public CheckItemTableDTO GetCheckItemTable()
|
||||
{
|
||||
CheckItemTableDTO checkItem=new CheckItemTableDTO();
|
||||
checkItem.Paint = Queryable().Where(it => it.InspectionModule == "油漆").OrderBy(it=>it.Id).ToList();
|
||||
CheckItemTableDTO checkItem = new CheckItemTableDTO();
|
||||
|
||||
|
||||
checkItem.Paint = Queryable().Where(it => it.InspectionModule == "油漆").OrderBy(it => it.Id).ToList();
|
||||
|
||||
checkItem.device = Queryable().Where(it => it.InspectionModule == "设备").OrderBy(it => it.Id).ToList();
|
||||
checkItem.Blank = Queryable().Where(it => it.InspectionModule == "毛坯").OrderBy(it => it.Id).ToList();
|
||||
checkItem.program = Queryable().Where(it => it.InspectionModule == "程序").OrderBy(it => it.Id).ToList();
|
||||
@@ -29,5 +34,59 @@ namespace ZR.Service.mes.qc
|
||||
return checkItem;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存检测结果
|
||||
/// </summary>
|
||||
/// <param name="workorder_id"></param>
|
||||
/// <param name="InspectionModule"></param>
|
||||
/// <param name="inspectItem"></param>
|
||||
/// <param name="counter"></param>
|
||||
/// <returns></returns>
|
||||
public async Task SaveinspectItem(string workorder_id, string InspectionModule, string checkid, int counter)
|
||||
{
|
||||
//更新实时记录表
|
||||
QcFirstinspectionRecord record = new QcFirstinspectionRecord();
|
||||
record.Id = DateTime.Now.ToString("MMddHHmmss");
|
||||
record.InspectionModule = InspectionModule;
|
||||
record.FKWorkorderId = workorder_id;
|
||||
record.FKInpectionId = checkid;
|
||||
record.Counter = counter;
|
||||
var x = Context.Storageable(record)
|
||||
.WhereColumns(it => new {it.FKInpectionId,it.FKWorkorderId,it.InspectionModule })
|
||||
.ToStorage();
|
||||
|
||||
x.AsInsertable.ExecuteCommandAsync(); //执行插入
|
||||
x.AsUpdateable.ExecuteCommandAsync(); //执行更新
|
||||
|
||||
////更新初检报废表
|
||||
//if (Convert.ToInt32(checkid) / 10 % 10==3)
|
||||
//{
|
||||
// QcAgaininspectionUselessnum scrap =new QcAgaininspectionUselessnum();
|
||||
// scrap.Id = "scrap" + DateTime.Now.ToString("MMddHHmmss");
|
||||
// scrap.FkInspectionitemId = checkid;
|
||||
// scrap.FkFqcId = "";
|
||||
// scrap.ProductName = "";
|
||||
// scrap.Number= 1;
|
||||
|
||||
|
||||
|
||||
//}
|
||||
|
||||
////更新初检xiazi表
|
||||
//if (Convert.ToInt32(checkid) / 10 % 10 == 1)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,6 @@ namespace ZR.Service.mes.qc.IService
|
||||
public interface IFirstFQCService
|
||||
{
|
||||
public CheckItemTableDTO GetCheckItemTable();
|
||||
public Task SaveinspectItem(string workorder_id, string InspectionModule, string checkid, int counter);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user