yxj
2024-05-08 2ec46c24c2f4adf1d431e356a7ca4ade0a9ed52c
WebAPI/Controllers/SBGL/Sb_EquipDotCheckPlanBillController.cs
@@ -380,7 +380,7 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select 点检项目ID  HDotCheckItemID,点检项目代码  HDotCheckCode ,点检项目 HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人代码 HManagerCode,负责人 HManagerName from h_v_Sb_EquipDotCheckPlanBillList", "h_v_Sb_EquipDotCheckPlanBillList");
                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckPlanBill_Edit", "h_v_Sb_EquipDotCheckPlanBill_Edit");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
@@ -388,9 +388,9 @@
                }
                else
                {
                    string sql1 = "select 点检项目ID  HDotCheckItemID,点检项目代码  HDotCheckCode ,点检项目 HDotCheckItem,点检部位 HDotCheckPart ,具体要求 HClaim,表体备注 HRemark,负责人ID HManagerID,负责人代码 HManagerCode,负责人 HManagerName from h_v_Sb_EquipDotCheckPlanBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_Sb_EquipDotCheckPlanBill_Edit where 1 = 1 ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBillList");
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckPlanBill_Edit");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
@@ -490,6 +490,7 @@
        [HttpGet]
        public object CheckSb_EquipMaintainRuleBill(string HInterID, int Type, string user)
        {
            string sql = "";
            try
            {
                //判断是否有删除权限
@@ -512,12 +513,46 @@
                }
                ClsPub.CurUserName = user;
                ds = oCN.RunProcReturn("select * from Sb_EquipDotCheckPlanBillMain where HInterID = " + int.Parse(HInterID), "Sb_EquipDotCheckPlanBillMain");
                string HBillNo = "";
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                }
                oCN.BeginTran();//开始事务
                //Type 1 审核  2  反审核
                if (Type == 1)
                {
                    if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    //审核前控制
                    sql = "exec h_p_Sb_EquipDotCheckBill_BeforeCheckCtrl  " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipDotCheckBill_BeforeCheckCtrl ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (!BillOld.CheckBill(int.Parse(HInterID), HBillNo, "h_p_Sb_EquipDotCheckBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -530,7 +565,28 @@
                }
                else
                {
                    if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    //反审核前控制
                    sql = "exec  h_p_Sb_EquipDotCheckBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipDotCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (BillOld.AbandonCheck(int.Parse(HInterID), HBillNo, " h_p_Sb_EquipDotCheckBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                    }