using DeviceRepair.Models; using NLog; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TsSFCDevice.Client.Biz.Base.Service; using TsSFCDevice.Client.Biz.Base.Utils; namespace TsSFCDevice.Client.Biz.Impl { public class SFCRepository { private readonly Logger log; private static SFCRepository manager; private IDictionary m_ApiParameters; /// /// API输入参数 /// public IDictionary ApiParameters { get { return m_ApiParameters; } set { m_ApiParameters = value; } } public static SFCRepository Instance { get { if (manager == null) manager = new SFCRepository(); return manager; } } public SFCRepository() { log = LogManager.GetCurrentClassLogger(); m_ApiParameters = new Dictionary(); } internal string GetParameters(string cOperator = "", bool bFlag = true) { return ParametersObject.GetInstance(cOperator).GetJsonSerialized(m_ApiParameters); } /// /// 判断批次是否存在 /// /// /// public bool GetBatchInfoToStaff(string Batch) { try { ApiParameters?.Clear(); ApiParameters.Add("Batch", Batch); bool BatchExists = false; var Rtn = Utility.SfcBizService.CurrentSvc.Get_BatchInfoToStaff_Exists(GetParameters(),out BatchExists); if (Rtn.Code != 1) { throw new Exception(Rtn.Message); } return BatchExists; } catch (Exception ex) { log.Error(ex.Message, ex); throw ex; } } } }