|
|
@ -107,160 +107,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
|
_wmsefRespository = wmsefRespository; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 选择结算明细任务列表,选择相关任务合拼导期间出库表
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
//[HttpGet]
|
|
|
|
//[Route("WmsJitOutPut")]
|
|
|
|
//[DisableRequestSizeLimit]
|
|
|
|
|
|
|
|
//public async Task<bool> WmsJitOutPut(List<string> fileList, string version)
|
|
|
|
//{
|
|
|
|
|
|
|
|
// List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>();
|
|
|
|
// foreach (var filename in fileList)
|
|
|
|
// {
|
|
|
|
// string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
|
|
|
|
// IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();
|
|
|
|
// var _list = await Importer.ImportSameSheets<WmsJitOutPutDetialDto, WmsJitOutPutDetial>(fileSavePath);
|
|
|
|
// foreach (var itm in _list)
|
|
|
|
// {
|
|
|
|
// var list = itm.Value.Data.ToList();
|
|
|
|
// _lst.AddRange(list.ToArray());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
// var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync();
|
|
|
|
|
|
|
|
// var query = from itm1 in _ls1
|
|
|
|
// join itm2 in outPutDetail on
|
|
|
|
// new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber }
|
|
|
|
// equals
|
|
|
|
// new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1
|
|
|
|
// from tm1 in temp1.DefaultIfEmpty() where tm1==null
|
|
|
|
// select itm1;
|
|
|
|
|
|
|
|
// await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0 });
|
|
|
|
// int _count= _wmsVersionRepository.Count(p => p.Version == version);
|
|
|
|
// if (_count == 0)
|
|
|
|
// {
|
|
|
|
// var _version = new List<WmsJitOutPut>();
|
|
|
|
// _version.Add(new WmsJitOutPut { Version = version, BillNum = "T" +DateTime.Now.ToString("yyyyMMddhhmmssdddd"), Creator = CurrentUser.Email });
|
|
|
|
// await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version);
|
|
|
|
// }
|
|
|
|
// //_wmsRepository.Where(p=>p)
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//[HttpGet]
|
|
|
|
//[Route("WmsJitOutPut-Pass")]
|
|
|
|
|
|
|
|
//public async Task<bool> WmsJitOutPutPass( string version, List<Guid> p_list=null)
|
|
|
|
//{
|
|
|
|
// if (p_list != null)
|
|
|
|
// {
|
|
|
|
// List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>();
|
|
|
|
// if (p_list.Count() > 0)
|
|
|
|
// {
|
|
|
|
// _ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync();
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// _ls = await _wmsRepository.Where(p => p.Version == version && 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);
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// //_wmsDapper.GetListBySql<WmsJitOutPutDetial>("insert into WmsJitOutPutDetial", false);
|
|
|
|
// //_wmsDapper.DbConnection.ConnectionTimeout = 1200;
|
|
|
|
// //_wmsRepository.Where(p=>p)
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//[HttpGet]
|
|
|
|
//[Route("WmsJitOutPut-Cancel")]
|
|
|
|
|
|
|
|
//public async Task<bool> WmsJitOutPutCancel(List<Guid> ids, string version)
|
|
|
|
//{
|
|
|
|
|
|
|
|
// //var _guid = GuidGenerator.Create();
|
|
|
|
// //foreach (var itm in _ls)
|
|
|
|
// //{
|
|
|
|
// // itm.TaskId = _guid;
|
|
|
|
// //}
|
|
|
|
// var _ls = await _wmsRepository.Where(p => ids.Contains(p.Id) && p.Version == version && p.State == 1).ToListAsync();
|
|
|
|
// var _first = _ls.FirstOrDefault();
|
|
|
|
// if (_ls.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);
|
|
|
|
|
|
|
|
// }
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
[Route("testImport")] |
|
|
|
[DisableRequestSizeLimit] |
|
|
|
|
|
|
|
[UnitOfWork(false)] |
|
|
|
public async Task<string> testUploadBeginInvoke([FromForm] IFormFileCollection files) |
|
|
|
{ |
|
|
|
List<CustomCondition> customConditionList = new List<CustomCondition>(); |
|
|
|
customConditionList.Add(new CustomCondition() { Name = "Version", Value = "202107" }); |
|
|
|
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = "T20210701" }); |
|
|
|
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = "T20210701" }); |
|
|
|
var _taskid = await _service.ImportEnqueueAsync<ImportTaskArgs>(files, "结算数据", CurrentUser, typeof(SettleAccountImportService),customConditionList,(rs)=> { |
|
|
|
|
|
|
|
}); |
|
|
|
return _taskid; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 导入功能
|
|
|
|
/// </summary>
|
|
|
|