Procházet zdrojové kódy

窑车烧成批次

chenxy před 6 roky
rodič
revize
cf497d073c

+ 6 - 3
DK.Client/PMModule/F_PM_0504.Designer.cs

@@ -218,6 +218,7 @@
             this.txtKilnCarCode.Name = "txtKilnCarCode";
             this.txtKilnCarCode.Size = new System.Drawing.Size(100, 21);
             this.txtKilnCarCode.TabIndex = 3;
+            this.txtKilnCarCode.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtKilnCarCode_KeyPress);
             this.txtKilnCarCode.Validating += new System.ComponentModel.CancelEventHandler(this.txtKilnCarCode_Validating);
             // 
             // txtUserCode
@@ -313,7 +314,7 @@
             this.dgvProduction.IsOpenMergeCellFlag = false;
             this.dgvProduction.IsSubTotalFlag = false;
             this.dgvProduction.IsTopDeep = false;
-            this.dgvProduction.Location = new System.Drawing.Point(12, 131);
+            this.dgvProduction.Location = new System.Drawing.Point(12, 118);
             this.dgvProduction.MergeColumnNames = null;
             this.dgvProduction.MergeDetailColumnNames = null;
             this.dgvProduction.MergeDetailOnlyColumn = null;
@@ -326,7 +327,7 @@
             dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(159)))), ((int)(((byte)(39)))), ((int)(((byte)(39)))));
             this.dgvProduction.RowsDefaultCellStyle = dataGridViewCellStyle6;
             this.dgvProduction.RowTemplate.Height = 21;
-            this.dgvProduction.Size = new System.Drawing.Size(903, 286);
+            this.dgvProduction.Size = new System.Drawing.Size(903, 299);
             this.dgvProduction.SortOrderColumnName = null;
             this.dgvProduction.TabIndex = 2;
             this.dgvProduction.Tag = true;
@@ -373,7 +374,7 @@
             // Status
             // 
             this.Status.DataPropertyName = "Status";
-            dataGridViewCellStyle3.NullValue = "本次登车";
+            dataGridViewCellStyle3.NullValue = "漏扫补件";
             this.Status.DefaultCellStyle = dataGridViewCellStyle3;
             this.Status.HeaderText = "产品状态";
             this.Status.Name = "Status";
@@ -591,6 +592,7 @@
             this.txtFiredBatchNo.Number = new System.Drawing.Point(3, 0);
             this.txtFiredBatchNo.Size = new System.Drawing.Size(60, 21);
             this.txtFiredBatchNo.TabIndex = 7;
+            this.txtFiredBatchNo.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtFiredBatchNo_KeyPress);
             this.txtFiredBatchNo.Validating += new System.ComponentModel.CancelEventHandler(this.txtFiredBatchNo_Validating);
             // 
             // dtpFiredDate
@@ -601,6 +603,7 @@
             this.dtpFiredDate.Size = new System.Drawing.Size(100, 21);
             this.dtpFiredDate.TabIndex = 5;
             this.dtpFiredDate.Value = new System.DateTime(2019, 12, 10, 0, 0, 0, 0);
+            this.dtpFiredDate.Validating += new System.ComponentModel.CancelEventHandler(this.dtpFiredDate_Validating);
             // 
             // txtKiln
             // 

+ 383 - 279
DK.Client/PMModule/F_PM_0504.cs

@@ -57,6 +57,7 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
         // 是否有商标名称
         private string _isLogoName = "";
 
+        private DataSet _KilntInfo = null;
         #endregion
 
         #region 构造函数
