/// <summary> /// 码申请处理申请工作 /// </summary> /// <param name="codeApply">码申请信息</param> /// <param name="ct"></param> public static void ApplyGenerateWork(CodeApply codeApply, CancellationToken ct) { CodeService.logger.Log(LogLevel.Info, $"处理码申请Id:{codeApply.ApplyId},申请工作"); #region 初始化码申请码规则处理表ApplyRuleProcess数据 //获取码规则ID int[] ruleIds = Array.ConvertAll <string, int>(codeApply.CodeRulesIDs.Split(new char[] { '|' }), int.Parse); //获取处理程序 List <ApplyRuleProcess> allApplyRuleProcess = ApplyRuleProcessFactory.Instance.GetCodeRuleByApplyId(codeApply.ApplyId); for (int i = 0; i < ruleIds.Length; i++) { if (allApplyRuleProcess.Count <= i) { //生成APPLY - RULE - PROCESSOR ApplyRuleProcess ruleProcess = new ApplyRuleProcess() { ApplyId = codeApply.ApplyId, CodeRuleId = ruleIds[i], Status = ApplyRuleStatus.None, AttributeInfo = string.Empty, EndCode = string.Empty, FirstCode = string.Empty }; ApplyRuleProcessFactory.Instance.Add(ruleProcess); } } #endregion ApplyProcesser applyProcess = new ApplyProcesser(codeApply); applyProcess.LoadData(); applyProcess.ApplyGenerate(); codeApply.ProcessType = ProcessType.Applied; CodeService.logger.Log(LogLevel.Info, $"完成码申请Id:{codeApply.ApplyId},申请工作"); }
/// <summary> /// 码申请存储码结果 /// </summary> /// <param name="codeApply">码申请信息</param> /// <param name="ct"></param> public static void ApplyCodesStore(CodeApply codeApply, CancellationToken ct) { CodeService.logger.Log(LogLevel.Info, $"处理码申请Id:{codeApply.ApplyId},存储码结果"); ApplyProcesser applyProcess = new ApplyProcesser(codeApply); applyProcess.LoadData(); applyProcess.CodesStore(); CodeService.logger.Log(LogLevel.Info, $"完成码申请Id:{codeApply.ApplyId},存储码结果"); }
/// <summary> /// 码申请保存单个码信息 /// </summary> /// <param name="codeApply">码申请信息</param> /// <param name="ct"></param> public static void ApplySaveBySingleCode(CodeApply codeApply, CancellationToken ct) { CodeService.logger.Log(LogLevel.Info, $"处理码申请Id:{codeApply.ApplyId},保存单个码信息"); ApplyProcesser applyProcess = new ApplyProcesser(codeApply); applyProcess.LoadData(); applyProcess.SaveBySingleCode(ct); CodeService.logger.Log(LogLevel.Info, $"完成码申请Id:{codeApply.ApplyId},保存单个码信息"); }
/// <summary> /// 码申请验证申请完成 /// </summary> /// <param name="codeApply">码申请信息</param> /// <param name="ct"></param> public static bool ApplyGenerateCompleted(CodeApply codeApply, CancellationToken ct) { CodeService.logger.Log(LogLevel.Info, $"处理码申请Id:{codeApply.ApplyId},验证申请完成工作"); ApplyProcesser applyProcess = new ApplyProcesser(codeApply); applyProcess.LoadData(); bool completed = applyProcess.GenerateCompleted(); CodeService.logger.Log(LogLevel.Info, $"完成码申请Id:{codeApply.ApplyId},验证申请完成工作"); return(completed); }