222
schangxiang@126.com
2024-12-14 3eabfd8dfa2574efbe8ce8d4a64862c16ad04823
222
已添加2个文件
已修改10个文件
已删除1个文件
1182 ■■■■■ 文件已修改
CC/iWareCC_ASRS/FormCC.Designer.cs 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/FormCC.cs 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/01_BZ01工位(清灰,洗板后工位)/DataProcess_BZ01.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/DataProcess_RobotBuffer_ModeChange.cs 206 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/1、DataProcess_RobotBuffer_AutoQiTaoOutbound.cs 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/5、CC_DataProcess_RobotBuffer_ForceOutbound.cs 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/5、DataProcess_RobotBuffer_PesonOutbound.cs 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/ThreadService/02_BZ39工位(补板后工位)/Outbound/CC_DataProcess_RobotBuffer_ForceOutbound.cs 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/WCF/CCWcfService.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/WCF/ICCWcfService.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/iWareCC.csproj 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Connected Services/CCWcfService/Reference.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsOperationTask/WmsOperationTaskService.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CC/iWareCC_ASRS/FormCC.Designer.cs
@@ -86,6 +86,7 @@
            this.ckBDataProcess_RobotBuffer_ForceOutbound = new System.Windows.Forms.CheckBox();
            this.ckBDataProcess_BZ12_FinishTask = new System.Windows.Forms.CheckBox();
            this.tabPage3 = new System.Windows.Forms.TabPage();
            this.button2 = new System.Windows.Forms.Button();
            this.btn1 = new System.Windows.Forms.Button();
            this.tb_taskNo = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
@@ -94,18 +95,8 @@
            this.button24 = new System.Windows.Forms.Button();
            this.tb_PackageCode = new System.Windows.Forms.TextBox();
            this.label23 = new System.Windows.Forms.Label();
            this.button23 = new System.Windows.Forms.Button();
            this.tb_wlm = new System.Windows.Forms.TextBox();
            this.label22 = new System.Windows.Forms.Label();
            this.button22 = new System.Windows.Forms.Button();
            this.button20 = new System.Windows.Forms.Button();
            this.tb_TongJi = new System.Windows.Forms.TextBox();
            this.checkBox_NowDay = new System.Windows.Forms.CheckBox();
            this.dateTimePicker_End = new System.Windows.Forms.DateTimePicker();
            this.label16 = new System.Windows.Forms.Label();
            this.dateTimePicker_Start = new System.Windows.Forms.DateTimePicker();
            this.btn_TongJi = new System.Windows.Forms.Button();
            this.button5 = new System.Windows.Forms.Button();
            this.tabDevice = new System.Windows.Forms.TabPage();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this.lbl_Warning_FX = new System.Windows.Forms.Label();
@@ -123,7 +114,6 @@
            this.lbl_Warning_FJ = new System.Windows.Forms.Label();
            this.lbl_XinTiao_FJ = new System.Windows.Forms.Label();
            this.lbl_Mode_FJ = new System.Windows.Forms.Label();
            this.button2 = new System.Windows.Forms.Button();
            this.tabControl1.SuspendLayout();
            this.tPModeChoice.SuspendLayout();
            this.panel_Model.SuspendLayout();
@@ -594,9 +584,9 @@
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Location = new System.Drawing.Point(2, 269);
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Name = "ckDataProcess_RobotBuffer_AutoQiTaoOutbound";
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Size = new System.Drawing.Size(271, 19);
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Size = new System.Drawing.Size(239, 19);
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.TabIndex = 40;
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Text = "机器人缓存岛 è‡ªåŠ¨é½å¥—å‡ºåº“ çº¿ç¨‹";
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.Text = "机器人缓存岛 é½åŒ…出库 çº¿ç¨‹";
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.UseVisualStyleBackColor = true;
            this.ckDataProcess_RobotBuffer_AutoQiTaoOutbound.CheckedChanged += new System.EventHandler(this.CommonCheckedChanged);
            // 
@@ -610,7 +600,7 @@
            this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask.Size = new System.Drawing.Size(70, 15);
            this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask.TabIndex = 39;
            this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask.Text = "label11";
            this.lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask.Click += new System.EventHandler(this.lbl_Alert_Place1014ClearStoreTask_Click);
            // 
            // ck_DataProcess_RobotBuffer_IssueOutboundTask
            // 
@@ -865,18 +855,8 @@
            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);
            this.tabPage3.Controls.Add(this.button22);
            this.tabPage3.Controls.Add(this.button20);
            this.tabPage3.Controls.Add(this.tb_TongJi);
            this.tabPage3.Controls.Add(this.checkBox_NowDay);
            this.tabPage3.Controls.Add(this.dateTimePicker_End);
            this.tabPage3.Controls.Add(this.label16);
            this.tabPage3.Controls.Add(this.dateTimePicker_Start);
            this.tabPage3.Controls.Add(this.btn_TongJi);
            this.tabPage3.Controls.Add(this.button5);
            this.tabPage3.Location = new System.Drawing.Point(4, 28);
            this.tabPage3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.tabPage3.Name = "tabPage3";
@@ -885,6 +865,18 @@
            this.tabPage3.TabIndex = 9;
            this.tabPage3.Text = "数据维护&统计";
            this.tabPage3.UseVisualStyleBackColor = true;
            //
            // button2
            //
            this.button2.BackColor = System.Drawing.Color.Aqua;
            this.button2.Location = new System.Drawing.Point(1022, 349);
            this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(155, 48);
            this.button2.TabIndex = 161;
            this.button2.Text = "更新库存表中的次序字段";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // btn1
            // 