@@ -182,20 +183,24 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
         {
             try
 			{
-				//string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
-				//		  Constant.INI_KEY_KILN_CODE, this._iniFilePath);
-				string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
+                dtpFiredDate.Value = DateTime.Now.Date;
+                //string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
+                //		  Constant.INI_KEY_KILN_CODE, this._iniFilePath);
+                string getKiln = Utility.ReadIniFile(Constant.INI_SECTION_SETTINGS,
 						  Constant.INI_KEY_KILN_CODE, LocalPath.LocalINIFilePath);
 
+                _KilntInfo = SystemModuleProxy.Service.GetAllKilntInfo();
+
                 if (getKiln != string.Empty)
                 {
                     this.txtKiln.Text = getKiln;
                     if (this.txtKiln.Text.Trim() != "")
                     {
-                        DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
-                        {
-                            return SystemModuleProxy.Service.GetAllKilntInfo();
-                        }));
+                        //DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
+                        //{
+                        //    return SystemModuleProxy.Service.GetAllKilntInfo();
+                        //}));
+                        DataSet dsResultAccount = _KilntInfo;
                         if (dsResultAccount != null && dsResultAccount.Tables[0].Rows.Count > 0)
                         {
                             DataView dv = dsResultAccount.Tables[0].DefaultView;
@@ -243,10 +248,11 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                 this.KilnCarPosition.DataSource = tKilnCarInfo.Copy();
                 this.dgvProduction.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
                 // 获取工序明细数据
-                ProcedureEntity procedureDataEntity = (ProcedureEntity)DoAsync(new BaseAsyncMethod(() =>
-                {
-                    return PMModuleProxy.Service.GetProcedureDataEntityByID(this._procedureID);
-                }));
+                //ProcedureEntity procedureDataEntity = (ProcedureEntity)DoAsync(new BaseAsyncMethod(() =>
+                //{
+                //    return PMModuleProxy.Service.GetProcedureDataEntityByID(this._procedureID);
+                //}));
+                ProcedureEntity procedureDataEntity = PMModuleProxy.Service.GetProcedureDataEntityByID(this._procedureID);
                 this._procedureDataEntity = procedureDataEntity;
                 // 设置控件禁用或启用
                 SetControlEnable();
@@ -291,123 +297,6 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
         }
 
         /// <summary>
-        /// 控件数据校验时发生
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void txtUserCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
-        {
-            try
-            {
-                if (txtUserCode.Text.Trim() == string.Empty) // 如果未添加数据,则此项获取焦点
-                {
-                    this.txtUserCode.IsMustInput = true;
-                    this.txtUserCode.SelectAll();
-                    e.Cancel = true;
-                    return;
-                }
-                else if (!this.txtUserCode.ReadOnly)
-                {
-                    SUserEntity userEntity = new SUserEntity();
-                    userEntity.UserCode = this.txtUserCode.Text.Trim();
-                    // 是否存在此用户编码的生产工号
-                    CheckProcedureUserResult MsgCheckProcedureUser = (CheckProcedureUserResult)DoAsync(new BaseAsyncMethod(() =>
-                    {
-                        return PMModuleProxy.Service.CheckProcedureUser(this._procedureID, this.txtUserCode.Text.Trim());
-                    }));
-                    if (MsgCheckProcedureUser != null)
-                    {
-                        if (!string.IsNullOrEmpty(MsgCheckProcedureUser.ErrMsg))
-                        {
-                            MessageBox.Show(MsgCheckProcedureUser.ErrMsg,
-                                this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                            this.txtUserCode.SelectAll();
-                            e.Cancel = true;
-                            return;
-                        }
-                        // 有此生产工号
-                        if (this._productionEntity.UserID != -Constant.INT_IS_ONE)
-                        {
-                            if (MsgCheckProcedureUser.UserID != this._productionEntity.UserID)
-                            {
-                                this.SaveDataInfo();
-                            }
-                        }
-                        this._productionEntity.UserID = MsgCheckProcedureUser.UserID;
-                        this._productionEntity.UserCode = MsgCheckProcedureUser.UserCode;
-                        this._productionEntity.UserName = MsgCheckProcedureUser.UserName;
-                        this.txtUserCode.ReadOnly = true;
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                // 对异常进行共通处理
-                ExceptionManager.HandleEventException(this.ToString(),
-                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
-            }
-        }
-
-        /// <summary>
-        /// 控件数据校验时发生
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void txtKilnCarCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
-        {
-            try
-            {
-                if (this.txtKilnCarCode.Text.Trim() == string.Empty) // 如果未添加数据,则此项获取焦点
-                {
-                    //this.txtKilnCarCode.IsMustInput = true;
-                    //this.txtKilnCarCode.SelectAll();
-                    //e.Cancel = true;
-                    //return;
-                }
-                else if (!this.txtKilnCarCode.ReadOnly)
-                {
-                    ClientRequestEntity cre = new ClientRequestEntity();
-                    cre.NameSpace = "F_PM_0504";
-                    cre.Name = "CheckKilnCar";
-                    cre.Properties["kilncarcode"]= this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
-                    cre.Properties["procedureID"] = this._procedureID;
-                    ServiceResultEntity sre = PMModuleProxyNew.Service.HandleRequest(cre);
-
-                    this._productionEntity.KilnCarID = null;
-                    this._productionEntity.KilnCarCode = null;
-                    if (sre == null)
-                    {
-                        MessageBox.Show("此窑车不存在",
-                                  this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                        this.txtKilnCarCode.SelectAll();
-                        e.Cancel = true;
-                        return;
-                    }
-                    if (sre.Status == Constant.ServiceResultStatus.Other)
-                    {
-                        MessageBox.Show(sre.Message,
-                                  this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                        this.txtKilnCarCode.SelectAll();
-                        e.Cancel = true;
-                        return;
-                    }
-
-                    this._productionEntity.KilnCarID = Convert.ToInt32(sre.Result);
-                    this._productionEntity.KilnCarCode = this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
-
-                    //this.txtKilnCarCode.ReadOnly = true;
-                    //this.txtKiln.ReadOnly = true;
-                }
-            }
-            catch (Exception ex)
-            {
-                // 对异常进行共通处理
-                ExceptionManager.HandleEventException(this.ToString(),
-                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
-            }
-        }
-
-        /// <summary>
         /// 条形码按键事件
         /// </summary>
         /// <param name="sender"></param>
@@ -433,24 +322,24 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
 
                 if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
                 {
-                    if (this.txtUserCode.Text.Trim() == string.Empty)
-                    {
-                        this.txtUserCode.Focus();
-                        this.txtBarcode.Text = string.Empty;
-                        return;
-                    }
-                    if (this.txtKilnCarCode.Text.Trim() == string.Empty)
-                    {
-                        this.txtKilnCarCode.Focus();
-                        this.txtBarcode.Text = string.Empty;
-                        return;
-                    }
-                    if (this.txtBarcode.Text.Trim() == string.Empty)
-                    {
-                        this.txtBarcode.SelectAll();
-                        this.txtBarcode.Focus();
-                        return;
-                    }
+                    //if (this.txtUserCode.Text.Trim() == string.Empty)
+                    //{
+                    //    this.txtUserCode.Focus();
+                    //    this.txtBarcode.Text = string.Empty;
+                    //    return;
+                    //}
+                    //if (this.txtKilnCarCode.Text.Trim() == string.Empty)
+                    //{
+                    //    this.txtKilnCarCode.Focus();
+                    //    this.txtBarcode.Text = string.Empty;
+                    //    return;
+                    //}
+                    //if (this.txtBarcode.Text.Trim() == string.Empty)
+                    //{
+                    //    this.txtBarcode.SelectAll();
+                    //    this.txtBarcode.Focus();
+                    //    return;
+                    //}
                     DataRow[] drRows = this.DataSourceTable.Select("BarCode='" + this.txtBarcode.Text.Trim() + "'");
                     if (drRows.Length == Constant.INT_IS_ZERO)
                     {
@@ -539,7 +428,7 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                                 //}
                                 //else
                                 //{
-                                this.CollectTypeOne(procedureDataEntity,dsCheckBarcode); // 集中采集
+                                this.CollectTypeOne(procedureDataEntity, dsCheckBarcode); // 集中采集
                                 //}
                                 this.txtBarcode.Text = string.Empty;
                                 this.txtBarcode.Focus();
@@ -561,6 +450,263 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
         }
 
         /// <summary>
+        /// 控件数据校验时发生
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void txtUserCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            try
+            {
+                if (txtUserCode.Text.Trim() == string.Empty) // 如果未添加数据,则此项获取焦点
+                {
+                    this.txtUserCode.IsMustInput = true;
+                    this.txtUserCode.SelectAll();
+                    e.Cancel = true;
+                    return;
+                }
+                else if (!this.txtUserCode.ReadOnly)
+                {
+                    SUserEntity userEntity = new SUserEntity();
+                    userEntity.UserCode = this.txtUserCode.Text.Trim();
+                    // 是否存在此用户编码的生产工号
+                    CheckProcedureUserResult MsgCheckProcedureUser = (CheckProcedureUserResult)DoAsync(new BaseAsyncMethod(() =>
+                    {
+                        return PMModuleProxy.Service.CheckProcedureUser(this._procedureID, this.txtUserCode.Text.Trim());
+                    }));
+                    if (MsgCheckProcedureUser != null)
+                    {
+                        if (!string.IsNullOrEmpty(MsgCheckProcedureUser.ErrMsg))
+                        {
+                            MessageBox.Show(MsgCheckProcedureUser.ErrMsg,
+                                this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                            this.txtUserCode.SelectAll();
+                            e.Cancel = true;
+                            return;
+                        }
+                        // 有此生产工号
+                        if (this._productionEntity.UserID != -Constant.INT_IS_ONE)
+                        {
+                            if (MsgCheckProcedureUser.UserID != this._productionEntity.UserID)
+                            {
+                                this.SaveDataInfo();
+                            }
+                        }
+                        this._productionEntity.UserID = MsgCheckProcedureUser.UserID;
+                        this._productionEntity.UserCode = MsgCheckProcedureUser.UserCode;
+                        this._productionEntity.UserName = MsgCheckProcedureUser.UserName;
+                        this.txtUserCode.ReadOnly = true;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                // 对异常进行共通处理
+                ExceptionManager.HandleEventException(this.ToString(),
+                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
+            }
+        }
+
+        private void txtKiln_Validating(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            try
+            {
+                if (string.IsNullOrWhiteSpace(this.txtKiln.Text) ||
+                    this.txtKiln.ReadOnly)
+                {
+                    return;
+                }
+
+                //DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
+                //{
+                //    return SystemModuleProxy.Service.GetAllKilntInfo();
+                //}));
+                //DataSet dsResultAccount = SystemModuleProxy.Service.GetAllKilntInfo();
+                DataSet dsResultAccount = _KilntInfo;
+                if (dsResultAccount != null && dsResultAccount.Tables[0].Rows.Count > 0)
+                {
+                    DataView dv = dsResultAccount.Tables[0].DefaultView;
+                    dv.RowFilter = "ValueFlag=1 and KilnCode='" + this.txtKiln.Text.Trim() + "'";
+                    DataTable dt = dv.ToTable();
+                    if (dt.Rows.Count == 0)
+                    {
+                        _productionEntity.KilnID = null;
+                        _productionEntity.KilnCode = null;
+                        e.Cancel = true;
+                        this.txtKiln.SelectAll();
+                        // 提示信息
+                        MessageBox.Show("不存在此窑炉编号",
+                              this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                        return;
+                    }
+                    else
+                    {
+                        _productionEntity.KilnID = Convert.ToInt32(dt.Rows[0]["KilnID"]);
+                        _productionEntity.KilnCode = this.txtKiln.Text.Trim();
+                    }
+                    // 保存业务系统配置
+                    Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
+                        this.txtKiln.Text.Trim(), this._iniFilePath);
+
+                    // 验证烧成批次
+                    if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
+                        this._productionEntity.KilnID == null ||
+                        this._productionEntity.KilnID == -1)
+                    {
+                        return;
+                    }
+                    if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
+                        this._productionEntity.KilnCarID == null ||
+                        this._productionEntity.KilnCarID == -1)
+                    {
+                        return;
+                    }
+                    if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
+                    {
+                        return;
+                    }
+                    this.CheckFiredBatchNo();
+                }
+            }
+            catch (Exception ex)
+            {
+                // 对异常进行共通处理
+                ExceptionManager.HandleEventException(this.ToString(),
+                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
+            }
+        }
+
+        private void txtKiln_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            try
+            {
+                if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
+                {
+                    this.txtKilnCarCode.Focus();
+                }
+            }
+            catch (Exception ex)
+            {
+                // 对异常进行共通处理
+                ExceptionManager.HandleEventException(this.ToString(),
+                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
+            }
+        }
+
+        private void txtKilnCarCode_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            try
+            {
+                if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
+                {
+                    this.dtpFiredDate.Focus();
+                }
+            }
+            catch (Exception ex)
+            {
+                // 对异常进行共通处理
+                ExceptionManager.HandleEventException(this.ToString(),
+                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
+            }
+        }
+
+        /// <summary>
+        /// 控件数据校验时发生
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void txtKilnCarCode_Validating(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            try
+            {
+                if (string.IsNullOrWhiteSpace(this.txtKilnCarCode.Text) ||
+                    this.txtKilnCarCode.ReadOnly)
+                {
+                    return;
+                }
+
+                ClientRequestEntity cre = new ClientRequestEntity();
+                cre.NameSpace = "F_PM_0504";
+                cre.Name = "CheckKilnCar";
+                cre.Properties["kilncarcode"] = this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
+                cre.Properties["procedureID"] = this._procedureID;
+                ServiceResultEntity sre = PMModuleProxyNew.Service.HandleRequest(cre);
+
+                this._productionEntity.KilnCarID = null;
+                this._productionEntity.KilnCarCode = null;
+                if (sre == null)
+                {
+                    this.txtKilnCarCode.SelectAll();
+                    e.Cancel = true;
+                    MessageBox.Show("此窑车不存在",
+                              this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    return;
+                }
+                if (sre.Status == Constant.ServiceResultStatus.Other)
+                {
+                    this.txtKilnCarCode.SelectAll();
+                    e.Cancel = true;
+                    MessageBox.Show(sre.Message,
+                              this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    return;
+                }
+
+                this._productionEntity.KilnCarID = Convert.ToInt32(sre.Result);
+                this._productionEntity.KilnCarCode = this.txtKiln.Text.Trim() + this.txtKilnCarCode.Text.Trim();
+
+                //this.txtKilnCarCode.ReadOnly = true;
+                //this.txtKiln.ReadOnly = true;
+
+                // 验证烧成批次
+                if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
+                    this._productionEntity.KilnID == null ||
+                    this._productionEntity.KilnID == -1)
+                {
+                    return;
+                }
+                if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
+                    this._productionEntity.KilnCarID == null ||
+                    this._productionEntity.KilnCarID == -1)
+                {
+                    return;
+                }
+                if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
+                {
+                    return;
+                }
+                this.CheckFiredBatchNo();
+            }
+            catch (Exception ex)
+            {
+                // 对异常进行共通处理
+                ExceptionManager.HandleEventException(this.ToString(),
+                    System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
+            }
+        }
+
+        private void dtpFiredDate_Validating(object sender, System.ComponentModel.CancelEventArgs e)
+        {
+            // 验证烧成批次
+            if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
+                this._productionEntity.KilnID == null ||
+                this._productionEntity.KilnID == -1)
+            {
+                return;
+            }
+            if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
+                this._productionEntity.KilnCarID == null ||
+                this._productionEntity.KilnCarID == -1)
+            {
+                return;
+            }
+            if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
+            {
+                return;
+            }
+            this.CheckFiredBatchNo();
+        }
+
+        /// <summary>
         ///  删除按钮事件
         /// </summary>
         /// <param name="sender"></param>
@@ -656,10 +802,10 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
         /// <param name="e"></param>
         private void txtUserCode_KeyPress(object sender, KeyPressEventArgs e)
         {
-            if ((int)e.KeyChar == 13) // 按了回车键
-            {
-                this.txtKilnCarCode.Focus();
-            }
+            //if ((int)e.KeyChar == 13) // 按了回车键
+            //{
+            //    this.txtKilnCarCode.Focus();
+            //}
         }
 
         #endregion
@@ -961,50 +1107,39 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
 
         #endregion
 
-        private void txtKiln_Validating(object sender, System.ComponentModel.CancelEventArgs e)
+        private void btnOk_Click(object sender, EventArgs e)
         {
+            this.btnOk.Focus();
+            if (this.txtFiredBatchNo.ReadOnly)
+            {
+                return;
+            }
             try
             {
-                if (this.txtKiln.Text.Trim() == string.Empty)
+                btnOk.Tag = 1;
+                if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
+                    this._productionEntity.KilnID == null ||
+                    this._productionEntity.KilnID == -1)
                 {
+                    MessageBox.Show("没有输入窑炉", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    this.txtKiln.Focus();
                     return;
                 }
-                if (this.txtKiln.Text.Trim() != "")
+                if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
+                    this._productionEntity.KilnCarID == null ||
+                    this._productionEntity.KilnCarID == -1)
                 {
-                    if (!this.txtKiln.ReadOnly)
-                    {
-                        DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
-                        {
-                            return SystemModuleProxy.Service.GetAllKilntInfo();
-                        }));
-                        if (dsResultAccount != null && dsResultAccount.Tables[0].Rows.Count > 0)
-                        {
-                            DataView dv = dsResultAccount.Tables[0].DefaultView;
-                            dv.RowFilter = "ValueFlag=1 and KilnCode='" + this.txtKiln.Text.Trim() + "'";
-                            DataTable dt = dv.ToTable();
-                            if (dt.Rows.Count == 0)
-                            {
-                                _productionEntity.KilnID = null;
-                                _productionEntity.KilnCode = null;
-                                // 提示信息
-                                MessageBox.Show("不存在此窑炉编号",
-                                      this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                                this.txtKiln.SelectAll();
-                                this.txtKiln.Focus();
-                                return;
-                            }
-                            else
-                            {
-                                _productionEntity.KilnID = Convert.ToInt32(dt.Rows[0]["KilnID"]);
-                                _productionEntity.KilnCode = this.txtKiln.Text.Trim();
-                            }
-                            // 保存业务系统配置
-                            Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
-                                this.txtKiln.Text.Trim(), this._iniFilePath);
-                        }
-                    }
+                    MessageBox.Show("没有输入窑车", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    this.txtKilnCarCode.Focus();
+                    return;
                 }
-
+                if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
+                {
+                    MessageBox.Show("没有输入烧成批次", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    this.txtFiredBatchNo.Focus();
+                    return;
+                }
+                this.CheckFiredBatchNo();
             }
             catch (Exception ex)
             {
@@ -1012,48 +1147,63 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                 ExceptionManager.HandleEventException(this.ToString(),
                     System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
             }
+            finally
+            {
+                btnOk.Tag = null;
+                btnOk.Enabled = true;
+            }
         }
 
-        private void txtKiln_KeyPress(object sender, KeyPressEventArgs e)
+        private void CheckFiredBatchNo()
+        {
+            string KilnCarBatchNo = string.Format("{0}#{1}#{2}#{3}",
+                this._productionEntity.KilnCode,
+                this._productionEntity.KilnCarCode,
+                this.dtpFiredDate.Value.Value.ToString("yyyyMMdd"),
+                this.txtFiredBatchNo.DataValue.Value.ToString("000"));
+
+            ClientRequestEntity cre = new ClientRequestEntity();
+            cre.NameSpace = "F_PM_0504";
+            cre.Name = "CheckKilnCarBatchNo";
+            cre.Properties["KilnID"] = this._productionEntity.KilnID.Value;
+            cre.Properties["KilnCarID"] = this._productionEntity.KilnCarID.Value;
+            cre.Properties["FiredDate"] = this.dtpFiredDate.Value.Value;
+            cre.Properties["KilnCarBatchNo"] = KilnCarBatchNo;
+            cre.Properties["ProcedureID"] = this._procedureID;
+            cre.Properties["ModelType"] = this._procedureDataEntity.ModelType;
+
+            //ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
+            //{
+            //    return PMModuleProxyNew.Service.HandleRequest(cre);
+            //}));
+            ServiceResultEntity sre = PMModuleProxyNew.Service.HandleRequest(cre);
+
+            if (sre == null)
+            {
+                MessageBox.Show("此窑车烧成批次不存在",
+                          this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+            if (sre.Status == Constant.ServiceResultStatus.Other)
+            {
+                MessageBox.Show(sre.Message,
+                          this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                return;
+            }
+
+            this.txtKilnCarCode.ReadOnly = true;
+            this.txtKiln.ReadOnly = true;
+            this.txtFiredBatchNo.ReadOnly = true;
+            this.dtpFiredDate.Enabled = false;
+        }
+
+        private void txtFiredBatchNo_KeyPress(object sender, KeyPressEventArgs e)
         {
             try
             {
                 if ((int)e.KeyChar == Constant.SYSTEM_KEYBOARD_ENTER_VALUE) // 按了回车键
                 {
-                    if (this.txtKiln.Text.Trim() == string.Empty)
-                    {
-                        return;
-                    }
-                    if (this.txtKiln.Text.Trim() != "")
-                    {
-                        DataSet dsResultAccount = (DataSet)DoAsync(new BaseAsyncMethod(() =>
-                        {
-                            return SystemModuleProxy.Service.GetAllKilntInfo();
-                        }));
-                        if (dsResultAccount != null && dsResultAccount.Tables[0].Rows.Count > 0)
-                        {
-                            DataView dv = dsResultAccount.Tables[0].DefaultView;
-                            dv.RowFilter = "ValueFlag=1 and KilnCode='" + this.txtKiln.Text.Trim() + "'";
-                            DataTable dt = dv.ToTable();
-                            if (dt.Rows.Count == 0)
-                            {
-                                // 提示信息
-                                MessageBox.Show("不存在此窑炉编号",
-                                      this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                                this.txtKiln.SelectAll();
-                                this.txtKiln.Focus();
-                                return;
-                            }
-                            else
-                            {
-                                // 保存业务系统配置
-                                Utility.WriteIniFile(Constant.INI_SECTION_SETTINGS, Constant.INI_KEY_KILN_CODE,
-                                    this.txtKiln.Text.Trim(), this._iniFilePath);
-                                this.txtKilnCarCode.Focus();
-                            }
-                        }
-
-                    }
+                    this.btnOk.Focus();
                 }
             }
             catch (Exception ex)
@@ -1064,69 +1214,32 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
             }
         }
 
-        private void btnOk_Click(object sender, EventArgs e)
+        private void txtFiredBatchNo_Validating(object sender, System.ComponentModel.CancelEventArgs e)
         {
             try
             {
-                if (string.IsNullOrWhiteSpace(this.txtKiln.Text) || this._productionEntity.KilnID == null)
+                if (this.txtFiredBatchNo.ReadOnly || string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
                 {
-                    MessageBox.Show("没有输入窑炉", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    this.txtKiln.Focus();
                     return;
                 }
-                if (string.IsNullOrWhiteSpace(this.txtKilnCarCode.Text) || this._productionEntity.KilnCarID == null)
+                // 验证烧成批次
+                if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCode) ||
+                    this._productionEntity.KilnID == null ||
+                    this._productionEntity.KilnID == -1)
                 {
-                    MessageBox.Show("没有输入窑车", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    this.txtKilnCarCode.Focus();
                     return;
                 }
-                if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
+                if (string.IsNullOrWhiteSpace(this._productionEntity.KilnCarCode) ||
+                    this._productionEntity.KilnCarID == null ||
+                    this._productionEntity.KilnCarID == -1)
                 {
-                    MessageBox.Show("没有输入烧成批次", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    this.txtFiredBatchNo.Focus();
                     return;
                 }
-
-                string KilnCarBatchNo = string.Format("{0}#{1}#{2}#{3}",
-                    this._productionEntity.KilnCode,
-                    this._productionEntity.KilnCarCode,
-                    this.dtpFiredDate.Value.Value.ToString("yyyyMMdd"),
-                    this.txtFiredBatchNo.DataValue.Value.ToString("000"));
-
-                ClientRequestEntity cre = new ClientRequestEntity();
-                cre.NameSpace = "F_PM_0504";
-                cre.Name = "CheckKilnCarBatchNo";
-                cre.Properties["KilnID"] = this._productionEntity.KilnID.Value;
-                cre.Properties["KilnCarID"] = this._productionEntity.KilnCarID.Value;
-                cre.Properties["FiredDate"] = this.dtpFiredDate.Value.Value;
-                cre.Properties["KilnCarBatchNo"] = KilnCarBatchNo;
-                cre.Properties["ProcedureID"] = this._procedureID;
-                cre.Properties["ModelType"] = this._procedureDataEntity.ModelType;
-
-                ServiceResultEntity sre = (ServiceResultEntity)DoAsync(new BaseAsyncMethod(() =>
-                {
-                    return PMModuleProxyNew.Service.HandleRequest(cre);
-                }));
-
-                if (sre == null)
-                {
-                    MessageBox.Show("此窑车烧成批次不存在",
-                              this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    this.txtFiredBatchNo.SelectAll();
-                    return;
-                }
-                if (sre.Status == Constant.ServiceResultStatus.Other)
+                if (string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
                 {
-                    MessageBox.Show(sre.Message,
-                              this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
-                    this.txtFiredBatchNo.SelectAll();
                     return;
                 }
-
-                this.txtKilnCarCode.ReadOnly = true;
-                this.txtKiln.ReadOnly = true;
-                this.txtFiredBatchNo.ReadOnly = true;
-                this.dtpFiredDate.Enabled = false;
+                this.CheckFiredBatchNo();
             }
             catch (Exception ex)
             {
@@ -1135,14 +1248,5 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                     System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
             }
         }
-
-        private void txtFiredBatchNo_Validating(object sender, System.ComponentModel.CancelEventArgs e)
-        {
-            if (this.txtFiredBatchNo.ReadOnly || string.IsNullOrWhiteSpace(this.txtFiredBatchNo.Text))
-            {
-                return;
-            }
-            btnOk_Click(null, null);
-        }
     }
 }

+ 113 - 90
DK.Service/BarcodePrintService/InvoiceLayoutPrinter.cs

@@ -18,7 +18,7 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
         // TODO 加密保存 解密读取
         private static byte[] KEY = new byte[] { 106, 240, 243, 74, 29, 163, 145, 29, 39, 65, 118, 96, 247, 237, 40, 121, 116, 10, 14, 50, 139, 117, 244, 163, 193, 190, 184, 66, 8, 185, 78, 73 };
         private static byte[] IV = new byte[] { 26, 122, 25, 28, 97, 211, 152, 32, 223, 110, 120, 242, 170, 35, 96, 93 };
-        private static ICryptoTransform _decryptor = null;
+        //private static ICryptoTransform _decryptor = null;
         #endregion 保存、读取相关
         #endregion
 
@@ -44,8 +44,8 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
         #region 构造函数
         static InvoiceLayoutPrinter()
         {
-            Rijndael age = Rijndael.Create();
-            _decryptor = age.CreateDecryptor(KEY, IV);
+            //Rijndael age = Rijndael.Create();
+            //_decryptor = age.CreateDecryptor(KEY, IV);
         }
 
         private InvoiceLayoutPrinter()
@@ -76,118 +76,139 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
         {
             if (layout == null || layout.Length == 0)
             {
-                throw new System.ArgumentNullException("InvoiceLayoutPrint's layout is null");
+                throw new System.ArgumentNullException("layout");
             }
             if (data == null)
             {
-                throw new System.ArgumentNullException("InvoiceLayoutPrint's data is null");
+                throw new System.ArgumentNullException("data");
             }
-            if (detail == null || detail.Rows.Count == 0)
+            //if (detail == null || detail.Rows.Count == 0)
+            //{
+            //    throw new System.ArgumentNullException("detail");
+            //}
+            try
             {
-                throw new System.ArgumentNullException("InvoiceLayoutPrint's detail is null");
+                InvoiceLayoutPrinter printer = new InvoiceLayoutPrinter();
+                printer.LayoutItems = new List<LayoutItem>();
+                printer.ReadLayout(layout);
+                printer._printData = data;
+                printer._printGridData = detail;
+
+                //return printer.DrawImages().ToArray();
+                return printer.DrawImages();
+            }
+            catch (Exception ex)
+            {
+                throw ex;
             }
-
-            InvoiceLayoutPrinter printer = new InvoiceLayoutPrinter();
-            printer.LayoutItems = new List<LayoutItem>();
-            printer.ReadLayout(layout);
-            printer._printData = data;
-            printer._printGridData = detail;
-
-            //return printer.DrawImages().ToArray();
-			return printer.DrawImages();
         }
 
         public static void Print(string printerName, short copies, byte[] layout, DataRow data, DataTable detail)
         {
             if (layout == null || layout.Length == 0)
             {
-                throw new System.ArgumentNullException("InvoiceLayoutPrint's layout is null");
+                throw new System.ArgumentNullException("layout");
             }
             if (data == null)
             {
-                throw new System.ArgumentNullException("InvoiceLayoutPrint's data is null");
+                throw new System.ArgumentNullException("data");
             }
-            if (detail == null || detail.Rows.Count == 0)
+            //if (detail == null || detail.Rows.Count == 0)
+            //{
+            //    throw new System.ArgumentNullException("detail");
+            //}
+            try
             {
-                throw new System.ArgumentNullException("InvoiceLayoutPrint's detail is null");
-            }
-
-            InvoiceLayoutPrinter printer = new InvoiceLayoutPrinter();
-            printer.LayoutItems = new List<LayoutItem>();
-            printer.ReadLayout(layout);
-            printer._printData = data;
-            printer._printGridData = detail;
+                InvoiceLayoutPrinter printer = new InvoiceLayoutPrinter();
+                printer.LayoutItems = new List<LayoutItem>();
+                printer.ReadLayout(layout);
+                printer._printData = data;
+                printer._printGridData = detail;
 
-            printer._printDocument.PrinterSettings.PrinterName = printerName;
-            printer._printDocument.PrinterSettings.Copies = copies;
+                printer._printDocument.PrinterSettings.PrinterName = printerName;
+                printer._printDocument.PrinterSettings.Copies = copies;
 
-            printer._printDocument.Print();
+                printer._printDocument.Print();
 
-            //return printer.DrawImages().ToArray();
-            //return printer.DrawImages();
+                //return printer.DrawImages().ToArray();
+                //return printer.DrawImages();
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
         }
 
         #region 票据打印
         private void ReadLayout(byte[] layout)
         {
-            using (MemoryStream stream = new MemoryStream(layout))
+            try
             {
-                stream.Position = 0;
-                // 反序列化
-                BinaryFormatter formatter = new BinaryFormatter();
-
-                // TODO 解密读取
-                //if (CryptoStream)
-                if (true)
+                using (MemoryStream stream = new MemoryStream(layout))
                 {
-                    using (CryptoStream cStream = new CryptoStream(stream, _decryptor, CryptoStreamMode.Read))
+                    stream.Position = 0;
+                    // 反序列化
+                    BinaryFormatter formatter = new BinaryFormatter();
+
+                    // TODO 解密读取
+                    //if (CryptoStream)
+                    if (true)
                     {
-                        this.Property = (PropertyOfLayoutBox)formatter.Deserialize(cStream);
+                        //using (CryptoStream cStream = new CryptoStream(stream, _decryptor, CryptoStreamMode.Read))
+                        Rijndael age = Rijndael.Create();
+                        using (CryptoStream cStream = new CryptoStream(stream, age.CreateDecryptor(KEY, IV), CryptoStreamMode.Read))
+                        {
+                            this.Property = (PropertyOfLayoutBox)formatter.Deserialize(cStream);
+                        }
                     }
-                }
-                else
-                {
-                    this.Property = (PropertyOfLayoutBox)formatter.Deserialize(stream);
-                }
-                //_lastItemRF = propertyOflayoutBox.LastItemRF;
-                //_newItemID = propertyOflayoutBox.NewItemID;
-                //_paperHeight = propertyOflayoutBox.PaperHeight;
-                //_paperWidth = propertyOflayoutBox.PaperWidth;
-                //if (_zoomType != ZoomType.Whole)
-                //{
-                //    ChangePaperSize();
-                //}
-                //else
-                //{
-                //    InitializeZoom();
-                //}
-                //paperArea.BackgroundImage = propertyOflayoutBox.BackgroundImage;
-                //_backgroundImageName = propertyOflayoutBox.BackgroundImageName;
-                //_isPrintBackground = propertyOflayoutBox.PrintBackground;
-                //_isPrintAreaVisible = propertyOflayoutBox.PrintAreaVisible;
-                ArrayList items = this.Property.Items;
-
-                if (items != null && 0 < items.Count)
-                {
-                    foreach (LayoutItem item in items)
+                    else
                     {
-                        //item.Init(this, false);
-                        //item.Init();
-                        this.LayoutItems.Add(item);
-                        if (item.ItemType == ItemType.Grid)
+                        this.Property = (PropertyOfLayoutBox)formatter.Deserialize(stream);
+                    }
+                    //_lastItemRF = propertyOflayoutBox.LastItemRF;
+                    //_newItemID = propertyOflayoutBox.NewItemID;
+                    //_paperHeight = propertyOflayoutBox.PaperHeight;
+                    //_paperWidth = propertyOflayoutBox.PaperWidth;
+                    //if (_zoomType != ZoomType.Whole)
+                    //{
+                    //    ChangePaperSize();
+                    //}
+                    //else
+                    //{
+                    //    InitializeZoom();
+                    //}
+                    //paperArea.BackgroundImage = propertyOflayoutBox.BackgroundImage;
+                    //_backgroundImageName = propertyOflayoutBox.BackgroundImageName;
+                    //_isPrintBackground = propertyOflayoutBox.PrintBackground;
+                    //_isPrintAreaVisible = propertyOflayoutBox.PrintAreaVisible;
+                    ArrayList items = this.Property.Items;
+
+                    if (items != null && 0 < items.Count)
+                    {
+                        foreach (LayoutItem item in items)
                         {
-                            this.OneGridItem = item as GridItem;
-                            if (this.OneGridItem.HeadRowsHeight == 0)
+                            //item.Init(this, false);
+                            //item.Init();
+                            this.LayoutItems.Add(item);
+                            if (item.ItemType == ItemType.Grid)
                             {
-                                this.OneGridItem.HeadRowsHeight = this.OneGridItem.RowsHeight;
+                                this.OneGridItem = item as GridItem;
+                                if (this.OneGridItem.HeadRowsHeight == 0)
+                                {
+                                    this.OneGridItem.HeadRowsHeight = this.OneGridItem.RowsHeight;
+                                }
                             }
                         }
                     }
+                    //paperArea.Select();
+                    //RefreshItemsBound();
+                    ////paperArea.Refresh();
+                    //return true;
                 }
-                //paperArea.Select();
-                //RefreshItemsBound();
-                ////paperArea.Refresh();
-                //return true;
+            }
+            catch (Exception ex)
+            {
+                throw ex;
             }
         }
 
@@ -212,22 +233,24 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
             //}
 
             List<Image> images = new List<Image>();
-            Bitmap pageImage = null;
-            Graphics pageGraphics = null;
+            //Bitmap pageImage = null;
+            //Graphics pageGraphics = null;
 
             bool hasNextPage = true;
             while (hasNextPage)
             {
-                pageImage = new Bitmap(this.PageWidthPixel, this.PageHeightPixel);
+                Bitmap pageImage = new Bitmap(this.PageWidthPixel, this.PageHeightPixel);
                 pageImage.SetResolution(LayoutCommon.DPI, LayoutCommon.DPI);
-                pageGraphics = Graphics.FromImage(pageImage);
-                // TODO 白色背景
-                pageGraphics.Clear(Color.White);
-                //pageGraphics.FillRectangle(Brushes.White, pageGraphics.ClipBounds);
-                pageGraphics.PageUnit = GraphicsUnit.Millimeter;
-
-                hasNextPage = DrawPage(pageGraphics);
-                images.Add(pageImage);
+                using (Graphics pageGraphics = Graphics.FromImage(pageImage))
+                {
+                    // TODO 白色背景
+                    pageGraphics.Clear(Color.White);
+                    //pageGraphics.FillRectangle(Brushes.White, pageGraphics.ClipBounds);
+                    pageGraphics.PageUnit = GraphicsUnit.Millimeter;
+
+                    hasNextPage = DrawPage(pageGraphics);
+                    images.Add(pageImage);
+                }
             }
 
             return images;

+ 1 - 0
DK.Service/DKIBOSSPRDLogic/DKIBOSSPRDLogic.cs

@@ -386,6 +386,7 @@ namespace Dongke.IBOSS.PRD.Service.DKIBOSSPRDLogic
                         userInfo = new SUserInfo();
                         userInfo.UserID = System.Convert.ToInt32(dsUserInfo.Tables[0].Rows[0]["UserID"]);
                         userInfo.UserCode = System.Convert.ToString(dsUserInfo.Tables[0].Rows[0]["UserCode"]);
+                        userInfo.UserName = System.Convert.ToString(dsUserInfo.Tables[0].Rows[0]["UserName"]);
                         userInfo.OrganizationID = System.Convert.ToInt32(dsUserInfo.Tables[0].Rows[0]["OrganizationID"]);
                         userInfo.OrganizationCode = System.Convert.ToString(dsUserInfo.Tables[0].Rows[0]["OrganizationCode"]);
                         userInfo.AccountID = System.Convert.ToInt32(dsUserInfo.Tables[0].Rows[0]["AccountID"]);

+ 14 - 4
DK.Service/PMModuleService/PMModuleLogic.cs

@@ -9042,9 +9042,12 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 "        ,inp.goodsid\n" +
                 "        ,inp.goodscode\n" +
                 "        ,inp.goodsname\n" +
-                "        ,kd.USERID\n" +
-                "        ,kd.USERCODE\n" +
-                "        ,kd.USERNAME\n" +
+                //"        ,kd.USERID\n" +
+                //"        ,kd.USERCODE\n" +
+                //"        ,kd.USERNAME\n" +
+                "        ,@USERID@\n" +
+                "        ,@USERCODE@\n" +
+                "        ,@USERNAME@\n" +
                 "        ,kd.KILNID\n" +
                 "        ,k.KILNCODE\n" +
                 "        ,k.KILNNAME\n" +
@@ -9107,6 +9110,7 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 "      ,t.FLOWPROCEDURETIME\n" +
                 "      ,t.PROCEDUREID\n" +
                 "      ,t.PROCEDURETIME\n" +
+                "      ,t.USERID\n" +
                 "      ,t.PRODUCTIONDATAID) =\n" +
                 "       (select pin.KILNID\n" +
                 "              ,pin.KILNCODE\n" +
@@ -9122,6 +9126,7 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 "              ,sysdate\n" +
                 "              ,pin.PROCEDUREID\n" +
                 "              ,sysdate\n" +
+                "              ,@USERID@\n" +
                 "              ,pin.PRODUCTIONDATAID\n" +
                 "          from tp_pm_productiondatain pin\n" +
                 "         where pin.productiondataid =\n" +
@@ -9139,12 +9144,17 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                         new CDAParameter("kilncarbatchno", cre.Properties["KilnCarBatchNo"]),
                         new CDAParameter("barcode", item["barcode"]),
                         new CDAParameter("KILNCARPOSITION", item["KILNCARPOSITION"]),
+                        new CDAParameter("USERID", userInfo.UserID),
+                        new CDAParameter("USERCODE", userInfo.UserCode),
+                        new CDAParameter("USERNAME", userInfo.UserName),
                     };
 
                     // 插入生产数据
                     dataAccess.ExecuteNonQuery(sqlString, paras);
                     // 更新在产数据
-                    dataAccess.ExecuteNonQuery(sqlUpdate, new CDAParameter("barcode", item["barcode"]));
+                    dataAccess.ExecuteNonQuery(sqlUpdate,
+                        new CDAParameter("barcode", item["barcode"]),
+                        new CDAParameter("USERID", userInfo.UserID));
                 }
 
                 dataAccess.Commit();

+ 8 - 0
DK.Service/Service.DataModels/SUserInfo.cs

@@ -32,6 +32,14 @@ namespace Dongke.IBOSS.PRD.Service.DataModels
             get;
             set;
         }
+        /// <summary>
+        /// 用户名称
+        /// </summary>
+        public string UserName
+        {
+            get;
+            set;
+        }
 
         /// <summary>
         /// 账套ID

binární
DLL/Curtain.Core.dll


+ 48 - 5
DLL/Curtain.Core.xml

@@ -1272,6 +1272,15 @@
             <param name="values"></param>
             <returns></returns>
         </member>
+        <member name="M:Curtain.Helpers.ArrayHelper.IsNullOrEmpty``2(System.Collections.Generic.Dictionary{``0,``1})">
+            <summary>
+            集合是null或0
+            </summary>
+            <typeparam name="K"></typeparam>
+            <typeparam name="V"></typeparam>
+            <param name="values"></param>
+            <returns></returns>
+        </member>
         <member name="M:Curtain.Helpers.ArrayHelper.ToArray``1(``0[])">
             <summary>
             转数组
@@ -1280,21 +1289,23 @@
             <param name="values"></param>
             <returns></returns>
         </member>
-        <member name="M:Curtain.Helpers.ArrayHelper.ToArray``1(System.String,System.Char)">
+        <member name="M:Curtain.Helpers.ArrayHelper.ToArray``1(System.String,System.Char,System.Boolean)">
             <summary>
             分割字符串
             </summary>
             <typeparam name="T"></typeparam>
             <param name="value"></param>
             <param name="separator"></param>
+            <param name="trimSpace"></param>
             <returns></returns>
         </member>
-        <member name="M:Curtain.Helpers.ArrayHelper.ToArray(System.String,System.Char)">
+        <member name="M:Curtain.Helpers.ArrayHelper.ToArray(System.String,System.Char,System.Boolean)">
             <summary>
             分割字符串
             </summary>
             <param name="value"></param>
             <param name="separator"></param>
+            <param name="trimSpace"></param>
             <returns></returns>
         </member>
         <member name="M:Curtain.Helpers.ArrayHelper.ToKeyArray``2(System.Collections.Generic.Dictionary{``0,``1},System.Int32)">
@@ -1757,6 +1768,26 @@
             <param name="format"></param>
             <returns></returns>
         </member>
+        <member name="M:Curtain.Core.ObjectExtension.ToArray``1(System.String,System.Char,System.Boolean)">
+            <summary>
+            分割字符串
+            </summary>
+            <typeparam name="T"></typeparam>
+            <param name="value"></param>
+            <param name="separator"></param>
+            <param name="trimSpace"></param>
+            <returns></returns>
+        </member>
+        <member name="M:Curtain.Core.ObjectExtension.ToArray(System.String,System.Char,System.Boolean)">
+            <summary>
+            分割字符串
+            </summary>
+            <typeparam name="T"></typeparam>
+            <param name="value"></param>
+            <param name="separator"></param>
+            <param name="trimSpace"></param>
+            <returns></returns>
+        </member>
         <member name="M:Curtain.Core.ObjectExtension.IsNullOrEmpty``1(``0[])">
             <summary>
             数组是null或0
@@ -1771,6 +1802,13 @@
             <param name="values"></param>
             <returns></returns>
         </member>
+        <member name="M:Curtain.Core.ObjectExtension.IsNullOrEmpty``2(System.Collections.Generic.Dictionary{``0,``1})">
+            <summary>
+            集合是null或0
+            </summary>
+            <param name="values"></param>
+            <returns></returns>
+        </member>
         <member name="M:Curtain.Core.ObjectExtension.ToKeyArray``2(System.Collections.Generic.Dictionary{``0,``1},System.Int32)">
             <summary>
             获得key类型数组
@@ -1806,12 +1844,17 @@
             日志记录器
             </summary>
         </member>
-        <member name="F:Curtain.Log.Logger.DefaultLogDirectory">
+        <member name="P:Curtain.Log.Logger.DefaultLogRoot">
+            <summary>
+            默认日志根目录(程序集所在目录)
+            </summary>
+        </member>
+        <member name="P:Curtain.Log.Logger.DefaultLogDirectory">
             <summary>
             默认日志路径(\Logs)
             </summary>
         </member>
-        <member name="F:Curtain.Log.Logger.DefaultLogEextension">
+        <member name="P:Curtain.Log.Logger.DefaultLogEextension">
             <summary>
             默认LOG文件扩展名(.log)
             </summary>
@@ -1874,7 +1917,7 @@
         </member>
         <member name="P:Curtain.Log.Logger.StackFrameIndex">
             <summary>
-            异常输出时,定位异常所在方法。(默认0,logger方法所在方法)
+            异常输出时,定位异常所在方法。(默认0,调用logger所在方法)
             </summary>
         </member>
         <member name="P:Curtain.Log.Logger.FileExistDays">

binární
DLL/Curtain.DataAccess.dll


+ 3 - 28
DLL/Curtain.DataAccess.xml

@@ -1204,7 +1204,7 @@
         </member>
         <member name="F:Curtain.DataAccess.MySqlVersion.MySql_5">
             <summary>
-            
+            5
             </summary>
         </member>
         <member name="T:Curtain.DataAccess.SQLiteVersion">
@@ -1219,7 +1219,7 @@
         </member>
         <member name="F:Curtain.DataAccess.SQLiteVersion.SQLite_3">
             <summary>
-            
+            3
             </summary>
         </member>
         <member name="T:Curtain.DataAccess.PostgreSQLVersion">
@@ -1232,34 +1232,9 @@
             未指定
             </summary>
         </member>
-        <member name="F:Curtain.DataAccess.PostgreSQLVersion.Npg_9_4_25">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="F:Curtain.DataAccess.PostgreSQLVersion.Npg_9_5_20">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="F:Curtain.DataAccess.PostgreSQLVersion.Npg_9_6_16">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="F:Curtain.DataAccess.PostgreSQLVersion.Npg_10_11">
-            <summary>
-            
-            </summary>
-        </member>
-        <member name="F:Curtain.DataAccess.PostgreSQLVersion.Npg_11_6">
-            <summary>
-            
-            </summary>
-        </member>
         <member name="F:Curtain.DataAccess.PostgreSQLVersion.Npg_12_1">
             <summary>
-            
+            12.1
             </summary>
         </member>
         <member name="T:Curtain.DataAccess.DataType">

binární
DLL/Curtain.Framework.dll


binární
DLL/Curtain.Net.Sockets.dll


+ 3 - 3
WCF.Service/WCF.Hosting/Config.ini

@@ -3,10 +3,10 @@ ServiceName=
 Description=
 
 [DBSetting]
-DBIP=172.18.130.61
+DBIP=192.168.0.237
 DBPort=1521
-SID=hgcz1
-DBUser=hgcz1
+SID=ibossmes
+DBUser=devhgcz
 DBPassword=etLHPkLTOLw=
 
 [WCFSetting]

+ 1 - 1
WCF.Service/WCF.Hosting/ConfigMain.cs

@@ -36,7 +36,7 @@ namespace Dongke.IBOSS.PRD.WCF.Hosting
             //ServiceInvoker.ServiceDoneEvent += DKIMSSWCFService_ServiceDoneEvent;
             //ServiceInvoker.ServiceExceptionEvent += DKIMSSWCFService_ServiceExceptionEvent;
 
-            Logger.DefaultLogDirectory = AppDomain.CurrentDomain.BaseDirectory + @"Log\";
+            Logger.DefaultLogDirectory = "Log";
 
             // 启动内存回收(每小时)
             timer1.Interval = 1000 * 60 * 60;

+ 65 - 0
WCF.Service/WCF.Services/PDAModuleService.cs

@@ -10682,6 +10682,71 @@ namespace Dongke.IBOSS.PRD.WCF.Services
                 }
                 #endregion
 
+                #region 窑车漏扫补件
+                if (module == "F_PM_0504")
+                {
+                    // 验证窑车编码是否存在
+                    if (action == "CheckKilnCar")
+                    {
+                        ClientRequestEntity cre = new ClientRequestEntity();
+                        cre.Properties["kilncarcode"] = data["KilnCarCode"];
+                        cre.Properties["procedureID"] = data["ProcedureID"];
+                        ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCar(cre, sUserInfo);
+                        if (sre.Status == Constant.ServiceResultStatus.Success)
+                        {
+                            actionResult.Status = (int)Constant.PDAResult.Success;
+                        }
+                        else
+                        {
+                            actionResult.Status = (int)Constant.PDAResult.Fail;
+                            actionResult.Message = sre.Message;
+                        }
+                        return actionResult;
+                    }
+                    // 验证窑车烧成批次号是否存在 和 是否能补漏扫
+                    if (action == "CheckKilnCarBatchNo")
+                    {
+                        ClientRequestEntity cre = new ClientRequestEntity();
+                        cre.Properties["KilnID"] = data["KilnID"];
+                        cre.Properties["KilnCarID"] = data["KilnCarID"];
+                        cre.Properties["ProcedureID"] = data["ProcedureID"];
+                        cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
+                        ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.CheckKilnCarBatchNo(cre, sUserInfo);
+                        if (sre.Status == Constant.ServiceResultStatus.Success)
+                        {
+                            actionResult.Status = (int)Constant.PDAResult.Success;
+                        }
+                        else
+                        {
+                            actionResult.Status = (int)Constant.PDAResult.Fail;
+                            actionResult.Message = sre.Message;
+                        }
+                        return actionResult;
+                    }
+                    // 窑车漏扫补件
+                    if (action == "SetKilnCarMissing")
+                    {
+                        ClientRequestEntity cre = new ClientRequestEntity();
+                        cre.Properties["KilnCarBatchNo"] = data["KilnCarBatchNo"];
+                        string carData = data["CarData"] + "";
+                        DataTable dataTable = JsonHelper.FromJson<DataTable>(carData);
+                        cre.Data = new DataSet();
+                        cre.Data.Tables.Add(dataTable);
+                        ServiceResultEntity sre = Service.PMModuleService.PMModuleLogic.SetKilnCarMissing(cre, sUserInfo);
+                        if (sre.Status == Constant.ServiceResultStatus.Success)
+                        {
+                            actionResult.Status = (int)Constant.PDAResult.Success;
+                        }
+                        else
+                        {
+                            actionResult.Status = (int)Constant.PDAResult.Fail;
+                            actionResult.Message = sre.Message;
+                        }
+                        return actionResult;
+                    }
+                }
+                #endregion
+
                 return actionResult;
 			}
 			catch (Exception ex)

+ 1 - 1
WCF.Service/WCF.WebHosting/Global.asax.cs

@@ -16,7 +16,7 @@ namespace Dongke.IBOSS.PRD.WCF.WebHosting
 	{
 		protected void Application_Start(object sender, EventArgs e)
         {
-            Logger.DefaultLogDirectory = AppDomain.CurrentDomain.BaseDirectory + @"Log\";
+            Logger.DefaultLogDirectory = "Log";
             InitService();
 
             // 更改连接串