YL
2022-01-19 7f7c137e8c1d26bb777f3d5abd13866ad6fde28b
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -1423,7 +1423,7 @@
        public object DeltetMouldRepairWorkBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -1510,7 +1510,7 @@
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -1842,7 +1842,7 @@
        public object DeltetMouldRepairCheckBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairCheckBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldRepairCheckBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -2123,7 +2123,7 @@
        public object DeltetMouldConkBookBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -2394,7 +2394,7 @@
        public object DeltetMouldMaintainPlanBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -2995,7 +2995,7 @@
        public object DeltetSc_MouldDotCheckBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -3268,7 +3268,7 @@
        public object DeltetSc_MouldDotCheckPlanBillBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -3442,7 +3442,7 @@
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, true, msg4))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapRequestBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -3764,7 +3764,7 @@
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBillList", 1, true, user))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -3795,11 +3795,11 @@
            string sql1 = string.Format(@"select * from h_v_Sc_MouldScrapOutHouseBillList where 库存组织='" + Organization + "'");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 日期 desc", "h_v_Sc_MouldScrapOutHouseBillList");
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldScrapOutHouseBillList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by 日期 desc";
                string sql = sql1 + sWhere + "order by 制单日期 desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldScrapOutHouseBillList");
            }
        }
@@ -3899,7 +3899,7 @@
            try
            {
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, true, msg4))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -4034,7 +4034,7 @@
        public object DeltetMouldScrapOutHouseBill(string HInterID, string user)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Delete", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldScrapOutBill_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -4121,7 +4121,7 @@
        //    try
        //    {
        //        //审核权限
        //        if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName))
        //        if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
@@ -4250,7 +4250,7 @@
        {
            //flag=1 审核;  flag=2 反审核
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldScrapOutBill_Check", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldScrapOutBill_Check", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -4339,7 +4339,7 @@
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBillList", 1, true, user))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -4370,11 +4370,11 @@
            string sql1 = string.Format(@"select * from h_v_Sc_MouldProdBackBillList where 库存组织='" + Organization + "'");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 日期 desc", "h_v_Sc_MouldProdBackBillList");
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdBackBillList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by 日期 desc";
                string sql = sql1 + sWhere + "order by 制单日期 desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList");
            }
@@ -4414,7 +4414,7 @@
                {
                    ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo,
                                                设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, 
                                                单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID,
                                                单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID,
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList"), "h_v_Sc_MouldProdBackBillList");
                }
@@ -4424,7 +4424,7 @@
                    //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark  from Sc_MouldRepairCheckBillSub where 1 = 1 ";
                    string sql1 = string.Format(@"SELECT HMaterID,模具代码 HMaterCode,模具名称 HMaterName,规格型号 HMaterSpec,批次 HBatchNo,
                                                设计寿命 HDesignLife, 剩余寿命 HLeaveLife, 累积使用寿命 HUseLife, 应发数量 HQtyMust, 实发数量 HQty, 
                                                单价 HPrice, 金额 HMoney,HWHSonID HWHID, 发料仓库代码 HWHCode, 发料仓库 HWHName,HSPID,
                                                单价 HPrice, 金额 HMoney,收料仓库ID HWHID, 收料仓库代码 HWHCode, 收料仓库 HWHName,HSPID,
                                                仓位代码 HSPCode, 仓位 HSPName,表体备注 HRemark,HStockOrgID,HUnitID,计量单位代码,计量单位 FROM h_v_Sc_MouldProdBackBillList where 1 = 1 ");
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldProdBackBillList");
@@ -4432,8 +4432,8 @@
                }
                //查汇总
                ds1 = oCN.RunProcReturn(string.Format(@"select  物料代码,max(物料名称)物料名称,规格型号,max(单据号)单据号,批次,sum(实发数量)实发数量,
                                            HWHSonID,max(发料仓库代码)发料仓库代码,max(发料仓库)发料仓库,表体备注 from h_v_Sc_MouldProdBackBillList
                                            where 1=1 " + sqlWhere + " group by 物料代码,规格型号,HWHSonID,批次,表体备注"), "h_v_Sc_MouldProdBackBillList");
                                            收料仓库ID,max(收料仓库代码)收料仓库代码,max(收料仓库)收料仓库,表体备注 from h_v_Sc_MouldProdBackBillList
                                            where 1=1 " + sqlWhere + " group by 物料代码,规格型号,收料仓库ID,批次,表体备注"), "h_v_Sc_MouldProdBackBillList");
                list.Add(ds.Tables[0]);
                list.Add(ds1.Tables[0]);
@@ -4474,7 +4474,7 @@
            ListModels oListModels = new ListModels();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, true, msg4))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -4612,7 +4612,7 @@
        public object DeltetMouldProdBackBill(string HInterID, string user)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Delete", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdBackBill_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -4689,7 +4689,7 @@
        {
            //flag=1 审核;  flag=2 反审核
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdBackBill_Check", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdBackBill_Check", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -4777,7 +4777,7 @@
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBillList", 1, true, user))
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -4808,11 +4808,11 @@
            string sql1 = string.Format(@"select * from h_v_Sc_MouldProdOutHouseBillList where 库存组织='" + Organization + "'");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 日期 desc", "h_v_Sc_MouldProdOutHouseBillList");
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + "order by 制单日期 desc", "h_v_Sc_MouldProdOutHouseBillList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by 日期 desc";
                string sql = sql1 + sWhere + "order by 制单日期 desc";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MouldProdOutHouseBillList");
            }
@@ -4912,7 +4912,8 @@
            ListModels oListModels = new ListModels();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, true, msg4))
                //模块名,写入日志,报错框,用户名
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -5036,6 +5037,44 @@
        }
        #endregion
        //判断用户权限
        #region
        [Route("Sc_MouldProdOutBill/QueryUserRight")]
        [HttpPost]
        public object QueryUserRight(string UserName)
        {
            try
            {
                //模块名,写入日志,报错框,用户名
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Edit", 1, false, UserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查询权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "有权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch(Exception e1)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有查询权限," + e1.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region [模具处理领用单删除功能]
        /// <summary>
        /// 模具处理领用单删除功能
@@ -5046,7 +5085,7 @@
        public object DeltetMouldProdOutBill(string HInterID, string user)
        {
            //删除权限
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Delete", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -5120,10 +5159,9 @@
        [Route("Sc_MouldProdOutBill/AuditMouldProdOutBill")]
        [HttpGet]
        public object AuditMouldProdOutBill(string HInterID, string user, int flag)
        {
            //flag=1 审核;  flag=2 反审核
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdOutBill_Check", 1, true, user))
            if (!DBUtility.ClsPub.Security_Log("Sc_MouldProdOutBill_Check", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -5459,7 +5497,7 @@
        public object DeltetMouldLifeChangeBill(string HInterID)
        {
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBill_Delete", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;