wangxinhui
2026-01-12 ded9c653b4bd5f45cb23124068687135c29e6915
多个功能优化,逻辑修改等
已添加25个文件
已复制12个文件
已重命名5个文件
已修改38个文件
2331 ■■■■ 文件已修改
项目代码/WCS/WCSClient/src/api/http.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Common/StationOccupiedEnum.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Common/TaskEnum/SequenceEnum.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_DTO/PackInfo/MESProPackInfoDTO.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackTypeRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackaxisRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackinfoRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackinfo_HtyRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IStationPackDetailRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IStationPackInfoRepository.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackaxisService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackinfoService.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackinfo_HtyService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IStationPackDetailService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IStationPackInfoService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_ITaskInfoRepository/IPackaxisTaskRepository.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_ITaskInfoRepository/IPackaxisTask_HtyRepository.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/IPackaxisTaskService.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/IPackaxisTask_HtyService.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/ITaskService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_PackType.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_Packaxis.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_Packinfo.cs 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_Packinfo_Hty.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackDetail.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Model/Models/TaskInfo/Dt_PackaxisTask.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackTypeRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackaxisRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackinfoRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Packinfo_HtyRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/StationPackDetailRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/StationPackInfoRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoService/PackaxisService.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoService/PackinfoService.cs 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoService/Packinfo_HtyService.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoService/StationPackDetailService.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_PackInfoService/StationPackInfoService.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Controllers/PackInfo/PackaxisController.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Controllers/PackInfo/PackinfoController.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/PackaxisTaskController.cs 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Filter/CustomProfile.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoRepository/PackaxisTaskRepository.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoRepository/PackaxisTask_HtyRepository.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTask_HtyService.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/DBNames/TrussDBName.cs 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/ApartPlate.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/StackPlate.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPB.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPH.cs 206 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/桁架/TrussCartonJob.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/桁架/TrussDixieCupJob.cs 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/码垛/MDJob_CP.cs 217 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_Common/CommonEnum/StationAreaEnum.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_IInboundService/IMESProInOrderInfoService.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_ITaskInfoService/ITaskService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_InboundService/MESProInOrderInfoService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutMESIssueCache.cs 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_OutboundService/OutMESOrderService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/MesTaskService.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Completed.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs 179 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_WMSServer/Controllers/MES/MesController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServices/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/接口协议/龙利得MES接口.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/通信协议/纸杯&纸箱上料桁架通讯协议.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/通信协议/纸杯纸箱上料桁架通讯协议-251118.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
项目资料/通信协议/龙利得机器人IO通讯表20250712.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WCS/WCSClient/src/api/http.js
@@ -12,8 +12,8 @@
let loadingInstance;
let loadingStatus = false;
if (process.env.NODE_ENV == 'development') {
    // axios.defaults.baseURL = 'http://127.0.0.1:9291/';
    axios.defaults.baseURL = 'http://192.168.35.3:9281/';
    axios.defaults.baseURL = 'http://127.0.0.1:9291/';
    // axios.defaults.baseURL = 'http://192.168.35.3:9281/';
}
else if (process.env.NODE_ENV == 'debug') {
    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Common/StationOccupiedEnum.cs
@@ -8,7 +8,6 @@
{
    public enum StationOccupiedEnum
    {
        None,
        Sure
    }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Common/TaskEnum/SequenceEnum.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_Common.TaskEnum
{
    public enum SequenceEnum
    {
        SeqPackTaskNum
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
@@ -130,6 +130,12 @@
        InPick = 530,
        /// <summary>
        /// ç©ºæ‰˜å›žå ç›˜
        /// </summary>
        [Description("空托回叠盘")]
        EmptyPaletteBack = 535,
        /// <summary>
        /// æˆå“å…¥åº“
        /// </summary>
        [Description("成品入库")]
@@ -175,7 +181,7 @@
        /// çº¸å¼ æ·‹è†œä½™æ–™é€€åº“
        /// </summary>
        [Description("纸张淋膜余料退库")]
        PaperFilmYLBackInbound = 725,
        PaperLMYLBackInbound = 725,
        /// <summary>
        /// çº¸è¢‹ä½™æ–™é€€åº“
@@ -196,6 +202,12 @@
        PaperOldYLBackInbound = 740,
        /// <summary>
        /// æ— çººå¸ƒè¢‹ä½™æ–™é€€åº“
        /// </summary>
        [Description("无纺布袋余料退库")]
        WFBBackInbound = 745,
        /// <summary>
        /// å··é“内移库
        /// </summary>
        [Description("巷道内移库")]
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_DTO/PackInfo/MESProPackInfoDTO.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WIDESEAWCS_DTO.PackInfo
{
    /// <summary>
    /// MES成品入库接收实体
    /// </summary>
    public class MESProPackInfoDTO
    {
        /// <summary>
        /// ç‰©æ–™æ¡ç 
        /// </summary>
        public string BarCode { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary
        public string MaterialCode { get; set; }
        /// <summary>
        /// å·¥å•号
        /// </summary>
        public string ProductOrderNo { get; set; }
        /// <summary>
        /// åŠ å·¥ä¸­å¿ƒç¼–ç (机台)
        /// </summary>
        public string MakeCode { get; set; }
        /// <summary>
        /// ç®±é•¿
        /// </summary>
        public decimal Length { get; set; }
        /// <summary>
        /// ç®±å®½
        /// </summary>
        public decimal Width { get; set; }
        /// <summary>
        /// ç®±é«˜
        /// </summary>
        public decimal Height { get; set; }
        /// <summary>
        /// çŠ¶æ€
        /// </summary>
        public int MESProInStatus { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_DTO/WIDESEAWCS_DTO.csproj
@@ -10,8 +10,4 @@
      <ProjectReference Include="..\WIDESEAWCS_Model\WIDESEAWCS_Model.csproj" />
    </ItemGroup>
    <ItemGroup>
      <Folder Include="BasicInfo\" />
    </ItemGroup>
</Project>
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackTypeRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackTypeRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ¸´ÖÆ
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_IPackInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IPackTypeRepository : IRepository<Dt_PackType>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackaxisRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackaxisRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ¸´ÖÆ
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_IPackInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IPackaxisRepository : IRepository<Dt_Packaxis>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackinfoRepository.cs
ÎļþÃû´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ÐÞ¸Ä
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_IPackInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IPackinfoRepository : IRepository<Dt_Packinfo>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackinfo_HtyRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IPackinfo_HtyRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ¸´ÖÆ
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_IPackInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IPackinfo_HtyRepository : IRepository<Dt_Packinfo_Hty>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IStationPackDetailRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IStationPackDetailRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ¸´ÖÆ
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_IPackInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IStationPackDetailRepository : IRepository<Dt_StationPackDetail>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IStationPackInfoRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IStationPackInfoRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ¸´ÖÆ
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_IPackInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IStationPackInfoRepository : IRepository<Dt_StationPackInfo>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackaxisService.cs
ÎļþÃû´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs ÐÞ¸Ä
@@ -6,9 +6,9 @@
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_PackInfoService
namespace WIDESEAWCS_IPackInfoService
{
    public interface IDt_PackaxisService : IService<Dt_Packaxis>
    public interface IPackaxisService : IService<Dt_Packaxis>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_DTO.PackInfo;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_IPackInfoService
{
    public interface IPackinfoService : IService<Dt_Packinfo>
    {
        /// <summary>
        /// æŽ¥æ”¶MES成品码垛
        /// </summary>
        /// <returns></returns>
        WebResponseContent ReceivePackaxisTask(List<MESProPackInfoDTO> mESProPackInfoDTOs);
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackinfo_HtyService.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IPackinfo_HtyService.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs ¸´ÖÆ
@@ -6,9 +6,9 @@
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_PackInfoService
namespace WIDESEAWCS_IPackInfoService
{
    public interface IDt_PackaxisService : IService<Dt_Packaxis>
    public interface IPackinfo_HtyService : IService<Dt_Packinfo_Hty>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IStationPackDetailService.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IStationPackDetailService.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs ¸´ÖÆ
@@ -6,9 +6,9 @@
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_PackInfoService
namespace WIDESEAWCS_IPackInfoService
{
    public interface IDt_PackaxisService : IService<Dt_Packaxis>
    public interface IStationPackDetailService : IService<Dt_StationPackDetail>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IStationPackInfoService.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IStationPackInfoService.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs ¸´ÖÆ
@@ -6,9 +6,9 @@
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_PackInfoService
namespace WIDESEAWCS_IPackInfoService
{
    public interface IDt_PackaxisService : IService<Dt_Packaxis>
    public interface IStationPackInfoService : IService<Dt_StationPackInfo>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_ITaskInfoRepository/IPackaxisTaskRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_ITaskInfoRepository
{
    public interface IPackaxisTaskRepository : IRepository<Dt_PackaxisTask>
    {
        int GetTaskNum(string sequenceName);
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_ITaskInfoRepository/IPackaxisTask_HtyRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_ITaskInfoRepository/IPackaxisTask_HtyRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ¸´ÖÆ
@@ -6,9 +6,10 @@
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_IPackInfoRepository
namespace WIDESEAWCS_ITaskInfoRepository
{
    public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis>
    public interface IPackaxisTask_HtyRepository : IRepository<Dt_PackaxisTask_Hty>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/IPackaxisTaskService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_ITaskInfoService
{
    public interface IPackaxisTaskService : IService<Dt_PackaxisTask>
    {
        WebResponseContent ReqPackTask(string barCode, string deviceCode);
        WebResponseContent TaskCompleted(int taskNum=0,Dt_PackaxisTask? packaxisTask=null);
        WebResponseContent BoxingInBound(string stationCode);
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/IPackaxisTask_HtyService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_ITaskInfoService
{
    public interface IPackaxisTask_HtyService : IService<Dt_PackaxisTask_Hty>
    {
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_ITaskInfoService/ITaskService.cs
@@ -224,12 +224,6 @@
        /// <param name="agvFinishDTO"></param>
        /// <returns></returns>
        WebResponseContent AGVFinish(AgvFinishDTO agvFinishDTO);
        /// <summary>
        /// AGV任务状态刷新
        /// </summary>
        /// <param name="agvUpdateModel"></param>
        /// <returns></returns>
        AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel);
        /// <summary>
        /// æ›´æ–°ä»»åŠ¡ä¿¡æ¯åŠæ·»åŠ ä»»åŠ¡æ˜Žç»†è®°å½•
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_PackType.cs
@@ -20,19 +20,19 @@
        /// <summary>
        /// ç åž›åž›åž‹é•¿åº¦
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "码垛垛型长度")]
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛垛型长度")]
        public int PackLength { get; set; }
        /// <summary>
        /// ç åž›åž›åž‹å®½åº¦
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "码垛垛型宽度")]
        public string PackWidth { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛垛型宽度")]
        public int PackWidth { get; set; }
        /// <summary>
        /// ç åž›åž›åž‹é«˜åº¦
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "码垛垛型高度")]
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛垛型高度")]
        public int PackHeight { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_Packaxis.cs
@@ -8,7 +8,7 @@
namespace WIDESEAWCS_Model.Models
{
    [SugarTable(nameof(Dt_Packaxis), "码垛坐标")]
    [SugarTable(nameof(Dt_Packaxis), "码垛坐标表")]
    public class Dt_Packaxis : BaseEntity
    {
        /// <summary>
@@ -26,14 +26,14 @@
        /// <summary>
        /// ç«™å°ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "站台编号")]
        public int StationCode { get; set; }
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "站台编号")]
        public string StationCode { get; set; }
        /// <summary>
        /// åž›åž‹
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "垛型")]
        public string PackType { get; set; }
        [SugarColumn(IsNullable = false, ColumnDescription = "垛型")]
        public int PackType { get; set; }
        /// <summary>
        /// ç åž›æ•°é‡
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_Packinfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,73 @@
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_Packinfo), "待码垛信息表")]
    public class Dt_Packinfo : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int id { get; set; }
        /// <summary>
        /// ç®±ç 
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "箱码")]
        public string BarCode { get; set; }
        /// <summary>
        /// åž›åž‹
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "垛型")]
        public int PackType { get; set; }
        /// <summary>
        /// ç åž›å·¥å•号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "码垛工单号")]
        public string OrderNo { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "码垛物料编号")]
        public string MaterialCode { get; set; }
        /// <summary>
        /// åŠ å·¥ä¸­å¿ƒç¼–ç (机台)
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "加工中心编码(机台)")]
        public string MakeCode { get; set; }
        /// <summary>
        /// ç åž›çŠ¶æ€
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛状态")]
        public int PackStatus { get; set; }
        /// <summary>
        /// ç®±é•¿
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "箱长")]
        public int Length { get; set; }
        /// <summary>
        /// ç®±å®½
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "箱宽")]
        public int Width { get; set; }
        /// <summary>
        /// ç®±é«˜
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "箱高")]
        public int Height { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_Packinfo_Hty.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
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
{
    public class Dt_Packinfo_Hty : Dt_Packinfo, IBaseHistoryEntity
    {
        public int SourceId { get; set; }
        public string OperateType { get; set; }
        public DateTime InsertTime { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackDetail.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
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_StationPackDetail), "码垛工位执行明细表")]
    public class Dt_StationPackDetail : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int id { get; set; }
        /// <summary>
        /// ç åž›å·¥ä½æ‰§è¡ŒId
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛工位执行Id")]
        public int StationPackId { get; set; }
        /// <summary>
        /// ç®±ç 
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "箱码")]
        public string BoxCode { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/PackInfo/Dt_StationPackInfo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
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_StationPackInfo), "码垛工位执行信息表")]
    public class Dt_StationPackInfo : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int id { get; set; }
        /// <summary>
        /// ç«™å°ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "站台编号")]
        public string StationCode { get; set; }
        /// <summary>
        /// è¾“送口编号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "输送口编号")]
        public string LineCode { get; set; }
        /// <summary>
        /// ç åž›æœºæ¢°æ‰‹ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "码垛机械手编号")]
        public string CraneCode { get; set; }
        /// <summary>
        /// åž›åž‹
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "垛型")]
        public int PackType { get; set; }
        /// <summary>
        /// ç åž›å·¥å•号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "码垛工单号")]
        public string OrderNo { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–号
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "码垛物料编号")]
        public string MaterielCode { get; set; }
        /// <summary>
        /// åŠ å·¥ä¸­å¿ƒç¼–ç (机台)
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "加工中心编码(机台)")]
        public string MakeCode { get; set; }
        /// <summary>
        /// ç åž›ç»“托数量
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛结托数量")]
        public int PackNum { get; set; }
        /// <summary>
        /// ç åž›å·²åˆ†é…æ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛已分配数量")]
        public int AssignNum { get; set; }
        /// <summary>
        /// ç åž›æ‰§è¡Œä¸­æ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛执行中数量")]
        public int ExecutingNum { get; set; }
        /// <summary>
        /// ç åž›å·²å®Œæˆæ•°é‡
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛已完成数量")]
        public int OverNum { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Model/Models/TaskInfo/Dt_PackaxisTask.cs
@@ -22,6 +22,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Attributes;
using WIDESEAWCS_Core.DB.Models;
@@ -43,7 +44,7 @@
        /// </summary>
        [ImporterHeader(Name = "码垛任务号")]
        [ExporterHeader(DisplayName = "码垛任务号")]
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛任务号")]
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛任务号"), Sequence(nameof(SequenceEnum.SeqPackTaskNum), 100000000)]
        public int PackTaskNum { get; set; }
        /// <summary>
@@ -52,7 +53,7 @@
        [ImporterHeader(Name = "箱码")]
        [ExporterHeader(DisplayName = "箱码")]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "箱码")]
        public string BoxCode { get; set; }
        public string BarCode { get; set; }
        /// <summary>
        /// è®¾å¤‡ç¼–号
