ch
2022-07-27 a72d939b5cafd1d02b3cae75975f1959fd0f814a
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
24个文件已修改
4个文件已添加
2271 ■■■■■ 已修改文件
.gitignore 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BLL/BLL.csproj 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BLL/Xt_SystemParameterForOrg.Designer.cs 292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BLL/Xt_SystemParameterForOrg.cs 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BLL/Xt_SystemParameterForOrg.resx 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BLL/系统管理/Xt_SystemParameter.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/WarM.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WarM/WarM.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Config/kdapi.config 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/MateOutController.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/DataHelper.cs 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs 854 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/Sc_WorkBillSortBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs 335 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_StockCheckItemBillController.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/工资管理/Pay_WorkTimesBillController.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MESBeginStepWorkBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/InvokeHelper.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/报表分析/Mes_OrderProcFlowAllReport.cs 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/报表分析/Mes_OrderProcFlowAllReport.designer.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -131,3 +131,5 @@
/NETERPNoWin/obj/Debug/NETERPNoWin.csproj.AssemblyReference.cache
/NETERPNoWin/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
/NETERPNoWin/obj/Debug/.NETFramework,Version=v4.0.AssemblyAttributes.cs
/NETERPNoWin/bin/Debug
/NETERPNoWin/obj/Debug
BLL/BLL.csproj
@@ -106,6 +106,12 @@
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="Xt_SystemParameterForOrg.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Xt_SystemParameterForOrg.Designer.cs">
      <DependentUpon>Xt_SystemParameterForOrg.cs</DependentUpon>
    </Compile>
    <Compile Include="系统管理\用户管理\Gy_UserByOrgRelation.cs">
      <SubType>Form</SubType>
    </Compile>
@@ -431,6 +437,9 @@
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <EmbeddedResource Include="Xt_SystemParameterForOrg.resx">
      <DependentUpon>Xt_SystemParameterForOrg.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="公用模块\AboutBox1.resx">
      <SubType>Designer</SubType>
      <DependentUpon>AboutBox1.cs</DependentUpon>
BLL/Xt_SystemParameterForOrg.Designer.cs
New file
@@ -0,0 +1,292 @@

namespace BLL
{
    partial class Xt_SystemParameterForOrg
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label1 = new System.Windows.Forms.Label();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.txtHFarmat = new System.Windows.Forms.TextBox();
            this.label6 = new System.Windows.Forms.Label();
            this.txtHExplanation = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.txtHValue = new System.Windows.Forms.TextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.txtHCaption = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.txtHKey = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.grdMain = new System.Windows.Forms.DataGridView();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.cmdCancel = new System.Windows.Forms.Button();
            this.cmdOK = new System.Windows.Forms.Button();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).BeginInit();
            this.groupBox4.SuspendLayout();
            this.SuspendLayout();
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox1.Location = new System.Drawing.Point(0, 0);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(734, 63);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("宋体", 13.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label1.Location = new System.Drawing.Point(241, 21);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(235, 24);
            this.label1.TabIndex = 0;
            this.label1.Text = "按组织设置系统参数";
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.txtHFarmat);
            this.groupBox2.Controls.Add(this.label6);
            this.groupBox2.Controls.Add(this.txtHExplanation);
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this.txtHValue);
            this.groupBox2.Controls.Add(this.label4);
            this.groupBox2.Controls.Add(this.txtHCaption);
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.txtHKey);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox2.Location = new System.Drawing.Point(0, 63);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(734, 155);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            //
            // txtHFarmat
            //
            this.txtHFarmat.Location = new System.Drawing.Point(93, 113);
            this.txtHFarmat.Name = "txtHFarmat";
            this.txtHFarmat.ReadOnly = true;
            this.txtHFarmat.Size = new System.Drawing.Size(629, 25);
            this.txtHFarmat.TabIndex = 9;
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(21, 118);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(67, 15);
            this.label6.TabIndex = 8;
            this.label6.Text = "格式范例";
            //
            // txtHExplanation
            //
            this.txtHExplanation.Location = new System.Drawing.Point(93, 82);
            this.txtHExplanation.Name = "txtHExplanation";
            this.txtHExplanation.ReadOnly = true;
            this.txtHExplanation.Size = new System.Drawing.Size(629, 25);
            this.txtHExplanation.TabIndex = 7;
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(21, 87);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(53, 15);
            this.label5.TabIndex = 6;
            this.label5.Text = "描  è¿°";
            //
            // txtHValue
            //
            this.txtHValue.Location = new System.Drawing.Point(444, 51);
            this.txtHValue.Name = "txtHValue";
            this.txtHValue.ReadOnly = true;
            this.txtHValue.Size = new System.Drawing.Size(278, 25);
            this.txtHValue.TabIndex = 5;
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(390, 56);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(30, 15);
            this.label4.TabIndex = 4;
            this.label4.Text = "值 ";
            //
            // txtHCaption
            //
            this.txtHCaption.Location = new System.Drawing.Point(93, 51);
            this.txtHCaption.Name = "txtHCaption";
            this.txtHCaption.ReadOnly = true;
            this.txtHCaption.Size = new System.Drawing.Size(278, 25);
            this.txtHCaption.TabIndex = 3;
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(21, 56);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(53, 15);
            this.label3.TabIndex = 2;
            this.label3.Text = "名  ç§°";
            //
            // txtHKey
            //
            this.txtHKey.Location = new System.Drawing.Point(93, 20);
            this.txtHKey.Name = "txtHKey";
            this.txtHKey.ReadOnly = true;
            this.txtHKey.Size = new System.Drawing.Size(278, 25);
            this.txtHKey.TabIndex = 1;
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(21, 25);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(52, 15);
            this.label2.TabIndex = 0;
            this.label2.Text = "关键值";
            //
            // groupBox3
            //
            this.groupBox3.Controls.Add(this.grdMain);
            this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.groupBox3.Location = new System.Drawing.Point(0, 218);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(734, 326);
            this.groupBox3.TabIndex = 2;
            this.groupBox3.TabStop = false;
            //
            // grdMain
            //
            this.grdMain.AllowUserToAddRows = false;
            this.grdMain.AllowUserToDeleteRows = false;
            this.grdMain.BackgroundColor = System.Drawing.SystemColors.InactiveCaption;
            this.grdMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.grdMain.Location = new System.Drawing.Point(3, 21);
            this.grdMain.Margin = new System.Windows.Forms.Padding(4);
            this.grdMain.Name = "grdMain";
            this.grdMain.ReadOnly = true;
            this.grdMain.RowHeadersWidth = 51;
            this.grdMain.RowTemplate.Height = 23;
            this.grdMain.Size = new System.Drawing.Size(728, 302);
            this.grdMain.TabIndex = 20;
            this.grdMain.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.grdMain_CellBeginEdit);
            //
            // timer1
            //
            this.timer1.Enabled = true;
            this.timer1.Interval = 500;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            //
            // groupBox4
            //
            this.groupBox4.Controls.Add(this.cmdCancel);
            this.groupBox4.Controls.Add(this.cmdOK);
            this.groupBox4.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.groupBox4.Location = new System.Drawing.Point(0, 544);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(734, 79);
            this.groupBox4.TabIndex = 3;
            this.groupBox4.TabStop = false;
            //
            // cmdCancel
            //
            this.cmdCancel.Location = new System.Drawing.Point(575, 24);
            this.cmdCancel.Name = "cmdCancel";
            this.cmdCancel.Size = new System.Drawing.Size(115, 42);
            this.cmdCancel.TabIndex = 1;
            this.cmdCancel.Text = "取    æ¶ˆ";
            this.cmdCancel.UseVisualStyleBackColor = true;
            this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
            //
            // cmdOK
            //
            this.cmdOK.Location = new System.Drawing.Point(421, 24);
            this.cmdOK.Name = "cmdOK";
            this.cmdOK.Size = new System.Drawing.Size(115, 42);
            this.cmdOK.TabIndex = 0;
            this.cmdOK.Text = "保   å­˜";
            this.cmdOK.UseVisualStyleBackColor = true;
            this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
            //
            // Xt_SystemParameterForOrg
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(734, 623);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Name = "Xt_SystemParameterForOrg";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "按组织设置系统参数";
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.grdMain)).EndInit();
            this.groupBox4.ResumeLayout(false);
            this.ResumeLayout(false);
        }
        #endregion
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.TextBox txtHCaption;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.TextBox txtHKey;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.TextBox txtHExplanation;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.TextBox txtHValue;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox txtHFarmat;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.DataGridView grdMain;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.GroupBox groupBox4;
        private System.Windows.Forms.Button cmdCancel;
        private System.Windows.Forms.Button cmdOK;
    }
}
BLL/Xt_SystemParameterForOrg.cs
New file
@@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BLL
{
    public partial class Xt_SystemParameterForOrg : Form
    {
        public Xt_SystemParameterForOrg()
        {
            InitializeComponent();
        }
        public const int HInterIDCol = 0;
        public const int HKeyCol = 1;
        public const int HOrgIDCol = 2;
        public const int HOrgNumberCol = 3;
        public const int HOrgNameCol = 4;
        public const int HValueCol = 5;
        public string sHKey;
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            initGrid();
            Display();
        }
        private void initGrid()
        {
            //
            grdMain.ColumnCount = 6;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
            //=
            grdMain.Columns[HOrgNumberCol].HeaderText = "组织代码";
            grdMain.Columns[HOrgNameCol].HeaderText = "组织名称";
            grdMain.Columns[HValueCol].HeaderText = "参数值";
            ////固定赋值=====================================================
            //=============================================================================
            //格式化
            //设置 æ‰‹å·¥éšè—
            DBUtility.ClsPub.HideGridView(grdMain, Name, DBUtility.ClsPub.AppPath);//设置隐藏列
            ////隐藏列
            grdMain.Columns[HInterIDCol].Visible = false;
            grdMain.Columns[HKeyCol].Visible = false;
            grdMain.Columns[HOrgIDCol].Visible = false;
            //隐藏源单信息
            //设置可编辑列
            string sAllowCol = HValueCol.ToString() ;
            //设置合计列
            string sTotalCol = "";
            //格式化网格
            //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
            DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
        }
        private void Display()
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            try
            {
                //根据 HKEY æ¥èŽ·å– çŽ°æœ‰ä¿¡æ¯
                DataSet ds = oCn.RunProcReturn("exec h_p_Xt_SystemParameter_GetValue '" + sHKey + "'", "h_p_Xt_SystemParameter_GetValue");
                if(ds==null)
                {
                    MessageBox.Show("读取失败1!没有返回任何数据!");
                    return;
                }
                if (ds.Tables[0].Rows.Count != 0)
                {
                    //显示到 è¡¨å¤´
                    txtHKey.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HKey"]);
                    txtHCaption.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HCaption"]);
                    txtHValue.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HMainValue"]);
                    txtHExplanation.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HExplanation"]);
                    txtHFarmat.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HFarmat"]);
                }
                else
                {
                    MessageBox.Show("读取失败2!没有返回任何数据!");
                    return;
                }
                //显示到 è¡¨ä½“
                grdMain.RowCount = ds.Tables[0].Rows.Count;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (i >= grdMain.RowCount - 1)
                        grdMain.Rows.Add();
                    //单据固定赋值
                    grdMain.Rows[i].Cells[HInterIDCol].Value = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HInterID"]);
                    grdMain.Rows[i].Cells[HKeyCol].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HKey"]);
                    grdMain.Rows[i].Cells[HOrgIDCol].Value = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HOrgID"]);
                    grdMain.Rows[i].Cells[HOrgNumberCol].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HOrgNumber"]);
                    grdMain.Rows[i].Cells[HOrgNameCol].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HOrgName"]);
                    grdMain.Rows[i].Cells[HValueCol].Value = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HValue"]);
                }
            }
            catch(Exception e1)
            {
                MessageBox.Show("读取失败!" + e1.Message);
            }
        }
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
            this.Close();
        }
        private void cmdOK_Click(object sender, EventArgs e)
        {
            //保存前判断
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            try
            {
                //清除 å­è¡¨ä¿¡æ¯
                oCn.RunProc(" delete from Xt_SystemParameterSub Where HKey= '" + sHKey + "'");
                //循环写入子表
                for (int i = 0; i < grdMain.Rows.Count; i++)
                {
                    if (DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HValueCol].Value).ToString() !="" &&
                         DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HKeyCol].Value).ToString() !="")
                    {
                        oCn.RunProc(" insert into  Xt_SystemParameterSub (HInterID,HValue,HKey,HOrgID) " +
                            " values(  " +
                            "  " + DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HInterIDCol].Value).ToString() + " " +
                            ",  '" + DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HValueCol].Value).ToString() + "' " +
                            ",  '" + DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HKeyCol].Value).ToString() + "' " +
                            ",  " + DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HOrgIDCol].Value).ToString() + " " +
                            ") ");
                    }
                }
                MessageBox.Show("保存完毕!");
            }
            catch(Exception e1)
            {
                MessageBox.Show("保存失败!"+ e1.Message);
            }
        }
        private void grdMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            int i = grdMain.CurrentCell.ColumnIndex;
            if (i == HKeyCol || i == HOrgNumberCol || i == HOrgNameCol)
            {
                e.Cancel = true;
            }
        }
    }
}
BLL/Xt_SystemParameterForOrg.resx
New file
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema
    Version 2.0
    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.
    Example:
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
    There are any number of "resheader" rows that contain simple
    name/value pairs.
    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.
    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:
    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    <value>17, 17</value>
  </metadata>
