YL
2022-02-07 2f21e4d7ef8c407e67a2f9880a0a6af3ad2e354f
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_QualityReportStepBillController.cs
@@ -26,10 +26,20 @@
        #region è¿”回生产质量汇报单列表
        [Route("Sc_QualityReportStepBill/list")]
        [HttpGet]
        public object list(string sWhere)
        public object list(string sWhere,string user)
        {
            try
            {
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_QualityReportBillListDetail " + sWhere, "h_v_Sc_QualityReportBillListDetail");
@@ -259,21 +269,21 @@
        #region è´¨é‡æ±‡æŠ¥å•列表删除按钮
        [Route("Sc_QualityReportStepBill/DeltetSc_QualityReportBill")]
        [HttpGet]
        public object DeltetSc_QualityReportBill(long HItemID)
        public object DeltetSc_QualityReportBill(long HItemID,string user)
        {
            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;
                //}
                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (HItemID == 0)
@@ -285,8 +295,8 @@
                    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");
                ds = oCN.RunProcReturn("select * from Sc_QualityReportBillMain where HInterID=" + HItemID, "Sc_QualityReportBillMain");
                ds1 = oCN.RunProcReturn("select * from Sc_QualityReportBillSub where HInterID=" + HItemID, "Sc_QualityReportBillSub");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -314,18 +324,18 @@
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
                if (HUseFlag == "已使用")
                string HBillStatus = Convert.ToString(ds.Tables[0].Rows[0]["HBillStatus"]);
                if (HBillStatus == "2")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此项目已使用,不能删除!";
                    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.RunProc("delete from Sc_QualityReportBillMain where HInterID=" + HItemID);
                oCN.RunProc("delete from Sc_QualityReportBillSub where HInterID=" + HItemID);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -622,6 +632,16 @@
        {
            try
            {
                //判断是否有编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Edit", 1, false, HChecker))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限编辑!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                bool bResult2 = false;
                oCN.BeginTran();