¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO |
| | | { |
| | | [ModelValidate] |
| | | public class MesResponseContent |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public bool bSucc { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string StrCode { get; set; } |
| | | /// <summary> |
| | | /// æ§è¡æå |
| | | /// </summary> |
| | | public string StrMsg { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime DataTime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public content Content { get; set; } |
| | | |
| | | public class content |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Name { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string ShortName { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Contacts { get; set; } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO |
| | | { |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä»æ¨¡å |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class TestToolOutModel |
| | | { |
| | | /// <summary> |
| | | /// æµæ¶ç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æµæ¶ç¼ç ", NotNullAndEmpty = true)] |
| | | public string ToolCode { get; set; } |
| | | /// <summary> |
| | | /// ç®æ å°åç |
| | | /// </summary> |
| | | [PropertyValidate("ç®æ å°åç ", NotNullAndEmpty = true)] |
| | | public string TargetAddressCode { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶æ¥åºæ¨¡å |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class TestToolScrapModel |
| | | { |
| | | /// <summary> |
| | | /// æµæ¶ç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æµæ¶ç¼ç ", NotNullAndEmpty = true)] |
| | | public string ToolCode { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶éåºæ¨¡å |
| | | /// </summary> |
| | | [ModelValidate] |
| | | public class TestToolBackModel |
| | | { |
| | | /// <summary> |
| | | /// æºä½ç½® |
| | | /// </summary> |
| | | [PropertyValidate("æºä½ç½®", NotNullAndEmpty = true)] |
| | | public string SourceAddressCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æµè¯æ¶ç¼ç |
| | | /// </summary> |
| | | [PropertyValidate("æµè¯æ¶ç¼ç ", NotNullAndEmpty = true)] |
| | | public string TestToolCode { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Stock |
| | | { |
| | | public class StockOutboundOrderDTO |
| | | { |
| | | /// <summary> |
| | | /// åæ®ç¼ç |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | /// <summary> |
| | | /// æçå· |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | public string MaterielCode { get; set; } |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | public string MaterielName { get; set; } |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | public string BatchNo { get; set; } |
| | | /// <summary> |
| | | /// åºåå· |
| | | /// </summary> |
| | | public string SerialNumber { get; set; } |
| | | /// <summary> |
| | | /// åºåæ°é |
| | | /// </summary> |
| | | public float StockQuantity { get; set; } |
| | | /// <summary> |
| | | /// åºåºæ°é |
| | | /// </summary> |
| | | public float OutboundQuantity { get; set; } |
| | | /// <summary> |
| | | /// å·¥åæ»æ° |
| | | /// </summary> |
| | | public float OrderQuantity { get; set; } |
| | | /// <summary> |
| | | /// å·²åºæ°é |
| | | /// </summary> |
| | | public float OverOutQuantity { get; set; } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockRepository; |
| | |
| | | List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, float needQuantity, out float residueQuantity); |
| | | |
| | | List<Dt_StockInfo> GetUseableStocks(string materielCode, string batchNo, int warehoseId); |
| | | StockOutboundOrderDTO GetStockOutboundOrder(SaveModel saveModel); |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_ITaskInfoRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | WebResponseContent RequestInboundTask(string palletCode, string stationCode); |
| | | |
| | | WebResponseContent InboundTaskCompleted(int taskNum); |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä» |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | MesResponseContent TestToolOut(TestToolOutModel model); |
| | | } |
| | | } |
| | |
| | | using AutoMapper; |
| | | using MailKit.Search; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using SqlSugar; |
| | | using System; |
| | |
| | | } |
| | | |
| | | } |
| | | public StockOutboundOrderDTO GetStockOutboundOrder(SaveModel saveModel) |
| | | { |
| | | try |
| | | { |
| | | var palletCode = saveModel.MainData["barcode"].ToString(); |
| | | Dt_StockInfo stockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(); |
| | | if (stockInfoDetail == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°åºå详æ
"); |
| | | } |
| | | BaseDal.QueryTabs<Dt_OutboundOrder, Dt_OutboundOrderDetail, StockOutboundOrderDTO>((a, b) => a.Id == b.OrderId, (a, b) => new StockOutboundOrderDTO |
| | | { |
| | | OrderNo = a.OrderNo, |
| | | MaterielCode = b.MaterielCode, |
| | | MaterielName = b.MaterielName, |
| | | PalletCode = stockInfo.PalletCode, |
| | | BatchNo = b.BatchNo, |
| | | OrderQuantity = b.OrderQuantity, |
| | | OverOutQuantity = b.OverOutQuantity, |
| | | OutboundQuantity = stockInfoDetail.OutboundQuantity, |
| | | SerialNumber = stockInfoDetail.SerialNumber, |
| | | StockQuantity = stockInfoDetail.StockQuantity, |
| | | |
| | | }, a => true, b => b.BatchNo == stockInfoDetail.BatchNo && b.MaterielCode == stockInfoDetail.MaterielCode, x => true).Select(x => new StockOutboundOrderDTO |
| | | { |
| | | OrderNo = x.OrderNo, |
| | | MaterielCode = x.MaterielCode, |
| | | MaterielName = x.MaterielName, |
| | | PalletCode = x.PalletCode, |
| | | BatchNo = x.BatchNo, |
| | | OrderQuantity = x.OrderQuantity, |
| | | OverOutQuantity = x.OverOutQuantity, |
| | | OutboundQuantity = x.OutboundQuantity, |
| | | SerialNumber = x.SerialNumber, |
| | | StockQuantity = x.StockQuantity, |
| | | }).ToList(); |
| | | return new StockOutboundOrderDTO(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return null; |
| | | } |
| | | } |
| | | public List<Dt_StockInfo> GetOutboundStocks(List<Dt_StockInfo> stockInfos, string materielCode, float needQuantity, out float residueQuantity) |
| | | { |
| | | List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_ITaskInfoRepository; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService : ServiceBase<Dt_Task, ITaskRepository>, ITaskService |
| | | { |
| | | /// <summary> |
| | | /// æµè¯æ¶åºä» |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public MesResponseContent TestToolOut(TestToolOutModel model) |
| | | { |
| | | return new MesResponseContent(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_TaskInfoService; |
| | | using WIDESEA_DTO.ERP; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.MES |
| | | { |
| | | [Route("api/Mes")] |
| | | [ApiController] |
| | | public class MesController : ControllerBase |
| | | { |
| | | private readonly IPurchaseOrderRepository _purchaseOrderRepository; |
| | | private readonly IPurchaseOrderService _purchaseOrderService; |
| | | private readonly ISupplierInfoService _supplierInfoService; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly ITaskService _taskService; |
| | | |
| | | public MesController(IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderService purchaseOrderService, ISupplierInfoService supplierInfoService, IMaterielInfoService materielInfoService, IOutboundOrderService outboundOrderService,ITaskService taskService) |
| | | { |
| | | _purchaseOrderRepository = purchaseOrderRepository; |
| | | _purchaseOrderService = purchaseOrderService; |
| | | _supplierInfoService = supplierInfoService; |
| | | _materielInfoService = materielInfoService; |
| | | _outboundOrderService = outboundOrderService; |
| | | _taskService = taskService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶MESæµè¯æ¶åºåº |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("TestToolOut"), AllowAnonymous, MethodParamsValidate] |
| | | public MesResponseContent TestToolOut([FromBody] Root<TestToolOutModel> model) |
| | | { |
| | | return _taskService.TestToolOut(model.Content); |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | |
| | | { |
| | | return Service.GetStockSelectViews(orderId, materielCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ£é |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetStockOutboundOrder")] |
| | | public StockOutboundOrderDTO GetStockOutboundOrder([FromBody] SaveModel saveModel) |
| | | { |
| | | return Service.GetStockOutboundOrder(saveModel); |
| | | } |
| | | } |
| | | } |