From f2bbd33bf5d4a95a138bed23e4990e9a2cbb6032 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 15 十一月 2023 09:00:36 +0800
Subject: [PATCH] 1

---
 WarM/仓库管理/Kf_SellOutBill_BarCodeNote.cs                     |   11 
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user |  122 +++---
 WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs  |    2 
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs       |  208 ++++++++++++
 DAL/基础资料/公用基础资料/ClsGy_BadType_Ctl.cs                        |  100 ++++++
 Model/Model.csproj                                          |    1 
 WebAPI/Controllers/WebAPIController.cs                      |  289 ++++++++++++++++++
 WebAPI/DLL/ClsGy_BadReason_Ctl.cs                           |    5 
 WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs      |   43 ++
 WebAPI/ListModels.cs                                        |   12 
 WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs        |   15 
 Model/生产管理/ClsSc_ICMOBillSub.cs                             |    1 
 WebAPI/Web.config                                           |    4 
 DAL/DAL.csproj                                              |    1 
 Model/基础资料/基础资料/ClsGy_BadReason_Model.cs                    |    1 
 WarM/仓库管理/Kf_SellOutBill_BarCodeNote.designer.cs            |   66 ++--
 WebAPI/Models/ClsGy_Material_Model.cs                       |    2 
 Model/基础资料/基础资料/ClsGy_BadType_Model.cs                      |   17 +
 WebAPI/DLL/ClsGy_Material_Ctl.cs                            |    9 
 19 files changed, 781 insertions(+), 128 deletions(-)

diff --git a/DAL/DAL.csproj b/DAL/DAL.csproj
index b6aebc5..ee91c8b 100644
--- a/DAL/DAL.csproj
+++ b/DAL/DAL.csproj
@@ -88,6 +88,7 @@
     <Compile Include="浠撳簱绠$悊\鏉$爜绠$悊\ClsGy_BarCodeBill_ChaiMa.cs" />
     <Compile Include="浠撳簱绠$悊\鏉$爜绠$悊\ClsKF_BarCodeStatusChangeBill.cs" />
     <Compile Include="鍩虹璧勬枡\InterFace鍩虹璧勬枡\ClsIF_ORGANIZATIONS_View.cs" />
+    <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_BadType_Ctl.cs" />
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_CustLocation_Ctl.cs" />
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_EquipStatus_Ctl.cs" />
     <Compile Include="鍩虹璧勬枡\鍏敤鍩虹璧勬枡\ClsGy_MouldStatus_Ctl.cs" />
diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadType_Ctl.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadType_Ctl.cs"
new file mode 100644
index 0000000..55ce525
--- /dev/null
+++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadType_Ctl.cs"
@@ -0,0 +1,100 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+
+namespace DAL
+{
+    public class ClsGy_BadType_Ctl : DBUtility.ClsGy_Base_Ctl
+    {
+        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+        //鍘熶唬鐮� 鐢ㄤ簬 鏇挎崲瀛愰」鐩�
+        public string HOldNumber;
+        public Model.ClsGy_BadType_Model oModel = new Model.ClsGy_BadType_Model();
+        //鏂板
+        public override bool AddNew()
+        {
+
+            try
+            {
+                oCn.BeginTran();
+                oCn.RunProc("Insert into " + MvarItemKey + " " +
+                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                    ",HGroupID" +
+                    ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HUseFlag,HMakeEmp,HMakeTime) " +
+                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
+                    "," + oModel.HGroupID.ToString() +
+                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'," + oModel.HOrgID + "," + oModel.HOrgID + ",'" + oModel.HUseFlag + "','" + oModel.HMakeEmp + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo);
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //淇敼
+        public override bool ModifyByID(Int64 sItemID)
+        {
+            try
+            {
+                oCn.BeginTran();
+                oCn.RunProc("Update " + MvarItemKey + " set " +
+                    " HNumber='" + oModel.HNumber + "'" +
+                    ",HName='" + oModel.HName + "'" +
+                    ",HShortNumber='" + oModel.HShortNumber + "'" +
+                    ",HHelpCode='" + oModel.HHelpCode + "'" +
+                    ",HModifyEmp='" + oModel.HMakeEmp + "'" +
+                    ",HModifyTime='" + DateTime.Now + "'" +
+                    ",HLevel=" + oModel.HLevel.ToString() +
+                    ",HGroupID=" + oModel.HGroupID.ToString() +
+                    ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
+                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
+                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                //淇敼瀛愰」鐩唬鐮�
+                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+                //灏嗕笂绾� 涓洪潪鏈骇
+                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                //
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+        //鏍规嵁浠g爜鍒ゆ柇淇℃伅
+        public override bool HavParentCode(string sCode, Int64 sItemID)
+        {
+            DataSet DS;
+            try
+            {
+                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
+                if (DS.Tables[0].Rows.Count == 0)
+                    return false;
+                else
+                {
+                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
+                    return true;
+                }
+            }
+            catch (Exception e)
+            {
+                throw (e);
+            }
+        }
+        //鏋勯�犲嚱鏁�
+        public ClsGy_BadType_Ctl()
+        {
+            MvarItemKey = "Gy_BadType";
+            MvarReportTitle = "涓嶈壇绫诲瀷璁剧疆";
+            oModel = new Model.ClsGy_BadType_Model();
+        }
+    }
+}
diff --git a/Model/Model.csproj b/Model/Model.csproj
index 62f9b47..890ed01 100644
--- a/Model/Model.csproj
+++ b/Model/Model.csproj
@@ -330,6 +330,7 @@
     <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_AreaUser_Model.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_BadType_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_BigArea_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_BusinessUnit_Model.cs" />
     <Compile Include="鍩虹璧勬枡\鍩虹璧勬枡\ClsGy_Carbook_Model.cs" />
diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadReason_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadReason_Model.cs"
index 1fa66b5..2b083da 100644
--- "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadReason_Model.cs"
+++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadReason_Model.cs"
@@ -10,6 +10,7 @@
         public Int64 HDeptID;
         public string HDeptNumber;
         public Int64 HProcID;
+        public Int64 HBadTypeID;
         public string HBarCode;
     }
 }
diff --git "a/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadType_Model.cs" "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadType_Model.cs"
new file mode 100644
index 0000000..96f69a8
--- /dev/null
+++ "b/Model/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_BadType_Model.cs"
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Model
+{
+    public class ClsGy_BadType_Model : DBUtility.ClsGy_Base_Model
+    {
+        //
+        public Int64 HGroupID;
+        public string HDeptNumber;
+        public Int64 HProcID;
+        public string HBarCode;
+        public string HMakeEmp;
+        public Int64 HOrgID;
+    }
+}
diff --git "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs" "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs"
index 6a6bb3f..d6dcba7 100644
--- "a/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs"
+++ "b/Model/\347\224\237\344\272\247\347\256\241\347\220\206/ClsSc_ICMOBillSub.cs"
@@ -44,5 +44,6 @@
         public string HCusMaterName; //客户物料名称
         public string HCusModel; //客户规格型号 
 
+        public object HOrderPickRemark { get; set; }
     }
 }
diff --git "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs" "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs"
index fad273f..277071c 100644
--- "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs"
+++ "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs"
@@ -346,6 +346,17 @@
 
         private void sh_Click(object sender, EventArgs e)
         {
+            DataSet ds2 = oCn.RunProcReturn("exec h_p_Kf_CheckSellOutBill_CrediControl " + HInterID.ToString(), "h_p_Kf_CheckSellOutBill_CrediControl");
+            if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
+            {
+                MessageBox.Show("瀹℃牳閿�鍞嚭搴撳崟锛屼俊鐢ㄦ帶鍒跺垽鏂敊璇紒", "鎻愮ず");
+                return;
+            }
+            else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 1)
+            {
+                MessageBox.Show(DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]), "鎻愮ず");
+                return;
+            }
             DataSet ds = oCn.RunProcReturn("exec h_p_Kf_SellOutBill_Check " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'", "h_p_Kf_SellOutBill_Check");
             if (ds == null || ds.Tables[0].Rows.Count == 0)
             {
diff --git "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.designer.cs" "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.designer.cs"
index 38c0de5..300ce3a 100644
--- "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.designer.cs"
+++ "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.designer.cs"
@@ -30,8 +30,8 @@
         {
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Kf_SellOutBill_BarCodeNote));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
             this.Tool = new System.Windows.Forms.ToolStrip();
             this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
             this.mrlk = new System.Windows.Forms.ToolStripButton();
@@ -57,6 +57,7 @@
             this.label4 = new System.Windows.Forms.Label();
             this.txtHSellStyle = new System.Windows.Forms.TextBox();
             this.gbUp = new System.Windows.Forms.GroupBox();
+            this.pic1 = new System.Windows.Forms.PictureBox();
             this.txtHCreditDifference = new System.Windows.Forms.TextBox();
             this.txtHCreditRating = new System.Windows.Forms.TextBox();
             this.txtHMoney = new System.Windows.Forms.TextBox();
@@ -110,10 +111,10 @@
             this.涓棿 = new System.Windows.Forms.Panel();
             this.搴曢儴 = new System.Windows.Forms.Panel();
             this.鍙充晶 = new System.Windows.Forms.Panel();
-            this.pic1 = new System.Windows.Forms.PictureBox();
             this.Tool.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdMain)).BeginInit();
             this.gbUp.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.grdSub)).BeginInit();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