@@ -109,11 +110,11 @@
        public string NextAddress { get; set; }
        /// <summary>
        /// ç®±ç±»åž‹
        /// åž›åž‹
        /// </summary>
        [ImporterHeader(Name = "箱类型")]
        [ExporterHeader(DisplayName = "箱类型")]
        [SugarColumn(IsNullable = false, ColumnDescription = "箱类型")]
        [ImporterHeader(Name = "垛型")]
        [ExporterHeader(DisplayName = "垛型")]
        [SugarColumn(IsNullable = false, ColumnDescription = "垛型")]
        public int PackType { get; set; }
        /// <summary>
@@ -123,5 +124,22 @@
        [ExporterHeader(DisplayName = "任务下发时间")]
        [SugarColumn(IsNullable = true, ColumnDescription = "任务下发时间")]
        public DateTime? Dispatchertime { get; set; }
        /// <summary>
        /// ç åž›åž›åž‹é•¿åº¦
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛垛型长度")]
        public int PackLength { get; set; }
        /// <summary>
        /// ç åž›åž›åž‹å®½åº¦
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛垛型宽度")]
        public int PackWidth { get; set; }
        /// <summary>
        /// ç åž›åž›åž‹é«˜åº¦
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "码垛垛型高度")]
        public int PackHeight { get; set; }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackTypeRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackTypeRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs ¸´ÖÆ
