杨乐
2022-02-10 777db38816776abbe4b864d26a6c0381b75e8f9d
WebAPI/Controllers/BaseSet/Gy_ModelTypeController.cs
@@ -42,7 +42,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere, "Gy_MouldType");
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_MouldType where 1=1 " + sWhere+ " order by HNumber", "Gy_MouldType");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -231,11 +231,11 @@
                bool HEndFlag = list[0].HEndFlag;
                //判断权限
                if (!ClsPub.Security_Log(msg4, 1, false, msg3))
                if (!DBUtility.ClsPub.Security_Log(msg4, 1, false, msg3))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有找到该功能模块!";
                    objJsonResult.Message = "没有保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -316,11 +316,11 @@
                string HUseFlag = list[0].HUseFlag;
                //判断权限
                if (!ClsPub.Security_Log(msg5, 1, false, msg4))
                if (!DBUtility.ClsPub.Security_Log(msg5, 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有找到该功能模块!";
                    objJsonResult.Message = "没有保存权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -439,188 +439,6 @@
        }
        #endregion
        //#region [模具分类审核、反审核]
        //[Route("Gy_ModelType/ModelTypeCheck")]
        //[HttpGet]
        //public object ModelTypeCheck(int HInterID, int IsAudit, string CurUserName)
        //{
        //    string ModRightNameCheck = "Gy_MouldType_Check";
        //    DBUtility.ClsPub.CurUserName = CurUserName;
        //    try
        //    {
        //        //审核权限
        //        if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "审核失败!无权限!";
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        if (HInterID <= 0)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "HInterID小于0!";
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        Int64 lngBillKey = 0;
        //        lngBillKey = DBUtility.ClsPub.isLong(HInterID);
        //        ds = oCN.RunProcReturn("Select * from Gy_MouldType Where HItemID=" + lngBillKey.ToString(), "Gy_MouldType");
        //        if (ds.Tables[0].Rows.Count != 0)
        //        {
        //            string HCloseMan = ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
        //            string HDeleteMan = ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
        //            string HChecker = ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
        //            if (HCloseMan.Trim() != "")
        //            {
        //                objJsonResult.code = "0";
        //                objJsonResult.count = 0;
        //                objJsonResult.Message = "单据已关闭!不能再次审核!";
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //            if (HDeleteMan.Trim() != "")
        //            {
        //                objJsonResult.code = "0";
        //                objJsonResult.count = 0;
        //                objJsonResult.Message = "单据已作废!不能再次审核!";
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //            if (IsAudit == 0)  //审核判断
        //            {
        //                if (HChecker.Trim() != "")
        //                {
        //                    objJsonResult.code = "0";
        //                    objJsonResult.count = 0;
        //                    objJsonResult.Message = "单据已审核!不能再次审核!";
        //                    objJsonResult.data = null;
        //                    return objJsonResult;
        //                }
        //            }
        //            if (IsAudit == 1) //反审核判断
        //            {
        //                if (HChecker.Trim() == "")
        //                {
        //                    objJsonResult.code = "0";
        //                    objJsonResult.count = 0;
        //                    objJsonResult.Message = "单据未审核!不需要反审核!";
        //                    objJsonResult.data = null;
        //                    return objJsonResult;
        //                }
        //            }
        //        }
        //        else
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        if (IsAudit == 0) //审核提交
        //        {
        //            //审核提交
        //            if (CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
        //            {
        //                objJsonResult.code = "1";
        //                objJsonResult.count = 1;
        //                objJsonResult.Message = "审核成功";
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //            else
        //            {
        //                objJsonResult.code = "0";
        //                objJsonResult.count = 0;
        //                objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //        }
        //        if (IsAudit == 1) //反审核提交
        //        {
        //            //反审核提交AbandonCheck
        //            if (AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
        //            {
        //                objJsonResult.code = "1";
        //                objJsonResult.count = 1;
        //                objJsonResult.Message = "反审核成功";
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //            else
        //            {
        //                objJsonResult.code = "0";
        //                objJsonResult.count = 0;
        //                objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
        //                objJsonResult.data = null;
        //                return objJsonResult;
        //            }
        //        }
        //        return objJsonResult;
        //    }
        //    catch (Exception e)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        ////审核
        //public bool CheckBill(Int64 lngBillKey, ref string sReturn)
        //{
        //    //模具档案有案例
        //    try
        //    {
        //        string HChecker = DBUtility.ClsPub.CurUserName;
        //        string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
        //        oCN.BeginTran();
        //        oCN.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
        //        oCN.Commit();
        //        //生成调拨单
        //        //得到调拨单 mainid 单据号
        //        //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo);
        //        //string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//得到新单号
        //        //oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'");
        //        //
        //        sReturn = "审核单据成功!";
        //        return true;
        //    }
        //    catch (Exception e)
        //    {
        //        sReturn = e.Message;
        //        throw (e);
        //    }
        //}
        ////反审核
        //public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
        //{
        //    try
        //    {
        //        string HChecker = DBUtility.ClsPub.CurUserName;
        //        string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
        //        oCN.BeginTran();
        //        //还原单据状态为未审核状态
        //        oCN.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
        //        sReturn = "反审核单据成功!";
        //        oCN.Commit();
        //        return true;
        //    }
        //    catch (Exception e)
        //    {
        //        sReturn = e.Message;
        //        throw (e);
        //    }
        //}
        //#endregion
    }
}