@@ -122,7 +123,6 @@
             this.panel1.SuspendLayout();
             this.groupBox1.SuspendLayout();
             this.panel2.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
             this.SuspendLayout();
             // 
             // Tool
@@ -213,12 +213,14 @@
             this.tp.Text = "鐢宠鐗规壒";
             this.tp.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
             this.tp.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.tp.Visible = false;
             this.tp.Click += new System.EventHandler(this.tp_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
             this.toolStripSeparator1.Size = new System.Drawing.Size(6, 50);
+            this.toolStripSeparator1.Visible = false;
             // 
             // sh
             // 
@@ -307,14 +309,14 @@
             this.grdMain.AllowUserToDeleteRows = false;
             this.grdMain.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
             this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle9.Font = new System.Drawing.Font("瀹嬩綋", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.grdMain.DefaultCellStyle = dataGridViewCellStyle9;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("瀹嬩綋", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.grdMain.DefaultCellStyle = dataGridViewCellStyle1;
             this.grdMain.Dock = System.Windows.Forms.DockStyle.Fill;
             this.grdMain.Location = new System.Drawing.Point(3, 3);
             this.grdMain.Margin = new System.Windows.Forms.Padding(0);
@@ -443,6 +445,17 @@
             this.gbUp.Size = new System.Drawing.Size(1105, 218);
             this.gbUp.TabIndex = 58;
             this.gbUp.TabStop = false;
+            // 
+            // pic1
+            // 
+            this.pic1.BackColor = System.Drawing.SystemColors.ActiveCaption;
+            this.pic1.Location = new System.Drawing.Point(861, 22);
+            this.pic1.Name = "pic1";
+            this.pic1.Size = new System.Drawing.Size(66, 30);
+            this.pic1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.pic1.TabIndex = 338;
+            this.pic1.TabStop = false;
+            this.pic1.Visible = false;
             // 
             // txtHCreditDifference
             // 
@@ -853,14 +866,14 @@
             this.grdSub.AllowUserToDeleteRows = false;
             this.grdSub.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
             this.grdSub.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle10.Font = new System.Drawing.Font("瀹嬩綋", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.grdSub.DefaultCellStyle = dataGridViewCellStyle10;
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle2.Font = new System.Drawing.Font("瀹嬩綋", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.grdSub.DefaultCellStyle = dataGridViewCellStyle2;
             this.grdSub.Dock = System.Windows.Forms.DockStyle.Fill;
             this.grdSub.Location = new System.Drawing.Point(0, 73);
             this.grdSub.Margin = new System.Windows.Forms.Padding(0);
@@ -1022,17 +1035,6 @@
             this.鍙充晶.Size = new System.Drawing.Size(12, 627);
             this.鍙充晶.TabIndex = 64;
             // 
-            // pic1
-            // 
-            this.pic1.BackColor = System.Drawing.SystemColors.ActiveCaption;
-            this.pic1.Location = new System.Drawing.Point(861, 22);
-            this.pic1.Name = "pic1";
-            this.pic1.Size = new System.Drawing.Size(66, 30);
-            this.pic1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-            this.pic1.TabIndex = 338;
-            this.pic1.TabStop = false;
-            this.pic1.Visible = false;
-            // 
             // Kf_SellOutBill_BarCodeNote
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1056,6 +1058,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.grdMain)).EndInit();
             this.gbUp.ResumeLayout(false);
             this.gbUp.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pic1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.grdSub)).EndInit();
             this.tabControl1.ResumeLayout(false);
             this.tabPage1.ResumeLayout(false);
@@ -1065,7 +1068,6 @@
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
             this.panel2.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pic1)).EndInit();
             this.ResumeLayout(false);
 
         }
diff --git a/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs b/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
index 6fe24ad..a31ef73 100644
--- a/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -292,7 +292,7 @@
             {
                 List<object> columnNameList = new List<object>();
                 //鏌ョ湅鏉冮檺
-                if (!DBUtility.ClsPub.Security_Log("Gy_BadReason", 1, false, user))
+                if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Query", 1, false, user))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -301,16 +301,9 @@
                     return objJsonResult;
                 }
 
-                if (sWhere == null || sWhere.Equals(""))
-                {
-                    ds = oCN.RunProcReturn("select * from h_v_IF_BadReasonList " + sWhere + " order by 涓嶈壇鍘熷洜浠g爜 ", "h_v_IF_BadReasonList");
-                }
-                else
-                {
-                    string sql1 = "select * from h_v_IF_BadReasonList where 1 = 1";
-                    string sql = sql1 + sWhere + " order by 涓嶈壇鍘熷洜浠g爜 ";
-                    ds = oCN.RunProcReturn(sql, "h_v_IF_BadReasonList");
-                }
+                string sql1 = "select * from h_v_gy_BadTypeList where 1 = 1";
+                string sql = sql1 + sWhere + " order by 涓嶈壇绫诲瀷浠g爜 ";
+                ds = oCN.RunProcReturn(sql, "h_v_gy_BadTypeList");
 
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 1a67950..0038234 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -83,7 +83,7 @@
                     return objJsonResult;
                 }
 
-                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "")
+                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "姝e父")
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -411,6 +411,16 @@
                 sub = JsonConvert.DeserializeObject<List<Model.ClsSc_AssemblyBillSub>>(sSubStr);
 
 
+                ds = oCN.RunProcReturn("select  * from h_v_Gy_QualifiedRecordsList where 浜у搧鏉$爜='" + omodel.HBarCode_P + "'", "h_v_Gy_QualifiedRecordsList");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏉$爜:" + omodel.HBarCode_P + ",宸插瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
                 Int64 HInterID1 = DBUtility.ClsPub.CreateBillID("3727", ref DBUtility.ClsPub.sExeReturnInfo);
                 string HBillNo1 = DBUtility.ClsPub.CreateBillCode("3727", ref DBUtility.ClsPub.sExeReturnInfo, true);
                 //淇濆瓨鐢熶骇缁勮鍗曚富琛�
@@ -531,8 +541,15 @@
                   "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + ") ");
                 }
 
+              
+
+                ds = oCN.RunProcReturn("select  * from Sc_StationOutBillSub_SN where HInterID='" + omodel.HInterID + "' order by HEntryID desc", "Sc_StationOutBillSub_SN");
+
                 oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
-values({omodel.HInterID}, '{omodel.HBillNo}', {ds.Tables[0].Rows.Count + 1}, '{omodel.HBarCode_P}', 1, GETDATE(), '', 0, 0, '', '', 0, 0)");
+values({omodel.HInterID}, '{omodel.HBillNo}', {(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)}, '{omodel.HBarCode_P}', 1, GETDATE(), '', " + HProcExchInterID + ","+ HProcExchEntryID + ", '"+ HProcExchBillNo + "', '', 0, 0)");
+
+                //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑鍚堟牸鏁伴噺
+                oCN.RunProc("update Sc_StationOutBillMain set HQty+=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID);
 
                 oCN.Commit();
 
@@ -572,14 +589,20 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                else
+
+                if (ds.Tables[0].Rows[0]["HStatus"].ToString() !="")
                 {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "";
-                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "褰撳墠鏉$爜鐨勭姸鎬佷负:"+ ds.Tables[0].Rows[0]["HStatus"].ToString() + "锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
                 }
 
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                objJsonResult.data = ds.Tables[0];
                 return objJsonResult;
             }
             catch (Exception e)
@@ -625,7 +648,7 @@
                     return objJsonResult;
                 }
 
-                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "") {
+                if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "姝e父") {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
                     objJsonResult.Message = "褰撳墠鏉$爜鐘舵�佷负"+ ds.Tables[0].Rows[0]["HStatus"].ToString() + "!";
@@ -682,12 +705,12 @@
         #region  宸ュ簭鍗曞搧杩囩珯 鏌ヨ鍚堟牸璁板綍
         [Route("Cj_SingleStation/HGRecordsList")]
         [HttpGet]
-        public object HGRecordsList(string HBarCode, string user)
+        public object HGRecordsList(string sWhere, string user)
         {
             try
             {
 
-                ds = oCN.RunProcReturn(@"select * from h_v_Sc_AssemblyBillList where HProcExchBillNo='" + HBarCode + "'", "h_v_Sc_AssemblyBillList");
+                ds = oCN.RunProcReturn(@"select * from h_v_Gy_QualifiedRecordsList where 1=1"+ sWhere, "h_v_Gy_QualifiedRecordsList");
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -701,6 +724,116 @@
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ュ簭鍗曞搧杩囩珯 鍒犻櫎涓嶈壇璁板綍
+        [Route("Cj_SingleStation/DelBadRecords")]
+        [HttpGet]
+        public object DelBadRecords(int HInterID, int HEntryID, string user,int HProcID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_Gy_BadRecordsList  where HInterID = " + HInterID, "h_v_Gy_BadRecordsList");
+
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                    objJsonResult.data = null;
+                }
+
+                oCN.BeginTran();
+
+                string sql = "";
+                sql = "delete from Sc_QualityReportBillMain where HInterID = " + HInterID;
+                oCN.RunProc(sql);
+                sql = "delete from Sc_QualityReportBillSub where HInterID = " + HInterID + " and HEntryID = " + HEntryID;
+                oCN.RunProc(sql);
+                string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString();
+                string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString();
+                //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑涓嶈壇鏁伴噺
+                oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID);
+
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ュ簭鍗曞搧杩囩珯 鍒犻櫎鍚堟牸璁板綍
+        [Route("Cj_SingleStation/DelQualifiedRecords")]
+        [HttpGet]
+        public object DelQualifiedRecords(int HInterID, int HEntryID, string user)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from h_v_Gy_QualifiedRecordsList  where hmainid = " + HInterID, "h_v_Gy_QualifiedRecordsList");
+
+                string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString();
+                string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString();
+                if (ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ユ棤鏁版嵁锛�";
+                    objJsonResult.data = null;
+                }
+
+                oCN.BeginTran();
+
+                string sql = "";
+                if (ds.Tables[0].Rows.Count == 1) {
+                    sql = "delete from Sc_StationOutBillMain where HInterID = " + HInterID;
+                    oCN.RunProc(sql);
+                }
+                ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_SN where HInterID = " + HInterID + " and HEntryID = " + HEntryID, "Sc_StationOutBillSub_SN");
+                string HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString();
+                string HBillNo_bak = ds.Tables[0].Rows[0]["HBillNo_bak"].ToString();
+
+                //鍒犻櫎缁勮杩芥函鍗�
+                oCN.RunProc("delete from Sc_AssemblyBillSub where HInterID in(select HInterID from Sc_AssemblyBillMain where HMainSourceInterID=" + HProcExchInterID + " and HMainSourceEntryID=" + HProcExchEntryID + " and HBarCode_P='" + HBarCode + "')");
+                oCN.RunProc("delete from   Sc_AssemblyBillMain where HMainSourceInterID=" + HProcExchInterID + " and HMainSourceEntryID=" + HProcExchEntryID + " and HBarCode_P='" + HBarCode + "'");
+
+                sql = "delete from Sc_StationOutBillSub_SN where HInterID = " + HInterID + " and HEntryID = " + HEntryID;
+                oCN.RunProc(sql);
+                //鍙嶅啓宸ュ簭鍑虹珯鍗曠殑鍚堟牸鏁伴噺
+                oCN.RunProc("update Sc_StationOutBillMain set HQty-=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HBillNo='"+ HBillNo_bak + "'");
+
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
                 objJsonResult.data = null;
                 return objJsonResult;
             }
@@ -815,8 +948,9 @@
                 string[] sArray = msg.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                 string sMainStr = sArray[0].ToString();
                 string sSubStr = sArray[1].ToString();
-                string user = sArray[2].ToString();
-                string HResult = sArray[3].ToString();
+                string sSubStr2 = sArray[2].ToString();
+                string user = sArray[3].ToString();
+                string HResult = sArray[4].ToString();
 
                 oCN.BeginTran();
                 if (HResult == "閰嶄欢")
@@ -836,8 +970,56 @@
 ({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID}
 ,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')");
 
+
+                    ds = oCN.RunProcReturn("select  * from Sc_SourceLineRepairBillSub where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillSub");
+                    if (ds.Tables[0].Rows[0]["HRepairResult"].ToString() == "OK") {
+                        //鐢熸垚 浜х嚎缁勮杩芥函鍗�
+
+                        Int64 HInterID1 = DBUtility.ClsPub.CreateBillID("3727", ref DBUtility.ClsPub.sExeReturnInfo);
+                        string HBillNo1 = DBUtility.ClsPub.CreateBillCode("3727", ref DBUtility.ClsPub.sExeReturnInfo, true);
+
+                        ds = oCN.RunProcReturn("select  * from Sc_SourceLineRepairBillMain where HInterID=" + model.HInterID, "Sc_SourceLineRepairBillMain");
+                        string HMaterID = ds.Tables[0].Rows[0]["HMaterID"].ToString();
+                        //淇濆瓨鐢熶骇缁勮鍗曚富琛�
+                        string sql = $@"Insert Into Sc_AssemblyBillMain(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate
+,HBillNo,HBillStatus,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo
+,HICMOInterID,HICMOBillNo,HBarCode_P,HMaterID,HUnitID,HAssemblyStatus,HProdOrgID)
+values('{DateTime.Now.Year}','{DateTime.Now.Month}','3727','3727',{HInterID1},getdate()
+,'{HBillNo1}','1','{user}',getdate(),{temp.HProcExchInterID.ToString()},{temp.HProcExchEntryID.ToString()},'{temp.HProcExchBillNo.ToString()}'
+,{model.HICMOInterID.ToString()},'{model.HICMOBillNo.ToString()}','{model.HBarCode.ToString()}',{HMaterID},0,'姹囨姤',{model.HProdOrgID})";
+                        oCN.RunProc(sql);
+
+                       List<Model.Sc_AssemblyBill_BindSourceTemp>  sub = new List<Model.Sc_AssemblyBill_BindSourceTemp>();
+                        sub = JsonConvert.DeserializeObject<List<Model.Sc_AssemblyBill_BindSourceTemp>>(sSubStr2);
+
+                        for (int i = 0; i < sub.Count; i++)
+                        {
+                            //瀛愯〃瀛樺偍
+                            string sq2 = $@"Insert Into Sc_AssemblyBillSub(HInterID,HBillNo_bak,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo
+,HSourceBillType,HMaterID,HSourceID,HEquipID,HUnitID,HQty
+,HGroupID,HWorkerID,HScanDate,HBarCode,HBarCode_P,HSNNumber)
+values({HInterID1},'{HBillNo1}',{(i + 1)},0,0,''
+,'',{sub[i].HMaterID},0,0,0,{sub[i].HQty}
+,0,0,getdate(),'{sub[i].HBarCode}','{model.HBarCode}','') ";
+                            oCN.RunProc(sq2);
+                        }
+
+                        //鐢熶骇宸ュ簭鍑虹珯SN鏁版嵁
+                        ds = oCN.RunProcReturn("select top 1  HInterID,HBillNo from Sc_StationOutBillMain where HProcExchInterID=" + temp.HProcExchInterID + " and HProcExchEntryID=" + temp.HProcExchEntryID + " and HBadCount<>0  order by  HInterID desc", "Sc_StationOutBillMain");
+
+                        string HInterIDSN = ds.Tables[0].Rows[0]["HInterID"].ToString();
+                        string HBillNoSN = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+
+                        ds = oCN.RunProcReturn("select *  from Sc_StationOutBillSub_SN where HInterID=" + HInterIDSN , "Sc_StationOutBillSub_SN");
+
+                        oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney)
+values({HInterIDSN}, '{HBillNoSN}', {ds.Tables[0].Rows.Count + 1}, '{model.HBarCode}', 1, GETDATE(), '', "+ temp.HProcExchInterID + ","+ temp.HProcExchEntryID+ ", '"+ temp.HProcExchBillNo+ "', '', 0, 0)");
+                        //鍙嶅啓宸ュ簭鍑虹珯鍗� 涓昏〃 涓嶈壇鏁伴噺 鍜� 鍚堟牸鏁伴噺
+                        oCN.RunProc("update Sc_StationOutBillMain set HQty+=1,HBadCount-=1  where HInterID='" + HInterIDSN + "'");
+
+                    }
                     //淇敼閰嶄欢缁戝畾娓呭崟缁戝畾鐨勬潯鐮佹壒鍙�
-                    oCN.RunProc("exec h_p_AssemblyBill_Temp '" + temp.HProcExchBillNo + "'," + model.HProcess + "," + temp.HMaterID + ",'" + temp.HBatchNo + "'");
+                    //oCN.RunProc("exec h_p_AssemblyBill_Temp '" + temp.HProcExchBillNo + "'," + model.HProcess + "," + temp.HMaterID + ",'" + temp.HBatchNo + "'");
                 }
                 else if (HResult == "NG"|| HResult == "OK") {
                     Model.ClsSc_SourceLineRepairBillMain model = new Model.ClsSc_SourceLineRepairBillMain();
diff --git a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
index 3f53aa9..ee29387 100644
--- a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
@@ -777,7 +777,7 @@
                 else if (com.Type == 3772)
                 {
                     //鐢熶骇璁㈠崟 涓嬫煡 宸ュ簭娴佽浆鍗� 
-                    ds = oCN.RunProcReturn($"select * from h_v_Sc_ProcessExchangeBillQuery where HICMOInterID='{com.HSouceInterID}' and HICMOEntryID={com.HSourceEntryID}", "h_v_Sc_ProcessExchangeBillQuery");
+                    ds = oCN.RunProcReturn($"select * from h_v_Sc_ProcessExchangeBillQuery where HICMOInterID='{com.HSouceInterID}' and HICMOEntryID={com.HSourceEntryID} and HBillSubType<>'SUB'", "h_v_Sc_ProcessExchangeBillQuery");
                 }
 
                 //娣诲姞鍒楀悕
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 6695dfb..59b8a9a 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -2338,6 +2338,295 @@
         }
 
         /// <summary>