@@ -9,9 +9,9 @@
namespace WIDESEAWCS_PackInfoRepository
{
    public class Dt_PackaxisRepository : RepositoryBase<Dt_Packaxis>, IDt_PackaxisRepository
    public class PackTypeRepository : RepositoryBase<Dt_PackType>, IPackTypeRepository
    {
        public Dt_PackaxisRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        public PackTypeRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackaxisRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackaxisRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs ¸´ÖÆ
@@ -9,9 +9,9 @@
namespace WIDESEAWCS_PackInfoRepository
{
    public class Dt_PackaxisRepository : RepositoryBase<Dt_Packaxis>, IDt_PackaxisRepository
    public class PackaxisRepository : RepositoryBase<Dt_Packaxis>, IPackaxisRepository
    {
        public Dt_PackaxisRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        public PackaxisRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/PackinfoRepository.cs
ÎļþÃû´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs ÐÞ¸Ä
@@ -9,9 +9,9 @@
namespace WIDESEAWCS_PackInfoRepository
{
    public class Dt_PackaxisRepository : RepositoryBase<Dt_Packaxis>, IDt_PackaxisRepository
    public class PackinfoRepository : RepositoryBase<Dt_Packinfo>, IPackinfoRepository
    {
        public Dt_PackaxisRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        public PackinfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Packinfo_HtyRepository.cs
copy from "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs" copy to "\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Packinfo_HtyRepository.cs"
Îļþ´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/Dt_PackaxisRepository.cs ¸´ÖÆ
@@ -9,9 +9,9 @@
namespace WIDESEAWCS_PackInfoRepository
{
    public class Dt_PackaxisRepository : RepositoryBase<Dt_Packaxis>, IDt_PackaxisRepository
    public class Packinfo_HtyRepository : RepositoryBase<Dt_Packinfo_Hty>, IPackinfo_HtyRepository
    {
        public Dt_PackaxisRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        public Packinfo_HtyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/StationPackDetailRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_PackInfoRepository
{
    public class StationPackDetailRepository : RepositoryBase<Dt_StationPackDetail>, IStationPackDetailRepository
    {
        public StationPackDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoRepository/StationPackInfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_PackInfoRepository
{
    public class StationPackInfoRepository : RepositoryBase<Dt_StationPackInfo>, IStationPackInfoRepository
    {
        public StationPackInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoService/PackaxisService.cs
ÎļþÃû´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoService/Dt_PackaxisService.cs ÐÞ¸Ä
@@ -11,17 +11,16 @@
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_PackInfoRepository;
using Magicodes.ExporterAndImporter.Core.Models;
using Magicodes.ExporterAndImporter.Excel;
using WIDESEAWCS_Common.Utilities;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IPackInfoService;
namespace WIDESEAWCS_PackInfoService
{
    public class Dt_PackaxisService : ServiceBase<Dt_Packaxis, IDt_PackaxisRepository>, IDt_PackaxisService
    public class PackaxisService : ServiceBase<Dt_Packaxis, IPackaxisRepository>, IPackaxisService
    {
        public Dt_PackaxisService(IDt_PackaxisRepository BaseDal) : base(BaseDal)
        public PackaxisService(IPackaxisRepository BaseDal) : base(BaseDal)
        {
        }
        public override WebResponseContent Import(List<IFormFile> files)
@@ -71,7 +70,7 @@
                    string id = row["id"]?.ToString() ?? string.Empty;
                    string DeviceCode = row["DeviceCode"]?.ToString() ?? string.Empty;
                    string StationCode = row["StationCode"]?.ToString() ?? string.Empty;
                    string PackType = row["PackType"]?.ToString() ?? string.Empty;
                    int PackType = row["PackType"].ObjToInt();
                    string PackNum = row["PackNum"]?.ToString() ?? string.Empty;
                    string AxisX = row["AxisX"]?.ToString() ?? string.Empty;
                    string AxisXCount = row["AxisXCount"]?.ToString() ?? string.Empty;
@@ -82,13 +81,13 @@
                    string AxisZ = row["AxisZ"]?.ToString() ?? string.Empty;
                    string AxisZCount = row["AxisZCount"]?.ToString() ?? string.Empty;
                    string AxisZSpacing = row["AxisZSpacing"]?.ToString() ?? string.Empty;
                    var axis = BaseDal.QueryFirst(x => x.DeviceCode == DeviceCode && x.StationCode == Convert.ToInt32(StationCode) && x.PackType == PackType);
                    var axis = BaseDal.QueryFirst(x => x.DeviceCode == DeviceCode && x.StationCode == StationCode && x.PackType == PackType);
                    if(axis == null)
                    {
                        Dt_Packaxis packaxis = new Dt_Packaxis()
                        {
                            DeviceCode = DeviceCode,
                            StationCode = Convert.ToInt32(StationCode),
                            StationCode = StationCode,
                            PackType = PackType,
                            PackNum = Convert.ToInt32(PackNum),
                            AxisX = Convert.ToInt32(AxisX),
@@ -108,7 +107,7 @@
                    else
                    {
                        axis.DeviceCode = DeviceCode;
                        axis.StationCode = Convert.ToInt32(StationCode);
                        axis.StationCode = StationCode;
                        axis.PackType = PackType;
                        axis.PackNum = Convert.ToInt32(PackNum);
                        axis.AxisX = Convert.ToInt32(AxisX);
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoService/PackinfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
using Magicodes.ExporterAndImporter.Excel.Utility;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_Common.Utilities;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IPackInfoService;
using WIDESEAWCS_DTO.PackInfo;
using AutoMapper;
namespace WIDESEAWCS_PackInfoService
{
    public class PackinfoService : ServiceBase<Dt_Packinfo, IPackinfoRepository>, IPackinfoService
    {
        private readonly IMapper _mapper;
        private readonly IPackTypeRepository _typeRepository;
        public PackinfoService(IPackinfoRepository BaseDal,IMapper mapper, IPackTypeRepository typeRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _typeRepository = typeRepository;
        }
        /// <summary>
        /// æŽ¥æ”¶MES成品码垛
        /// </summary>
        /// <returns></returns>
        public WebResponseContent ReceivePackaxisTask(List<MESProPackInfoDTO> mESProPackInfoDTOs)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                List<Dt_PackType> packTypes = _typeRepository.QueryData();
                List<Dt_Packinfo> packinfos = new List<Dt_Packinfo>();
                foreach (var item in mESProPackInfoDTOs)
                {
                    Dt_PackType? packType = packTypes.FirstOrDefault(x=>x.PackWidth==item.Width && x.PackLength==item.Length && x.PackHeight==item.Height);
                    if (packType == null) throw new Exception($"未找到条码{item.BarCode},{item.Length}*{item.Width}*{item.Height}码垛配置");
                    Dt_Packinfo packinfo = _mapper.Map<Dt_Packinfo>(item);
                    packinfo.PackType = packType.id;
                    packinfos.Add(packinfo);
                }
                BaseDal.AddData(packinfos);
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoService/Packinfo_HtyService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
using Magicodes.ExporterAndImporter.Excel.Utility;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_Common.Utilities;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IPackInfoService;
namespace WIDESEAWCS_PackInfoService
{
    public class Packinfo_HtyService : ServiceBase<Dt_Packinfo_Hty, IPackinfo_HtyRepository>, IPackinfo_HtyService
    {
        public Packinfo_HtyService(IPackinfo_HtyRepository BaseDal) : base(BaseDal)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoService/StationPackDetailService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
using Magicodes.ExporterAndImporter.Excel.Utility;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_Common.Utilities;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IPackInfoService;
namespace WIDESEAWCS_PackInfoService
{
    public class StationPackDetailService : ServiceBase<Dt_StationPackDetail, IStationPackDetailRepository>, IStationPackDetailService
    {
        public StationPackDetailService(IStationPackDetailRepository BaseDal) : base(BaseDal)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_PackInfoService/StationPackInfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
using Magicodes.ExporterAndImporter.Excel.Utility;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_Common.Utilities;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IPackInfoService;
namespace WIDESEAWCS_PackInfoService
{
    public class StationPackInfoService : ServiceBase<Dt_StationPackInfo, IStationPackInfoRepository>, IStationPackInfoService
    {
        public StationPackInfoService(IStationPackInfoRepository BaseDal) : base(BaseDal)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
@@ -244,7 +244,7 @@
                        }
                        else
                        {
                            if (task.TaskType == TaskTypeEnum.PrintYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.PrintYLBackInbound.ObjToInt())
                            if (task.TaskType == TaskTypeEnum.PrintYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.PrintYLBackInbound.ObjToInt() || task.TaskType == TaskTypeEnum.EmptyPaletteBack.ObjToInt())
                            {
                                var content = TakeFinish(task.CurrentAddress);
                                if (!content.Status)
@@ -346,7 +346,7 @@
                    MESResponse response = _taskService.MESAvgArriveNotice(requestAGVArriveDTO).DeserializeObject<MESResponse>() ?? throw new Exception("未获取到返回信息");
                    if (!response.Result)
                    {
                        throw new Exception($"调用MES小车允许放货报错,MES返回信息"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match => {
                        throw new Exception($"调用MES小车允许放货报错,MES返回信息"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match =>{
                            return ((char)Convert.ToInt32(match.Groups[1].Value, 16)).ToString();
                        }));
                    }
@@ -435,23 +435,24 @@
                            return content.Error("禁止放料");
                        }
                    }
                    else if (device.DeviceCode.Contains("TrussCarton"))//桁架
                    else if (device.DeviceCode.Contains("TrussDixieCup"))//桁架
                    {
                        bool RequestPut = otherDevice.GetValue<W_TrussCartonDB, bool>(GetCartonRequest(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                        if (!RequestPut)
                        {
                            otherDevice.SetValue(GetCartonRequest(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                            Thread.Sleep(1000);
                        }
                        bool AllowFinish = otherDevice.GetValue<R_TrussCartonDB, bool>(GetCarton(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                        if (AllowFinish)
                        {
                            content.OK("允许放料");
                        }
                        else
                        {
                            return content.Error("禁止放料");
                        }
                            bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                            if (!RequestPut)
                            {
                                otherDevice.SetValue(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                                Thread.Sleep(1000);
                            }
                            bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupPutOut(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                            if (AllowFinish)
                            {
                                content.OK("允许放料");
                            }
                            else
                            {
                                return content.Error("禁止放料");
                            }
                    }
                }
                return content;
@@ -500,9 +501,9 @@
                    {
                        otherDevice.SetValue(RetractDB.Ret_PutFinish, true, stationManger.StationDeviceCode);
                    }
                    else if (device.DeviceCode.Contains("TrussCarton"))//纸箱桁架
                    else if (device.DeviceCode.Contains("TrussDixieCup"))//纸杯桁架
                    {
                        otherDevice.SetValue(GetCartonPut(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                        otherDevice.SetValue(GetTrussDixieCupPuted(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                    }
                }
                return WebResponseContent.Instance.OK();
@@ -515,45 +516,75 @@
        /// <summary>
        /// èŽ·å–æ¡æž¶æ”¾æ–™ä¿¡å·
        /// </summary>
        private W_TrussCartonDB GetCartonPut(string StationCode)
        private W_TrussDixieCupDB GetTrussDixieCupPuted(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return W_TrussCartonDB.W_CartonPut1;
                    return W_TrussDixieCupDB.W_DixieCupPuted1;
                case "2":
                    return W_TrussCartonDB.W_CartonPut2;
                    return W_TrussDixieCupDB.W_DixieCupPuted2;
                case "3":
                    return W_TrussCartonDB.W_CartonPut3;
                    return W_TrussDixieCupDB.W_DixieCupPuted3;
                case "4":
                    return W_TrussCartonDB.W_CartonPut4;
                case "5":
                    return W_TrussCartonDB.W_CartonPut5;
                case "6":
                    return W_TrussCartonDB.W_CartonPut6;
                    return W_TrussDixieCupDB.W_DixieCupPuted4;
                default:
                    throw new Exception("未定义工位");
            }
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶è¯·æ±‚ä¿¡å·
        /// èŽ·å–æ¡æž¶å–æ–™æ–™ä¿¡å·
        /// </summary>
        private W_TrussCartonDB GetCartonRequest(string StationCode)
        private W_TrussDixieCupDB GetTrussDixieCupTaked(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return W_TrussCartonDB.W_CartonRequest1;
                    return W_TrussDixieCupDB.W_DixieCupTaked1;
                case "2":
                    return W_TrussCartonDB.W_CartonRequest2;
                    return W_TrussDixieCupDB.W_DixieCupTaked2;
                case "3":
                    return W_TrussCartonDB.W_CartonRequest3;
                    return W_TrussDixieCupDB.W_DixieCupTaked3;
                case "4":
                    return W_TrussCartonDB.W_CartonRequest4;
                case "5":
                    return W_TrussCartonDB.W_CartonRequest5;
                case "6":
                    return W_TrussCartonDB.W_CartonRequest6;
                    return W_TrussDixieCupDB.W_DixieCupTaked4;
                default:
                    throw new Exception("未定义工位");
            }
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶è¯·æ±‚è¿›ä¿¡å·
        /// </summary>
        private W_TrussDixieCupDB GetTrussDixieCupOutReq(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return W_TrussDixieCupDB.W_DixieCupReqPut1;
                case "2":
                    return W_TrussDixieCupDB.W_DixieCupReqPut2;
                case "3":
                    return W_TrussDixieCupDB.W_DixieCupReqPut3;
                case "4":
                    return W_TrussDixieCupDB.W_DixieCupReqPut4;
                default:
                    throw new Exception("未定义工位");
            }
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶è¯·æ±‚è¿›ä¿¡å·
        /// </summary>
        private W_TrussDixieCupDB GetTrussDixieCupInReq(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return W_TrussDixieCupDB.W_DixieCupReqTake1;
                case "2":
                    return W_TrussDixieCupDB.W_DixieCupReqTake2;
                case "3":
                    return W_TrussDixieCupDB.W_DixieCupReqTake3;
                case "4":
                    return W_TrussDixieCupDB.W_DixieCupReqTake4;
                default:
                    throw new Exception("未定义工位");
            }
@@ -562,22 +593,37 @@
        /// <summary>
        /// èŽ·å–æ¡æž¶è¿›å…¥ä¿¡å·
        /// </summary>
        private R_TrussCartonDB GetCarton(string StationCode)
        private R_TrussDixieCupDB GetDixieCupPutOut(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return R_TrussCartonDB.R_CartonAllow1;
                    return R_TrussDixieCupDB.R_DixieCupPutOut1;
                case "2":
                    return R_TrussCartonDB.R_CartonAllow2;
                    return R_TrussDixieCupDB.R_DixieCupPutOut2;
                case "3":
                    return R_TrussCartonDB.R_CartonAllow3;
                    return R_TrussDixieCupDB.R_DixieCupPutOut3;
                case "4":
                    return R_TrussCartonDB.R_CartonAllow4;
                case "5":
                    return R_TrussCartonDB.R_CartonAllow5;
                case "6":
                    return R_TrussCartonDB.R_CartonAllow6;
                    return R_TrussDixieCupDB.R_DixieCupPutOut4;
                default:
                    throw new Exception("未定义工位");
            }
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶è¿›å…¥ä¿¡å·
        /// </summary>
        private R_TrussDixieCupDB GetDixieCupTakeIn(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return R_TrussDixieCupDB.R_DixieCupTakeIn1;
                case "2":
                    return R_TrussDixieCupDB.R_DixieCupTakeIn2;
                case "3":
                    return R_TrussDixieCupDB.R_DixieCupTakeIn3;
                case "4":
                    return R_TrussDixieCupDB.R_DixieCupTakeIn4;
                default:
                    throw new Exception("未定义工位");
            }
@@ -659,6 +705,24 @@
                            return content.Error("禁止取料");
                        }
                    }
                    else if (device.DeviceCode.Contains("TrussDixieCup"))
                    {
                        bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupInReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                        if (!RequestPut)
                        {
                            otherDevice.SetValue(GetTrussDixieCupInReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                            Thread.Sleep(1000);
                        }
                        bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupTakeIn(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
                        if (AllowFinish)
                        {
                            content.OK("允许取料");
                        }
                        else
                        {
                            return content.Error("禁止取料");
                        }
                    }
                }
                return content;
            }
@@ -709,6 +773,10 @@
                    {
                        otherDevice.SetValue(RetractDB.Ret_TakeFinish, true, stationManger.StationDeviceCode);
                    }
                    else if (device.DeviceCode.Contains("TrussDixieCup"))//纸杯桁架
                    {
                        otherDevice.SetValue(GetTrussDixieCupTaked(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
                    }
                }
                return WebResponseContent.Instance.OK();
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/PackInfo/PackaxisController.cs
@@ -7,20 +7,19 @@
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IPackInfoService;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_PackInfoService;
using WIDESEAWCS_Tasks;
namespace WIDESEAWCS_WCSServer.Controllers.PackInfo
{
    [Route("api/Packaxis")]
    [ApiController]
    public class PackaxisController : ApiBaseController<IDt_PackaxisService, Dt_Packaxis>
    public class PackaxisController : ApiBaseController<IPackaxisService, Dt_Packaxis>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public PackaxisController(IDt_PackaxisService service, IHttpContextAccessor httpContextAccessor) : base(service)
        public PackaxisController(IPackaxisService service, IHttpContextAccessor httpContextAccessor) : base(service)
        {
            _httpContextAccessor = httpContextAccessor;
        }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/PackInfo/PackinfoController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
using HslCommunication.WebSocket;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.PackInfo;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IPackInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_WCSServer.Controllers.PackInfo
{
    [Route("api/Packinfo")]
    [ApiController]
    public class PackinfoController : ApiBaseController<IPackinfoService, Dt_Packinfo>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public PackinfoController(IPackinfoService service, IHttpContextAccessor httpContextAccessor) : base(service)
        {
            _httpContextAccessor = httpContextAccessor;
        }
        [HttpPost, HttpGet, Route("ReceivePackaxisTask"), AllowAnonymous]
        public WebResponseContent ReceivePackaxisTask([FromBody] List<MESProPackInfoDTO> mESProPackInfoDTOs)
        {
            return Service.ReceivePackaxisTask(mESProPackInfoDTOs);
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Controllers/Task/PackaxisTaskController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfo_HtyService;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_WCSServer.Controllers.Task
{
    [Route("api/PackaxisTask")]
    [ApiController]
    public class PackaxisTaskController : ApiBaseController<IPackaxisTaskService, Dt_PackaxisTask>
    {
        private readonly IHttpContextAccessor _httpContextAccessor;
        public PackaxisTaskController(IPackaxisTaskService service, IHttpContextAccessor httpContextAccessor) : base(service)
        {
            _httpContextAccessor = httpContextAccessor;
        }
        [HttpPost, HttpGet,Route("PackTaskCompleted"), AllowAnonymous]
        public WebResponseContent PackTaskCompleted(int taskNum)
        {
            return Service.TaskCompleted(taskNum);
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Server/Filter/CustomProfile.cs
@@ -5,6 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.System;
using WIDESEAWCS_DTO.PackInfo;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob.DTO;
@@ -30,6 +31,8 @@
                .ForMember(a => a.Width, b => b.MapFrom(b => b.TaskLength))
                .ForMember(a => a.Height, b => b.MapFrom(b => b.HeightType))
                .ForMember(a => a.TargetAddress, b => b.MapFrom(b => b.NextAddress));
            CreateMap<MESProPackInfoDTO, Dt_Packinfo>()
                .ForMember(a => a.PackStatus, b => b.MapFrom(b => b.MESProInStatus)).ForMember(a => a.OrderNo, b => b.MapFrom(b => b.ProductOrderNo));
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoRepository/PackaxisTaskRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_TaskInfoRepository
{
    public class PackaxisTaskRepository : RepositoryBase<Dt_PackaxisTask>, IPackaxisTaskRepository
    {
        public PackaxisTaskRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
        static object lock_taskNum = new object();
        public int GetTaskNum(string sequenceName)
        {
            lock (lock_taskNum)
            {
                return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
            }
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoRepository/PackaxisTask_HtyRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_TaskInfoRepository
{
    public class PackaxisTask_HtyRepository : RepositoryBase<Dt_PackaxisTask_Hty>, IPackaxisTask_HtyRepository
    {
        public PackaxisTask_HtyRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/InvokeAGVService.cs
@@ -70,15 +70,5 @@
            }
            return content;
        }
        /// <summary>
        /// AGV任务状态刷新/AGV任务完成
        /// </summary>
        /// <param name="agvUpdateModel"></param>
        /// <returns></returns>
        public AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel)
        {
            return new AgvResponseContent();
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTaskService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,232 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseRepository;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_IPackInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_TaskInfoService
{
    public class PackaxisTaskService : ServiceBase<Dt_PackaxisTask, IPackaxisTaskRepository>, IPackaxisTaskService
    {
        private readonly IPackinfoRepository _packinfoRepository;
        private readonly IStationPackInfoRepository _stationPackInfoRepository;
        private readonly IStationPackDetailRepository _stationPackDetailRepository;
        private readonly IPackaxisRepository _packaxisRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        public PackaxisTaskService(IPackaxisTaskRepository BaseDal,IPackinfoRepository packinfoRepository, IStationPackInfoRepository stationPackInfoRepository, IStationPackDetailRepository stationPackDetailRepository, IPackaxisRepository packaxisRepository, IStationMangerRepository stationMangerRepository, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
        {
            _packinfoRepository = packinfoRepository;
            _stationPackInfoRepository = stationPackInfoRepository;
            _stationPackDetailRepository = stationPackDetailRepository;
            _packaxisRepository = packaxisRepository;
            _stationMangerRepository = stationMangerRepository;
            _unitOfWorkManage = unitOfWorkManage;
        }
        public WebResponseContent ReqPackTask(string barCode,string deviceCode)
        {
            WebResponseContent content= new WebResponseContent();
            try
            {
                Dt_Packinfo packinfo = _packinfoRepository.QueryFirst(x=>x.BarCode==barCode && x.PackStatus==StationOccupiedEnum.None.ObjToInt());
                if (packinfo==null)
                {
                    return content.Error($"未找到条码{barCode}");
                }
                List<Dt_StationPackInfo> stationPackInfos = _stationPackInfoRepository.QueryData();
                Dt_StationPackInfo? stationPackInfo=stationPackInfos.FirstOrDefault(x=>x.PackType==packinfo.PackType && x.OrderNo==packinfo.OrderNo && x.AssignNum<x.PackNum);
                //如果订单相同、垛型一致并且分配数量少于码垛结托数量则分配到一起
                if (stationPackInfo!=null)
                {
                    Dt_PackaxisTask packaxisTask = new Dt_PackaxisTask()
                    {
                        DeviceCode=deviceCode,
                        SourceAddress= "2421",
                        BarCode=barCode,
                        CurrentAddress= "2421",
                        TargetAddress=stationPackInfo.StationCode,
                        NextAddress=stationPackInfo.LineCode,
                        TaskState =TaskStatusEnum.Line_Executing.ObjToInt(),
                        PackLength=packinfo.Length,
                        PackWidth=packinfo.Width,
                        PackHeight=packinfo.Height,
                        PackType=packinfo.PackType,
                        Dispatchertime=DateTime.Now,
                    };
                    stationPackInfo.AssignNum += 1;
                    stationPackInfo.ExecutingNum += 1;
                    packinfo.PackStatus = StationOccupiedEnum.Sure.ObjToInt();
                    _unitOfWorkManage.BeginTran();
                    //更新码垛执行工位
                    _stationPackInfoRepository.UpdateData(stationPackInfo);
                    //更新待码垛信息表
                    _packinfoRepository.UpdateData(packinfo);
                    //添加码垛任务
                    BaseDal.AddData(packaxisTask);
                    _unitOfWorkManage.CommitTran();
                    return content.OK(barCode, packaxisTask);
                }
                else//分配新工位
                {
                    //获取当前空盘准备的码垛工位
                    List<string> stations = _stationMangerRepository.QueryData(x => x.StationDeviceCode == "CLC_CP" && x.IsOccupied == StationOccupiedEnum.None.ObjToInt()).Select(x => x.StationCode).ToList();
                    //获取码垛配置表查询有配置的码垛工位
                    List<Dt_Packaxis> packaxes = _packaxisRepository.QueryData(x => x.PackType == packinfo.PackType);
                    if (packaxes.Count==0)
                    {
                        return content.Error("未找到码垛坐标配置");
                    }
                    List<string> packStations = packaxes.Select(x => x.StationCode).ToList();
                    Dt_StationPackInfo? packInfoAssign = stationPackInfos.Where(x => x.PackType == 0 && x.AssignNum == 0 && stations.Contains(x.StationCode) && packStations.Contains(x.StationCode)).OrderByDescending(x => x.StationCode).FirstOrDefault();
                    if (packInfoAssign == null)
                    {
                        return content.Error("未找到可分配垛位");
                    }
                    packInfoAssign.PackType = packinfo.PackType;
                    packInfoAssign.OrderNo = packinfo.OrderNo;
                    packInfoAssign.MakeCode = packinfo.MakeCode;
                    packInfoAssign.MaterielCode = packInfoAssign.MaterielCode;
                    packInfoAssign.PackNum = packaxes.FirstOrDefault(x=>x.StationCode== packInfoAssign.StationCode).PackNum;
                    Dt_PackaxisTask packaxisTask = new Dt_PackaxisTask()
                    {
                        DeviceCode = deviceCode,
                        SourceAddress = "2421",
                        BarCode = barCode,
                        CurrentAddress = "2421",
                        TargetAddress = packInfoAssign.StationCode,
                        NextAddress = packInfoAssign.LineCode,
                        TaskState = TaskStatusEnum.Line_Executing.ObjToInt(),
                        PackLength = packinfo.Length,
                        PackWidth = packinfo.Width,
                        PackHeight = packinfo.Height,
                        PackType = packinfo.PackType,
                        Dispatchertime = DateTime.Now,
                    };
                    packInfoAssign.AssignNum += 1;
                    packInfoAssign.ExecutingNum += 1;
                    packinfo.PackStatus = StationOccupiedEnum.Sure.ObjToInt();
                    _unitOfWorkManage.BeginTran();
                    //更新码垛执行工位
                    _stationPackInfoRepository.UpdateData(packInfoAssign);
                    //更新待码垛信息表
                    _packinfoRepository.UpdateData(packinfo);
                    //添加码垛任务
                    BaseDal.AddData(packaxisTask);
                    _unitOfWorkManage.CommitTran();
                    return content.OK(barCode, packaxisTask);
                }
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
        }
        public WebResponseContent BoxingInBound(string stationCode)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StationPackInfo stationPackInfo = _stationPackInfoRepository.QueryFirst(x => x.StationCode == stationCode);
                if (stationPackInfo.OverNum != stationPackInfo.AssignNum)
                {
                    throw new Exception($"分配数量{stationPackInfo.AssignNum},完成数量{stationPackInfo.OverNum}数量不符");
                }
                List<Dt_StationPackDetail> stationPackDetails = _stationPackDetailRepository.QueryData(x => x.StationPackId == stationPackInfo.id);
                if (stationPackDetails.Count <= 0)
                {
                    throw new Exception($"{stationCode}未找到码垛明细");
                }
                List<string> barCodes = stationPackDetails.Select(x => x.BoxCode).ToList();
                List<Dt_Packinfo> packinfos = _packinfoRepository.QueryData(x => barCodes.Contains(x.BarCode)).ToList();
                stationPackInfo.PackType = 0;
                stationPackInfo.OrderNo = "";
                stationPackInfo.MakeCode = "";
                stationPackInfo.MaterielCode = "";
                stationPackInfo.PackNum = 0;
                stationPackInfo.OverNum = 0;
                stationPackInfo.AssignNum = 0;
                stationPackInfo.ExecutingNum = 0;
                _unitOfWorkManage.BeginTran();
                _stationPackInfoRepository.UpdateData(stationPackInfo);
                _stationPackDetailRepository.DeleteData(stationPackDetails);
                _packinfoRepository.DeleteAndMoveIntoHty(packinfos, App.User?.UserId == 0 ? OperateTypeEnum.自动完成 : OperateTypeEnum.人工完成);
                //同步到WMS
                string address = AppSettings.Get("WMSApiAddress");
                string response = HttpHelper.Post($"{address}/api/Task/BoxingInBound?stationCode=" + stationCode, barCodes.Serialize());
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(response) ?? throw new Exception($"未收到返回结果");
                if (!responseContent.Status)
                {
                    throw new Exception(responseContent.Message);
                }
                _unitOfWorkManage.CommitTran();
                content.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                content.Error(ex.Message);
            }
            return content;
        }
        public WebResponseContent TaskCompleted(int taskNum=0,Dt_PackaxisTask? packaxisTask=null)
        {
            try
            {
                _unitOfWorkManage.BeginTran();
                Dt_PackaxisTask? packaxisTaskFinish = null;
                if (packaxisTask!=null)
                {
                    packaxisTaskFinish= packaxisTask;
                }
                else
                {
                    packaxisTaskFinish = BaseDal.QueryFirst(x => x.PackTaskNum == taskNum);
                    packaxisTaskFinish.TaskState = TaskStatusEnum.Finish.ObjToInt();
                }
                if (packaxisTaskFinish != null)
                {
                    Dt_StationPackInfo stationPackInfo = _stationPackInfoRepository.QueryFirst(x => x.StationCode == packaxisTaskFinish.TargetAddress);
                    stationPackInfo.ExecutingNum -= 1;
                    stationPackInfo.OverNum += 1;
                    Dt_StationPackDetail stationPackDetail = new Dt_StationPackDetail()
                    {
                        StationPackId = stationPackInfo.id,
                        BoxCode = packaxisTaskFinish.BarCode
                    };
                    _stationPackInfoRepository.UpdateData(stationPackInfo);
                    _stationPackDetailRepository.AddData(stationPackDetail);
                    BaseDal.DeleteAndMoveIntoHty(packaxisTaskFinish, App.User?.UserId == 0 ? OperateTypeEnum.自动完成 : OperateTypeEnum.人工完成);
                }
                else
                {
                    return WebResponseContent.Instance.Error("未找到任务");
                }
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/PackaxisTask_HtyService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
namespace WIDESEAWCS_TaskInfoService
{
    public class PackaxisTask_HtyService : ServiceBase<Dt_PackaxisTask_Hty, IPackaxisTask_HtyRepository>, IPackaxisTask_HtyService
    {
        public PackaxisTask_HtyService(IPackaxisTask_HtyRepository BaseDal) : base(BaseDal)
        {
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -478,9 +478,9 @@
                {
                    return WebResponseContent.Instance.Error($"未找到WMSApi地址");
                }
                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}&palletCode={palletCode}");
                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}");
                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? throw new Exception("结果返回为空");
                if (responseContent != null && responseContent.Status && responseContent.Data != null)
                if (responseContent.Status && responseContent.Data != null)
                {
                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
                    if (taskDTO != null)
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineTaskCommand.cs
@@ -160,6 +160,30 @@
            set { _barcode = value.Replace("\0", "").Replace("\\0", ""); }
        }
    }
    public class R_CLineCPHChannelInfo : DeviceCommand
    {
        /// <summary>
        /// å·¥ä½å·
        /// </summary>
        public short R_ReadID { get; set; }
        /// <summary>
        /// å·¥ä½çŠ¶æ€
        /// 0:脱机<br/>
        /// 1:手动<br/>
        /// 2:自动<br/>
        /// 3:自动运行<br/>
        /// 4:故障<br/>
        /// </summary>
        public short R_State { get; set; }
        /// <summary>
        /// ä»»åŠ¡å·
        /// </summary>
        public int R_TaskNo { get; set; }
        /// <summary>
        /// ç›®çš„地址
        /// </summary>
        public short R_TargetAddress { get; set; }
    }
    public class R_RGVCPInfo : DeviceCommand
    {
        /// <summary>
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/DBNames/TrussDBName.cs
@@ -131,4 +131,144 @@
        W_CartonRequest6
    }
    /// <summary>
    /// æ¡æž¶çº¸æ¯è¯»å–
    /// </summary>
    public enum R_TrussDixieCupDB
    {
        /// <summary>
        /// å¿ƒè·³
        /// </summary>
        R_DixieCupHeart,
        /// <summary>
        /// æŠ¥è­¦
        /// </summary>
        R_DixieCupError,
        /// <summary>
        /// ä½ç½®è¿è¡Œ
        /// </summary>
        R_DixieCupModel,
        /// <summary>
        /// 1号托盘位无料呼叫信号
        /// </summary>
        R_DixieCupCall1,
        /// <summary>
        /// 2号托盘位无料呼叫信号
        /// </summary>
        R_DixieCupCall2,
        /// <summary>
        /// 3号托盘位无料呼叫信号
        /// </summary>
        R_DixieCupCall3,
        /// <summary>
        /// 4号托盘位无料呼叫信号
        /// </summary>
        R_DixieCupCall4,
        /// <summary>
        /// 1号托盘位允许取货信号(入)
        /// </summary>
        R_DixieCupTakeIn1,
        /// <summary>
        /// 2号托盘位允许取货信号(入)
        /// </summary>
        R_DixieCupTakeIn2,
        /// <summary>
        /// 3号托盘位允许取货信号(入)
        /// </summary>
        R_DixieCupTakeIn3,
        /// <summary>
        /// 4号托盘位允许取货信号(入)
        /// </summary>
        R_DixieCupTakeIn4,
        /// <summary>
        /// 1号托盘位允许放货信号(出)
        /// </summary>
        R_DixieCupPutOut1,
        /// <summary>
        /// 2号托盘位允许放货信号(出)
        /// </summary>
        R_DixieCupPutOut2,
        /// <summary>
        /// 3号托盘位允许放货信号(出)
        /// </summary>
        R_DixieCupPutOut3,
        /// <summary>
        /// 4号托盘位允许放货信号(出)
        /// </summary>
        R_DixieCupPutOut4
    }
    /// <summary>
    /// æ¡æž¶çº¸æ¯å†™å…¥
    /// </summary>
    public enum W_TrussDixieCupDB
    {
        /// <summary>
        /// å¿ƒè·³
        /// </summary>
        W_DixieCupHeart,
        /// <summary>
        /// 1号位请求取货(入)
        /// </summary>
        W_DixieCupReqTake1,
        /// <summary>
        /// 2号位请求取货(入)
        /// </summary>
        W_DixieCupReqTake2,
        /// <summary>
        /// 3号位请求取货(入)
        /// </summary>
        W_DixieCupReqTake3,
        /// <summary>
        /// 4号位请求取货(入)
        /// </summary>
        W_DixieCupReqTake4,
        /// <summary>
        /// 1号位取货完成
        /// </summary>
        W_DixieCupTaked1,
        /// <summary>
        /// 2号位取货完成
        /// </summary>
        W_DixieCupTaked2,
        /// <summary>
        /// 3号位取货完成
        /// </summary>
        W_DixieCupTaked3,
        /// <summary>
        /// 4号位取货完成
        /// </summary>
        W_DixieCupTaked4,
        /// <summary>
        /// 1号位请求放货(出)
        /// </summary>
        W_DixieCupReqPut1,
        /// <summary>
        /// 2号位请求放货(出)
        /// </summary>
        W_DixieCupReqPut2,
        /// <summary>
        /// 3号位请求放货(出)
        /// </summary>
        W_DixieCupReqPut3,
        /// <summary>
        /// 4号位请求放货(出)
        /// </summary>
        W_DixieCupReqPut4,
        /// <summary>
        /// 1号位放货完成
        /// </summary>
        W_DixieCupPuted1,
        /// <summary>
        /// 2号位放货完成
        /// </summary>
        W_DixieCupPuted2,
        /// <summary>
        /// 3号位放货完成
        /// </summary>
        W_DixieCupPuted3,
        /// <summary>
        /// 4号位放货完成
        /// </summary>
        W_DixieCupPuted4,
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/ApartPlate.cs
@@ -25,9 +25,9 @@
        private readonly ITaskService _taskService;
        private readonly ITaskRepository _taskRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IDt_PackaxisRepository _packaxisRepository;
        private readonly IPackaxisRepository _packaxisRepository;
        public ApartPlate(ICacheService cacheService, ITaskService taskService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IDt_PackaxisRepository packaxisRepository)
        public ApartPlate(ICacheService cacheService, ITaskService taskService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IPackaxisRepository packaxisRepository)
        {
            _cacheService = cacheService;
            _taskService = taskService;
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/StackPlateJob/StackPlate.cs
@@ -25,9 +25,9 @@
        private readonly ITaskService _taskService;
        private readonly ITaskRepository _taskRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IDt_PackaxisRepository _packaxisRepository;
        private readonly IPackaxisRepository _packaxisRepository;
        public StackPlate(ICacheService cacheService, ITaskService taskService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IDt_PackaxisRepository packaxisRepository)
        public StackPlate(ICacheService cacheService, ITaskService taskService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IPackaxisRepository packaxisRepository)
        {
            _cacheService = cacheService;
            _taskService = taskService;
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj
@@ -7,8 +7,11 @@
    </PropertyGroup>
    <ItemGroup>
      <Compile Remove="AGV\**" />
      <Compile Remove="HoisterJob\**" />
      <EmbeddedResource Remove="AGV\**" />
      <EmbeddedResource Remove="HoisterJob\**" />
      <None Remove="AGV\**" />
      <None Remove="HoisterJob\**" />
    </ItemGroup>
@@ -19,10 +22,6 @@
    <ItemGroup>
        <ProjectReference Include="..\WIDESEAWCS_TaskInfoService\WIDESEAWCS_TaskInfoService.csproj" />
    </ItemGroup>
    <ItemGroup>
      <Folder Include="AGV\" />
    </ItemGroup>
</Project>
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPB.cs
@@ -223,7 +223,14 @@
                                {
                                    //请求任务
                                    WebResponseContent content = _taskService.RequestPlateOutTask(item.StationCode);
                                    WriteInfo(item.StationName, $"二楼空托叠盘出库任务生成");
                                    if (content.Status)
                                    {
                                        WriteInfo(item.StationName, $"二楼空托叠盘出库任务生成");
                                    }
                                    else
                                    {
                                        WriteInfo(item.StationName, $"{content.Message}");
                                    }
                                }
                            }
                            //叠盘任务完成交互
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPH.cs
@@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Components.Routing;
using Autofac.Core;
using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using Org.BouncyCastle.Asn1.Ocsp;
using Org.BouncyCastle.Tls;
using Quartz;
using System;
@@ -25,6 +27,7 @@
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_TaskInfoRepository;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
@@ -42,13 +45,11 @@
        private readonly IRouterService _routerService;
        private readonly IRouterExtension _routerExtension;
        private readonly List<Dt_WarehouseDevice> warehouseDevices;
        private readonly IPackaxisTaskRepository _packaxisTaskRepository;
        private readonly IPackaxisTaskService _packaxisTaskService;
        private static object lockObj = 0;//
        private static int Channel = 0;
        private static int Long = 0;
        private static int Wide = 0;
        private static int High = 0;
        public ConveyorLineJob_CPH(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
        public ConveyorLineJob_CPH(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension, IPackaxisTaskRepository packaxisTaskRepository, IPackaxisTaskService packaxisTaskService)
        {
            _cacheService = cacheService;
            _taskService = taskService;
@@ -58,13 +59,6 @@
            _routerRepository = routerRepository;
            _routerService = routerService;
            _routerExtension = routerExtension;
            if (!AppSettings.Get("Channel").IsNullOrEmpty())
            {
                Channel = AppSettings.Get("Channel").ObjToInt();
                Long= AppSettings.Get("Long").ObjToInt();
                Wide = AppSettings.Get("Wide").ObjToInt();
                High = AppSettings.Get("High").ObjToInt();
            }
            string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice));
            if (!string.IsNullOrEmpty(warehouseDevicesStr))
            {
@@ -74,6 +68,8 @@
            {
                warehouseDevices = new List<Dt_WarehouseDevice>();
            }
            _packaxisTaskRepository = packaxisTaskRepository;
            _packaxisTaskService = packaxisTaskService;
        }
        public Task Execute(IJobExecutionContext context)
@@ -83,85 +79,155 @@
                if (lockObj.ToString()=="0")
                {
                    lockObj = 1;
                    Task task = Task.Run(async () =>
                    bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
                    if (flag && value != null)
                    {
                        try
                        {
                            bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
                            if (flag && value != null)
                            //获取当前设备
                            OtherDevice device = (OtherDevice)value;
                            List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                            Task.Run(() =>
                            {
                                //获取当前设备
                                OtherDevice device = (OtherDevice)value;
                                List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                                Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt());
                                while (true)
                                try
                                {
                                    if (RequestIn != null)
                                    Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt());
                                    while (true)
                                    {
                                        DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == RequestIn.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                                        DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == RequestIn.StationCode && x.DeviceProParamType == nameof(W_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                                        if (deviceProRead != null && deviceProWrite != null)
                                        if (RequestIn != null)
                                        {
                                            R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress);
                                            //码垛环线请求任务
                                            if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1)
                                            DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == RequestIn.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                                            DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == RequestIn.StationCode && x.DeviceProParamType == nameof(W_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                                            if (deviceProRead != null && deviceProWrite != null)
                                            {
                                                #region todo:临时逻辑
                                                //写入执行数据
                                                device.SetValue(W_CLineCPHDB.W_TaskNo, 100 + 5, RequestIn.StationCode);
                                                device.SetValue(W_CLineCPHDB.W_Channel, Channel, RequestIn.StationCode);
                                                device.SetValue(W_CLineCPHDB.W_Long, Long, RequestIn.StationCode);
                                                device.SetValue(W_CLineCPHDB.W_Wide, Wide, RequestIn.StationCode);
                                                device.SetValue(W_CLineCPHDB.W_High, High, RequestIn.StationCode);
                                                device.SetValue(W_CLineCPHDB.W_TMID, conveyorLineInfoRead.R_BoxCode, RequestIn.StationCode);
                                                device.SetValue(W_CLineCPHDB.W_Request, 1, RequestIn.StationCode);
                                                WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode);
                                                if (content.Status)
                                                R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress);
                                                //码垛环线请求任务
                                                if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1)
                                                {
                                                    WriteInfo(RequestIn.StationName, content.Message);
                                                    //判断是否任务已经存在
                                                    Dt_PackaxisTask packaxisTask = _packaxisTaskRepository.QueryFirst(x => x.BarCode == conveyorLineInfoRead.R_BoxCode.Trim() && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt());
                                                    if (packaxisTask != null)
                                                    {
                                                        //写入执行数据
                                                        device.SetValue(W_CLineCPHDB.W_TaskNo, packaxisTask.PackTaskNum, RequestIn.StationCode);
                                                        device.SetValue(W_CLineCPHDB.W_Channel, packaxisTask.NextAddress, RequestIn.StationCode);
                                                        device.SetValue(W_CLineCPHDB.W_Long, packaxisTask.PackLength, RequestIn.StationCode);
                                                        device.SetValue(W_CLineCPHDB.W_Wide, packaxisTask.PackWidth, RequestIn.StationCode);
                                                        device.SetValue(W_CLineCPHDB.W_High, packaxisTask.PackHeight, RequestIn.StationCode);
                                                        device.SetValue(W_CLineCPHDB.W_TMID, packaxisTask.BarCode, RequestIn.StationCode);
                                                        device.SetValue(W_CLineCPHDB.W_Request, 1, RequestIn.StationCode);
                                                    }
                                                    else
                                                    {
                                                        #region
                                                        WebResponseContent webResponse = _packaxisTaskService.ReqPackTask(conveyorLineInfoRead.R_BoxCode.Trim(), RequestIn.StationDeviceCode);
                                                        if (webResponse.Status)
                                                        {
                                                            Dt_PackaxisTask _PackaxisTask = webResponse.Data as Dt_PackaxisTask;
                                                            //写入执行数据
                                                            device.SetValue(W_CLineCPHDB.W_TaskNo, _PackaxisTask.PackTaskNum, RequestIn.StationCode);
                                                            device.SetValue(W_CLineCPHDB.W_Channel, _PackaxisTask.NextAddress.ObjToInt(), RequestIn.StationCode);
                                                            device.SetValue(W_CLineCPHDB.W_Long, _PackaxisTask.PackLength, RequestIn.StationCode);
                                                            device.SetValue(W_CLineCPHDB.W_Wide, _PackaxisTask.PackWidth, RequestIn.StationCode);
                                                            device.SetValue(W_CLineCPHDB.W_High, _PackaxisTask.PackHeight, RequestIn.StationCode);
                                                            device.SetValue(W_CLineCPHDB.W_TMID, _PackaxisTask.BarCode, RequestIn.StationCode);
                                                            device.SetValue(W_CLineCPHDB.W_Request, 1, RequestIn.StationCode);
                                                            WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode.Trim());
                                                            if (content.Status)
                                                            {
                                                                WriteInfo(RequestIn.StationName, content.Message);
                                                            }
                                                            else
                                                            {
                                                                WriteError(RequestIn.StationName, content.Message);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            WriteError(RequestIn.StationName, webResponse.Message);
                                                        }
                                                        #endregion
                                                    }
                                                }
                                                else
                                                {
                                                    WriteError(RequestIn.StationName, content.Message);
                                                }
                                                #endregion
                                            }
                                        }
                                        else
                                        {
                                            WriteError(RequestIn.StationName, $"未找到设备子编号{RequestIn.StationCode}的协议信息");
                                        }
                                    }
                                    foreach (var item in stationMangers.Where(x => x.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()))
                                    {
                                        DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                                        if (deviceProRead != null)
                                        {
                                            R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress);
                                            //获取码垛口任务更新任务状态
                                            if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0)
                                            else
                                            {
                                                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt());
                                                if (task != null)
                                                {
                                                    task.CurrentAddress = item.StationCode;
                                                    task.NextAddress = task.TargetAddress;
                                                    task.DeviceCode = item.StackerCraneCode;
                                                    _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing);
                                                }
                                                WriteError(RequestIn.StationName, $"未找到设备子编号{RequestIn.StationCode}的协议信息");
                                            }
                                        }
                                    }
                                }
                            }
                                catch (Exception ex)
                                {
                                    Thread.Sleep(1000);
                                }
                            });
                            Task.Run(() =>
                            {
                                try
                                {
                                    //获取所有码垛口
                                    List<Dt_StationManger> stationMangersMD = stationMangers.Where(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt()).ToList();
                                    while (true)
                                    {
                                        if (stationMangersMD.Count > 0)
                                        {
                                            foreach (var item in stationMangersMD)
                                            {
                                                DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StationCode && x.DeviceProParamType == nameof(R_CLineCPHDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                                                if (deviceProRead != null)
                                                {
                                                    R_CLineCPHChannelInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHChannelInfo>(deviceProRead.DeviceProAddress);
                                                    //获取码垛口任务更新任务状态
                                                    if (conveyorLineInfoRead != null && conveyorLineInfoRead.R_State == 5 && conveyorLineInfoRead.R_TaskNo > 0)
                                                    {
                                                        Dt_PackaxisTask packaxisTask = _packaxisTaskRepository.QueryFirst(x => x.PackTaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == item.StationDeviceCode);
                                                        if (packaxisTask != null)
                                                        {
                                                            Dt_PackaxisTask packaxisTaskOld = _packaxisTaskRepository.QueryFirst(x => x.TaskState == TaskStatusEnum.MD_Executing.ObjToInt() && x.DeviceCode == item.StackerCraneCode);
                                                            if (packaxisTaskOld != null)
                                                            {
                                                                WriteError(item.StationName, $"码垛{item.StackerCraneCode}正执行任务{packaxisTaskOld.PackTaskNum},无法继续下发");
                                                            }
                                                            else
                                                            {
                                                                packaxisTask.CurrentAddress = item.StationCode;
                                                                packaxisTask.NextAddress = packaxisTask.TargetAddress;
                                                                packaxisTask.DeviceCode = item.StackerCraneCode;
                                                                packaxisTask.TaskState = TaskStatusEnum.MD_Executing.ObjToInt();
                                                                _packaxisTaskRepository.UpdateData(packaxisTask);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            WriteError(item.StationName, $"未找到任务{conveyorLineInfoRead.R_TaskNo}信息");
                                                        }
                                                        Thread.Sleep(2000);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            WriteError(nameof(ConveyorLineJob_CPH), $"错误信息:未找到码垛口信息");
                                        }
                                    }
                                }
                                catch (Exception ex)
                                {
                                    Thread.Sleep(1000);
                                }
                            });
                        }
                        catch (Exception ex)
                        {
                            lockObj = 0;
                            WriteError(nameof(ConveyorLineJob_CPH), $"错误信息:{ex.Message}");
                        }
                    });
                    }
                }
                
            }
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/èì¼Ü/TrussCartonJob.cs
@@ -79,7 +79,7 @@
                        //写入心跳
                        foreach (var item in stationMangers)
                        {
                            //码垛状态
                            //请求状态
                            bool Call = device.GetValue<R_TrussCartonDB, bool>(GetCartonCall(item.StackerCraneStationCode), device.DeviceCode);
                            if (Call && item.IsOccupied == 0)
@@ -91,6 +91,7 @@
                                //请求WMS空托叠盘任务
                            }
                        }
                        Thread.Sleep(1000);
                        device.SetValue(W_TrussCartonDB.W_CartonHeart, true, device.DeviceCode);
                    }
                    else
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/èì¼Ü/TrussDixieCupJob.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,118 @@
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks.DBNames;
using WIDESEAWCS_Core.Helper;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
using WIDESEAWCS_Tasks.ConveyorLineJob;
namespace WIDESEAWCS_Tasks
{
    /// <summary>
    /// çº¸æ¯æ¡æž¶
    /// </summary>
    [DisallowConcurrentExecution]
    public class TrussDixieCupJob : JobBase, IJob
    {
        private readonly ICacheService _cacheService;
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IRouterRepository _routerRepository;
        private readonly IRouterService _routerService;
        private readonly IRouterExtension _routerExtension;
        public TrussDixieCupJob(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension)
        {
            _cacheService = cacheService;
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _stationMangerRepository = stationMangerRepository;
            _routerRepository = routerRepository;
            _routerService = routerService;
            _routerExtension = routerExtension;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
                if (flag && value != null)
                {
                    OtherDevice device = (OtherDevice)value;
                    List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StationDeviceCode == device.DeviceCode);
                    //获取协议
                    DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == device.DeviceCode && x.DeviceProParamType == nameof(R_TrussDixieCupDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                    DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == device.DeviceCode && x.DeviceProParamType == nameof(W_TrussDixieCupDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                    //判断协议是否满足
                    if (deviceProRead != null && deviceProWrite != null)
                    {
                        device.SetValue(W_TrussDixieCupDB.W_DixieCupHeart, false, device.DeviceCode);
                        //写入心跳
                        foreach (var item in stationMangers)
                        {
                            //请求状态
                            bool Call = device.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupCall(item.StackerCraneStationCode), device.DeviceCode);
                            if (Call && item.IsOccupied == 0)
                            {
                                //请求WMS叫料任务
                            }
                            else if (Call && item.IsOccupied == 1)
                            {
                                //请求WMS空托叠盘任务
                            }
                        }
                        device.SetValue(W_TrussDixieCupDB.W_DixieCupHeart, true, device.DeviceCode);
                    }
                    else
                    {
                        WriteError(device.DeviceCode, $"未找到设备编号{device.DeviceCode}的协议信息");
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(TrussDixieCupJob), ex.Message);
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// èŽ·å–æ¡æž¶å‘¼å«ä¿¡å·
        /// </summary>
        public R_TrussDixieCupDB GetDixieCupCall(string StationCode)
        {
            switch (StationCode)
            {
                case "1":
                    return R_TrussDixieCupDB.R_DixieCupCall1;
                case "2":
                    return R_TrussDixieCupDB.R_DixieCupCall2;
                case "3":
                    return R_TrussDixieCupDB.R_DixieCupCall3;
                case "4":
                    return R_TrussDixieCupDB.R_DixieCupCall4;
                default:
                    throw new Exception("未定义工位");
            }
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/Âë¶â/MDJob_CP.cs
@@ -15,6 +15,7 @@
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_IPackInfoRepository;
@@ -27,6 +28,7 @@
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Repository;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_TaskInfoRepository;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_Tasks.DBNames;
using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
@@ -37,26 +39,17 @@
    public class MDJob_CP : JobBase, IJob
    {
        private readonly ICacheService _cacheService;
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IStationMangerRepository _stationMangerRepository;
        private readonly IDt_PackaxisRepository _packaxisRepository;
        private readonly IRouterRepository _routerRepository;
        private readonly IRouterService _routerService;
        private readonly IRouterExtension _routerExtension;
        private readonly IPackaxisRepository _packaxisRepository;
        private readonly IPackaxisTaskRepository _packaxisTaskRepository;
        private readonly IPackaxisTaskService _packaxisTaskService;
        private readonly IStationPackInfoRepository _stationPackInfoRepository;
        private readonly List<Dt_WarehouseDevice> warehouseDevices;
        public MDJob_CP(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository, IRouterService routerService, IRouterExtension routerExtension, IDt_PackaxisRepository packaxisRepository)
        public MDJob_CP(ICacheService cacheService, IStationMangerRepository stationMangerRepository,  IPackaxisRepository packaxisRepository, IPackaxisTaskRepository packaxisTaskRepository,IPackaxisTaskService packaxisTaskService, IStationPackInfoRepository stationPackInfoRepository)
        {
            _cacheService = cacheService;
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _stationMangerRepository = stationMangerRepository;
            _routerRepository = routerRepository;
            _routerService = routerService;
            _routerExtension = routerExtension;
            _packaxisRepository = packaxisRepository;
            string? warehouseDevicesStr = _cacheService.Get<string>(nameof(Dt_WarehouseDevice));
@@ -68,113 +61,139 @@
            {
                warehouseDevices = new List<Dt_WarehouseDevice>();
            }
            _packaxisTaskRepository = packaxisTaskRepository;
            _packaxisTaskService = packaxisTaskService;
            _stationPackInfoRepository = stationPackInfoRepository;
        }
        public Task Execute(IJobExecutionContext context)
        {
            bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
            if (flag && value != null)
            try
            {
                OtherDevice device = (OtherDevice)value;
                List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StackerCraneCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && x.IsOccupied == 0);
                foreach (var item in stationMangers)
                bool flag = context.JobDetail.JobDataMap.TryGetValue("JobParams", out object? value);
                if (flag && value != null)
                {
                    OtherDevice device = (OtherDevice)value;
                    List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x => x.StackerCraneCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && x.IsOccupied == 0);
                    //获取协议
                    DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StackerCraneCode && x.DeviceProParamType == nameof(R_MDDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                    DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == item.StackerCraneCode && x.DeviceProParamType == nameof(W_MDDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                    DeviceProDTO? deviceProRead = device.DeviceProDTOs.Where(x => x.DeviceChildCode == device.DeviceCode && x.DeviceProParamType == nameof(R_MDDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                    DeviceProDTO? deviceProWrite = device.DeviceProDTOs.Where(x => x.DeviceChildCode == device.DeviceCode && x.DeviceProParamType == nameof(W_MDDB)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
                    if (deviceProRead != null && deviceProWrite != null)
                    {
                        short Allow = device.GetValue<R_MDDB, short>(R_MDDB.R_MDAllow, item.StackerCraneCode);
                        foreach (var item in stationMangers)
                        {
                        #region è¯»å–工位状态
                        short R_MDStatus1 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus1, item.StackerCraneCode);
                        short R_MDStatus2 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus2, item.StackerCraneCode);
                        short R_MDStatus3 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus3, item.StackerCraneCode);
                        short R_MDStatus4 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus4, item.StackerCraneCode);
                        short ReceiveDoneState = device.GetValue<W_MDDB, short>(W_MDDB.W_MDReceiveDone, item.StackerCraneCode);
                        #endregion
                        //码垛状态
                        short PackState = device.GetValue<R_MDDB, short>(GetPackStateEnum(item.StackerCraneStationCode), item.StackerCraneCode);
                        //码垛数量
                        short PackNum = device.GetValue<R_MDDB, short>(GetPackNumEnum(item.StackerCraneStationCode), item.StackerCraneCode);
                        if (R_MDStatus1 == 1 || R_MDStatus2 == 1 || R_MDStatus3 == 1 || R_MDStatus4 == 1)
                        {
                            Thread.Sleep(200);
                            if (ReceiveDoneState!=0)
                            short Allow = device.GetValue<R_MDDB, short>(R_MDDB.R_MDAllow, item.StackerCraneCode);
                            #region è¯»å–工位状态
                            short R_MDStatus1 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus1, item.StackerCraneCode);
                            short R_MDStatus2 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus2, item.StackerCraneCode);
                            short R_MDStatus3 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus3, item.StackerCraneCode);
                            short R_MDStatus4 = device.GetValue<R_MDDB, short>(R_MDDB.R_MDStatus4, item.StackerCraneCode);
                            short ReceiveDoneState = device.GetValue<W_MDDB, short>(W_MDDB.W_MDReceiveDone, item.StackerCraneCode);
                            #endregion
                            //码垛状态
                            short PackState = device.GetValue<R_MDDB, short>(GetPackStateEnum(item.StackerCraneStationCode), item.StackerCraneCode);
                            //码垛数量
                            short PackNum = device.GetValue<R_MDDB, short>(GetPackNumEnum(item.StackerCraneStationCode), item.StackerCraneCode);
                            if ((R_MDStatus1 == 1 || R_MDStatus2 == 1 || R_MDStatus3 == 1 || R_MDStatus4 == 1) && Allow == 4)
                            {
                                device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 0);
                                WriteInfo(item.StackerCraneCode, $"{item.StackerCraneCode}清除下发标识信号");
                            }
                            continue;
                        }
                        if (PackState == 2)
                        {
                            Thread.Sleep(200);
                            device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 0);
                            WriteInfo(item.StationName, $"{item.StationName}清除工位结托信号");
                            continue;
                        }
                        var axis = _packaxisRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.StationCode == Convert.ToInt32(item.StackerCraneStationCode));
                        if (axis != null)
                        {
                            //进行结托
                            if (Convert.ToInt32(PackNum) == axis.PackNum)
                            {
                                device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 2);
                                WriteInfo(item.StationName, $"{item.StationName}写入工位结托信号");
                                Thread.Sleep(200);
                                if (ReceiveDoneState != 0)
                                {
                                    device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 0);
                                    WriteInfo(item.StackerCraneCode, $"{item.StackerCraneCode}工位任务下发标识值为:{ReceiveDoneState},机器人读取状态为:{Allow},1工位{R_MDStatus1},2工位{R_MDStatus2},3工位{R_MDStatus3},4工位{R_MDStatus4},码垛清除下发标识信号");
                                }
                                continue;
                            }
                            //码垛申请
                            if (Allow == 3 || Allow == 7)
                            if (PackState == 2)
                            {
                                //获取当前任务
                                Dt_Task task = _taskRepository.QueryData(x => x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.MD_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode).OrderBy(x => x.TaskNum).FirstOrDefault();
                                if (task != null)
                                {
                                    //写入工位号
                                    device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSendID.ToString()).DeviceProDataBlock, Convert.ToInt16(item.StackerCraneStationCode));
                                    //写入工位允许码垛
                                    device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 1);
                                    #region èŽ·å–å†™å…¥ç åž›X、Y、Z坐标
                                    (int, int, int) result = GetAxis(PackNum, axis, item.StackerCraneStationCode);
                                    device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, result.Item1);
                                    device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, result.Item2);
                                    device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDZ.ToString()).DeviceProDataBlock, result.Item3);
                                    WriteInfo(item.StationName, $"码垛数量【{PackNum}】,下发码垛坐标X、Y、Z【{result.Serialize()}】");
                                    #endregion
                                    device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDA.ToString()).DeviceProDataBlock, 1);
                                    //写入下发标识
                                    device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 3);
                                    //更新任务信息
                                    task.TaskState = TaskStatusEnum.Finish.ObjToInt();
                                    //_taskRepository.UpdateData(task);
                                    _taskService.TaskCompleted(task.TaskNum);
                                    Thread.Sleep(1000);
                                    WriteInfo(item.StationName, $"任务号{task.TaskNum}码垛");
                                    return Task.CompletedTask;
                                }
                                Thread.Sleep(200);
                                device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 0);
                                WriteInfo(item.StationName, $"{item.StationName}清除工位结托信号");
                                continue;
                            }
                        }
                        else
                        {
                            WriteError(item.StationName, $"未找到该工位{item.StationName}的坐标信息,请核对数据");
                            //获取当前工位码垛执行中数据
                            Dt_StationPackInfo stationPackInfo = _stationPackInfoRepository.QueryFirst(x => x.StationCode == item.StationCode && x.AssignNum > 0);
                            if (stationPackInfo!=null)
                            {
                                var axis = _packaxisRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.StationCode == stationPackInfo.StationCode && x.PackType== stationPackInfo.PackType);
                                if (axis != null)
                                {
                                    //进行结托
                                    if (Convert.ToInt32(PackNum) == axis.PackNum)
                                    {
                                        WebResponseContent responseContent = _packaxisTaskService.BoxingInBound(item.StationCode);
                                        if (responseContent.Status)
                                        {
                                            device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 2);
                                            WriteInfo(item.StationName, $"{item.StationName}写入工位结托信号");
                                        }
                                        else
                                        {
                                            WriteError(item.StationName, $"{responseContent.Message}");
                                        }
                                        continue;
                                    }
                                    //码垛申请
                                    if (Allow == 3 || Allow == 7)
                                    {
                                        //获取当前任务
                                        Dt_PackaxisTask packaxisTask = _packaxisTaskRepository.QueryFirst(x => x.NextAddress == item.StationCode && x.DeviceCode == item.StackerCraneCode && x.PackType == stationPackInfo.PackType && x.TaskState == TaskStatusEnum.MD_Executing.ObjToInt());
                                        if (packaxisTask != null)
                                        {
                                            //写入工位号
                                            device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSendID.ToString()).DeviceProDataBlock, Convert.ToInt16(item.StackerCraneStationCode));
                                            //写入工位允许码垛
                                            device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == GetPackSendEnum(item.StackerCraneStationCode).ToString()).DeviceProDataBlock, 1);
                                            #region èŽ·å–å†™å…¥ç åž›X、Y、Z坐标
                                            (int, int, int) result = GetAxis(PackNum, axis, item.StackerCraneStationCode);
                                            device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, result.Item1);
                                            device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, result.Item2);
                                            device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDZ.ToString()).DeviceProDataBlock, result.Item3);
                                            WriteInfo(item.StationName, $"码垛数量【{PackNum}】,下发码垛坐标X、Y、Z【{result.Serialize()}】");
                                            #endregion
                                            device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDA.ToString()).DeviceProDataBlock, 1);
                                            //写入下发标识
                                            device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 3);
                                            packaxisTask.TaskState = TaskStatusEnum.Finish.ObjToInt();
                                            _packaxisTaskRepository.UpdateData(packaxisTask);
                                            //任务完成
                                            WebResponseContent webResponse = _packaxisTaskService.TaskCompleted(packaxisTask: packaxisTask);
                                            if (!webResponse.Status)
                                            {
                                                WriteError(item.StationName, $"任务号{packaxisTask.PackTaskNum}码垛完成错误{webResponse.Message}");
                                            }
                                            else
                                            {
                                                WriteInfo(item.StationName, $"任务号{packaxisTask.PackTaskNum}码垛完成");
                                            }
                                            Thread.Sleep(800);
                                            return Task.CompletedTask;
                                        }
                                    }
                                }
                                else
                                {
                                    WriteError(item.StationName, $"未找到该工位{item.StationName}的坐标信息,请核对数据");
                                }
                            }
                        }
                    }
                    else
                    {
                        WriteError(item.StationName, $"未找到设备子编号{item.StationCode}的协议信息");
                        WriteError(device.DeviceCode, $"未找到设备{device.DeviceCode}的协议信息");
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(MDJob_CP),ex.Message);
            }
            return Task.CompletedTask;
        }
        /// <summary>
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_Common/CommonEnum/StationAreaEnum.cs
@@ -110,11 +110,13 @@
        /// </summary>
        [Description("二楼雾化")]
        äºŒæ¥¼é›¾åŒ– = 17,
        /// <summary>
        /// äºŒæ¥¼æˆå“åº“缓存区
        /// </summary>
        [Description("二楼成品库缓存区")]
        äºŒæ¥¼æˆå“åº“缓存区 = 18,
        /// <summary>
        /// ä¸€æ¥¼æš‚存架
        /// </summary>
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -142,6 +142,12 @@
        EmptyProductBack = 630,
        /// <summary>
        /// åˆ†åˆ‡åŠæˆå“å…¥åº“
        /// </summary>
        [Description("分切半成品入库")]
        PartOffInbound = 695,
        /// <summary>
        /// æ— çººå¸ƒåŠæˆå“å…¥åº“
        /// </summary>
        [Description("无纺布半成品入库")]
@@ -175,7 +181,7 @@
        /// çº¸å¼ æ·‹è†œä½™æ–™é€€åº“
        /// </summary>
        [Description("纸张淋膜余料退库")]
        PaperFilmYLBackInbound = 725,
        PaperLMYLBackInbound = 725,
        /// <summary>
        /// çº¸è¢‹ä½™æ–™é€€åº“
@@ -196,6 +202,12 @@
        PaperOldYLBackInbound = 740,
        /// <summary>
        /// æ— çººå¸ƒè¢‹ä½™æ–™é€€åº“
        /// </summary>
        [Description("无纺布袋余料退库")]
        WFBBackInbound = 745,
        /// <summary>
        /// å··é“内移库
        /// </summary>
        [Description("巷道内移库")]
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_IInboundService/IMESProInOrderInfoService.cs
@@ -18,7 +18,11 @@
        /// MES工单停止接口
        /// </summary>
        WebResponseContent ReceiveProOrderStop(MESOrderStopDTO orderStopDTO);
        /// <summary>
        /// MES产量回传接口
        /// </summary>
        /// <param name="boxCode"></param>
        /// <returns></returns>
        WebResponseContent MESBoxCode(string boxCode);
    }
}
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -64,7 +64,7 @@
        /// <param name="stationCode"></param>
        /// <param name="palletCode"></param>
        /// <returns></returns>
        WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode);
        WebResponseContent DeviceRequestInboundTaskSimple(string stationCode);
        /// <summary>
        /// åŽŸæ–™å…¥åº“ä»»åŠ¡è¯·æ±‚
@@ -275,5 +275,6 @@
        /// </summary>
        /// <returns></returns>
        WebResponseContent DisableStatus(int[] keys);
        WebResponseContent BoxingInBound(string stationCode, List<string> barCodes);
    }
}
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_InboundService/MESProInOrderInfoService.cs
@@ -69,7 +69,7 @@
            return content;
        }
        /// <summary>
        /// MES工单停止接口
        /// MES产量回传
        /// </summary>
        /// <summary>
        public WebResponseContent MESBoxCode(string boxCode)
@@ -95,7 +95,7 @@
                MESResponse response = _invokeMESService.MESBoxCodeNotice(boxCode).DeserializeObject<MESResponse>() ?? throw new Exception("未获取到MES返回信息");
                if (!response.Result)
                {
                    throw new Exception($"MES配送出发接口调用报错,MES返回信息{DecodeUnicode(response.Msg)}");
                    throw new Exception($"MES返回信息{DecodeUnicode(response.Msg)}");
                }
                BaseDal.UpdateData(mESProInOrderInfo);
                content.OK($"成品条码{boxCode}扫码入库");
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_Model/Models/Outbound/Dt_OutMESIssueCache.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,80 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.DB.Models;
namespace WIDESEA_Model.Models
{
    /// <summary>
    /// MES当前呼料缓存
    /// </summary>
    [SugarTable(nameof(Dt_OutMESIssueCache), "MES当前呼料缓存"), ModelValidate]
    public class Dt_OutMESIssueCache : BaseEntity
    {
        /// <summary>
        /// ä¸»é”®
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]
        public int Id { get; set; }
        /// <summary>
        /// ä»“库主键
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "仓库主键")]
        public int WarehouseId { get; set; }
        /// <summary>
        /// åŠ å·¥ä¸­å¿ƒåŒºåŸŸ
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "加工中心区域")]
        public int MakeArea { get; set; }
        /// <summary>
        /// å‡ºåº“来源明细ID
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "出库来源明细ID")]
        public int OutDetailId { get; set; }
        /// <summary>
        /// WMS单据编号
        /// </summary>
        [CodeRule(RuleCodeEnum.OutboundOrderRule)]
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "WMS单据编号", IsOnlyIgnoreUpdate = true)]
        public string OutMESOrderNo { get; set; }
        /// <summary>
        /// ç”Ÿäº§è®¢å•编码(上游)
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "生产订单编码(上游)")]
        public string ProductOrderNo { get; set; }
        /// <summary>
        /// æ´¾å•工单编码
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "派单工单编码")]
        public string SendOrderNo { get; set; }
        /// <summary>
        /// ç‰©æ–™ç¼–码
        /// </summary>
        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "物料编码")]
        public string MaterialCode { get; set; }
        /// <summary>
        /// ç‰©æ–™æ‰¹æ¬¡
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "物料批次")]
        public string MaterialLot { get; set; }
        /// <summary>
        /// åŠ å·¥ä¸­å¿ƒç¼–ç (机台)
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "加工中心编码(机台)")]
        public string MakeCode { get; set; }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs
@@ -161,6 +161,14 @@
        public decimal? CheckWeight { get; set; }
        /// <summary>
        /// åˆå§‹é‡é‡
        /// </summary>
        [ExporterHeader(DisplayName = "初始重量")]
        [ImporterHeader(Name = "初始重量")]
        [SugarColumn(IsNullable = true, ColumnDescription = "初始重量")]
        public decimal? InitialWeight { get; set; }
        /// <summary>
        /// ç‰©æ–™ç›´å¾„/高度
        /// </summary>
        [ExporterHeader(DisplayName = "物料直径")]
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_OutboundService/OutMESOrderService.cs
@@ -6,6 +6,7 @@
using System.Threading.Tasks;
using WIDESEA_Common.LocationEnum;
using WIDESEA_Common.MaterielEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.WareHouseEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseServices;
@@ -209,7 +210,7 @@
                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterialCode, item.WarehouseId).Where(x => !outStocks.Select(x => x.PalletCode).Contains(x.PalletCode)).ToList();
                if (!stockInfos.Any())
                {
                    throw new Exception($"未找到可分配库存");
                    continue;
                }
                //分配实际库存
                List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, needQuantity).OrderBy(x => x.StockLength).ToList();
@@ -246,7 +247,8 @@
                        assignStop = false;
                    }
                }
                //修改状态
                item.OutMESOrderStatus = OutOrderStatusEnum.出库中.ObjToInt();
                locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            }
