yxj
2024-06-18 951587f554b2daabb19f969d17811b7bfedf6b44
WebAPI/Controllers/SCGL/Sc_MaterToSourceBillController.cs
@@ -40,13 +40,13 @@
            {
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillList " + sWhere, "h_v_Sc_MaterToSourceBillList");
                    ds = oCN.RunProcReturn("select * from h_v_Sc_MaterToSourceBillMain " + sWhere, "h_v_Sc_MaterToSourceBillMain");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_MaterToSourceBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_Sc_MaterToSourceBillMain where 1 = 1 ";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillList");
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MaterToSourceBillMain");
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
@@ -132,6 +132,87 @@
                objJsonResult.data = null;
            }
            return objJsonResult;
        }
        #endregion
        #region [上料防错单删除功能]
        /// <summary>
        /// 开工单删除功能
        /// </summary>
        /// <returns></returns>
        [Route("Sc_MaterToSourceBill/DeltetMaterToSourceBill")]
        [HttpGet]
        public object DeltetMaterToSourceBill(string HInterID, string UserName)
        {
            DBUtility.ClsPub.CurUserName = UserName;
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Delete", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无删除权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                if (oBill.omodel.HBillStatus > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
@@ -338,7 +419,7 @@
            string refSav = sArray[2].ToString();
            //保存权限
            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Edit", 1, true, DBUtility.ClsPub.CurUserName))
            //if (!DBUtility.ClsPub.Security_Log("MES_MaterToSourceBill_Edit", 1, false, DBUtility.ClsPub.CurUserName))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
@@ -515,6 +596,7 @@
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //返回主ID
                    objJsonResult.Verify = "N";
                }
                if (bResult)
@@ -563,7 +645,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;