Browse Source

Merge branch 'master' of http://pscg.dongkesoft.com:9002/r/mes/hg5020

xuwei 6 years ago
parent
commit
1b6d38c867

+ 12 - 13
DK.Client/PMModule/F_PM_0101.Designer.cs

@@ -41,8 +41,8 @@
             this.tsrOperate = new Dongke.IBOSS.PRD.Basics.BaseControls.C_ToolStrip();
             this.tsbtnAdd = new System.Windows.Forms.ToolStripButton();
             this.tsbtnEdit = new System.Windows.Forms.ToolStripButton();
-            this.tsbtnUnLast = new System.Windows.Forms.ToolStripButton();
             this.tsbtnBindBarCode = new System.Windows.Forms.ToolStripButton();
+            this.tsbtnUnLast = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
             this.tsbtnAdaptive = new System.Windows.Forms.ToolStripButton();
             this.tsbtnClose = new System.Windows.Forms.ToolStripButton();
@@ -153,18 +153,6 @@
             this.tsbtnEdit.Text = "编辑(&E)";
             this.tsbtnEdit.Click += new System.EventHandler(this.tsbtnEdit_Click);
             // 
-            // tsbtnUnLast
-            // 
-            this.tsbtnUnLast.AutoSize = false;
-            this.tsbtnUnLast.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.tsbtnUnLast.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
-            this.tsbtnUnLast.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.tsbtnUnLast.Name = "tsbtnUnLast";
-            this.tsbtnUnLast.Size = new System.Drawing.Size(100, 25);
-            this.tsbtnUnLast.Text = "撤销最后注浆(&U)";
-            this.tsbtnUnLast.Visible = false;
-            this.tsbtnUnLast.Click += new System.EventHandler(this.tsbtnUnLast_Click);
-            // 
             // tsbtnBindBarCode
             // 
             this.tsbtnBindBarCode.AutoSize = false;
@@ -176,6 +164,17 @@
             this.tsbtnBindBarCode.Text = "绑定条码(&B)";
             this.tsbtnBindBarCode.Click += new System.EventHandler(this.tsbtnBindBarCode_Click);
             // 
+            // tsbtnUnLast
+            // 
+            this.tsbtnUnLast.AutoSize = false;
+            this.tsbtnUnLast.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.tsbtnUnLast.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.tsbtnUnLast.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.tsbtnUnLast.Name = "tsbtnUnLast";
+            this.tsbtnUnLast.Size = new System.Drawing.Size(100, 25);
+            this.tsbtnUnLast.Text = "撤销最后注浆(&U)";
+            this.tsbtnUnLast.Click += new System.EventHandler(this.tsbtnUnLast_Click);
+            // 
             // toolStripSeparator3
             // 
             this.toolStripSeparator3.AutoSize = false;

+ 6 - 1
DK.Client/PMModule/F_PM_0106.cs

@@ -107,7 +107,7 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                     DataRow dataRow = _data.Tables[0].Rows[0];
                     this.txtTextBox1.Text = 
                         $"成型线编码  :{dataRow["GroutingLineCode"]} " + Environment.NewLine + Environment.NewLine +
-                        $"最后注浆日期:{dataRow["LastGroutingDate"]} " + Environment.NewLine + Environment.NewLine +
+                        $"最后注浆日期:{(dataRow["LastGroutingDate"] as DateTime?)?.ToString("yyyy-MM-dd")?? dataRow["LastGroutingDate"]+""} " + Environment.NewLine + Environment.NewLine +
                         $"最后注浆批次:{dataRow["LastGroutingBatchNo"]} " + Environment.NewLine + Environment.NewLine +
                         $"成型工号    :{dataRow["usercode"]} "
                         ;