@@ -276,7 +278,7 @@
                List<Dt_ProStockInfo> stockInfos = _stockService.ProStockInfoService.GetUseableStocks(item.MaterialCode, WarehouseEnum.LLDCP.ObjToInt()).Where(x => !outStocks.Select(x => x.PalletCode).Contains(x.PalletCode)).ToList();
                if (!stockInfos.Any())
                {
                    throw new Exception($"未找到可分配库存");
                    continue;
                }
                //分配实际库存
                List<Dt_ProStockInfo> autoAssignStocks = _stockService.ProStockInfoService.GetOutboundStocks(stockInfos, needQuantity);
@@ -313,7 +315,7 @@
                        assignStop = false;
                    }
                }
                item.OutMESOrderStatus = OutOrderStatusEnum.出库中.ObjToInt();
                locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
            }
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/MesTaskService.cs
@@ -310,11 +310,13 @@
                        TaskTypeEnum taskTypeEnum = aGVStationInfo.StationArea switch
                        {
                            nameof(StationAreaEnum.一楼印刷) => TaskTypeEnum.PrintYLBackInbound,
                            nameof(StationAreaEnum.一楼纸张淋膜) => TaskTypeEnum.PaperFilmYLBackInbound,
                            nameof(StationAreaEnum.一楼纸张淋膜) => TaskTypeEnum.PaperLMYLBackInbound,
                            nameof(StationAreaEnum.一楼无纺淋膜) => TaskTypeEnum.WFBLMYLBackInbound,
                            nameof(StationAreaEnum.二楼无纺布袋) => TaskTypeEnum.WFBBackInbound,
                            nameof(StationAreaEnum.二楼纸袋) => TaskTypeEnum.PaperYLBackInbound,
                            _ => throw new Exception("未找到对应任务")
                        };
                        if (taskTypeEnum== TaskTypeEnum.WFBLMYLBackInbound)
                        if (taskTypeEnum == TaskTypeEnum.WFBLMYLBackInbound || taskTypeEnum == TaskTypeEnum.WFBBackInbound)
                        {
                            Dt_AGVStationInfo? stationInfo = AssignWFBStation(_AGVStationInfos?.Select(x=>x.AGVStationCode).ToList()) ?? throw new Exception("未找到可用无纺布暂存架");
                            newTask.NextAddress = stationInfo.AGVStationCode;
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Completed.cs
@@ -97,6 +97,7 @@
            try
            {
                Dt_Task wmsTask = BaseDal.QueryFirst(x=>x.TaskNum == task.TaskNum);
                string oldPalletCode = wmsTask.PalletCode;
                if (wmsTask != null)
                {
                    wmsTask.PalletCode= task.PalletCode;
@@ -108,6 +109,31 @@
                    wmsTask.TaskType = task.TaskType;
                    wmsTask.TargetAddress = task.TargetAddress;
                    BaseDal.UpdateData(wmsTask);
                    //推送MES接驳成功接口
                    if (wmsTask.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && !wmsTask.WorkCentreCode.IsNullOrEmpty() && wmsTask.TaskStatus == TaskStatusEnum.AGV_TakeFinish.ObjToInt())
                    {
                        Dt_AGVStationInfo? aGVStationInfo = null;
                        if (wmsTask.CurrentAddress== "603" || wmsTask.CurrentAddress == "613" || wmsTask.CurrentAddress == "102" || wmsTask.CurrentAddress == "614" || wmsTask.CurrentAddress == "615" || wmsTask.CurrentAddress == "604" || wmsTask.CurrentAddress == "605")
                        {
                            aGVStationInfo = _basicRepository.AGVStationInfoRepository.QueryFirst(x=>x.AGVStationCode==wmsTask.CurrentAddress);
                        }
                        else
                        {
                            aGVStationInfo= _basicRepository.AGVStationInfoRepository.QueryFirst(x => x.MESPointCode == wmsTask.CurrentAddress);
                        }
                        MESRecepNoticeModel mESRecepNoticeModel = new MESRecepNoticeModel()
                        {
                            WorkCentreEmptyPalletNotice = new List<RecepNotice>()
                            {
                                new RecepNotice()
                                {
                                    LocationCode = aGVStationInfo.MESPointCode,
                                    CompleteFlag=true
                                }
                            }
                        };
                    }
                    //推送ERP半成品入库
                    if (wmsTask.TaskType>=TaskTypeEnum.WFBYLInbound.ObjToInt() && wmsTask.TaskType <= TaskTypeEnum.PrintYLInbound.ObjToInt() && wmsTask.TaskStatus==TaskStatusEnum.AGV_TakeFinish.ObjToInt())
                    {
                        Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x=>x.PalletCode== wmsTask.PalletCode);
@@ -126,6 +152,13 @@
                                }
                            }) ?? throw new Exception("半成品入库接口请求失败");
                    }
                    //成品入库更新托盘条码
                    if (wmsTask.TaskType == TaskTypeEnum.InProduct.ObjToInt() && oldPalletCode!=task.PalletCode)
                    {
                        Dt_ProStockInfo stockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == oldPalletCode);
                        stockInfo.PalletCode = task.PalletCode;
                        _stockRepository.ProStockInfoRepository.UpdateData(stockInfo);
                    }
                }
                return WebResponseContent.Instance.OK();
            }
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -41,29 +41,24 @@
        /// <param name="stationCode"></param>
        /// <param name="palletCode"></param>
        /// <returns></returns>
        public WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode)
        public WebResponseContent DeviceRequestInboundTaskSimple(string stationCode)
        {
            try
            {
                Dt_Task task = Repository.QueryFirst(x => x.PalletCode == palletCode);
                Dt_Task task = Repository.QueryFirst(x => x.PalletCode == stationCode);
                if (task != null)
                {
                    PushTasksToWCS(new List<Dt_Task> { task });
                    return WebResponseContent.Instance.OK($"该托盘已生成任务", _mapper.Map<WMSTaskDTO>(task));
                }
                Dt_ProStockInfo stockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == palletCode);
                Dt_ProStockInfo stockInfo = BaseDal.Db.Queryable<Dt_ProStockInfo>().Where(x => x.PalletCode == stationCode).Includes(x => x.proStockInfoDetails).First(); ;
                if (stockInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到组盘信息");
                }
                if (stockInfo.StockStatus != StockStatusEmun.MES余料退库.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES空托退库.ObjToInt())
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"该托盘状态不正确,不可申请入库");
                }
                if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                {
                    return WebResponseContent.Instance.Error($"该托盘已绑定货位");
                }
                Dt_Task newTask = new Dt_Task()
