1
llj
2026-03-04 69967cc5f88abdf438f8072762d64a68eae66bb9
WebAPI/Controllers/ÎïÁ÷¹ÜÀí/³öÔ˵¥/WLYayBillController.cs
@@ -31,7 +31,7 @@
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Query", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log("WLYayBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -269,7 +269,7 @@
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
                if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -365,11 +365,11 @@
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
                if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_SupConfirm", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.Message = "确认失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -424,7 +424,7 @@
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_Supplier_Check", 1, false, CurUserName))
                if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -438,7 +438,15 @@
                oCN.BeginTran();
                if (IsAudit == 1)
                {
                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDate_AllocationDriver"].ToString() == "")
                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "到场确认失败!无权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDate_AllocationDriver"].ToString() == ""|| ds.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "" || ds.Tables[0].Rows[0]["HDriverID"].ToString() == "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -450,6 +458,22 @@
                }
                else if (IsAudit == 2)
                {
                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "到场确认失败!无权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_pickConfirm", 1, false, CurUserName))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "提货失败!无权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HSurer_Arrive"] == null)
                    {
                        objJsonResult.code = "0";
@@ -463,7 +487,15 @@
                }
                else if (IsAudit == 3)
                {
                    if (ds.Tables[0].Rows[0]["HSurer_Pick"] == null || ds.Tables[0].Rows[0]["HSurer_Pick"].ToString() == "")
                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_tranConfirm", 1, false, CurUserName))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "出厂运输失败!无权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HSurer_Pick"] == null || ds.Tables[0].Rows[0]["HSurer_Pick"].ToString() == "" )
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -476,6 +508,14 @@
                }
                else if (IsAudit == 4)
                {
                    if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_receiveConfirm", 1, false, CurUserName))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "签收失败!无权限!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HSurer_Trans"] == null || ds.Tables[0].Rows[0]["HSurer_Trans"].ToString() == "")
                    {
                        objJsonResult.code = "0";
@@ -527,9 +567,17 @@
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("WLYayBill_SelectDriver", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DataSet ds;
                var dss = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain");
                if (dss.Tables[0].Rows[0]["HDate_CarrierSure"] == null || dss.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "")
                if (dss.Tables[0].Rows[0]["HDate_CarrierSure"] == null || dss.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "" || dss.Tables[0].Rows[0]["HChecker"].ToString() == "" || dss.Tables[0].Rows[0]["HDate_CarrierSure"] == "2000-01-01 00:00:00.000")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -599,10 +647,83 @@
        #endregion
        [Route("WLYayBillController/deleteBill")]
        [HttpGet]
        public object deleteBill(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("WLYayBill_Delete", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (string.IsNullOrWhiteSpace(HItemID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HItemID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HItemID, "WL_YayBillMain");
                DataSet dds = oCN.RunProcReturn("select * from WL_YayBillSub_Material where HInterID=" + HItemID, "WL_YayBillSub_Material");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete WL_YayBillMain where HInterID=" + HItemID);
                if (dds != null || dds.Tables[0].Rows.Count != 0)
                {
                    oCN.RunProc("delete WL_YayBillSub_Material where HInterID=" + HItemID);
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "数据删除成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        [Route("WLYayBillController/updateBillMEs")]
        [HttpGet]
        public object updateBillMEs(int HInterID,int HEntryID, int ScatteredVolume, string CurUserName)
        {
            //删除权限
            if (!DBUtility.ClsPub.Security_Log("WLYayBill_ScatteredVolume", 1, false, CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            var ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID, "WL_YayBillMain");
            if (ds != null || ds.Tables[0].Rows.Count <= 0)
            {