222
schangxiang@126.com
2024-11-23 520067288fb790f50d7732ef8570b3b7f1205d4b
222
已添加1个文件
已修改9个文件
245 ■■■■■ 文件已修改
CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/FormCC.Designer.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/FormCC.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/2、DataProcess_RobotBuffer_IssueOutboundTask.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/4、DataProcess_RobotBuffer_ForceOutbound.cs 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/iWareCC.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SDA/iWareSda/App.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Connected Services/StationService/Reference.cs
@@ -194,6 +194,9 @@
        private short R_DestinationField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private bool R_ForceOutboundModeField;
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private bool R_InboundFinishField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
@@ -290,6 +293,19 @@
                if ((this.R_DestinationField.Equals(value) != true)) {
                    this.R_DestinationField = value;
                    this.RaisePropertyChanged("R_Destination");
                }
            }
        }
        [System.Runtime.Serialization.DataMemberAttribute()]
        public bool R_ForceOutboundMode {
            get {
                return this.R_ForceOutboundModeField;
            }
            set {
                if ((this.R_ForceOutboundModeField.Equals(value) != true)) {
                    this.R_ForceOutboundModeField = value;
                    this.RaisePropertyChanged("R_ForceOutboundMode");
                }
            }
        }
@@ -498,7 +514,7 @@
        private int W_Destination_InField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string W_Destination_OutField;
        private int W_Destination_OutField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private short W_HeightField;
