| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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;
- namespace Business.ResourceExamineManagement
- {
- public class ResourceExamineAppService : IResourceExamineAppService
- {
- private IRepository<ic_item, long> _ic_item;
- private IRepository<ic_bom, long> _ic_bom;
- public ResourceExamineAppService(
- IRepository<ic_item, long> icitem,
- IRepository<ic_bom, long> icbom
- )
- {
- _ic_item = icitem;
- _ic_bom = icbom;
- }
- /// <summary>
- /// 资源检查
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- /// <exception cref="NotImplementedException"></exception>
- public Task<PschedDto> ReceiveResult(SeorderentryDto input)
- {
- throw new NotImplementedException();
- }
- /// <summary>
- /// BOM预处理
- /// </summary>
- /// <param name="BomId">Bom主键</param>
- /// <param name="Quantity">需要数量</param>
- public async Task BomPretreatmentAsync(long? BomId, int Quantity)
- {
- if (BomId == null)
- {
- //throw new bu
- }
- var query = (await _ic_bom.GetQueryableAsync()).WhereIf(true, a => a.bom_id == BomId).ToList();
- }
- /// <summary>
- /// 检查在制工单
- /// </summary>
- /// <param name="bomNumber">Bom编码</param>
- /// <param name="Quantity">需要数量</param>
- /// <returns></returns>
- //public async Task CheckMorder(string bomNumber, int Quantity)
- public void CheckMorder(string bomNumber, int Quantity)
- {
- if (string.IsNullOrEmpty(bomNumber) || Quantity < 0)
- {
- //TODO:入参异常;
- //throw new NotImplementedException();
- }
- //查询生产工单类型为计划工单并且工单类型为备库工单 并且BOM编码一致数据
- // 订单状态为 初始或下达工单
- // List =>数量满足Quantity && 生成工单结束日期最早
- }
- }
- }
|