dengjunjie
2024-12-24 aacbe0eccdb886c424aa42758d6d3f5d62550a75
Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
已删除9个文件
已修改26个文件
已添加10个文件
已重命名1个文件
505 ■■■■ 文件已修改
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/0397a60b-c71f-4284-85ef-52044ecfbb47.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/182750cd-850d-4516-a67b-7253ac4fb232.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/43baaa76-d5f1-4df1-9f57-25cfd3fe3186.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/55c55350-83b6-4489-98a3-f1f310d14b68.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/63f25530-00aa-456a-969e-f1c0f63b3c3e.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/671f6735-50dc-4160-a801-1403c5554dc0.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6ddb89a1-3fb5-42aa-a799-c08181483993.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/beef5092-aeef-4199-ba40-4b3d6192ea2d.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/cc3915a8-59aa-4f44-9ac1-1573b19314bd.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d02ec307-551b-4de2-b989-3f41b8cc227f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WareHouseEnum/WarehouseEnum.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_Warehouse.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_WarehouseDevice.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP仓/StackerCraneJob_PP.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/StackerCraneJob_ZH.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0fe0eb0-0200-46f6-a7cd-e7eceefa6c9f.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d1c62139-7bae-4df6-b13e-daefe3114894.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dba84b80-59a3-4d5b-9a50-dd830ce6c4f5.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e7c41db3-4bc3-4216-90e3-a4b2f38e7979.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fc937dfc-f65e-4bef-aaa4-717ebb3be43e.vsidx 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/IERPService/IInvokeERPService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/接口文档/MES业务流程图V1.0.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/0397a60b-c71f-4284-85ef-52044ecfbb47.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/182750cd-850d-4516-a67b-7253ac4fb232.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/43baaa76-d5f1-4df1-9f57-25cfd3fe3186.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/55c55350-83b6-4489-98a3-f1f310d14b68.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/63f25530-00aa-456a-969e-f1c0f63b3c3e.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/671f6735-50dc-4160-a801-1403c5554dc0.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/6ddb89a1-3fb5-42aa-a799-c08181483993.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/beef5092-aeef-4199-ba40-4b3d6192ea2d.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/cc3915a8-59aa-4f44-9ac1-1573b19314bd.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d02ec307-551b-4de2-b989-3f41b8cc227f.vsidx
Binary files differ
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj
@@ -7,7 +7,7 @@
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="WIDESEAWCS_QuartzJob" Version="1.0.0" />
    <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.1" />
  </ItemGroup>
  <ItemGroup>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