@@ -621,12 +637,12 @@
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        public string W_Destination_Out {
        public int W_Destination_Out {
            get {
                return this.W_Destination_OutField;
            }
            set {
                if ((object.ReferenceEquals(this.W_Destination_OutField, value) != true)) {
                if ((this.W_Destination_OutField.Equals(value) != true)) {
                    this.W_Destination_OutField = value;
                    this.RaisePropertyChanged("W_Destination_Out");
                }
CC/iWareCC_ASRS/Connected Services/StationService/item3.xsd
@@ -12,6 +12,7 @@
      <xs:element minOccurs="0" name="R_AlarmCode" type="xs:short" />
      <xs:element minOccurs="0" name="R_AlarmCodeMsg" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="R_Destination" type="xs:short" />
      <xs:element minOccurs="0" name="R_ForceOutboundMode" type="xs:boolean" />
      <xs:element minOccurs="0" name="R_InboundFinish" type="xs:boolean" />
      <xs:element minOccurs="0" name="R_InboundNumber" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="R_Inbound_TaskID" type="xs:short" />
@@ -41,7 +42,7 @@
      <xs:element minOccurs="0" name="W_CartonWidth" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="W_DataFinish" type="xs:boolean" />
      <xs:element minOccurs="0" name="W_Destination_In" type="xs:int" />
      <xs:element minOccurs="0" name="W_Destination_Out" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="W_Destination_Out" type="xs:int" />
      <xs:element minOccurs="0" name="W_Height" type="xs:short" />
      <xs:element minOccurs="0" name="W_InboundFinishConfirm" type="xs:boolean" />
      <xs:element minOccurs="0" name="W_Inbound_TaskID" type="xs:short" />
CC/iWareCC_ASRS/FormCC.Designer.cs
@@ -470,6 +470,10 @@
            this.dataGridViewTextBoxColumn63 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.btn_Find_OutTaskRetryToMes = new System.Windows.Forms.Button();
            this.lbl_RobotMode = new System.Windows.Forms.Label();
            this.tb_PackageCode = new System.Windows.Forms.TextBox();
            this.label23 = new System.Windows.Forms.Label();
            this.button24 = new System.Windows.Forms.Button();
            this.lbl_currHandlerPackageCodeForIssueOutboundTask = new System.Windows.Forms.Label();
            this.tPTransAsrs.SuspendLayout();
            this.panel14.SuspendLayout();
            this.panel15.SuspendLayout();
@@ -2801,6 +2805,7 @@
            // 
            // panel_Model
            // 
            this.panel_Model.Controls.Add(this.lbl_currHandlerPackageCodeForIssueOutboundTask);
            this.panel_Model.Controls.Add(this.lbl_RobotMode);
            this.panel_Model.Controls.Add(this.rBOnlyIn);
            this.panel_Model.Controls.Add(this.lbl_IsSimulationPLC);
@@ -5474,6 +5479,9 @@
            // 
            // tabPage3
            // 
            this.tabPage3.Controls.Add(this.button24);
            this.tabPage3.Controls.Add(this.tb_PackageCode);
            this.tabPage3.Controls.Add(this.label23);
            this.tabPage3.Controls.Add(this.button23);
            this.tabPage3.Controls.Add(this.tb_wlm);
            this.tabPage3.Controls.Add(this.label22);
@@ -5833,6 +5841,44 @@
            this.lbl_RobotMode.Size = new System.Drawing.Size(127, 15);
            this.lbl_RobotMode.TabIndex = 12;
            this.lbl_RobotMode.Text = "缓存岛机器人模式";
            //
            // tb_PackageCode
            //
            this.tb_PackageCode.Location = new System.Drawing.Point(856, 427);
            this.tb_PackageCode.Name = "tb_PackageCode";
            this.tb_PackageCode.Size = new System.Drawing.Size(339, 25);
            this.tb_PackageCode.TabIndex = 154;
            //
            // label23
            //
            this.label23.AutoSize = true;
            this.label23.Location = new System.Drawing.Point(794, 437);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(45, 15);
            this.label23.TabIndex = 153;
            this.label23.Text = "包号:";
            //
            // button24
            //
            this.button24.BackColor = System.Drawing.Color.Aqua;
            this.button24.Location = new System.Drawing.Point(817, 489);
            this.button24.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.button24.Name = "button24";
            this.button24.Size = new System.Drawing.Size(155, 48);
            this.button24.TabIndex = 155;
            this.button24.Text = "强制该包号出库";
            this.button24.UseVisualStyleBackColor = false;
            this.button24.Click += new System.EventHandler(this.button24_Click);
            //
            // lbl_currHandlerPackageCodeForIssueOutboundTask
            //
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.AutoSize = true;
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.Location = new System.Drawing.Point(275, 693);
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.Name = "lbl_currHandlerPackageCodeForIssueOutboundTask";
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.Size = new System.Drawing.Size(172, 15);
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.TabIndex = 14;
            this.lbl_currHandlerPackageCodeForIssueOutboundTask.Text = "当前下发出库任务的包号";
            // 
            // FormCC
            // 
@@ -6347,6 +6393,10 @@
        private System.Windows.Forms.Label label22;
        private System.Windows.Forms.Button button23;
        private System.Windows.Forms.Label lbl_RobotMode;
        private System.Windows.Forms.Button button24;
        private System.Windows.Forms.TextBox tb_PackageCode;
        private System.Windows.Forms.Label label23;
        private System.Windows.Forms.Label lbl_currHandlerPackageCodeForIssueOutboundTask;
    }
}
CC/iWareCC_ASRS/FormCC.cs
@@ -38,6 +38,11 @@
        public static bool IsAllowRunOutMode = false;
        /// <summary>
        /// å½“前下发出库任务的包号
        /// </summary>
        public static string currHandlerPackageCodeForIssueOutboundTask = "";
        /// <summary>
        /// 1号堆垛机入库口扫码强制验证通过
        /// </summary>
        public static bool Srm1_IN_SMQZYZTG = false;
@@ -1831,6 +1836,7 @@
                }
                this.lbl_RobotMode.Text = "缓存岛机器人模式:" + (IsAllowRunOutMode ? "出库模式" : "入库模式");
                this.lbl_currHandlerPackageCodeForIssueOutboundTask.Text = "当前下发出库任务的包号:" + currHandlerPackageCodeForIssueOutboundTask;
            }
        }
