Browse Source

..

Branch_PaiNaWeiSJob
xusc 3 months ago
parent
commit
5936031a3f
  1. BIN
      .vs/ICSSoft.FromERP/v16/.suo
  2. 28
      ICSSoft.FromERP/Data/ICSHelper.cs
  3. 23
      ICSSoft.FromERP/SyncCas_Jinyang.cs

BIN
.vs/ICSSoft.FromERP/v16/.suo

Binary file not shown.

28
ICSSoft.FromERP/Data/ICSHelper.cs

@ -126,6 +126,15 @@ namespace ICSSoft.FromERP
log.Warn(name + "-内存占用:" + memoryUsed); log.Warn(name + "-内存占用:" + memoryUsed);
} }
/// <summary>
/// BS MES
/// </summary>
/// <param name="Namespace"></param>
/// <param name="ClassName"></param>
/// <param name="TenantId"></param>
/// <param name="sql"></param>
/// <param name="TempTableName"></param>
/// <returns></returns>
public static string Time(string Namespace, string ClassName, string TenantId, string sql, string TempTableName) public static string Time(string Namespace, string ClassName, string TenantId, string sql, string TempTableName)
{ {
try try
@ -157,6 +166,15 @@ WHERE Namespace='{0}' AND ClassName='{1}' AND TenantId='{2}'
} }
} }
/// <summary>
/// CS MES
/// </summary>
/// <param name="Namespace"></param>
/// <param name="Class"></param>
/// <param name="WorkPoint"></param>
/// <param name="sql"></param>
/// <param name="TempTableName"></param>
/// <returns></returns>
public static string Time4Old(string Namespace, string Class, string WorkPoint, string sql, string TempTableName) public static string Time4Old(string Namespace, string Class, string WorkPoint, string sql, string TempTableName)
{ {
try try
@ -399,6 +417,11 @@ WHERE Namespace='{0}' AND ClassName='{1}' AND TenantId='{2}'
} }
/// <summary>
/// BS MES
/// </summary>
/// <param name="conStr"></param>
/// <returns></returns>
public static DataTable GetERPDB(string conStr) public static DataTable GetERPDB(string conStr)
{ {
try try
@ -413,6 +436,11 @@ WHERE Namespace='{0}' AND ClassName='{1}' AND TenantId='{2}'
} }
} }
/// <summary>
/// CS MES
/// </summary>
/// <param name="conStr"></param>
/// <returns></returns>
public static DataTable GetOldERPDB(string conStr) public static DataTable GetOldERPDB(string conStr)
{ {
try try

23
ICSSoft.FromERP/SyncCas_Jinyang.cs

@ -66,7 +66,7 @@ DROP TABLE #tempSyncCas_Jinyang
select * ,a.CreateTime as MTime into #tempSyncCas_Jinyang from [ICSDomeAmb] a with( nolock) select * ,a.CreateTime as MTime into #tempSyncCas_Jinyang from [ICSDomeAmb] a with( nolock)
where a.CreateTime>=@LastTime
where a.CreateTime>@LastTime
select select
a.* a.*
@ -96,6 +96,7 @@ select * ,a.CreateTime as MTime into #tempSyncCas_Jinyang from [ICSDomeAmb] a wi
{ {
return; return;
} }
var insertSql = "";
foreach (DataRow item in resultDT.Rows) foreach (DataRow item in resultDT.Rows)
{ {
var input = new CapInputDto(); var input = new CapInputDto();
@ -110,9 +111,25 @@ select * ,a.CreateTime as MTime into #tempSyncCas_Jinyang from [ICSDomeAmb] a wi
list.Add(input); list.Add(input);
insertSql += @"
INSERT INTO [dbo].[ICSDomeAmb_cus]
([CreateTime]
,IPAddress
,UserCode
,[LotNO]
,[InvStd ]
,[EqCode]
,[Free1]
,[Free2]
)
values ('" + item["CreateTime"].ToString() + "','"+ item["IPAddress"].ToString() + "','"+ item["UserCode"].ToStringExt() + "','" + input.LotNo + "','" + input.ProductNo + "','" + input.EquipmentID + "','" + item["Free1"].ToStringExt() + "','"+ item["Free2"].ToStringExt() + "')";
} }
if (list.Count == 0)
{
log.Info("没有数据行");
return;
}
var inputObj = JsonConvert.SerializeObject(list); var inputObj = JsonConvert.SerializeObject(list);
//string url = ICSHelper.GetConfigString()["JinyangCapUrl"]+ @"?deipaaskeyauth=a5P1RTL4380zd9jpb57qXx63rdynUHN2"; //string url = ICSHelper.GetConfigString()["JinyangCapUrl"]+ @"?deipaaskeyauth=a5P1RTL4380zd9jpb57qXx63rdynUHN2";
string url = ICSHelper.GetConfigString()["JinyangCapUrl"]; string url = ICSHelper.GetConfigString()["JinyangCapUrl"];
@ -123,6 +140,8 @@ select * ,a.CreateTime as MTime into #tempSyncCas_Jinyang from [ICSDomeAmb] a wi
{ {
ICSHelper.ExecuteDate(conStr, insertSql);
} }
else else
{ {

Loading…
Cancel
Save