1
duhe
2023-09-06 2ac90163499626a2e2c4b4a46219b944dc6c9b17
1
8个文件已修改
756 ■■■■■ 已修改文件
WarM/条码打印/Kf_WeighToBarCode.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Kf_WeighToBarCode_StationOutBill.cs 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Kf_WeighToBarCode_StationOutBill.designer.cs 164 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/条码打印/Kf_WeighToBarCode_StationOutBill.resx 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_SourceController.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/LMESController.cs 268 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode.cs
@@ -523,6 +523,17 @@
        //条码生成前判断
        private bool Sub_AllowSave()
        {
            //判断当前单据ID是否已上传生成单据
            DataSet Ds = oCn.RunProcReturn("select top 1 1 from KF_WeighSource_Temp with(nolock) where HInterID=" + HInterID.ToString() + " and HRelationInterID=1 ", "KF_WeighSource_Temp", ref DBUtility.ClsPub.sExeReturnInfo);
            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            {
            }
            else
            {
                MessageBox.Show("当前条码记录已换班上传生成单据,请退出后重新进入该模块进行条码生成操作!", "提示");
                return false;
            }
            if (HInterID==0 || HBillNo=="")
            {
                MessageBox.Show("获取条码对应单据ID或单据号失败,请重新刷新界面!", "提示");
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode_StationOutBill.cs
@@ -35,6 +35,7 @@
        public Int64 HProcessExchangeEntryID = 0;
        public Int64 HSupID = 0;
        public double HSourceQty = 0;
        public double HMaterWeight = 0;         //物料克重
        public string HCusMaterName = "";       //客户物料名称
        public string HCusModel = "";           //客户规格型号
        public string HMaker = DBUtility.ClsPub.CurUserName;
@@ -522,7 +523,7 @@
            if (chkHDYFlag.Checked == true)
            {
                //打印条码
                Sub_SetReport("物料条码");
                Sub_SetReport("半成品条码");
                Report.Print(false);
                Thread.Sleep(1000);
            }
@@ -542,6 +543,8 @@
            }
            txtHQty.Text = "";
            txtHWeightQyt.Text = "";
            txtHBarcodeNo.Text = "";
            txtHQty.Focus();
        }
@@ -574,12 +577,37 @@
                MessageBox.Show("请输入正确米数!", "提示");
                return false;
            }
            else if (DBUtility.ClsPub.isDoule(txtHWeightQyt.Text) == 0)
            {
                MessageBox.Show("请输入正确重量!", "提示");
                return false;
            }
            else if (DBUtility.ClsPub.isInt(txtHBarcodeNo.Text) == 0)
            {
                MessageBox.Show("请输入包号!", "提示");
                return false;
            }
            else if (DBUtility.ClsPub.isDoule(txtHProcID.Tag) == 0)
            {
                MessageBox.Show("请先选择工序!", "提示");
                return false;
            }
            //实际克重=重量/米数*1000,实际克重超出物料维护克重的百分之二十或不足物料维护克重的百分之八十,预警提示
            double sQty = 0;    //实际克重
            sQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text) / DBUtility.ClsPub.isDoule(txtHQty.Text) * 1000;
            if (sQty > HMaterWeight * 1.2 || sQty < HMaterWeight * 0.8)
            {
                if (MessageBox.Show("物料维护克重为:" + HMaterWeight.ToString() + ",实际克重为:" + sQty.ToString() + ",所输入实际克重超出物料维护克重的百分之二十或不足物料维护克重的百分之八十,请检查输入的数据是否正确!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            return true;
        }
@@ -641,9 +669,11 @@
            string HBarCodeType = "";
            Int64 HMaterID2 = 0;
            double HQty = 0;            //米数
            double HMaterialJQty = 0;   //重量
            Int64 HGroupID = 0;
            Int64 HDeptID = 0;
            string HProcessExchangeBillNo = "";
            Int64 HBarcodeNo = 0;       //包数
            string HMaterName = "";
            string HMaterModel = "";
            Int64 HProcID = 0;
@@ -655,9 +685,11 @@
            HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text);
            HMaterID2 = DBUtility.ClsPub.isLong(txtHMaterNumber.Tag);
            HQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
            HMaterialJQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text);
            HGroupID = DBUtility.ClsPub.isLong(txtHGroupID.Tag);
            HDeptID = DBUtility.ClsPub.isLong(txtHDeptName.Tag);
            HProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text);
            HBarcodeNo = DBUtility.ClsPub.isLong(txtHBarcodeNo.Text);
            HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text);
            HMaterModel = DBUtility.ClsPub.isStrNull(txtHMaterModel.Text);
            HProcID = DBUtility.ClsPub.isLong(txtHProcID.Tag);