@@ -71,35 +66,28 @@
                    CurrentAddress = stationCode,
                    Grade = 0,
                    NextAddress = "",
                    PalletCode = palletCode,
                    PalletCode = stationCode,
                    Roadway = "",
                    SourceAddress = stationCode,
                    TargetAddress = "",
                    TaskType = TaskTypeEnum.Inbound.ObjToInt(),
                    TaskType = TaskTypeEnum.InProduct.ObjToInt(),
                    TaskStatus = TaskStatusEnum.New.ObjToInt(),
                    WarehouseId = stockInfo.WarehouseId,
                    PalletType = stockInfo.PalletType,
                };
                if (stockInfo.StockStatus == StockStatusEmun.手动组盘暂存.ObjToInt())
                stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                stockInfo.proStockInfoDetails.ForEach(x =>
                {
                    stockInfo.StockStatus = StockStatusEmun.手动组盘入库确认.ObjToInt();
                }
                else
                {
                    stockInfo.StockStatus = StockStatusEmun.入库确认.ObjToInt();
                }
                    x.ProStockDetailStatus = StockStatusEmun.入库确认.ObjToInt();
                });
                _unitOfWorkManage.BeginTran();
                int taskId = BaseDal.AddData(newTask);
                newTask.TaskId = taskId;
                _stockRepository.ProStockInfoRepository.UpdateData(stockInfo);
                _stockRepository.ProStockInfoDetailRepository.UpdateData(stockInfo.proStockInfoDetails);
                _unitOfWorkManage.CommitTran();
                WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask);
                PushTasksToWCS(new List<Dt_Task> { newTask });
                if (newTask.WarehouseId == 5) PutFinish(stationCode, newTask.PalletCode, newTask.TaskNum.ToString());
                return WebResponseContent.Instance.OK(data: wMSTaskDTO);
            }
            catch (Exception ex)