+        /// 淇濆瓨涓嶈壇绫诲瀷
+        /// </summary>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [Route("SaveGy_BadType")]
+        [HttpPost]
+        public object SaveGy_BadType([FromBody] JObject msg)
+        {
+            DataSet ds;
+            var _value = msg["msg"].ToString();
+            string msg3 = _value.ToString();
+            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg1 = sArray[0].ToString();
+            string msg2 = sArray[1].ToString();
+
+            //鏌ョ湅鏉冮檺
+            if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Edit", 1, false, msg2))
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+            Int64 HItemID = 0;
+            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+            //鑾峰彇鏈�澶D鍊艰祴鍊�
+            DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_BadType ", "Gy_BadType");
+            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
+            {
+                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
+                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
+                maxid += 1;
+                HItemID = maxid;
+            }
+            ListModels oListModels = new ListModels();
+            try
+            {
+                DAL.ClsGy_BadType_Ctl oBill = new DAL.ClsGy_BadType_Ctl();
+                List<Model.ClsGy_BadType_Model> lsmain = new List<Model.ClsGy_BadType_Model>();
+                msg1 = msg1.Replace("\\", "");
+                msg1 = msg1.Replace("\n", "");  //\n
+                lsmain = oListModels.getObjectByJson_Gy_BadType(msg1);
+                foreach (Model.ClsGy_BadType_Model oItem in lsmain)
+                {
+                    if (oItem.HNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (oItem.HName.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+
+                    ds = oCN.RunProcReturn("select * from  Gy_BadType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadType");
+                    if (oItem.HNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    //鏂板鏃跺垽鏂�
+                    if (oItem.HItemID == 0)
+                    {
+                        if (ds == null || ds.Tables[0].Rows.Count == 0)
+                        {
+
+                        }
+                        else
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+                            objJsonResult.data = 1;
+                            return objJsonResult;
+                        }
+                        //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+                        string sParent;
+                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+                        if (sParent.Trim() == "")
+                        {
+                            oBill.oModel.HParentID = 0;
+                        }
+                        else
+                        {
+                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
+                            {
+                                oBill.oModel.HParentID = oBill.oModel.HItemID;
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+                                objJsonResult.data = 1;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    else//缂栬緫鏃跺垽鏂�
+                    {
+                        //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+                        string sParent;
+                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+                        if (sParent.Trim() == "")
+                        {
+                            oBill.oModel.HParentID = 0;
+                        }
+                        else
+                        {
+                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+                            {
+                                oBill.oModel.HParentID = oBill.oModel.HItemID;
+                            }
+                            else
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+                                objJsonResult.data = 1;
+                                return objJsonResult;
+                            }
+                        }
+                    }
+                    //寰楀埌鐭唬鐮�
+                    string sShortNumber;
+                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
+                    if (sShortNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+                    oItem.HEndFlag = true;//鏈骇鏍囧織
+                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+
+                    oBill.oModel = oItem;
+                }
+
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                bool bResult;
+                if (oBill.oModel.HItemID == 0)
+                {
+                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+                    bResult = oBill.AddNew();
+                }
+                else
+                {
+                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+                }
+                if (bResult)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                    //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+                    objJsonResult.data = 1;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+        }
+
+
+        /// <summary>
+        /// 涓嶈壇绫诲瀷鑾峰彇淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("GetGy_BadTypeDetail")]
+        [HttpGet]
+        public ApiResult<DataSet> GetGy_BadTypeDetail(string HID)
+        {
+            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_gy_BadTypeList  where HItemID= " + HID + " ", "h_v_gy_BadTypeList");
+            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+                return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄤ笉鑹被鍨嬫暟鎹�" };
+            return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
+        }
+
+        /// <summary>
+        /// 涓嶈壇绫诲瀷鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetGy_BadType")]
+        [HttpGet]
+        public object DeltetGy_BadType(string HItemID, string user)
+        {
+            DataSet ds;
+            //string ModRightNameCheck = "Sc_ProcessReport_check";
+            try
+            {
+                //鍒犻櫎鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                if (string.IsNullOrWhiteSpace(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Gy_BadType where HItemID=" + HItemID, "Gy_BadType");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+                //if (HStopflag)
+                //{
+                //    oCN.RollBack();//鍥炴粴浜嬪姟
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                oCN.RunProc("delete Gy_BadType where HItemID=" + HItemID);
+                oCN.Commit();//鎻愪氦浜嬪姟
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult; ;
+
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        /// <summary>
         /// 涓嶈壇鍘熷洜鑾峰彇淇℃伅
         /// </summary>
         /// <returns></returns>
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
index 775940d..215f510 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
@@ -586,14 +586,14 @@
                 ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS
                 ,HBomID,HEntryCusID,HSTOCKINORGID
 				,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney
-                ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark,HCusMaterName,HCusModel) 
+                ,HAuxQty,HAuxUnit,HWidth,HWeight,HColorRemark,HCusMaterName,HCusModel,HOrderPickRemark) 
                  values({HInterID},{HEntryID},{(oSub.HQty == null ? 0 : oSub.HQty)}
                 ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}'
                 ,'{(oSub.HBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HBeginDate.ToString())}','{(oSub.HEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HEndDate.ToString())}'
                 ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},{oSub.HSTATUS}
                  ,{oSub.HBomID}  ,{oSub.HCusID} ,{oSub.HSTOCKINORGID}
 	                    ,0,0,'','',0,0
-                ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}')");
+                ,{oSub.HAuxQty},{oSub.HAuxUnit},{oSub.HWidth},{oSub.HWeight},'{oSub.HColorRemark}','{oSub.HCusMaterName}','{oSub.HCusModel}','{oSub.HOrderPickRemark}')");
 
             objJsonResult.code = "1";
             objJsonResult.count = 1;
@@ -1995,5 +1995,44 @@
         }
         #endregion
 
+
+        #region 鐢熶骇浠诲姟鍗曡鍗曞寘瑁呭娉� 淇濆瓨鍔熻兘
+        [Route("Sc_ICMOBill/ICMOBillSaveRemark")]
+        [HttpGet]
+        public object ICMOBillSaveRemark(string HInterID,string HEntryID, string HOrderPickRemark)
+        {
+            try
+            {
+                if (string.IsNullOrEmpty(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "Exception锛丠InterID涓嶈兘涓虹┖";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+                oCN.BeginTran();
+                 oCN.RunProc("update Sc_ICMOBillSub set HOrderPickRemark = '" + HOrderPickRemark + "' where HInterID = " + HInterID + " and  HEntryID = " + HEntryID + "");
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/DLL/ClsGy_BadReason_Ctl.cs b/WebAPI/DLL/ClsGy_BadReason_Ctl.cs
index 13d9431..558e765 100644
--- a/WebAPI/DLL/ClsGy_BadReason_Ctl.cs
+++ b/WebAPI/DLL/ClsGy_BadReason_Ctl.cs
@@ -21,10 +21,10 @@
                 oCn.RunProc("Insert into " + MvarItemKey + " " +
                     " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                     ",HDeptID,HProcID" +
-                    ",HLevel,HEndFlag,HStopflag,HRemark) " +
+                    ",HLevel,HEndFlag,HStopflag,HRemark,HBadTypeID) " +
                     " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                     "," + oModel.HDeptID.ToString() + "," + oModel.HProcID.ToString() +
-                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "',"+oModel.HBadTypeID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                 oCn.Commit();
@@ -50,6 +50,7 @@
                     ",HHelpCode='" + oModel.HHelpCode + "'" +
                     ",HLevel=" + oModel.HLevel.ToString() +
                     ",HDeptID=" + oModel.HDeptID.ToString() +
+                    ",HBadTypeID=" + oModel.HBadTypeID.ToString() +
                     ",HProcID=" + oModel.HProcID.ToString() +
                     ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                     ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
diff --git a/WebAPI/DLL/ClsGy_Material_Ctl.cs b/WebAPI/DLL/ClsGy_Material_Ctl.cs
index 438e794..ea9aa33 100644
--- a/WebAPI/DLL/ClsGy_Material_Ctl.cs
+++ b/WebAPI/DLL/ClsGy_Material_Ctl.cs
@@ -27,7 +27,7 @@
                     ",HSubjoin,HSubjoin2,HColor,HVersion,HEngName,HEngModel,HPropertyTypeID,HSPGroupID,HSPID,HMinPickQty,HUSEORGID,HERPItemID" +
                     ",HSALEUNITID,HSALEPRICEUNITID,HBASEUNITID,HSTOREUNITID,HCHECKINCOMING,HCHECKPRODUCT,HPERUNITSTANDHOUR" +
                     ",HSTDLABORPREPARETIME,HSTDMACHINEPREPARETIME,HWidth,HWeight,HColorRemark,HQCSchemeID_Fst,HQCSchemeID_Proc,HQCSchemeID_Patrol" +
-                    ",HMaterRuleType,HColorNo) " +
+                    ",HMaterRuleType,HColorNo,HPieceMaxQty) " +
                     " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                     ", " + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'" +
                     ",'" + oModel.HModel + "'," + oModel.HUnitID.ToString() + "," + oModel.HMaterClsID.ToString() + "," + oModel.HMaterTypeID.ToString() + "," + oModel.HUnitGroupID.ToString() +
@@ -36,7 +36,7 @@
                     ", " + oModel.HKeepDays.ToString() + "," + oModel.HPlanPrice.ToString() + "," + oModel.HstdPrice.ToString() + "," + oModel.HQtyMin.ToString() + "," + oModel.HQtyMax.ToString() +
                     ",'" + oModel.HSubjoin + "','" + oModel.HSubjoin2 + "','" + oModel.HColor + "','" + oModel.HVersion + "','" + oModel.HEngName + "','" + oModel.HEngModel + "'," + oModel.HPropertyTypeID.ToString() + "," + oModel.HSPGroupID.ToString() + "," + oModel.HSPID.ToString() + "," + oModel.HMinPickQty.ToString() + "," + oModel.HUSEORGID + "," + oModel.HERPItemID + "," + oModel.HSALEUNITID + "," + oModel.HSALEPRICEUNITID + "," + oModel.HBASEUNITID + "," + oModel.HSTOREUNITID + "," + oModel.HCHECKINCOMING + "," + oModel.HCHECKPRODUCT + "," + oModel.HPERUNITSTANDHOUR + "," + oModel.HSTDLABORPREPARETIME + "," + oModel.HSTDMACHINEPREPARETIME + ","+ oModel.HWidth + "," + oModel.HWeight + ",'"+ oModel.HColorRemark + "'," + oModel.HQCSchemeID_Fst + ","
                        + oModel.HQCSchemeID_Proc + "," + oModel.HQCSchemeID_Patrol + "" +
-                       ",'"+ oModel.HMaterRuleType + "','"+ oModel.HColorNo + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                       ",'"+ oModel.HMaterRuleType + "','"+ oModel.HColorNo + "','" + oModel.HPieceMaxQty.ToString() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                 oCn.Commit();
@@ -65,14 +65,14 @@
                     ",HWhID,HRoutingID,HBomID,HSecUnitID,HSecUnitRate" +
                     ",HHighStock,HLowStock,HSafeStock,HOrderPrice,HSalePrice" +
                     ",HKeepDays,HPlanPrice,HstdPrice,HQtyMin,HQtyMax" +
-                    ",HSubjoin,HSubjoin2,HColor,HVersion,HEngName,HEngModel,HPropertyTypeID,HSPGroupID,HSPID,HMinPickQty,HCREATEORGID,HUSEORGID,HERPItemID,HBatchManager,HOldMaterNumber) " +
+                    ",HSubjoin,HSubjoin2,HColor,HVersion,HEngName,HEngModel,HPropertyTypeID,HSPGroupID,HSPID,HMinPickQty,HCREATEORGID,HUSEORGID,HERPItemID,HBatchManager,HOldMaterNumber,HPieceMaxQty) " +
                     " Values('" + oModel.HItemID + "','" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                     ", " + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'" +
                     ",'" + oModel.HModel + "'," + oModel.HUnitID.ToString() + "," + oModel.HMaterClsID.ToString() + "," + oModel.HMaterTypeID.ToString() + "," + oModel.HUnitGroupID.ToString() +
                     ", " + oModel.HWhID.ToString() + "," + oModel.HRoutingID.ToString() + "," + oModel.HBomID.ToString() + "," + oModel.HSecUnitID.ToString() + "," + oModel.HSecUnitRate.ToString() +
                     ", " + oModel.HHighStock.ToString() + "," + oModel.HLowStock.ToString() + "," + oModel.HSafeStock.ToString() + "," + oModel.HOrderPrice.ToString() + ",'" + oModel.HSalePrice + "'" +
                     ", " + oModel.HKeepDays.ToString() + "," + oModel.HPlanPrice.ToString() + "," + oModel.HstdPrice.ToString() + "," + oModel.HQtyMin.ToString() + "," + oModel.HQtyMax.ToString() +
-                    ",'" + oModel.HSubjoin + "','" + oModel.HSubjoin2 + "','" + oModel.HColor + "','" + oModel.HVersion + "','" + oModel.HEngName + "','" + oModel.HEngModel + "'," + oModel.HPropertyTypeID.ToString() + "," + oModel.HSPGroupID.ToString() + "," + oModel.HSPID.ToString() + "," + oModel.HMinPickQty.ToString() + "," + oModel.HCREATEORGID + "," + oModel.HUSEORGID + "," + oModel.HERPItemID + "," + oModel.HBatchManager + ",'" + oModel.HOldMaterNumber + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    ",'" + oModel.HSubjoin + "','" + oModel.HSubjoin2 + "','" + oModel.HColor + "','" + oModel.HVersion + "','" + oModel.HEngName + "','" + oModel.HEngModel + "'," + oModel.HPropertyTypeID.ToString() + "," + oModel.HSPGroupID.ToString() + "," + oModel.HSPID.ToString() + "," + oModel.HMinPickQty.ToString() + "," + oModel.HCREATEORGID + "," + oModel.HUSEORGID + "," + oModel.HERPItemID + "," + oModel.HBatchManager + ",'" + oModel.HOldMaterNumber + "','" + oModel.HPieceMaxQty.ToString() + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                 sql = "set identity_insert gy_material off";
                 oCn.RunProc(sql);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
@@ -148,6 +148,7 @@
                     ",HQCSchemeID_Fst= " + oModel.HQCSchemeID_Fst +
                     ",HQCSchemeID_Proc= " + oModel.HQCSchemeID_Proc +
                     ",HQCSchemeID_Patrol= " + oModel.HQCSchemeID_Patrol +
+                    ",HPieceMaxQty=" + oModel.HPieceMaxQty.ToString() +
                     ",HSTDMACHINEPREPARETIME=" + oModel.HSTDMACHINEPREPARETIME.ToString() + "Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼瀛愰」鐩唬鐮�
                 oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs
index c234e3d..9fd70e2 100644
--- a/WebAPI/ListModels.cs
+++ b/WebAPI/ListModels.cs
@@ -713,6 +713,18 @@
         }
 
         /// <summary>
+        /// 澶勭悊鏂板涓嶈壇绫诲瀷琛ㄧ殑json
+        /// </summary>
+        /// <param name="jsonString"></param>
+        /// <returns></returns>
+        public List<Model.ClsGy_BadType_Model> getObjectByJson_Gy_BadType(string jsonString)
+        {
+            jsonString = "[" + jsonString.ToString() + "]";
+            List<Model.ClsGy_BadType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_BadType_Model>>(jsonString);
+            return list;
+        }
+
+        /// <summary>
         /// 澶勭悊鏂板鏁呴殰鍘熷洜琛ㄧ殑json
         /// </summary>
         /// <param name="jsonString"></param>
diff --git a/WebAPI/Models/ClsGy_Material_Model.cs b/WebAPI/Models/ClsGy_Material_Model.cs
index 2fff414..cb772e8 100644
--- a/WebAPI/Models/ClsGy_Material_Model.cs
+++ b/WebAPI/Models/ClsGy_Material_Model.cs
@@ -63,5 +63,7 @@
         public int HQCSchemeID_Proc;
         public int HQCSchemeID_Patrol;
         public string HColorNo;//棰滆壊鑹插彿
+        public double HPieceMaxQty; //鍗曚欢鏈�澶т笂闄�
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index 0ff2907..34f8b09 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -9,7 +9,7 @@
   </PropertyGroup>
   <ItemGroup>
     <File Include="apiapp.json">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="bin/Antlr3.Runtime.dll">
       <publishTime>02/22/2013 16:43:40</publishTime>
@@ -81,7 +81,7 @@
       <publishTime>08/25/2021 10:28:25</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="bin/Kingdee.BOS.WebApi.FormService.dll">
       <publishTime>09/20/2018 19:23:20</publishTime>
@@ -115,7 +115,7 @@
       <publishTime>11/15/2023 08:53:01</publishTime>
     </File>
     <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="bin/Newtonsoft.Json.dll">
       <publishTime>08/04/2014 04:33:56</publishTime>
@@ -251,7 +251,7 @@
       <publishTime>11/28/2018 21:01:00</publishTime>
     </File>
     <File Include="bin/System.Web.Http.WebHost.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="bin/System.Web.Mvc.dll">
       <publishTime>01/28/2015 12:02:18</publishTime>
@@ -306,58 +306,58 @@
       <publishTime>11/29/2018 21:26:30</publishTime>
     </File>
     <File Include="Config/kdapi.config">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="Content/bootstrap.css">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="Content/bootstrap.min.css">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="Content/Site.css">
-      <publishTime>04/06/2023 15:57:01</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/BLL.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/DAL.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/DBUtility.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/Kingdee.BOS.WebApi.Client.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/Model.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/Newtonsoft.Json.Net35.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:56</publishTime>
     </File>
     <File Include="DLL/Pub_Class.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="DLL/Pub_Control.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="DLL/SQLHelper.dll">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.eot">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.svg">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.ttf">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="fonts/glyphicons-halflings-regular.woff">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Global.asax">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="grpc_csharp_ext.x64.dll">
       <publishTime>03/22/2022 13:17:22</publishTime>
@@ -366,7 +366,7 @@
       <publishTime>03/22/2022 13:17:22</publishTime>
     </File>
     <File Include="Index.html">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="libgrpc_csharp_ext.x64.dylib">
       <publishTime>03/19/2022 07:38:44</publishTime>
@@ -375,121 +375,121 @@
       <publishTime>03/19/2022 07:38:42</publishTime>
     </File>
     <File Include="libman.json">
-      <publishTime>07/12/2023 08:14:21</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Metadata/deploymentTemplates/apiappconfig.azureresource.json">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="packages.config">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/bootstrap.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery-1.10.2.min.map">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/jquery.validate.unobtrusive.min.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Scripts/modernizr-2.6.2.js">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Shared/Error.cshtml">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/Shared/_Layout.cshtml">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/web.config">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Views/_ViewStart.cshtml">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Customer_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Department_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Employee_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_StockPlace_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Supplier_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsCLD_Warehouse_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BadReason_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_BarCodeBill_WMS_Model_View.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Customer_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Department_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Employee_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Group_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Item30JiTai_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Source_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_StockPlace_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Supplier_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsGy_Warehouse_Model.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsKf_ICStockBill_Mould.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/ClsKf_ICStockBill_WMS.datasource">
-      <publishTime>04/06/2023 15:57:02</publishTime>
+      <publishTime>09/25/2023 09:42:57</publishTime>
     </File>
     <File Include="Web References/WebS/Reference.cs">
       <publishTime>12/20/2021 13:19:56</publishTime>
     </File>
     <File Include="Web References/WebS/Reference.map">
-      <publishTime>11/03/2023 22:05:51</publishTime>
+      <publishTime>11/01/2023 11:13:09</publishTime>
     </File>
     <File Include="Web References/WebS/WebService1.disco">
       <publishTime>12/20/2021 13:19:56</publishTime>
diff --git a/WebAPI/Web.config b/WebAPI/Web.config
index e339306..1a5fed7 100644
--- a/WebAPI/Web.config
+++ b/WebAPI/Web.config
@@ -22,7 +22,7 @@
 		<!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>-->
 		<!--<add key="FileIP" value="http://localhost:8080/" />-->
 		<!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/>    -->
-		<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/><!--棰滃彴寮忔満-->
+		<!--<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/>--><!--棰滃彴寮忔満-->
 		<!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> 澶忓疂-->
 		<!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> -->
 		<!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/>    鍗氭棩绉戞妧-->
@@ -34,7 +34,7 @@
 		<!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/>     瀹夌憺鏈嶅姟鍣�-->
 		<!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/> -->	<!--娴嬭瘯鏈嶅姟鍣�-->
 		<!--<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/>    鏈湴-->
-		<!--<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/>	闄堥洴闈欐湰鍦伴厤缃�-->
+		<add key="sUrl" value="http://192.168.56.1:81/web/WebService1.asmx"/>	<!--闄堥洴闈欐湰鍦伴厤缃�-->
 		<add key="webpages:Version" value="3.0.0.0" />
 		<add key="webpages:Enabled" value="false" />
 		<add key="ClientValidationEnabled" value="true" />

--
Gitblit v1.9.1