@@ -52,6 +52,12 @@
        InQuality = 540,
        /// <summary>
        /// ç”Ÿäº§é€€æ–™
        /// </summary>
        [Description("生产退料")]
        ProductionReturn = 550,
        /// <summary>
        /// å··é“内移库
        /// </summary>
        [Description("巷道内移库")]
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WareHouseEnum/WarehouseEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.WareHouseEnum
{
    /// <summary>
    /// ä»“库
    /// HA57 = æ·®å®‰äºŒåŽ‚ - æ¿æ–™ä»“<br/>
    /// HA58 = æ·®å®‰äºŒåŽ‚ - PP仓<br/>
    /// HA60 = æ·®å®‰äºŒåŽ‚ - è¾…料仓<br/>
    /// HA64 = æ·®å®‰äºŒåŽ‚ - æµ‹è¯•架仓<br/>
    /// HA71 = æ·®å®‰äºŒåŽ‚ - æˆå“ä»“<br/>
    /// HA72 = æ·®å®‰äºŒåŽ‚ - å°¾æ•°ä»“<br/>
    /// HA73 = æ·®å®‰äºŒåŽ‚ - ç ”发仓<br/>
    /// HA101 = æ·®å®‰äºŒåŽ‚ - æˆå“ä»“平库<br/>
    /// HA152 = æ·®å®‰äºŒåŽ‚ - å¹²è†œä»“<br/>
    /// HA153 = æ·®å®‰äºŒåŽ‚ - æ²¹å¢¨ä»“<br/>
    /// </summary>
    public enum WarehouseEnum
    {
        /// <summary>
        /// æ¿æ–™ä»“
        /// </summary>
        [Description("板料仓")]
        HA57,
        /// <summary>
        /// PP仓
        /// </summary>
        [Description("PP仓")]
        HA58,
        /// <summary>
        /// è¾…料仓
        /// </summary>
        [Description("辅料仓")]
        HA60,
        /// <summary>
        /// æµ‹è¯•架仓
        /// </summary>
        [Description("测试架仓")]
        HA64,
        /// <summary>
        /// æˆå“ä»“
        /// </summary>
        [Description("成品仓")]
        HA71,
        /// <summary>
        /// å°¾æ•°ä»“
        /// </summary>
        [Description("尾数仓")]
        HA72,
        /// <summary>
        /// ç ”发仓
        /// </summary>
        [Description("研发仓")]
        HA73,
        /// <summary>
        /// æˆå“ä»“平库
        /// </summary>
        [Description("成品仓平库")]
        HA101,
        /// <summary>
        /// å¹²è†œä»“
        /// </summary>
        [Description("干膜仓")]
        HA152,
        /// <summary>
        /// æ²¹å¢¨ä»“
        /// </summary>
        [Description("油墨仓")]
        HA153
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -52,5 +52,9 @@
        /// ä¼˜å…ˆçº§
        /// </summary>
        public int Grade { get; set; }
        public int WarehouseId { get; set; }
        public string AGVArea { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj
@@ -10,4 +10,8 @@
      <ProjectReference Include="..\WIDESEAWCS_Model\WIDESEAWCS_Model.csproj" />
    </ItemGroup>
    <ItemGroup>
      <Folder Include="BasicInfo\" />
    </ItemGroup>
</Project>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_Warehouse.cs
ÎļþÃû´Ó ´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/BasicInfo/WarehouseDTO.cs ÐÞ¸Ä
@@ -4,15 +4,20 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.DB.Models;
namespace WIDESEAWCS_DTO.BasicInfo
namespace WIDESEAWCS_Model.Models
{
    public class WarehouseDTO
    /// <summary>
    /// ä»“库信息
    /// </summary>
    [SugarTable(nameof(Dt_Warehouse), "仓库信息")]
    public class Dt_Warehouse : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        [SugarColumn(IsPrimaryKey = true, ColumnDescription = "主键")]
        public int WarehouseId { get; set; }
        /// <summary>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/BasicInfo/Dt_WarehouseDevice.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.DB.Models;
namespace WIDESEAWCS_Model.Models
{
    [SugarTable(nameof(Dt_WarehouseDevice))]
    public class Dt_WarehouseDevice : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
        public int Id { get; set; }
        /// <summary>
        /// è®¾å¤‡ä¸»é”®
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "")]
        public int DeviceId { get; set; }
        /// <summary>
        /// è®¾å¤‡ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        public string DeviceCode { get; set; }
        /// <summary>
        /// è®¾å¤‡åç§°
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        public string DeviceName { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// ä»“库编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        public string WarehouseCode { get; set; }
        /// <summary>
        /// ä»“库名称
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "")]
        public string WarehouseName { get; set; }
        /// <summary>
        /// å¤‡æ³¨
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "")]
        public string Remark { get; set; }
    }
}
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/WarehouseHostedService.cs
@@ -1,12 +1,24 @@

