From 9faee57fcc026298a78aa8b6639dcd829baf9862 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期日, 12 六月 2022 16:09:41 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WorkM/流转卡管理/MES_StationInBill.cs | 113 ++++++++++++++++++++++++++++++------- DAL/车间管理/ClsSc_StationInBill.cs | 9 ++- 2 files changed, 98 insertions(+), 24 deletions(-) diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_StationInBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_StationInBill.cs" index e65edd5..943a5f6 100644 --- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_StationInBill.cs" +++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_StationInBill.cs" @@ -323,9 +323,12 @@ public override bool AddBill(ref string sReturn) { try - { + { //寰楀埌mainid - omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + if (DBUtility.ClsPub.isLong(omodel.HInterID) == 0) + { + omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); + } //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� oCn.BeginTran(); //涓昏〃 @@ -390,7 +393,7 @@ oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + omodel.HInterID.ToString() + ",1"); - //==================杩涚珯鍗曞惎鐢ㄩ厤浠舵竻鍗曠粦瀹氾紝鍒欏皢 閰嶄欢娓呭崟鍐欏叆 瀹為檯琛�. 骞惰繘琛� 淇濆瓨寮哄埗鎺у埗 + //==================杩涚珯鍗曞惎鐢ㄩ厤浠舵竻鍗曠粦瀹氾紝 杩涜 淇濆瓨寮哄埗鎺у埗 //============================== diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" index cd5e636..fcf9aa1 100644 --- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" +++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationInBill.cs" @@ -30,8 +30,9 @@ public DAL.ClsSc_StationInBill BillNew = new DAL.ClsSc_StationInBill(); public DAL.ClsSc_StationInBill BillOld = new DAL.ClsSc_StationInBill(); - public Int64 lngBillKey; - public Int64 lngBillSubKey; + public Int64 HInterID;//涓诲唴鍚� + public Int64 lngBillKey; //娴佽浆鍗D + public Int64 lngBillSubKey; //娴佽浆鍗″瓙ID public Int64 lngICMOEntryID; //------------------------------------------------------------------------- @@ -191,11 +192,11 @@ this.txtHStationInTime.Text = DBUtility.ClsPub.GetServerDate(-1); this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//寰楀埌鏂板崟鍙� - - if (lngBillKey != 0 ) - { - //LotShow(); - } + this.HInterID = DBUtility.ClsPub.CreateBillID(this.ModName, ref DBUtility.ClsPub.sExeReturnInfo); + //if (lngBillKey != 0 ) + //{ + // //LotShow(); + //} } private void LotShow() //鑷姩杞藉叆 娴佽浆鍗¤繘绔欑晫闈㈠姛鑳� @@ -561,7 +562,13 @@ return false; //璧嬪�糏D if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) + { BillNew.omodel.HInterID = BillOld.omodel.HInterID; + } + else + { + BillNew.omodel.HInterID = HInterID; + } //涓荤被璧嬪�� //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞� string s = ""; @@ -1034,9 +1041,14 @@ Sub_WriteInForm_SM2(Ds.Tables[0], i); } //濡傛灉绯荤粺鍙傛暟鍚敤浜� 杩涚珯鍗曠粦瀹氶厤浠舵竻鍗曞垯 浠庣敓浜х敤鏂欐竻鍗曚腑鑾峰彇宸ュ簭BOM鍐欏叆 涓存椂琛紝骞跺姞杞借〃鏍� - - //鍒锋柊琛ㄤ綋缃戞牸鏁版嵁 - + Pub_Class.ClsXt_SystemParameter oParam = new ClsXt_SystemParameter(); + string sIsBingLine = oParam.GetSingleSystemParameter("MES_StationInBill_LineBindCtl",ref DBUtility.ClsPub.sExeReturnInfo ); + if (sIsBingLine.Trim() == "Y") + { + oCn.RunProc("exec h_p_MES_StationInBillSubBindSource_Insert " + lngBillKey.ToString() + " , " + lngBillSubKey.ToString() + "," + HInterID.ToString() + " "); + //鍒锋柊琛ㄤ綋缃戞牸鏁版嵁 + DisplaySub(); + } // txtHGroupID.Focus(); } @@ -1452,18 +1464,77 @@ //閰嶄欢鏉″舰鐮� 鍥炶溅浜嬩欢 private void txtHBarCode_Mater_KeyDown(object sender, KeyEventArgs e) { - if (e.KeyCode == Keys.Return) + try { - //鍏堝垽鏂� 涓存椂琛ㄤ腑鏄惁鏈夋暟鎹� - - //鍒ゆ柇鏉″舰鐮佹槸鍚﹀湪鏉$爜妗f涓� - - //鍒ゆ柇鏉″舰鐮佹槸鍚﹀悎鐞� - - //鍐欏叆 鎵爜璁板綍琛� - - //鍒锋柊琛ㄤ綋缃戞牸鏁版嵁 - + if (e.KeyCode == Keys.Return) + { + if (txtHBarCode_Mater.Text.Trim() == "") + { + MessageBox.Show("璇疯緭鍏ユ潯褰㈢爜锛�"); + return; + } + string sBarCode = txtHBarCode_Mater.Text.Trim(); + txtHBarCode_Mater.Text = ""; + //鍒ゆ柇鏉″舰鐮佹槸鍚﹀湪鏉$爜妗f涓紝鍒ゆ柇鏉″舰鐮佹槸鍚﹀悎鐞� + //鍏堝垽鏂� 涓存椂琛ㄤ腑鏄惁鏈夋暟鎹紝鏉″舰鐮佺殑鐗╂枡鏄惁鍦ㄦ竻鍗曚腑锛屽啓鍏� 鎵爜璁板綍琛� + //寰楀埌淇℃伅 + SQLHelper.ClsCN oCn = new ClsCN(); + DataSet Ds; + Ds = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindBarCode " + HInterID.ToString() + " ,'" + sBarCode + "'", "h_p_MES_StationInBillSub_BindBarCode"); + //鍐欏叆淇℃伅 + if (Ds == null || Ds.Tables[0].Rows.Count == 0) + { + MessageBox.Show("鏈煡璇㈠埌鏉″舰鐮佷俊鎭紒"); + return; + } + else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 2) + { + MessageBox.Show("閿欒锛�" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1])); + return; + } + //鍒锋柊琛ㄤ綋缃戞牸鏁版嵁锛堟渶濂介鑹叉樉绀猴級 + DisplaySub(); + } } + catch (Exception e1) + { + MessageBox.Show(e1.Message + "txtHBarCode_Mater_KeyDown"); + } + } + + private void DisplaySub() + { + try + { + SQLHelper.ClsCN oCn = new ClsCN(); + DataSet Dsplay; + Dsplay = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindDisplay " + HInterID.ToString() + " ", "h_p_MES_StationInBillSub_BindDisplay"); + //鍐欏叆淇℃伅 + if (Dsplay == null || Dsplay.Tables[0].Rows.Count == 0) + { + MessageBox.Show("鍒锋柊澶辫触锛�"); + return; + } + else + { + grdSub.DataSource = Dsplay.Tables[0].DefaultView; + //璁剧疆鍚堣鍒� + //string sTotalCol = ""; + //sTotalCol = DBUtility.Gy_BaseFun.GetTotalCols(DSet); + //string[] sT; + //sT = sTotalCol.Split(Convert.ToChar(",")); + //oSumGrid.BuildTotalCols(sT); + // + //鍐荤粨 + int FrCol = 0; + string s = "鏄�"; + DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol); + } + } + catch (Exception e) + { + MessageBox.Show(e.Message + "DisplaySub"); + } + } } } \ No newline at end of file -- Gitblit v1.9.1