DAL/采购管理/ClsCg_POOrderBill.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WarM/条码打印/Gy_BarCodeBill_automaticallyByPLC_New.resx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/品质管理/质量报表/QC_QualityReportsController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/条码管理/WEBSController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/²É¹º¹ÜÀí/ClsCg_POOrderBill.cs
@@ -309,8 +309,95 @@ throw (e); } } //åèµ·å®¡æ¹ public bool startCheckFlow(Int64 lngBillKey, Int64 HCheckFlowID_select, ref string sReturn) { try { string HBillNo = ""; //åæ®å· string HCheckFlowID = ""; //å®¡æ¹æµID string HCheckItemNowID = ""; //å½åå®¡æ ¸é¡¹ç®ID string HCheckItemNextID = ""; //å¾ å®¡æ ¸é¡¹ç®ID //夿æ¯å¦å·²ç»åèµ·å®¡æ¹ string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + this.BillType + "'"; DataSet ds0 = oCn.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); if (ds0 != null && ds0.Tables[0].Rows.Count > 0) { sReturn = "忮已å起审æ¹ï¼ä¸å¯éå¤å®¡æ¹ï¼"; return false; } //è·ååæ®æ°æ® string sql = "select * from " + this.MvarItemKey + " where HInterID = " + lngBillKey; DataSet ds = oCn.RunProcReturn(sql, this.MvarItemKey); if (ds == null || ds.Tables[0].Rows.Count == 0) { sReturn = "åæ®ä¸åå¨ï¼"; return false; } HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); //è·ååæ®ç±»å对åºçé»è®¤å®¡æ¹æµ string sql1 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " + "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " + "where a.HBillTypeID = '" + this.BillType + "' " + "and a.HInterID = " + HCheckFlowID_select + " " + "order by b.HFlowNo asc"; DataSet ds1 = oCn.RunProcReturn(sql1, "Xt_CheckFlowMain"); if (ds1 == null || ds1.Tables[0].Rows.Count == 0) { sReturn = "é»è®¤å®¡æ¹æµä¸åå¨ï¼"; return false; } HCheckFlowID = ds1.Tables[0].Rows[0]["HInterID"].ToString(); HCheckItemNowID = ds1.Tables[0].Rows[0]["HCheckItemID"].ToString(); if (ds1.Tables[0].Rows.Count >= 2) { HCheckItemNextID = ds1.Tables[0].Rows[1]["HCheckItemID"].ToString(); } else { HCheckItemNextID = "0"; } oCn.BeginTran(); //å¢å 忮审æ¹ç¶æè¡¨ æ°æ® for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { string sql2 = "insert into Xt_BillCheckFlowStatus" + "(HBillTypeID,HBillInterID,HBillNo,HCheckFlowID,HCheckItemID,HChecker,HCheckDate,HCheckNote) " + "values(" + "'" + this.BillType + "'," + "" + lngBillKey + "," + "'" + HBillNo + "'," + "" + ds1.Tables[0].Rows[i]["HInterID"].ToString() + "," + "" + ds1.Tables[0].Rows[i]["HCheckItemID"].ToString() + "," + "" + "''" + "," + "" + "''" + "," + "" + "''" + "" + ")"; oCn.RunProc(sql2); } //æ´æ°ä¸»è¡¨ å®¡æ¹æµ æ°æ® string sql3 = "update " + this.MvarItemKey + " set HCheckFlowID = " + HCheckFlowID + ",HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; oCn.RunProc(sql3); oCn.Commit(); return true; } catch (Exception e) { sReturn += e.Message; return false; } } } } WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill_automaticallyByPLC_New.cs
@@ -13,6 +13,7 @@ using System.Drawing.Printing; using System.IO; using System.Management; using System.Net.NetworkInformation; namespace WarM { @@ -1017,6 +1018,12 @@ { try { if (socket != null && socket.Connected) { MessageBox.Show("已建ç«è¿æ¥ï¼ä¸å¯éå¤å»ºç«è¿æ¥ï¼"); return; } if (grdMain.Rows.Count == 0 || grdMain.Rows[0].Cells[HMaterIDCol].Value == null || grdMain.Rows[0].Cells[HMaterIDCol].Value.ToString() == "" || grdMain.Rows[0].Cells[HMaterIDCol].Value.ToString() == "0") { MessageBox.Show("è¯·éæ©æºåï¼"); @@ -1060,6 +1067,8 @@ Thread thread = new Thread(ReceiveMess); thread.Start(); MessageBox.Show("è¿æ¥æåï¼"); timer3.Enabled = true; } catch (Exception ex) { @@ -1093,8 +1102,8 @@ } catch (Exception ex) { MessageBox.Show("æ¥å£å¼å¸¸ï¼å·²å ³éè¿æ¥ï¼" + ex.Message); socket.Close(); //MessageBox.Show("æ¥å£å¼å¸¸ï¼å·²å ³éè¿æ¥ï¼" + ex.Message); //socket.Close(); } } @@ -1236,6 +1245,7 @@ if (socket.Connected) { socket.Close(); MessageBox.Show("è¿æ¥å ³éæåï¼"); } else { @@ -1246,6 +1256,10 @@ catch (Exception ex) { MessageBox.Show(ex.Message); } finally { timer3.Enabled = false; } } #endregion @@ -2353,5 +2367,90 @@ } } #region æçº¿éè¿ private int maxRepeatConnectTimes = 5; private int currentRepeatConnectTimes = 0; #region 宿¶å¨æ£æµè¿æ¥ç¶æãæçº¿éè¿ private void timer3_Tick(object sender, EventArgs e) { if (currentRepeatConnectTimes < maxRepeatConnectTimes) { //夿客æ·ç«¯æ¯å¦å¯ä»¥è®¿é®æå¡å¨ï¼è¥ä¸å¯ä»¥è®¿é®ï¼å ³ésocketè¿æ¥ if (!getTargetInternetStatus()) { if (socket != null && socket.Connected) { socket.Close(); } currentRepeatConnectTimes += 1; } else if (getTargetInternetStatus() && !socket.Connected) { //è¥å®¢æ·ç«¯å¯ä»¥è®¿é®æå¡å¨ï¼socketéæ°è¿æ¥æå¡å¨ try { socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPAddress iPAddress = IPAddress.Parse(textBox_IPParams.Text); IPEndPoint point = new IPEndPoint(iPAddress, Convert.ToInt32(textBox_PortParams.Text)); socket.Connect(point); Thread thread = new Thread(ReceiveMess); thread.Start(); currentRepeatConnectTimes = 0; } catch (Exception ex) { currentRepeatConnectTimes += 1; } } } else { timer3.Enabled = false; currentRepeatConnectTimes = 0; MessageBox.Show("è¿æ¥å·²æå¼ï¼è¯·éæ°è¿æ¥ï¼!"); } } #endregion #region è·åç®æ 设å¤ç½ç»è¿æ¥ç¶æ private bool getTargetInternetStatus() { try { string targetIp = textBox_IPParams.Text; // æ¿æ¢ä¸ºç®æ çµèçIPå°å Ping pingSender = new Ping(); PingOptions options = new PingOptions(); // 使ç¨64åèçæ°æ®å ï¼âä½ å¯ä»¥æ ¹æ®éè¦è°æ´è¿ä¸ªå¼ string data = "Hello from Ping!"; byte[] buffer = Encoding.ASCII.GetBytes(data); int timeout = 1200; // è¶ æ¶æ¶é´ï¼âåä½ä¸ºæ¯«ç§ PingReply reply = pingSender.Send(targetIp, timeout, buffer, options); if (reply.Status == IPStatus.Success) { return true; } else { return false; } } catch (Exception ex) { return false; } } #endregion #endregion } } WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill_automaticallyByPLC_New.designer.cs
@@ -147,6 +147,7 @@ this.printDialog1 = new System.Windows.Forms.PrintDialog(); this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog(); this.timer2 = new System.Windows.Forms.Timer(this.components); this.timer3 = new System.Windows.Forms.Timer(this.components); this.Tool.SuspendLayout(); this.P1.SuspendLayout(); this.tabControl_MainInfo.SuspendLayout(); @@ -887,7 +888,7 @@ this.tabPage_ParamsInfo.Location = new System.Drawing.Point(4, 28); this.tabPage_ParamsInfo.Name = "tabPage_ParamsInfo"; this.tabPage_ParamsInfo.Padding = new System.Windows.Forms.Padding(3); this.tabPage_ParamsInfo.Size = new System.Drawing.Size(1387, 314); this.tabPage_ParamsInfo.Size = new System.Drawing.Size(1786, 314); this.tabPage_ParamsInfo.TabIndex = 1; this.tabPage_ParamsInfo.Text = "é 置信æ¯"; // @@ -1343,7 +1344,7 @@ this.tabPage3.Location = new System.Drawing.Point(4, 5); this.tabPage3.Margin = new System.Windows.Forms.Padding(4); this.tabPage3.Name = "tabPage3"; this.tabPage3.Size = new System.Drawing.Size(1398, 288); this.tabPage3.Size = new System.Drawing.Size(1796, 288); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "æ¡£æ¡å表"; this.tabPage3.UseVisualStyleBackColor = true; @@ -1363,7 +1364,7 @@ this.grdList.ReadOnly = true; this.grdList.RowHeadersWidth = 30; this.grdList.RowTemplate.Height = 23; this.grdList.Size = new System.Drawing.Size(1398, 288); this.grdList.Size = new System.Drawing.Size(1796, 288); this.grdList.TabIndex = 46; // // tabPage2 @@ -1373,7 +1374,7 @@ this.tabPage2.Margin = new System.Windows.Forms.Padding(4); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(4); this.tabPage2.Size = new System.Drawing.Size(1398, 288); this.tabPage2.Size = new System.Drawing.Size(1796, 288); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "æ¡ç ä¿¡æ¯"; this.tabPage2.UseVisualStyleBackColor = true; @@ -1393,7 +1394,7 @@ this.grdSub.ReadOnly = true; this.grdSub.RowHeadersWidth = 30; this.grdSub.RowTemplate.Height = 23; this.grdSub.Size = new System.Drawing.Size(1390, 280); this.grdSub.Size = new System.Drawing.Size(1788, 280); this.grdSub.TabIndex = 45; // // tabPage1 @@ -1449,7 +1450,7 @@ this.tabPage4.Location = new System.Drawing.Point(4, 5); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); this.tabPage4.Size = new System.Drawing.Size(1398, 288); this.tabPage4.Size = new System.Drawing.Size(1796, 288); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "工忡ç "; this.tabPage4.UseVisualStyleBackColor = true; @@ -1469,7 +1470,7 @@ this.grdBillBarCodeList.ReadOnly = true; this.grdBillBarCodeList.RowHeadersWidth = 30; this.grdBillBarCodeList.RowTemplate.Height = 23; this.grdBillBarCodeList.Size = new System.Drawing.Size(1392, 282); this.grdBillBarCodeList.Size = new System.Drawing.Size(1790, 282); this.grdBillBarCodeList.TabIndex = 47; // // pageSetupDialog1 @@ -1496,6 +1497,11 @@ // this.timer2.Enabled = true; this.timer2.Tick += new System.EventHandler(this.timer2_Tick); // // timer3 // this.timer3.Interval = 5000; this.timer3.Tick += new System.EventHandler(this.timer3_Tick); // // Gy_BarCodeBill_automaticallyByPLC_New // @@ -1669,5 +1675,6 @@ private System.Windows.Forms.PrintDialog printDialog1; private System.Windows.Forms.PrintPreviewDialog printPreviewDialog1; private System.Windows.Forms.Timer timer2; private System.Windows.Forms.Timer timer3; } } WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill_automaticallyByPLC_New.resx
@@ -760,6 +760,9 @@ <metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1058, 17</value> </metadata> <metadata name="timer3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>1177, 17</value> </metadata> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>64</value> </metadata> WebAPI/Controllers/CGGL/Cg_POOrderBillController.cs
@@ -2398,6 +2398,463 @@ } #endregion #region éè´è®¢å åèµ·å®¡æ¹ [Route("Cg_POOrderBill/StartCheckFlow_POOrderBill")] [HttpGet] public object StartCheckFlow_POOrderBill(int HInterID, int HCheckFlowID_select, string CurUserName) { string ModRightNameCheck = "Cg_POOrderBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; try { ////å®¡æ ¸æé //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; // objJsonResult.data = null; // return objJsonResult; //} //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsCg_POOrderBill oBill = new DAL.ClsCg_POOrderBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //åèµ·å®¡æ¹ if (oBill.startCheckFlow(lngBillKey, HCheckFlowID_select, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åèµ·å®¡æ¹æå"; objJsonResult.data = null; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å起审æ¹å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region éè´è®¢å å¤çº§ å®¡æ ¸/åå®¡æ ¸ /// <summary> /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Cg_POOrderBill/AuditXs_POOrderBill_Flow")] [HttpGet] public object AuditXs_POOrderBill_Flow(int HInterID, int IsAudit, string CurUserName, string CurUserID) { //string ModRightNameCheck = "Cg_POOrderBill_Check"; DBUtility.ClsPub.CurUserName = CurUserName; try { ////å®¡æ ¸æé //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) //{ // objJsonResult.code = "0"; // objJsonResult.count = 0; // objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; // objJsonResult.data = null; // return objJsonResult; //} //HInterIDæ°æ®å¤æ if (HInterID <= 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDå°äº0ï¼"; objJsonResult.data = null; return objJsonResult; } Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HInterID); //对HInterIDè¿è¡ç±»åçè½¬æ¢ DAL.ClsCg_POOrderBill oBill = new DAL.ClsCg_POOrderBill(); //å®ä¾ååæ®æä½ç±»ï¼ç¨äºè¿è¡ç¸å ³æä½ //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® { if (oBill.omodel.HCloseMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å ³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (oBill.omodel.HDeleteMan.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } if (IsAudit == 0) //å®¡æ ¸å¤æ { //夿æ¯å¦å·²ç»åèµ·å®¡æ¹ string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + oBill.BillType + "'"; DataSet ds0 = oCN.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); if (ds0 != null && ds0.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :åæ®æªå起审æ¹ï¼"; objJsonResult.data = null; return objJsonResult; } //夿忮å½åç¶æ if (oBill.omodel.HChecker.Trim() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :åæ®å·²å®æå®¡æ ¸!ä¸è½ç»§ç»å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { //夿æ¯å¦åå¨å®¡æ ¸è¿çé¡¹ç® string sql0 = "select * from Xt_BillCheckFlowStatus where HBillInterID = " + lngBillKey + " and HBillTypeID = '" + oBill.BillType + "' and ISNULL(HChecker,'') <> ''"; DataSet ds0 = oCN.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); if (ds0 != null && ds0.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :åæ®ä¸åå¨å·²ç»å®¡æ ¸ç项ç®ï¼ï¼"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); //è¿è¡éè¦è¿è¡çå®¡æ ¸/åå®¡æ ¸æä½ if (IsAudit == 0) //å®¡æ ¸æäº¤ { #region å®¡æ ¸åçç¸å ³å¤æ //å®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_Cg_POOrderBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Cg_POOrderBill_BeforeCheckCtrl"); if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :å®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } //================================================================================== //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ string s = ""; int sYear = 0; int sPeriod = 0; DateTime HDate = DateTime.Now; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.Message = s; return objJsonResult; } #endregion //è·åå½åå®¡æ ¸é¡¹ç® string sql0 = "select * from " + oBill.MvarItemKey + " where HInterID = " + lngBillKey; DataSet ds0 = oCN.RunProcReturn(sql0, oBill.MvarItemKey); string HCheckFlowID = ds0.Tables[0].Rows[0]["HCheckFlowID"].ToString(); //å®¡æ¹æµå ç string HCheckItemNowID = ds0.Tables[0].Rows[0]["HCheckItemNowID"].ToString(); //å½å审æ¹é¡¹ç®å ç string HCheckItemNextID = ds0.Tables[0].Rows[0]["HCheckItemNextID"].ToString(); //å¾ å®¡æ¹é¡¹ç®å ç //å¤æç¨æ·æ¯å¦ææé å®¡æ¹ å½åå®¡æ¹æµç审æ¹é¡¹ç® //string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + " and HValue = 1"; string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + ""; DataSet ds01 = oCN.RunProcReturn(sql01, "Xt_CheckUserRight"); if (ds01.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :ç¨æ·æ å½åå®¡æ ¸é¡¹ç®çå®¡æ ¸æéï¼"; objJsonResult.data = null; return objJsonResult; } //æ´æ° 忮审æ¹ç¶æè¡¨ ä¸å¯¹åºå®¡æ ¸é¡¹ç®çå®¡æ ¸ç¶æ string sql02 = "update Xt_BillCheckFlowStatus set HChecker='" + CurUserName + "',HCheckDate=getdate() where HBillTypeID = '" + oBill.BillType + "' and HBillInterID=" + lngBillKey + " and HCheckFlowID=" + HCheckFlowID + " and HCheckItemID=" + HCheckItemNowID; oCN.RunProc(sql02); //夿å½åå®¡æ ¸é¡¹ç®æ¯å¦æ¯æåä¸ä¸ªé¡¹ç®ï¼å¦ææ¯ï¼å®¡æ ¸ååååæ®çåæ®ç¶æã妿䏿¯ï¼è·åä¸ä¸ä¸ªå®¡æ ¸é¡¹ç®å¹¶æ´æ°å°éå®è®¢å主表 if (HCheckItemNextID != "0") //ååå®¡æ ¸çå®¡æ ¸é¡¹ç®ä¸æ¯æåä¸ä¸ªå®¡æ ¸é¡¹ç® { string sql03 = "select b.HInterID,b.HCheckItemID from Xt_CheckFlowMain as a " + "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " + "where a.HBillTypeID = '" + oBill.BillType + "' " + "and a.HInterID = " + HCheckFlowID + " " + "order by b.HFlowNo asc"; DataSet ds03 = oCN.RunProcReturn(sql03, "Xt_CheckFlowMain"); //è·åæ°çå½åå®¡æ ¸é¡¹ç®åå¾ å®¡æ ¸é¡¹ç® for (int i = 0; i < ds03.Tables[0].Rows.Count; i++) { if (ds03.Tables[0].Rows[i]["HCheckItemID"].ToString() == HCheckItemNextID) { HCheckItemNowID = HCheckItemNextID; } else if (HCheckItemNowID == HCheckItemNextID) { HCheckItemNextID = ds03.Tables[0].Rows[i]["HCheckItemID"].ToString(); break; } } //æ°çå½åå®¡æ ¸é¡¹ç®ä¸ºæåä¸ä¸ªå®¡æ ¸é¡¹ç®ï¼å¾ å®¡æ ¸é¡¹ç®ä¸åå¨ï¼è®¾ä¸ºé»è®¤å¼"0" if (HCheckItemNowID == HCheckItemNextID) { HCheckItemNextID = "0"; } //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; oCN.RunProc(sql04); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } else //ååå®¡æ ¸çå®¡æ ¸é¡¹ç®æ¯æåä¸ä¸ªå®¡æ ¸é¡¹ç® { //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® HCheckItemNowID = "0"; HCheckItemNextID = "0"; string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; oCN.RunProc(sql04); //æ´æ°åæ®çåæ®ç¶æ if (oBill.CheckBill(oCN, oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Cg_POOrderBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } } } if (IsAudit == 1) //åå®¡æ ¸æäº¤ { #region åå®¡æ ¸åçç¸å ³å¤æ //åå®¡æ ¸åæ§å¶========================================= DataSet ds = oCN.RunProcReturn("Exec h_p_Cg_POOrderBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'", "h_p_Cg_POOrderBill_BeforeUnCheckCtrl"); if (ds == null) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + "åå®¡æ ¸åå¤æå¤±è´¥ï¼"; objJsonResult.data = null; return objJsonResult; } if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); objJsonResult.data = null; return objJsonResult; } //========================================================= //è¿è¡ ä¼è®¡æé´ ç»è´¦ çå¤æåæ§å¶ string s = ""; int sYear = 0; int sPeriod = 0; DateTime HDate = DateTime.Now; if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false) { objJsonResult.Message = s; return objJsonResult; } #endregion //è·åéè¦åå®¡æ ¸çå®¡æ ¸é¡¹ç® string sql0 = "select c.* from Xt_CheckFlowMain as a " + "inner join Xt_CheckFlowSub as b on a.HInterID = b.HInterID " + "inner join Xt_BillCheckFlowStatus as c on a.HBillTypeID = c.HBillTypeID and b.HCheckItemID = c.HCheckItemID " + "where c.HBillTypeID = '" + oBill.BillType + "' and c.HBillInterID = " + lngBillKey + " " + "order by b.HFlowNo asc"; DataSet ds0 = oCN.RunProcReturn(sql0, "Xt_BillCheckFlowStatus"); if (ds0 == null || ds0.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :æªå起审æ¹ï¼"; objJsonResult.data = null; return objJsonResult; } string HCheckFlowID = ds0.Tables[0].Rows[0]["HCheckFlowID"].ToString(); //å®¡æ¹æµå ç string HCheckItemNowID = "0"; //å½å审æ¹é¡¹ç®å ç string HCheckItemNextID = "0"; //å¾ å®¡æ¹é¡¹ç®å ç if (oBill.omodel.HBillStatus <= 1) { for (int i = 0; i < ds0.Tables[0].Rows.Count; i++) { if (ds0.Tables[0].Rows[i]["HChecker"].ToString() != "") { HCheckItemNowID = ds0.Tables[0].Rows[i]["HCheckItemID"].ToString(); HCheckItemNextID = ds0.Tables[0].Rows[i]["HCheckItemID"].ToString(); } else { HCheckItemNextID = ds0.Tables[0].Rows[i]["HCheckItemID"].ToString(); break; } } if (HCheckItemNowID == HCheckItemNextID) { HCheckItemNextID = "0"; } } else { HCheckItemNowID = ds0.Tables[0].Rows[ds0.Tables[0].Rows.Count - 1]["HCheckItemID"].ToString(); HCheckItemNextID = "0"; } //å¤æç¨æ·æ¯å¦ææé å®¡æ¹ å½åå®¡æ¹æµç审æ¹é¡¹ç® //string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + " and HValue = 1"; string sql01 = "select * from Xt_CheckUserRight where HUserID = '" + CurUserID + "' and HCheckFlowInterID = " + HCheckFlowID + " and HCheckItemID = " + HCheckItemNowID + ""; DataSet ds01 = oCN.RunProcReturn(sql01, "Xt_CheckUserRight"); if (ds01.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :ç¨æ·æ å½åå®¡æ ¸é¡¹ç®çå®¡æ ¸æéï¼"; objJsonResult.data = null; return objJsonResult; } //æ´æ° 忮审æ¹ç¶æè¡¨ ä¸å¯¹åºå®¡æ ¸é¡¹ç®çå®¡æ ¸ç¶æ string sql02 = "update Xt_BillCheckFlowStatus set HChecker='',HCheckDate='' where HBillTypeID = '" + oBill.BillType + "' and HBillInterID=" + lngBillKey + " and HCheckFlowID=" + HCheckFlowID + " and HCheckItemID=" + HCheckItemNowID; oCN.RunProc(sql02); //夿åå®¡æ ¸çåæ®æ¯å¦å·²ç»å®¡æ ¸å®æï¼è¥å®¡æ ¸å®æï¼åå®¡æ ¸éè¦åæ´åæ®ç¶æã if (oBill.omodel.HBillStatus <= 1) { //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; oCN.RunProc(sql04); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } else { //æ´æ°åæ®ä¸»è¡¨çå®¡æ¹æµæ°æ® string sql04 = "update " + oBill.MvarItemKey + " set HCheckItemNowID=" + HCheckItemNowID + ",HCheckItemNextID=" + HCheckItemNextID + " where HInterID = " + lngBillKey; oCN.RunProc(sql04); //åå®¡æ ¸æäº¤AbandonCheck if (oBill.AbandonCheck(oCN, oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Xs_SeOrderBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "åå®¡æ ¸æå"; objJsonResult.data = null; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } } } oCN.Commit(); return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥æè åå®¡æ ¸å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; oCN.RollBack(); return objJsonResult; } } #endregion } } WebAPI/Controllers/Æ·ÖʹÜÀí/ÖÊÁ¿±¨±í/QC_QualityReportsController.cs
@@ -770,6 +770,122 @@ } #endregion #region è´¨éæ¨¡å æ§è½æ¥åºå°è´¦ /// <summary> /// è¿åç´éçæ¥è¡¨å表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("QC_CustomerAppealReport/QC_PerformanceScrapLedger")] [HttpGet] public object QC_PerformanceScrapLedger(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); if (sWhere == null || sWhere == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥è¯¢æ¡ä»¶ï¼"; objJsonResult.data = null; return objJsonResult; } Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere); string HBeginDate = dic["HBeginDate"].ToString(); string HEndDate = dic["HEndDate"].ToString(); string HBatchNo = dic["HBatchNo"].ToString(); int HMaterID = int.Parse(dic["HMaterID"].ToString()); ds = oCN.RunProcReturn("exec h_p_QC_PerformanceScrapLedger '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo+"'", "h_p_QC_PerformanceScrapLedger"); //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { Type dataType = col.DataType; string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region è´¨éæ¨¡å éæµç»è®°æ°æ®å°è´¦ /// <summary> /// è¿åç´éçæ¥è¡¨å表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("QC_CustomerAppealReport/QC_RegistrationForTestingReport")] [HttpGet] public object QC_RegistrationForTestingReport(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); if (sWhere == null || sWhere == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥è¯¢æ¡ä»¶ï¼"; objJsonResult.data = null; return objJsonResult; } Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere); string HBeginDate = dic["HBeginDate"].ToString(); string HEndDate = dic["HEndDate"].ToString(); string HBatchNo = dic["HBatchNo"].ToString(); int HMaterID = int.Parse(dic["HMaterID"].ToString()); ds = oCN.RunProcReturn("exec h_p_QC_RegistrationForTestingReport '" + HBeginDate + "','" + HEndDate + "','" + HMaterID + "','" + HBatchNo + "'", "h_p_QC_RegistrationForTestingReport"); //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { Type dataType = col.DataType; string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region è´¨éæ¨¡å å¶ç¨ç»©æè¶å¿å¾(䏿¬¡åæ ¼ç) æ¥è¯¢ [Route("QC_CustomerAppealReport/getQC_ProcessPerformanceFirstPass")] WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -8596,6 +8596,53 @@ #endregion #region æ«ç éªè¯å è¿åè¡¥æ«æ¸ åå表 [Route("WEBSController/Gy_BarCodeConfirmBill_getSuppRushList")] [HttpGet] public object Gy_BarCodeConfirmBill_getSuppRushList(long HInterID, string HBillNo, string HBillType, long HOrgID) { try { string sql = "exec h_p_Gy_BarCodeConfirmBill_getSuppRushList " + HInterID + ",'" + HBillNo + "','" + HBillType + "'," + HOrgID; ds = oCn.RunProcReturn(sql, "h_p_Gy_BarCodeConfirmBill_getSuppRushList"); if (ds == null || ds.Tables.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼"; objJsonResult.data = null; return objJsonResult; } else { List<object> columnNameList = new List<object>(); //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { Type dataType = col.DataType; string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; columnNameList.Add(JsonConvert.DeserializeObject(ColmString)); //è·åå°DataColumnå对象çåå } objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è·åå表信æ¯å¤±è´¥ï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region æ«ç éªè¯å å 餿«ç è®°å½ /// <summary>