From 104deff01e0a756be9ea3a860e877a9a1d6d0e56 Mon Sep 17 00:00:00 2001 From: 仲国强 <519541279@qq.com> Date: 星期二, 31 八月 2021 14:28:13 +0800 Subject: [PATCH] 质量汇报保存 --- WebAPI/Controllers/生产管理/质量汇报单/Sc_QualityReportBillController.cs | 129 ++++++++++++++++++++++++++++++++---------- 1 files changed, 97 insertions(+), 32 deletions(-) diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" index 09dd0af..6e8ee3f 100644 --- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" +++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\350\264\250\351\207\217\346\261\207\346\212\245\345\215\225/Sc_QualityReportBillController.cs" @@ -133,7 +133,6 @@ string msg = sArray[0].ToString(); string OperationType = sArray[1].ToString().Trim(); bool bResult = false; - bool bResult2 = false; try { msg = "[" + msg.ToString() + "]"; @@ -156,8 +155,6 @@ { //鏄惁淇濆瓨 bResult = AddBillTmpSQL(mainList, ref ClsPub.sExeReturnInfo); - //鏄惁瀹℃牳 - bResult2 = set_CheckBill(mainList[0].HInterID, ref ClsPub.sExeReturnInfo); } else if (OperationType.Equals("3")) { @@ -171,23 +168,11 @@ //鏄惁淇濆瓨 if (bResult == true) { - //鏄惁瀹℃牳 - if (bResult2 == true) - { - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "鍗曟嵁瀛樼洏瀹屾瘯!鍗曟嵁鍙�:" + mainList[0].HBillNo.Trim(); - objJsonResult.data = null; - return objJsonResult; - } - else - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁瀛樼洏瀹屾瘯锛佽嚜鍔ㄥ鏍稿け璐ワ紝鍘熷洜:" + ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鎵爜淇濆瓨鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; } else { @@ -216,6 +201,7 @@ //鍥哄畾璧嬪��================================= BillNew.HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D BillNew.HBillNo = mainList[0].HBillNo; + BillNew.HBillType = mainList[0].HBillType; BillNew.HDate = mainList[0].HDate; BillNew.HICMOBillNo = mainList[0].HICMOBillNo; BillNew.HICMOInterID = mainList[0].HICMOInterID; @@ -231,28 +217,26 @@ BillNew.HBarCode = mainList[0].HBarCode; BillNew.HMaker = mainList[0].HMaker; BillNew.HMakeDate = mainList[0].HMakeDate; + BillNew.HReportType = mainList[0].HReportType; + BillNew.HSourceBillNo = mainList[0].HICMOBillNo; + BillNew.HSourceInterID = mainList[0].HICMOInterID; + BillNew.HSourceBillType = mainList[0].HSourceBillType; oCN.BeginTran(); - //涓昏〃 + //涓存椂琛� oCN.RunProc("Insert Into Sc_ICMOBillQualityStatus_Tmp " + " (HInterID,HBillNo,HDate,HICMOBillNo,HICMOInterID" + ",HProcExchBillNo,HProcExchInterID,HProcExchEntryID,HProcID,HMaterID" + ",HSourceID,HGroupID,HCheckManID,HBadReasonID,HBarCode" + - ",HMaker,HMakeDate" + + ",HMaker,HMakeDate,HBillType,HReportType,HSourceBillNo" + + ",HSourceInterID,HSourceBillType" + ") " + " values(" + BillNew.HInterID + ",'" + BillNew.HBillNo + "','" + BillNew.HDate + "','" + BillNew.HICMOBillNo + "'," + BillNew.HICMOInterID + ",'" + BillNew.HProcExchBillNo + "'," + BillNew.HProcExchInterID + "," + BillNew.HProcExchEntryID + "," + BillNew.HProcID + "," + BillNew.HMaterID + "," + BillNew.HSourceID + "," + BillNew.HGroupID + "," + BillNew.HCheckManID + "," + BillNew.HBadReasonID + ",'" + BillNew.HBarCode + "'" + - ",'" + BillNew.HMaker + "','" + BillNew.HMakeDate + "'" + + ",'" + BillNew.HMaker + "','" + BillNew.HMakeDate + "','" + BillNew.HBillType + "','" + +BillNew.HReportType + "','" +BillNew.HSourceBillNo + "'" + + "," + BillNew.HSourceInterID + ",'" + BillNew.HSourceBillType + "'" + ") "); - //鍒ゆ柇鏄惁鍏佽淇濆瓨 - ds = oCN.RunProcReturn("exec h_p_JIT_ICMOBillQualityStatus_SaveCtrl", "h_p_JIT_ICMOBillQualityStatus_SaveCtrl"); - if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") - { - sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); - oCN.RollBack(); - return false; - } - sReturn = "鏂板鍗曟嵁鎴愬姛锛�"; + sReturn = "鎵爜鎴愬姛锛�"; oCN.Commit(); return true; } @@ -418,5 +402,86 @@ } } #endregion + + #region 鍒犻櫎鎵弿璁板綍琛� + [Route("Sc_QualityReportBill/del_BarCodeDetail")] + [HttpGet] + public object del_BarCodeDetail(long HItemID) + { + try + { + oCN.RunProc("delete from Sc_ICMOBillQualityStatus_Tmp where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鎻愪氦淇濆瓨锛屽瓨涓诲瓙琛ㄥ強鏄庣粏琛� + [Route("Sc_QualityReportBill/set_SaveBill")] + [HttpGet] + public object set_SaveBill(long HInterID) + { + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + bool bResult2 = false; + oCN.BeginTran(); + oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID); + //鍒ゆ柇鏄惁鍏佽淇濆瓨 + ds = oCN.RunProcReturn("exec h_p_JIT_ICMOBillQualityStatus_SaveCtrl", "h_p_JIT_ICMOBillQualityStatus_SaveCtrl"); + if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + //鏄惁瀹℃牳 + bResult2 = set_CheckBill(HInterID, ref ClsPub.sExeReturnInfo); + //鏄惁瀹℃牳 + if (bResult2 == true) + { + oCN.Commit(); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍗曟嵁淇濆瓨鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁瀛樼洏瀹屾瘯锛佽嚜鍔ㄥ鏍稿け璐ワ紝鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion } } \ No newline at end of file -- Gitblit v1.9.1