已添加25个文件
已复制12个文件
已重命名5个文件
已修改38个文件
| | |
| | | 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/'; |
| | |
| | | { |
| | | public enum StationOccupiedEnum |
| | | { |
| | | |
| | | None, |
| | | Sure |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_Common.TaskEnum |
| | | { |
| | | public enum SequenceEnum |
| | | { |
| | | SeqPackTaskNum |
| | | } |
| | | } |
| | |
| | | InPick = 530, |
| | | |
| | | /// <summary> |
| | | /// 空æåå ç |
| | | /// </summary> |
| | | [Description("空æåå ç")] |
| | | EmptyPaletteBack = 535, |
| | | |
| | | /// <summary> |
| | | /// æåå
¥åº |
| | | /// </summary> |
| | | [Description("æåå
¥åº")] |
| | |
| | | /// çº¸å¼ æ·è使éåº |
| | | /// </summary> |
| | | [Description("çº¸å¼ æ·è使éåº")] |
| | | PaperFilmYLBackInbound = 725, |
| | | PaperLMYLBackInbound = 725, |
| | | |
| | | /// <summary> |
| | | /// 纸è¢ä½æéåº |
| | |
| | | PaperOldYLBackInbound = 740, |
| | | |
| | | /// <summary> |
| | | /// æ 纺å¸è¢ä½æéåº |
| | | /// </summary> |
| | | [Description("æ 纺å¸è¢ä½æéåº")] |
| | | WFBBackInbound = 745, |
| | | |
| | | /// <summary> |
| | | /// å··éå
ç§»åº |
| | | /// </summary> |
| | | [Description("å··éå
ç§»åº")] |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; } |
| | | } |
| | | } |
| | |
| | | <ProjectReference Include="..\WIDESEAWCS_Model\WIDESEAWCS_Model.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="BasicInfo\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
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 ¸´ÖÆ |
| | |
| | | |
| | | namespace WIDESEAWCS_IPackInfoRepository |
| | | { |
| | | public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis> |
| | | public interface IPackTypeRepository : IRepository<Dt_PackType> |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | namespace WIDESEAWCS_IPackInfoRepository |
| | | { |
| | | public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis> |
| | | public interface IPackaxisRepository : IRepository<Dt_Packaxis> |
| | | { |
| | | } |
| | | } |
| ÎļþÃû´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoRepository/IDt_PackaxisRepository.cs ÐÞ¸Ä |
| | |
| | | |
| | | namespace WIDESEAWCS_IPackInfoRepository |
| | | { |
| | | public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis> |
| | | public interface IPackinfoRepository : IRepository<Dt_Packinfo> |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | namespace WIDESEAWCS_IPackInfoRepository |
| | | { |
| | | public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis> |
| | | public interface IPackinfo_HtyRepository : IRepository<Dt_Packinfo_Hty> |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | namespace WIDESEAWCS_IPackInfoRepository |
| | | { |
| | | public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis> |
| | | public interface IStationPackDetailRepository : IRepository<Dt_StationPackDetail> |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | namespace WIDESEAWCS_IPackInfoRepository |
| | | { |
| | | public interface IDt_PackaxisRepository : IRepository<Dt_Packaxis> |
| | | public interface IStationPackInfoRepository : IRepository<Dt_StationPackInfo> |
| | | { |
| | | } |
| | | } |
| ÎļþÃû´Ó ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_IPackInfoService/IDt_PackaxisService.cs ÐÞ¸Ä |
| | |
| | | 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> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | 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> |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | 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> |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | 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> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | 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> |
| | | { |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | 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); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | 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> |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | /// <param name="agvFinishDTO"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AGVFinish(AgvFinishDTO agvFinishDTO); |
| | | /// <summary> |
| | | /// AGVä»»å¡ç¶æå·æ° |
| | | /// </summary> |
| | | /// <param name="agvUpdateModel"></param> |
| | | /// <returns></returns> |
| | | AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel); |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ä¿¡æ¯åæ·»å 任塿ç»è®°å½ |
| | |
| | | /// <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; } |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEAWCS_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_Packaxis), "ç ååæ ")] |
| | | [SugarTable(nameof(Dt_Packaxis), "ç ååæ è¡¨")] |
| | | public class Dt_Packaxis : BaseEntity |
| | | { |
| | | /// <summary> |
| | |
| | | /// <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> |
| | | /// ç åæ°é |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; } |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core.Attributes; |
| | | using WIDESEAWCS_Core.DB.Models; |
| | | |
| | |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç åä»»å¡å·")] |
| | | [ExporterHeader(DisplayName = "ç åä»»å¡å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç åä»»å¡å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç åä»»å¡å·"), Sequence(nameof(SequenceEnum.SeqPackTaskNum), 100000000)] |
| | | public int PackTaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | [ImporterHeader(Name = "ç®±ç ")] |
| | | [ExporterHeader(DisplayName = "ç®±ç ")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç®±ç ")] |
| | | public string BoxCode { get; set; } |
| | | public string BarCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç¼å· |
| | |
| | | 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> |
| | |
| | | [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; } |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | 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) |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | 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/Dt_PackaxisRepository.cs ÐÞ¸Ä |
| | |
| | | |
| | | 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) |
| | | { |
| | | } |
| | | } |
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 ¸´ÖÆ |
| | |
| | | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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/Dt_PackaxisService.cs ÐÞ¸Ä |
| | |
| | | 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) |
| | |
| | | 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; |
| | |
| | | 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), |
| | |
| | | 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); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | 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) |
| | |
| | | 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); |
| | | |
| | | bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (!RequestPut) |
| | | { |
| | | otherDevice.SetValue(GetCartonRequest(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | otherDevice.SetValue(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode); |
| | | Thread.Sleep(1000); |
| | | } |
| | | bool AllowFinish = otherDevice.GetValue<R_TrussCartonDB, bool>(GetCarton(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupPutOut(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode); |
| | | if (AllowFinish) |
| | | { |
| | | content.OK("å
è®¸æ¾æ"); |
| | |
| | | { |
| | | 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(); |
| | |
| | | /// <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("æªå®ä¹å·¥ä½"); |
| | | } |
| | |
| | | /// <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("æªå®ä¹å·¥ä½"); |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | 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(); |
| | |
| | | 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; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | .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)); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// AGVä»»å¡ç¶æå·æ°/AGVä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="agvUpdateModel"></param> |
| | | /// <returns></returns> |
| | | public AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel) |
| | | { |
| | | return new AgvResponseContent(); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | 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) |
| | |
| | | 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> |
| | |
| | | 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, |
| | | } |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | </PropertyGroup> |
| | | |
| | | <ItemGroup> |
| | | <Compile Remove="AGV\**" /> |
| | | <Compile Remove="HoisterJob\**" /> |
| | | <EmbeddedResource Remove="AGV\**" /> |
| | | <EmbeddedResource Remove="HoisterJob\**" /> |
| | | <None Remove="AGV\**" /> |
| | | <None Remove="HoisterJob\**" /> |
| | | </ItemGroup> |
| | | |
| | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEAWCS_TaskInfoService\WIDESEAWCS_TaskInfoService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Folder Include="AGV\" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | { |
| | | //请æ±ä»»å¡ |
| | | WebResponseContent content = _taskService.RequestPlateOutTask(item.StationCode); |
| | | if (content.Status) |
| | | { |
| | | WriteInfo(item.StationName, $"äºæ¥¼ç©ºæå çåºåºä»»å¡çæ"); |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(item.StationName, $"{content.Message}"); |
| | | } |
| | | } |
| | | } |
| | | //å çä»»å¡å®æäº¤äº |
| | | else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 8 && conveyorLineInfoRead.TaskNo > 0) |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | 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; |
| | |
| | | _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)) |
| | | { |
| | |
| | | { |
| | | warehouseDevices = new List<Dt_WarehouseDevice>(); |
| | | } |
| | | _packaxisTaskRepository = packaxisTaskRepository; |
| | | _packaxisTaskService = packaxisTaskService; |
| | | } |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | |
| | | if (lockObj.ToString()=="0") |
| | | { |
| | | lockObj = 1; |
| | | Task task = Task.Run(async () => |
| | | { |
| | | try |
| | | { |
| | | 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.StationDeviceCode == device.DeviceCode); |
| | | Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()); |
| | | Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | Dt_StationManger? RequestIn = stationMangers.FirstOrDefault(x => x.StationDeviceCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()); |
| | | while (true) |
| | | { |
| | | if (RequestIn != null) |
| | |
| | | //ç åç¯çº¿è¯·æ±ä»»å¡ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request == 1) |
| | | { |
| | | #region todo:临æ¶é»è¾ |
| | | //夿æ¯å¦ä»»å¡å·²ç»åå¨ |
| | | 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, 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_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); |
| | | WebResponseContent content = _taskService.MESBoxCodeNotice(conveyorLineInfoRead.R_BoxCode); |
| | | } |
| | | 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); |
| | |
| | | { |
| | | WriteError(RequestIn.StationName, content.Message); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteError(RequestIn.StationName, webResponse.Message); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | WriteError(RequestIn.StationName, $"æªæ¾å°è®¾å¤åç¼å·{RequestIn.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | foreach (var item in stationMangers.Where(x => x.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())) |
| | | } |
| | | } |
| | | 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_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress); |
| | | R_CLineCPHChannelInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHChannelInfo>(deviceProRead.DeviceProAddress); |
| | | //è·åç åå£ä»»å¡æ´æ°ä»»å¡ç¶æ |
| | | if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0) |
| | | if (conveyorLineInfoRead != null && conveyorLineInfoRead.R_State == 5 && conveyorLineInfoRead.R_TaskNo > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress == item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); |
| | | if (task != null) |
| | | 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) |
| | | { |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing); |
| | | 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) |
| | | { |
| | |
| | | WriteError(nameof(ConveyorLineJob_CPH), $"é误信æ¯ï¼{ex.Message}"); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | //åå
¥å¿è·³ |
| | | foreach (var item in stationMangers) |
| | | { |
| | | //ç åç¶æ |
| | | //请æ±ç¶æ |
| | | bool Call = device.GetValue<R_TrussCartonDB, bool>(GetCartonCall(item.StackerCraneStationCode), device.DeviceCode); |
| | | |
| | | if (Call && item.IsOccupied == 0) |
| | |
| | | //请æ±WMS空æå çä»»å¡ |
| | | } |
| | | } |
| | | Thread.Sleep(1000); |
| | | device.SetValue(W_TrussCartonDB.W_CartonHeart, true, device.DeviceCode); |
| | | } |
| | | else |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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("æªå®ä¹å·¥ä½"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Communicator; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | using WIDESEAWCS_IPackInfoRepository; |
| | |
| | | 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; |
| | |
| | | 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)); |
| | |
| | | { |
| | | warehouseDevices = new List<Dt_WarehouseDevice>(); |
| | | } |
| | | _packaxisTaskRepository = packaxisTaskRepository; |
| | | _packaxisTaskService = packaxisTaskService; |
| | | _stationPackInfoRepository = stationPackInfoRepository; |
| | | } |
| | | |
| | | 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.StackerCraneCode == device.DeviceCode && x.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && x.IsOccupied == 0); |
| | | foreach (var item in stationMangers) |
| | | { |
| | | //è·ååè®® |
| | | 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) |
| | | { |
| | | |
| | | 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) |
| | | if ((R_MDStatus1 == 1 || R_MDStatus2 == 1 || R_MDStatus3 == 1 || R_MDStatus4 == 1) && Allow == 4) |
| | | { |
| | | 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}æ¸
é¤ä¸åæ è¯ä¿¡å·"); |
| | | WriteInfo(item.StackerCraneCode, $"{item.StackerCraneCode}å·¥ä½ä»»å¡ä¸åæ è¯å¼ä¸ºï¼{ReceiveDoneState},æºå¨äººè¯»åç¶æä¸ºï¼{Allow}ï¼1å·¥ä½{R_MDStatus1}ï¼2å·¥ä½{R_MDStatus2}ï¼3å·¥ä½{R_MDStatus3}ï¼4å·¥ä½{R_MDStatus4}ï¼ç 忏
é¤ä¸åæ è¯ä¿¡å·"); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | WriteInfo(item.StationName, $"{item.StationName}æ¸
é¤å·¥ä½ç»æä¿¡å·"); |
| | | continue; |
| | | } |
| | | var axis = _packaxisRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.StationCode == Convert.ToInt32(item.StackerCraneStationCode)); |
| | | //è·åå½åå·¥ä½ç åæ§è¡ä¸æ°æ® |
| | | 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_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) |
| | | 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<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}ç å"); |
| | | 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> |
| | |
| | | /// </summary> |
| | | [Description("äºæ¥¼é¾å")] |
| | | äºæ¥¼é¾å = 17, |
| | | |
| | | /// <summary> |
| | | /// äºæ¥¼æååºç¼ååº |
| | | /// </summary> |
| | | [Description("äºæ¥¼æååºç¼ååº")] |
| | | äºæ¥¼æååºç¼ååº = 18, |
| | | |
| | | /// <summary> |
| | | /// 䏿¥¼æåæ¶ |
| | | /// </summary> |
| | |
| | | EmptyProductBack = 630, |
| | | |
| | | /// <summary> |
| | | /// åååæåå
¥åº |
| | | /// </summary> |
| | | [Description("åååæåå
¥åº")] |
| | | PartOffInbound = 695, |
| | | |
| | | /// <summary> |
| | | /// æ 纺å¸åæåå
¥åº |
| | | /// </summary> |
| | | [Description("æ 纺å¸åæåå
¥åº")] |
| | |
| | | /// çº¸å¼ æ·è使éåº |
| | | /// </summary> |
| | | [Description("çº¸å¼ æ·è使éåº")] |
| | | PaperFilmYLBackInbound = 725, |
| | | PaperLMYLBackInbound = 725, |
| | | |
| | | /// <summary> |
| | | /// 纸è¢ä½æéåº |
| | |
| | | PaperOldYLBackInbound = 740, |
| | | |
| | | /// <summary> |
| | | /// æ 纺å¸è¢ä½æéåº |
| | | /// </summary> |
| | | [Description("æ 纺å¸è¢ä½æéåº")] |
| | | WFBBackInbound = 745, |
| | | |
| | | /// <summary> |
| | | /// å··éå
ç§»åº |
| | | /// </summary> |
| | | [Description("å··éå
ç§»åº")] |
| | |
| | | /// MESå·¥å忢æ¥å£ |
| | | /// </summary> |
| | | WebResponseContent ReceiveProOrderStop(MESOrderStopDTO orderStopDTO); |
| | | |
| | | /// <summary> |
| | | /// MES产éåä¼ æ¥å£ |
| | | /// </summary> |
| | | /// <param name="boxCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent MESBoxCode(string boxCode); |
| | | } |
| | | } |
| | |
| | | /// <param name="stationCode"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode); |
| | | WebResponseContent DeviceRequestInboundTaskSimple(string stationCode); |
| | | |
| | | /// <summary> |
| | | /// åæå
¥åºä»»å¡è¯·æ± |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent DisableStatus(int[] keys); |
| | | WebResponseContent BoxingInBound(string stationCode, List<string> barCodes); |
| | | } |
| | | } |
| | |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// MESå·¥å忢æ¥å£ |
| | | /// MES产éåä¼ |
| | | /// </summary> |
| | | /// <summary> |
| | | public WebResponseContent MESBoxCode(string boxCode) |
| | |
| | | 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}æ«ç å
¥åº"); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; } |
| | | } |
| | | } |
| | |
| | | public decimal? CheckWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå§éé |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "åå§éé")] |
| | | [ImporterHeader(Name = "åå§éé")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åå§éé")] |
| | | public decimal? InitialWeight { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç´å¾/é«åº¦ |
| | | /// </summary> |
| | | [ExporterHeader(DisplayName = "ç©æç´å¾")] |
| | |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | assignStop = false; |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹ç¶æ |
| | | item.OutMESOrderStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList())); |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | assignStop = false; |
| | | } |
| | | } |
| | | |
| | | item.OutMESOrderStatus = OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | locationInfos.AddRange(_basicRepository.LocationInfoRepository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList())); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | try |
| | | { |
| | | Dt_Task wmsTask = BaseDal.QueryFirst(x=>x.TaskNum == task.TaskNum); |
| | | string oldPalletCode = wmsTask.PalletCode; |
| | | if (wmsTask != null) |
| | | { |
| | | wmsTask.PalletCode= task.PalletCode; |
| | |
| | | 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); |
| | |
| | | } |
| | | }) ?? 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(); |
| | | } |
| | |
| | | /// <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() |
| | |
| | | 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(); |
| | | } |
| | | else |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | } |
| | | |
| | | stockInfo.proStockInfoDetails.ForEach(x => |
| | | { |
| | | 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) |
| | |
| | | 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); |
| | |
| | | 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) |
| | |
| | | MaterielThickness = bSTStockInfoDTO.Thick, |
| | | MaterielWide = bSTStockInfoDTO.W, |
| | | MaterielWeight = bSTStockInfoDTO.Qty, |
| | | InitialWeight = bSTStockInfoDTO.Qty, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = bSTStockInfoDTO.StockMeter, |
| | |
| | | MaterielThickness = purchaseBSTOrderDetail.MaterialThick, |
| | | MaterielWide = purchaseBSTOrderDetail.MaterialWide, |
| | | MaterielWeight = purchaseBSTOrderDetail.DeliveryQty, |
| | | InitialWeight=purchaseBSTOrderDetail.DeliveryQty, |
| | | MaterielCode = materielInfo.MaterielCode, |
| | | MaterielName = materielInfo.MaterielName, |
| | | StockLength = purchaseBSTOrderDetail.ProcurementLength, |
| | |
| | | _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); |
| | | } |
| | |
| | | } |
| | | //è·åè´§ä½ä¿¡æ¯ |
| | | 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($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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 |
| | |
| | | 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("æªæ¾å°ç©æä¿¡æ¯"); |
| | |
| | | //åæåå
¥åºä»»å¡ |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = CheckPointCode.AGVStationCode, |
| | | CurrentAddress = item.PointCode.StartsWith("YS") ? CheckPointCode.AGVStationCode : CheckPointCode.MESPointCode, |
| | | Grade = 0, |
| | | NextAddress = "", |
| | | PalletCode = item.BarCode, |
| | |
| | | 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) |
| | | { |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | //åå»ºä»»å¡ |
| | | 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; |
| | |
| | | { |
| | | //åå»ºä»»å¡ |
| | | tasks = GetTasks(result.Item1, result.Item3); |
| | | result.Item2.ForEach(x => |
| | | { |
| | | OutOrderStatusEnum.åºåºä¸.ObjToInt(); |
| | | }); |
| | | result.Item3.ForEach(x => |
| | | { |
| | | x.Status = OutLockStockStatusEnum.åºåºä¸.ObjToInt(); |
| | |
| | | //è·åè´§ä½ |
| | | 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); |
| | |
| | | /// 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> |
| | |
| | | { |
| | | 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); |
| | | } |
| | | } |
| | | } |