From 990445751e7e7f65521d0413b7de4dc607e76e14 Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期三, 10 三月 2021 20:08:44 +0800 Subject: [PATCH] 1. 添加抽检周数配置 --- app.config | 1 + SizeDetection.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/SizeDetection.cs b/SizeDetection.cs index 5a5e868..2f5f8cb 100644 --- a/SizeDetection.cs +++ b/SizeDetection.cs @@ -656,6 +656,15 @@ { GregorianCalendar gc = new GregorianCalendar(); int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay, DayOfWeek.Monday); + + var weekPlusStr = ConfigurationManager.AppSettings["WeekPlus"]; + int weekPlus = 0; + if (!int.TryParse(weekPlusStr, out weekPlus)) + { + weekPlus = 0; + } + weekOfYear += weekPlus; + string week = weekOfYear.ToString().Length == 1 ? "0" + weekOfYear.ToString() : weekOfYear.ToString(); string year = dt.Year.ToString().Substring(dt.Year.ToString().Length - 1, 1); return year + week; diff --git a/app.config b/app.config index 32da9a1..ea53f7d 100644 --- a/app.config +++ b/app.config @@ -49,6 +49,7 @@ <add key="ContiousNGThreshold" value="3"/> <add key="EnableUploadMinutes" value="10"/> + <add key="WeekPlus" value="0"/> </appSettings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> -- Gitblit v1.8.0