挤出批号修改 erp接口另起线程调用
This commit is contained in:
@@ -11,6 +11,6 @@ namespace Tnb.BasicData.Interfaces
|
||||
/// <param name="id"></param>
|
||||
/// <param name="send_type">手动 自动</param>
|
||||
/// <returns></returns>
|
||||
Task<ThirdResult> Send(List<ThirdWebapiRecord> records, string send_type,ISqlSugarClient db=null);
|
||||
Task<ThirdResult> Send(List<ThirdWebapiRecord> records, string send_type,ISqlSugarClient db=null,bool ThreadFlag = true);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace Tnb.BasicData
|
||||
public async Task<string> Send(string id)
|
||||
{
|
||||
ThirdWebapiRecord record = await _repository.GetSingleAsync(x=>x.id==id);
|
||||
ThirdResult thirdResult = await Send(Arrays.AsList(record), "手动");
|
||||
ThirdResult thirdResult = await Send(Arrays.AsList(record), "手动",null,false);
|
||||
return thirdResult.msgResult;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,25 @@ namespace Tnb.BasicData
|
||||
return "失败";
|
||||
}
|
||||
|
||||
public async Task<ThirdResult> Send(List<ThirdWebapiRecord> records, string send_type,ISqlSugarClient db=null)
|
||||
public async Task<ThirdResult> Send(List<ThirdWebapiRecord> records, string send_type,ISqlSugarClient db=null,bool threadFlag=true)
|
||||
{
|
||||
ThirdResult thirdResult = new ThirdResult();
|
||||
if (threadFlag)
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
Send(records, send_type, db);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
thirdResult = await Send(records, send_type, db);
|
||||
}
|
||||
|
||||
return thirdResult;
|
||||
}
|
||||
|
||||
private async Task<ThirdResult> Send(List<ThirdWebapiRecord> records, string send_type, ISqlSugarClient db = null)
|
||||
{
|
||||
ThirdResult thirdResult = null;
|
||||
bool tranFlag = true;
|
||||
@@ -273,8 +291,6 @@ namespace Tnb.BasicData
|
||||
Log.Error(e.Message,e);
|
||||
if(tranFlag) await db.Ado.RollbackTranAsync();
|
||||
}
|
||||
|
||||
|
||||
return thirdResult;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user