ResourceExamineAppService.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Microsoft.EntityFrameworkCore;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Linq.Dynamic.Core;
  6. using System.Threading.Tasks;
  7. using Volo.Abp.Application.Dtos;
  8. using Volo.Abp.Domain.Repositories;
  9. using Business.Models;
  10. using Microsoft.AspNetCore.Authorization;
  11. using Business.Permissions;
  12. using XCZ;
  13. using Business.ResourceExamineManagement.Dto;
  14. using Bussiness.Model.MES.IC;
  15. using AutoMapper.Internal.Mappers;
  16. namespace Business.ResourceExamineManagement
  17. {
  18. public class ResourceExamineAppService : IResourceExamineAppService
  19. {
  20. private IRepository<ic_item, long> _ic_item;
  21. private IRepository<ic_bom, long> _ic_bom;
  22. public ResourceExamineAppService(
  23. IRepository<ic_item, long> icitem,
  24. IRepository<ic_bom, long> icbom
  25. )
  26. {
  27. _ic_item = icitem;
  28. _ic_bom = icbom;
  29. }
  30. /// <summary>
  31. /// 资源检查
  32. /// </summary>
  33. /// <param name="input"></param>
  34. /// <returns></returns>
  35. /// <exception cref="NotImplementedException"></exception>
  36. public Task<PschedDto> ReceiveResult(SeorderentryDto input)
  37. {
  38. throw new NotImplementedException();
  39. }
  40. /// <summary>
  41. /// BOM预处理
  42. /// </summary>
  43. /// <param name="BomId">Bom主键</param>
  44. /// <param name="Quantity">需要数量</param>
  45. public async Task BomPretreatmentAsync(long? BomId, int Quantity)
  46. {
  47. if (BomId == null)
  48. {
  49. //throw new bu
  50. }
  51. var query = (await _ic_bom.GetQueryableAsync()).WhereIf(true, a => a.bom_id == BomId).ToList();
  52. }
  53. /// <summary>
  54. /// 检查在制工单
  55. /// </summary>
  56. /// <param name="bomNumber">Bom编码</param>
  57. /// <param name="Quantity">需要数量</param>
  58. /// <returns></returns>
  59. //public async Task CheckMorder(string bomNumber, int Quantity)
  60. public void CheckMorder(string bomNumber, int Quantity)
  61. {
  62. if (string.IsNullOrEmpty(bomNumber) || Quantity < 0)
  63. {
  64. //TODO:入参异常;
  65. //throw new NotImplementedException();
  66. }
  67. //查询生产工单类型为计划工单并且工单类型为备库工单 并且BOM编码一致数据
  68. // 订单状态为 初始或下达工单
  69. // List =>数量满足Quantity && 生成工单结束日期最早
  70. }
  71. }
  72. }