Эх сурвалжийг харах

数据库连接,完工数量修改

callm 3 жил өмнө
parent
commit
2b6a37c528

+ 1 - 1
UAS_MES_YD/App.config

@@ -72,7 +72,7 @@
   <applicationSettings>
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
-        <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+        <value />
       </setting>
     </UAS_MES_NEW.Properties.Settings>
   </applicationSettings>

+ 1 - 1
UAS_MES_YD/CustomControl/HeadBar/HeadBar.cs

@@ -122,7 +122,7 @@ namespace UAS_MES_NEW.CustomControl
                 if (logout_confirm == "Yes")
                 {
                     //注销的时候切换回默认数据库
-                    SystemInf.ConnectionString = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
+                    SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                     DataHelper.DBConnectionString = SystemInf.ConnectionString;
                     //清除上个用户的权限信息
                     SystemInf.Caller.Clear();

+ 1 - 1
UAS_MES_YD/DataOperate/DataHelper.cs

@@ -10,7 +10,7 @@ namespace UAS_MES_NEW.DataOperate
     class DataHelper
     {
         //系统默认的的连接字符串
-        private string ConnectionStrings = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         public static OracleConnection connection = null;

+ 1 - 1
UAS_MES_YD/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -66,7 +66,7 @@ namespace UAS_MES_NEW.Make
             ma_code.FormName = Name;
             ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail" };
             ma_code.DbChange += Ma_code_DbChange;
-            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.Condition = "ma_statuscode='STARTED' or ma_statuscode='FINISH'";
             dh = SystemInf.dh;
             StepCount.StepCode = User.CurrentStepCode;
             StepCount.Source = User.UserSourceCode;

+ 1 - 1
UAS_MES_YD/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -647,7 +647,7 @@ namespace UAS_MES_NEW.Make
                                     if (ms_status == "2")
                                     {
                                         //已完工数-1
-                                        SQLS1.Add("update make set ma_madeqty=ma_madeqty-1 where ma_code='" + ma_code + "'");
+                                        SQLS1.Add("update make set ma_endqty=ma_endqty-1 where ma_code='" + ma_code + "'");
                                     }
                                     //更新序列号状态
                                     SQLS1.Add("update makecraftdetail set mcd_inqty=mcd_inqty-1,mcd_okqty=mcd_okqty-1 where mcd_macode='" + ma_code + "' and mcd_stepcode='" + ms_stepcode + "'");

+ 3 - 3
UAS_MES_YD/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -631,7 +631,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.ma_softversion_label.AutoSize = true;
             this.ma_softversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_softversion_label.Location = new System.Drawing.Point(6, 224);
+            this.ma_softversion_label.Location = new System.Drawing.Point(6, 204);
             this.ma_softversion_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_softversion_label.Name = "ma_softversion_label";
             this.ma_softversion_label.Size = new System.Drawing.Size(146, 41);
@@ -711,9 +711,9 @@ namespace UAS_MES_NEW.Make
             this.ma_softversion.AutoSize = true;
             this.ma_softversion.CutLength = null;
             this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_softversion.Location = new System.Drawing.Point(188, 224);
+            this.ma_softversion.Location = new System.Drawing.Point(188, 204);
             this.ma_softversion.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.ma_softversion.MaximumSize = new System.Drawing.Size(300, 0);
+            this.ma_softversion.MaximumSize = new System.Drawing.Size(400, 0);
             this.ma_softversion.Name = "ma_softversion";
             this.ma_softversion.Size = new System.Drawing.Size(0, 41);
             this.ma_softversion.TabIndex = 73;

+ 1 - 1
UAS_MES_YD/FunctionCode/Make/Make_TestCollection.cs

@@ -227,7 +227,7 @@ namespace UAS_MES_NEW.Make
                         }
                         if (ma_code.Text != oMakeCode && oMakeCode != null)
                         {
-                            dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,ma_softversion,ma_salecode,substr(pr_spec,0,50)pr_spec,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
+                            dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,nvl(ma_softversion,ms_softversion)ma_softversion,ma_salecode,substr(pr_spec,0,50)pr_spec,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,ma_qty from makeserial left join  make on ma_code=ms_makecode left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
                             if (dt.Rows.Count > 0)
                             {
                                 BaseUtil.SetFormValue(this.Controls, dt);

+ 1 - 1
UAS_MES_YD/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -821,7 +821,7 @@ namespace UAS_MES_NEW.Packing
                                     SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
                                     SQLS1.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + num + ",mcd_outqty=mcd_outqty-" + num + ",mcd_okqty=mcd_okqty-" + num + " where mcd_macode='" + ma_code + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                     //扣减已完工数
-                                    SQLS1.Add("update make set ma_madeqty=ma_madeqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");
+                                    SQLS1.Add("update make set ma_endqty=ma_endqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");
                                 }
                                 if (pa_checkno != "")
                                 {

+ 1 - 1
UAS_MES_YD/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -793,7 +793,7 @@ namespace UAS_MES_NEW.Packing
                                     SQLS1.Add("delete from steppassed where sp_sncode in (select ms_sncode from makeserial where ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "') and sp_makecode='" + ma_code + "' and sp_stepcode='" + User.CurrentStepCode + "'");
                                     SQLS1.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + num + ",mcd_outqty=mcd_outqty-" + num + ",mcd_okqty=mcd_okqty-" + num + " where mcd_macode='" + ma_code + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                                     //扣减已完工数
-                                    SQLS1.Add("update make set ma_madeqty=ma_madeqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");
+                                    SQLS1.Add("update make set ma_endqty=ma_endqty-(select count(1) from makeserial where  ms_outboxcode='" + pa_outboxcode.Text + "' and ms_makecode='" + ma_code + "' and ms_status=2) where ma_code='" + ma_code + "'");
                                 }
                                 if (pa_checkno != "")
                                 {

+ 27 - 0
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleIn.Designer.cs

@@ -52,6 +52,8 @@
             this.Confirm = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cu_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.ma_softversion = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.Info)).BeginInit();
             this.SuspendLayout();
             // 
@@ -304,11 +306,34 @@
             this.cu_code.Str2 = null;
             this.cu_code.TabIndex = 226;
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(889, 72);
+            this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(146, 41);
+            this.label3.TabIndex = 228;
+            this.label3.Text = "软件版本";
+            // 
+            // ma_softversion
+            // 
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_softversion.Location = new System.Drawing.Point(1052, 72);
+            this.ma_softversion.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 41);
+            this.ma_softversion.TabIndex = 227;
+            // 
             // Special_AfterSaleIn
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1566, 802);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.cu_code);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.InDate);
@@ -362,5 +387,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_prodcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn ms_custname;
         private CustomControl.TextBoxWithIcon.EnterTextBox cu_code;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label ma_softversion;
     }
 }

+ 3 - 2
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleIn.cs

@@ -50,11 +50,12 @@ namespace UAS_MES_NEW.Special
             string oMSID = "";
             string oMakecode = "";
             string Err = "";
-            DataTable dt = (DataTable)dh.ExecuteSql("select ma_custname,ma_prodcode,pr_spec from makeserial_view left join make_view on ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_sncode='" + barcode.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select ma_custname,ma_prodcode,pr_spec,ma_softversion from makeserial_view left join make_view on ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_sncode='" + barcode.Text + "'", "select");
             if (dt.Rows.Count > 0)
             {
                 cu_code.Text = dt.Rows[0]["ma_custname"].ToString();
                 pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                ma_softversion.Text = dt.Rows[0]["ma_softversion"].ToString();
                 pr_spec.Text = dt.Rows[0]["pr_spec"].ToString();
             }
             if (cu_code.Text == "" || pr_code.Text == "")
@@ -64,7 +65,7 @@ namespace UAS_MES_NEW.Special
             }
             if (LogicHandler.CheckStepSNAndMacode("MD22020001", "ZBRK", barcode.Text, User.UserCode, out oMakecode, out oMSID, out Err))
             {
-                dh.ExecuteSql("update makeserial set ms_custname='" + cu_code.Text + "',ms_prodcode1='" + pr_code.Text + "' where ms_id=" + oMSID, "update");
+                dh.ExecuteSql("update makeserial set ms_custname='" + cu_code.Text + "',ms_prodcode1='" + pr_code.Text + "',ms_softversion='" + ma_softversion.Text + "' where ms_id=" + oMSID, "update");
                 LoadGridData();
                 if (dh.getFieldDataByCondition("makeserial", "ms_stepcode", "ms_id=" + oMSID).ToString() == User.CurrentStepCode)
                 {

+ 0 - 9
UAS_MES_YD/FunctionCode/Special/Special_AfterSaleIn.resx

@@ -126,15 +126,6 @@
   <metadata name="ms_custname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="ms_sncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ms_prodcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ms_custname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 2 - 2
UAS_MES_YD/FunctionCode/Special/Special_CancelImei.cs

@@ -44,7 +44,7 @@ namespace UAS_MES_NEW.Special
                     string sn = dt.Rows[0]["ms_sncode"].ToString();
                     string pr_detail = dt.Rows[0]["pr_detail"].ToString();
                     dh.ExecuteSql("update makeserial set ms_imei1='" + Reason.Text + "' where ms_imei1='" + IMEI.Text + "'", "update");
-                    dh.ExecuteSql("update sninfo set ms_imei1='' where sn_imei1='" + IMEI.Text + "'", "update");
+                    dh.ExecuteSql("update sninfo set ms_imei1='' where si_imei1='" + IMEI.Text + "'", "update");
                     LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, Reason.Text, "取消成功", IMEI.Text, "");
                     OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);
                 }