@@ -3535,5 +3541,22 @@
        {
        }
        private void button24_Click(object sender, EventArgs e)
        {
            //强制该包号出库
            var packageCode = this.tb_PackageCode.Text.Trim();
            var alertMsg = "";
            DataProcess_RobotBuffer_ForceOutbound.Handler(packageCode, ref alertMsg);
            if (!string.IsNullOrEmpty(alertMsg))
            {
                MessageBox.Show("错误:" + alertMsg);
            }
            else
            {
                MessageBox.Show("已处理");
            }
        }
    }
}
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/2¡¢DataProcess_RobotBuffer_IssueOutboundTask.cs
@@ -24,6 +24,7 @@
    /// </summary>
    public static class DataProcess_RobotBuffer_IssueOutboundTask
    {
        public static async void Handler()
        {
            var alertMsg = "";
@@ -53,18 +54,37 @@
                            }
                            //取创建时间最早的那个要出库的包
                            if (string.IsNullOrEmpty(FormCC.currHandlerPackageCodeForIssueOutboundTask))
                            {
                            var firstTask = wmsDB.wms_rbline_task.Where(x =>
                           x.RbTaskType == (int)RbTaskTypeEnum.出库任务
                          && x.TaskStatus == (int)TaskStatusEnum.新建).OrderBy(x => x.CreateTime).FirstOrDefault();
                            if (firstTask == null)
                            {
                                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},根据 æ²¡æœ‰æ‰¾åˆ° æ–°å»º çš„任务 ";
                                    FormCC.currHandlerPackageCodeForIssueOutboundTask = "";
                                continue;
                                }
                                FormCC.currHandlerPackageCodeForIssueOutboundTask = firstTask.PackageCode;
                            }
                            else
                            {
                                var firstTask = wmsDB.wms_rbline_task.Where(x =>
                           x.RbTaskType == (int)RbTaskTypeEnum.出库任务
                          && x.TaskStatus == (int)TaskStatusEnum.新建
                          && x.PackageCode == FormCC.currHandlerPackageCodeForIssueOutboundTask
                          ).OrderBy(x => x.CreateTime).FirstOrDefault();
                                if (firstTask == null)
                                {
                                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},根据 æ²¡æœ‰æ‰¾åˆ° æ–°å»º çš„任务 ";
                                    FormCC.currHandlerPackageCodeForIssueOutboundTask = "";
                                    continue;
                                }
                            }
                            var taskList = wmsDB.wms_rbline_task.Where(x =>
                           x.RbTaskType == (int)RbTaskTypeEnum.出库任务
                          && x.TaskStatus == (int)TaskStatusEnum.新建).Where(x => x.PackageCode == firstTask.PackageCode).OrderBy(x => x.CreateTime).ToList();
                          && x.TaskStatus == (int)TaskStatusEnum.新建).Where(x => x.PackageCode == FormCC.currHandlerPackageCodeForIssueOutboundTask).OrderBy(x => x.CreateTime).ToList();
                            if (taskList == null)
                            {
                                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = $"{rgvLocation.ToString()},根据 æ²¡æœ‰æ‰¾åˆ° æ–°å»º çš„任务 ";
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/4¡¢DataProcess_RobotBuffer_ForceOutbound.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,102 @@
using Admin.NET.Application;
using iWareCommon.Common.Globle;
using iWareCommon.Utils;
using iWareModel;
using iWareSql.DataAccess;
using iWareSql.WmsDBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace iWareCC.ThreadService
{
    /// <summary>
    /// æœºå™¨äººç¼“存岛 äººå·¥å¼ºåˆ¶å‡ºåº“ å¤„理
    /// </summary>
    public static class DataProcess_RobotBuffer_ForceOutbound
    {
        public static  bool Handler(string packageCode, ref string alertMsg)
        {
            alertMsg = "";
            LogType logType = LogType.DataProcess_RobotBuffer_AutoQiTaoOutbound;
            try
            {
                var rgvLocation = StationLocationEnum.BZ39.ToString();
                var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
                if (obj.R_ForceOutboundMode == false)
                {
                    alertMsg = "PLC不是强制出库模式";
                    return false;
                }
                using (WmsDBModel wmsDB = new WmsDBModel())
                {
                    List<wms_stock_quan> qunList = wmsDB.wms_stock_quan.Where(x => x.StockStatus == (int)StockStatusEnum.在库
                        && x.PackageCode == packageCode
                    ).ToList();
                    foreach (var x in qunList)
                    {
                        x.StockStatus = (int)StockStatusEnum.人工强制待出库;
                        //生成出库任务
                        //记录任务
                        var _id = Yitter.IdGenerator.YitIdHelper.NextId();
                        var plcTaskNo = BusinessHelper.CreatePlcTaskIdForSrmTask();
                        var new_task = new wms_rbline_task()
                        {
                            Id = _id,
                            TaskNo = plcTaskNo,
                            UPI = x.Upi,
                            Length = x.Length,
                            Width = x.Width,
                            Thk = x.Thk,
                            IssueTime = DateTime.Now,
                            PlanNo = x.PlanNo,
                            OrderId = x.OrderId,
                            PackageCode = x.PackageCode,
                            PlaceCode = x.PlaceCode,
                            RbTaskType = (int)RbTaskTypeEnum.出库任务,
                            RbTaskTypeEnumName = RbTaskTypeEnum.出库任务.ToString(),
                            TaskStatus = (int)TaskStatusEnum.新建,
                            TaskStatusName = TaskStatusEnum.新建.ToString(),
                            TaskMsg = "人工强制待出库",
                            CreateTime = DateTime.Now,
                            CreateUserName = "CC",
                            UpdateTime = DateTime.Now,
                            UpdateUserName = "CC",
                        };
                        wmsDB.wms_rbline_task.Add(new_task);
                        var place = StationHandler.GetPlaceByPlaceCode(x.PlaceCode, wmsDB);
                        place.PlaceStatus = (int)PlaceStatusEnum.锁定;
                        Thread.Sleep(100);
                    }
                    wmsDB.SaveChanges();
                }
                return true;
            }
            catch (Exception ex)
            {
                alertMsg = " å‡ºçް异叏:" + ex.Message;
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
                Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
                return false;
            }
        }
    }
}
CC/iWareCC_ASRS/iWareCC.csproj
@@ -156,6 +156,7 @@
    <Compile Include="ThreadService\00_269工位\DataProcess_269.cs" />
    <Compile Include="ThreadService\01_BZ01工位(清灰,洗板后工位)\DataProcess_BZ01.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\DataProcess_RobotBuffer_ModeChange.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\4、DataProcess_RobotBuffer_ForceOutbound.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\2、DataProcess_RobotBuffer_IssueOutboundTask.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\1、DataProcess_RobotBuffer_AutoQiTaoOutbound.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\3、DataProcess_RobotBuffer_FinishTaskForOutbound.cs" />
SDA/iWareSda/App.config
@@ -4,8 +4,8 @@
    <!-- è¯­è¨€é…ç½® é…ç½®  0 ä¸­æ–‡ 1 è‹±æ–‡ -->
    <add key="LanguageFlg" value="0"/>
    <!-- ç«™ç‚¹çš„PLC é…ç½® -->
    <!-- <add key="Station_Address" value="172.17.51.202"/> -->
    <add key="Station_Address" value="192.168.10.100"/>
    <add key="Station_Address" value="172.17.51.202"/>
    <!-- <add key="Station_Address" value="192.168.10.100"/> -->
    <add key="Station_Rack" value="0"/>
    <add key="Station_Slot" value="1"/>
    <add key="Station_Port" value="102"/>
SDA/iWareSda/Devices/4-Station/StationModel/DB/RgvComm.cs
@@ -407,6 +407,12 @@
        /// </summary>
        [Description("出库任务号")]
        public short R_Outbound_TaskID { get; set; }
        /// <summary>
        /// å¼ºåˆ¶å‡ºåº“模式
        /// </summary>
        [Description("强制出库模式")]
        public bool R_ForceOutboundMode { get; set; }
    }
    public class StationDBForReadComm