@@ -683,8 +715,8 @@
                + " '" + HBarCode + "','" + HBarCodeType + "'," + HMaterID2.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString()
                + ",'" + HBatchNo + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + HMaker + "',getdate(),0," + HQty.ToString()
                + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "',''"
                + ", 1,1," + HDeptID.ToString() + ",0,0,''"
                + ", 0,'',getdate(),'','" + sDate + "',0,0"
                + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + ",0,0,''"
                + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + ",0"
                + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0"
                + ", " + HProcessExchangeInterID.ToString() + "," + HProcessExchangeEntryID.ToString() + ",'" + HProcessExchangeBillNo + "',0,'" + HCusMaterName + "','" + HCusModel + "'"
                + ", " + HProcID.ToString() + "," + HCenterID.ToString() + "," + HSourceID.ToString() + "," + HProcNo.ToString() + "," + HSourceQty.ToString()
@@ -727,6 +759,7 @@
            HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("数量")].Value);
            HProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HProcessExchangeInterID")].Value);
            HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value);
            HMaterWeight = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HMaterWeight")].Value);
            HCusMaterName = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusMaterName")].Value);
            HCusModel = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusModel")].Value);
        }
@@ -928,6 +961,50 @@
        #endregion
        #region  //流水号扫描
        private void txtHProcNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                if (txtHProcNo.Text == "")
                {
                    MessageBox.Show("流水号为空,请输入流水号!");
                    return;
                }
                //根据转卡主ID、流水号带出流转卡上相应工序、班组、工作中心、生产资源
                DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetBCPWeighSource_HProcNo " + HProcessExchangeInterID.ToString() + "," + txtHProcNo.Text, "h_p_KF_GetBCPWeighSource_HProcNo");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    txtHProcNo.Text = "";
                    txtHProcID.Tag = 0;
                    txtHProcID.Text = "";
                    txtHCenterID.Tag = 0;
                    txtHCenterID.Text = "";
                    txtHGroupID.Tag = 0;
                    txtHGroupID.Text = "";
                    txtHSourceID.Tag = 0;
                    txtHSourceID.Text = "";
                    MessageBox.Show("所输入流水号不在当前工序流转卡下,请重新输入流水号!");
                    return;
                }
                else
                {
                    HProcessExchangeEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"]);
                    txtHProcNo.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcNo"]);
                    txtHProcID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcID"]);
                    txtHProcID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcName"]);
                    txtHCenterID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCenterID"]);
                    txtHCenterID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCenterName"]);
                    txtHGroupID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
                    txtHGroupID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HGroupName"]);
                    txtHSourceID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
                    txtHSourceID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceName"]);
                }
            }
        }
        #endregion
        #region  //工序选择
        private void cmdHProcID_Click(object sender, EventArgs e)
