schangxiang@126.com
2024-11-28 ef3318c39fe8358b663e66daeb98adf1de1b97a8
增加 齐套验证县城
已添加1个文件
已修改7个文件
184 ■■■■ 文件已修改
CC/iWareCC_ASRS/Common/SystemValue.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Common/SystemWarningMsg.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/FormCC.Designer.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/FormCC.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/05_BZ30(齐套验证)/DataProcess_ValidateQiTao.cs 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/iWareCC.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCommon/Utils/Log4Net/LogType.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCommon/log4net_iWare.config 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/Common/SystemValue.cs
@@ -134,7 +134,7 @@
        /// </summary>
        public static bool isAllowRuning_DataProcess_RobotBuffer_ModeChange = false;
        public static bool isAllowRuning_PrintHandler = false;
        public static bool isAllowRuning_DataProcess_ValidateQiTao = false;
        /// <summary>
        /// æ˜¯å¦å…è®¸æ‰§è¡Œ å †åž›æœºå…¥å£æ‰«ç æ£€æµ‹çº¿ç¨‹
CC/iWareCC_ASRS/Common/SystemWarningMsg.cs
@@ -101,7 +101,7 @@
        /// <summary>
        /// è¾“送线任务完成确认的警告消息
        /// </summary>
        public static string _lbl_Alert_PrintHandler = string.Empty;
        public static string _lbl_Alert_DataProcess_ValidateQiTao = string.Empty;
        /// <summary>
        /// æ¸…理数据现场 çš„警告消息
CC/iWareCC_ASRS/FormCC.Designer.cs
@@ -244,8 +244,8 @@
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound = new System.Windows.Forms.CheckBox();
            this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask = new System.Windows.Forms.Label();
            this.ck_DataProcess_RobotBuffer_IssueOutboundTask = new System.Windows.Forms.CheckBox();
            this.lbl_Alert_PrintHandler = new System.Windows.Forms.Label();
            this.ck_PrintHandler = new System.Windows.Forms.CheckBox();
            this.lbl_DataProcess_ValidateQiTao = new System.Windows.Forms.Label();
            this.ck_DataProcess_ValidateQiTao = new System.Windows.Forms.CheckBox();
            this.lbl_MainTaskDecompose = new System.Windows.Forms.Label();
            this.ckMainTaskDecompose = new System.Windows.Forms.CheckBox();
            this.lbl_Alert_DeleteData = new System.Windows.Forms.Label();
@@ -3016,8 +3016,8 @@
            this.groupBox1.Controls.Add(this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound);
            this.groupBox1.Controls.Add(this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask);
            this.groupBox1.Controls.Add(this.ck_DataProcess_RobotBuffer_IssueOutboundTask);
            this.groupBox1.Controls.Add(this.lbl_Alert_PrintHandler);
            this.groupBox1.Controls.Add(this.ck_PrintHandler);
            this.groupBox1.Controls.Add(this.lbl_DataProcess_ValidateQiTao);
            this.groupBox1.Controls.Add(this.ck_DataProcess_ValidateQiTao);
            this.groupBox1.Controls.Add(this.lbl_MainTaskDecompose);
            this.groupBox1.Controls.Add(this.ckMainTaskDecompose);
            this.groupBox1.Controls.Add(this.lbl_Alert_DeleteData);
