ch
2022-08-15 4bf3ca7fc8e3cceba62d6617724cac3cbc919746
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESReturnStepWorkBillController.cs
@@ -40,6 +40,7 @@
            {
                ds = Sc_GetMESReturnStepWorkBill(sWhere);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "返回记录成功!";
@@ -60,17 +61,52 @@
        {
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MESReturnWorkBillList_NEW ", "h_v_Sc_MESReturnWorkBillList_NEW");
                return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MESReturnWorkBillList_NEW order by hmainid desc ", "h_v_Sc_MESReturnWorkBillList_NEW");
            }
            else
            {
                string sql1 = "select * from h_v_Sc_MESReturnWorkBillList_NEW where 1 = 1 ";
                string sql = sql1 + sWhere;
                string sql = sql1 + sWhere+ " order by hmainid desc ";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Sc_MESReturnWorkBillList_NEW");
            }
        }
        #endregion
        #region èŽ·å–è¿”å·¥å·¥åºä¸‹æ‹‰æ¡†æ•°æ®(所有工序)
        [Route("Sc_MESReturnStepWorkBill/GetMESReturnStepSelectBill")]
        [HttpGet]
        public object GetMESReturnStepSelectBill()
        {
            try
            {
                ds = oCN.RunProcReturn("select HItemID,工序代码,工序名称   from h_v_Gy_ProcessList ", "h_v_Gy_ProcessList");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无工序数据,请维护!";
                    objJsonResult.data =null;
                }
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region[返工单编辑时获取表头数据]
@@ -101,7 +137,7 @@
        {
            DBUtility.ClsPub.CurUserName = UserName;
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Drop", 1, true, DBUtility.ClsPub.CurUserName))
            if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Drop", 1, false, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -183,19 +219,19 @@
        [HttpGet]
        public object AuditReturnStepProcessReportList(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "Sc_ProcessPlan_Check";
            string ModRightNameCheck = "Sc_ReturnStepProcess_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, true, 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;
                //}
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
@@ -330,7 +366,7 @@
            DBUtility.ClsPub.CurUserName = UserName;
            
            //保存权限
            if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Edit", 1, true, DBUtility.ClsPub.CurUserName))
            if (!DBUtility.ClsPub.Security_Log_second("Sc_ProcessPlan_Edit", 1, false, DBUtility.ClsPub.CurUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;