using SqlSugar;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.Seed;
using WIDESEAWCS_DTO.BasicInfo;
using WIDESEAWCS_Model.Models;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
namespace WIDESEAWCS_Server.HostedService
{
    public class WarehouseHostedService : IHostedService
    {
        private readonly ICacheService _cacheService;
        private readonly DBContext _dbContext;
        public WarehouseHostedService(ICacheService cacheService, DBContext dbContext)
        {
            _cacheService = cacheService;
            _dbContext = dbContext;
        }
        public Task StartAsync(CancellationToken cancellationToken)
        {
            string connStr = AppSettings.GetValue("WMSConnectionStrings");
@@ -14,14 +26,18 @@
            {
                throw new Exception("WMS连接字符串错误");
            }
            SqlSugarClient sugarClient = new SqlSugarClient(new ConnectionConfig()
            SqlSugarClient sugarClient = new(new ConnectionConfig()
            {
                ConnectionString = connStr,
                IsAutoCloseConnection = true,
                DbType = DbType.SqlServer
            });
            List<WarehouseDTO> warehouses = sugarClient.Queryable<WarehouseDTO>().ToList();
            List<Dt_Warehouse> warehouses = sugarClient.Queryable<Dt_Warehouse>().ToList();
            _dbContext.Db.Deleteable<Dt_Warehouse>().ExecuteCommand();
            _dbContext.Db.Insertable(warehouses).ExecuteCommand();
            return Task.CompletedTask;
        }
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -21,6 +21,7 @@
using Autofac.Core;
using WIDESEAWCS_QuartzJob.QuartzExtensions;
using Microsoft.AspNetCore.Builder;
using WIDESEAWCS_Server.HostedService;
var builder = WebApplication.CreateBuilder(args);
@@ -46,8 +47,9 @@
builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
builder.Services.AddDbSetup();//Db å¯åŠ¨æœåŠ¡
builder.Services.AddScoped<QuartzJobCreateDataTabel>();
builder.Services.AddHostedService<QuartzJobDataTableHostedService>();
//builder.Services.AddScoped<QuartzJobCreateDataTabel>();
builder.Services.AddHostedService<WarehouseHostedService>();
//builder.Services.AddHostedService<QuartzJobDataTableHostedService>();
builder.Services.AddAutoMapperSetup();
@@ -61,7 +63,7 @@
builder.Services.AddHttpContextSetup();
builder.Services.AddHostedService<QuartzJobHostedService>();
//builder.Services.AddHostedService<QuartzJobHostedService>();
builder.Services.AddMvc(options =>
{
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -32,23 +32,28 @@
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.BasicInfo;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
namespace WIDESEAWCS_TaskInfoService
{
    public partial class TaskService : ServiceBase<Dt_Task, ITaskRepository>, ITaskService
    {
        private readonly IMapper _mapper;
        private readonly ICacheService _cacheService;
        private readonly IRouterService _routerService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository;
        private readonly IMapper _mapper;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IRouterRepository _routerRepository;
        private Dictionary<string, OrderByType> _taskOrderBy = new()
            {
@@ -56,20 +61,33 @@
                {nameof(Dt_Task.CreateDate),OrderByType.Asc},
            };
        private List<Dt_Warehouse>? Warehouses = new List<Dt_Warehouse>();
        public Dictionary<string, OrderByType> TaskOrderBy { get { return _taskOrderBy; } set { _taskOrderBy = value; } }
        public List<int> TaskInboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 100 && x < 500).ToList();
        public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 500 && x < 900).ToList();
        public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, IStationMangerRepository stationMangerRepository) : base(BaseDal)
        public TaskService(ITaskRepository BaseDal, IMapper mapper, ICacheService cacheService, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _cacheService = cacheService;
            _routerService = routerService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskExecuteDetailRepository = taskExecuteDetailRepository;
            _mapper = mapper;
            _stationMangerRepository = stationMangerRepository;
            _routerRepository = routerRepository;
            string? cacheStr = _cacheService.Get(nameof(Dt_Warehouse));
            if (!string.IsNullOrEmpty(cacheStr))
            {
                Warehouses = JsonConvert.DeserializeObject<List<Dt_Warehouse>>(cacheStr);
            }
        }
        /// <summary>
        /// æŽ¥æ”¶WMS任务信息
@@ -81,10 +99,11 @@
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<Dt_WarehouseDevice> warehouseDevices = Db.Queryable<Dt_WarehouseDevice>().ToList();
                List<Dt_Task> tasks = new List<Dt_Task>();
                foreach (var item in taskDTOs)
                {
                    if (BaseDal.QueryFirst(x => x.TaskNum == item.TaskNum || x.PalletCode == item.PalletCode) != null)
                    {
                        continue;
@@ -95,6 +114,23 @@
                    task.CurrentAddress = item.SourceAddress;
                    task.NextAddress = item.TargetAddress;
                    List<Dt_WarehouseDevice> wades = warehouseDevices.Where(x => x.WarehouseId == item.WarehouseId).ToList();
                    if (string.IsNullOrEmpty(item.AGVArea))
                    {
                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == item.SourceAddress || x.StackerCraneCode == item.RoadWay);
                        //stationManger.AGVStationCode
                        //stationManger.StackerCraneCode
                        //stationManger.StationDeviceCode
                        List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (stationManger.StationDeviceCode == x.StartPosi || stationManger.StackerCraneCode == x.StartPosi));
                    }
                    else
                    {
                        List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && item.AGVArea == x.StartPosi);
                    }
                    tasks.Add(task);
                }
                BaseDal.AddData(tasks);
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/PP²Ö/StackerCraneJob_PP.cs
@@ -19,7 +19,7 @@
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
using WIDESEAWCS_Tasks;
namespace WIDESEAWCS_Tasks
{
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj
@@ -7,7 +7,7 @@
    </PropertyGroup>
    <ItemGroup>
      <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.0" />
      <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.1" />
    </ItemGroup>
    <ItemGroup>
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/°å²Ä²Ö/StackerCraneJob_BC.cs
@@ -19,7 +19,7 @@
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
using WIDESEAWCS_Tasks;
namespace WIDESEAWCS_Tasks
{
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/×躸²Ö/StackerCraneJob_ZH.cs
@@ -19,7 +19,7 @@
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_Tasks.HoisterJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using WIDESEAWCS_Tasks.阻焊仓;
using WIDESEAWCS_Tasks;
namespace WIDESEAWCS_Tasks
{
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0fe0eb0-0200-46f6-a7cd-e7eceefa6c9f.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/d1c62139-7bae-4df6-b13e-daefe3114894.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dba84b80-59a3-4d5b-9a50-dd830ce6c4f5.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e7c41db3-4bc3-4216-90e3-a4b2f38e7979.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/fc937dfc-f65e-4bef-aaa4-717ebb3be43e.vsidx
Binary files differ
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/APIEnum/APIEnum.cs
@@ -41,6 +41,11 @@
        /// ERP物料出库接口调用
        /// </summary>
        [Description("ERP物料出库接口调用")]
        InvokeOutboundOrderApi
        InvokeOutboundOrderApi,
        /// <summary>
        /// MES同步测试架台账信息
        /// </summary>
        [Description("MES同步测试架台账信息")]
        WMS_MES_TestToolSync,
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -80,6 +80,11 @@
        [Description("阻焊仓入库")]
        SolderInbound = 2350,
        /// <summary>
        /// æµ‹è¯•架退库
        /// </summary>
        [Description("测试架退库")]
        TestBackbound=2400,
        /// <summary>
        /// å‡ºåº“
        /// </summary>
        [Description("出库")]
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs
@@ -14,8 +14,8 @@
namespace WIDESEA_Core
{
    public sealed class SeedDataHostedService : IHostedService
    {
        private readonly DBContext _dbContext;
        {
            private readonly DBContext _dbContext;
        private readonly ILogger<SeedDataHostedService> _logger;
        private readonly string _webRootPath;
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs
@@ -53,5 +53,9 @@
        /// </summary>
        public int Grade { get; set; }
        public int WarehouseId { get; set; }
        public string AGVArea { get; set; }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_External/IERPService/IInvokeERPService.cs
@@ -33,6 +33,11 @@
        /// <param name="inboundModel"></param>
        /// <returns></returns>
        string InvokeInboundOrderApi(ERPInboundModel inboundModel);
        /// <summary>
        /// ERP物料出库接口调用
        /// </summary>
        /// <param name="outboundModel"></param>
        /// <returns></returns>
        string InvokeOutboundOrderApi(ERPOutboundModel outboundModel);
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutStockLockInfoService.cs
@@ -18,6 +18,8 @@
        List<Dt_OutStockLockInfo> GetOutStockLockInfos(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, List<Dt_StockInfo> outStocks, int? taskNum = null);
        Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null);
        List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus);
        List<Dt_OutStockLockInfo> GetStockOutboundOrder(SaveModel saveModel);
    }
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -100,7 +100,7 @@
        /// <param name="taskNum">任务号</param>
        /// <param name="locationCode">入库或出库的货位号</param>
        /// <returns></returns>
        MesResponseContent TestReturnStock(TestToolBackModel backModel);
        MesResponseContent TestToolBack(TestToolBackModel backModel);
        /// <summary>
        /// æµ‹è¯•架报废
        /// </summary>
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs
@@ -49,6 +49,30 @@
            return outStockLockInfos;
        }
        public Dt_OutStockLockInfo GetOutStockLockInfo(Dt_OutboundOrder outboundOrder, Dt_OutboundOrderDetail outboundOrderDetail, Dt_StockInfo outStock, float assignQuantity, int? taskNum = null)
        {
            Dt_OutStockLockInfo outStockLockInfo = new Dt_OutStockLockInfo()
            {
                PalletCode = outStock.PalletCode,
                AssignQuantity = assignQuantity,
                MaterielCode = outboundOrderDetail.MaterielCode,
                BatchNo = outboundOrderDetail.BatchNo,
                LocationCode = outStock.LocationCode,
                MaterielName = outboundOrderDetail.MaterielName,
                OrderDetailId = outboundOrderDetail.Id,
                OrderNo = outboundOrder.OrderNo,
                OrderType = outboundOrder.OrderType,
                OriginalQuantity = outStock.Details.Where(x => x.MaterielCode == outboundOrderDetail.MaterielCode).Sum(x => x.StockQuantity),
                Status = taskNum == null ? OutLockStockStatusEnum.已分配.ObjToInt() : OutLockStockStatusEnum.出库中.ObjToInt(),
                StockId = outStock.Id,
                TaskNum = taskNum,
                OrderQuantity = outboundOrderDetail.OrderQuantity
            };
            return outStockLockInfo;
        }
        public List<Dt_OutStockLockInfo> GetByOrderDetailId(int orderDetailId, OutLockStockStatusEnum outStockStatus)
        {
            return BaseDal.QueryData(x => x.OrderDetailId == orderDetailId && x.Status == outStockStatus.ObjToInt());
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService_Pick.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_IOutboundRepository;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
namespace WIDESEA_IOutboundService
{
    public partial class OutStockLockInfoService : ServiceBase<Dt_OutStockLockInfo, IOutStockLockInfoRepository>, IOutStockLockInfoService
    {
        IStockService _stockService;
        public WebResponseContent MaterialPick(string palletCode)
        {
            try
            {
                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode);
                if (stockInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到该托盘库存信息");
                }
                List<Dt_OutStockLockInfo> outStockLockInfos = Repository.QueryData(x => x.PalletCode == palletCode);
                for (int i = 0; i < outStockLockInfos.Count; i++)
                {
                    float assignQuantity = outStockLockInfos[i].AssignQuantity;
                    List<Dt_StockInfoDetail> stockInfoDetails = stockInfo.Details.Where(x => x.MaterielCode == outStockLockInfos[i].MaterielCode).ToList();
                    for (int j = 0; j < stockInfoDetails.Count; j++)
                    {
                       // if(assignQuantity > stockInfoDetails[j])
                    }
                }
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs
@@ -234,38 +234,52 @@
                float needQuantity = originalNeedQuantity;
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, outboundOrder.WarehouseId);
                if (!stockInfos.Any())
                {
                    throw new Exception($"未找到可分配库存");
                }
                List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, item.MaterielCode, needQuantity, out float residueQuantity);
                item.LockQuantity += needQuantity - residueQuantity;
                outStocks.AddRange(autoAssignStocks);
                float assignQuantity = needQuantity - residueQuantity;
                //for (int i = 0; i < outboundOrderDetails.Count; i++)
                //{
                //    for (int j = 0; j < outStocks.Count; j++)
                //    {
                //        if(assignQuantity > 0)
                //        {
                //            if (outboundOrderDetails[i].OrderQuantity - outboundOrderDetails[i].LockQuantity >= outStocks[j].)
                //            {
                //            }
                //        }
                //    }
                List<Dt_OutboundOrderDetail> details = outboundOrderDetails.Where(x => !string.IsNullOrEmpty(x.BatchNo) ? x.BatchNo == item.BatchNo : true && x.MaterielCode == item.MaterielCode).ToList();
                //    if (assignQuantity > 0 && outboundOrderDetails[i].LockQuantity < outboundOrderDetails[i].OrderQuantity)
                //    {
                //        outStockLockInfos.AddRange(_outStockLockInfoService.GetOutStockLockInfos(outboundOrder, outboundOrderDetails[i], outStocks));
                //        if (outboundOrderDetails[i].OrderQuantity - outboundOrderDetails[i].LockQuantity >= assignQuantity)
                //        {
                //            outboundOrderDetails[i].LockQuantity += assignQuantity;
                //            break;
                //        }
                //        else
                //        {
                //            assignQuantity -= (outboundOrderDetails[i].OrderQuantity - outboundOrderDetails[i].LockQuantity);
                //            outboundOrderDetails[i].LockQuantity = outboundOrderDetails[i].OrderQuantity;
                //        }
                //    }
                //}
                for (int i = 0; i < details.Count; i++)
                {
                    float orderQuantity = details[i].OrderQuantity;
                    for (int j = 0; j < autoAssignStocks.Count; j++)
                    {
                        float detailAssignQuantity = outStockLockInfos.Where(x => !string.IsNullOrEmpty(x.BatchNo) ? x.BatchNo == item.BatchNo : true && x.MaterielCode == item.MaterielCode && x.OrderDetailId == details[i].Id).Sum(x => x.AssignQuantity);//出库订单明细已分配数量
                        float palletAssignQuantity = outStockLockInfos.Where(x => x.BatchNo == item.BatchNo && x.MaterielCode == item.MaterielCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//出库详情已分配数量
                        if (string.IsNullOrEmpty(item.BatchNo))
                        {
                            palletAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == item.MaterielCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//出库详情已分配数量
                        }
                        float palletOutboundQuantity = autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity);
                        if (palletAssignQuantity < palletOutboundQuantity)//如果出库详情已分配数量小于托盘已分配数量,则可以继续添加该托盘出库信息
                        {
                            float orderDetailNeedQuantity = details[i].OrderQuantity - detailAssignQuantity;
                            if (orderDetailNeedQuantity > autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity)
                            {
                                details[i].LockQuantity += autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity;
                                Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(outboundOrder, details[i], autoAssignStocks[j], autoAssignStocks[j].Details.Sum(x => x.OutboundQuantity) - palletAssignQuantity);
                                outStockLockInfos.Add(outStockLockInfo);
                            }
                            else
                            {
                                Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(outboundOrder, details[i], autoAssignStocks[j], details[i].OrderQuantity - details[i].LockQuantity);
                                outStockLockInfos.Add(outStockLockInfo);
                                details[i].LockQuantity = details[i].OrderQuantity;
                                break;
                            }
                        }
                    }
                }
                locationInfos.AddRange(_basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            }
@@ -385,6 +399,14 @@
                List<Dt_OutStockLockInfo> addOutStockLockInfos = outStockLockInfos.Where(x => x.Id == 0).ToList();
                if (addOutStockLockInfos != null && addOutStockLockInfos.Any())
                {
                    if(tasks != null)
                    {
                        addOutStockLockInfos.ForEach(x =>
                        {
                            x.TaskNum = tasks.FirstOrDefault(v => v.PalletCode == x.PalletCode)?.TaskNum;
                        });
                    }
                    _outStockLockInfoService.Repository.AddData(addOutStockLockInfos);
                }
                List<Dt_OutStockLockInfo> updateOutStockLockInfos = outStockLockInfos.Where(x => x.Id > 0).ToList();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -41,17 +41,19 @@
        private readonly IStockInfoRepository _stockInfoRepository;
        public IOutboundOrderRepository Repository => BaseDal;
        private readonly IInvokeERPService _invokeERPService;
        private readonly IOutStockLockInfoService _outStockLockInfoService;
        public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper,IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IStockInfoService stockInfoService,
          IStockInfoRepository stockInfoRepository, IInvokeERPService invokeERPService) : base(BaseDal)
          IStockInfoRepository stockInfoRepository, IInvokeERPService invokeERPService, IOutStockLockInfoService outStockLockInfoService) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage=unitOfWorkManage;
            _unitOfWorkManage = unitOfWorkManage;
            _basicService = basicService;
            _outboundOrderDetailRepository = outboundOrderDetailRepository;
            _stockInfoService = stockInfoService;
            _stockInfoRepository = stockInfoRepository;
            _invokeERPService = invokeERPService;
            _outStockLockInfoService = outStockLockInfoService;
        }
        public WebResponseContent ReceiveOutOrder(ErpOutOrderDTO model)
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -1,8 +1,10 @@
using System;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.APIEnum;
using WIDESEA_Common.CommonEnum;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.OtherEnum;
@@ -11,6 +13,7 @@
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.Enums;
using WIDESEA_DTO;
using WIDESEA_DTO.ERP;
using WIDESEA_DTO.MES;
@@ -79,6 +82,8 @@
                BaseDal.AddData(taskOut);
                //加入货位变动记录
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, locationStatus, LocationChangeType.OutboundAssignLocation, stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", taskOut.TaskNum);
                //加入库存变动记录
                //_recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfoDetails, beforeQuantity, totalQuantity, StockChangeTypeEnum.MaterielGroup);
                _unitOfWorkManage.CommitTran();
                //将任务推送到WCS
                PushTasksToWCS();
@@ -95,7 +100,7 @@
        /// æµ‹è¯•架退库
        /// </summary>
        /// <returns></returns>
        public MesResponseContent TestReturnStock(TestToolBackModel backModel)
        public MesResponseContent TestToolBack(TestToolBackModel backModel)
        {
            MesResponseContent responseContent = new MesResponseContent();
            try
@@ -107,9 +112,38 @@
                  x.WarehouseId == warehouse.WarehouseId &&
                  x.StockStatus == (int)StockStatusEmun.出库完成)
                .Includes(x => x.Details).Where(x => x.Details.Any(x => x.BatchNo == backModel.TestToolCode)).First();
                if (stockInfo==null)
                {
                    return responseContent.Error($"{backModel.TestToolCode}库存信息不存在");
                }
                //生成退库任务
                Dt_Task taskIn = new()
                {
                    CurrentAddress = backModel.SourceAddressCode,
                    Grade = 0,
                    PalletCode = stockInfo.PalletCode,
                    NextAddress = "",
                    Roadway = "",
                    SourceAddress = backModel.SourceAddressCode,
                    TargetAddress = "",
                    TaskStatus = (int)TaskStatusEnum.New,
                    TaskType = (int)TaskTypeEnum.TestBackbound,
                    TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                    PalletType = stockInfo.PalletType,
                    WarehouseId = stockInfo.WarehouseId,
                };
                //更改库存状态
                stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                _unitOfWorkManage.BeginTran();
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _unitOfWorkManage.CommitTran();
                //将任务推送到WCS
                PushTasksToWCS();
                responseContent.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                responseContent.Error(ex.Message);
            }
            return responseContent;
@@ -127,14 +161,23 @@
                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA64.ToString());
                //获取库存记录
                Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x =>
                  x.WarehouseId == warehouse.WarehouseId)
                  x.WarehouseId == warehouse.WarehouseId && x.StockStatus==StockStatusEmun.出库完成.ObjToInt())
                .Includes(x => x.Details).Where(x => x.Details.Any(x => x.BatchNo == toolScrap.ToolCode)).First();
                if (stockInfo == null)
                {
                    return responseContent.Error($"{toolScrap.ToolCode}库存信息不存在");
                }
                //清除库存信息
                _unitOfWorkManage.BeginTran();
                _stockRepository.StockInfoRepository.DeleteData(stockInfo);
                _stockRepository.StockInfoDetailRepository.DeleteData(stockInfo.Details);
                _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfo,OperateTypeEnum.自动删除);
                _stockRepository.StockInfoDetailRepository.DeleteAndMoveIntoHty(stockInfo.Details, OperateTypeEnum.自动删除);
                _unitOfWorkManage.CommitTran();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                responseContent.Error(ex.Message);
            }
            return responseContent;
