|
@@ -184,101 +184,15 @@ namespace wispro.sp.winClient
|
|
|
woman
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
private async void button3_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- await UserField2String();
|
|
|
- //share.Utility.UserConditionHelper.GetPropertyDescription<Staff>(typeof(PerformanceItem).AssemblyQualifiedName);
|
|
|
-
|
|
|
- #region Demo流程数据
|
|
|
- //HttpClient http = new HttpClient();
|
|
|
- //int wfId = 6;
|
|
|
- //var workflow = await GetWorkflow(wfId, http);
|
|
|
- //var Steps = await GetSteps(wfId, http);
|
|
|
- //var Actions = await GetActions(wfId, http);
|
|
|
- //var Transfers = await GetTransfers(wfId,http);
|
|
|
- #endregion
|
|
|
- //FlowChartUtility flowChart = new FlowChartUtility();
|
|
|
- //flowChart.workflow = workflow;
|
|
|
- //flowChart.Steps = Steps;
|
|
|
- //flowChart.Transfers = Transfers;
|
|
|
-
|
|
|
- //string strSvg = flowChart.GetSvgString();
|
|
|
-
|
|
|
- ////var file = System.IO.File.CreateText("c:\\temp\\tem.svg");
|
|
|
- ////file.WriteLine(strSvg);
|
|
|
- ////file.Close();
|
|
|
-
|
|
|
- //System.Xml.XmlDocument xmdoc = new System.Xml.XmlDocument();
|
|
|
- //xmdoc.LoadXml(strSvg);
|
|
|
- //Svg.SvgDocument svg = Svg.SvgDocument.Open(xmdoc);
|
|
|
- //Bitmap bitmap = svg.Draw();
|
|
|
- //bitmap.Save("c:\\temp\\test.jpg",ImageFormat.Jpeg);
|
|
|
- //MemoryStream mStream = new MemoryStream();
|
|
|
- //bitmap.Save(mStream, ImageFormat.Jpeg);
|
|
|
- //byte[] bitMaps = new byte[mStream.Length];
|
|
|
- //mStream.Read(bitMaps, 0, (int)mStream.Length);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //var test =wispro.sp.utility.EmunHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.LogicSymbols>();
|
|
|
-
|
|
|
- //Console.WriteLine("");
|
|
|
- //dynamic dynObj = new ExpandoObject();
|
|
|
- //dynObj.Name = "名称";
|
|
|
- //dynObj.Text = "aaabc";
|
|
|
-
|
|
|
-
|
|
|
- //List<dynamic> list = new List<dynamic>();
|
|
|
- //for(int i = 0; i < 3; i++)
|
|
|
- //{
|
|
|
- // dynamic d = new ExpandoObject();
|
|
|
- // d.Id = i + 1;
|
|
|
- // d.Filed1 = $"Field{i}";
|
|
|
- // d.Date = DateTime.Now.AddDays(i);
|
|
|
- // list.Add(d);
|
|
|
- //}
|
|
|
-
|
|
|
- //dynObj.List = list;
|
|
|
- //var temTxt = System.Text.Json.JsonSerializer.Serialize(dynObj);
|
|
|
-
|
|
|
- //var dynamic = System.Text.Json.JsonSerializer.Deserialize<ExpandoObject>(temTxt);
|
|
|
-
|
|
|
-
|
|
|
- //MessageBox.Show(((IDictionary<string, object>)dynamic)["Name"].ToString());
|
|
|
-
|
|
|
- //wispro.sp.utility.MailUtil.SendEmail("测试邮件标题","测试邮件内容","罗才洋","luocaiyang@139.com");
|
|
|
- //CreateAppealModel model = new CreateAppealModel();
|
|
|
- //HttpClient http = new HttpClient();
|
|
|
- //PerformanceItem item = await http.GetFromJsonAsync<wispro.sp.entity.PerformanceItem>($"{strAPIBaseUri}/api/PerformanceItem/Get?Id=7341");
|
|
|
- //List<AppealType> appealTypes = await http.GetFromJsonAsync<List<AppealType>>($"{strAPIBaseUri}/api/Appeal/GetAppealTypes");
|
|
|
- //var appealType = appealTypes.Where<AppealType>(a => a.Id == 1).FirstOrDefault();
|
|
|
- //await model.Init(item, appealType);
|
|
|
- ////await TestQueryFilter();
|
|
|
- //List<PerformanceItem> retList = new List<PerformanceItem>();
|
|
|
- //var test= retList.Where<PerformanceItem>(p => p.isDanger());
|
|
|
-
|
|
|
- //await InitRules(true);
|
|
|
-
|
|
|
- ////return;
|
|
|
+ await RefreshPerformanceItem();
|
|
|
|
|
|
//await ImportUsers();
|
|
|
//await InputPerformanceItem("c:\\temp\\21.01-21.11 工程师绩效报表-总表.xlsx", true, false, 0);
|
|
|
|
|
|
- ////CalMonth cal = new CalMonth()
|
|
|
- ////{
|
|
|
- //// Year = 2021,
|
|
|
- //// Month = 9,
|
|
|
- //// Status = 0
|
|
|
- ////};
|
|
|
-
|
|
|
- ////await InputPerformanceItem(@"C:\Users\luowen\Downloads\每月绩效统计--发客户超过一个月未完成案件.xlsx", true,false,1, cal);
|
|
|
-
|
|
|
- ////await InputPerformanceItem(@"C:\Users\luowen\Downloads\每月绩效统计--上个月递交完成案件.xlsx", true, false, 1, cal);
|
|
|
-
|
|
|
- ////await InputPerformanceItem(@"C:\Users\luowen\Downloads\每月绩效统计--中国一次OA授权表.xlsx", true, false, 1, cal,true);
|
|
|
-
|
|
|
- //MessageBox.Show("导入完成!");
|
|
|
}
|
|
|
|
|
|
private PerformanceItem Row2Item_1(DataRow row, List<Staff> Staffs, CalMonth calMonth)
|
|
@@ -620,6 +534,17 @@ namespace wispro.sp.winClient
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private async Task RefreshPerformanceItem()
|
|
|
+ {
|
|
|
+ if (Token == null)
|
|
|
+ {
|
|
|
+ await Login();
|
|
|
+ }
|
|
|
+
|
|
|
+ await RefreshItemAsync();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private async Task UserField2String()
|
|
|
{
|
|
|
if (Token == null)
|
|
@@ -895,7 +820,7 @@ namespace wispro.sp.winClient
|
|
|
return retStr;
|
|
|
}
|
|
|
|
|
|
- string strAPIBaseUri = "https://47.106.221.167"; //"http://localhost:39476";//
|
|
|
+ string strAPIBaseUri = "https://47.106.221.167"; // "http://localhost:39476";//
|
|
|
|
|
|
userToken Token;
|
|
|
public async Task Login()
|
|
@@ -1059,6 +984,16 @@ namespace wispro.sp.winClient
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private async Task<PerformanceItem> RefreshItemAsync()
|
|
|
+ {
|
|
|
+ HttpClient http = CreateHttp();
|
|
|
+ http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
|
|
|
+ var data = await http.GetFromJsonAsync<PerformanceItem>($"{strAPIBaseUri}/api/PerformanceItem/RefreshBasePoint");
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private async Task<List<Staff>> getReviewers(int itemId,int appealTypeId)
|
|
|
{
|
|
|
HttpClient http = CreateHttp();
|