@@ -60,7 +60,7 @@ namespace UAS_MES_NEW.Special
                         string sn = dt.Rows[0]["ms_sncode"].ToString();
                         string pr_detail = dt.Rows[0]["pr_detail"].ToString();
                         dh.ExecuteSql("update makeserial set ms_imei2=='" + Reason.Text + "' where ms_imei2='" + IMEI.Text + "'", "update");
-                        dh.ExecuteSql("update sninfo set si_imei2='' where sn_imei2='" + IMEI.Text + "'", "update");
+                        dh.ExecuteSql("update sninfo set si_imei2='' where si_imei2='" + IMEI.Text + "'", "update");
                         LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, Reason.Text, "取消成功", IMEI.Text, "");
                         LogicHandler.DoCommandLog("CancelImei", User.UserCode, "", User.UserLineCode, User.UserSourceCode, Reason.Text, "取消成功", IMEI.Text, "");
                         OperateResult.AppendText("SN:" + sn + ",IMEI:" + IMEI.Text + ",机型:" + pr_detail + "取消成功\n", System.Drawing.Color.Black);

+ 1 - 1
UAS_MES_YD/Login.cs

@@ -46,7 +46,7 @@ namespace UAS_MES_NEW
         {
             BaseUtil.FormStepInOrOut(this, true);
             //设置默认数据库
-            SystemInf.DefaultDB = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
+            SystemInf.DefaultDB = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.ProcessesID = System.Diagnostics.Process.GetCurrentProcess().Id;
             CheckForIllegalCrossThreadCalls = false;
             LoadMasterInf = new Thread(LoadMaster);

+ 1 - 1
UAS_MES_YD/Main.cs

@@ -357,7 +357,7 @@ namespace UAS_MES_NEW
             if (logout_confirm == "Yes")
             {
                 //注销的时候切换回默认数据库
-                SystemInf.ConnectionString = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
+                SystemInf.ConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
                 DataHelper.DBConnectionString = SystemInf.ConnectionString;
                 //清除上个用户的权限信息
                 SystemInf.Caller.Clear();

+ 1 - 3
UAS_MES_YD/Properties/Settings.Designer.cs

@@ -121,9 +121,7 @@ namespace UAS_MES_NEW.Properties {
         
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91" +
-            ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 1 - 1
UAS_MES_YD/Properties/Settings.settings

@@ -27,7 +27,7 @@
       <Value Profile="(Default)">ftp://10.8.0.82|vsftpd|vsftpd</Value>
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
-      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+      <Value Profile="(Default)" />
     </Setting>
   </Settings>
 </SettingsFile>

+ 3 - 3
UAS_MES_YD/PublicMethod/LogicHandler.cs

@@ -526,7 +526,7 @@ namespace UAS_MES_NEW.PublicMethod
             }
             ExeSQL.Add(sql.ToString());
             //更新完工数量
-            ExeSQL.Add("update make set ma_madeqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");
+            ExeSQL.Add("update make set ma_endqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");
             //删除StepPassed数据
             sql.Clear();
             sql.Append("delete from steppassed where sp_sncode in (select v_barcode from mes_package_view where v_outboxcode='" + iOutBoxCode + "') ");
@@ -557,7 +557,7 @@ namespace UAS_MES_NEW.PublicMethod
             sql.Append("where ms_sncode in (select v_barcode from  mes_package_view where v_outboxcode='" + iOutBoxCode + "')");
             ExeSQL.Add(sql.ToString());
             //更新完工数量
-            ExeSQL.Add("update make set ma_madeqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");
+            ExeSQL.Add("update make set ma_endqty=(select count(1) from makeserial where ms_makecode='" + iMakeCode + "' and ms_status=2) where ma_code='" + iMakeCode + "'");
             //删除StepPassed数据
             sql.Clear();
             sql.Append("delete from steppassed where sp_sncode in (select v_barcode from mes_package_view where v_outboxcode='" + iOutBoxCode + "') ");
@@ -827,7 +827,7 @@ namespace UAS_MES_NEW.PublicMethod
                 if (ms_status == "2")
                 {
                     dh.ExecuteSql("delete from steppassed where sp_sncode='" + iSnCode + "' and sp_makecode='" + iMakeCode + "' and sp_stepcode='" + StepCode + "'", "delete");
-                    dh.UpdateByCondition("make", "ma_madeqty=nvl(ma_madeqty,0)-1", "ma_code='" + iMakeCode + "'");
+                    dh.UpdateByCondition("make", "ma_endqty=nvl(ma_endqty,0)-1", "ma_code='" + iMakeCode + "'");
                 }
                 if (ms_stepcode == StepCode)
                 {