|
|
@ -409,51 +409,18 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
|
[UnitOfWork(false)] |
|
|
|
public async Task<bool> WmsJitOutPutPass(WmsJitRequestDto input) |
|
|
|
{ |
|
|
|
if (input.Guids != null) |
|
|
|
{ |
|
|
|
|
|
|
|
var sql = "DECLARE @return_value int\n" + |
|
|
|
"EXEC @return_value = [dbo].[p_wms_output]\n" + |
|
|
|
" @billnum = N'{0}',\n" + |
|
|
|
" @type = 0\n" + |
|
|
|
" @type = 0,\n" + |
|
|
|
" @date = N'{1}'\n"+ |
|
|
|
"SELECT 'Return Value' = @return_value"; |
|
|
|
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( |
|
|
|
string.Format(sql,input.BillNum) |
|
|
|
string.Format(sql,input.BillNum,input.AccountDate) |
|
|
|
); |
|
|
|
//List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>();
|
|
|
|
//if (input.Guids.Count() > 0)
|
|
|
|
//{
|
|
|
|
// _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State != 2).ToListAsync();
|
|
|
|
//}
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// _ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
|
|
|
|
//}
|
|
|
|
//if (_ls.Count() > 0)
|
|
|
|
//{
|
|
|
|
// //var _first = _ls.FirstOrDefault();
|
|
|
|
// //var _guid = GuidGenerator.Create();
|
|
|
|
// //foreach (var itm in _ls)
|
|
|
|
// //{
|
|
|
|
// // itm.TaskId = _guid;
|
|
|
|
// //}
|
|
|
|
// //await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls);
|
|
|
|
// //var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail",_first.BillNum, 0,0 ,_guid)
|
|
|
|
// //{
|
|
|
|
// // TaskId = _guid,
|
|
|
|
// // SourceBillNum = _first.BillNum,
|
|
|
|
// // TableName = "WmsJitOutPutDetail",
|
|
|
|
// // InterfaceType = "1",
|
|
|
|
// // Version = version,
|
|
|
|
// // SettleAccountState = 0,
|
|
|
|
// // WmsState=0
|
|
|
|
|
|
|
|
// //};
|
|
|
|
// //var _l = new List<TS_UNI_API>();
|
|
|
|
// //_l.Add(uniapi);
|
|
|
|
// //await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
|
|
|
|
|
|
|
|
//}
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
@ -467,26 +434,34 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
|
[Route("WmsJitOutPut-Cancel")] |
|
|
|
public async Task<bool> WmsJitOutPutCancel(WmsJitRequestDto input) |
|
|
|
{ |
|
|
|
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 2).ToListAsync(); |
|
|
|
var _first = _ls.FirstOrDefault(); |
|
|
|
if (_ls.Count > 0) |
|
|
|
|
|
|
|
|
|
|
|
if (input.Guids != null && input.Guids.Count() > 0) |
|
|
|
{ |
|
|
|
//var _guid = GuidGenerator.Create();
|
|
|
|
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
|
|
|
|
//var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
|
|
|
|
//{
|
|
|
|
// TaskId = _guid,
|
|
|
|
// SourceBillNum = _first.BillNum,
|
|
|
|
// TableName = "WmsJitOutPutDetail",
|
|
|
|
// InterfaceType = "1",
|
|
|
|
// Version = version,
|
|
|
|
// WmsState = 0,
|
|
|
|
// SettleAccountState=0
|
|
|
|
//};
|
|
|
|
//var _l = new List<TS_UNI_API>();
|
|
|
|
//_l.Add(uniapi);
|
|
|
|
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
|
|
|
|
} |
|
|
|
List<string> _ls = new List<string>(); |
|
|
|
foreach (var itm in input.Guids) |
|
|
|
{ |
|
|
|
_ls.Add(string.Format("{0}",itm)); |
|
|
|
} |
|
|
|
|
|
|
|
string str= string.Join(",",_ls.ToArray()); |
|
|
|
|
|
|
|
var sql = "DECLARE @return_value int\n" + |
|
|
|
"EXEC @return_value = [dbo].[p_wms_output_cancel]\n" + |
|
|
|
" @Guids ={0}, \n" + |
|
|
|
" @billnum = N'{1}',\n" + |
|
|
|
" @type = 0,\n" + |
|
|
|
" @accountdate = N'{2}'\n" + |
|
|
|
"SELECT 'Return Value' = @return_value"; |
|
|
|
|
|
|
|
sql= string.Format(sql, str, input.BillNum, input.AccountDate); |
|
|
|
|
|
|
|
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( |
|
|
|
sql |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|