Commit 1306443d by Neo Turing

优化

parent 78eaef0d
...@@ -49,7 +49,7 @@ namespace Kivii.Third.Bestseller.Entities ...@@ -49,7 +49,7 @@ namespace Kivii.Third.Bestseller.Entities
rtns.PayerName = order.PAYER_ORG_NAME; rtns.PayerName = order.PAYER_ORG_NAME;
rtns.SampleName = order.SAMPLE_NAME; rtns.SampleName = order.PRD_NAME_CN;//order.SAMPLE_NAME;
rtns.SampleBrand = order.BRAND_DISPLAY; rtns.SampleBrand = order.BRAND_DISPLAY;
rtns.SampleGradeSafety = order.CHECK_LEVEL_DISPLAY; rtns.SampleGradeSafety = order.CHECK_LEVEL_DISPLAY;
rtns.SampleGrade = order.SAMPLE_GRADE_DISPLAY; rtns.SampleGrade = order.SAMPLE_GRADE_DISPLAY;
...@@ -110,14 +110,14 @@ namespace Kivii.Third.Bestseller.Entities ...@@ -110,14 +110,14 @@ namespace Kivii.Third.Bestseller.Entities
var results = response.data.results.AcceptThirdContractOrder(Guid.Parse(Configs._ownerKvid), Configs._ownerName, conn); var results = response.data.results.AcceptThirdContractOrder(Guid.Parse(Configs._ownerKvid), Configs._ownerName, conn);
try //try
{ //{
foreach (var item in results) // foreach (var item in results)
{ // {
client.AcceptOrderConfirm(Configs._token, Configs._secret, item.SerialNumber); // client.AcceptOrderConfirm(Configs._token, Configs._secret, item.SerialNumber);
} // }
} //}
catch { } //catch { }
rtns.Results.AddRange(results); rtns.Results.AddRange(results);
rtns.Total = rtns.Results.Count; rtns.Total = rtns.Results.Count;
......
...@@ -8,6 +8,7 @@ using System.Collections.Generic; ...@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Data; using System.Data;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Net.Sockets;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
...@@ -73,11 +74,11 @@ namespace Kivii.Third.Bestseller.Extensions ...@@ -73,11 +74,11 @@ namespace Kivii.Third.Bestseller.Extensions
/// <param name="appsecret"></param> /// <param name="appsecret"></param>
/// <param name="orderNo"></param> /// <param name="orderNo"></param>
/// <returns></returns> /// <returns></returns>
public static OrderResponse AcceptOrderConfirm(this JsonHttpClient _client, string apptoken, string appsecret, string orderNo) public static OrderResponse AcceptOrderConfirm(this JsonHttpClient _client, string orderNo, string apptoken=null, string appsecret = null)
{ {
(_client == null).ThrowIfTrue("AcceptOrderConfirm:请传入_client"); (_client == null).ThrowIfTrue("AcceptOrderConfirm:请传入_client");
(apptoken.IsNullOrEmpty()).ThrowIfTrue("AcceptOrderConfirm:请传入apptoken"); if (apptoken.IsNullOrEmpty()) apptoken = Configs._token;//.ThrowIfTrue("AcceptOrderConfirm:请传入apptoken");
(appsecret.IsNullOrEmpty()).ThrowIfTrue("AcceptOrderConfirm:请传入appsecret"); if (appsecret.IsNullOrEmpty()) appsecret = Configs._secret;//.ThrowIfTrue("AcceptOrderConfirm:请传入appsecret");
(orderNo.IsNullOrEmpty()).ThrowIfTrue("AcceptOrderConfirm:请传入orderNo"); (orderNo.IsNullOrEmpty()).ThrowIfTrue("AcceptOrderConfirm:请传入orderNo");
//var client = new JsonServiceClient(baseUrl); //var client = new JsonServiceClient(baseUrl);
...@@ -301,6 +302,8 @@ namespace Kivii.Third.Bestseller.Extensions ...@@ -301,6 +302,8 @@ namespace Kivii.Third.Bestseller.Extensions
var allReports = conn.Select(queryReports); var allReports = conn.Select(queryReports);
if (allReports.IsNullOrEmpty()) return; if (allReports.IsNullOrEmpty()) return;
var client = new JsonHttpClient(Configs._defaultUrl);
foreach (var third in thirds) foreach (var third in thirds)
{ {
var reports = allReports.Where(o => o.BizId == third.SerialNumber).ToList(); var reports = allReports.Where(o => o.BizId == third.SerialNumber).ToList();
...@@ -359,6 +362,12 @@ namespace Kivii.Third.Bestseller.Extensions ...@@ -359,6 +362,12 @@ namespace Kivii.Third.Bestseller.Extensions
third.IsAccepted = true; third.IsAccepted = true;
third.AddOnlyProperties(o => o.IsAccepted); third.AddOnlyProperties(o => o.IsAccepted);
conn.UpdateOnly(third); conn.UpdateOnly(third);
try
{
client.AcceptOrderConfirm(third.SerialNumber, Configs._token, Configs._secret);
}
catch { }
} }
} }
......
...@@ -69,14 +69,14 @@ namespace Kivii.Third.Bestseller.Jobs ...@@ -69,14 +69,14 @@ namespace Kivii.Third.Bestseller.Jobs
var results = response.data.results.AcceptThirdContractOrder(ownerKvid, ownerName, conn); var results = response.data.results.AcceptThirdContractOrder(ownerKvid, ownerName, conn);
TaskContext.Message = $"新增{results.Count}条!"; TaskContext.Message = $"新增{results.Count}条!";
try //try
{ //{
foreach (var item in results) // foreach (var item in results)
{ // {
client.AcceptOrderConfirm(token, secret, item.SerialNumber); // client.AcceptOrderConfirm(token, secret, item.SerialNumber);
} // }
} //}
catch { } //catch { }
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -33,5 +33,5 @@ using System.Runtime.InteropServices; ...@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.2024.10220")] [assembly: AssemblyVersion("5.4.2024.10280")]
[assembly: AssemblyFileVersion("5.4.2024.10220")] [assembly: AssemblyFileVersion("5.4.2024.10280")]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment