duhe
2024-03-02 f1b49e6d69ba09cc5fc874bcb6eb37d666f8adab
WebAPI/Controllers/Éú²ú¹ÜÀí/ÖÊÁ¿»ã±¨µ¥/Sc_QualityReportBillController.cs
@@ -262,7 +262,7 @@
            try
            {
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
                //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
@@ -281,7 +281,8 @@
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from  where hmainid=" + HItemID, "h_v_Sc_QualityReportBillListDetail");
                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";
@@ -319,7 +320,8 @@
                    return objJsonResult;
                }
                oCN.RunProc("delete from h_v_Sc_QualityReportBillListDetail where hmainid=" + HItemID);
                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;
@@ -383,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";
@@ -619,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);
                //判断是否允许保存,不允许则回滚
@@ -632,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 = "";