98 lines
3.4 KiB
C#
Executable File
98 lines
3.4 KiB
C#
Executable File
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using Opsoft.NetCore.O3App.Domain;
|
|
using Opsoft.NetCore.O3App.Domain.Interface;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.MES.IRepositories;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.MES.IServices;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.MES.Model;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
|
using Opsoft.NetCore.O3App.Services.CommonFunction;
|
|
using Opsoft.NetCore.O3App.Shared;
|
|
|
|
namespace Opsoft.NetCore.O3App.Services.MES
|
|
{
|
|
[MapTo(typeof(IQualityCheckService), ServiceLifetime.Transient)]
|
|
public class QualityCheckService : ServiceBase<BaseEntity, IQualityCheckRepository>, IQualityCheckService
|
|
{
|
|
public QualityCheckService(IQualityCheckRepository repository) : base(repository)
|
|
{
|
|
Init(repository);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询质检单
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
public async Task<object> SearchQualityBill(JObject request)
|
|
{
|
|
if (request == null)
|
|
{
|
|
throw new O3AppException("查询质检单参数不可为空", 400);
|
|
}
|
|
return await (repository as IQualityCheckRepository).SearchQualityBill(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得质检单据
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
public async Task<object> GetQualityBill(JObject request)
|
|
{
|
|
if (request == null)
|
|
{
|
|
throw new O3AppException("获取质检单参数不可为空", 400);
|
|
}
|
|
return await (repository as IQualityCheckRepository).GetQualityBill(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存质检单据
|
|
/// </summary>
|
|
/// <param name="bill"></param>
|
|
/// <returns></returns>
|
|
public async Task<object> SaveQualityBill(T_SFC_QUALITY bill)
|
|
{
|
|
if (bill == null)
|
|
{
|
|
throw new O3AppException("保存质检单参数不可为空", 400);
|
|
}
|
|
return await(repository as IQualityCheckRepository).SaveQualityBill(bill);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 检验完成
|
|
/// </summary>
|
|
/// <param name="bill"></param>
|
|
/// <returns></returns>
|
|
public async Task<object> QualityBillInspectionCompleted(T_SFC_QUALITY bill)
|
|
{
|
|
if (bill == null)
|
|
{
|
|
throw new O3AppException("保存质检单参数不可为空", 400);
|
|
}
|
|
return await(repository as IQualityCheckRepository).QualityBillInspectionCompleted(bill);
|
|
}
|
|
|
|
public Task<object> OpenWin(JObject request)
|
|
{
|
|
if (request == null)
|
|
{
|
|
throw new O3AppException("保存质检单参数不可为空", 400);
|
|
}
|
|
return (repository as IQualityCheckRepository).OpenWin(request);
|
|
}
|
|
}
|
|
}
|