|
@ -47,6 +47,7 @@ using Win.Sfs.SettleAccount.Entities.WMS; |
|
|
using Win.Sfs.SettleAccount.Entities.Wms; |
|
|
using Win.Sfs.SettleAccount.Entities.Wms; |
|
|
using Win.Sfs.SettleAccount.Repository; |
|
|
using Win.Sfs.SettleAccount.Repository; |
|
|
using WY.NewJit.Extends.PaiGe.WMS; |
|
|
using WY.NewJit.Extends.PaiGe.WMS; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|
|
|
|
|
|
|
|
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
{ |
|
|
{ |
|
@ -54,16 +55,16 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
/// wms出库
|
|
|
/// wms出库
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
//[AllowAnonymous]
|
|
|
[AllowAnonymous] |
|
|
[Route("api/settleaccount/wmsSharePartoutput")] |
|
|
[Route("api/settleaccount/wmsSharePartoutput")] |
|
|
[Authorize(SettleAccountPermissions.WMSJIT.Default)] |
|
|
//[Authorize(SettleAccountPermissions.WMSJIT.Default)]
|
|
|
public class WMSSharePartAppService : |
|
|
public class WMSSharePartAppService : |
|
|
SettleAccountApplicationBase<WmsSharePartOutPutDetial> |
|
|
SettleAccountApplicationBase<WmsSharePartOutPutDetial> |
|
|
{ |
|
|
{ |
|
|
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> _wmsRepository; |
|
|
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> _wmsRepository; |
|
|
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> _wmsVersionRepository; |
|
|
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> _wmsVersionRepository; |
|
|
private readonly WMSEfCoreRepository<WmsSharePartOutPutDetial> _wmsefRespository; |
|
|
private readonly WMSEfCoreRepository<WmsSharePartOutPutDetial> _wmsefRespository; |
|
|
|
|
|
private readonly WmsDapperRepository _wmsDapper; |
|
|
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|
|
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository; |
|
|
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|
|
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job; |
|
|
private readonly IExcelImportAppService _excelImportService; |
|
|
private readonly IExcelImportAppService _excelImportService; |
|
@ -87,7 +88,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
IExcelImportAppService excelImportService, |
|
|
IExcelImportAppService excelImportService, |
|
|
IDistributedCache<WmsSharePartOutPutDetial> cache, |
|
|
IDistributedCache<WmsSharePartOutPutDetial> cache, |
|
|
ISnowflakeIdGenerator snowflakeIdGenerator, |
|
|
ISnowflakeIdGenerator snowflakeIdGenerator, |
|
|
ICommonManager commonManager |
|
|
ICommonManager commonManager, |
|
|
|
|
|
WmsDapperRepository wmsDapper |
|
|
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) |
|
|
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) |
|
|
{ |
|
|
{ |
|
|
_excelImportService = excelImportService; |
|
|
_excelImportService = excelImportService; |
|
@ -95,6 +97,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
_wmstbRespository = wmstbRespository; |
|
|
_wmstbRespository = wmstbRespository; |
|
|
_wmsRepository = wmsRepository; |
|
|
_wmsRepository = wmsRepository; |
|
|
_wmsVersionRepository = wmsVersionRepository; |
|
|
_wmsVersionRepository = wmsVersionRepository; |
|
|
|
|
|
_wmsDapper = wmsDapper; |
|
|
_wmsefRespository = wmsefRespository; |
|
|
_wmsefRespository = wmsefRespository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -136,15 +139,43 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
[Route("WmsSharePartDetailList")] |
|
|
[Route("WmsSharePartDetailList")] |
|
|
|
|
|
[UnitOfWork(false)] |
|
|
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|
|
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|
|
virtual public async Task<PagedResultDto<WmsSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input) |
|
|
virtual public async Task<PagedResultDto<WmsSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input) |
|
|
{ |
|
|
{ |
|
|
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|
|
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|
|
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|
|
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, |
|
|
input.SkipCount, true); |
|
|
input.SkipCount, true); |
|
|
|
|
|
var stockList = _wmsDapper.GetSalesStock(); |
|
|
|
|
|
var query = from itm in entities |
|
|
|
|
|
join itm1 in stockList on itm.MaterialCode equals itm1.SapCode |
|
|
|
|
|
into temp1 |
|
|
|
|
|
from tm1 in temp1.DefaultIfEmpty() |
|
|
|
|
|
select new WmsSharePartOutPutDetial(//少加个发货,由于零件有重复
|
|
|
|
|
|
itm.Id, |
|
|
|
|
|
itm.WmsBillNum, |
|
|
|
|
|
itm.OrderBillNum, |
|
|
|
|
|
itm.MaterialCode, |
|
|
|
|
|
itm.MaterialDesc, |
|
|
|
|
|
itm.MaterialGroup, |
|
|
|
|
|
itm.OutPut, |
|
|
|
|
|
itm.InPut, |
|
|
|
|
|
itm.State, |
|
|
|
|
|
itm.Extend1, |
|
|
|
|
|
itm.Extend2, |
|
|
|
|
|
itm.Version, |
|
|
|
|
|
itm.ParentMaterialCode, |
|
|
|
|
|
itm.BillNum, |
|
|
|
|
|
itm.TaskId, |
|
|
|
|
|
itm.Remark, |
|
|
|
|
|
itm.Qty, |
|
|
|
|
|
tm1 == null ? 0 : tm1.Qty, |
|
|
|
|
|
itm.OutPutQty |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var totalCount = await GetCountAsync(input); |
|
|
var totalCount = await GetCountAsync(input); |
|
|
return new PagedResultDto<WmsSharePartOutPutDetial>(totalCount, entities); |
|
|
return new PagedResultDto<WmsSharePartOutPutDetial>(totalCount, query.ToList()); |
|
|
} |
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 任务明细标记已确认
|
|
|
/// 任务明细标记已确认
|
|
@ -207,7 +238,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
_billNum, |
|
|
_billNum, |
|
|
GuidGenerator.Create(), |
|
|
GuidGenerator.Create(), |
|
|
string.Empty, |
|
|
string.Empty, |
|
|
p.Qty |
|
|
p.Qty, |
|
|
|
|
|
p.StockQty, |
|
|
|
|
|
p.Qty |
|
|
)); |
|
|
)); |
|
|
_lst.AddRange(_list.ToArray()); |
|
|
_lst.AddRange(_list.ToArray()); |
|
|
} |
|
|
} |
|
@ -246,13 +279,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
string.Empty, |
|
|
string.Empty, |
|
|
0, |
|
|
0, |
|
|
string.Empty, |
|
|
string.Empty, |
|
|
input.Version, |
|
|
|
|
|
string.Empty, |
|
|
string.Empty, |
|
|
|
|
|
input.Version, |
|
|
p.MaterialCode, |
|
|
p.MaterialCode, |
|
|
_billNum, |
|
|
_billNum, |
|
|
GuidGenerator.Create(), |
|
|
GuidGenerator.Create(), |
|
|
string.Empty, |
|
|
string.Empty, |
|
|
p.Qty |
|
|
p.Qty, |
|
|
|
|
|
p.StockQty, |
|
|
|
|
|
p.Qty |
|
|
)).ToList(); |
|
|
)).ToList(); |
|
|
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|
|
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); |
|
|
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); |
|
|
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); |
|
@ -326,6 +361,25 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
} |
|
|
} |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
|
|
|
[Route("WmsSharePartOutPutModify")] |
|
|
|
|
|
[DisableRequestSizeLimit] |
|
|
|
|
|
public async Task<bool> WmsSharePartUpdate(WmsSharePartOutPutDetial detial) |
|
|
|
|
|
{ |
|
|
|
|
|
var _entityList = _wmsRepository.Where(p => p.Id == detial.BranchId).ToList(); |
|
|
|
|
|
if (_entityList.Count() > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var itm in _entityList) |
|
|
|
|
|
{ |
|
|
|
|
|
itm.OutPutQty = detial.OutPutQty; |
|
|
|
|
|
await _wmsRepository.UpdateAsync(itm); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
///出库界面功能, 撤销核准出库
|
|
|
///出库界面功能, 撤销核准出库
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -429,6 +483,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
GuidGenerator.Create() |
|
|
GuidGenerator.Create() |
|
|
, string.Empty |
|
|
, string.Empty |
|
|
, itm.Qty |
|
|
, itm.Qty |
|
|
|
|
|
, 0 |
|
|
|
|
|
, itm.Qty |
|
|
); |
|
|
); |
|
|
_lsCopy.Add(_detail); |
|
|
_lsCopy.Add(_detail); |
|
|
} |
|
|
} |
|
|