1
cwjbxqmz
2024-02-20 a590bd43dd6b33ebf328b8768fa60f0441aaf4ac
WebAPI/Controllers/Æ·ÖʹÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBillController.cs
@@ -190,7 +190,52 @@
                if (IsAudit == 0)  //审核判断
                {
                    //审核前控制
                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_QC_ProcessCheckBill_BeforeCheckCtrl ");
                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    oCN.RunProc("update QC_ProcessCheckBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID);
                    //审核后控制
                    DataSet EndDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_AfterCheckCtrl  " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + CurUserName + "'", "h_p_QC_ProcessCheckBill_AfterCheckCtrl");
                    if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核后判断失败!";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "审核失败!" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
@@ -199,7 +244,53 @@
                }
                if (IsAudit == 1) //反审核判断
                {
                    //反审核前控制
                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_QC_ProcessCheckBill_BeforeUnCheckCtrl");
                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    oCN.RunProc("update QC_ProcessCheckBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID);
                    //反审核后控制
                    DataSet EndDs = oCN.RunProcReturn("Exec  h_p_QC_ProcessCheckBill_AfterUnCheckCtrl  " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + CurUserName + "'", " h_p_QC_ProcessCheckBill_AfterUnCheckCtrl");
                    if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核后判断失败!";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    else
                    {
                        if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "反审核失败!" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]);
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
@@ -980,8 +1071,30 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from QC_ProcessCheckBillMain where HInterID=" + HItemID, "QC_ProcessCheckBillMain");
                //删除前控制
                DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_ProcessCheckBill_BeforeDelCtrl   " + HItemID.ToString() + ",'" + user + "'", "h_p_QC_ProcessCheckBill_BeforeDelCtrl");
                if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "删除前判断失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (BillOld.DeleteBill(HItemID, ref ClsPub.sExeReturnInfo) != true)
                if (BillOld.DeleteBill(HItemID, ds.Tables[0].Rows[0]["HBillNo"].ToString(), "h_p_QC_ProcessCheckBill_AfterDelCtrl", user, ref ClsPub.sExeReturnInfo) != true)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;