@@ -372,7 +360,7 @@
                    stockInfoOld.IsPick = WhetherEnum.False.ObjToInt();
                }
                decimal stockLength = bSTStockInfoDTO.StockMeter;
                if (weight != bSTStockInfoDTO.Qty)
                if (weight != bSTStockInfoDTO.Qty && weight < stockInfoOld.InitialWeight)
                {
                    Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterialSourceId == stockInfoOld.MaterielId);
                    int gramWeight = (int)(materielInfo.MaterielWeight * 1000);
@@ -393,13 +381,13 @@
                        throw new Exception($"上报称重失败");
                    }
                    stockLength = weight / bSTStockInfoDTO.W / gramWeight * 1000000;
                    stockInfoOld.IsFull = WhetherEnum.True.ObjToInt();
                    stockInfoOld.MaterielWeight = weight;
                }
                stockInfoOld.StockStatus = StockStatusEmun.老厂退库.ObjToInt();
                stockInfoOld.MaterielThickness = bSTStockInfoDTO.Thick;
                stockInfoOld.MaterielWeight = weight;
                stockInfoOld.MaterielWide = bSTStockInfoDTO.W;
                stockInfoOld.StockLength = stockLength;
                stockInfoOld.IsFull = WhetherEnum.True.ObjToInt();
                stockInfoOld.StockOutLength = 0;
                stockInfoOld.WarehouseId = WarehouseEnum.LLDYL.ObjToInt();
                if (thickness < 400)
@@ -672,6 +660,7 @@
                            MaterielThickness = bSTStockInfoDTO.Thick,
                            MaterielWide = bSTStockInfoDTO.W,
                            MaterielWeight = bSTStockInfoDTO.Qty,
                            InitialWeight = bSTStockInfoDTO.Qty,
                            MaterielCode = materielInfo.MaterielCode,
                            MaterielName = materielInfo.MaterielName,
                            StockLength = bSTStockInfoDTO.StockMeter,
@@ -757,6 +746,7 @@
                                MaterielThickness = purchaseBSTOrderDetail.MaterialThick,
                                MaterielWide = purchaseBSTOrderDetail.MaterialWide,
                                MaterielWeight = purchaseBSTOrderDetail.DeliveryQty,
                                InitialWeight=purchaseBSTOrderDetail.DeliveryQty,
                                MaterielCode = materielInfo.MaterielCode,
                                MaterielName = materielInfo.MaterielName,
                                StockLength = purchaseBSTOrderDetail.ProcurementLength,