@@ -467,5 +473,12 @@
        [Description("出库任务号")]
        public string R_Outbound_TaskID { get; set; }
        /// <summary>
        /// å¼ºåˆ¶å‡ºåº“模式
        /// </summary>
        [Description("强制出库模式")]
        public string R_ForceOutboundMode { get; set; }
    }
}
SDA/iWareSda/Devices/4-Station/StationModel/Station_CacheEntity.cs
@@ -176,7 +176,8 @@
                W_ReqOut = W_DBHeaderWithSeparate_BZ39 + "12.0",
                W_Destination_Out = W_DBHeaderWithSeparate_BZ39 + "14.0",
                W_Mode = W_DBHeaderWithSeparate_BZ39 + "18.0",
                W_OutboundFinishConfirm = W_DBHeaderWithSeparate_BZ39 + "0.2"
                W_OutboundFinishConfirm = W_DBHeaderWithSeparate_BZ39 + "0.2",
            });
@@ -223,6 +224,8 @@
                R_Inbound_TaskID = W_DBHeaderWithSeparate_BZ39 + "112.0",
                R_Outbound_TaskID = W_DBHeaderWithSeparate_BZ39 + "114.0",
                R_ForceOutboundMode = W_DBHeaderWithSeparate_BZ39 + "50.3",
            });