@@ -966,46 +958,6 @@
            this.label23.TabIndex = 153;
            this.label23.Text = "包号:";
            // 
            // button23
            //
            this.button23.BackColor = System.Drawing.Color.Aqua;
            this.button23.Location = new System.Drawing.Point(808, 349);
            this.button23.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.button23.Name = "button23";
            this.button23.Size = new System.Drawing.Size(155, 48);
            this.button23.TabIndex = 152;
            this.button23.Text = "临时-测试btjReceive";
            this.button23.UseVisualStyleBackColor = false;
            this.button23.Click += new System.EventHandler(this.button23_Click);
            //
            // tb_wlm
            //
            this.tb_wlm.Location = new System.Drawing.Point(898, 206);
            this.tb_wlm.Name = "tb_wlm";
            this.tb_wlm.Size = new System.Drawing.Size(339, 25);
            this.tb_wlm.TabIndex = 151;
            //
            // label22
            //
            this.label22.AutoSize = true;
            this.label22.Location = new System.Drawing.Point(794, 209);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(60, 15);
            this.label22.TabIndex = 150;
            this.label22.Text = "物料码:";
            //
            // button22
            //
            this.button22.BackColor = System.Drawing.Color.Aqua;
            this.button22.Location = new System.Drawing.Point(808, 262);
            this.button22.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.button22.Name = "button22";
            this.button22.Size = new System.Drawing.Size(155, 48);
            this.button22.TabIndex = 149;
            this.button22.Text = "临时-测试getEngineInfo";
            this.button22.UseVisualStyleBackColor = false;
            this.button22.Click += new System.EventHandler(this.button22_Click);
            //
            // button20
            // 
            this.button20.BackColor = System.Drawing.Color.DarkOrange;
@@ -1026,67 +978,6 @@
            this.tb_TongJi.Name = "tb_TongJi";
            this.tb_TongJi.Size = new System.Drawing.Size(748, 459);
            this.tb_TongJi.TabIndex = 13;
            //
            // checkBox_NowDay
            //
            this.checkBox_NowDay.AutoSize = true;
            this.checkBox_NowDay.Location = new System.Drawing.Point(533, 132);
            this.checkBox_NowDay.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.checkBox_NowDay.Name = "checkBox_NowDay";
            this.checkBox_NowDay.Size = new System.Drawing.Size(59, 19);
            this.checkBox_NowDay.TabIndex = 12;
            this.checkBox_NowDay.Text = "今天";
            this.checkBox_NowDay.UseVisualStyleBackColor = true;
            this.checkBox_NowDay.CheckedChanged += new System.EventHandler(this.checkBox_NowDay_CheckedChanged);
            //
            // dateTimePicker_End
            //
            this.dateTimePicker_End.Location = new System.Drawing.Point(295, 130);
            this.dateTimePicker_End.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.dateTimePicker_End.Name = "dateTimePicker_End";
            this.dateTimePicker_End.Size = new System.Drawing.Size(200, 25);
            this.dateTimePicker_End.TabIndex = 11;
            //
            // label16
            //
            this.label16.AutoSize = true;
            this.label16.Location = new System.Drawing.Point(253, 138);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(22, 15);
            this.label16.TabIndex = 10;
            this.label16.Text = "至";
            //
            // dateTimePicker_Start
            //
            this.dateTimePicker_Start.Location = new System.Drawing.Point(37, 130);
            this.dateTimePicker_Start.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.dateTimePicker_Start.Name = "dateTimePicker_Start";
            this.dateTimePicker_Start.Size = new System.Drawing.Size(200, 25);
            this.dateTimePicker_Start.TabIndex = 9;
            //
            // btn_TongJi
            //
            this.btn_TongJi.BackColor = System.Drawing.Color.Aqua;
            this.btn_TongJi.Location = new System.Drawing.Point(631, 118);
            this.btn_TongJi.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.btn_TongJi.Name = "btn_TongJi";
            this.btn_TongJi.Size = new System.Drawing.Size(155, 48);
            this.btn_TongJi.TabIndex = 8;
            this.btn_TongJi.Text = "统计信息";
            this.btn_TongJi.UseVisualStyleBackColor = false;
            this.btn_TongJi.Click += new System.EventHandler(this.btn_TongJi_Click);
            //
            // button5
            //
            this.button5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
            this.button5.Location = new System.Drawing.Point(36, 20);
            this.button5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.button5.Name = "button5";
            this.button5.Size = new System.Drawing.Size(177, 48);
            this.button5.TabIndex = 7;
            this.button5.Text = "手动库存维护";
            this.button5.UseVisualStyleBackColor = false;
            this.button5.Click += new System.EventHandler(this.button5_Click);
            // 
            // tabDevice
            // 
@@ -1305,18 +1196,6 @@
            this.lbl_Mode_FJ.Text = "设备模式: ";
            this.lbl_Mode_FJ.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // button2
            //
            this.button2.BackColor = System.Drawing.Color.Aqua;
            this.button2.Location = new System.Drawing.Point(1022, 349);
            this.button2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(155, 48);
            this.button2.TabIndex = 161;
            this.button2.Text = "更新库存表中的次序字段";
            this.button2.UseVisualStyleBackColor = false;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // FormCC
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -1394,16 +1273,10 @@
        private System.Windows.Forms.Label lbl_Alert_DataProcess_RobotBuffer_IssueOutboundTask;
        private System.Windows.Forms.CheckBox ck_DataProcess_RobotBuffer_IssueOutboundTask;
        private System.Windows.Forms.TabPage tabPage3;
        private System.Windows.Forms.Button button5;
        private System.Windows.Forms.Label lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound;
        private System.Windows.Forms.CheckBox ckDataProcess_RobotBuffer_AutoQiTaoOutbound;
        private System.Windows.Forms.Label lbl_DataProcess_RobotBuffer_ModeChange;
        private System.Windows.Forms.CheckBox ck_DataProcess_RobotBuffer_ModeChange;
        private System.Windows.Forms.Button btn_TongJi;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.DateTimePicker dateTimePicker_Start;
        private System.Windows.Forms.DateTimePicker dateTimePicker_End;
        private System.Windows.Forms.CheckBox checkBox_NowDay;
        private System.Windows.Forms.Button button20;
        private System.Windows.Forms.TextBox tb_TongJi;
        private System.Windows.Forms.Label lbl_Alert_DataProcess_RobotBuffer_FinishTaskForOutbound;