@@ -156,6 +156,11 @@ namespace Dongke.IBOSS.PRD.Client.PMModule
                 // 异常情况处理
                 if (sre.Status == Constant.ServiceResultStatus.Success)
                 {
+                    DialogResult dr = MessageBox.Show("撤销成功,是否关闭画面", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
+                    if (dr == DialogResult.Yes)
+                    {
+                        this.Close();
+                    }
                     _data = null;
                     this.txtGroutingLineCode.Clear();
                     this.txtTextBox1.Clear();

+ 36 - 9
DK.Service/PMModuleService/PMModuleLogic.cs

@@ -713,7 +713,7 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                     "       decode(GMT.CanManyTimes, '1', decode(GL.LastGroutingDate, null, 1, :GroutingDate, NVL(GL.LastGroutingBatchNo, 1) + 1, 1), 1) GroutingBatchNo," +
                     //"       GMT.CanManyTimes," +
                     "       GL.monitorid," +
-                    "       decode(mu.userid,null,null, mu.username || '[' || mu.usercode || ']') monitorcode," +
+                    "       decode(mu.userid,null,'', mu.username || '[' || mu.usercode || ']') monitorcode," +
                     "       GMT.GMouldTypeID," +
                     "       GMT.GMouldTypeName," +
                     // 成型线变更 ver41 by chenxy end
@@ -836,7 +836,7 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                     "       GL.LastGroutingBatchNo," +
                     "       GL.monitorid," +
                     //"       mu.usercode monitorcode," +
-                    "       decode(mu.userid,null,null, mu.username || '[' || mu.usercode || ']') monitorcode," +
+                    "       decode(mu.userid,null,'', mu.username || '[' || mu.usercode || ']') monitorcode," +
                     "       decode(GMT.CanManyTimes, '1', NULL, 1) GroutingNum," +
                     "       GMT.CanManyTimes" +
                     // 成型线变更 ver41 by chenxy end
@@ -2741,6 +2741,7 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 "    on gd.GroutingLineID = gl.GroutingLineID\n" +
                 "   and gd.GroutingDate = GL.LastGroutingDate\n" +
                 "   and gd.GroutingBatchNo = gl.LastGroutingBatchNo\n" +
+                "   and gd.valueflag = '1'\n" +
                 " where gl.valueflag = '1'\n" +
                 "   and gl.GroutingLineCode = :glcode";
                 OracleParameter[] ps = new OracleParameter[]
@@ -2857,6 +2858,7 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 "    on gd.GroutingLineID = gl.GroutingLineID\n" +
                 "   and gd.GroutingDate = GL.LastGroutingDate\n" +
                 "   and gd.GroutingBatchNo = gl.LastGroutingBatchNo\n" +
+                "   and gd.valueflag = '1'\n" +
                 " where gl.valueflag = '1'\n" +
                 "   and gl.GroutingLineID = :glID\n" +
                 " for update";
@@ -2933,23 +2935,45 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 // 'S_PM_022', '注浆编辑限制天数' add by chenxy 2018-12-15 end
 
                 //2.然后取消注浆,3.并valueflag=0。4.修改成型线的最后注浆日期、批次。
-
-                string sql =
+                int r = 0;
+                string sql = null;
+                sql =
                 "UPDATE TP_PM_GroutingDailyDetail" +
                 "   SET GroutingCount = CASE" +
                 "                       WHEN GroutingFlag = '1'" +
                 "                       THEN GroutingCount - 1" +
                 "                       ELSE GroutingCount END," +
                 "       GroutingFlag = '0'," +
-                "       valueflag = '0'," +
                 "       UpdateUserID = :UpdateUserID" +
-                " WHERE GroutingDailyID = :gdid and valueflag = '1'";
+                " WHERE GroutingDailyID = :gdid";
                 ps = new OracleParameter[]
                 {
                     new OracleParameter(":UpdateUserID", user.UserID),
                     new OracleParameter(":gdid", gdID),
                 };
-                int r = conn.ExecuteNonQuery(sql, ps);
+                r = conn.ExecuteNonQuery(sql, ps);
+
+                sql = "UPDATE tp_pc_groutinglinedetail gld\n" +
+                "   SET gld.groutingcount =\n" +
+                "       (SELECT gdds.groutingcount\n" +
+                "          FROM tp_pm_groutingdailydetail gdds\n" +
+                "         WHERE gdds.groutingdailyid = :gdid\n" +
+                "           AND gdds.groutinglinedetailid = gld.groutinglinedetailid\n" +
+                "           AND gdds.valueflag = '1')\n" +
+                "      ,gld.updateuserid  = :UpdateUserID\n" +
+                " WHERE gld.groutinglinedetailid IN\n" +
+                "       (SELECT gdd.groutinglinedetailid\n" +
+                "          FROM tp_pm_groutingdailydetail gdd\n" +
+                "         WHERE gdd.groutingdailyid = :gdid\n" +
+                "           AND gdd.valueflag = '1')";
+                r = conn.ExecuteNonQuery(sql, ps);
+
+                sql =
+                "UPDATE TP_PM_GroutingDailyDetail" +
+                "   SET valueflag = '0'," +
+                "       UpdateUserID = :UpdateUserID" +
+                " WHERE GroutingDailyID = :gdid";
+                r = conn.ExecuteNonQuery(sql, ps);
 
                 sql = "update TP_PM_GroutingDaily gd set gd.valueflag='0', updateuserid = :UpdateUserID where gd.GroutingDailyID = :gdid";
                 r = conn.ExecuteNonQuery(sql, ps);
@@ -2965,6 +2989,11 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 "                   and gm.valueflag = '1'))\n" +
                 "      ,gl.UpdateUserID = :UpdateUserID\n" +
                 " where gl.GroutingLineID = :glid";
+                ps = new OracleParameter[]
+                {
+                    new OracleParameter(":UpdateUserID", user.UserID),
+                    new OracleParameter(":glid", glID),
+                };
                 r = conn.ExecuteNonQuery(sql, ps);
 
                 conn.Commit();
@@ -2983,8 +3012,6 @@ namespace Dongke.IBOSS.PRD.Service.PMModuleService
                 }
             }
         }
-
-
         #endregion
         #endregion 注浆管理