yxj
2024-06-18 d3473e15fd14ea84a1378f3d3841bcad16c2d9f3
WebAPI/Controllers/XSGL/Xs_ReceivableBillController.cs
@@ -38,14 +38,14 @@
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                //if (!DBUtility.ClsPub.Security_Log("Xs_ReceivableBill_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log("Xs_ReceivableBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
@@ -105,14 +105,14 @@
            try
            {
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Xs_ReceivableBill_Edit", 1, false, msg4))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无保存权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log_second("Xs_ReceivableBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsXs_ReceivableBill oBill = new DAL.ClsXs_ReceivableBill();
                List<Model.ClsXs_ReceivableBillMain> lsmain = new List<Model.ClsXs_ReceivableBillMain>();
@@ -205,6 +205,17 @@
                    oBill.DetailColl.Add(oItemSub);
                }
                //进行 会计期间 结账 的判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                //保存
@@ -301,14 +312,14 @@
                string s = "";
                //查看权限
                //if (!DBUtility.ClsPub.Security_Log("Xs_ReceivableBill_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log("Xs_ReceivableBill_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID == null || HInterID.Equals(""))
                {
@@ -357,11 +368,34 @@
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                ////==================================================================================
                ////==================================================================================
                //进行 会计期间 结账 的判断和控制
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = DateTime.Now;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.Message = s;
                    return objJsonResult;
                }
                oCN.BeginTran();
                ds = oCN.RunProcReturn("select * from h_v_Xs_ReceivableBillList_Query where hmainid=" + HInterID, "h_v_Xs_ReceivableBillList_Query");
                string hSourceBillType = ds.Tables[0].Rows[0]["HSourceBillType"].ToString();
                if (hSourceBillType == "1401")
                {
                    //应收单 删除回填 销售订单 关联数量
                    oCN.RunProc("exec h_p_Xs_UpDateRelation_SeOrderToPOStockIn_Del " + HInterID);
                }
                else if (hSourceBillType == "1205")
                {
                    //应收单 删除回填 销售出库单 关联数量
                    oCN.RunProc("exec h_p_Xs_UpDateRelation_ICStockoPOStockIn_Del    " + HInterID);
                }
                oCN.RunProc("delete from Xs_ReceivableBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Xs_ReceivableBillSub where HInterID= " + HInterID);
@@ -427,14 +461,14 @@
            try
            {
                //审核权限
                //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "审核失败!无权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {
@@ -505,6 +539,17 @@
                //进行需要进行的审核/反审核操作
                if (IsAudit == 0) //审核提交
                {
                    //进行 会计期间 结账 的判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    oCN.BeginTran();
                    //记录返回信息
@@ -581,6 +626,17 @@
                    //}
                    ////===========================================================          
                    //进行 会计期间 结账 的判断和控制
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    DateTime HDate = DateTime.Now;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                    {
                        objJsonResult.Message = s;
                        return objJsonResult;
                    }
                    //反审核提交AbandonCheck
                    //if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Xs_ReceivableBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo) == true)
@@ -631,14 +687,14 @@
            try
            {
                //检查权限
                //if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "关闭失败!无权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "关闭失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                if (HInterID <= 0)
                {