using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Repositories;
using Business.Models;
using Microsoft.AspNetCore.Authorization;
using Business.Permissions;
using XCZ;
using Business.ResourceExamineManagement.Dto;
using Bussiness.Model.MES.IC;
using AutoMapper.Internal.Mappers;
using Bussiness.Model.Tech;
using Bussiness.Model.Production;
using Business.Core.MongoDBHelper;
using Business.Core.Utilities;
using Hangfire.Storage.Monitoring;
using Business.BookManagement.Dto;
using Volo.Abp.ObjectMapping;
namespace Business.ResourceExamineManagement
{
///
/// 资源检查
///
[Authorize(BusinessPermissions.ResourceExamine.Default)]
public class ResourceExamineAppService : IResourceExamineAppService
{
#region 服务
//private IRepository _ic_item;
//private IRepository _ic_bom;
/////
///// 工艺路径
/////
//private IRepository _mes_technique;
/////
///// 工序
/////
//private IRepository _mes_process;
/////
///// 工艺关联工序
/////
//private IRepository _mes_tech_process;
/////
///// 排程占用记录
/////
//private IRepository _mes_schedule_occupy;
private readonly IMongoDB _mes_technique;
#endregion
///
/// 构造函数
///
///
///
public ResourceExamineAppService(
IMongoDB mes_technique
)
{
_mes_technique = mes_technique;
}
///
/// 资源检查
///
///
///
///
public async Task ReceiveResult(SeorderentryDto input)
{
mes_technique info = new mes_technique();
SnowFlake snow = new SnowFlake(1,1);
info.tech_id = snow.NextId();
info.tech_name = "ceshi";
info.level = 1;
await _mes_technique.InsertOne(info);
throw new NotImplementedException();
}
///
/// BOM预处理
///
/// 订单行id
/// Bom主键
/// 需要数量
public async Task BomPretreatmentAsync(long? orderid,long? BomId, int Quantity)
{
//if (BomId == null)
//{
// //throw new bu
//}
//var query = (await _ic_bom.GetQueryableAsync()).WhereIf(true, a => a.bom_id == BomId).ToList();
}
///
/// 产能计算
///
/// Bom主键
/// 需要数量
public async Task ProductiveExamine(long? BomId, int Quantity)
{
}
}
}