@@ -1004,6 +994,28 @@
                        _stockRepository.ProStockInfoDetailRepository.UpdateData(proStockInfo.proStockInfoDetails);
                        _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId);
                        BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.人工完成 : WIDESEA_Core.Enums.OperateTypeEnum.自动完成);
                        if (task.TaskType==TaskTypeEnum.InProduct.ObjToInt())
                        {
                            ERPProInUpModel proInUpModel = new ERPProInUpModel();
                            List<PB_INV_PRODUCT_INItem> pRODUCT_INItems = new List<PB_INV_PRODUCT_INItem>();
                            foreach (var item in proStockInfo.proStockInfoDetails)
                            {
                                PB_INV_PRODUCT_INItem pB_INV_PRODUCT_INItem = new PB_INV_PRODUCT_INItem()
                                {
                                    WP_ID=item.LotNumber.ObjToInt(),
                                    INV_BARCODE=item.ProductNo,
                                    QTY=(int)item.StockQty,
                                    REMARK="成品入库"
                                };
                                pRODUCT_INItems.Add(pB_INV_PRODUCT_INItem);
                            }
                            proInUpModel.PB_INV_PRODUCT_IN= pRODUCT_INItems;
                            string request = _invokeERPService.ERPProInUp(proInUpModel) ?? throw new Exception("成品入库接口请求失败");
                            if (!request.Contains("Success"))
                            {
                                throw new Exception($"成品入库失败");
                            }
                        }
                        _unitOfWorkManage.CommitTran();
                        _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(proStockInfo, 0, proStockInfo.proStockInfoDetails.Sum(x => x.StockQty), StockChangeTypeEnum.Inbound);
                    }
@@ -1022,7 +1034,7 @@
                    }
                    //获取货位信息
                    Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                    if (locationInfoEnd == null && task.TaskType!=TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() && task.TaskType != TaskTypeEnum.WFBYLInbound.ObjToInt())
                    if (locationInfoEnd == null && task.TaskType!=TaskTypeEnum.WFBBackInbound.ObjToInt() && task.TaskType != TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() && task.TaskType != TaskTypeEnum.WFBYLInbound.ObjToInt())
                    {
                        return content.Error($"未找到对应的终点货位信息");
                    }
@@ -1034,7 +1046,7 @@
                        Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                        _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId);
                    }
                    if (task.TaskType != TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() && task.TaskType != TaskTypeEnum.WFBYLInbound.ObjToInt())
                    if (task.TaskType != TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() && task.TaskType != TaskTypeEnum.WFBBackInbound.ObjToInt() && task.TaskType != TaskTypeEnum.WFBYLInbound.ObjToInt())
                    {
                        stockInfo.LocationCode = locationInfoEnd.LocationCode;
                    }
@@ -1838,16 +1850,24 @@
                if (AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.半成品.ObjToInt()).Count() > 0)
                {
                    //生成半成品入库
                    WebResponseContent webResponse = PrintInbound(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.半成品.ObjToInt()).ToList());
                    WebResponseContent webResponse = SemiProInbound(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.半成品.ObjToInt()).ToList());
                    if (!webResponse.Status)
                    {
                        throw new Exception(webResponse.Message);
                    }
                    tasks = webResponse.Data as List<Dt_Task>;
                    WebResponseContent taskResponse = PushTasksToWCS(tasks);
                    if (taskResponse.Status)
                    if (!taskResponse.Status)
                    {
                        throw new Exception(taskResponse.Message);
                    }
                }
                if (AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.成品.ObjToInt()).Count() > 0)
                {
                    WebResponseContent webResponse = PushPackaxisTaskToWCS(AddMESProInOrders.Where(x => x.MESProOrderType == MaterielTypeEnum.成品.ObjToInt()).ToList());
                    if (!webResponse.Status)
                    {
                        throw new Exception(webResponse.Message);
                    }
                }
                _unitOfWorkManage.CommitTran();
@@ -1862,9 +1882,9 @@
            return content;
        }
        /// <summary>
        /// å°åˆ·ä¸‹æ–™MES任务
        /// åŠæˆå“ä¸‹æ–™MES任务
        /// </summary>
        public WebResponseContent PrintInbound(List<Dt_MESProInOrderInfo> mESProInOrderInfos)
        public WebResponseContent SemiProInbound(List<Dt_MESProInOrderInfo> mESProInOrderInfos)
        {
            WebResponseContent content = new WebResponseContent();
            try
@@ -1879,11 +1899,16 @@
                List<Dt_Task> tasks = new List<Dt_Task>();
                //获取所有AGV点位
                List<Dt_AGVStationInfo> aGVStationInfos = _basicRepository.AGVStationInfoRepository.QueryData(x => !string.IsNullOrEmpty(x.MESPointCode));
                List<Dt_AGVStationInfo> _AGVStationInfos = new List<Dt_AGVStationInfo>();
                //根据半成品信息呼叫对应任务
                foreach (var item in mESProInOrderInfos)
                {
                    Dt_AGVStationInfo? CheckPointCode = aGVStationInfos.FirstOrDefault(x => x.MESPointCode == item?.PointCode);
                    Dt_MaterielInfo? materielInfo = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterialCode);
                    if (CheckPointCode==null)
                    {
                        return content.Error($"未找到{item?.PointCode}点位");
                    }
                    if (materielInfo == null)
                    {
                        return content.Error("未找到物料信息");
@@ -1924,7 +1949,7 @@
                    //半成品入库任务
                    Dt_Task newTask = new Dt_Task()
                    {
                        CurrentAddress = CheckPointCode.AGVStationCode,
                        CurrentAddress = item.PointCode.StartsWith("YS") ? CheckPointCode.AGVStationCode : CheckPointCode.MESPointCode,
                        Grade = 0,
                        NextAddress = "",
                        PalletCode = item.BarCode,
@@ -1940,17 +1965,54 @@
                    TaskTypeEnum taskTypeEnum = CheckPointCode.StationArea switch
                    {
                        nameof(StationAreaEnum.一楼印刷) => TaskTypeEnum.PrintYLInbound,
                        nameof(StationAreaEnum.一楼分切) => TaskTypeEnum.PartOffInbound,
                        nameof(StationAreaEnum.一楼纸张淋膜) => TaskTypeEnum.PaperFilmInbound,
                        nameof(StationAreaEnum.一楼无纺淋膜) => TaskTypeEnum.WFBYLInbound,
                        _ => throw new Exception("未找到对应任务")
                    };
                    if (taskTypeEnum == TaskTypeEnum.WFBYLInbound)
                    {
                        Dt_AGVStationInfo? stationInfo = AssignWFBStation(_AGVStationInfos?.Select(x => x.AGVStationCode).ToList()) ?? throw new Exception("未找到可用无纺布暂存架");
                        newTask.NextAddress = stationInfo.AGVStationCode;
                        newTask.TargetAddress = stationInfo.AGVStationCode;
                        newTask.Roadway = "AGV";
                        stationInfo.IsOccupied = 1;
                        _AGVStationInfos.Add(stationInfo);
                    }
                    newTask.TaskType = taskTypeEnum.ObjToInt();
                    stockInfos.Add(stockInfo);
                    tasks.Add(newTask);
                }
                //操作入库数据
                BaseDal.AddData(tasks);
                _basicRepository.AGVStationInfoRepository.UpdateData(_AGVStationInfos);
                _stockRepository.StockInfoRepository.AddData(stockInfos);
                //推送任务
                content.OK("发送成功",data:tasks);
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// æŽ¨é€ç åž›æ•°æ®è‡³WCS
        /// </summary>
        /// <returns></returns>
        public WebResponseContent PushPackaxisTaskToWCS(List<Dt_MESProInOrderInfo> mESProInOrderInfos)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string url = AppSettings.Get("WCS");
                if (string.IsNullOrEmpty(url))
                {
                    throw new Exception($"未找到WCSAApi地址,请检查配置文件");
                }
                string response = HttpHelper.Post($"{url}/api/Packinfo/ReceivePackaxisTask", mESProInOrderInfos.Serialize());
                return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("返回错误");
            }
            catch (Exception ex)
            {
@@ -1974,5 +2036,56 @@
                throw new Exception(ex.Message);
            }
        }
        public WebResponseContent BoxingInBound(string stationCode,List<string> barCodes)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                //获取成品库存
                Dt_ProStockInfo proStockInfoOld = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == stationCode);
                if (proStockInfoOld != null)
                {
                    return content.Error($"托盘{stationCode}已存在");
                }
                //获取条码信息
                List<Dt_MESProInOrderInfo> proInOrderInfos = _inboundRepository.MESProInOrderInfoRepository.QueryData(x=> barCodes.Contains(x.BarCode));
                Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x=>x.MaterielCode== proInOrderInfos.FirstOrDefault().MaterialCode);
                List<Dt_ProStockInfoDetail> proStockInfoDetails = new List<Dt_ProStockInfoDetail>();
                foreach (var item in proInOrderInfos)
                {
                    Dt_ProStockInfoDetail proStockInfoDetail = new Dt_ProStockInfoDetail()
                    {
                        ProductCode = materielInfo.MaterielCode,
                        ProductNo = item.BarCode,
                        ProductName = materielInfo.MaterielName,
                        ProductSpec = materielInfo.MaterielSpec,
                        LotNumber = item.ProcessNum.ToString(),
                        ProductUnit = materielInfo.MaterielUnit,
                        StockQty = item.ProQuantity,
                        ProStockDetailStatus = StockStatusEmun.组盘暂存.ObjToInt()
                    };
                    proStockInfoDetails.Add(proStockInfoDetail);
                }
                Dt_ProStockInfo proStockInfo = new Dt_ProStockInfo()
                {
                    PalletCode = stationCode,
                    ProInOrderNo = proInOrderInfos.FirstOrDefault().ProductOrderNo,
                    ProStockAttribute = materielInfo.MaterielSourceType,
                    PalletType = 1,
                    LocationCode = "",
                    WarehouseId = materielInfo.WarehouseId,
                    StockStatus = StockStatusEmun.组盘暂存.ObjToInt(),
                    proStockInfoDetails = proStockInfoDetails
                };
                BaseDal.Db.InsertNav(proStockInfo).Include(x => x.proStockInfoDetails).ExecuteCommand();
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Outbound.cs
@@ -986,15 +986,10 @@
                            {
                                //创建任务
                                tasks = GetTasks(result.Item1, result.Item3);
                                result.Item2.ForEach(x =>
                                {
                                    OutOrderStatusEnum.出库中.ObjToInt();
                                });
                                result.Item3.ForEach(x =>
                                {
                                    x.Status = OutLockStockStatusEnum.出库中.ObjToInt();
                                });
                                stockInfos = result.Item1;
                                Orders = result.Item2;
                                outStockLockInfos = result.Item3;
@@ -1033,10 +1028,6 @@
                            {
                                //创建任务
                                tasks = GetTasks(result.Item1, result.Item3);
                                result.Item2.ForEach(x =>
                                {
                                    OutOrderStatusEnum.出库中.ObjToInt();
                                });
                                result.Item3.ForEach(x =>
                                {
                                    x.Status = OutLockStockStatusEnum.出库中.ObjToInt();
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Reloaction.cs
@@ -216,9 +216,12 @@
                //获取货位
                Dt_LocationInfo startLocationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.Row == relocation.StartRow && x.Columns == relocation.StartColumn && x.Layer == relocation.StartLayer && x.RoadwayNo == relocation.RoadWay);
                Dt_LocationInfo endLocationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.Row == relocation.TargetRow && x.Columns == relocation.TargetColumn && x.Layer == relocation.TargetLayer && x.RoadwayNo == relocation.RoadWay);
                if (startLocationInfo==null || endLocationInfo==null)
                {
                    return content.Error("起始货位或终点货位不存在");
                }
                //判断条件
                if (startLocationInfo != null && startLocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && startLocationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && endLocationInfo != null && endLocationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt() && endLocationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt())
                if (startLocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && startLocationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && endLocationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt() && endLocationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt())
                {
                    Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.LocationCode == startLocationInfo.LocationCode);
                    Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.LocationCode == startLocationInfo.LocationCode);
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_WMSServer/Controllers/MES/MesController.cs
@@ -36,7 +36,7 @@
        {
            _taskService = taskService;
            _outMESOrderService = outMESOrderService;
            _proInOrderInfoService=proInOrderInfoService;
            _proInOrderInfoService = proInOrderInfoService;
            _invokeMESService = invokeMESService;
        }
        /// <summary>
ÏîÄ¿´úÂë/WMS/WMSServices/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -30,12 +30,11 @@
        /// WCS申请入库任务(不分配货位)
        /// </summary>
        /// <param name="stationCode"></param>
        /// <param name="palletCode"></param>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("DeviceRequestInboundTaskSimple"), AllowAnonymous]
        public WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode)
        public WebResponseContent DeviceRequestInboundTaskSimple(string stationCode)
        {
            return Service.DeviceRequestInboundTaskSimple(stationCode, palletCode);
            return Service.DeviceRequestInboundTaskSimple(stationCode);
        }
        /// <summary>
@@ -326,5 +325,14 @@
        {
            return Service.DisableStatus(keys);
        }
        /// <summary>
        /// æˆå“ç»„盘
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("BoxingInBound"), AllowAnonymous]
        public WebResponseContent BoxingInBound(string stationCode, [FromBody] List<string> barCodes)
        {
            return Service.BoxingInBound(stationCode, barCodes);
        }
    }
}
ÏîÄ¿×ÊÁÏ/½Ó¿ÚЭÒé/ÁúÀûµÃMES½Ó¿Ú.xlsx
Binary files differ
ÏîÄ¿×ÊÁÏ/ͨÐÅЭÒé/Ö½±­&Ö½ÏäÉÏÁÏèì¼ÜͨѶЭÒé.xlsx
Binary files differ
ÏîÄ¿×ÊÁÏ/ͨÐÅЭÒé/Ö½±­Ö½ÏäÉÏÁÏèì¼ÜͨѶЭÒé-251118.xlsx
Binary files differ
ÏîÄ¿×ÊÁÏ/ͨÐÅЭÒé/ÁúÀûµÃ»úÆ÷ÈËIOͨѶ±í20250712.xlsx
Binary files differ