</root>
BLL/ϵͳ¹ÜÀí/Xt_SystemParameter.cs
@@ -566,12 +566,13 @@
        private void org_Click(object sender, EventArgs e)
        {
            Xt_SystemParameterForOrg oXt_SystemParameterForOrg = new Xt_SystemParameterForOrg();
            if (DBUtility.Gy_BaseFun.AllowRow(grdMain))
            {
                //根据选中行显示 æŒ‰ç»„织的 ç³»ç»Ÿå‚数清单
                //获取选中行的 HKEY
                string sKey = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentRow.Index].Cells[Fun_GetCol("关键码")].Value);
                oXt_SystemParameterForOrg.sHKey = sKey;
                oXt_SystemParameterForOrg.ShowDialog();
            }
        }
    }
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -172,6 +172,10 @@
                    {
                        omodel.Kf_MateOutBillCheck_MustQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MateOutBillCheck_WHSPCtl")     //校验-是否校对仓库仓位
                    {
                        omodel.Kf_MateOutBillCheck_WHSPCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //生产退料单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MateOutBackBill_AutoCheck")
                    {
@@ -480,6 +484,10 @@
                    {
                        omodel.Kf_MoveStockBillCheck_MustQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockBillCheck_WHSPCtl")     //校验-是否校对仓库仓位
                    {
                        omodel.Kf_MoveStockBillCheck_WHSPCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //补料单
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MateReplenishOutBill_AutoCheck")
                    {
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -30,6 +30,7 @@
        public string Kf_MateOutBill_SimpleMode;   //简洁模式(不显示源单列表,只显示扫码记录,但后台仍控制)
        public string Kf_MateOutBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
        public string Kf_MateOutBillCheck_MustQtyCtl;   //校验数量控制
        public string Kf_MateOutBillCheck_WHSPCtl;   //校验-是否校对仓库仓位
        //生产退料
        public string Kf_MateOutBackBill_AutoCheck;
        public string Kf_MateOutBackBill_ERPMode;
@@ -120,6 +121,7 @@
        public string Kf_MoveStockBill_BarCodeMustSameSourceBill;   // æ¡ç å¿…须同源单一致
        public string Kf_MoveStockBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
        public string Kf_MoveStockBillCheck_MustQtyCtl;   //校验数量控制
        public string Kf_MoveStockBillCheck_WHSPCtl;   //校验-是否校对仓库仓位
        //补料单
        public string Kf_MateReplenishOutBill_AutoCheck;
        public string Kf_MateReplenishOutBill_ERPMode;
WarM/WarM.csproj
@@ -940,9 +940,6 @@
      <DependentUpon>CH_RedStockOutCheckCount.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="报表分析\Kf_BarCodeBackInfoReport_MaterInOut_BatchNo.resx">
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="报表分析\Kf_BarCodeBackInfoReport_MaterInOut_BatchNo_M.resx">
      <DependentUpon>Kf_BarCodeBackInfoReport_MaterInOut_BatchNo_M.cs</DependentUpon>
      <SubType>Designer</SubType>
WarM/WarM.csproj.user
@@ -9,6 +9,6 @@
    <ErrorReportUrlHistory />
    <FallbackCulture>zh-CN</FallbackCulture>
    <VerifyUploadedFiles>false</VerifyUploadedFiles>
    <ProjectView>ShowAllFiles</ProjectView>
    <ProjectView>ProjectFiles</ProjectView>
  </PropertyGroup>
</Project>
WebAPI/Config/kdapi.config
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="DbId" value="5f9258a311401c"></add>
        <add key="DbId" value="6204a70eba35fc"></add>
        <add key="UserName" value="Administrator"></add>
        <add key="PassWord" value="qaz!@#123"></add>
        <add key="KDApiUrl" value="http://localhost/K3Cloud/"></add>
WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
@@ -382,7 +382,6 @@
                string HEmpRate = list[0].HEmpRate ?? "";
                string HExamRate = list[0].HExamRate ?? "";
                DateTime HHealthCardEDate = Convert.ToDateTime("1900/1/1");
                ////判断权限
                //if (!ClsPub.Security_Log(msg5, 1, false, msg4))
                //{
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1217,7 +1217,7 @@
                DataSet ds = new DataSet();
                ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID=" + HInterID, "Gy_MouldFileMain");
                DataRow dr = ds.Tables[0].Rows[0];
                string Num = dr["HBillNo"].ToString();
                string Num = dr["HBarCode"].ToString();
                string Num1 = Num.Substring(0,(Num.Length)-5);
                oCN.BeginTran();
                for (int i = StarNum1; i <= EndNum1; i++)
@@ -1246,6 +1246,7 @@
                    if (ds1.Tables[0].Rows.Count == 0 || ds1 == null)
                    {
                        long HItemID = DBUtility.ClsPub.CreateBillID("3899", ref DBUtility.ClsPub.sExeReturnInfo);
                        //string HBillNo = DBUtility.ClsPub.CreateBillCode("3899", ref DBUtility.ClsPub.sExeReturnInfo, true);
                        string sql = string.Format(@"Insert Into Gy_MouldFileMain   " +
                        "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                        ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HBarCode" +
WebAPI/Controllers/BaseSet/Gy_WorkCenterController.cs
@@ -8,6 +8,8 @@
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
using Newtonsoft.Json;
namespace WebAPI.Controllers
{
    public class Gy_WorkCenterController : ApiController
@@ -18,15 +20,15 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        /// <summary>
        /// è¿”回工作中心列表
        ///参数:string sql。
        ///返回值:object。
        /// å·¥ä½œä¸­å¿ƒåŠ¨æ€åˆ—
        /// </summary>
        [Route("Gy_WorkCenter/list")]
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_WorkCenter/Gy_WorkCenterDyCollist")]
        [HttpGet]
        public object list(string sWhere,string user)
        public object Gy_WorkCenterDyCollist(string sWhere,string user)
        {
            try
            {
@@ -40,33 +42,21 @@
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                ds = oCN.RunProcReturn("select * from h_v_WorkCenterList where 1 = 1 " + sWhere + " order by å·¥ä½œä¸­å¿ƒä»£ç  ", "h_v_WorkCenterList");
                List<object> listCol = new List<object>();
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    ds = oCN.RunProcReturn("select * from h_v_WorkCenterList order by å·¥ä½œä¸­å¿ƒä»£ç  ", "h_v_WorkCenterList");
                }
                else
                {
                    string sql1 = "select * from h_v_WorkCenterList where 1 = 1 ";
                    string sql = sql1 + sWhere+ " order by å·¥ä½œä¸­å¿ƒä»£ç  ";
                    ds = oCN.RunProcReturn(sql, "h_v_WorkCenterList");
                    Type dataType = col.DataType;
                    string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    listCol.Add(JsonConvert.DeserializeObject(str));
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = listCol;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception e)
            {
@@ -79,6 +69,48 @@
        }
        /// <summary>
        /// è¿”回工作中心列表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_WorkCenter/list")]
        [HttpGet]
        public object list(string sWhere, string user)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_WorkCenter", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_WorkCenterList where 1 = 1 " + sWhere + " order by å·¥ä½œä¸­å¿ƒä»£ç  ", "h_v_WorkCenterList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// æ ¹æ®åŸºç¡€èµ„æ–™ID æŸ¥æ‰¾è®°å½•
        ///参数:string sql。
        ///返回值:object。
WebAPI/Controllers/MJGL/Sc_MouldProdInBillController.cs
@@ -635,7 +635,16 @@
                if (bResult)
                {
                    string sql = $"exec h_p_Sc_MouldChangeFileStatus  'in','{oBill.omodel.HInterID.ToString()}' ";
                    oCn.RunProc(sql);
                    DataSet db=oCn.RunProcReturn(sql, "h_p_Sc_MouldChangeFileStatus");
                    if (db.Tables[0].Rows[0]["issuccess"].ToString()=="0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "器具位置同步失败!";
                        //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
WebAPI/Controllers/MateOutController.cs
@@ -1,5 +1,6 @@
using DBUtility;
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
@@ -844,6 +845,55 @@
            }
        }
        //刷新表体  è¿”回条码库存信息网页PDA版
        [Route("KF_ICInventoryByMaterID/GetBillEntry_TmpList_Pack1")]
        [HttpGet]
        public object GetBillEntry_TmpList_Pack1(string HBarCode, long sHWHID, long sHSPID, long HOWNERID, string sWhere)
        {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                List<object> columnNameList = new List<object>();
                DataSet ds = oCN.RunProcReturn("exec h_p_KF_ICInventoryByMaterIDList1 '" + HBarCode + "'," + sHWHID + "," + sHSPID+","+ HOWNERID+",'"+ sWhere+"'", "h_p_KF_ICInventoryByMaterIDList");
                //添加列名
                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列对象的列名
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        [Route("MateOutBill/Delete_Json")]
        [HttpGet]
        public object Delete_Json(long HInterID, long HMaterID, long HAuxPropID, string HMTONo, long HSourceInterID, long HSourceEntryID, string sHBillType)
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/DataHelper.cs
New file
@@ -0,0 +1,171 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WebAPI.Utility;
namespace WebAPI.Controllers.SCGL.日计划管理
{
    public static class DataHelper
    {
        public static List<T> ToModelList<T>(this DataSet ds) where T : new()
        {
            try
            {
                List<T> list = new List<T>();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        list.Add(row.Put(new T()));
                    }
                }
                return list;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public static List<T> ToModelList<T>(this DataTable dt) where T : new()
        {
            try
            {
                List<T> list = new List<T>();
                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        list.Add(row.Put(new T()));
                    }
                }
                return list;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        /// <summary>
        /// è¿”回一条数据的Model
        /// </summary>
        /// <typeparam name="T">Model类型</typeparam>
        /// <param name="entity">Model类型</param>
        /// <param name="ds"></param>
        /// <returns></returns>
        public static T ToModel<T>(DataSet ds) where T : new()
        {
            try
            {
                T m = new T();
                if (ds.Tables[0].Rows.Count > 0)
                {
                    m = ds.Tables[0].Rows[0].Put(new T());
                }
                return m;
            }
            catch (Exception)
            {
                return default(T);
                //throw;
            }
        }
        public static T Put<T>(this DataRow row, T entity) where T : new()
        {
            if (entity == null)
            {
                entity = new T();
            }
            Type type = typeof(T);
            PropertyInfo[] pi = type.GetProperties();
            foreach (PropertyInfo item in pi)
            {
                int index = row.Table.Columns.IndexOf(item.Name);
                if (index != -1)
                {
                    if (row[item.Name] != null && row[item.Name] != DBNull.Value)
                    {
                        if (item.PropertyType == typeof(DateTime))
                        {
                            //如果对日期格式有特殊要求 å¯ä»¥åœ¨è¿™é‡Œè½¬æ¢
                            item.SetValue(entity, Convert.ToDateTime(row[item.Name].ToString()), null);
                        }
                        else
                        {
                            item.SetValue(entity, ChangeType(row[item.Name], item.PropertyType), null);
                        }
                    }
                }
            }
            return entity;
        }
        public static object ChangeType(object obj, Type conversionType)
        {
            return ChangeType(obj, conversionType, Thread.CurrentThread.CurrentCulture);
        }
        public static object ChangeType(object obj, Type conversionType, IFormatProvider provider)
        {
            #region Nullable
            Type nullableType = Nullable.GetUnderlyingType(conversionType);
            if (nullableType != null)
            {
                if (obj == null)
                {
                    return null;
                }
                return Convert.ChangeType(obj, nullableType, provider);
            }
            #endregion
            if (typeof(System.Enum).IsAssignableFrom(conversionType))
            {
                return Enum.Parse(conversionType, obj.ToString());
            }
            return Convert.ChangeType(obj, conversionType, provider);
        }
        public static string ToListParam<T>(this List<T> list)
        {
            string str = string.Empty;
            foreach (var item in list)
            {
                str += $"'{item}',";
            }
            str = str.TrimEnd(',');
            str = $"({str})";
            return str;
        }
        public static string GetUpdateStr(string table, Dictionary<string, object> dic, string condition)
        {
            var strSet = string.Empty;
            foreach (var item in dic)
            {
                var type = Util.GetObjectType(item.Value);
                switch (type)
                {
                    case "string":
                    case "date":
                        strSet += $" {item.Key}='{item.Value}' ";
                        break;
                    default:
                        strSet += $" {item.Key}={item.Value} ";
                        break;
                }
            }
            return $"update {table} set {strSet} where 1=1 {condition}";
        }
    }
}
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -7,11 +7,13 @@
using WebAPI.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Diagnostics;
namespace WebAPI.Controllers.SCGL.日计划管理
{
    public class JIT_DayPlanPlatFormBillController : ApiController
    {
        List<PRD_Inventory> ListInventory;//库存明细
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
@@ -22,7 +24,7 @@
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 æŸ¥è¯¢
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillList")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillList(string sWhere,string user)
        public object JIT_DayPlanPlatFormBillList(string sWhere, string user)
        {
            try
            {
@@ -38,8 +40,45 @@
                omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere);
                ds = oCN.RunProcReturn($"exec h_p_JIT_Sc_WorkBillSortBill_Query '{omdelMian.HPlanBeginDate}',{(omdelMian.HProdORGID==null?0: omdelMian.HProdORGID)},'{omdelMian.HSeOrderBillNo}'" +
                ds = oCN.RunProcReturn($"exec h_p_JIT_Sc_WorkBillSortBill_Query '{omdelMian.HPlanBeginDate}',{(omdelMian.HProdORGID == null ? 0 : omdelMian.HProdORGID)},'{omdelMian.HSeOrderBillNo}'" +
                    $",'{omdelMian.HPlanEndDate.AddDays(1).AddSeconds(-1)}',{omdelMian.HMaterID},'{omdelMian.HICMOBillNo}',{omdelMian.HWorkShopID}", "h_p_JIT_Sc_WorkBillSortBill_Query");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// æ ¹æ®ID查询 é½å¥—状态 å’Œ é”å®šçŠ¶æ€
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHinterIDList")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHinterIDList(string sWhere,int num)
        {
            try
            {
                if (num == 1)
                {
                    ds = oCN.RunProcReturn($"select isnull(DATEDIFF(DAY,GETDATE(),CONVERT(varchar(10),max(HMasterDate),20)),0) DayNum from  Sc_WorkBillSortBillSub where HInterID in ({sWhere}) and  HMasterDate>=CONVERT(varchar(10),GETDATE(),20) and HLockedSub=1", "Sc_WorkBillSortBillSub");
                }
                else if (num == 2)
                {
                    ds = oCN.RunProcReturn($"select CONVERT(varchar(10),HMasterDate,20) HMasterDate,HComplete,HInterID from  Sc_WorkBillSortBillSub where HInterID in ({sWhere}) and  HMasterDate>=CONVERT(varchar(10),GETDATE(),20) and (HComplete='齐套' or  HComplete='未齐套') ", "Sc_WorkBillSortBillSub");
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -149,11 +188,11 @@
                        var HMainSourceInterID = list[i]["源单主内码"].ToString();
                        var HMainSourceEntryID = list[i]["源单子内码"].ToString();
                        if (HSourceID=="")
                        if (HSourceID == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i+1}行生产资源不能为空!";
                            objJsonResult.Message = $"第{i + 1}行生产资源不能为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -278,5 +317,812 @@
            return objJsonResult;
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 é½å¥—分析
        #region æ¸…单配料方式
        public class PRD_PPBOM
        {
            /// <summary>
            /// æ—¥è®¡åˆ’工单FID
            /// </summary>
            public long HInterID { get; set; }
            /// <summary>
            /// æ—¥è®¡åˆ’明细FEntryID
            /// </summary>
            public long HEntryID { get; set; }
            /// <summary>
            /// ç”Ÿäº§ç”¨æ–™æ¸…单单号
            /// </summary>
            public string HBillNo { get; set; }
            /// <summary>
            /// ç”Ÿäº§è®¢å•单号
            /// </summary>
            public string HICMOBillNo { get; set; }
            /// <summary>
            /// ç”Ÿäº§è®¢å•内码
            /// </summary>
            public string HICMOInterID { get; set; }
            /// <summary>
            /// çˆ¶çº§ç‰©æ–™ID
            /// </summary>
            public string FMaterialID { get; set; }
            /// <summary>
            /// çˆ¶çº§ç‰©æ–™æ•°é‡
            /// </summary>
            public decimal FQty { get; set; }
            /// <summary>
            /// å­é¡¹ç‰©æ–™ID
            /// </summary>
            public string FMATERIALID2 { get; set; }
            /// <summary>
            /// å­é¡¹ç‰©æ–™åç§°
            /// </summary>
            public string FNumber { get; set; }
            /// <summary>
            /// éœ€æ±‚数量
            /// </summary>
            public decimal FNeedQty { get; set; }
            /// <summary>
            /// å³æ—¶åº“å­˜
            /// </summary>
            public decimal FBASEQTY { get; set; }
            /// <summary>
            /// ç”Ÿäº§è®¢å•主码
            /// </summary>
            public string HICMOInterID_Sec { get; set; }
            /// <summary>
            /// ç”Ÿäº§è®¢å•子码
            /// </summary>
            public string HICMOEntryID_Sec { get; set; }
            /// <summary>
            /// æ—¥è®¡åˆ’数量
            /// </summary>
            public string HQty { get; set; }
            /// <summary>
            /// æ—¥è®¡åˆ’日期
            /// </summary>
            public DateTime HMasterDate { get; set; }
            /// <summary>
            /// è®¢å•等级
            /// </summary>
            public string HOrderLev { get; set; }
            /// <summary>
            /// åº“存组织
            /// </summary>
            public string FStockOrgId { get; set; }
            /// <summary>
            /// ç»„织名称
            /// </summary>
            public string OrgFnumber { get; set; }
            /// <summary>
            /// å•位用量
            /// </summary>
            public decimal dwyl { get; set; }
            /// <summary>
            /// é¢„计消耗用量
            /// </summary>
            public decimal PlanCount { get; set; }
            /// <summary>
            /// ç‰©æ–™å±žæ€§
            /// </summary>
            public int FErpClsID { get; set; }
            /// <summary>
            /// è½¦é—´
            /// </summary>
            public string HWorkShopID { get; set; }
            /// <summary>
            /// è½¦é—´ç¼–码
            /// </summary>
            public string FHWorkShopNumber { get; set; }
        }
        #endregion
        #region å³æ—¶åº“å­˜
        public class PRD_Inventory
        {
            /// <summary>
            /// ç‰©æ–™ID
            /// </summary>
            public string FMATERIALID { get; set; }
            /// <summary>
            /// ç‰©æ–™ç¼–码
            /// </summary>
            public string FNumber { get; set; }
            /// <summary>
            /// å³æ—¶åº“å­˜
            /// </summary>
            public decimal FBASEQTY { get; set; }
            /// <summary>
            /// åº“存组织
            /// </summary>
            public string FStockOrgId { get; set; }
            /// <summary>
            /// åº“存货主类型
            /// </summary>
            public string FOwnerTypeId { get; set; }
            /// <summary>
            /// åº“存货主
            /// </summary>
            public string FOwnerId { get; set; }
            /// <summary>
            /// è´§ä¸»ç¼–码
            /// </summary>
            public string FOwnerNumber { get; set; }
            /// <summary>
            /// ä»“库
            /// </summary>
            public string FSTOCKID { get; set; }
            /// <summary>
            /// ä»“库编码
            /// </summary>
            public string FStockNumber { get; set; }
        }
        #endregion
        #region è½¦é—´ä»“库对照列表
        public class PRD_WorkHouseCompar
        {
            /// <summary>
            /// ç»„织
            /// </summary>
            public string FORGID { get; set; }
            /// <summary>
            /// è½¦é—´
            /// </summary>
            public string FWORKSHOPID { get; set; }
            /// <summary>
            /// ä»“库
            /// </summary>
            public string FSTOCKID { get; set; }
        }
        #endregion
        #region æ—¥è®¡åˆ’+生产订单
        public class DayPlanPickedModel
        {
            /// <summary>
            /// è®¢å•入库数量 æŒ‰ç…§ç”Ÿäº§è®¢å•明细行
            /// </summary>
            public decimal FCXStockInQty { get; set; }
            /// <summary>
            ///  ä¸»ç”Ÿäº§è®¢å•子内码
            /// </summary>
            public string FPRDMOENTYID { get; set; }
            /// <summary>
            ///  ç‰©æ–™å•位用量
            /// </summary>
            public decimal dwyl { get; set; }
            /// <summary>
            ///  å·²é¢†æ•°é‡
            /// </summary>
            public decimal FPickedQty { get; set; }
            /// <summary>
            /// å‰©ä½™å¯ç”¨æ•°é‡
            /// </summary>
            public decimal FRemainPickedQty { get; set; }
            /// <summary>
            ///  ç‰©æ–™
            /// </summary>
            public string FMATERIALID { get; set; }
        }
        #endregion
        #region å­˜å‚¨ä¸´æ—¶éœ€è¦æ’入数据
        public class CompleteAnalysisTempModel
        {
            /// <summary>
            /// ä¸»ç”Ÿäº§è®¢å•主内码:FHMainICMOInterIDr
            /// </summary>
            public string FHMainICMOInterIDr { get; set; }
            /// <summary>
            ///  ä¸»ç”Ÿäº§è®¢å•子内码:FHMainICMOEntryID
            /// </summary>
            public string FHMainICMOEntryID { get; set; }
            /// <summary>
            ///  æ—¥è®¡åˆ’订单主内码:FHICMOInterID
            /// </summary>
            public string FHICMOInterID { get; set; }
            /// <summary>
            ///  æ—¥è®¡åˆ’订单子内码:FHICMOEntryID
            /// </summary>
            public string FHICMOEntryID { get; set; }
            /// <summary>
            ///  å­ä»¶ç‰©æ–™ï¼šFHMaterID
            /// </summary>
            public string FHMaterID { get; set; }
            /// <summary>
            ///  åº“存组织:FHStockOrgID
            /// </summary>
            public string FHStockOrgID { get; set; }
            /// <summary>
            ///生产组织:FHPRDORGID
            /// </summary>
            public string FHPRDORGID { get; set; }
            /// <summary>
            /// ç”Ÿäº§è®¢å•号:FPRDBillNo
            /// </summary>
            public string FPRDBillNo { get; set; }
            /// <summary>
            /// æ ‡è¯†
            /// </summary>
            public string FIdentificat { get; set; }
            /// <summary>
            ///  è´§ä¸»åç§°ï¼šFOwnerName
            /// </summary>
            public string FOwnerName { get; set; }
            /// <summary>
            ///  è´§ä¸»ç¼–码:FOwnerId
            /// </summary>
            public string FOwnerId { get; set; }
            /// <summary>
            /// è´§ä¸»ç±»åž‹ï¼šFOwnerTypeId
            /// </summary>
            public string FOwnerTypeId { get; set; }
            /// <summary>
            /// é½å¥—状态
            /// </summary>
            public string FComPlete { get; set; }
            /// <summary>
            ///  æ•°é‡
            /// </summary>
            public string FHUseQty { get; set; }
            /// <summary>
            ///  åŠæ—¶åº“存数量:FHStockQty
            /// </summary>
            public decimal FHStockQty { get; set; }
            /// <summary>
            ///可用数量:FHLeftQty
            /// </summary>
            public decimal FHLeftQty { get; set; }
            /// <summary>
            /// ç¼ºæ–™æ•°é‡
            /// </summary>
            public decimal FLackCount { get; set; }
            /// <summary>
            /// å ç”¨æ•°é‡
            /// </summary>
            public decimal FOccupyCount { get; set; }
            /// <summary>
            /// å ç”¨é¢†æ–™æ•°é‡
            /// </summary>
            public decimal FOccupyPickedCount { get; set; }
            /// <summary>
            /// å•位用量:FUnitDosage
            /// </summary>
            public decimal FUnitDosage { get; set; }
            /// <summary>
            /// è®¡åˆ’总数量:FSumPlanCount
            /// </summary>
            public decimal FSumPlanCount { get; set; }
            /// <summary>
            /// é½å¥—数量:FCompleteCount q
            /// </summary>
            public decimal FCompleteCount { get; set; }
            public decimal FCompleteCount1 { get; set; }
            /// <summary>
            /// æ—¥è®¡åˆ’日期
            /// </summary>
            public DateTime FPlanDate { get; set; }
            //物料类型
            public int FErpClsID { get; set; }
            //仓库
            public string FStock { get; set; }
            //车间
            public string FWorkShop { get; set; }
        }
        #endregion
        [Route("JIT_DayPlanPlatFormBill/JIT_CompleteSetAnalysis")]
        [HttpGet]
        public object JIT_CompleteSetAnalysis(string sWhere, string user)
        {
            try
            {
                oCN.BeginTran();
                Stopwatch sw = new Stopwatch();
                omdelMian = JsonConvert.DeserializeObject<Sc_WorkBillSortBillMain>(sWhere);
                string sql = $"exec JIT_qtfx {omdelMian.HProdORGID},{omdelMian.HWorkShopID},'{user}' ";
                ds = oCN.RunProcReturn(sql, "JIT_qtfx");
                LogService.Write("齐套分析sql:" + sql);
                List<PRD_PPBOM> BomList = new List<PRD_PPBOM>();
                DataTable resulTable = ds.Tables[0];
                if (resulTable.Rows[0][0].ToString().Contains("失败"))
                {
                    return resulTable.Rows[0][0].ToString();
                }
                else
                {
                    BomList = ds.ToModelList<PRD_PPBOM>();
                }
                string fDayPlanFids = string.Empty;
                string fDayPlanFEntryids = string.Empty;
                if (BomList.Count == 0)
                {
                    return "没有需要进行齐套分析的数据";
                }
                else
                {
                    List<string> fidList = BomList.Select(x => x.HInterID.ToString()).Distinct().ToList();
                    List<string> fentryidList = BomList.Select(x => x.HEntryID.ToString()).Distinct().ToList();
                    fDayPlanFids = string.Join(",", fidList);
                    fDayPlanFEntryids = string.Join(",", fentryidList);
                }
                LogService.Write("日计划工单ids" + fDayPlanFids);
                sw.Start();//开始计时
                //获取当前即时库存 åº“存数量+库存组织+物料+货主+仓库
                ds = oCN.RunProcReturn(@"
select distinct isnull(a.FBASEQTY,0) FBASEQTY,b.FNumber,a.FOwnerTypeId,a.FOwnerId,c.FNUMBER as FOwnerNumber,a.FSTOCKID,d.FNUMBER as FStockNumber from
(
select distinct a.HProdORGID FStockOrgId,T2.FMATERIALID,FNumber from SC_WORKBILLSORTBILLMAIN a
join SC_WORKBILLSORTBILLSub b on a.HInterID = b.HInterID
join AIS20210811135644..T_PRD_PPBOM T1 on a.HICMOInterID_Sec = t1.FMoId and a.HICMOEntryID_Sec = t1.FMOENTRYID
LEFT JOIN  AIS20210811135644..T_PRD_PPBOMENTRY T2 on T1.FID = t2.FID
join  AIS20210811135644..T_BD_MATERIAL T3 on T2.FMATERIALID = T3.FMATERIALID
) T1
JOIN  AIS20210811135644..T_BD_MATERIAL b on  t1.FNUMBER = b.FNUMBER
LEFT JOIN  AIS20210811135644..T_STK_Inventory a on b.FMATERIALID = a.FMATERIALID
LEFT join (select distinct fitemid,fformid,FNUMBER from  AIS20210811135644..V_ITEMCLASS_OWNER) c on a.FOwnerTypeId = c.fformid and a.FOWNERID = c.fitemid
join  AIS20210811135644..t_BD_Stock d on a.FSTOCKID =d.FSTOCKID
where a.FBASEQTY>0
", "SC_WORKBILLSORTBILLMAIN");
                ListInventory = ds.ToModelList<PRD_Inventory>();
                //车间 ä»“库对照列表
                ds = oCN.RunProcReturn(@"
SELECT DISTINCT T1.HOrgId FORGID,HWorkShopID FWORKSHOPID,HWHID FSTOCKID FROM Gy_WorkWarehouseBillMain T1
JOIN Gy_WorkWarehouseBillMainSub T2 ON T1.HInterID=T2.HInterID
", "Gy_WorkWarehouseBillMain");
                List<PRD_WorkHouseCompar> pRD_WorkHouseCompar = ds.ToModelList<PRD_WorkHouseCompar>();
                int i = 1;//用于进度条的加载
                //日计划+生产订单子表编码ID
                var DatePlanList = BomList.GroupBy(p => new { p.HMasterDate, p.HICMOEntryID_Sec }).Select(x => new PRD_PPBOM { HMasterDate = x.Key.HMasterDate, HICMOEntryID_Sec = x.Key.HICMOEntryID_Sec }).ToList();
                //取应发数量 FMustQty ä¸è¦å–值需求数量FNeedQty é¢†æ–™æ•°æ®
                string LLsql = string.Format(@"
select max(t1.FCXStockInQty)FCXStockInQty,FPRDMOENTYID,max(dwyl)dwyl,sum(FPickedQty)FPickedQty,sum(FRemainPickedQty)FRemainPickedQty,FMATERIALID from
(
select a.FCXStockInQty, FPRDMOENTYID,convert( decimal(18,2),FMustQty/FQty ) as dwyl,FPickedQty,T2.FMATERIALID,
case when convert( decimal(18,2),(FPickedQty - a.FCXStockInQty * FMustQty/FQty))< 0 then 0
else convert( decimal(18,2),(FPickedQty - a.FCXStockInQty * FMustQty/FQty)) end as FRemainPickedQty
 from
(
select sum(HSourceStockInQty)FCXStockInQty,HICMOEntryID_Sec FPRDMOENTYID from SC_WORKBILLSORTBILLMAIN a
--where a.HInterID IN ({0})
group by HICMOEntryID_Sec
) a
join  AIS20210811135644..T_PRD_PPBOM T1  on a.FPRDMOENTYID = t1.FMOENTRYID
LEFT JOIN AIS20210811135644..T_PRD_PPBOMENTRY t2 on T1.FID = T2.FID
LEFT JOIN AIS20210811135644..T_PRD_PPBOMENTRY_Q t3 on t2.FENTRYID = T3.FENTRYID
LEFT JOIN AIS20210811135644..T_BD_MATERIAL T4 ON T2.FMATERIALID = T4.FMATERIALID
) t1
group by FPRDMOENTYID,FMATERIALID
", fDayPlanFids);
                List<DayPlanPickedModel> DayPlanPickedModel = new List<DayPlanPickedModel>();
                ds = oCN.RunProcReturn(LLsql, "SC_WORKBILLSORTBILLMAIN");
                DayPlanPickedModel = ds.ToModelList<DayPlanPickedModel>();
                //CompleteAnalysisTempModel ç”¨äºŽå­˜å‚¨ä¸´æ—¶éœ€è¦æ’入数据
                List<CompleteAnalysisTempModel> completeAnalysisTempModel = new List<CompleteAnalysisTempModel>();
                //创建字典 ç”¨äºŽå‚¨å­˜ç‰©æ–™ + å ç”¨æ•°é‡
                Dictionary<string, decimal> occupyDic = new Dictionary<string, decimal>();
                LogService.Write($"齐套分析,数据准备阶段,用时" + sw.Elapsed + "总行数:" + BomList.Count);
                LogService.Write($"齐套分析,数据准备阶段,用时" + sw.Elapsed + "总需要循环的bom数量:" + DatePlanList.Count);
                //第一个循环 æ—¥è®¡åˆ’工单明细 ä¸€å¤©+一个工单 ä¸€ä¸ªå¾ªçޝ
                foreach (var item in DatePlanList)
                {
                    //日计划用料清单明细 æ¯ä¸€å¤©çš„实际用料情况
                    var _BomList = BomList.Where(x => x.HMasterDate == item.HMasterDate && x.HICMOEntryID_Sec == item.HICMOEntryID_Sec).ToList();
                    //每一个物料进行库存计算
                    foreach (var _item in _BomList)
                    {
                        //车间仓库 å¯¹ç…§è¡¨ æ¯ä¸ªæ—¥è®¡åˆ’同属一个车间 A,B
                        var _pRD_WorkHouseCompar = pRD_WorkHouseCompar.Where(c => c.FWORKSHOPID == _item.HWorkShopID).ToList();
                        decimal jskcQty = 0;//用于计算
                        decimal jskcQty2 = 0;//用于计算当时那个计算节点的即时库存
                        //计算当前这几个仓库总的库存量
                        if (_pRD_WorkHouseCompar.Count > 0)
                        {
                            foreach (var _WorkHouse in _pRD_WorkHouseCompar)
                            {
                                //库存数据匹配
                                List<PRD_Inventory> _ListInventory = ListInventory.Where(c => c.FNumber == _item.FNumber && c.FBASEQTY > 0 && c.FSTOCKID == _WorkHouse.FSTOCKID).ToList();
                                if (_ListInventory.Count > 0)
                                {
                                    foreach (var Inventory in _ListInventory)
                                    {
                                        jskcQty += Inventory.FBASEQTY;
                                    }
                                }
                            }
                        }
                        //找出物料被其它订单占用数量
                        decimal occupyMaterial = 0;
                        if (occupyDic.ContainsKey(_item.HWorkShopID + _item.FMATERIALID2))
                        {
                            occupyMaterial = occupyDic[_item.HWorkShopID + _item.FMATERIALID2];
                        }
                        //虚拟日计划用料清单 éœ€æ±‚数量
                        decimal planNeed = _item.PlanCount; //不参与计算 ç”¨äºŽè®°å½•
                        decimal need = _item.PlanCount;//参与计算
                        decimal FOccupyPickedCount = 0;//占用领料单数量
                        //找到领用数量
                        var _DayPlanPickedModel = DayPlanPickedModel.Where(c => c.FPRDMOENTYID == _item.HICMOEntryID_Sec && c.FMATERIALID == _item.FMATERIALID2).FirstOrDefault();
                        if (_DayPlanPickedModel.FRemainPickedQty >= need)
                        {
                            //领料数量满足了当前这个需求量 ç›´æŽ¥é½å¥— ä¸éœ€è¦åŽ»å ç”¨ä»“åº“
                            completeAnalysisTempModel.Add(new CompleteAnalysisTempModel
                            {
                                FHMainICMOInterIDr = _item.HICMOInterID_Sec,
                                FHMainICMOEntryID = _item.HICMOEntryID_Sec,
                                FHICMOInterID = _item.HInterID.ToString(),
                                FHICMOEntryID = _item.HEntryID.ToString(),
                                FHMaterID = _item.FMATERIALID2,
                                FErpClsID = _item.FErpClsID,
                                FHStockOrgID = _item.FStockOrgId,
                                FHPRDORGID = _item.FStockOrgId,
                                FPRDBillNo = _item.HICMOBillNo,
                                FOwnerTypeId = "",
                                FUnitDosage = _item.dwyl,//单位用量
                                FSumPlanCount = planNeed,//计划总数量
                                FCompleteCount1 = planNeed, //齐套数量
                                FLackCount = 0,//缺料数量
                                FHStockQty = jskcQty2,//即时库存
                                FHLeftQty = jskcQty,//可用数量
                                FOccupyCount = occupyMaterial,//占用数量
                                FOccupyPickedCount = planNeed,//占用领料数量
                                FComPlete = "齐套",
                                FPlanDate = item.HMasterDate, // æ—¥è®¡åˆ’日期
                                FWorkShop = _item.HWorkShopID //车间
                            });
                            //扣除剩余可用领料数量
                            _DayPlanPickedModel.FRemainPickedQty -= need;
                            //循环下一个物料
                            continue;
                        }
                        else
                        {
                            need -= _DayPlanPickedModel.FRemainPickedQty; //剩余需求数量
                            FOccupyPickedCount = _DayPlanPickedModel.FRemainPickedQty;
                            _DayPlanPickedModel.FRemainPickedQty = 0;
                        }
                        if (_pRD_WorkHouseCompar.Count > 0)
                        {
                            //缺料数量 éœ€æ±‚数量 - å®žé™…库存  >0 ? ä¸€ä¸ªç‰©æ–™ä¸ç®¡å ç”¨å¤šå°‘条 åº“å­˜+货主 æ•°æ® ç¼ºæ–™æ•°é‡æ˜¯åŒä¸€ä¸ªæ•°é‡
                            decimal _fLackCount = need > jskcQty ? (need - jskcQty) : 0;
                            //LogHelper.Info("组织:" + _item.FStockOrgId + " ,及时库存" + jskcQty);
                            //总库存为0了 ç›´æŽ¥ç»™å‡º ç¼ºæ–™æ•°é‡
                            if (jskcQty == 0)
                            {
                                completeAnalysisTempModel.Add(new CompleteAnalysisTempModel
                                {
                                    FHMainICMOInterIDr = _item.HICMOInterID_Sec,
                                    FHMainICMOEntryID = _item.HICMOEntryID_Sec,
                                    FHICMOInterID = _item.HInterID.ToString(),
                                    FHICMOEntryID = _item.HEntryID.ToString(),
                                    FHMaterID = _item.FMATERIALID2,
                                    FErpClsID = _item.FErpClsID,
                                    FHStockOrgID = _item.FStockOrgId,
                                    FHPRDORGID = _item.FStockOrgId,
                                    FPRDBillNo = _item.HICMOBillNo,
                                    FOwnerTypeId = "",
                                    FUnitDosage = _item.dwyl,//单位用量
                                    FSumPlanCount = planNeed,//计划总数量
                                    FCompleteCount1 = FOccupyPickedCount, //齐套数量
                                    FLackCount = need,//缺料数量
                                    FHStockQty = jskcQty2,//即时库存
                                    FHLeftQty = jskcQty,//可用数量
                                    FOccupyCount = occupyMaterial,//占用数量
                                    FOccupyPickedCount = FOccupyPickedCount,//占用领料数量
                                    FComPlete = "未齐套",
                                    FPlanDate = item.HMasterDate, // æ—¥è®¡åˆ’日期
                                    FWorkShop = _item.HWorkShopID //车间
                                });
                                //终止该物料计算 è¿›å…¥ä¸‹ä¸€ä¸ª
                                continue;
                            }
                            foreach (var WorkHouse in _pRD_WorkHouseCompar)
                            {
                                //库存数据匹配
                                List<PRD_Inventory> _ListInventory = ListInventory.Where(c => c.FNumber == _item.FNumber && c.FBASEQTY > 0 && c.FSTOCKID == WorkHouse.FSTOCKID).ToList();
                                //需求数量 å ç”¨å®ŒåŽå¯ä»¥è·³å‡ºè½¦é—´ä»“库循环
                                if (need == 0)
                                    break;
                                if (_ListInventory.Count > 0)
                                {
                                    foreach (var Inventory in _ListInventory)
                                    {
                                        if (need == 0)
                                            break;
                                        //齐套数量
                                        decimal fCompleteCount = need >= Inventory.FBASEQTY ? Inventory.FBASEQTY : need;
                                        if (!occupyDic.ContainsKey(_item.HWorkShopID + _item.FMATERIALID2))
                                        {
                                            occupyDic.Add(_item.HWorkShopID + _item.FMATERIALID2, fCompleteCount);
                                        }
                                        else
                                        {
                                            occupyMaterial = occupyDic[_item.HWorkShopID + _item.FMATERIALID2];
                                            occupyDic[_item.HWorkShopID + _item.FMATERIALID2] = occupyMaterial + fCompleteCount;
                                        }
                                        completeAnalysisTempModel.Add(new CompleteAnalysisTempModel
                                        {
                                            FHMainICMOInterIDr = _item.HICMOInterID_Sec,
                                            FHMainICMOEntryID = _item.HICMOEntryID_Sec,
                                            FHICMOInterID = _item.HInterID.ToString(),
                                            FHICMOEntryID = _item.HEntryID.ToString(),
                                            FHMaterID = _item.FMATERIALID2,
                                            FHStockOrgID = _item.FStockOrgId,
                                            FHPRDORGID = _item.FStockOrgId,
                                            FErpClsID = _item.FErpClsID,
                                            FPRDBillNo = _item.HICMOBillNo,
                                            FOwnerTypeId = Inventory.FOwnerTypeId,
                                            FOwnerId = Inventory.FOwnerId,
                                            FUnitDosage = _item.dwyl,//单位用量
                                            FSumPlanCount = planNeed,//计划总数量
                                            FCompleteCount1 = fCompleteCount + FOccupyPickedCount, //齐套数量
                                            FLackCount = _fLackCount,//缺料数量
                                            FHStockQty = jskcQty2,//即时库存
                                            FHLeftQty = jskcQty,//可用数量
                                            FOccupyCount = occupyMaterial,//占用数量
                                            FOccupyPickedCount = FOccupyPickedCount,//领料占用数量
                                            FComPlete = jskcQty >= need ? "齐套" : "未齐套",
                                            FPlanDate = item.HMasterDate, // æ—¥è®¡åˆ’日期
                                            FStock = Inventory.FSTOCKID,//仓库
                                            FWorkShop = _item.HWorkShopID //车间
                                        });
                                        //扣减总库存数量
                                        jskcQty = jskcQty >= fCompleteCount ? jskcQty - fCompleteCount : 0;
                                        //剩余日计划需求数量
                                        need = need >= Inventory.FBASEQTY ? need - Inventory.FBASEQTY : 0;
                                        //扣减消耗库存
                                        Inventory.FBASEQTY = Inventory.FBASEQTY - fCompleteCount;
                                    }
                                }
                            }
                        }
                        //没有车间仓库数据 æ—¢æ²¡æœ‰å¯ç”¨åº“å­˜ ä¸ºæœªé½å¥—
                        else
                        {
                            if (occupyDic.ContainsKey(_item.HWorkShopID + _item.FMATERIALID2))
                            {
                                occupyMaterial = occupyDic[_item.HWorkShopID + _item.FMATERIALID2];
                            }
                            completeAnalysisTempModel.Add(new CompleteAnalysisTempModel
                            {
                                FHMainICMOInterIDr = _item.HICMOInterID_Sec,
                                FHMainICMOEntryID = _item.HICMOEntryID_Sec,
                                FHICMOInterID = _item.HInterID.ToString(),
                                FHICMOEntryID = _item.HEntryID.ToString(),
                                FHMaterID = _item.FMATERIALID2,
                                FErpClsID = _item.FErpClsID,
                                FHStockOrgID = _item.FStockOrgId,
                                FHPRDORGID = _item.FStockOrgId,
                                FPRDBillNo = _item.HICMOBillNo,
                                FOwnerTypeId = "",
                                FUnitDosage = _item.dwyl,//单位用量
                                FSumPlanCount = planNeed,//计划总数量
                                FCompleteCount1 = planNeed - need, //齐套数量
                                FLackCount = need,//缺料数量
                                FHStockQty = jskcQty2,//即时库存
                                FHLeftQty = jskcQty,//可用数量
                                FOccupyCount = occupyMaterial,//占用数量
                                FOccupyPickedCount = FOccupyPickedCount,//占用领料数量
                                FComPlete = "未齐套",
                                FPlanDate = item.HMasterDate, // æ—¥è®¡åˆ’日期
                                FWorkShop = _item.HWorkShopID //车间
                            });
                        }
                    }
                    //Thread.Sleep(6000);
                    i++;
                }
                LogService.Write($"齐套分析,数据准备完成,保存到Model实体,总行数:{completeAnalysisTempModel.Count},耗时:" + sw.Elapsed);
                List<string> sqlList = new List<string>();
                DataTable insertDT = new DataTable();
                insertDT.TableName = "JIT_MOMaterReadysBill";
                insertDT.Columns.Add("FID", typeof(long));
                insertDT.Columns.Add("FDOCUMENTSTATUS", typeof(string));
                insertDT.Columns.Add("FHMAINICMOINTERIDR", typeof(long));
                insertDT.Columns.Add("FHMAINICMOENTRYID", typeof(long));
                insertDT.Columns.Add("FHICMOINTERID", typeof(long));
                insertDT.Columns.Add("FHICMOENTRYID", typeof(long));
                insertDT.Columns.Add("FHMATERID", typeof(long));
                insertDT.Columns.Add("FHSTOCKORGID", typeof(long));
                insertDT.Columns.Add("FHSTOCKQTY", typeof(decimal));
                insertDT.Columns.Add("FHLEFTQTY", typeof(decimal));
                insertDT.Columns.Add("FHPRDORGID", typeof(long));
                insertDT.Columns.Add("FUNITDOSAGE", typeof(decimal));
                insertDT.Columns.Add("FSUMPLANCOUNT", typeof(decimal));
                insertDT.Columns.Add("FPRDBILLNO", typeof(string));
                insertDT.Columns.Add("FOWNERID", typeof(long));
                insertDT.Columns.Add("FOWNERTYPEID", typeof(string));
                insertDT.Columns.Add("FPLANDATE", typeof(DateTime));
                insertDT.Columns.Add("FCOMPLETE", typeof(string));
                insertDT.Columns.Add("FLACKCOUNT", typeof(decimal));
                insertDT.Columns.Add("FOCCUPYCOUNT", typeof(decimal));
                insertDT.Columns.Add("FCOMPLETECOUNT1", typeof(decimal));
                insertDT.Columns.Add("FERPCLSID", typeof(string));
                insertDT.Columns.Add("FWORKSHOPID", typeof(long));
                insertDT.Columns.Add("FSTOCKID", typeof(long));
                insertDT.Columns.Add("FOCCUPYPICKEDCOUNT", typeof(decimal));
                int jdtmmm = 1;
                ds = oCN.RunProcReturn("select max(HInterID)FID FROM  JIT_MOMaterReadysBill", "JIT_MOMaterReadysBill");
                int maxFid = int.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString());
                foreach (var item in completeAnalysisTempModel)
                {
                    DataRow dr = insertDT.NewRow();
                    dr["FID"] = maxFid + jdtmmm;
                    dr["FDOCUMENTSTATUS"] = "A";
                    dr["FHMAINICMOINTERIDR"] = item.FHMainICMOInterIDr;
                    dr["FHMAINICMOENTRYID"] = item.FHMainICMOEntryID;
                    dr["FHICMOINTERID"] = item.FHICMOInterID;
                    dr["FHICMOENTRYID"] = item.FHICMOEntryID;
                    dr["FHMATERID"] = item.FHMaterID;
                    dr["FHSTOCKORGID"] = item.FHStockOrgID;
                    dr["FHSTOCKQTY"] = item.FHStockQty;
                    dr["FHLEFTQTY"] = item.FHLeftQty;
                    dr["FHPRDORGID"] = item.FHPRDORGID;
                    dr["FUNITDOSAGE"] = item.FUnitDosage;
                    dr["FSUMPLANCOUNT"] = item.FSumPlanCount;
                    dr["FPRDBILLNO"] = item.FPRDBillNo;
                    dr["FOWNERID"] = item.FOwnerId == null ? "0" : item.FOwnerId;
                    dr["FOWNERTYPEID"] = item.FOwnerTypeId;
                    dr["FPLANDATE"] = item.FPlanDate.ToString("yyyy-MM-dd");
                    dr["FCOMPLETE"] = item.FComPlete;
                    dr["FLACKCOUNT"] = item.FLackCount;
                    dr["FOCCUPYCOUNT"] = item.FOccupyCount;
                    dr["FCOMPLETECOUNT1"] = item.FCompleteCount1;
                    dr["FERPCLSID"] = item.FErpClsID;
                    dr["FWORKSHOPID"] = item.FWorkShop == null ? "0" : item.FWorkShop;
                    dr["FSTOCKID"] = item.FStock == null ? "0" : item.FStock;
                    dr["FOCCUPYPICKEDCOUNT"] = item.FOccupyPickedCount;
                    insertDT.Rows.Add(dr);
                    jdtmmm++;
                }
                insertDT.EndLoadData(); // çŒå…¥æ•°æ®ç»“束
                //插入之前执行下清空语句(测试是否能够防止重复生成)
                string deletesql = $"delete from JIT_MOMaterReadysBill  where HICMOInterID  in ({fDayPlanFids}) ";
                oCN.RunProc(deletesql);
                // æ‰¹é‡æ’入到数据库
                foreach (DataRow item in insertDT.Rows)
                {
                    oCN.RunProc("insert into JIT_MOMaterReadysBill(HInterID,HDocumentStatus,HMainICMOInterID,HMainICMOEntryID,HICMOInterID" +
                            ", HICMOEntryID, HMaterID, HStockORGID, HStockQty, HLeftQty" +
                            ", HProdORGID, HUnitDosage, HSumPlanQty, HICMOBillNo, HOwnerID" +
                            ", HOwnerTypeID, HPlanDate, HComplete, HLackQty, HOccupyQty" +
                            ", HCompleteQty1, HErpClsID, HWorkShopID, HWHID, HOccupyPickedQTY)values" +
                             $"({item["FID"].ToString()}, 1, {item["FHMAINICMOINTERIDR"].ToString()}, {item["FHMAINICMOENTRYID"].ToString()}, {item["FHICMOINTERID"].ToString()}" +
                             $", {item["FHICMOENTRYID"].ToString()}, {item["FHMATERID"].ToString()}, {item["FHSTOCKORGID"].ToString()}, {item["FHSTOCKQTY"].ToString()}, {item["FHLEFTQTY"].ToString()}" +
                             $" , {item["FHPRDORGID"].ToString()}, {item["FUNITDOSAGE"].ToString()}, {item["FSUMPLANCOUNT"].ToString()}, '{item["FPRDBILLNO"].ToString()}', {item["FOWNERID"].ToString()}" +
                             $", '{item["FOWNERTYPEID"].ToString()}', '{item["FPLANDATE"].ToString()}','{item["FCOMPLETE"].ToString()}', {item["FLACKCOUNT"].ToString()}, {item["FOCCUPYCOUNT"].ToString()}" +
                             $", {item["FCOMPLETECOUNT1"].ToString()}, {item["FERPCLSID"].ToString()}, {item["FWORKSHOPID"].ToString()}, {item["FSTOCKID"].ToString()}, {item["FOCCUPYPICKEDCOUNT"].ToString()})");
                }
                LogService.Write("批量插入到数据库用时:" + sw.Elapsed);
                //执行完成后 æ›´æ–°æ—¥è®¡åˆ’工单状态
                string updatesql = string.Format(@"
update Sc_WorkBillSortBillSub set HComplete = '未齐套' where HEntryID IN
(select distinct HICMOEntryID from JIT_MOMaterReadysBill
 where  isnull(HComplete,'未齐套') ='未齐套'
 and HICMOEntryID in ({0})
 )", fDayPlanFEntryids);
                //LogService.Write(Context, updatesql);
                oCN.RunProc(updatesql);
                updatesql = string.Format(@"
update Sc_WorkBillSortBillSub set HComplete  = '齐套'
where HEntryID IN ({0}) and HComplete  <>'未齐套'
", fDayPlanFEntryids);
                //LogService.Write(updatesql);
                oCN.RunProc(updatesql);
                //释放齐套操作 é¿å…å¤šäººåŒæ—¶è¿›è¡Œé½å¥—分析
                oCN.RunProc($"update T_PRD_QTFX set FSTATUS = 0 where FPRDORGID ={omdelMian.HProdORGID} and FSTATUS = 1 ");
                sw.Stop();//结束计时
                LogService.Write("齐套分析运行总时长:" + sw.Elapsed);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "操作成功";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                LogService.Write("操作失败:" + e.Message.ToString());
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.Message.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 é”å®š
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHLockedDay")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHLockedDay(string sWhere, int HLockedDay)
        {
            try
            {
                if (sWhere != null && sWhere != "")
                {
                    oCN.RunProc("update Sc_WorkBillSortBillSub set HLockedSub=1" +
                    $" where HInterID in ({sWhere}) and HMasterDate between  DATEADD(day, -1, getdate()) and DATEADD(day,{(HLockedDay - 1)},getdate()) ");
                }
                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
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 è§£é”
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHUnlockDay")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHUnlockDay(string sWhere, int HLockedDay)
        {
            try
            {
                if (sWhere != null && sWhere != "")
                {
                    oCN.RunProc("update Sc_WorkBillSortBillSub set HLockedSub=0" +
                    $" where HInterID in ({sWhere}) and HMasterDate between  DATEADD(day, -1, getdate()) and DATEADD(day,{(HLockedDay - 1)},getdate()) ");
                }
                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
    }
}
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/Sc_WorkBillSortBillController.cs
@@ -35,7 +35,7 @@
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from  h_v_JIT_Sc_WorkBillSortBillList where 1=1" + sWhere + "order by å•据号 desc ", "h_v_JIT_Sc_WorkBillSortBillList");
                ds = oCN.RunProcReturn("select * from  h_v_JIT_Sc_WorkBillSortBillList where 1=1" + sWhere + " order by å•据号 desc ", "h_v_JIT_Sc_WorkBillSortBillList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -19,7 +19,7 @@
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
@@ -136,7 +136,7 @@
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
@@ -216,14 +216,21 @@
                DataRow dr1 = ds1.Tables[0].Rows[0];
                JObject model = new JObject();
                model.Add("FBillType", "50fa7c2eda7947b89fab5431bf25d48e"); //单据类型1
                model.Add("FBillType", new JObject() { ["Fnumber"] = "SCHBD01_SYS" }); //单据类型生产汇报“SCHBD02_SYS” å…¥åº“汇报SCHBD01_SYS
                model.Add("FPrdOrgId", new JObject() { ["Fnumber"] = dr1["FPrdOrgNUMBER"].ToString() }); //生产组织1
                model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //单据日期1
                JArray Fentity = new JArray();
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    JObject FentityModel = new JObject();
                    FentityModel.Add("FReportType", "103852");//生产汇报类型
                    FentityModel.Add("FReportType", new JObject() { ["Fnumber"] = "1" });//生产汇报类型
                    FentityModel.Add("FSrcBillType", "PRD_MO");//  æºå•类型
                    FentityModel.Add("FProductType", "1");//  äº§å“ç±»åž‹
                    FentityModel.Add("FSrcBillNo", item["任务单"].ToString());//  æºå•编号
                    FentityModel.Add("FSrcInterId", dr1["FMOID"].ToString());//  æºå•内码
                    FentityModel.Add("FSrcEntryId", dr1["FMOENTRYID"].ToString());//  æºå•分录内码、
                    FentityModel.Add("FSRCENTRYSEQ", dr1["FMOENTRYSEQ"].ToString());//  æºå•分录行号
                    FentityModel.Add("FUNITID", new JObject() { ["Fnumber"] = dr1["FUNITNUMBER"].ToString() });//单位
                    FentityModel.Add("FTimeUnitId", "1");//时间单位
                    FentityModel.Add("FWorkshipId", new JObject() { ["Fnumber"] = dr1["FWorkShopNUM"].ToString() }); //  ç”Ÿäº§è½¦é—´
                    FentityModel.Add("FStandHourUnitId", "3600"); // å•位标准工时单位 
@@ -231,25 +238,48 @@
                    FentityModel.Add("FMoEntrySeq", dr1["HICMOEntryID"].ToString());//生产订单行号
                    FentityModel.Add("FMoId", dr1["HICMOInterID"].ToString());//生产订单内码
                    FentityModel.Add("FFinishQty", item["接收数量"].ToString());//完成数量1
                    FentityModel.Add("FQuaQty", item["合格数量"].ToString());//合格数量1
                    FentityModel.Add("FStockInOrgId ", OrganizationNUM);// å…¥åº“组织
                    FentityModel.Add("FQuaQty", item["合格数量"].ToString());//合格数量1FFailQty
                    FentityModel.Add("FFailQty", item["不良数量"].ToString());//不合格数量
                    FentityModel.Add("FStockInOrgId ", new JObject() { ["Fnumber"] = OrganizationNUM });// å…¥åº“组织
                    FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = dr1["FStockNUM"].ToString() }); // ä»“库 
                    FentityModel.Add("FSrcBillType", "PRD_MO");//  æºå•类型
                    FentityModel.Add("FSrcBillNo", item["任务单"].ToString());//  æºå•编号
                    FentityModel.Add("FSrcInterId", dr1["HICMOInterID"].ToString());//  æºå•内码
                    FentityModel.Add("FSrcEntryId", dr1["HICMOEntryID"].ToString());//  æºå•分录内码
                    FentityModel.Add("FMOID", dr1["FMOID"].ToString());//
                    FentityModel.Add("FMOBILLNO", dr1["FMOBILLNO"].ToString());//
                    FentityModel.Add("FMOENTRYID", dr1["FMOENTRYID"].ToString());//
                    FentityModel.Add("FMOENTRYSEQ", dr1["FMOENTRYSEQ"].ToString());//
                    FentityModel.Add("FOwnerTypeId", dr1["FOWNERTYPEID"].ToString()); //货主类型:FOwnerTypeId(必填项)
                    FentityModel.Add("FOwnerId", new JObject() { ["Fnumber"] = dr1["FOwnerNumber"].ToString() }); //货主:FOwnerId(必填项)
                    FentityModel.Add("FBomId", new JObject() { ["Fnumber"] = dr1["FBOMNUM"].ToString() }); //BOM版本:FBomId(必填项)
                    FentityModel.Add("FCostRate", dr1["FCostRate"].ToString());// æˆæœ¬æƒé‡
                    FentityModel.Add("FISBACKFLUSH", dr1["FISBACKFLUSH"].ToString() == "1" ? true : false);// å€’冲领料
                    //FFLOWID FFLOWLINEID FRULEID FSTABLENAME
                    //f6e6eec3 - 5267 - 4f02 - 8593 - b633da508a72    3   PRD_MO2MORPT T_PRD_MOENTRY
                    //业务流程图:FEntity_Link_FFlowId
                    //推进路线:FEntity_Link_FFlowLineId
                    //转换规则:FEntity_Link_FRuleId
                    //源单表内码:FEntity_Link_FSTableId
                    //源单表:FEntity_Link_FSTableName
                    //源单内码:FEntity_Link_FSBillId
                    //源单分录内码:FEntity_Link_FSId
                    //原始携带量:FEntity_Link_FBaseQuaQtyOld
                    //修改携带量:FEntity_Link_FBaseQuaQty
                    //JArray Fentity2 = new JArray();
                    //JObject FentityModel2 = new JObject();
                    //FentityModel2.Add("FDetailEntity_Link_FRULEID", "PUR_PurchaseOrder-PUR_ReceiveBill");
                    //FentityModel2.Add("FDetailEntity_Link_FSTableName", "t_PUR_POOrderEntry");
                    //FentityModel2.Add("FDetailEntity_Link_FSBillId", item["FID"].ToString());
                    //FentityModel2.Add("FDetailEntity_Link_FSId", item["FEntryID"].ToString());
                    //Fentity2.Add(FentityModel2);
                    //FentityModel.Add("FDetailEntity_Link", Fentity2);
                    //Fentity.Add(FentityModel);
                    JArray Fentity2 = new JArray();
                    JObject FentityModel2 = new JObject();
                    FentityModel2.Add("FEntity_Link_FFlowId", "f6e6eec3-5267-4f02-8593-b633da508a72");
                    FentityModel2.Add("FEntity_Link_FFlowLineId", "PRD_MO2MORPT");
                    FentityModel2.Add("FEntity_Link_FRuleId", "3");
                    FentityModel2.Add("FEntity_Link_FSTableId", "0");
                    FentityModel2.Add("FEntity_Link_FSTableName", "T_PRD_MOENTRY");
                    FentityModel2.Add("FEntity_Link_FSBillId", dr1["FMOID"].ToString());
                    FentityModel2.Add("FEntity_Link_FSId", dr1["FMOENTRYID"].ToString());
                    FentityModel2.Add("FEntity_Link_FBaseQuaQtyOld", item["合格数量"].ToString());
                    FentityModel2.Add("FEntity_Link_FBaseQuaQty", item["合格数量"].ToString());
                    Fentity2.Add(FentityModel2);
                    FentityModel.Add("FEntity_Link", Fentity2);
                    FentityModel.Add("FBFLowId", new JObject() { ["FID"] = "f6e6eec3-5267-4f02-8593-b633da508a72" }); //
                    Fentity.Add(FentityModel);
                }
                model.Add("FDetailEntity", Fentity); //明细信息
                model.Add("FEntity", Fentity); //明细信息
                JObject jsonRoot = new JObject()
                {
                    ["Creator"] = "",
@@ -261,14 +291,36 @@
                    //["IsAutoSubmitAndAudit"] = true,//自动调用提交和审核功能
                    ["Model"] = model
                };
                string result = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));
                //判断审核是否成功
                LogService.Write("jsonRoot:" + jsonRoot);
                string result = InvokeHelper.Save("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//保存
                //判断保存是否成功
                if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = $"工序汇报入库单同步金蝶云失败!单号:{dr["单据号"].ToString()}" + result;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //提交审核
                string result1 = string.Empty;
                string result2 = string.Empty;
                var fID = JObject.Parse(result)["Result"]["Id"].ToString();
                var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
                var json = new
                {
                    Ids = fID,
                };
                result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(json));//提交
                //result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(json));//审核
                if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = $"生产汇报单单号:{fBillNo},提交失败" + result;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -298,7 +350,7 @@
        /// </summary>
        [Route("Sc_ProcessMangement/MES_Sc_ProcessReportList_Json")]
        [HttpGet]
        public object MES_Sc_ProcessReportList_Json(string sWhere,string user)
        public object MES_Sc_ProcessReportList_Json(string sWhere, string user)
        {
            DataSet ds;
            try
@@ -321,7 +373,7 @@
                else
                {
                    string sql1 = "select * from h_v_Sc_ProcessReportList where 1 = 1 ";
                    string sql = sql1 + sWhere+ " order by hmainid desc";
                    string sql = sql1 + sWhere + " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessReportList");
                }
            }
@@ -349,11 +401,11 @@
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (HInterID<=0)
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!" ;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -366,9 +418,9 @@
    inner join Gy_Department s2 on s1.HDeptID=s2.HItemID and s1.HInterID=" + HInterID;
                    ds = oCN.RunProcReturn(sql1, "Sc_ProcessReportMain");
                }
            }
            catch (Exception e)
            {
@@ -405,12 +457,12 @@
                else
                {
                    string sql1 =@"select [hmainid], [日期], [单据号], [HDeptID], [部门代码], [部门], [HMaterID], [物料代码], [物料名称], [规格型号], [HUnitID], [计量单位代码], [计量单位], [HprocID],
                    string sql1 = @"select [hmainid], [日期], [单据号], [HDeptID], [部门代码], [部门], [HMaterID], [物料代码], [物料名称], [规格型号], [HUnitID], [计量单位代码], [计量单位], [HprocID],
[工序代码], [工序], [HGroupID], [班组代码], [班组名称], [HSourceID], [资源代码], [生产资源], [HWorkerID], [职员代码], [职员], [hsubid], [数量], [计划开工日期], 
[计划完工日期], [计划工时], [表体备注], [HICMOInterID], [生产任务单号], [HSeOrderInterID], [销售订单号], [表头备注], [制单人], [制单日期], [审核人], [审核日期], [修改人],
[修改日期], [关闭人], [关闭日期], [作废人], [作废日期], [源单主内码], [源单子内码], [源单单号], [源单类型], [行关闭人], [HBillType], [HQtyDecimal], [HPriceDecimal] 
from h_v_Sc_ProcessSendWorkList 
where hmainid=(select HSourceID from Sc_ProcessReportSub where HInterID="+HInterID+")";
where hmainid=(select HSourceID from Sc_ProcessReportSub where HInterID=" + HInterID + ")";
                    ds = oCN.RunProcReturn(sql1, "h_v_Sc_ProcessSendWorkList");
@@ -440,7 +492,7 @@
        /// </summary>
        [Route("Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json")]
        [HttpGet]
        public object MES_Sc_ProcessPlanMain_Json(string sWhere,string user)
        public object MES_Sc_ProcessPlanMain_Json(string sWhere, string user)
        {
            DataSet ds;
            try
@@ -462,7 +514,7 @@
                else
                {
                    string sql1 = "select * from h_v_Sc_ProcessPlanList where 1 = 1 ";
                    string sql = sql1 + sWhere+ " order by hmainid desc ";
                    string sql = sql1 + sWhere + " order by hmainid desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList");
                }
            }
@@ -542,7 +594,7 @@
                    ",HRemark,HInnerBillNo,HMaker,HMakeDate" +
                    ") " +
                    " values(" + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + BillType + "','" + BillType + "'," + omodel.HInterID.ToString() +
                    ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + (omodel.HBillStatus=1) + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() +
                    ",'" + omodel.HDate.ToShortDateString() + "','" + omodel.HBillNo + "'," + (omodel.HBillStatus = 1) + "," + omodel.HCheckItemNowID.ToString() + "," + omodel.HCheckItemNextID.ToString() +
                    "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HMaterID.ToString() + ",'" + omodel.HMaterNumber + "'," + omodel.HUnitID.ToString() +
                    ",'" + omodel.HUnitNumber + "'," + omodel.HPlanQty.ToString() + ",'" + omodel.HPlanBeginDate.ToShortDateString() + "','" + omodel.HPlanEndDate.ToShortDateString() + "','" + omodel.HExplanation + "'" +
                    ",'" + omodel.HRemark + "','" + omodel.HInnerBillNo + "','" + omodel.HMaker + "',getdate()" +
@@ -577,7 +629,7 @@
                   " where HInterID=" + omodel.HInterID.ToString());
                    //删除子表
                    oCN.RunProc("Delete From Sc_ProcessPlanSub where HInterID = " + omodel.HInterID.ToString()+ " and hentryid="+ hentryid);
                    oCN.RunProc("Delete From Sc_ProcessPlanSub where HInterID = " + omodel.HInterID.ToString() + " and hentryid=" + hentryid);
                }
                //保存子表
                objJsonResult = AddBillSub(msg3, hentryid);
@@ -624,7 +676,7 @@
               ",HBeginDayQty,HBeginFixQty,HFixWorkDays,HTrunWorkDays,HReadyTimes" +
               ",HReadyTime,HQueueTime,HMoveTime,HBatchNo" +
               ") values("
               + omodel.HInterID.ToString() + "," +(hentryid==-1?i: hentryid) + ",'" + oSub.HBillNo + "'," + oSub.HProcNo.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HWorkingQty.ToString() +
               + omodel.HInterID.ToString() + "," + (hentryid == -1 ? i : hentryid) + ",'" + oSub.HBillNo + "'," + oSub.HProcNo.ToString() + "," + oSub.HProcID.ToString() + "," + oSub.HWorkingQty.ToString() +
               ",'" + oSub.HProcNumber + "','" + oSub.HWorkRemark + "'," + oSub.HCenterID.ToString() + "," + oSub.HDeptID.ToString() + ",'" + oSub.HDeptNumber + "'" +
               "," + oSub.HGroupID.ToString() + ",'" + oSub.HGroupNumber + "'," + oSub.HWorkerID.ToString() + ",'" + oSub.HWorkerNumber + "'," + oSub.HSourceID.ToString() +
               "," + oSub.HQty.ToString() + ",'" + oSub.HTimeUnit + "'," + oSub.HPlanWorkTimes.ToString() + ",'" + oSub.HPlanBeginDate.ToString() + "','" + oSub.HPlanEndDate.ToString() + "'" +
@@ -733,7 +785,7 @@
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在;原因:"+DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.Message = "单据不存在;原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -749,7 +801,8 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else {
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败,原因:" + DBUtility.ClsPub.sExeReturnInfo;
@@ -787,7 +840,7 @@
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        //审核
        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
@@ -854,7 +907,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    objJsonResult.code = "1";
@@ -892,7 +945,7 @@
        /// <returns></returns>
        [Route("Sc_ProcessMangement/MES_Sc_ProcessSendWorkMain_Json")]
        [HttpGet]
        public object MES_Sc_ProcessSendWorkMain_Json(string sWhere,string user)
        public object MES_Sc_ProcessSendWorkMain_Json(string sWhere, string user)
        {
            DataSet ds;
            try
@@ -915,7 +968,7 @@
                else
                {
                    string sql1 = "select * from h_v_Sc_ProcessSendWorkList where 1 = 1 ";
                    string sql = sql1 + sWhere+ " order by hmainid desc ";
                    string sql = sql1 + sWhere + " order by hmainid desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessSendWorkList");
                }
            }
@@ -937,7 +990,7 @@
        /// <returns></returns>
        [Route("SaveProcessSendWork")]
        [HttpPost]
        public object SaveProcessSendWork([FromBody]JObject msg)
        public object SaveProcessSendWork([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
@@ -967,7 +1020,7 @@
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_SendWorkMain(msg2);
                foreach ( Model.ClsSc_ProcessSendWorkMain  oItem in lsmain)
                foreach (Model.ClsSc_ProcessSendWorkMain oItem in lsmain)
                {
                    UserName = oItem.HMaker;
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
@@ -1034,7 +1087,7 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (Convert.ToInt32( sendworksub.HQty) > Convert.ToInt32( oItemSub.计划数量))
                    if (Convert.ToInt32(sendworksub.HQty) > Convert.ToInt32(oItemSub.计划数量))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -1058,7 +1111,7 @@
                    sendworksub.HCloseType = false;
                    sendworksub.HSourceBillType = oItemSub.HBillType;
                    lss.Add(sendworksub);//先把数据存放到派工单子表集合里
                }
                if (lss.Count > 0)
@@ -1208,7 +1261,7 @@
                    sendworksub.HWorkerNumber = ""; //--操作工代码
                    sendworksub.HWorkerID = 0; //--操作工ID
                    sendworksub.HGroupNumber = ""; //班组代码
                    sendworksub.HGroupID =0;  //--班组ID
                    sendworksub.HGroupID = 0;  //--班组ID
                    sendworksub.HSourceNumber = ""; //--生产资源代码
                    //--生产资源ID
                    sendworksub.HProcNumber = ""; //--工序代码
@@ -1346,7 +1399,7 @@
        /// <returns></returns>
        [Route("Sc_ProcessMangement/MES_QC_NoPassProdCheckBill_Json")]
        [HttpGet]
        public object MES_QC_NoPassProdCheckBill_Json(string sWhere,string user)
        public object MES_QC_NoPassProdCheckBill_Json(string sWhere, string user)
        {
            DataSet ds;
            try
@@ -1369,7 +1422,7 @@
                else
                {
                    string sql1 = "select * from h_v_QC_NoPassProdCheckBillList where 1 = 1 ";
                    string sql = sql1 + sWhere+ " order by hmainid desc ";
                    string sql = sql1 + sWhere + " order by hmainid desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_QC_NoPassProdCheckBillList");
                }
            }
@@ -1432,7 +1485,7 @@
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!"+e.ToString();
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
@@ -1569,7 +1622,7 @@
        /// <returns></returns>
        [Route("SaveProcessReport")]
        [HttpPost]
        public object SaveProcessReport([FromBody] JObject msg)
        public object SaveProcessReport([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
@@ -1580,7 +1633,7 @@
                List<WebAPI.Models.Sc_ProcessReportViewModel> ls = new List<WebAPI.Models.Sc_ProcessReportViewModel>();
                ls = oListModels.getObjectByJson_Report(msg1);
                int i = 0;
                foreach (Models.Sc_ProcessReportViewModel ItemView in ls)
                {
                    i++;
@@ -1589,23 +1642,23 @@
                    //工序汇报单主表保存
                    ReportMain.HBillType = "3714";
                    ReportMain.HBillNo = ItemView.HBillNo;
                    ReportMain.HMakeDate=DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    ReportMain.HYear=DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    ReportMain.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    ReportMain.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    ReportMain.HDate = DateTime.Now;
                    ReportMain.HMaker = ItemView.HEmp;
                    ReportMain.HCloseType = false;
                    ReportMain.HPlanQty = (double)ItemView.HQty;
                    ReportMain.HMainSourceInterID = ItemView.HInterID;
                    ReportMain.HInterID =0;
                    ReportMain.HInterID = 0;
                    ReportMain.HPeriod = 1;
                    ReportMain.HBillSubType = "3714";
                    ReportMain.HBillStatus = 0;
                    ReportMain.HCheckItemNowID = 0;
                    ReportMain.HCheckItemNextID = 0;
                    ReportMain.HICMOInterID= (long)ItemView.HICMOInterID;
                    ReportMain.HICMOBillNo=ItemView.HICMOBillNo;
                    ReportMain.HICMOInterID = (long)ItemView.HICMOInterID;
                    ReportMain.HICMOBillNo = ItemView.HICMOBillNo;
                    ReportMain.HDeptID = (long)ItemView.HDeptID;
                    ReportMain.HDeptNumber =ItemView.HDeptNumber;
                    ReportMain.HDeptNumber = ItemView.HDeptNumber;
                    ReportMain.HGroupID = (long)ItemView.HGroupID;
                    ReportMain.HGroupNumber = ItemView.HGroupNumber;
                    ReportMain.HMaterID = (long)ItemView.HMaterID;
@@ -1617,7 +1670,7 @@
                    ReportMain.HExplanation = "";
                    ReportMain.HInnerBillNo = "";
                    ReportMain.HSupID = 0;
                    //保存到汇报单主表
@@ -1636,15 +1689,15 @@
                    ReportSub.HQty = (double)ItemView.HQty;
                    ReportSub.HProcID = ItemView.HProcID;
                    ReportSub.HProcNumber = ItemView.HProcNumber;
                    ReportSub.HOutPrice =0;
                    ReportSub.HOutPrice = 0;
                    ReportSub.HOutMoney = 0;
                    ReportSub.HSourceID = (long)ItemView.HSourceID;
                    ReportSub.HEmpNumber = "";
                    ReportSub.HRelBeginDate = DateTime.Now;
                    ReportSub.HRelEndDate = DateTime.Now;
                    ReportSub.HTimes =3;
                    ReportSub.HTimes = 3;
                    ReportSub.HSeOrderInterID = 0;
                    ReportSub.HSeOrderEntryID =0;
                    ReportSub.HSeOrderEntryID = 0;
                    ReportSub.HSeOrderBillNo = "";
                    ReportSub.HProcPlanInterID = 0;
                    ReportSub.HProcPlanBillNo = "";
@@ -1654,44 +1707,44 @@
                    ReportSub.HRelationMoney = 0;
                    ReportSub.HMaterID = (long)ItemView.HMaterID;
                    ReportSub.HMaterNumber = ItemView.HMaterNumber;
                    ReportSub.HCheckQty =0;
                    ReportSub.HBadCount =0;
                    ReportSub.HWasterQty =0;
                    ReportSub.HWasterQty2 =0;
                    ReportSub.HPrice =0;
                    ReportSub.HMoney =0;
                    ReportSub.HProcPlanInterID =0;
                    ReportSub.HProcPlanEntryID =0;
                    ReportSub.HProcPlanBillNo ="";
                    ReportSub.HSourceEntryID =0;
                    ReportSub.HSourceBillType ="";
                    ReportSub.HRelationQty =0;
                    ReportSub.HRelationMoney =0;
                    ReportSub.HBadPrirce =0;
                    ReportSub.HBadMoney =0;
                    ReportSub.HWasterPrice =0;
                    ReportSub.HWasterMoney =0;
                    ReportSub.HQualityRate =0;
                    ReportSub.HSecUnitQty1 =0;
                    ReportSub.HSecUnitRate1=0;
                    ReportSub.HSecUnitQty2=0;
                    ReportSub.HSecUnitRate2=0;
                    ReportSub.HUsingQty=0;
                    ReportSub.HSelfBadCount=0;
                    ReportSub.HPreBadCount=0;
                    ReportSub.HPayMentQty=0;
                    ReportSub.HOtherDeduct=0;
                    ReportSub.HRelPay=0;
                    ReportSub.HOtherItem1="";
                    ReportSub.HOtherItem2="";
                    ReportSub.HOtherItem3="";
                    ReportSub.HOtherItem4="";
                    ReportSub.HOtherItem5="";
                    ReportSub.HPackType="";
                    ReportSub.HCheckEmpID=0;
                    ReportSub.HWeight=0;
                    ReportSub.HBatchNo="";
                    ReportSub.HCheckQty = 0;
                    ReportSub.HBadCount = 0;
                    ReportSub.HWasterQty = 0;
                    ReportSub.HWasterQty2 = 0;
                    ReportSub.HPrice = 0;
                    ReportSub.HMoney = 0;
                    ReportSub.HProcPlanInterID = 0;
                    ReportSub.HProcPlanEntryID = 0;
                    ReportSub.HProcPlanBillNo = "";
                    ReportSub.HSourceEntryID = 0;
                    ReportSub.HSourceBillType = "";
                    ReportSub.HRelationQty = 0;
                    ReportSub.HRelationMoney = 0;
                    ReportSub.HBadPrirce = 0;
                    ReportSub.HBadMoney = 0;
                    ReportSub.HWasterPrice = 0;
                    ReportSub.HWasterMoney = 0;
                    ReportSub.HQualityRate = 0;
                    ReportSub.HSecUnitQty1 = 0;
                    ReportSub.HSecUnitRate1 = 0;
                    ReportSub.HSecUnitQty2 = 0;
                    ReportSub.HSecUnitRate2 = 0;
                    ReportSub.HUsingQty = 0;
                    ReportSub.HSelfBadCount = 0;
                    ReportSub.HPreBadCount = 0;
                    ReportSub.HPayMentQty = 0;
                    ReportSub.HOtherDeduct = 0;
                    ReportSub.HRelPay = 0;
                    ReportSub.HOtherItem1 = "";
                    ReportSub.HOtherItem2 = "";
                    ReportSub.HOtherItem3 = "";
                    ReportSub.HOtherItem4 = "";
                    ReportSub.HOtherItem5 = "";
                    ReportSub.HPackType = "";
                    ReportSub.HCheckEmpID = 0;
                    ReportSub.HWeight = 0;
                    ReportSub.HBatchNo = "";
                    //保存到汇报单子表
                    ReportModel.DetailColl.Add(ReportSub);
                }
@@ -1767,7 +1820,7 @@
        /// <returns></returns>
        [Route("SaveProcessReportList")]
        [HttpPost]
        public object SaveProcessReportList([FromBody] JObject msg)
        public object SaveProcessReportList([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
@@ -1830,7 +1883,7 @@
                List<Model.ClsSc_ProcessReportSub> lsReportSub = new List<Model.ClsSc_ProcessReportSub>();
                foreach (WebAPI.Models.Sc_ProcessSendWorkViewModel ItemView in ls)
                {
                    i++;
                    Model.ClsSc_ProcessReportSub reportSub = new Model.ClsSc_ProcessReportSub();
                    if (ItemView.数量 <= 0)
@@ -1856,8 +1909,8 @@
                    reportSub.HRemark = "";
                    reportSub.HCloseMan = ReportModel.omodel.HCloseMan;
                    reportSub.HCloseType = false;
                    reportSub.HEmpID =0;
                    reportSub.HICMOBillNo ="";
                    reportSub.HEmpID = 0;
                    reportSub.HICMOBillNo = "";
                    reportSub.HICMOInterID = (long)ItemView.HICMOInterID;
                    reportSub.HRemark = "";
                    reportSub.HSourceBillType = "3712";
@@ -1923,7 +1976,7 @@
                    lsReportSub.Add(reportSub);
                }
                if (lsReportSub.Count>0)
                if (lsReportSub.Count > 0)
                {
                    //然后在循环保存到汇报但子表
                    foreach (Model.ClsSc_ProcessReportSub item in lsReportSub)
@@ -1992,7 +2045,7 @@
        /// <returns></returns>
        [Route("SaveBadReasonList")]
        [HttpPost]
        public object SaveBadReasonList([FromBody] JObject msg)
        public object SaveBadReasonList([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
@@ -2002,7 +2055,7 @@
            string user = sArray[2].ToString();
            string UserName="";
            string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
@@ -2024,7 +2077,7 @@
                foreach (Model.ClsQC_NoPassProdCheckBillMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    UserName=oItem.HMaker;
                    UserName = oItem.HMaker;
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
@@ -2032,7 +2085,7 @@
                    oItem.HBillSubType = "7509";
                    oItem.HBillStatus = 1;
                    oItem.HPeriod = 0;
                    oItem.HGroupName ="";
                    oItem.HGroupName = "";
                    oItem.HSourceID = 0;
                    oItem.HICMOInterID = 0;
                    oItem.HICMOBillNo = "";
@@ -2052,7 +2105,7 @@
                    oItem.HMainSourceInterID = oItem.HInterID;
                    oItem.HInterID = 0;
                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate)=="")
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -2061,7 +2114,7 @@
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                }
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
@@ -2079,8 +2132,8 @@
                        break;
                    }
                    //将前台临时存放的值传过来的值赋给对应的不良数量字段
                    oItemSub.HBadQty = Convert.ToDecimal( oItemSub.HMRBChecker);
                    if (oItemSub.HBadQty<=0)
                    oItemSub.HBadQty = Convert.ToDecimal(oItemSub.HMRBChecker);
                    if (oItemSub.HBadQty <= 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -2088,7 +2141,7 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if ((double)oItemSub.HBadQty >oBill.omodel.HPlanQty )
                    if ((double)oItemSub.HBadQty > oBill.omodel.HPlanQty)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -2096,7 +2149,7 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(oItemSub.HWasterReasonName)=="")
                    if (DBUtility.ClsPub.isStrNull(oItemSub.HWasterReasonName) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -2123,7 +2176,7 @@
                    oItemSub.HBadPCSQty = 0;
                    oItemSub.HQCResultID = 0;
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存前判断(单据号重复,笔录项目)
                //保存
@@ -2176,10 +2229,10 @@
        /// <returns></returns>
        [Route("CloseProcessReportList")]
        [HttpGet]
        public object CloseProcessReportList(int HInterID,int IsClose,string CurUserName)
        public object CloseProcessReportList(int HInterID, int IsClose, string CurUserName)
        {
            DataSet ds;
             string ModRightNameCheck = "Sc_ProcessReport_check";
            string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //审核权限
@@ -2212,7 +2265,7 @@
                }
                var HChecker = ds.Tables[0].Rows[0]["HChecker"].ToString();
                var HCloseMan = ds.Tables[0].Rows[0]["HCloseMan"].ToString();
                if (IsClose == 0)
                {
                    if (HCloseMan.Trim() != "" || HChecker.Trim() == "")
@@ -2229,8 +2282,8 @@
                    objJsonResult.Message = "* å•据关闭成功!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                else if(IsClose==1)
                }
                else if (IsClose == 1)
                {
                    if (HCloseMan.Trim() == "" || HChecker.Trim() == "")
                    {
@@ -2257,7 +2310,7 @@
                    return objJsonResult; ;
                }
            }
            catch (Exception e)
            {
@@ -2292,7 +2345,7 @@
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (HInterID <= 0)
@@ -2310,11 +2363,11 @@
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有这个单据,无法审核!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    return objJsonResult;
                }
                var HChecker = ds.Tables[0].Rows[0]["HChecker"].ToString();//取审核人
                var HMaker=ds.Tables[0].Rows[0]["HMaker"].ToString();//取制单人
                var HCloseMan=ds.Tables[0].Rows[0]["HCloseMan"].ToString();//取关闭人
                var HMaker = ds.Tables[0].Rows[0]["HMaker"].ToString();//取制单人
                var HCloseMan = ds.Tables[0].Rows[0]["HCloseMan"].ToString();//取关闭人
                if (IsAudit == 0)
                {
                    if (HChecker.Trim() != "" || HChecker.Trim() == HMaker || HCloseMan != "")
@@ -2331,7 +2384,7 @@
                    objJsonResult.count = 1;
                    objJsonResult.Message = "* å•据审核成功!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    return objJsonResult;
                }
                else if (IsAudit == 1)
                {
@@ -2349,7 +2402,7 @@
                    objJsonResult.count = 1;
                    objJsonResult.Message = "* å•据反审核成功!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    return objJsonResult;
                }
                else
                {
@@ -2357,7 +2410,7 @@
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据无法审核!";
                    objJsonResult.data = null;
                    return objJsonResult;
                    return objJsonResult;
                }
@@ -2379,7 +2432,7 @@
        /// <returns></returns>
        [Route("Sc_ProcessMangement/MES_WW_EntrustProcSendWorkBill_Json")]
        [HttpGet]
        public object MES_WW_EntrustProcSendWorkBill_Json(string sqlWhere,string user)
        public object MES_WW_EntrustProcSendWorkBill_Json(string sqlWhere, string user)
        {
            DataSet ds;
            try
@@ -2402,7 +2455,7 @@
                else
                {
                    string sql1 = "select * from h_v_WW_EntrustProcSendWorkBillList where 1 = 1 ";
                    string sql = sql1 + sqlWhere+ " order by hmainid desc ";
                    string sql = sql1 + sqlWhere + " order by hmainid desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_WW_EntrustProcSendWorkBillList");
                }
            }
@@ -2424,7 +2477,7 @@
        /// <returns></returns>
        [Route("Sc_ProcessMangement/MES_WW_EntrustProcessReportBill_Json")]
        [HttpGet]
        public object MES_WW_EntrustProcessReportBill_Json(string sqlWhere,string user)
        public object MES_WW_EntrustProcessReportBill_Json(string sqlWhere, string user)
        {
            DataSet ds;
            try
@@ -2468,8 +2521,8 @@
        /// <param name="sqlWhere"></param>
        /// <returns></returns>
        [Route("Sc_ProcessMangement/MES_WW_EntrustProcessSendOutBillList_Json")]
        [HttpGet]
        public object MES_WW_EntrustProcessSendOutBillList_Json(string sqlWhere,string user)
        [HttpGet]
        public object MES_WW_EntrustProcessSendOutBillList_Json(string sqlWhere, string user)
        {
            DataSet ds;
            try
@@ -2492,7 +2545,7 @@
                else
                {
                    string sql1 = "select * from h_v_WW_EntrustProcessSendOutBillList where 1 = 1 ";
                    string sql = sql1 + sqlWhere+ " order by hmainid desc ";
                    string sql = sql1 + sqlWhere + " order by hmainid desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_WW_EntrustProcessSendOutBillList");
                }
            }
@@ -2599,7 +2652,7 @@
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    sendworksub.HEntryID = i;
                    sendworksub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
@@ -2726,7 +2779,7 @@
                    ReportMain.HCloseType = false;
                    ReportMain.HPrintQty = 0;
                    ReportMain.HMainSourceBillType = "3740";
                    ReportMain.HMainSourceInterID =0;
                    ReportMain.HMainSourceInterID = 0;
                    ReportMain.HMainSourceBillNo = ItemView.HWW_BillNo;
                    ReportMain.HInterID = 0;
                    ReportMain.HPeriod = 1;
@@ -2737,7 +2790,7 @@
                    ReportMain.HDeptID = Convert.ToInt32(ItemView.HDeptID);
                    ReportMain.HExplanation = "";
                    ReportMain.HInnerBillNo = "";
                    ReportMain.HSupID =Convert.ToInt32( ItemView.HSupID);
                    ReportMain.HSupID = Convert.ToInt32(ItemView.HSupID);
                    //保存到汇报单主表
@@ -2754,7 +2807,7 @@
                    ReportSub.HCloseType = false;
                    ReportSub.HSourceBillType = "3740";
                    ReportSub.HQty = Convert.ToDecimal(ItemView.HQty);
                    ReportSub.HProcID =Convert.ToInt32( ItemView.HProcID);
                    ReportSub.HProcID = Convert.ToInt32(ItemView.HProcID);
                    ReportSub.HTimes = 0;
                    ReportSub.HSeOrderInterID = 0;
                    ReportSub.HSeOrderEntryID = 0;
@@ -3166,7 +3219,7 @@
                    WorkOrdersub.HSourceInterID = oItemSub.hmainid.Value; //--源单id
                    WorkOrdersub.HSourceEntryID = oItemSub.hsubid.Value; //--源单子ID
                    WorkOrdersub.HSourceBillNo = oItemSub.单据号; //--源单单号
                    WorkOrdersub.HSourceBillType= oItemSub.HBillType; //--源单类型
                    WorkOrdersub.HSourceBillType = oItemSub.HBillType; //--源单类型
                    WorkOrdersub.HRelationQty = 0;  //--关联数量
                    WorkOrdersub.HRelationMoney = 0; //--关联金额
                    WorkOrdersub.HOrderBillNo = ""; //--销售订单号
@@ -3176,9 +3229,9 @@
                    WorkOrdersub.HQty = (double)oItemSub.计划数量; //--订单数量
                    WorkOrdersub.HEntrustType = "3739"; //--委外类型
                    WorkOrdersub.HNextProcName = ""; //--下道工序
                    WorkOrdersub.HPrice =0; //加工费
                    WorkOrdersub.HPrice = 0; //加工费
                    WorkOrdersub.HOutQty = 0;  //--关联发出数量
                    WorkOrdersub.HInQty =0; //--关联接收数量
                    WorkOrdersub.HInQty = 0; //--关联接收数量
                    WorkOrdersub.HBackSupDate = DateTime.Now; //--实际交货日期
                    WorkOrdersub.HInDate = DateTime.Now; //--交货日期 
                    WorkOrdersub.HWorkProcFlow = ""; //--工艺流
WebAPI/Controllers/WebAPIController.cs
@@ -1023,7 +1023,8 @@
            }
            try
            {
                ds = webserver.GetEmployeeList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                string sql = $"Select * from h_v_IF_Emp {sWhere} Order by HNumber";
                ds = oCN.RunProcReturn(sql, "h_v_IF_Emp");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_StockCheckItemBillController.cs
@@ -211,7 +211,7 @@
                    ")", ref DBUtility.ClsPub.sExeReturnInfo);
                    //修改上级为非末级代码
                    oCn.RunProc("Update Gy_StockCheckItem set HEndflag=0 where HItemID=" + oBill.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -252,6 +252,46 @@
        }
        #endregion
        #region ç›˜ç‚¹åˆ†æžåˆ—表判断当前选择的盘点方案是否生成过单据
        [Route("Gy_StockCheckItemBill/StockItemSubIsExistence")]
        [HttpGet]
        public object StockItemSubIsExistence(string sID)
        {
            try
            {
                DataSet ds;
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql;
                sql = string.Format(@"select * from Gy_StockCheckItemSub where HInterID=" + sID);
                ds = oCN.RunProcReturn(sql, "Gy_StockCheckItemSub");
                if (ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "暂未生成";
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "已生成";
                    return objJsonResult;
                }
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç›˜ç‚¹åˆ†æžåˆ—表
        [Route("Gy_StockCheckItemBill/Get_InventoryAnalysisList")]
        [HttpGet]
@@ -263,15 +303,30 @@
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sID == null || sID == "")
                //判断是否选择盘点方案,是=>(用盘点方案子表做对比),否=>(用器具档案做对比)
                if (sID==null|| sID == "")
                {
                    sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisList where " + sWhere + " order by HItemID desc ");
                    if (sWhere=="pk")
                    {
                        sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisPK");
                    }
                    else
                    {
                        sql = string.Format($"exec h_p_Sc_MouldInventoryAnalysisList2  '{sWhere}'");
                    }
                }
                else
                {
                    sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisList where " + sWhere + " and HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID=" + sID + ") and HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID=" + sID + ") order by HItemID desc ");
                    if (sWhere == "pk")
                    {
                        sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisPK2 WHERE HInterID="+ sID);
                    }
                    else
                    {
                        sql = string.Format($"exec h_p_Sc_MouldInventoryAnalysisList  '{sID}','{sWhere}'");
                    }
                }
                ds = oCN.RunProcReturn(sql, "Sc_MouldStockBillMain_Temp");
                ds = oCN.RunProcReturn(sql, "h_p_Sc_MouldInventoryAnalysisList");
                list.Add(ds.Tables[0]);
                objJsonResult.code = "1";
WebAPI/Controllers/¹¤×ʹÜÀí/Pay_WorkTimesBillController.cs
@@ -328,8 +328,6 @@
                return objJsonResult;
            }
        }
        //
        /// <summary>
        /// é€šè¿‡ç­ç»„查询职员信息
        ///参数:string sql。
@@ -343,7 +341,7 @@
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "产品器具未选择";
                objJsonResult.Message = "班组未选择";
                objJsonResult.data = null;
                return objJsonResult;
            }
@@ -372,6 +370,31 @@
                return objJsonResult;
            }
        }
        [Route("Pay_WorkTimesBill/calcAvgMoney")]
        [HttpPost]
        public object GetEmployeeByHGroup([FromBody] JObject msg) {
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                List<object> list = new List<object>();
                DataSet ds;
                string sql = string.Format($"exec h_p_CalcAvgMoney '{msg["msg"]}'");
                ds = oCN.RunProcReturn(sql, "h_p_CalcAvgMoney");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取信息成功!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
    }
}
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESBeginStepWorkBillController.cs
@@ -1622,7 +1622,7 @@
                        Ids = Ds.Tables[0].Rows[0][0].ToString(),
                        //PkEntryIds = (EntyID).Split('-')[1]
                    };
                    LogService.Write("json=" + json);
                    //LogService.Write("json=" + json);
                    string result1 = string.Empty;
                    string result2 = string.Empty;
WebAPI/InvokeHelper.cs
@@ -37,9 +37,9 @@
            HttpClient httpClient = new HttpClient();
            httpClient.Url = string.Concat(CloudUrl, "Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc");
            List<object> Parameters = new List<object>();
            Parameters.Add("5f9258a311401c");//账套标示
            Parameters.Add("622703e117d642");//账套标示
            Parameters.Add("Administrator");//用户名
            Parameters.Add("qaz!@#123");//密码
            Parameters.Add("sa@123456");//密码
            Parameters.Add(2052);//2052代表中文
            httpClient.Content = JsonConvert.SerializeObject(Parameters);
WebAPI/WebAPI.csproj
@@ -378,6 +378,7 @@
    <Compile Include="Controllers\CJGL\Cj_StationInBillController.cs" />
    <Compile Include="Controllers\CJGL\Cj_StationEntrustOutBillController.cs" />
    <Compile Include="Controllers\CJGL\Sc_WorkBillAutoSortBillMainController.cs" />
    <Compile Include="Controllers\SCGL\日计划管理\DataHelper.cs" />
    <Compile Include="Controllers\SCGL\日计划管理\JIT_Cg_PODemandPlanBillController.cs" />
    <Compile Include="Controllers\SCGL\Sc_CallGoodsBackRequestBillController.cs" />
    <Compile Include="Controllers\SCGL\Sc_ComplementGoodBillController.cs" />
WorkM/±¨±í·ÖÎö/Mes_OrderProcFlowAllReport.cs
@@ -255,24 +255,24 @@
                }
            }
            for (int j = HRecProc1Col; j < grdMain.Columns.Count-2; j++)
            {
                if (checkBox1.Checked == false)
                {
                    if (ClsPub.isStrNull(grdMain.Columns[j].HeaderText).ToUpper().Trim().Contains("不合格") == true)
                    {
                        grdMain.Columns[j].Visible = false;
                    }
                    else
                    {
                        grdMain.Columns[j].Visible = true;
                    }
                }
                else
                {
                    grdMain.Columns[j].Visible = true;
                }
            }
            //for (int j = HRecProc1Col; j < grdMain.Columns.Count-2; j++)
            //{
            //    if (checkBox1.Checked == false)
            //    {
            //        if (ClsPub.isStrNull(grdMain.Columns[j].HeaderText).ToUpper().Trim().Contains("不合格") == true)
            //        {
            //            grdMain.Columns[j].Visible = false;
            //        }
            //        else
            //        {
            //            grdMain.Columns[j].Visible = true;
            //        }
            //    }
            //    else
            //    {
            //        grdMain.Columns[j].Visible = true;
            //    }
            //}
            //
        }
WorkM/±¨±í·ÖÎö/Mes_OrderProcFlowAllReport.designer.cs
@@ -132,14 +132,14 @@
            // eXCELToolStripMenuItem
            // 
            this.eXCELToolStripMenuItem.Name = "eXCELToolStripMenuItem";
            this.eXCELToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
            this.eXCELToolStripMenuItem.Size = new System.Drawing.Size(136, 26);
            this.eXCELToolStripMenuItem.Text = "EXCEL";
            this.eXCELToolStripMenuItem.Click += new System.EventHandler(this.eXCELToolStripMenuItem_Click);
            // 
            // cSVToolStripMenuItem
            // 
            this.cSVToolStripMenuItem.Name = "cSVToolStripMenuItem";
            this.cSVToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
            this.cSVToolStripMenuItem.Size = new System.Drawing.Size(136, 26);
            this.cSVToolStripMenuItem.Text = "CSV";
            this.cSVToolStripMenuItem.Click += new System.EventHandler(this.cSVToolStripMenuItem_Click);
            // 
@@ -398,6 +398,7 @@
            this.chkHShowUnFinish.TabIndex = 86;
            this.chkHShowUnFinish.Text = "只显示未完工";
            this.chkHShowUnFinish.UseVisualStyleBackColor = true;
            this.chkHShowUnFinish.Visible = false;
            // 
            // checkBox1
            // 
@@ -408,6 +409,7 @@
            this.checkBox1.TabIndex = 85;
            this.checkBox1.Text = "显示不合格";
            this.checkBox1.UseVisualStyleBackColor = true;
            this.checkBox1.Visible = false;
            // 
            // txtHOrderProcNo
            // 
@@ -501,6 +503,7 @@
            this.grdSum.Margin = new System.Windows.Forms.Padding(4);
            this.grdSum.Name = "grdSum";
            this.grdSum.ReadOnly = true;
            this.grdSum.RowHeadersWidth = 51;
            this.grdSum.RowTemplate.Height = 23;
            this.grdSum.ScrollBars = System.Windows.Forms.ScrollBars.None;
            this.grdSum.Size = new System.Drawing.Size(1432, 24);
@@ -517,6 +520,7 @@
            this.grdMain.Margin = new System.Windows.Forms.Padding(4);
            this.grdMain.Name = "grdMain";
            this.grdMain.ReadOnly = true;
            this.grdMain.RowHeadersWidth = 51;
            this.grdMain.RowTemplate.Height = 23;
            this.grdMain.Size = new System.Drawing.Size(1432, 414);
            this.grdMain.TabIndex = 54;