@@ -970,5 +1047,106 @@
        }
        #endregion
        #region  //生产资源选择
        private void txtHSourceID_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Return)
            {
                if (DBUtility.ClsPub.isStrNull(txtHSourceID.Text) != "")
                {
                    DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
                    if (oSource.GetInfoByID(DBUtility.ClsPub.isLong(txtHSourceID.Text.Replace("HCX", ""))))
                    {
                        txtHSourceID.Text = oSource.omodel.HName;
                        txtHSourceID.Tag = oSource.omodel.HItemID;
                    }
                    else
                    {
                        txtHSourceID.Text = "";
                        txtHSourceID.Tag = 0;
                    }
                }
                else
                {
                    txtHSourceID.Text = "";
                    txtHSourceID.Tag = 0;
                }
            }
        }
        private void txtHSourceID_Click(object sender, EventArgs e)
        {
            txtHSourceID.SelectAll();
        }
        private void txtHSourceID_TextChanged(object sender, EventArgs e)
        {
            BLL.ClsPub_BLL.Sub_ClearText(txtHSourceID);
        }
        private void cmdHSourceID_Click(object sender, EventArgs e)
        {
            DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
            if (oSource.RefreshView())
            {
                txtHSourceID.Text = oSource.oModel.HName;
                txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
            }
            else
            {
                txtHSourceID.Text = "";
            }
        }
        #endregion
        #region  //生产班组选择
        private void cmdHGroupID_Click(object sender, EventArgs e)
        {
            DAL.ClsGy_Group_View oGroup = new DAL.ClsGy_Group_View();
            if (oGroup.RefreshView())
            {
                txtHGroupID.Text = oGroup.oModel.HName;
                txtHGroupID.Tag = oGroup.oModel.HItemID.ToString();
            }
            else
            {
                txtHGroupID.Text = "";
            }
        }
        private void txtHGroupID_TextChanged(object sender, EventArgs e)
        {
            BLL.ClsPub_BLL.Sub_ClearText(txtHGroupID);
        }
        #endregion
        #region  //工作中心选择
        private void cmdHCenterID_Click(object sender, EventArgs e)
        {
            DAL.ClsGy_WorkCenter_View oWorkCenter = new DAL.ClsGy_WorkCenter_View();
            if (oWorkCenter.RefreshView())
            {
                txtHCenterID.Text = oWorkCenter.oModel.HName;
                txtHCenterID.Tag = oWorkCenter.oModel.HItemID.ToString();
            }
            else
            {
                txtHCenterID.Text = "";
            }
        }
        private void txtHCenterID_TextChanged(object sender, EventArgs e)
        {
            BLL.ClsPub_BLL.Sub_ClearText(txtHCenterID);
        }
        #endregion
    }
}
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode_StationOutBill.designer.cs
@@ -30,8 +30,8 @@
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Kf_WeighToBarCode_StationOutBill));
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = 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();
@@ -55,6 +55,13 @@
            this.label4 = new System.Windows.Forms.Label();
            this.txtHMaterNumber = new System.Windows.Forms.TextBox();
            this.gbUp = new System.Windows.Forms.GroupBox();
            this.cmdHCenterID = new System.Windows.Forms.Button();
            this.cmdHGroupID = new System.Windows.Forms.Button();
            this.cmdHSourceID = new System.Windows.Forms.Button();
            this.label15 = new System.Windows.Forms.Label();
            this.txtHBarcodeNo = new System.Windows.Forms.TextBox();
            this.label18 = new System.Windows.Forms.Label();
            this.txtHWeightQyt = new System.Windows.Forms.TextBox();
            this.label17 = new System.Windows.Forms.Label();
            this.txtHProcNo = new System.Windows.Forms.TextBox();
            this.label16 = new System.Windows.Forms.Label();
@@ -270,14 +277,14 @@
            this.grdMain.AllowUserToDeleteRows = false;
            this.grdMain.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
            this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            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;
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.grdMain.DefaultCellStyle = dataGridViewCellStyle3;
            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);
@@ -315,7 +322,7 @@
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label3.ForeColor = System.Drawing.Color.Black;
            this.label3.Location = new System.Drawing.Point(272, 88);
            this.label3.Location = new System.Drawing.Point(662, 116);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(29, 12);
            this.label3.TabIndex = 52;
@@ -325,10 +332,10 @@
            // 
            this.txtHProcID.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtHProcID.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.txtHProcID.Location = new System.Drawing.Point(303, 84);
            this.txtHProcID.Location = new System.Drawing.Point(693, 112);
            this.txtHProcID.Name = "txtHProcID";
            this.txtHProcID.ReadOnly = true;
            this.txtHProcID.Size = new System.Drawing.Size(112, 21);
            this.txtHProcID.Size = new System.Drawing.Size(108, 21);
            this.txtHProcID.TabIndex = 53;
            this.txtHProcID.TextChanged += new System.EventHandler(this.txtHProcID_TextChanged);
            // 
@@ -356,6 +363,13 @@
            // gbUp
            // 
            this.gbUp.BackColor = System.Drawing.Color.Transparent;
            this.gbUp.Controls.Add(this.cmdHCenterID);
            this.gbUp.Controls.Add(this.cmdHGroupID);
            this.gbUp.Controls.Add(this.cmdHSourceID);
            this.gbUp.Controls.Add(this.label15);
            this.gbUp.Controls.Add(this.txtHBarcodeNo);
            this.gbUp.Controls.Add(this.label18);
            this.gbUp.Controls.Add(this.txtHWeightQyt);
            this.gbUp.Controls.Add(this.label17);
            this.gbUp.Controls.Add(this.txtHProcNo);
            this.gbUp.Controls.Add(this.label16);