@@ -3286,28 +3286,28 @@
            this.ck_DataProcess_RobotBuffer_IssueOutboundTask.UseVisualStyleBackColor = true;
            this.ck_DataProcess_RobotBuffer_IssueOutboundTask.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged);
            // 
            // lbl_Alert_PrintHandler
            // lbl_DataProcess_ValidateQiTao
            // 
            this.lbl_Alert_PrintHandler.AutoSize = true;
            this.lbl_Alert_PrintHandler.BackColor = System.Drawing.Color.White;
            this.lbl_Alert_PrintHandler.ForeColor = System.Drawing.Color.Red;
            this.lbl_Alert_PrintHandler.Location = new System.Drawing.Point(215, 492);
            this.lbl_Alert_PrintHandler.Name = "lbl_Alert_PrintHandler";
            this.lbl_Alert_PrintHandler.Size = new System.Drawing.Size(70, 15);
            this.lbl_Alert_PrintHandler.TabIndex = 37;
            this.lbl_Alert_PrintHandler.Text = "label11";
            this.lbl_DataProcess_ValidateQiTao.AutoSize = true;
            this.lbl_DataProcess_ValidateQiTao.BackColor = System.Drawing.Color.White;
            this.lbl_DataProcess_ValidateQiTao.ForeColor = System.Drawing.Color.Red;
            this.lbl_DataProcess_ValidateQiTao.Location = new System.Drawing.Point(215, 492);
            this.lbl_DataProcess_ValidateQiTao.Name = "lbl_DataProcess_ValidateQiTao";
            this.lbl_DataProcess_ValidateQiTao.Size = new System.Drawing.Size(70, 15);
            this.lbl_DataProcess_ValidateQiTao.TabIndex = 37;
            this.lbl_DataProcess_ValidateQiTao.Text = "label11";
            // 
            // ck_PrintHandler
            // ck_DataProcess_ValidateQiTao
            // 
            this.ck_PrintHandler.AutoSize = true;
            this.ck_PrintHandler.Location = new System.Drawing.Point(4, 492);
            this.ck_PrintHandler.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.ck_PrintHandler.Name = "ck_PrintHandler";
            this.ck_PrintHandler.Size = new System.Drawing.Size(125, 19);
            this.ck_PrintHandler.TabIndex = 36;
            this.ck_PrintHandler.Text = "打印服务线程";
            this.ck_PrintHandler.UseVisualStyleBackColor = true;
            this.ck_PrintHandler.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged);
            this.ck_DataProcess_ValidateQiTao.AutoSize = true;
            this.ck_DataProcess_ValidateQiTao.Location = new System.Drawing.Point(4, 492);
            this.ck_DataProcess_ValidateQiTao.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.ck_DataProcess_ValidateQiTao.Name = "ck_DataProcess_ValidateQiTao";
            this.ck_DataProcess_ValidateQiTao.Size = new System.Drawing.Size(161, 19);
            this.ck_DataProcess_ValidateQiTao.TabIndex = 36;
            this.ck_DataProcess_ValidateQiTao.Text = "BZ30齐套验证线程";
            this.ck_DataProcess_ValidateQiTao.UseVisualStyleBackColor = true;
            this.ck_DataProcess_ValidateQiTao.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged);
            // 
            // lbl_MainTaskDecompose
            // 
@@ -6152,8 +6152,8 @@
        private System.Windows.Forms.CheckBox ckDeleteData;
        private System.Windows.Forms.Label lbl_MainTaskDecompose;
        private System.Windows.Forms.CheckBox ckMainTaskDecompose;
        private System.Windows.Forms.Label lbl_Alert_PrintHandler;
        private System.Windows.Forms.CheckBox ck_PrintHandler;
        private System.Windows.Forms.Label lbl_DataProcess_ValidateQiTao;
        private System.Windows.Forms.CheckBox ck_DataProcess_ValidateQiTao;
        private System.Windows.Forms.Label lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask;
        private System.Windows.Forms.CheckBox ck_DataProcess_RobotBuffer_IssueOutboundTask;
        private System.Windows.Forms.Button btn_1007;
CC/iWareCC_ASRS/FormCC.cs
@@ -1549,7 +1549,7 @@
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange, ck_DataProcess_RobotBuffer_ModeChange);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_PrintHandler, ck_PrintHandler);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_ValidateQiTao, ck_DataProcess_ValidateQiTao);
            DoCommonCheckedChanged(ref SystemValue.isAllowRuning_DataProcess_RobotBuffer_FinishTaskForOutbound, checkBox_DataProcess_RobotBuffer_FinishTaskForOutbound);