@@ -1418,12 +1291,8 @@
        private System.Windows.Forms.CheckBox ck_DataProcess_BZ39;
        private System.Windows.Forms.Label lbl_alert_DataProcess_BZ01;
        private System.Windows.Forms.CheckBox ck_AutoIssueInStoreTask;
        private System.Windows.Forms.Button button22;
        private System.Windows.Forms.Label lbl_alert_DataProcess_269;
        private System.Windows.Forms.CheckBox ck_DataProcess_269;
        private System.Windows.Forms.TextBox tb_wlm;
        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;
CC/iWareCC_ASRS/FormCC.cs
@@ -208,12 +208,13 @@
            new Thread(DataProcess_RobotBuffer_ModeChange.Handler).Start();
            //new Thread(DataProcess_RobotBuffer_ModeChange.Handler).Start();
            new Thread(DataProcess_RobotBuffer_IssueOutboundTask.Handler).Start();
            new Thread(DataProcess_RobotBuffer_AutoQiTaoOutbound.Handler).Start();
            //new Thread(DataProcess_RobotBuffer_AutoQiTaoOutbound.Handler).Start();
            new Thread(DataProcess_RobotBuffer_PesonOutbound.Handler).Start();
            new Thread(DataProcess_RobotBuffer_FinishTaskForOutbound.Handler).Start();