@@ -399,12 +413,88 @@
            this.gbUp.TabIndex = 58;
            this.gbUp.TabStop = false;
            // 
            // cmdHCenterID
            //
            this.cmdHCenterID.BackColor = System.Drawing.Color.Transparent;
            this.cmdHCenterID.Image = ((System.Drawing.Image)(resources.GetObject("cmdHCenterID.Image")));
            this.cmdHCenterID.ImageAlign = System.Drawing.ContentAlignment.TopRight;
            this.cmdHCenterID.Location = new System.Drawing.Point(409, 111);
            this.cmdHCenterID.Name = "cmdHCenterID";
            this.cmdHCenterID.Size = new System.Drawing.Size(22, 22);
            this.cmdHCenterID.TabIndex = 332;
            this.cmdHCenterID.UseVisualStyleBackColor = false;
            this.cmdHCenterID.Click += new System.EventHandler(this.cmdHCenterID_Click);
            //
            // cmdHGroupID
            //
            this.cmdHGroupID.BackColor = System.Drawing.Color.Transparent;
            this.cmdHGroupID.Image = ((System.Drawing.Image)(resources.GetObject("cmdHGroupID.Image")));
            this.cmdHGroupID.ImageAlign = System.Drawing.ContentAlignment.TopRight;
            this.cmdHGroupID.Location = new System.Drawing.Point(201, 111);
            this.cmdHGroupID.Name = "cmdHGroupID";
            this.cmdHGroupID.Size = new System.Drawing.Size(22, 22);
            this.cmdHGroupID.TabIndex = 331;
            this.cmdHGroupID.UseVisualStyleBackColor = false;
            this.cmdHGroupID.Click += new System.EventHandler(this.cmdHGroupID_Click);
            //
            // cmdHSourceID
            //
            this.cmdHSourceID.BackColor = System.Drawing.Color.Transparent;
            this.cmdHSourceID.Image = ((System.Drawing.Image)(resources.GetObject("cmdHSourceID.Image")));
            this.cmdHSourceID.ImageAlign = System.Drawing.ContentAlignment.TopRight;
            this.cmdHSourceID.Location = new System.Drawing.Point(604, 111);
            this.cmdHSourceID.Name = "cmdHSourceID";
            this.cmdHSourceID.Size = new System.Drawing.Size(22, 22);
            this.cmdHSourceID.TabIndex = 330;
            this.cmdHSourceID.UseVisualStyleBackColor = false;
            this.cmdHSourceID.Click += new System.EventHandler(this.cmdHSourceID_Click);
            //
            // label15
            //
            this.label15.AutoSize = true;
            this.label15.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label15.ForeColor = System.Drawing.Color.Black;
            this.label15.Location = new System.Drawing.Point(466, 88);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(29, 12);
            this.label15.TabIndex = 328;
            this.label15.Text = "包号";
            //
            // txtHBarcodeNo
            //
            this.txtHBarcodeNo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtHBarcodeNo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.txtHBarcodeNo.Location = new System.Drawing.Point(498, 84);
            this.txtHBarcodeNo.Name = "txtHBarcodeNo";
            this.txtHBarcodeNo.Size = new System.Drawing.Size(128, 21);
            this.txtHBarcodeNo.TabIndex = 329;
            //
            // label18
            //
            this.label18.AutoSize = true;
            this.label18.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label18.ForeColor = System.Drawing.Color.Black;
            this.label18.Location = new System.Drawing.Point(272, 88);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(29, 12);
            this.label18.TabIndex = 326;
            this.label18.Text = "重量";
            //
            // txtHWeightQyt
            //
            this.txtHWeightQyt.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtHWeightQyt.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.txtHWeightQyt.Location = new System.Drawing.Point(303, 84);
            this.txtHWeightQyt.Name = "txtHWeightQyt";
            this.txtHWeightQyt.Size = new System.Drawing.Size(128, 21);
            this.txtHWeightQyt.TabIndex = 327;
            //
            // label17
            // 
            this.label17.AutoSize = true;
            this.label17.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label17.ForeColor = System.Drawing.Color.Black;
            this.label17.Location = new System.Drawing.Point(454, 88);
            this.label17.Location = new System.Drawing.Point(650, 88);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(41, 12);
            this.label17.TabIndex = 324;
@@ -414,18 +504,18 @@
            // 
            this.txtHProcNo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtHProcNo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.txtHProcNo.Location = new System.Drawing.Point(498, 84);
            this.txtHProcNo.Location = new System.Drawing.Point(693, 84);
            this.txtHProcNo.Name = "txtHProcNo";
            this.txtHProcNo.ReadOnly = true;
            this.txtHProcNo.Size = new System.Drawing.Size(128, 21);
            this.txtHProcNo.TabIndex = 325;
            this.txtHProcNo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtHProcNo_KeyDown);
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label16.ForeColor = System.Drawing.Color.Black;
            this.label16.Location = new System.Drawing.Point(626, 88);
            this.label16.Location = new System.Drawing.Point(27, 144);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(65, 12);
            this.label16.TabIndex = 320;
@@ -435,7 +525,7 @@
            // 
            this.txtHICMOBillNo.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtHICMOBillNo.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.txtHICMOBillNo.Location = new System.Drawing.Point(693, 84);
            this.txtHICMOBillNo.Location = new System.Drawing.Point(95, 140);
            this.txtHICMOBillNo.Name = "txtHICMOBillNo";
            this.txtHICMOBillNo.ReadOnly = true;
            this.txtHICMOBillNo.Size = new System.Drawing.Size(128, 21);
@@ -459,15 +549,17 @@
            this.txtHCenterID.Location = new System.Drawing.Point(303, 112);
            this.txtHCenterID.Name = "txtHCenterID";
            this.txtHCenterID.ReadOnly = true;
            this.txtHCenterID.Size = new System.Drawing.Size(128, 21);
            this.txtHCenterID.Size = new System.Drawing.Size(108, 21);
            this.txtHCenterID.TabIndex = 319;
            this.txtHCenterID.TextChanged += new System.EventHandler(this.txtHCenterID_TextChanged);
            // 
            // cmdHProcID
            // 
            this.cmdHProcID.BackColor = System.Drawing.Color.Transparent;
            this.cmdHProcID.Enabled = false;
            this.cmdHProcID.Image = ((System.Drawing.Image)(resources.GetObject("cmdHProcID.Image")));
            this.cmdHProcID.ImageAlign = System.Drawing.ContentAlignment.TopRight;
            this.cmdHProcID.Location = new System.Drawing.Point(409, 83);
            this.cmdHProcID.Location = new System.Drawing.Point(799, 111);
            this.cmdHProcID.Name = "cmdHProcID";
            this.cmdHProcID.Size = new System.Drawing.Size(22, 22);
            this.cmdHProcID.TabIndex = 317;
@@ -570,9 +662,11 @@
            this.txtHSourceID.ImeMode = System.Windows.Forms.ImeMode.NoControl;
            this.txtHSourceID.Location = new System.Drawing.Point(498, 112);
            this.txtHSourceID.Name = "txtHSourceID";
            this.txtHSourceID.ReadOnly = true;
            this.txtHSourceID.Size = new System.Drawing.Size(128, 21);
            this.txtHSourceID.Size = new System.Drawing.Size(108, 21);
            this.txtHSourceID.TabIndex = 151;
            this.txtHSourceID.Click += new System.EventHandler(this.txtHSourceID_Click);
            this.txtHSourceID.TextChanged += new System.EventHandler(this.txtHSourceID_TextChanged);
            this.txtHSourceID.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtHSourceID_KeyPress);
            // 
            // label9
            // 
@@ -592,8 +686,9 @@
            this.txtHGroupID.Location = new System.Drawing.Point(95, 112);
            this.txtHGroupID.Name = "txtHGroupID";
            this.txtHGroupID.ReadOnly = true;
            this.txtHGroupID.Size = new System.Drawing.Size(128, 21);
            this.txtHGroupID.Size = new System.Drawing.Size(108, 21);
            this.txtHGroupID.TabIndex = 149;
            this.txtHGroupID.TextChanged += new System.EventHandler(this.txtHGroupID_TextChanged);
            // 
            // label7
            // 
@@ -733,14 +828,14 @@
            this.grdSub.AllowUserToDeleteRows = false;
            this.grdSub.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
            this.grdSub.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            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;
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.grdSub.DefaultCellStyle = dataGridViewCellStyle4;
            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);
@@ -973,5 +1068,12 @@
        private System.Windows.Forms.TextBox txtHICMOBillNo;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.TextBox txtHProcNo;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.TextBox txtHBarcodeNo;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.TextBox txtHWeightQyt;
        private System.Windows.Forms.Button cmdHSourceID;
        private System.Windows.Forms.Button cmdHCenterID;
        private System.Windows.Forms.Button cmdHGroupID;
    }
}
WarM/ÌõÂë´òÓ¡/Kf_WeighToBarCode_StationOutBill.resx
@@ -435,6 +435,51 @@
  <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>102, 16</value>
  </metadata>
  <data name="cmdHCenterID.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        R0lGODlhEAAQAIZBAAAzmQBmzP///1o7AJlmAOazAMTz/9mmAEW5//nNT+W5ToPV/5TW/cyZAAyf/7Dp
        /yOn/2jD/q3h/le8/sz3/5zg/7bt/73l/7Xs/2fH/4DT///bnZXb/97//2rK/wWb/8np/6zf/1S//77x
        /73w/8Xv/1+//wmc/1jA/5Db/5LV/6rn/6Xb/zCt/33O/9X3/4LO/7jj/4PT/x+m/7nk/3XP/3PJ/3bQ
        /6Tb/5Td/zCv/3fM/029/4za/6Pf/ZHc/6Pk/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEBAAAh+QQB
        AABBACwAAAAAEAAQAAAIqACDCBwoMIDBAAQTBjEYIcKECQYVLmQQ44KJFhBmQECYMAAOEAJYnPjgwAHH
        gQEYqAhBA4YOBDwQIDg5cYcLGyg8LOixYAFNABJkZBBRI8cDEg98ACAIlIOGGylWGOhgwMBSphUq/ACC
        wQAFClcFEiAAQICAEhZGvDAbloCCDQUAlDUrQO5AtwkKHBgQRK7duwryHmjAV2IQAoIJGxY4QK/ixYwH
        FIYcEAA7
