From a2cbc7e236720685b9485b494ae2a642cad81f96 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 11 三月 2024 23:12:06 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/生产管理/质量汇报单/Sc_QualityReportBillController.cs | 131 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 130 insertions(+), 1 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 7748ef2..4b34ab8 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"
@@ -252,6 +252,95 @@
}
#endregion
+ #region 璐ㄩ噺姹囨姤鍗曞垪琛ㄥ垹闄ゆ寜閽�
+ [Route("DeltetSc_QualityReportBill")]
+ [HttpGet]
+ public object DeltetSc_QualityReportBill(long HItemID)
+ {
+ DataSet ds;
+ DataSet ds1;
+ try
+ {
+ //鍒犻櫎鏉冮檺
+ //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (HItemID == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where hmainid=" + HItemID, "Sc_QualityReportBillMain");
+ ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where hmainid=" + HItemID, "Sc_QualityReportBillSub");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+ //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+ //if (HStopflag)
+ //{
+ // oCN.RollBack();//鍥炴粴浜嬪姟
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //ds1 = oCN.RunProcReturn("Select HItemID from Sc_QualityReportBill Where HParentID='" + HItemID + "'", "Sc_QualityReportBill");
+ //if (ds1.Tables[0].Rows.Count != 0)
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰锛屼笉鑳藉垹闄わ紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
+ if (HUseFlag == "宸蹭娇鐢�")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ら」鐩凡浣跨敤锛屼笉鑳藉垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.RunProc("delete from Sc_QualityReportBillMain where hmainid=" + HItemID);
+ oCN.RunProc("delete from Sc_QualityReportBillSub where hmainid=" + HItemID);
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+ 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 璐ㄩ噺姹囨姤鍗曟壂涓嶈壇鏉$爜鑾峰彇涓嶈壇鍘熷洜id
[Route("Sc_QualityReportBill/get_HBadReasonID")]
[HttpGet]
@@ -296,7 +385,7 @@
{
oCN1.BeginTran();
//瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Check", 1, true, HChecker))
+ if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Check", 1, false, HChecker))
{
oCN1.RollBack();
objJsonResult.code = "0";
@@ -532,6 +621,26 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
bool bResult2 = false;
oCN.BeginTran();
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("exec h_p_Sc_QualityReportBill_BeforeSaveCtrl " + HInterID, "h_p_Sc_QualityReportBill_BeforeSaveCtrl");
+
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ 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;
+ }
+ //=========================================================
//淇濆瓨
oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID);
//鍒ゆ柇鏄惁鍏佽淇濆瓨锛屼笉鍏佽鍒欏洖婊�
@@ -545,6 +654,26 @@
objJsonResult.data = null;
return objJsonResult;
}
+ //淇濆瓨鍚庢帶鍒�=========================================
+ ds = oCN.RunProcReturn("exec h_p_Sc_QualityReportBill_AfterSaveCtrl " + HInterID, "h_p_Sc_QualityReportBill_AfterSaveCtrl");
+
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ 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;
+ }
+ //=========================================================
oCN.Commit();
//鑾峰彇鑷姩瀹℃牳鍙傛暟
string sReturn = "";
--
Gitblit v1.9.1