CC/iWareCC_ASRS/ThreadService/05_BZ30(ÆëÌ×ÑéÖ¤)/DataProcess_ValidateQiTao.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
using Admin.NET.Application;
using iWareCC.Common.Helper;
using iWareCC.StationService;
using iWareCommon.Common.Globle;
using iWareCommon.Utils;
using iWareModel;
using iWareSql.DataAccess;
using iWareSql.DBModel;
using iWareSql.WmsDBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Configuration;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WZ.Useful.Commons;
using XiGang.Core.Model;
namespace iWareCC.ThreadService
{
    /// <summary>
    /// BZ30齐套验证
    /// </summary>
    public static class DataProcess_ValidateQiTao
    {
        public static async void Handler()
        {
            var alertMsg = "";
            LogType logType = LogType.DataProcess_ValidateQiTao;
            while (true)
            {
                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = string.Empty;
                try
                {
                    if (SystemValue.isAllowRuning_DataProcess_ValidateQiTao && SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        if (FormCC.IsAllowRunOutMode)
                        {
                            using (WmsDBModel wmsDB = new WmsDBModel())
                            {
                                var rbRunMode = wmsDB.wms_rbline_runmode.FirstOrDefault();
                                if (TaskHandler.ValidateNoFinishOutTaskForRobotBuffer(wmsDB))
                                {//不存在
                                    rbRunMode.LineRunMode = (int)RbRunModeEnum.入库模式;
                                    rbRunMode.LineRunModeName = RbRunModeEnum.入库模式.ToString();
                                    rbRunMode.UpdateTime = DateTime.Now;
                                    //推送给PLC切换模式
                                    using (StationServiceClient client = new StationServiceClient())
                                    {
                                        var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.入库模式, rgvLocation);
                                        if (!res.result)
                                        {
                                            SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-推送给PLC切换模式 å¤±è´¥,ChangeModeAsync è¿”回:{res.resMsg}";
                                            continue;
                                        }
                                        else
                                        {
                                            Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-推送给PLC切换模式 æˆåŠŸ,ChangeModeAsync,参数: ç«™ç‚¹{rgvLocation}");
                                        }
                                    }
                                    FormCC.IsAllowRunOutMode = false;
                                }
                                else
                                {//存在
                                    if (rbRunMode.LineRunMode == (int)RbRunModeEnum.出库模式)
                                    {
                                        SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"已经是出库模式了,此次循环结束";
                                        continue;
                                    }
                                    rbRunMode.LineRunMode = (int)RbRunModeEnum.出库模式;
                                    rbRunMode.LineRunModeName = RbRunModeEnum.出库模式.ToString();
                                    rbRunMode.UpdateTime = DateTime.Now;
                                    //推送给PLC切换模式
                                    using (StationServiceClient client = new StationServiceClient())
                                    {
                                        var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.出库模式, rgvLocation);
                                        if (!res.result)
                                        {
                                            SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao = $"{rgvLocation.ToString()}-推送给PLC切换模式 å¤±è´¥,ChangeModeAsync è¿”回:{res.resMsg}";
                                            continue;
                                        }
                                        else
                                        {
                                            Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-推送给PLC切换模式 æˆåŠŸ,ChangeModeAsync,参数: ç«™ç‚¹{rgvLocation}");
                                        }
                                    }
                                }
                                wmsDB.SaveChanges();
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    SystemWarningMsg._lbl_Alert_DataProcess_ValidateQiTao += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
                    Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
                }
            }
        }
    }
}
CC/iWareCC_ASRS/iWareCC.csproj
@@ -171,6 +171,7 @@
    <Compile Include="ThreadService\03_BZ12%28机器人码包工位%29\DataProcess_BZ12_FinishTask.cs" />
    <Compile Include="ThreadService\04_BZ21(搬运整垛机器人)\DataProcess_BZ21.cs" />
    <Compile Include="ThreadService\04_BZ21(搬运整垛机器人)\DataProcess_BZ21_FinishTask.cs" />
    <Compile Include="ThreadService\05_BZ30%28齐套验证%29\DataProcess_ValidateQiTao.cs" />
    <Compile Include="WCF\CCWcfService.cs" />
    <Compile Include="WCF\ICCWcfService.cs" />
    <Compile Include="WmsTask\AutoUpdateEngineInfoTask.cs" />
CC/iWareCommon/Utils/Log4Net/LogType.cs
@@ -62,7 +62,7 @@
        /// <summary>
        /// å‡ºåº“计划
        /// </summary>
        PrintHandler = 300,
        DataProcess_ValidateQiTao = 300,
        /// <summary>
        /// MES服务
CC/iWareCommon/log4net_iWare.config
@@ -262,8 +262,8 @@
      <filter type="log4net.Filter.DenyAllFilter" />
    </appender>
    <!--出库计划【信息】日志-->
    <appender name="PrintHandler_Info" type="log4net.Appender.RollingFileAppender">
      <file value="d:\\Log\\LuLiMuYe\\iWareCC\\PrintHandler_Info\\" />
    <appender name="DataProcess_ValidateQiTao_Info" type="log4net.Appender.RollingFileAppender">
      <file value="d:\\Log\\LuLiMuYe\\iWareCC\\DataProcess_ValidateQiTao_Info\\" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <staticLogFileName value="false" />
@@ -273,13 +273,13 @@
        <param name="ConversionPattern" value="%n消息时间:%d [%t] %n消息级别:%-5p %n消 æ¯ ç±»ï¼š%c [%x] %n%m %n "/>
      </layout>
      <filter type="log4net.Filter.LoggerMatchFilter">
        <loggerToMatch value="PrintHandler_Info" />
        <loggerToMatch value="DataProcess_ValidateQiTao_Info" />
      </filter>
      <filter type="log4net.Filter.DenyAllFilter" />
    </appender>
    <!--出库计划【错误】日志-->
    <appender name="PrintHandler_Error" type="log4net.Appender.RollingFileAppender">
      <file value="d:\\Log\\LuLiMuYe\\iWareCC\\PrintHandler_Error\\" />
    <appender name="DataProcess_ValidateQiTao_Error" type="log4net.Appender.RollingFileAppender">
      <file value="d:\\Log\\LuLiMuYe\\iWareCC\\DataProcess_ValidateQiTao_Error\\" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <staticLogFileName value="false" />
@@ -289,7 +289,7 @@
        <param name="ConversionPattern" value="%n异常时间:%d [%t] %n异常级别:%-5p %n异 å¸¸ ç±»ï¼š%c [%x] %n%m %n "/>
      </layout>
      <filter type="log4net.Filter.LoggerMatchFilter">
        <loggerToMatch value="PrintHandler_Error" />
        <loggerToMatch value="DataProcess_ValidateQiTao_Error" />
      </filter>
      <filter type="log4net.Filter.DenyAllFilter" />
    </appender>
@@ -640,8 +640,8 @@
      <appender-ref ref="DataProcess_RobotBuffer_AutoQiTaoOutbound_Error"/>
      <appender-ref ref="DataProcess_RobotBuffer_ModeChange_Info"/>
      <appender-ref ref="DataProcess_RobotBuffer_ModeChange_Error"/>
      <appender-ref ref="PrintHandler_Info"/>
      <appender-ref ref="PrintHandler_Error"/>
      <appender-ref ref="DataProcess_ValidateQiTao_Info"/>
      <appender-ref ref="DataProcess_ValidateQiTao_Error"/>
      <!--堆垛机任务线程日志-->
      <appender-ref ref="SrmTheadService_Info"/>
      <appender-ref ref="SrmTheadService_Error"/>