</value>
  </data>
  <data name="cmdHGroupID.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        R0lGODlhEAAQAIZBAAAzmQBmzP///1o7AJlmAOazAMTz/9mmAEW5//nNT+W5ToPV/5TW/cyZAAyf/7Dp
        /yOn/2jD/q3h/le8/sz3/5zg/7bt/73l/7Xs/2fH/4DT///bnZXb/97//2rK/wWb/8np/6zf/1S//77x
        /73w/8Xv/1+//wmc/1jA/5Db/5LV/6rn/6Xb/zCt/33O/9X3/4LO/7jj/4PT/x+m/7nk/3XP/3PJ/3bQ
        /6Tb/5Td/zCv/3fM/029/4za/6Pf/ZHc/6Pk/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEBAAAh+QQB
        AABBACwAAAAAEAAQAAAIqACDCBwoMIDBAAQTBjEYIcKECQYVLmQQ44KJFhBmQECYMAAOEAJYnPjgwAHH
        gQEYqAhBA4YOBDwQIDg5cYcLGyg8LOixYAFNABJkZBBRI8cDEg98ACAIlIOGGylWGOhgwMBSphUq/ACC
        wQAFClcFEiAAQICAEhZGvDAbloCCDQUAlDUrQO5AtwkKHBgQRK7duwryHmjAV2IQAoIJGxY4QK/ixYwH
        FIYcEAA7
</value>
  </data>
  <data name="cmdHSourceID.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        R0lGODlhEAAQAIZBAAAzmQBmzP///1o7AJlmAOazAMTz/9mmAEW5//nNT+W5ToPV/5TW/cyZAAyf/7Dp
        /yOn/2jD/q3h/le8/sz3/5zg/7bt/73l/7Xs/2fH/4DT///bnZXb/97//2rK/wWb/8np/6zf/1S//77x
        /73w/8Xv/1+//wmc/1jA/5Db/5LV/6rn/6Xb/zCt/33O/9X3/4LO/7jj/4PT/x+m/7nk/3XP/3PJ/3bQ
        /6Tb/5Td/zCv/3fM/029/4za/6Pf/ZHc/6Pk/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEBAAAh+QQB
        AABBACwAAAAAEAAQAAAIqACDCBwoMIDBAAQTBjEYIcKECQYVLmQQ44KJFhBmQECYMAAOEAJYnPjgwAHH
        gQEYqAhBA4YOBDwQIDg5cYcLGyg8LOixYAFNABJkZBBRI8cDEg98ACAIlIOGGylWGOhgwMBSphUq/ACC
        wQAFClcFEiAAQICAEhZGvDAbloCCDQUAlDUrQO5AtwkKHBgQRK7duwryHmjAV2IQAoIJGxY4QK/ixYwH
        FIYcEAA7
</value>
  </data>
  <data name="cmdHProcID.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    <value>
        R0lGODlhEAAQAIZBAAAzmQBmzP///1o7AJlmAOazAMTz/9mmAEW5//nNT+W5ToPV/5TW/cyZAAyf/7Dp
