93 lines
3.0 KiB
C#
93 lines
3.0 KiB
C#
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;
|
|
using ZR.Service.mes.qu.IService;
|
|
|
|
namespace ZR.Service.mes.qc
|
|
{
|
|
|
|
[AppService(ServiceType = typeof(IFirstFQCService), ServiceLifetime = LifeTime.Transient)]
|
|
public class FirstFQCService : BaseService<QcInspectionitem>, IFirstFQCService
|
|
{
|
|
public CheckItemTableDTO GetCheckItemTable()
|
|
{
|
|
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();
|
|
checkItem.Team = Queryable().Where(it => it.InspectionModule == "班组操作").OrderBy(it => it.Id).ToList();
|
|
|
|
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)
|
|
//{
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|