@@ -258,8 +259,7 @@
        }
        private void FormCC_Load(object sender, EventArgs e)
        {
            dateTimePicker_Start.Value = DateTime.Now;
            dateTimePicker_End.Value = DateTime.Now;
            /*
@@ -1238,224 +1238,34 @@
        private void button5_Click(object sender, EventArgs e)
        {
            if (SystemValue.isStartedModel)
            {
                WZ.Useful.Commons.MessageUtil.ShowError("手动库位维护,需要将模式关闭!");
                return;
            }
            //手动库位维护
            SrmStockForm frm = new SrmStockForm();
            frm.ShowDialog();
        }
        private void btn_TongJi_Click(object sender, EventArgs e)
        {
            //统计
            int store_FDJ = 0;//现有发动机数
            int store_EmptySalver = 0;//空托盘数量
            int store_EmptySalver_TS = 0;//空托盘托数
            int count_In_FDJ = 0;//查询某天入库了多少发动机
            int count_In_EmptySalver = 0;//查询某天入库了多少 ç©ºæ‰˜ç›˜
            int count_In_EmptySalver_TS = 0;//查询某天入库了多少 ç©ºæ‰˜ç›˜æ‰˜æ•°
            int count_Out_FDJ = 0;//查询某天出库了多少发动机
            int count_Out_EmptySalver = 0;//查询某天出库了多少 ç©ºæ‰˜ç›˜
            int count_Out_EmptySalver_TS = 0;//查询某天出库了多少 ç©ºæ‰˜ç›˜æ‰˜æ•°
            int count_ZY_EmptySalver = 0;//查询某天转运了多少 ç©ºæ‰˜ç›˜
            int count_ZY_EmptySalver_TS = 0;//查询某天转运了多少 ç©ºæ‰˜ç›˜æ‰˜æ•°
            //某段时间的统计
            var str_start = this.dateTimePicker_Start.Value.ToString("yyyy-MM-dd" + " " + "00:00:00");
            var str_end = this.dateTimePicker_End.Value.ToString("yyyy-MM-dd" + " " + "23:59:59");
            var start = Convert.ToDateTime(str_start);
            var end = Convert.ToDateTime(str_end);
            int allPlacesCount = 0;
            using (DbModel edm = new DbModel())
            {
                var queryMaterialType_一般物料 = (int)MaterialTypeEnum.一般物料;
                var queryMaterialType_托盘 = (int)MaterialTypeEnum.托盘;
                var queryInOutFlag_In = (int)MainInOutFlagEnum.入库;
                var queryInOutFlag_Out = (int)MainInOutFlagEnum.出库;
                var queryInOutFlag_ZY = (int)MainInOutFlagEnum.转运;
                var allPlaces = edm.Base_Station.Where(x => x.IsSrmStation == true).ToList();
                allPlaces = StationHandler.FindCommonFilter(allPlaces);
                allPlacesCount = allPlaces.Count;
                store_FDJ = edm.V_Store.Where(x => x.MaterialType == queryMaterialType_一般物料).Count();
                store_EmptySalver_TS = edm.V_Store.Where(x => x.MaterialType == queryMaterialType_托盘).Count();
                store_EmptySalver = store_EmptySalver_TS == 0 ? 0 : edm.V_Store.Where(x => x.MaterialType == queryMaterialType_托盘).Sum(x => (int)x.Qty);
                //查询某天入库了多少发动机
                var taskState = (int)MainTaskStatusEnum.已完成;
                count_In_FDJ = edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_一般物料 && x.InOutFlag == queryInOutFlag_In && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end)).Count();
                //查询某天入库了多少托盘
                count_In_EmptySalver_TS = edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_托盘 && x.InOutFlag == queryInOutFlag_In && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end)).Count();
                count_In_EmptySalver = count_In_EmptySalver_TS == 0 ? 0 : edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_托盘 && x.InOutFlag == queryInOutFlag_In && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end)).Sum(x => (int)x.Qty);
                //查询某天出库了多少发动机
                count_Out_FDJ = edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_一般物料 && x.InOutFlag == queryInOutFlag_Out && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end)).Count();
                //查询某天入库了多少托盘
                count_Out_EmptySalver_TS = edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_托盘 && x.InOutFlag == queryInOutFlag_Out && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end)).Count();
                count_Out_EmptySalver = count_Out_EmptySalver_TS == 0 ? 0 : edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_托盘 && x.InOutFlag == queryInOutFlag_Out && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end)).Sum(x => (int)x.Qty);
                //查询某天转运了多少托盘(注意:只查询去1014位置的)
                count_ZY_EmptySalver_TS = edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_托盘 && x.InOutFlag == queryInOutFlag_ZY && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end) && x.RealToPlace == "1014").Count();
                count_ZY_EmptySalver = count_ZY_EmptySalver_TS == 0 ? 0 : edm.Task_Main.Where(x => x.MaterialType == queryMaterialType_托盘 && x.InOutFlag == queryInOutFlag_ZY && x.TaskState == taskState && (x.FinishTime >= start && x.FinishTime <= end) && x.RealToPlace == "1014").Sum(x => (int)x.Qty);
            }
            //显示
            //var aa = "\r\n";
            var str = "";
            str += "时间范围: " + str_start + "至" + str_end + " \r\n";
            str += "==================【库存】========================= \r\n";
            str += "现有发动机数: " + store_FDJ + "  \r\n";
            str += "现有空托盘数: " + store_EmptySalver + " \r\n";
            str += "现有空托盘托数: " + store_EmptySalver_TS + " \r\n";
            str += "总库位" + allPlacesCount + ",有发动机或托盘库位" + (store_FDJ + store_EmptySalver_TS) + ",库存占比: " + CSharpHelper.ExecPercent((store_FDJ + store_EmptySalver_TS), allPlacesCount) + " \r\n";
            str += "\r\n";
            str += "==================【入库】========================= \r\n";
            str += "入库发动机数: " + count_In_FDJ + " \r\n";
            str += "入库空托盘数: " + count_In_EmptySalver + " \r\n";
            str += "入库空托盘托数: " + count_In_EmptySalver_TS + " \r\n";
            str += "\r\n";
            str += "==================【出库】========================= \r\n";
            str += "出库发动机数: " + count_Out_FDJ + " \r\n";
            str += "出库空托盘数: " + count_Out_EmptySalver + " \r\n";
            str += "出库空托盘托数: " + count_Out_EmptySalver_TS + " \r\n";
            str += "\r\n";
            str += "==================【转运托盘】========================= \r\n";
            str += "转运空托盘数: " + count_ZY_EmptySalver + " \r\n";
            str += "转运空托盘托数: " + count_ZY_EmptySalver_TS + " \r\n";
            str += "\r\n";
            this.tb_TongJi.Text = str;
        }
        private void checkBox_NowDay_CheckedChanged(object sender, EventArgs e)
        {
            if (this.checkBox_NowDay.Checked)
            {
                dateTimePicker_Start.Value = DateTime.Now;
                dateTimePicker_End.Value = DateTime.Now;
            }
        }
        private void rBOnlyIn_CheckedChanged(object sender, EventArgs e)
        {
            SetModelCheckBoxToSystemValue();
        }
        private void btnSMQZYZTG1_Click(object sender, EventArgs e)
        {
            DobtnSMQZYZTG(EDevice.一号堆垛机);
        }
        private void DobtnSMQZYZTG(EDevice device)
        {
            MessageBoxButtons messButton = MessageBoxButtons.OKCancel;
            DialogResult dr = MessageBox.Show("注意:入库口扫码强制验证通过功能,仅适用于扫码器没有扫到码,但是实际托盘码和堆垛机要执行的任务托盘码一致的情况!如果堆垛机要执行的任务跟实际托盘码不符,请不要点击该按钮,及时联系管理员过来处理。您确定要操作吗?", "确认", messButton);
            if (dr == DialogResult.OK)//如果点击“确定”按钮
            {
                var stationCode = MyExtendHelper.GetRgvStationCodeBySrm(device);
                var srm = FormCC.srmViewDict[(int)device];
                //只有当堆垛机有任务执行时,并且是入库任务的时候才判断
                var realSrmSourcePlace = (int)device + "-" + srm.SrmSourcePlace;
                if (srm.R_TaskNo > 0 && (srm.R_State == (int)ESrmState.取货中 || srm.R_State == (int)ESrmState.取货定位中)
                   && SysGloble.Dict_SpecialPlace_IN.ContainsKey(realSrmSourcePlace))
                {
                    var result = MyExtendHelper.WriteScanValidateACK(false, "入库口扫码强制验证通过", stationCode, srm.R_TaskNo, true, "", "");
                    if (result)
                    {
                        MyExtendHelper.SetSrm_IN_SMQZYZTG(device, true);
                        MessageBox.Show("入库口扫码强制验证通过 æˆåŠŸï¼");
                    }
                    else
                    {
                        MessageBox.Show("入库口扫码强制验证通过 å¤±è´¥ï¼");
                    }
                }
                else
                {
                    MessageBox.Show(device.ToString() + "任务号不是大于0,或者 çŠ¶æ€ä¸æ˜¯ '取货中'或'取货定位中',不允许操作");
                }
            }
            else//如果点击“取消”按钮
            {
            }
        }
        private void button22_Click(object sender, EventArgs e)
        {
            var cargNo = this.tb_wlm.Text.Trim();
            var ret = WmsRequestHelper.test_getEngineInfo(cargNo);
            //转换后
            MesRetModel2<MesRetProductModel> retModel = JsonConvert.DeserializeObject<MesRetModel2<MesRetProductModel>>(ret);
            this.tb_TongJi.Text = "MES返回:" + ret + "\r\n" +
                "转换后:" + "\r\n" +
                JsonConvert.SerializeObject(retModel)
                ;
        }
        private void button23_Click(object sender, EventArgs e)
        {
            var cargNo = this.tb_wlm.Text.Trim();
            var ret = WmsRequestHelper.test_btjReceive(cargNo);
            //转换后
            MessageModel<string> retModel = JsonConvert.DeserializeObject<MessageModel<string>>(ret);
            this.tb_TongJi.Text = "WMS返回:" + ret + "\r\n" +
                "转换后:" + "\r\n" +
                JsonConvert.SerializeObject(retModel);
        }
        private void lbl_Alert_Place1014ClearStoreTask_Click(object sender, EventArgs e)
        {
        }
        private void button24_Click(object sender, EventArgs e)
        {
            //强制该包号出库
            var packageCode = this.tb_PackageCode.Text.Trim();
            ////强制该包号出库
            //var packageCode = this.tb_PackageCode.Text.Trim();
            var alertMsg = "";
            CC_DataProcess_RobotBuffer_ForceOutbound.Handler(packageCode, ref alertMsg);
            if (!string.IsNullOrEmpty(alertMsg))
            {
                MessageBox.Show("错误:" + alertMsg);
            }
            else
            {
                MessageBox.Show("已处理");
            }
            //var alertMsg = "";
            //CC_DataProcess_RobotBuffer_ForceOutbound.Handler(packageCode, ref alertMsg);
            //if (!string.IsNullOrEmpty(alertMsg))
            //{
            //    MessageBox.Show("错误:" + alertMsg);
            //}
            //else
            //{
            //    MessageBox.Show("已处理");
            //}
        }
        private void button25_Click(object sender, EventArgs e)
CC/iWareCC_ASRS/ThreadService/01_BZ01¹¤Î»£¨Çå»Ò£¬Ï´°åºó¹¤Î»£©/DataProcess_BZ01.cs
@@ -46,6 +46,7 @@
                            continue;
                        }
                        var rgvLocation = StationLocationEnum.BZ01.ToString();
                        /*
                         * 1、从数据库中判断是否齐套
@@ -353,6 +354,10 @@
        /// <returns></returns>
        private static bool IsAllloRunOutTaskMode(WmsDBModel wmsDB, mes_batchOrderUPI_new curUpiObj)
        {
            //不再判断 ã€Editby shaocx,2024-12-14】
            return false;
            /*
            //首先查询数据库中是否有 è¦å‡ºåº“的数据
            var isExistOutTaskForNewCreated = wmsDB.wms_rbline_task.Where(x =>
            (x.RbTaskType == (int)RbTaskTypeEnum.齐包出库任务 || x.RbTaskType == (int)RbTaskTypeEnum.强制出库任务)
@@ -420,6 +425,8 @@
            FormCC.IsAllowRunOutMode = true;
            return true;
            //*/
        }
        /// <summary>
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/DataProcess_RobotBuffer_ModeChange.cs
@@ -1,109 +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;
//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>
    /// æœºå™¨äººç¼“存岛 æ¨¡å¼åˆ‡æ¢ å¤„理
    /// </summary>
    public static class DataProcess_RobotBuffer_ModeChange
    {
        public static async void Handler()
        {
            var alertMsg = "";
            LogType logType = LogType.DataProcess_RobotBuffer_ModeChange;
            while (true)
            {
                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = string.Empty;
                try
                {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange &&
                    if ( SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        if (FormCC.IsAllowRunOutMode)
                        {
                            using (WmsDBModel wmsDB = new WmsDBModel())
                            {
                                var rbRunMode = wmsDB.wms_rbline_runmode.FirstOrDefault();
//namespace iWareCC.ThreadService
//{
//    /// <summary>
//    /// æœºå™¨äººç¼“存岛 æ¨¡å¼åˆ‡æ¢ å¤„理
//    /// </summary>
//    public static class DataProcess_RobotBuffer_ModeChange
//    {
//        public static async void Handler()
//        {
//            var alertMsg = "";
//            LogType logType = LogType.DataProcess_RobotBuffer_ModeChange;
//            while (true)
//            {
//                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
//                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = string.Empty;
//                try
//                {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_ModeChange &&
//                    if ( 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;
//                                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_RobotBuffer_ModeChange = $"{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_RobotBuffer_ModeChange = $"已经是出库模式了,此次循环结束";
                                        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_RobotBuffer_ModeChange = $"{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_RobotBuffer_ModeChange = $"已经是出库模式了,此次循环结束";
//                                        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_RobotBuffer_ModeChange = $"{rgvLocation.ToString()}-推送给PLC切换模式 å¤±è´¥,ChangeModeAsync è¿”回:{res.resMsg}";
                                            continue;
                                        }
                                        else
                                        {
                                            Log4NetHelper.WriteInfoLog(logType, $"{rgvLocation.ToString()}-推送给PLC切换模式 æˆåŠŸ,ChangeModeAsync,参数: ç«™ç‚¹{rgvLocation}");
                                        }
                                    }
                                }
//                                    //推送给PLC切换模式
//                                    using (StationServiceClient client = new StationServiceClient())
//                                    {
//                                        var res = await client.ChangeModeAsync((int)EDevice.Station, (int)RbRunModeEnum.出库模式, rgvLocation);
//                                        if (!res.result)
//                                        {
//                                            SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange = $"{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_RobotBuffer_ModeChange += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
                    Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
                }
            }
        }
//                                wmsDB.SaveChanges();
//                            }
//                        }
//                    }
//                }
//                catch (Exception ex)
//                {
//                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_ModeChange += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
//                    Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
//                }
//            }
//        }
    }
}
//    }
//}
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/1¡¢DataProcess_RobotBuffer_AutoQiTaoOutbound.cs
@@ -1,111 +1,111 @@
using Admin.NET.Application;
using iWareCC.Common.Helper;
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;
//using Admin.NET.Application;
//using iWareCC.Common.Helper;
//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_AutoQiTaoOutbound
    {
        public static async void Handler()
        {
            var alertMsg = "";
            LogType logType = LogType.DataProcess_RobotBuffer_AutoQiTaoOutbound;
            while (true)
            {
                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound = string.Empty;
                try
                {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_AutoQiTaoOutbound &&
                    if (SystemValue.isStartedModel)
                    {
//namespace iWareCC.ThreadService
//{
//    /// <summary>
//    /// æœºå™¨äººç¼“存岛 è‡ªåŠ¨é½å¥—å‡ºåº“ å¤„理
//    /// </summary>
//    public static class DataProcess_RobotBuffer_AutoQiTaoOutbound
//    {
//        public static async void Handler()
//        {
//            var alertMsg = "";
//            LogType logType = LogType.DataProcess_RobotBuffer_AutoQiTaoOutbound;
//            while (true)
//            {
//                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
//                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound = string.Empty;
//                try
//                {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_AutoQiTaoOutbound &&
//                    if (SystemValue.isStartedModel)
//                    {
                        using (WmsDBModel wmsDB = new WmsDBModel())
                        {
                            List<wms_stock_quan> qunList = wmsDB.wms_stock_quan.Where(x => x.StockStatus == (int)StockStatusEnum.在库).ToList();
                            var queryPageckCodeList = qunList.Select(x => x.PackageCode).Distinct().ToList();
                            List<mes_batchOrderUPI_new> upiList = wmsDB.mes_batchOrderUPI_new.Where(x => queryPageckCodeList.Contains(x.PackageCode)).ToList();
                            var groups = qunList.GroupBy(x => x.PackageCode);
                            foreach (var group in groups)
                            {
                                var packageCode = group.Key;
                                var allCount = upiList.Where(x => x.PackageCode == packageCode).Count();
                                if (allCount == group.ToList().Count())
                                {
                                    //满足齐套,出库
                                    //注意:排序严格按照 æ¬¡åº è¿›è¡ŒæŽ’序。 ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
                                    var doList = upiList.Where(x => x.PackageCode == packageCode).OrderBy(x => x.Shelf).ToList();
                                    foreach (var item in doList)
                                    {
                                        item.UpiStatus = (int)UpiStatusEnum.已齐包;
                                        item.UpdateTime = DateTime.Now;
//                        using (WmsDBModel wmsDB = new WmsDBModel())
//                        {
//                            List<wms_stock_quan> qunList = wmsDB.wms_stock_quan.Where(x => x.StockStatus == (int)StockStatusEnum.在库).ToList();
//                            var queryPageckCodeList = qunList.Select(x => x.PackageCode).Distinct().ToList();
//                            List<mes_batchOrderUPI_new> upiList = wmsDB.mes_batchOrderUPI_new.Where(x => queryPageckCodeList.Contains(x.PackageCode)).ToList();
//                            var groups = qunList.GroupBy(x => x.PackageCode);
//                            foreach (var group in groups)
//                            {
//                                var packageCode = group.Key;
//                                var allCount = upiList.Where(x => x.PackageCode == packageCode).Count();
//                                if (allCount == group.ToList().Count())
//                                {
//                                    //满足齐套,出库
//                                    //注意:排序严格按照 æ¬¡åº è¿›è¡ŒæŽ’序。 ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
//                                    var doList = upiList.Where(x => x.PackageCode == packageCode).OrderBy(x => x.Shelf).ToList();
//                                    foreach (var item in doList)
//                                    {
//                                        item.UpiStatus = (int)UpiStatusEnum.已齐包;
//                                        item.UpdateTime = DateTime.Now;
                                        var stock = group.ToList().Find(b => b.Upi == item.UPI);
                                        stock.StockStatus = (int)StockStatusEnum.齐包待出库;
//                                        var stock = group.ToList().Find(b => b.Upi == item.UPI);
//                                        stock.StockStatus = (int)StockStatusEnum.齐包待出库;
                                        //生成出库任务
                                        //记录任务
                                        var _id = Yitter.IdGenerator.YitIdHelper.NextId();
                                        var plcTaskNo = BusinessHelper.CreatePlcTaskId();
                                        plcTaskNo = MyExtendHelper.GetNewTaskNo(wmsDB, RbTaskTypeEnum.齐包出库任务, plcTaskNo);
                                        var new_task = new wms_rbline_task()
                                        {
                                            Id = _id,
                                            TaskNo = plcTaskNo,
//                                        //生成出库任务
//                                        //记录任务
//                                        var _id = Yitter.IdGenerator.YitIdHelper.NextId();
//                                        var plcTaskNo = BusinessHelper.CreatePlcTaskId();
//                                        plcTaskNo = MyExtendHelper.GetNewTaskNo(wmsDB, RbTaskTypeEnum.齐包出库任务, plcTaskNo);
//                                        var new_task = new wms_rbline_task()
//                                        {
//                                            Id = _id,
//                                            TaskNo = plcTaskNo,
                                            Upi = stock.Upi,
                                            Length = stock.Length,
                                            Width = stock.Width,
                                            Thk = stock.Thk,
//                                            Upi = stock.Upi,
//                                            Length = stock.Length,
//                                            Width = stock.Width,
//                                            Thk = stock.Thk,
                                            PlanNo = stock.PlanNo,
                                            OrderId = stock.OrderId,
                                            PackageCode = stock.PackageCode,
                                            PlaceCode = stock.PlaceCode,
                                            RbTaskType = (int)RbTaskTypeEnum.齐包出库任务,
                                            TaskStatus = (int)TaskStatusEnum.新建,
                                            TaskMsg = "出库任务",
//                                            PlanNo = stock.PlanNo,
//                                            OrderId = stock.OrderId,
//                                            PackageCode = stock.PackageCode,
//                                            PlaceCode = stock.PlaceCode,
//                                            RbTaskType = (int)RbTaskTypeEnum.齐包出库任务,
//                                            TaskStatus = (int)TaskStatusEnum.新建,
//                                            TaskMsg = "出库任务",
                                            CreateTime = DateTime.Now,
                                            CreateUserName = SysGloble.WCSSystem,
                                            UpdateTime = DateTime.Now,
                                            UpdateUserName = SysGloble.WCSSystem,
                                        };
//                                            CreateTime = DateTime.Now,
//                                            CreateUserName = SysGloble.WCSSystem,
//                                            UpdateTime = DateTime.Now,
//                                            UpdateUserName = SysGloble.WCSSystem,
//                                        };
                                        wmsDB.wms_rbline_task.Add(new_task);
//                                        wmsDB.wms_rbline_task.Add(new_task);
                                        var place = StationHandler.GetPlaceByPlaceCode(stock.PlaceCode, wmsDB);
                                        place.PlaceStatus = (int)PlaceStatusEnum.锁定;
//                                        var place = StationHandler.GetPlaceByPlaceCode(stock.PlaceCode, wmsDB);
//                                        place.PlaceStatus = (int)PlaceStatusEnum.锁定;
                                        Thread.Sleep(100);
                                    }
                                }
                            }
//                                        Thread.Sleep(100);
//                                    }
//                                }
//                            }
                            wmsDB.SaveChanges();
                        }
//                            wmsDB.SaveChanges();
//                        }
                    }
                }
                catch (Exception ex)
                {
                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
                    Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
                }
            }
        }
//                    }
//                }
//                catch (Exception ex)
//                {
//                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
//                    Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
//                }
//            }
//        }
    }
}
//    }
//}
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/5¡¢CC_DataProcess_RobotBuffer_ForceOutbound.cs
ÎļþÒÑɾ³ý
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/5¡¢DataProcess_RobotBuffer_PesonOutbound.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,117 @@
using Admin.NET.Application;
using iWareCC.Common.Helper;
using iWareCommon.Common.Globle;
using iWareCommon.Utils;
using iWareModel;
using iWareSql.DataAccess;
using iWareSql.WmsDBModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace iWareCC.ThreadService
{
    /// <summary>
    /// æœºå™¨äººç¼“存岛 äººå·¥é½åŒ…待出库 å¤„理
    /// </summary>
    public static class DataProcess_RobotBuffer_PesonOutbound
    {
        public static async void Handler()
        {
            var alertMsg = "";
            LogType logType = LogType.DataProcess_RobotBuffer_AutoQiTaoOutbound;
            while (true)
            {
                Thread.Sleep(2000);//休眠2秒,将休眠写到前面,是为了下面的continue方法执行后不显示错误信息的提示!!!【EditBy shaocx,2022-05-24】
                SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound = string.Empty;
                try
                {//SystemValue.isAllowRuning_DataProcess_RobotBuffer_AutoQiTaoOutbound &&
                    if (SystemValue.isStartedModel)
                    {
                        var rgvLocation = StationLocationEnum.BZ39.ToString();
                        if (FormCC.stationView == null)
                        {
                            SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound = $"{rgvLocation.ToString()}-获取PLC对象为null";
                            continue;
                        }
                        var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
                        if (obj.R_OutboundMode == false)
                        {
                            alertMsg = "PLC不是齐包出库模式";
                            continue;
                        }
                        using (WmsDBModel wmsDB = new WmsDBModel())
                        {
                            List<wms_stock_quan> qunList = wmsDB.wms_stock_quan.Where(x => x.StockStatus == (int)StockStatusEnum.齐包待出库
                            ).OrderBy(x => x.PackageCode).ToList();
                            //按照包分组处理
                            var groups = qunList.GroupBy(x => x.PackageCode);
                            foreach (var group in groups)
                            {
                                //注意:排序严格按照 æ¬¡åº è¿›è¡ŒæŽ’序。 ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
                                var stockList = group.ToList().OrderBy(x => x.Shelf).ToList();
                                foreach (var x in stockList)
                                {
                                    x.StockStatus = (int)StockStatusEnum.人工齐包出库任务已创建;
                                    x.StockStatusName = StockStatusEnum.人工齐包出库任务已创建.ToString();
                                    //生成出库任务
                                    //记录任务
                                    var _id = Yitter.IdGenerator.YitIdHelper.NextId();
                                    var plcTaskNo = BusinessHelper.CreatePlcTaskId();
                                    plcTaskNo = MyExtendHelper.GetNewTaskNo(wmsDB, RbTaskTypeEnum.齐包出库任务, plcTaskNo);
                                    var new_task = new wms_rbline_task()
                                    {
                                        Id = _id,
                                        TaskNo = plcTaskNo,
                                        Upi = x.Upi,
                                        Length = x.Length,
                                        Width = x.Width,
                                        Thk = x.Thk,
                                        PlanNo = x.PlanNo,
                                        OrderId = x.OrderId,
                                        PackageCode = x.PackageCode,
                                        PlaceCode = x.PlaceCode,
                                        RbTaskType = (int)RbTaskTypeEnum.齐包出库任务,
                                        TaskStatus = (int)TaskStatusEnum.新建,
                                        TaskMsg = "齐包出库任务",
                                        CreateTime = DateTime.Now,
                                        CreateUserName = SysGloble.WCSSystem,
                                        UpdateTime = DateTime.Now,
                                        UpdateUserName = SysGloble.WCSSystem,
                                    };
                                    wmsDB.wms_rbline_task.Add(new_task);
                                    var place = StationHandler.GetPlaceByPlaceCode(x.PlaceCode, wmsDB);
                                    place.PlaceStatus = (int)PlaceStatusEnum.锁定;
                                    Thread.Sleep(100);
                                }
                            }
                            wmsDB.SaveChanges();
                        }
                    }
                }
                catch (Exception ex)
                {
                    SystemWarningMsg._lbl_Alert_DataProcess_RobotBuffer_AutoQiTaoOutbound += " å‡ºçް异叏:" + ex.Message + SysGloble.SPLIT_STR;
                    Log4NetHelper.WriteErrorLog(logType, " å‡ºçŽ°å¼‚å¸¸ï¼š" + ex.Message, ex);
                }
            }
        }
    }
}
CC/iWareCC_ASRS/ThreadService/02_BZ39¹¤Î»£¨²¹°åºó¹¤Î»£©/Outbound/CC_DataProcess_RobotBuffer_ForceOutbound.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,102 @@
//using Admin.NET.Application;
//using iWareCC.Common.Helper;
//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 CC_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.CreatePlcTaskId();
//                        plcTaskNo = MyExtendHelper.GetNewTaskNo(wmsDB, RbTaskTypeEnum.强制出库任务, plcTaskNo);
//                        var new_task = new wms_rbline_task()
//                        {
//                            Id = _id,
//                            TaskNo = plcTaskNo,
//                            Upi = x.Upi,
//                            Length = x.Length,
//                            Width = x.Width,
//                            Thk = x.Thk,
//                            PlanNo = x.PlanNo,
//                            OrderId = x.OrderId,
//                            PackageCode = x.PackageCode,
//                            PlaceCode = x.PlaceCode,
//                            RbTaskType = (int)RbTaskTypeEnum.强制出库任务,
//                            TaskStatus = (int)TaskStatusEnum.新建,
//                            TaskMsg = "人工强制待出库",
//                            CreateTime = DateTime.Now,
//                            CreateUserName = SysGloble.WCSSystem,
//                            UpdateTime = DateTime.Now,
//                            UpdateUserName = SysGloble.WCSSystem,
//                        };
//                        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/WCF/CCWcfService.cs
@@ -61,6 +61,37 @@
        }
        /// <summary>
        /// éªŒè¯æ¨¡å¼
        /// </summary>
        /// <param name="flag"></param>
        /// <returns></returns>
        public FunRetEntity ValidateMode(int flag)
        {
            try
            {
                var rgvLocation = StationLocationEnum.BZ39.ToString();
                var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
                if (flag == 1)
                {//要强制出库
                    if (obj.R_ForceOutboundMode == false)
                    {
                        return FunRetEntity.Fail("PLC不是强制出库模式");
                    }
                }
                else
                {
                    if (obj.R_OutboundMode == false)
                    {
                        return FunRetEntity.Fail("PLC不是出库模式");
                    }
                }
                return FunRetEntity.Success("成功", "");
            }
            catch (Exception ex)
            {
                return FunRetEntity.Fail("异常:" + ex.Message);
            }
        }
    }
}
CC/iWareCC_ASRS/WCF/ICCWcfService.cs
@@ -31,7 +31,13 @@
        /// <returns></returns>
        [OperationContract]
        FunRetEntity WriteStation_AllowIn();
        /// <summary>
        /// éªŒè¯æ¨¡å¼
        /// </summary>
        /// <param name="flag"></param>
        /// <returns></returns>
        [OperationContract]
        FunRetEntity ValidateMode(int flag);
    }
}
CC/iWareCC_ASRS/iWareCC.csproj
@@ -165,8 +165,9 @@
    <Compile Include="ThreadService\01_BZ01工位(清灰,洗板后工位)\DataProcess_BZ01.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\DataProcess_RobotBuffer_ModeChange.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Inbound\2、DataProcess_BZ39_IssueInboundTask.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\5、DataProcess_RobotBuffer_PesonOutbound.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\4、DataProcess_RobotBuffer_ForceOutbound.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\5、CC_DataProcess_RobotBuffer_ForceOutbound.cs" />
    <Compile Include="ThreadService\02_BZ39工位(补板后工位)\Outbound\CC_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" />
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Connected Services/CCWcfService/Reference.cs
@@ -74,6 +74,9 @@
        
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICCWcfService/WriteStation_AllowIn", ReplyAction="http://tempuri.org/ICCWcfService/WriteStation_AllowInResponse")]
        System.Threading.Tasks.Task<CCWcfService.FunRetEntity> WriteStation_AllowInAsync();
        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICCWcfService/ValidateMode", ReplyAction="http://tempuri.org/ICCWcfService/ValidateModeResponse")]
        System.Threading.Tasks.Task<CCWcfService.FunRetEntity> ValidateModeAsync(int flag);
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")]
@@ -136,6 +139,11 @@
            return base.Channel.WriteStation_AllowInAsync();
        }
        
        public System.Threading.Tasks.Task<CCWcfService.FunRetEntity> ValidateModeAsync(int flag)
        {
            return base.Channel.ValidateModeAsync(flag);
        }
        public virtual System.Threading.Tasks.Task OpenAsync()
        {
            return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsOperationTask/WmsOperationTaskService.cs
@@ -9,6 +9,7 @@
using Admin.NET.Application.Service.WmsTask.WmsRbLineTask.Dto;
using Furion.DatabaseAccessor;
using Admin.NET.Application.Service.WmsCommonnQuery.Dto;
using Admin.NET.Application.CommonHelper;
namespace Admin.NET.Application;
/// <summary>
@@ -102,6 +103,14 @@
            updateQuanList.AddRange(quanList);
        }
        //模式判断
        var client = await WCFServiceHelper.GetWCFService_SAPCC_Client(_sysConfigRep);
        var res = await client.ValidateModeAsync(1);
        if (res.result == false)
        {
            throw Oops.Oh(res.resMsg);
        }
        await _wmsStockQuanRep.UpdateRangeAsync(updateQuanList);
    }
@@ -152,6 +161,14 @@
            updateQuanList.AddRange(quanList);
        }
        //模式判断
        var client = await WCFServiceHelper.GetWCFService_SAPCC_Client(_sysConfigRep);
        var res = await client.ValidateModeAsync(2);
        if (res.result == false)
        {
            throw Oops.Oh(res.resMsg);
        }
        await _wmsStockQuanRep.UpdateRangeAsync(updateQuanList);
    }