WebAPI/Controllers/BaseSet/Gy_SourceController.cs
@@ -307,6 +307,87 @@
            return model;
        }
        #region ç”Ÿäº§èµ„源 æ ‘形图
        public class TreeModel
        {
            public string id { get; set; }
            public string title { get; set; }
            public List<TreeModel> children = new List<TreeModel>();
        }
        [Route("Gy_Source/Gy_SourceTreeList")]
        [HttpGet]
        public object Gy_SourceTreeList()
        {
            try
            {
                string sql1 = string.Format("select hitemid,hnumber,hname from Gy_Source order by hnumber");
                ds = oCN.RunProcReturn(sql1, "Gy_Source");
                List<TreeModel> treeModels = new List<TreeModel>();
                TreeModel first = new TreeModel();
                first.id = "0";
                first.title = "生产资源设置";
                treeModels.Add(first);
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    var strLen = row["hitemid"].ToString().Split('.');
                    if (strLen.Length == 1)
                    {
                        TreeModel tree = new TreeModel();
                        tree.id = row["hitemid"].ToString();
                        tree.title = row["hname"].ToString();
                        treeModels[0].children.Add(tree);
                    }
                }
                digui(ds.Tables[0], treeModels[0].children, 2);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é€’归函数
        /// </summary>
        public void digui(DataTable dt, List<TreeModel> tree, int num)
        {
            for (int m = 0; m < tree.Count; m++)
            {
                tree[m].children = new List<TreeModel>();
                for (int i = 0; i < dt.Rows.Count; i++)//第一次循环,得到所有根节点的子集
                {
                    var strLen = dt.Rows[i]["hnumber"].ToString().Split('.');
                    if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + "."))
                    {
                        TreeModel tbjson = new TreeModel();
                        tbjson.id = dt.Rows[i]["hitemid"].ToString();
                        tbjson.title = dt.Rows[i]["hname"].ToString();
                        tree[m].children.Add(tbjson);
                    }
                }
                var strLens = tree[m].id.Split('.');
                for (int i = 0; i < tree[m].children.Count; i++)
                {
                    digui(dt, tree[m].children, strLens.Length + 2);//再次用子集去循环,拿出子集的子集
                }
            }
        }
        #endregion
        /// <summary>
        /// ç”Ÿäº§èµ„源删除功能
        /// </summary>
WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs
@@ -69,6 +69,7 @@
                    oItem.HBillSubType = OperationType=="5"?"SUB":"3772";
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oItem.HDate = OperationType == "5" ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) : oItem.HDate;
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -149,7 +149,7 @@
                long HInterID = mainList[0].HInterID;//递入type得到的单据ID
                string HBillNo = mainList[0].HBillNo;//递入type得到的单据号
                DateTime HDate = mainList[0].HDate;//日期
                DateTime HDate = OperationType == 4 ? DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) : mainList[0].HDate;//日期
                int HYear = DateTime.Now.Year;
                double HPeriod = DateTime.Now.Month;
                string HRemark = mainList[0].HRemark;//备注
WebAPI/Controllers/LMESController.cs
@@ -117,6 +117,274 @@
            }
        }
        /// <summary>
        /// å·¥åºæµè½¬å¡åªæ˜¾ç¤ºå·¥åºæŸ“厂的数据
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("LEMS/MES_ProcessExchangeBillList_Json")]
        [HttpGet]
        public object MES_ProcessExchangeBillList_Json(string sWhere, string user,int OperationType)
        {
            DataSet ds;
            try
            {
                List<object> columnNameList = new List<object>();
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查询权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (OperationType == 1) {
                    //获取系统参数
                    string Ret = "";
                    if (oSystemParameter.ShowBill(ref Ret))
                    {
                        //判断客户为乔一
                        if (oSystemParameter.omodel.WMS_CampanyName == "乔一")
                        {
                            sWhere += " and å·¥åº='染厂' ";
                        }
                        else {
                            sWhere += " and å·¥åº='粗磨' ";
                        }
                    }
                    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                    ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillList");
                }
                else
                {
                    //获取系统参数
                    string Ret = "";
                    if (oSystemParameter.ShowBill(ref Ret))
                    {
                        //判断客户为龙山汽配
                        if (oSystemParameter.omodel.WMS_CampanyName == "乔一")
                        {
                        }
                    }
                    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                    ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeArrangementList where 1 = 1 " + sWhere , "h_v_Sc_ProcessExch_v_Sc_ProcessExchangeArrangementListhangeBillList");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #region æŽ’缸功能
        [Route("LEMS/ProcessExchangeArrangement_Add")]
        [HttpGet]
        public object ProcessExchangeArrangement_Add(string HInterID_S, int HSourceID,long HOrgID,string user)
        {
            DataSet ds;
            DataSet ds1;
            try
            {
                var HNum = HInterID_S.Split(',');
                oCN.BeginTran();
                for (int j = 0; j < HNum.Length; j++)
                {
                    long HInterID = long.Parse(HNum[j].Split('|')[0]);
                    long HEntryID = long.Parse(HNum[j].Split('|')[1]);
                    ds = oCN.RunProcReturn(@"select a.HMaterID,b.HProcID,a.HBillNo from Sc_ProcessExchangeBillMain a inner join Sc_ProcessExchangeBillSub b on a.HInterID=b.HInterID
where a.HInterID=" + HInterID + " and b.HEntryID=" + HEntryID, "Sc_ProcessExchangeBillMain");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "查无此工序流转卡!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //查询子工艺路线物料 å·¥åº
                    string HMaterID = ds.Tables[0].Rows[0]["HMaterID"].ToString();
                    string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
                    ds1 = oCN.RunProcReturn(@"select  a.HMaterID,a.HMainProcID,b.* from Gy_RoutingBillMain a     inner join Gy_RoutingBillSub b on a.HInterID=b.HInterID where a.HMaterID=" + HMaterID + " and a.HMainProcID=" + HProcID + " and a.HBillSubType='SUB'", "Gy_RoutingBillMain");
                    if (ds1.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "没有相对应的默认工艺路线,请先设置工艺路线!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill();
                    string sReturn = "";
                    DBUtility.ClsPub.HOrgID = HOrgID;
                    oBill.ShowBill(HInterID, ref sReturn);
                    long HInterID1 = DBUtility.ClsPub.CreateBillID(oBill.omodel.HBillType, ref DBUtility.ClsPub.sExeReturnInfo);
                    string HBillNo = DBUtility.ClsPub.CreateBillCode(oBill.omodel.HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
                    oBill.omodel.HInterID = HInterID1;
                    oBill.omodel.HBillNo = HBillNo;
                    oBill.omodel.HBillSubType = "SUB";
                    oBill.omodel.HDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd"));
                    oBill.omodel.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oBill.omodel.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
                    oBill.omodel.HMaker = user;
                    oBill.omodel.HMakeDate = DateTime.Now.ToString();
                    oBill.omodel.HMainSourceInterID = HInterID;
                    oBill.omodel.HMainSourceEntryID = HEntryID;
                    oBill.omodel.HMainSourceBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    oBill.DetailColl.Clear();
                    for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                    {
                        Model.ClsSc_ProcessExchangeBillSub oSub = new Model.ClsSc_ProcessExchangeBillSub();
                        oSub.HInterID = HInterID1;
                        oSub.HEntryID = (i + 1);
                        oSub.HProcNo = long.Parse(ds1.Tables[0].Rows[i]["HProcNo"].ToString());
                        oSub.HProcID = long.Parse(ds1.Tables[0].Rows[i]["HProcID"].ToString());
                        oSub.HWorkRemark = ds1.Tables[0].Rows[i]["HRemark"].ToString();
                        oSub.HCenterID = long.Parse(ds1.Tables[0].Rows[i]["HCenterID"].ToString());
                        oSub.HSupID = long.Parse(ds1.Tables[0].Rows[i]["HSupID"].ToString());
                        oSub.HSupFlag = ds1.Tables[0].Rows[i]["HSupFlag"].ToString() == "1" ? true : false;
                        oSub.HQty = oBill.omodel.HQty;
                        oSub.HTechnologyParameter = "";
                        oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                        oBill.DetailColl.Add(oSub);
                    }
                    bool bResult = false;
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=" + HSourceID + " where HInterID=" + HInterID + " and HEntryID=" + HEntryID);
                    if (!bResult)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "派工失败!" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "派工成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å–消排缸功能
        [Route("LEMS/ProcessExchangeArrangementDel")]
        [HttpGet]
        public object ProcessExchangeArrangementDel(string HInterID_S, int HSourceID, long HOrgID, string user)
        {
            DataSet ds;
            DataSet ds1;
            try
            {
                var HNum = HInterID_S.Split(',');
                oCN.BeginTran();
                for (int j = 0; j < HNum.Length; j++)
                {
                    ds = oCN.RunProcReturn(@"select * from Sc_ProcessExchangeBillMain a where a.HInterID=" + HNum[j], "Sc_ProcessExchangeBillMain");
                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "查无此子工序流转卡!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    string HMainSourceInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"].ToString();
                    string HMainSourceEntryID = ds.Tables[0].Rows[0]["HMainSourceEntryID"].ToString();
                    ds1 = oCN.RunProcReturn(@"select * from Sc_ProcessExchangeBillMain where HInterID=" + HMainSourceInterID, "Sc_ProcessExchangeBillMain");
                    if (ds1.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "查无此子工序流转卡对应的主工序流转卡!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    oCN.RunProc("update Sc_ProcessExchangeBillSub set HSourceID=0 where HInterID=" + HMainSourceInterID + " and HEntryID=" + HMainSourceEntryID);
                    oCN.RunProc("delete from Sc_ProcessExchangeBillMain where HInterID=" + HNum[j]);
                    oCN.RunProc("delete from Sc_ProcessExchangeBillSub where HInterID=" + HNum[j]);
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "已取消派工!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "异常!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        /// <summary>
        /// è¿”回工序流转卡维护列表从表
        ///参数:string sql。