@@ -149,10 +192,14 @@
            WebResponseContent content= new WebResponseContent();
            try
            {
                Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x=>x.ApiCode==APIEnum.WMS_MES_TestToolSync.ToString());
                Root<TestToolSynInfo> root = new Root<TestToolSynInfo>()
                {
                    From = "WMS",
                    DateTime = DateTime.Now.ToString(),
                    Content=toolSynInfo
                };
                //调用接口
            }
            catch (Exception ex)
            {
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -33,6 +33,7 @@
using WIDESEA_DTO.Inbound;
using WIDESEA_DTO.Stock;
using WIDESEA_DTO.Task;
using WIDESEA_External.ERPService;
using WIDESEA_IBasicRepository;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
@@ -58,6 +59,8 @@
        private readonly IOutboundService _outboundService;
        private readonly IStockService _stockService;
        private readonly IBasicRepository _basicRepository;
        private readonly IApiInfoRepository _apiInfoRepository;
        private readonly IInvokeERPService _invokeERPService;
        public ITaskRepository Repository => BaseDal;
@@ -71,7 +74,7 @@
        public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList();
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository) : base(BaseDal)
        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
@@ -81,6 +84,8 @@
            _outboundService = outboundService;
            _stockService = stockService;
            _basicRepository = basicRepository;
            _apiInfoRepository = apiInfoRepository;
            _invokeERPService = invokeERPService;
        }
        /// <summary>
@@ -158,6 +163,10 @@
                if (task.TaskType == TaskTypeEnum.TestInbound.ObjToInt())
                {
                    stockInfo.StockStatus = StockStatusEmun.入库完成未建出库单.ObjToInt();
                    stockInfo.Details.ForEach(x =>
                    {
                        x.Status = StockStatusEmun.入库完成.ObjToInt();
                    });
                }
                else
                {
@@ -171,7 +180,7 @@
                _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details);
                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, lastStatus, LocationChangeType.InboundCompleted);
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, stockInfo.Details.Sum(x => x.StockQuantity), stockInfo.Details.Sum(x => x.StockQuantity), StockChangeTypeEnum.Inbound, taskNum);
                _unitOfWorkManage.CommitTran();
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj
@@ -7,6 +7,7 @@
  </PropertyGroup>
  <ItemGroup>
    <ProjectReference Include="..\WIDESEA_External\WIDESEA_External.csproj" />
    <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
    <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" />
    <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/MES/MesController.cs
@@ -49,17 +49,17 @@
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("TestReturnStock"), AllowAnonymous, MethodParamsValidate]
        public MesResponseContent TestReturnStock([FromBody] Root<TestToolBackModel> model)
        [HttpPost, Route("TestToolBack"), AllowAnonymous, MethodParamsValidate]
        public MesResponseContent TestToolBack([FromBody] Root<TestToolBackModel> model)
        {
            return _taskService.TestReturnStock(model.Content);
            return _taskService.TestToolBack(model.Content);
        }
        /// <summary>
        /// æµ‹è¯•架报废
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost, Route("TestScrap"), AllowAnonymous, MethodParamsValidate]
        [HttpPost, Route("TestToolScrap"), AllowAnonymous, MethodParamsValidate]
        public MesResponseContent TestScrap([FromBody] Root<TestToolScrap> model)
        {
            return _taskService.TestScrap(model.Content);
ÏîÄ¿×ÊÁÏ/½Ó¿ÚÎĵµ/MESÒµÎñÁ÷³ÌͼV1.0.xlsx
Binary files differ