| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.SquareCabin; |
| | |
| | | public interface IInventoryInfoService : IService<Dt_InventoryInfo> |
| | | { |
| | | IRepository<Dt_InventoryInfo> Repository { get; } |
| | | |
| | | /// <summary> |
| | | /// è·ååºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent GetInventory(); |
| | | } |
| | | } |
| | |
| | | /// <param name="messageRemark"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AddMessageInfo(MessageGroupByEnum groupByEnum, string messageName, string messageInfo, MessageStatusEnum statusEnum = MessageStatusEnum.Undisposed, string messageRemark = ""); |
| | | WebResponseContent DeleteAndIntoHty(int[] keys); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | public interface ISupplyTaskHtyService : IService<Dt_SupplyTask_Hty> |
| | | { |
| | | |
| | | /// <summary> |
| | | /// æ°ååªçè·ååºå
¥åºä»»å¡åå² |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent GetInOutTasks(); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | |
| | | { |
| | | } |
| | | public IRepository<Dt_InventoryInfo> Repository => BaseDal; |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·ååºå |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetInventory() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<object> lists = new List<object>(); |
| | | #region å·å»åº |
| | | string WareCodeLD = WarehouseEnum.å·å»åº.ObjToInt().ToString("000"); |
| | | List<Dt_InventoryInfo> inventoryInfosLD = BaseDal.QueryData(x => x.WarehouseCode == WareCodeLD); |
| | | object LDQty = new |
| | | { |
| | | name = WarehouseEnum.å·å»åº.ObjToString(), |
| | | count = inventoryInfosLD.Sum(x => x.StockQuantity).ObjToInt() |
| | | }; |
| | | lists.Add(LDQty); |
| | | #endregion |
| | | #region éº»ç²¾åº |
| | | string WareCodeMJ = WarehouseEnum.麻精åº.ObjToInt().ToString("000"); |
| | | List<Dt_InventoryInfo> inventoryInfosMJ = BaseDal.QueryData(x => x.WarehouseCode == WareCodeMJ); |
| | | object MJQty = new |
| | | { |
| | | name = WarehouseEnum.麻精åº.ObjToString(), |
| | | count = inventoryInfosMJ.Sum(x => x.StockQuantity).ObjToInt() |
| | | }; |
| | | lists.Add(MJQty); |
| | | #endregion |
| | | #region å¤§ä»¶åº |
| | | string WareCodeDJ = WarehouseEnum.大件åº.ObjToInt().ToString("000"); |
| | | List<Dt_InventoryInfo> inventoryInfosDJ = BaseDal.QueryData(x => x.WarehouseCode == WareCodeDJ); |
| | | object DJQty = new |
| | | { |
| | | name = WarehouseEnum.大件åº.ObjToString(), |
| | | count = inventoryInfosDJ.Sum(x => x.StockQuantity).ObjToInt() |
| | | }; |
| | | lists.Add(DJQty); |
| | | #endregion |
| | | content.OK(data: lists); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_IWMsInfoServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | } |
| | | return content; |
| | | } |
| | | public WebResponseContent DeleteAndIntoHty(int[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_MessageInfo> messageInfos = BaseDal.QueryData(x => keys.Contains(x.Id)); |
| | | foreach (var item in messageInfos) |
| | | { |
| | | item.MessageStatus = MessageStatusEnum.Processed.ObjToInt(); |
| | | item.Modifier = App.User.UserName; |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(messageInfos, OperateTypeEnum.äººå·¥å®æ); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IWMsInfoServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | public SupplyTaskHtyService(IRepository<Dt_SupplyTask_Hty> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | public WebResponseContent GetInOutTasks() |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<object> list = new List<object>(); |
| | | DateTime dateTime = DateTime.Now.AddDays(-6).Date; |
| | | List<Dt_SupplyTask_Hty> supplyTask_Hties = BaseDal.QueryData(x => x.InsertTime >= dateTime); |
| | | for (int i = 6; i >= 0; i--) |
| | | { |
| | | DateTime dateTime1 = DateTime.Now.AddDays(-i).Date; |
| | | DateTime dateTime2 = DateTime.Now.AddDays(-i + 1).Date; |
| | | var supplyTasks = supplyTask_Hties.Where(x => x.InsertTime >= dateTime1 && x.InsertTime < dateTime2).ToList(); |
| | | var inQty = Convert.ToInt32(supplyTasks.Where(x => x.TaskType == TaskTypeEnum.In.ObjToInt() || x.TaskType == TaskTypeEnum.OutReturn.ObjToInt()).Sum(x => x.StockQuantity)); |
| | | var outQty = Convert.ToInt32(supplyTasks.Where(x => x.TaskType == TaskTypeEnum.Out.ObjToInt() || x.TaskType == TaskTypeEnum.InReturn.ObjToInt()).Sum(x => x.StockQuantity)); |
| | | list.Add(new |
| | | { |
| | | date = dateTime1.ToString("yyyy-MM-dd"), |
| | | @in = inQty, |
| | | @out = outQty, |
| | | }); |
| | | } |
| | | content.OK(data: new |
| | | { |
| | | daily = list |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IWMsInfoServices; |
| | |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [ImporterHeader(Name = "主é®")] |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | [ExporterHeader(DisplayName = "主é®", IsIgnore = true)] |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int TaskId { get; set; } |
| | | |
| | |
| | | /// ä»»å¡å·ï¼è®¢å详æ
主é®ï¼ID |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡å·")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡å·")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡å·", IsIgnore = true)] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡å·"), Sequence(nameof(SequenceEnum.SeqTaskNum), 100000000)] |
| | | public int TaskNum { get; set; } |
| | | |
| | |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç¼å·")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·", IsIgnore = true)] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æçç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ç±»å")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç±»å")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç±»å", IsIgnore = true)] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡ç±»å")] |
| | | public int TaskType { get; set; } |
| | | |
| | |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ç¶æ")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç¶æ")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç¶æ", IsIgnore = true)] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡ç¶æ")] |
| | | public int TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºæ¿ç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åºæ¿ç¼å·")] |
| | | [ExporterHeader(DisplayName = "åºæ¿ç¼å·", IsIgnore = true)] |
| | | [SugarColumn(IsNullable = false, Length = 30, ColumnDescription = "åºæ¿ç¼å·")] |
| | | public string WarehouseCode { get; set; } |
| | | |
| | |
| | | /// åºåæ°,任塿°é |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åºåæ°")] |
| | | [ExporterHeader(DisplayName = "åºåæ°")] |
| | | [ExporterHeader(DisplayName = "任塿°")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåæ°")] |
| | | public decimal StockQuantity { get; set; } |
| | | |
| | |
| | | /// ä»»å¡ä¸åæ¶é´ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ä¸åæ¶é´")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ä¸åæ¶é´")] |
| | | [ExporterHeader(DisplayName = "å建æ¶é´")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ä¸åæ¶é´")] |
| | | public DateTime? Dispatchertime { get; set; } |
| | | |
| | |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ä¿¡æ¯åå² |
| | |
| | | /// åè¡¨ä¸»é® |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å表主é®")] |
| | | [ExporterHeader(DisplayName = "å表主é®")] |
| | | [ExporterHeader(DisplayName = "å表主é®", IsIgnore = true)] |
| | | [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "å表主é®")] |
| | | public int SourceId { get; set; } |
| | | |
| | |
| | | /// ç§»å
¥å岿¶é´ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç§»å
¥å岿¶é´")] |
| | | [ExporterHeader(DisplayName = "ç§»å
¥å岿¶é´")] |
| | | [ExporterHeader(DisplayName = "宿æ¶é´")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç§»å
¥å岿¶é´")] |
| | | public DateTime InsertTime { get; set; } |
| | | } |
| | |
| | | _unitOfWorkManage.RollbackTran(); |
| | | _messageInfoService.AddMessageInfo(messageGroupBy, name, ex.Message, messageStatus); |
| | | SendErrorToUpstream(1, "", ex.Message, ""); |
| | | return responseContent.Error("åæ¥å¤±è´¥: " + ex.Message); |
| | | //return responseContent.Error("åæ¥å¤±è´¥: " + ex.Message); |
| | | } |
| | | }; |
| | | return responseContent.OK("忥å
¥åºåæå"); |
| | |
| | | _unitOfWorkManage.RollbackTran(); |
| | | _messageInfoService.AddMessageInfo(messageGroupBy, name, ex.Message, messageStatus); |
| | | SendErrorToUpstream(3, "", ex.Message, ""); |
| | | return responseContent.Error("åæ¥å¤±è´¥: " + ex.Message); |
| | | //return responseContent.Error("åæ¥å¤±è´¥: " + ex.Message); |
| | | } |
| | | } |
| | | return responseContent.OK($"忥åºåºåæåï¼å
±{_DeliveryOrders.Count}æ¡"); |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IWMsInfoServices; |
| | |
| | | public InventoryInfoController(IInventoryInfoService service) : base(service) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// æ°ååªçè·ååºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetInventory"), AllowAnonymous] |
| | | public object GetInventory() |
| | | { |
| | | WebResponseContent content = Service.GetInventory(); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | note = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "000", |
| | | note = "æå", |
| | | date = content.Data |
| | | }; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IWMsInfoServices; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public MessageInfoController(IMessageInfoService service) : base(service) |
| | | { |
| | | } |
| | | [HttpPost, HttpGet, Route("DeleteAndIntoHty")] |
| | | public WebResponseContent DeleteAndIntoHty([FromBody] int[] keys) |
| | | { |
| | | return Service.DeleteAndIntoHty(keys); |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IWMsInfoServices; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public SupplyTaskHtyController(ISupplyTaskHtyService service) : base(service) |
| | | { |
| | | } |
| | | [HttpPost, HttpGet, Route("GetInOutTasks"), AllowAnonymous] |
| | | public object GetInOutTasks() |
| | | { |
| | | WebResponseContent content = Service.GetInOutTasks(); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | note = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "000", |
| | | note = "æå", |
| | | date = content.Data |
| | | }; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |