yunfeng.liu 3 years ago
parent
commit
23719cf2f9
  1. 1509
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220108.txt
  2. 1
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
  3. 3
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs
  4. 115
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs
  5. 251
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs
  6. 470
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs
  7. 451
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs
  8. 80
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  9. 180
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  10. 387
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs
  11. 425
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs
  12. 334
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  13. 291
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  14. 561
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  15. 28
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/WmsOutPutPercent.cs
  16. 163
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  17. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs
  18. 155
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
  19. 8
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs
  20. 107
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFShippingDapperRepository.cs
  21. 8
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  22. 109
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHShippingDapperRepository.cs
  23. 8
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs
  24. 107
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMShippingDapperRepository.cs
  25. 253
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  26. 103
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQCarSettledDetailDiffExportService.cs
  27. 18
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs
  28. 51
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFShippingExportService.cs
  29. 5
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
  30. 57
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHShippingExportService.cs
  31. 4
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs
  32. 118
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSharePartSettledDetailDiffExportService.cs
  33. 51
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMShippingExportService.cs
  34. 7
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs
  35. 56
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs
  36. 38
      src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs
  37. BIN
      src/Modules/SettleAccount/数据库修改记录.xlsx
  38. 64
      vue/src/router/modules/hq_out_order.js

1509
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20220108.txt

File diff suppressed because it is too large

1
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj

@ -54,6 +54,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
<Folder Include="wwwroot\files\host\my-file-container\" />
</ItemGroup>

3
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs

@ -296,6 +296,9 @@ namespace Win.Sfs.SettleAccount.Entities.Wms
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string Version { set; get; }

115
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs

@ -237,7 +237,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("WmsHQFKanbanOutPut")]
public async Task<string> WmsHQFKanbanOutPut(WmsJitRequestDto input)
{
var _billNum = "K" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
if (_joblist.Count() > 0)
@ -251,23 +251,18 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var _list = _excelHelper.ExcelToList<WmsHQFKanbanOutPutDetial>();
foreach (var itm in _list)
{
itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create());
}
_lst.AddRange(_list.ToArray());
}
// var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban}
new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban }
new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
if (errList.Count() == 0)
@ -334,30 +329,20 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsHQFKanbanOutPutPass(WmsJitRequestDto input)
{
if (input.Guids != null)
{
List<WmsHQFKanbanOutPutDetial> _ls = new List<WmsHQFKanbanOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version ==input.Version && p.BillNum == input.BillNum && 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 sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 3\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
}
}
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 3,\n" +
" @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum, input.AccountDate)
);
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
@ -369,26 +354,32 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("WmsHQFKanbanOutPut-Cancel")]
public async Task<bool> WmsHQFKanbanOutPutCancel(WmsJitRequestDto input)
{
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).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", input.Version, "WmsHQFKanbanOutPutDetail", _first.BillNum, 0,0, _guid)
List<string> _ls = new List<string>();
foreach (var itm in input.Guids)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
TableName = "WmsHQFKanbanOutPutDetail",
InterfaceType = "2",
Version = input.Version,
WmsState = 0,
SettleAccountState=0
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
_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 = 3,\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;
}
[HttpPost]
@ -397,7 +388,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "K" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQFKanbanOutPutDetial>(files, _excelImportService);
List<WmsHQFKanbanOutPutDetial> _lst = new List<WmsHQFKanbanOutPutDetial>();
@ -408,7 +399,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
GuidGenerator.Create(),
itm.WmsBillNum,
itm.Kanban,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
@ -429,15 +419,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
_lst.AddRange(_lsCopy.ToArray());
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _ls1 on
new { itm1.MaterialCode, itm1.Kanban }
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban }
new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
@ -452,20 +442,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _ls1
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.Kanban }
new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban } into temp1
new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;

251
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs

@ -63,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
private readonly ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQFSharePartOutPutDetial> _wmsefRespository;
private readonly WmsDapperRepository _wmsDapper;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService;
@ -78,8 +78,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
public WMSHQFSharePartAppService(
ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPutDetial, Guid> wmsRepository,
WmsDapperRepository wmsDapper,
ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQFSharePartOutPutDetial> wmsefRespository,
@ -96,6 +96,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
_wmsDapper = wmsDapper;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
@ -142,6 +143,31 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
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 WmsHQHSharePartOutPutDetial(
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.Qty
);
return new PagedResultDto<WmsHQFSharePartOutPutDetial>(totalCount, entities);
}
/// <summary>
@ -213,14 +239,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
GuidGenerator.Create(),
string.Empty,
p.
,0
));
_lst.AddRange(_lsAry.ToArray());
}
}
foreach (var itm in _lst)
{
itm.BillNum = _billNum;
@ -241,27 +264,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
await _job.UpdateAsync(job);
}
}
//return _billNum;
//else
//{
// StringBuilder _buffer = new StringBuilder();
// foreach (var itm in errList)
// {
// _buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number);
// }
// var _errinfo = _buffer.ToString();
// foreach (var job in _joblist)
// {
// job.FileName = _errinfo;
// await _job.UpdateAsync(job);
// }
// //}
//}
//else
//{
// _billNum = string.Empty;
//}
return ApplicationConsts.SuccessStr;
}
/// <summary>
@ -291,7 +294,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 2\n" +
" @type = 4\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
@ -310,109 +313,111 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("WmsSharePartOutPut-Cancel")]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).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", input.Version, "WmsSharePartOutPutDetail", _first.BillNum, 0,0, _guid)
//{
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsSharePartOutPutDetail",
// InterfaceType = "3",
// Version = input.Version,
// WmsState = 0,
// SettleAccountState=0
//};
//var _l = new List<TS_UNI_API>();
//_l.Add(uniapi);
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
return true;
}
//[HttpPost]
//[Route("ExcelImport")]
//[DisableRequestSizeLimit]
////[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
//{
//var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
//ExportImporter _exportImporter = new ExportImporter();
//var result = await _exportImporter.ExtendExcelImport<WmsHQFSharePartOutPutDetial>(files, _excelImportService);
//List<WmsHQFSharePartOutPutDetial> _lst = new List<WmsHQFSharePartOutPutDetial>();
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 = 4,\n" +
" @accountdate = N'{2}'\n" +
"SELECT 'Return Value' = @return_value";
sql = string.Format(sql, str, input.BillNum, input.AccountDate);
//var _lsCopy = new List<WmsHQFSharePartOutPutDetial>();
//foreach (var itm in result)
//{
// WmsHQFSharePartOutPutDetial _detail = new WmsHQFSharePartOutPutDetial(
// GuidGenerator.Create(),
// itm.WmsBillNum,
// itm.OrderBillNum,
// itm.MaterialCode,
// itm.MaterialDesc,
// itm.MaterialGroup,
// string.Empty,
// string.Empty,
// 0,
// string.Empty,
// string.Empty,
// version,
// itm.ParentMaterialCode,
// itm.BillNum,
// GuidGenerator.Create()
// , string.Empty
// , itm.Qty
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
sql
);
}
return true;
}
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQFSharePartOutPutDetial>(files, _excelImportService);
List<WmsHQFSharePartOutPutDetial> _lst = new List<WmsHQFSharePartOutPutDetial>();
// );
// _lsCopy.Add(_detail);
//}
//_lst.AddRange(_lsCopy.ToArray());
var _lsCopy = new List<WmsHQFSharePartOutPutDetial>();
foreach (var itm in result)
{
WmsHQFSharePartOutPutDetial _detail = new WmsHQFSharePartOutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.OrderBillNum,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
version,
itm.ParentMaterialCode,
itm.BillNum,
GuidGenerator.Create()
, string.Empty
, itm.Qty
,0
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
//var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
//var error = from itm1 in outPutDetail
// join itm2 in _lst on
// new { itm1.MaterialCode, itm1.OrderBillNum,itm1.WmsBillNum,itm1.po }
// equals
// new { itm2.MaterialCode, itm2.OrderBillNum }
// select itm1;
//var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.OrderBillNum }
equals
new { itm2.MaterialCode, itm2.OrderBillNum }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
//var checkList = new List<ErrorExportDto>();
//foreach (var itm in errList)
//{
// checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
//}
//if (checkList.Count > 0)
//{
// return await ExportErrorReportAsync(checkList);
//}
//var query = from itm1 in _ls1
// join itm2 in outPutDetail on
// new { itm1.MaterialCode, itm1.OrderBillNum }
// equals
// new { itm2.MaterialCode, itm2.OrderBillNum } into temp1
// from tm1 in temp1.DefaultIfEmpty()
// where tm1 == null
// select itm1;
//var _wmslst = query.ToList();
//foreach (var itm in _wmslst)
//{
// itm.BillNum = _billNum;
//}
//await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
//int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
//if (_count == 0)
//{
// var _version = new WmsHQFSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
//}
//return _billNum;
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode }
equals
new { itm2.MaterialCode } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQFSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return _billNum;
}
}
}

470
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs

@ -0,0 +1,470 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using AutoMapper;
using System.Linq;
using System.Text;
using Volo.Abp.Guids;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.ObjectMapping;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.CacheBase;
using Win.Utils;
using Volo.Abp.Application.Dtos;
using Win.Sfs.BaseData.ImportExcelCommon;
using Volo.Abp.Domain.Repositories;
using EFCore.BulkExtensions;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
using Win.Sfs.SettleAccount.FISes;
using Win.Sfs.Shared.Enums.SettleAccount;
using Win.Sfs.Shared.Filter;
using Shouldly;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.Data.Common;
using Volo.Abp.Uow;
using Volo.Abp;
using Win.Abp.Snowflakes;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Magicodes.ExporterAndImporter.Core.Models;
using TaskJob.Services;
using TaskJob.EventArgs;
using Win.Sfs.SettleAccount.Entities.WMS;
using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.Repository;
using WY.NewJit.Extends.PaiGe.WMS;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
/// <summary>
/// wms出库
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/WmsHQHKanbanoutput")]
public class WmsHQHKanbanAppService :
SettleAccountApplicationBase<WmsHQHKanbanOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsHQHKanbanOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQHKanbanOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQHKanbanOutPutDetial> _wmsefRespository;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService;
private readonly TaskJobService _service;
/// <summary>
///
/// </summary>
/// <param name="wmsRepository"></param>
/// <param name="job"></param>
/// <param name="wmsVersionRepository"></param>
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
public WmsHQHKanbanAppService(
IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<WmsHQHKanbanOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQHKanbanOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQHKanbanOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsHQHKanbanOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_job = job;
_wmstbRespository = wmstbRespository;
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
_excelImportService = excelImportService;
}
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
{
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
private async Task<long> GetCountAsync(WmsKanbanOutPutRequestDto input)
{
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
/// <summary>
/// 准时化出库主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQHKanbanOutPut>> GetListAsync( WmsKanbanOutPutRequestDto input)
{
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsHQHKanbanOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQHKanbanOutPutDetial>> GetListAsync(WmsKanbanOutPutDetialRequestDto input)
{
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsHQHKanbanOutPutDetial>(totalCount, entities);
}
/// <summary>
/// 任务明细标记已确认
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanOutPutAudit")]
[DisableRequestSizeLimit]
public async Task<bool> WmsHQHKanbanAudit(List<Guid> ids)
{
var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
foreach (var itm in _joblist)
{
itm.FileName = "已确认";
await _job.UpdateAsync(itm);
}
return true;
}
///// <summary>
///// 选择任务,生成出库单,只包含已确认的单据
///// </summary>
///// <param name="ids"></param>
///// <param name="version"></param>
///// <returns></returns>
//[HttpPost]
//[Route("WmsWithOutKanbanOutPut")]
//public async Task<string> WmsWithOutKanbanOutPut(WmsJitRequestDto input)
//{
// var _billNum = "KA" + DateTime.Now.ToString("yyyyMMddhhmmss");
// var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
// if (_joblist.Count() > 0)
// {
// var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
// List<WmsHQHKanbanOutPutDetial> _lst = new List<WmsHQHKanbanOutPutDetial>();
// foreach (var filename in fileList)
// {
// string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
// ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
// var _list = _excelHelper.ExcelToList<SettleKBWithOutCode>();
// foreach (var itm in _list)
// {
// var _entity= new WmsHQHKanbanOutPutDetial(GuidGenerator.Create(), string.Empty, string.Empty, itm.MaterialCode, itm.MaterialDesc
// , itm.SapMaterialGroup, string.Empty, string.Empty, 0, string.Empty, string.Empty, itm.Version, itm.SapMaterialCode,
// _billNum, Guid.Empty, string.Empty, itm.InvoiceQty,itm.
// );
// _lst.Add(_entity);
// }
// }
// var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version && p.Kanban==string.Empty).ToListAsync();
// await _wmsRepository.GetDbContext().BulkInsertAsync(_lst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
// int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
// if (_count == 0)
// {
// var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
// }
// foreach (var job in _joblist)
// {
// job.FileName = _billNum;
// await _job.UpdateAsync(job);
// }
// }
// return ApplicationConsts.SuccessStr; ;
//}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanOutPut")]
public async Task<string> WmsHQHKanbanOutPut(WmsJitRequestDto input)
{
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
if (_joblist.Count() > 0)
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsHQHKanbanOutPutDetial> _lst = new List<WmsHQHKanbanOutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
var _list = _excelHelper.ExcelToList<WmsHQHKanbanOutPutDetial>();
foreach (var itm in _list)
{
itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create());
}
_lst.AddRange(_list.ToArray());
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
if (errList.Count() == 0)
{
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.Kanban }
equals
new { itm2.MaterialCode, itm2.Kanban } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
foreach (var job in _joblist)
{
job.FileName = _billNum;
await _job.UpdateAsync(job);
}
}
else
{
StringBuilder _buffer = new StringBuilder();
foreach (var itm in errList)
{
_buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number);
}
var _errinfo = _buffer.ToString();
foreach (var job in _joblist)
{
job.FileName = _errinfo;
await _job.UpdateAsync(job);
}
}
}
else
{
_billNum = string.Empty;
}
return ApplicationConsts.SuccessStr; ;
}
/// <summary>
/// 出库界面功能,核准出库功能
/// </summary>
/// <param name="version"></param>
/// <param name="p_list"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanOutPut-Pass")]
[UnitOfWork(false)]
public async Task<bool> WmsHQHKanbanOutPutPass(WmsJitRequestDto input)
{
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 3,\n" +
" @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum, input.AccountDate)
);
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQHKanbanOutPut-Cancel")]
public async Task<bool> WmsHQHKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
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 = 3,\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;
}
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQHKanbanOutPutDetial>(files, _excelImportService);
List<WmsHQHKanbanOutPutDetial> _lst = new List<WmsHQHKanbanOutPutDetial>();
var _lsCopy = new List<WmsHQHKanbanOutPutDetial>();
foreach (var itm in result)
{
WmsHQHKanbanOutPutDetial _detail = new WmsHQHKanbanOutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.Kanban,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
version,
itm.ParentMaterialCode,
itm.BillNum,
GuidGenerator.Create()
, string.Empty
, itm.Qty,
itm.PoLine
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.Kanban,itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban,itm2.PoLine } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return _billNum;
}
}
}

451
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs

@ -0,0 +1,451 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using AutoMapper;
using System.Linq;
using System.Text;
using Volo.Abp.Guids;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.ObjectMapping;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.CacheBase;
using Win.Utils;
using Volo.Abp.Application.Dtos;
using Win.Sfs.BaseData.ImportExcelCommon;
using Volo.Abp.Domain.Repositories;
using EFCore.BulkExtensions;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
using Win.Sfs.SettleAccount.FISes;
using Win.Sfs.Shared.Enums.SettleAccount;
using Win.Sfs.Shared.Filter;
using Shouldly;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.Data.Common;
using Volo.Abp.Uow;
using Volo.Abp;
using Win.Abp.Snowflakes;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Magicodes.ExporterAndImporter.Core.Models;
using TaskJob.Services;
using TaskJob.EventArgs;
using Win.Sfs.SettleAccount.Entities.WMS;
using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.Repository;
using WY.NewJit.Extends.PaiGe.WMS;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
/// <summary>
/// wms出库
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/WmsHQHSharePartoutput")]
public class WmsHQHSharePartAppService :
SettleAccountApplicationBase<WmsHQHSharePartOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsHQHSharePartOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQHSharePartOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQHSharePartOutPutDetial> _wmsefRespository;
private readonly WmsDapperRepository _wmsDapper;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService;
private readonly TaskJobService _service;
/// <summary>
///
/// </summary>
/// <param name="wmsRepository"></param>
/// <param name="job"></param>
/// <param name="wmsVersionRepository"></param>
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
public WmsHQHSharePartAppService(
ISettleAccountBranchEfCoreRepository<WmsHQHSharePartOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQHSharePartOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQHSharePartOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IExcelImportAppService excelImportService,
IDistributedCache<WmsHQHSharePartOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
WmsDapperRepository wmsDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_excelImportService = excelImportService;
_job = job;
_wmstbRespository = wmstbRespository;
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
_wmsDapper = wmsDapper;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
{
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
private async Task<long> GetCountAsync(WmsSharePartOutPutRequestDto input)
{
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
/// <summary>
/// 准时化出库主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQHSharePartOutPut>> GetListAsync(WmsSharePartOutPutRequestDto input)
{
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsHQHSharePartOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQHSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input)
{
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
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 WmsHQHSharePartOutPutDetial(
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.Qty
);
return new PagedResultDto<WmsHQHSharePartOutPutDetial>(totalCount, query.ToList());
}
/// <summary>
/// 任务明细标记已确认
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPutAudit")]
[DisableRequestSizeLimit]
public async Task<bool> WmsSharePartAudit(List<Guid> ids)
{
var _joblist = await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
foreach (var itm in _joblist)
{
itm.FileName = "已确认";
}
foreach (var itm in _joblist)
{
await _job.UpdateAsync(itm);
}
var _count = await _job.BatchUpdateAsync(_joblist.ToList());
if (_count > 0)
{
return true;
}
return false;
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut")]
public async Task<string> WmsSharePartOutPut(WmsJitRequestDto input)
{
var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
if (_joblist.Count() > 0)
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsHQHSharePartOutPutDetial> _lst = new List<WmsHQHSharePartOutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
var _list = _excelHelper.ExcelToList<HQFSharePartSettledDetailDiff>();
if (_list.Count() > 0)
{
var _lsAry = _list.Select(p => new
WmsHQHSharePartOutPutDetial(
GuidGenerator.Create(),
"",
string.Empty,
p.,
p.,
p.,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
input.Version,
p.Sap编码,
_billNum,
GuidGenerator.Create(),
string.Empty,
p.,
0
));
_lst.AddRange(_lsAry.ToArray());
}
}
foreach (var itm in _lst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQHSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
foreach (var job in _joblist)
{
job.FileName = _billNum;
await _job.UpdateAsync(job);
}
}
//return _billNum;
//else
//{
// StringBuilder _buffer = new StringBuilder();
// foreach (var itm in errList)
// {
// _buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number);
// }
// var _errinfo = _buffer.ToString();
// foreach (var job in _joblist)
// {
// job.FileName = _errinfo;
// await _job.UpdateAsync(job);
// }
// //}
//}
//else
//{
// _billNum = string.Empty;
//}
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 出库界面功能,核准出库功能
/// </summary>
/// <param name="version"></param>
/// <param name="p_list"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Pass")]
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
if (input.Guids != null)
{
List<WmsHQHSharePartOutPutDetial> _ls = new List<WmsHQHSharePartOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && 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 sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 4\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
}
}
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
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 = 4,\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;
}
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQHSharePartOutPutDetial>(files, _excelImportService);
List<WmsHQHSharePartOutPutDetial> _lst = new List<WmsHQHSharePartOutPutDetial>();
var _lsCopy = new List<WmsHQHSharePartOutPutDetial>();
foreach (var itm in result)
{
WmsHQHSharePartOutPutDetial _detail = new WmsHQHSharePartOutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.OrderBillNum,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
version,
itm.ParentMaterialCode,
itm.BillNum,
GuidGenerator.Create()
, string.Empty
, itm.Qty
,0
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode }
equals
new { itm2.MaterialCode }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode}
equals
new { itm2.MaterialCode} into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQHSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return _billNum;
}
}
}

80
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs

@ -292,11 +292,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var _list = _excelHelper.ExcelToList<WmsKanbanOutPutDetial>();
foreach (var itm in _list)
{
itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create());
}
_lst.AddRange(_list.ToArray());
@ -395,26 +390,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
//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", input.Version, "WmsKanbanOutPutDetail",_first.BillNum, 0,0 ,_guid)
//{
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsKanbanOutPutDetail",
// InterfaceType = "2",
// Version = input.Version,
// SettleAccountState = 0,
// WmsState=0
//};
//var _l = new List<TS_UNI_API>();
//_l.Add(uniapi);
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
}
return true;
@ -429,25 +405,30 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("WmsKanbanOutPut-Cancel")]
public async Task<bool> WmsKanbanOutPutCancel(WmsJitRequestDto input)
{
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).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", input.Version, "WmsKanbanOutPutDetail", _first.BillNum, 0,0, _guid)
//{
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsKanbanOutPutDetail",
// InterfaceType = "2",
// Version = input.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 = 2,\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;
}
@ -488,12 +469,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
_lst.AddRange(_lsCopy.ToArray());
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _ls1 on
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban }
equals
new { itm2.MaterialCode, itm2.Kanban }
@ -513,14 +494,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var query = from itm1 in _ls1
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.Kanban }
equals

180
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -154,20 +154,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
public async Task<bool> WmsSharePartAudit(List<Guid> ids)
{
var _joblist =await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
var _joblist = await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
foreach (var itm in _joblist)
{
itm.FileName = "已确认";
}
foreach (var itm in _joblist)
{
await _job.UpdateAsync(itm);
}
var _count=await _job.BatchUpdateAsync(_joblist.ToList());
if (_count > 0)
{
return true;
}
return false;
}
/// <summary>
@ -193,35 +185,36 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var _list = _excelHelper.ExcelToList<WmsSharePartOutPutDetial>();
if (_list.Count() > 0)
{
var _lsAry = _list.GroupBy(p => new
{
p.MaterialCode,
p.MaterialGroup,
p.OrderBillNum,
p.MaterialDesc,
p.Version,
p.WmsBillNum,
}).Select(p => new
WmsSharePartOutPutDetial(
GuidGenerator.Create(),
p.Key.WmsBillNum,
p.Key.OrderBillNum,
p.Key.MaterialCode,
p.Key.MaterialDesc,
p.Key.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
string.Empty,
p.Key.MaterialCode,
_billNum,
GuidGenerator.Create(),
string.Empty,
p.Sum(itm => itm.Qty)
));
_lst.AddRange(_lsAry.ToArray());
//var _lsAry = _list.GroupBy(p => new
//{
// p.MaterialCode,
// p.MaterialGroup,
// p.OrderBillNum,
// p.MaterialDesc,
// p.Version,
// p.WmsBillNum,
//}).Select(p => new
//WmsSharePartOutPutDetial(
// GuidGenerator.Create(),
// p.Key.WmsBillNum,
// p.Key.OrderBillNum,
// p.Key.MaterialCode,
// p.Key.MaterialDesc,
// p.Key.MaterialGroup,
// string.Empty,
// string.Empty,
// 0,
// string.Empty,
// string.Empty,
// string.Empty,
// p.Key.MaterialCode,
// _billNum,
// GuidGenerator.Create(),
// string.Empty,
// p.Sum(itm => itm.Qty)
//));
_lst.AddRange(_list.ToArray());
}
}
@ -229,67 +222,34 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.OrderBillNum }
new { itm1.MaterialCode, itm1.OrderBillNum,itm1.WmsBillNum }
equals
new { itm2.MaterialCode, itm2.OrderBillNum }
new { itm2.MaterialCode, itm2.OrderBillNum,itm2.WmsBillNum }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
if (errList.Count() == 0)
{
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.OrderBillNum }
new { itm1.MaterialCode, itm1.OrderBillNum, itm1.WmsBillNum }
equals
new { itm2.MaterialCode, itm2.OrderBillNum } into temp1
new { itm2.MaterialCode, itm2.OrderBillNum, itm2.WmsBillNum } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
_wmslst = _wmslst.GroupBy(p => new
{
p.MaterialCode,
p.MaterialGroup,
p.OrderBillNum,
p.MaterialDesc,
p.Version,
p.WmsBillNum,
}).Select(p => new
WmsSharePartOutPutDetial(
GuidGenerator.Create(),
p.Key.WmsBillNum,
p.Key.OrderBillNum,
p.Key.MaterialCode,
p.Key.MaterialDesc,
p.Key.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
string.Empty,
p.Key.MaterialCode,
_billNum,
GuidGenerator.Create(),
string.Empty,
p.Sum(itm => itm.Qty)
)).ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_count == 0)
if (_wmslst.Count()>0 && _count == 0)
{
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
foreach (var job in _joblist)
{
job.FileName = _billNum;
@ -310,7 +270,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
job.FileName = _errinfo;
await _job.UpdateAsync(job);
}
}
}
else
@ -350,26 +309,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
//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", input.Version, "WmsSharePartOutPutDetail",_first.BillNum, 0,0 ,_guid)
//{
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsSharePartOutPutDetail",
// InterfaceType = "3",
// Version = input.Version,
// SettleAccountState = 0,
// WmsState=0
//};
//var _l = new List<TS_UNI_API>();
//_l.Add(uniapi);
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
}
return true;
@ -384,25 +324,30 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("WmsSharePartOutPut-Cancel")]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).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", input.Version, "WmsSharePartOutPutDetail", _first.BillNum, 0,0, _guid)
List<string> _ls = new List<string>();
foreach (var itm in input.Guids)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
TableName = "WmsSharePartOutPutDetail",
InterfaceType = "3",
Version = input.Version,
WmsState = 0,
SettleAccountState=0
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
_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 = 2,\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;
}
@ -417,8 +362,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var result = await _exportImporter.ExtendExcelImport<WmsSharePartOutPutDetial>(files, _excelImportService);
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
var _lsCopy = new List<WmsSharePartOutPutDetial>();
foreach (var itm in result)
{
@ -470,11 +413,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _ls1
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.OrderBillNum }

387
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMKanbanAppService.cs

@ -0,0 +1,387 @@
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Repository;
using WY.NewJit.Extends.PaiGe.WMS;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// wms出库-M平台
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/WMSHQMKanbanoutput")]
public class WmsHQMKanbanAppService :
SettleAccountApplicationBase<WmsHQMKanbanOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsHQMKanbanOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQMKanbanOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQMKanbanOutPutDetial> _wmsefRespository;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService;
private readonly TaskJobService _service;
/// <summary>
///
/// </summary>
/// <param name="wmsRepository"></param>
/// <param name="job"></param>
/// <param name="wmsVersionRepository"></param>
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
public WmsHQMKanbanAppService(
IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<WmsHQMKanbanOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQMKanbanOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQMKanbanOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsHQMKanbanOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_job = job;
_wmstbRespository = wmstbRespository;
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
_excelImportService = excelImportService;
}
private async Task<long> GetCountAsync(WmsKanbanOutPutDetialRequestDto input)
{
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
private async Task<long> GetCountAsync(WmsKanbanOutPutRequestDto input)
{
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
/// <summary>
/// 准时化出库主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQMKanbanList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQMKanbanOutPut>> GetListAsync(WmsKanbanOutPutRequestDto input)
{
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsHQMKanbanOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQMKanbanDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQMKanbanOutPutDetial>> GetListAsync(WmsKanbanOutPutDetialRequestDto input)
{
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsHQMKanbanOutPutDetial>(totalCount, entities);
}
/// <summary>
/// 任务明细标记已确认
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQMKanbanOutPutAudit")]
[DisableRequestSizeLimit]
public async Task<bool> WmsHQMKanbanAudit(List<Guid> ids)
{
var _joblist = await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
foreach (var itm in _joblist)
{
itm.FileName = "已确认";
await _job.UpdateAsync(itm);
}
return true;
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQMKanbanOutPut")]
public async Task<string> WmsHQMKanbanOutPut(WmsJitRequestDto input)
{
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
if (_joblist.Count() > 0)
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsHQMKanbanOutPutDetial> _lst = new List<WmsHQMKanbanOutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
var _list = _excelHelper.ExcelToList<WmsHQMKanbanOutPutDetial>();
foreach (var itm in _list)
{
itm.SetData(GuidGenerator.Create(), string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, input.Version, GuidGenerator.Create());
}
_lst.AddRange(_list.ToArray());
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban, itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban, itm2.PoLine }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
if (errList.Count() == 0)
{
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.Kanban }
equals
new { itm2.MaterialCode, itm2.Kanban } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQMKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
foreach (var job in _joblist)
{
job.FileName = _billNum;
await _job.UpdateAsync(job);
}
}
else
{
StringBuilder _buffer = new StringBuilder();
foreach (var itm in errList)
{
_buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number);
}
var _errinfo = _buffer.ToString();
foreach (var job in _joblist)
{
job.FileName = _errinfo;
await _job.UpdateAsync(job);
}
}
}
else
{
_billNum = string.Empty;
}
return ApplicationConsts.SuccessStr; ;
}
/// <summary>
/// 出库界面功能,核准出库功能
/// </summary>
/// <param name="version"></param>
/// <param name="p_list"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQMKanbanOutPut-Pass")]
[UnitOfWork(false)]
public async Task<bool> WmsHQMKanbanOutPutPass(WmsJitRequestDto input)
{
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 3,\n" +
" @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum, input.AccountDate)
);
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQMKanbanOutPut-Cancel")]
public async Task<bool> WmsHQMKanbanOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
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 = 3,\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;
}
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "HQKB" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQMKanbanOutPutDetial>(files, _excelImportService);
List<WmsHQMKanbanOutPutDetial> _lst = new List<WmsHQMKanbanOutPutDetial>();
var _lsCopy = new List<WmsHQMKanbanOutPutDetial>();
foreach (var itm in result)
{
WmsHQMKanbanOutPutDetial _detail = new WmsHQMKanbanOutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.Kanban,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
version,
itm.ParentMaterialCode,
itm.BillNum,
GuidGenerator.Create()
, string.Empty
, itm.Qty,
itm.PoLine
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban, itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban, itm2.PoLine }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.Kanban, itm1.PoLine }
equals
new { itm2.MaterialCode, itm2.Kanban, itm2.PoLine } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQMKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return _billNum;
}
}
}

425
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQMSharePartAppService.cs

@ -0,0 +1,425 @@
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Repository;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using WY.NewJit.Extends.PaiGe.WMS;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// wms出库
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/WmsHQMSharePartoutput")]
public class WmsHQMSharePartAppService :
SettleAccountApplicationBase<WmsHQMSharePartOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsHQMSharePartOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQMSharePartOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQMSharePartOutPutDetial> _wmsefRespository;
private readonly WmsDapperRepository _wmsDapper;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly IExcelImportAppService _excelImportService;
private readonly TaskJobService _service;
/// <summary>
///
/// </summary>
/// <param name="wmsRepository"></param>
/// <param name="job"></param>
/// <param name="wmsVersionRepository"></param>
/// <param name="wmsefRespository"></param>
/// <param name="wmstbRespository"></param>
public WmsHQMSharePartAppService(
ISettleAccountBranchEfCoreRepository<WmsHQMSharePartOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQMSharePartOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQMSharePartOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IExcelImportAppService excelImportService,
IDistributedCache<WmsHQMSharePartOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
WmsDapperRepository wmsDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_excelImportService = excelImportService;
_job = job;
_wmstbRespository = wmstbRespository;
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
_wmsDapper = wmsDapper;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
{
return await _wmsRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
private async Task<long> GetCountAsync(WmsSharePartOutPutRequestDto input)
{
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);
}
/// <summary>
/// 准时化出库主表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQMSharePartOutPut>> GetListAsync(WmsSharePartOutPutRequestDto input)
{
var entities = await _wmsVersionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
return new PagedResultDto<WmsHQMSharePartOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQMSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto input)
{
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(input);
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 WmsHQMSharePartOutPutDetial(
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.Qty
);
return new PagedResultDto<WmsHQMSharePartOutPutDetial>(totalCount, query.ToList());
}
/// <summary>
/// 任务明细标记已确认
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPutAudit")]
[DisableRequestSizeLimit]
public async Task<bool> WmsSharePartAudit(List<Guid> ids)
{
var _joblist = await _job.Where(p => ids.Contains(p.Id)).ToListAsync();
foreach (var itm in _joblist)
{
itm.FileName = "已确认";
}
foreach (var itm in _joblist)
{
await _job.UpdateAsync(itm);
}
var _count = await _job.BatchUpdateAsync(_joblist.ToList());
if (_count > 0)
{
return true;
}
return false;
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut")]
public async Task<string> WmsSharePartOutPut(WmsJitRequestDto input)
{
var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
var _joblist = _job.Where(p => input.Guids.Contains(p.Id) && p.FileName == "已确认").ToList();
if (_joblist.Count() > 0)
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsHQMSharePartOutPutDetial> _lst = new List<WmsHQMSharePartOutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
var _list = _excelHelper.ExcelToList<HQFSharePartSettledDetailDiff>();
if (_list.Count() > 0)
{
var _lsAry = _list.Select(p => new
WmsHQMSharePartOutPutDetial(
GuidGenerator.Create(),
"",
string.Empty,
p.,
p.,
p.,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
input.Version,
p.Sap编码,
_billNum,
GuidGenerator.Create(),
string.Empty,
p.,
0
));
_lst.AddRange(_lsAry.ToArray());
}
}
foreach (var itm in _lst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_lst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQMSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
foreach (var job in _joblist)
{
job.FileName = _billNum;
await _job.UpdateAsync(job);
}
}
//return _billNum;
//else
//{
// StringBuilder _buffer = new StringBuilder();
// foreach (var itm in errList)
// {
// _buffer.AppendFormat("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number);
// }
// var _errinfo = _buffer.ToString();
// foreach (var job in _joblist)
// {
// job.FileName = _errinfo;
// await _job.UpdateAsync(job);
// }
// //}
//}
//else
//{
// _billNum = string.Empty;
//}
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 出库界面功能,核准出库功能
/// </summary>
/// <param name="version"></param>
/// <param name="p_list"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Pass")]
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
if (input.Guids != null)
{
List<WmsHQMSharePartOutPutDetial> _ls = new List<WmsHQMSharePartOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.BillNum == input.BillNum && 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 sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 4\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
}
}
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.Guids != null && input.Guids.Count() > 0)
{
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 = 4,\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;
}
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQMSharePartOutPutDetial>(files, _excelImportService);
List<WmsHQMSharePartOutPutDetial> _lst = new List<WmsHQMSharePartOutPutDetial>();
var _lsCopy = new List<WmsHQMSharePartOutPutDetial>();
foreach (var itm in result)
{
WmsHQMSharePartOutPutDetial _detail = new WmsHQMSharePartOutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.OrderBillNum,
itm.MaterialCode,
itm.MaterialDesc,
itm.MaterialGroup,
string.Empty,
string.Empty,
0,
string.Empty,
string.Empty,
version,
itm.ParentMaterialCode,
itm.BillNum,
GuidGenerator.Create()
, string.Empty
, itm.Qty
, 0
);
_lsCopy.Add(_detail);
}
_lst.AddRange(_lsCopy.ToArray());
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode }
equals
new { itm2.MaterialCode }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _lst
join itm2 in outPutDetail on
new { itm1.MaterialCode }
equals
new { itm2.MaterialCode } into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm1;
var _wmslst = query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQMSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return _billNum;
}
}
}

334
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -72,8 +72,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
_invoiceVersionRepository = invoiceVersionRepository;
_fisVersionrepository = fisVersionrepository;
_itemInvoicePriceVersionrepository = itemInvoicePriceVersionrepository;
//_versionRepository = versionRepository;
//_repository = repository;
_service = service;
}
@ -200,7 +199,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
@ -249,22 +248,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
});
return _taskid;
}
#endregion
[HttpGet]
[Route("SharePartUnSettledExport")]
[DisableRequestSizeLimit]
@ -315,125 +300,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
}
/// <summary>
/// 未结算对比
/// </summary>
/// <param name="year"></param>
/// <param name="period"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode"></param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
//[HttpGet]
//[Route("UnSettledDiff-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> UnSettledMake(string year, string period, string version, string customerCode, string factory, string matialCode, string state,DateTime begin,DateTime end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "未结算对比" });
// customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("未结算对比", ExportExtentsion.Excel,version, string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup, CurrentUser, typeof(UnSettledExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
/// ERP总成开票报表功能
/// </summary>
/// <param name="year"></param>
/// <param name="period"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="matialCode"></param>
/// <param name="state"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <returns></returns>
//[HttpGet]
//[Route("FisUnSettledDiff-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> FisUnSettledMake(string year, string version, string customerCode, string factory, string state)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "ERP总成开票报表" });
// customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? DateTime.Now.Year.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("ERP总成开票报表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(fisUnsettledDiffReport), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
/// 价差量差分析报表
/// </summary>
/// <param name="year"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <param name="factory"></param>
/// <param name="state"></param>
/// <returns></returns>
//[HttpGet]
//[Route("PriceQtyDiff-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> PriceQtyDiffMake(string year, string version, string customerCode, string factory, string state)
//{
// //if (!_invoiceVersionRepository.Any(p => p.Version == version))
// //{
// // throw new BusinessException("8989", string.Format("不存发票{0}期间", version));
// //}
// //if (!_settleAccountVersionrepository.Any(p => p.Version == version))
// //{
// // throw new BusinessException("8989", string.Format("不存结算{0}期间", version));
// //}
// //if (!_itemInvoicePriceVersionrepository.Any(p => p.Version == version))
// //{
// // throw new BusinessException("8989", string.Format("不存QAD价格导入{0}期间", version));
// //}
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "价差量差分析报表" });
// customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? DateTime.Now.Year.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("价差量差分析报表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(PriceQtyDifferenceExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
/// 1.大众发票与结算核对汇总表
/// </summary>
@ -510,10 +376,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[DisableRequestSizeLimit]
public async Task<string> UnInvoiceSettledDetailDiffMake(
BaseRequestDto request
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
@ -664,6 +527,35 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
#region 红旗、一汽轿车的输出报表
/// <summary>
/// 一汽轿车
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQCarSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQCarSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("一汽轿车核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQCarSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
///红旗H平台核对明细
/// </summary>
@ -688,7 +580,36 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("H平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSettledDetailDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("H平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 红旗H平台备件结算出库
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQHSharePartSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQHSharePartSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("H平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -737,6 +658,36 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("F平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
///红旗M平台核对明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQMSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQMSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
@ -746,7 +697,108 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("F平台核备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("M平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQMSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 红旗M平台备件结算出库
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQMSharePartSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQMSharePartSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("M平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQMSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// H平台未结明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQHShippingExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQHShippingExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
var _taskid = await _service.ExportEnqueueAsync("H平台发运核对输出", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(HQHShippingExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// F平台未结明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQHShippingExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFShippingExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
var _taskid = await _service.ExportEnqueueAsync("F平台未结明细", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(HQFShippingExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// M平台未明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQMShippingExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQMShippingExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
var _taskid = await _service.ExportEnqueueAsync("M平台未明细", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(HQMShippingExportService), customConditionList, (rs) =>
{
});
return _taskid;

291
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -1732,7 +1732,7 @@
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.#ctor(Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.WmsDapperRepository,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
</summary>
@ -1787,6 +1787,126 @@
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService">
<summary>
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.#ctor(Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHKanbanOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHKanbanOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHKanbanOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHKanbanOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
</summary>
<param name="wmsRepository"></param>
<param name="job"></param>
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutRequestDto)">
<summary>
准时化出库主表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.WmsHQHKanbanAudit(System.Collections.Generic.List{System.Guid})">
<summary>
任务明细标记已确认
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.WmsHQHKanbanOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.WmsHQHKanbanOutPutPass(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能,核准出库功能
</summary>
<param name="version"></param>
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHKanbanAppService.WmsHQHKanbanOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService">
<summary>
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHSharePartOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQHSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager,Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.WmsDapperRepository)">
<summary>
</summary>
<param name="wmsRepository"></param>
<param name="job"></param>
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutRequestDto)">
<summary>
准时化出库主表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.WmsSharePartAudit(System.Collections.Generic.List{System.Guid})">
<summary>
任务明细标记已确认
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.WmsSharePartOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.WmsSharePartOutPutPass(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能,核准出库功能
</summary>
<param name="version"></param>
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQHSharePartAppService.WmsSharePartOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSJitAppService">
<summary>
wms出库
@ -2541,6 +2661,126 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService">
<summary>
wms出库-M平台
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.#ctor(Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
</summary>
<param name="wmsRepository"></param>
<param name="job"></param>
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutRequestDto)">
<summary>
准时化出库主表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.WmsHQMKanbanAudit(System.Collections.Generic.List{System.Guid})">
<summary>
任务明细标记已确认
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.WmsHQMKanbanOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.WmsHQMKanbanOutPutPass(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能,核准出库功能
</summary>
<param name="version"></param>
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMKanbanAppService.WmsHQMKanbanOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService">
<summary>
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager,Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.WmsDapperRepository)">
<summary>
</summary>
<param name="wmsRepository"></param>
<param name="job"></param>
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutRequestDto)">
<summary>
准时化出库主表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.WmsSharePartAudit(System.Collections.Generic.List{System.Guid})">
<summary>
任务明细标记已确认
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.WmsSharePartOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.WmsSharePartOutPutPass(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能,核准出库功能
</summary>
<param name="version"></param>
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.WMS.WmsHQMSharePartAppService.WmsSharePartOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.FISes.FISAppService">
<summary>
区域相关应用服务
@ -3150,6 +3390,13 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQCarSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
一汽轿车
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQHSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗H平台核对明细
@ -3157,6 +3404,13 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQHSharePartSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗H平台备件结算出库
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQFSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗F平台核对明细
@ -3171,6 +3425,41 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQMSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗M平台核对明细
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQMSharePartSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗M平台备件结算出库
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQHShippingExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
H平台未结明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQFShippingExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
F平台未结明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQMShippingExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
M平台未明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.SettleAccountApplicationAutoMapperProfile.CreateMapBT_Car_Platform">
<summary>
红旗F平台导入

561
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs

@ -271,11 +271,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
[ImporterHeader(Name = "组件组物料",IsIgnore =true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
@ -328,6 +324,235 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
#region 红旗M平台出库
/// <summary>
/// 看板M平台明细
/// </summary>
public class WmsHQMKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsHQMKanbanOutPutDetial()
{
}
public WmsHQMKanbanOutPutDetial(Guid id, string wmsBillNum, string kanban, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, string poline)
{
Id = id;
WmsBillNum = wmsBillNum;
Kanban = kanban;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
PoLine = poline;
}
public void SetData(Guid id, string remark, string wmsbillnum, string version, Guid taskId)
{
Id = id;
Remark = remark;
WmsBillNum = wmsbillnum;
Version = version;
TaskId = taskId;
}
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
[ImporterHeader(Name = "行号")]
public string PoLine { set; get; }
[ImporterHeader(Name = "订货看板编号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
//[ImporterHeader(Name = "订货看板编号")]
////KENN号
//public string OrderBillNum { set; get; }
[ImporterHeader(Name = "Sap编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "零件中文名称")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "发货零件号")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务描述", IsIgnore = true)]
public Guid TaskId { set; get; }
}
public class WmsHQMKanbanOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsHQMKanbanOutPut()
{
}
public WmsHQMKanbanOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
/// <summary>
/// 备件出库
/// </summary>
public class WmsHQMSharePartOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsHQMSharePartOutPut()
{
}
public WmsHQMSharePartOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
/// <summary>
/// 备件出库明细
/// </summary>
public class WmsHQMSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsHQMSharePartOutPutDetial()
{
}
public WmsHQMSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty)
{
Id = id;
WmsBillNum = wmsBillNum;
OrderBillNum = orderBillNum;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
StockQty = stockQty;
}
public void SetId(Guid id)
{
Id = id;
}
//交货单号
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号", IsIgnore = true)]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "看板号", IsIgnore = true)]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "Sap编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "结算物料号")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "单据号", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务ID", IsIgnore = true)]
public Guid TaskId { set; get; }
}
#endregion
#region 红旗看板
public class WmsHQFKanbanOutPut : FullAuditedAggregateRootBase<Guid>
@ -388,26 +613,25 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
Version = version;
TaskId = taskId;
}
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
[ImporterHeader(Name = "行号")]
public string PoLine { set; get; }
//交货单号
[ImporterHeader(Name = "订货看板编号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "条码号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "物料号")]
//[ImporterHeader(Name = "订货看板编号")]
////KENN号
//public string OrderBillNum { set; get; }
[ImporterHeader(Name = "Sap编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ImporterHeader(Name = "零件中文名称")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
@ -421,7 +645,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "客户物料")]
[ImporterHeader(Name = "发货零件号")]
/// <summary>
/// 扩展字段1
/// </summary>
@ -429,7 +653,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "订单日期")]
[ImporterHeader(Name = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
@ -438,14 +662,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "单据", IsIgnore = true)]
[ImporterHeader(Name = "数量", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务", IsIgnore = true)]
[ImporterHeader(Name = "任务描述", IsIgnore = true)]
public Guid TaskId { set; get; }
}
/// <summary>
@ -478,7 +714,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public WmsHQFSharePartOutPutDetial()
{
}
public WmsHQFSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId,string remark,decimal qty )
public WmsHQFSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId,string remark,decimal qty ,decimal stockQty )
{
Id = id;
WmsBillNum = wmsBillNum;
@ -504,14 +740,42 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
//交货单号
[ImporterHeader(Name = "组件组物料")]
//[ExporterHeader(DisplayName = "收货仓库")]
//public string 收货仓库 { set; get; }
//[ExporterHeader(DisplayName = "收货仓库描述")]
//public string 收货仓库描述 { set; get; }
//[ExporterHeader(DisplayName = "结算物料号")]
//public string 结算物料号 { set; get; }
//[ExporterHeader(DisplayName = "结算物料描述")]
//public string 物料描述 { set; get; }
//[ExporterHeader(DisplayName = "结算数量")]
//public decimal 结算数量 { set; get; }
//[ExporterHeader(DisplayName = "结算单价")]
//public decimal 结算单价 { set; get; }
//[ExporterHeader(DisplayName = "结算金额")]
//public decimal 结算金额 { set; get; }
//[ExporterHeader(DisplayName = "Sap编码")]
//public string Sap编码 { set; get; }
//[ExporterHeader(DisplayName = "物料组(车型)")]
//public string 物料组 { set; get; }
//[ExporterHeader(DisplayName = "寄销库数量")]
//public decimal 寄销库数量 { set; get; }
[ImporterHeader(Name = "寄销库数量",IsIgnore =true)]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "组件组物料",IsIgnore =true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
[ImporterHeader(Name = "交货单号",IsIgnore =true)]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "看板号")]
[ImporterHeader(Name = "看板号",IsIgnore =true)]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP编码")]
[ImporterHeader(Name = "Sap编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
@ -528,7 +792,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public string InPut { set; get; }
[ImporterHeader(Name = "状态",IsIgnore =true)]
public int State { get; set; }
[ImporterHeader(Name = "物料代码")]
[ImporterHeader(Name = "结算物料号")]
/// <summary>
/// 扩展字段1
/// </summary>
@ -536,20 +800,254 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "扩展字段2",IsIgnore =true)]
[ImporterHeader(Name = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号",IsIgnore =true)]
public string Version { set; get; }
[ImporterHeader(Name = "开票数量")]
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "单据号", IsIgnore = true)]
public string BillNum { set; get; }
public Guid TaskId { set; get; }
}
public class WmsHQHKanbanOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsHQHKanbanOutPut()
{
}
public WmsHQHKanbanOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
/// <summary>
/// 看板明细
/// </summary>
public class WmsHQHKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsHQHKanbanOutPutDetial()
{
}
public WmsHQHKanbanOutPutDetial(Guid id, string wmsBillNum, string kanban, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, string poline)
{
Id = id;
WmsBillNum = wmsBillNum;
Kanban = kanban;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
PoLine = poline;
}
public void SetData(Guid id, string remark, string wmsbillnum, string version, Guid taskId)
{
Id = id;
Remark = remark;
WmsBillNum = wmsbillnum;
Version = version;
TaskId = taskId;
}
[ImporterHeader(Name = "行号")]
public string PoLine { set; get; }
[ImporterHeader(Name = "订货看板编号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
//[ImporterHeader(Name = "订货看板编号")]
////KENN号
//public string OrderBillNum { set; get; }
[ImporterHeader(Name = "Sap编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "零件中文名称")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "发货零件号")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务描述", IsIgnore = true)]
public Guid TaskId { set; get; }
}
/// <summary>
/// 备件出库
/// </summary>
public class WmsHQHSharePartOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsHQHSharePartOutPut()
{
}
public WmsHQHSharePartOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
/// <summary>
/// 备件出库明细
/// </summary>
public class WmsHQHSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsHQHSharePartOutPutDetial()
{
}
public WmsHQHSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty,decimal stockQty)
{
Id = id;
WmsBillNum = wmsBillNum;
OrderBillNum = orderBillNum;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
StockQty = stockQty;
}
public void SetId(Guid id)
{
Id = id;
}
//交货单号
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号", IsIgnore = true)]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "看板号", IsIgnore = true)]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "Sap编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "结算物料号")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "单据号", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务ID", IsIgnore = true)]
public Guid TaskId { set; get; }
}
#endregion
/// <summary>
@ -713,16 +1211,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
Id = id;
}
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
// 期间 交货单号 发货日期 采购订单号 SAP编码 物料代码 物料描述 物料组 开票单价 数量差异 发货数量 开票数量 定价 单价差异
//交货单号
[ImporterHeader(Name = "组件组物料")]
[ImporterHeader(Name = "组件组物料",IsIgnore =true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "看板号")]
[ImporterHeader(Name = "采购订单号")]
//KENN号
public string OrderBillNum { set; get; }
@ -765,6 +1261,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public string BillNum { set; get; }
[ImporterHeader(Name = "任务代码", IsIgnore = true)]
public Guid TaskId { set; get; }

28
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/WmsOutPutPercent.cs

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
public class WmsOutPutPercent:FullAuditedAggregateRootBase<Guid>
{
public WmsOutPutPercent(Guid id,decimal completeQty, decimal applyQty, decimal cancelQty):base(id)
{
CompleteQty = completeQty;
ApplyQty = applyQty;
CancelQty = cancelQty;
}
public decimal CompleteQty { set; get; }
public decimal ApplyQty { set; get; }
public decimal CancelQty { set; get; }
}
}

163
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -333,9 +333,19 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsKanbanOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutVersion(options);
builder.ConfigureHQFKanban(options);
builder.ConfigureHQMKanban(options);
builder.ConfigureHQHKanban(options);
builder.ConfigureWmsHQFKanbanOutPutVersion(options);
builder.ConfigureWmsHQFKanbanOutPutDetial(options);
builder.ConfigureWmsHQFSharePartOutPutVersion(options);
builder.ConfigureWmsHQFSharePartOutPutDetial(options);
builder.ConfigureWmsHQHKanbanOutPutVersion(options);
builder.ConfigureWmsHQHKanbanOutPutDetial(options);
builder.ConfigureWmsHQHSharePartOutPutVersion(options);
builder.ConfigureWmsHQHSharePartOutPutDetial(options);
#endregion
}
@ -1228,6 +1238,159 @@ namespace Win.Sfs.SettleAccount
}
private static void ConfigureWmsHQFKanbanOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQFKanbanOutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQFKanbanOutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsHQFKanbanOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQFKanbanOutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQFKanbanOutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.PoLine).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Kanban).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ParentMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
});
}
private static void ConfigureWmsHQFSharePartOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQFSharePartOutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQFSharePartOutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsHQFSharePartOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQFSharePartOutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQFSharePartOutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OrderBillNum).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.PoLine).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.Kanban).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ParentMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
});
}
private static void ConfigureWmsHQHKanbanOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQHKanbanOutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQHKanbanOutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsHQHKanbanOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQHKanbanOutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQHKanbanOutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.PoLine).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Kanban).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ParentMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
});
}
private static void ConfigureWmsHQHSharePartOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQHSharePartOutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQHSharePartOutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsHQHSharePartOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsHQHSharePartOutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsHQHSharePartOutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OrderBillNum).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.PoLine).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.Kanban).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ParentMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.MaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
});
}
#endregion

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs

@ -164,5 +164,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var _list = DbConnection.Query<InvoiceSettleDiff>(string.Format(str, version));
return _list.ToList();
}
}
}

155
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs

@ -0,0 +1,155 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
/// <summary>
/// 红旗M平台输出报表
/// </summary>
public class HQCarSettledDetailDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQCarSettledDetailDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQCarSettleQtyDiff> GetDiffQtyList(string version)
{
List<HQCarSettleQtyDiff> _list = new List<HQCarSettleQtyDiff>();
var str =
"SELECT\n" +
" temp1.MaterialCode 客户物料号,\n" +
" temp1.HQMKanBan 看板号 ,\n" +
" temp1.SettleQty 结算数量,\n" +
" temp2.Qty 发货数量,\n" +
" ( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"FROM\n" +
" ( SELECT SUM ( Qty ) SettleQty, HQMKanBan, MaterialCode FROM Set_HQ_M_Platform WHERE version = '{0}' GROUP BY HQMKanBan, MaterialCode ) temp1\n" +
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_M_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQMKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode \n" +
"WHERE\n" +
" temp1.SettleQty!= temp2.Qty";
str = string.Format(str, version);
var _query = DbConnection.Query<HQCarSettleQtyDiff>(str, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQCarSettledDetailDiff> GetHQCarSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQCarSettledDetailDiff> _list = new List<HQCarSettledDetailDiff>();
string condition = " ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 销售单价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.Price 结算单价,\n" +
" A.Qty 结算数量,\n" +
" A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" Price,\n" +
" SUM ( Qty ) Qty,\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc \n" +
" FROM\n" +
" Set_BT_Car_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" {1} \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" price \n" +
" ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQCarSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
public class HQCarSettledDetailDiff
{
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算物料号")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算物料描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "寄销库数量")]
public decimal { set; get; }
}
public class HQCarSettleQtyDiff
{
public string { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public string { set; get; }
}
}

8
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs

@ -116,7 +116,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List<HQFSettledDetailDiff> _list = new List<HQFSettledDetailDiff>();
string condition = " where 1=1 ";
string condition = " ";
////if (!string.IsNullOrEmpty(materialCode))
@ -213,8 +213,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<HQFSettleQtyDiff> GetDiffQtyList(string version)
{
List<HQFSettleQtyDiff> _list = new List<HQFSettleQtyDiff>();
@ -245,9 +243,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List<HQFSharePartSettledDetailDiff> _list = new List<HQFSharePartSettledDetailDiff>();
string condition = " where 1=1 ";
string condition =string.Empty;
if (!string.IsNullOrEmpty(begin))
{

107
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFShippingDapperRepository.cs

@ -0,0 +1,107 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class HQFShippingDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQFShippingDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQFShippingDiff> GetHQFShippingReportList(string version, string begin, string end)
{
List<HQFShippingDiff> _list = new List<HQFShippingDiff>();
string condition = " ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and b.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and b.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" Isnull( TEMP2.Price, 0 ) 单价 ,\n" +
" Round( Isnull( TEMP2.Price, 0 ) * temp1.数量, 2 ) 金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.LastModificationTime 交货时间,\n" +
" A.WmsBillNum 交货单号,\n" +
" A.PoLine 行号,\n" +
" A.MaterialCode 发货零件号,\n" +
" B.MaterialCode Sap零件号,\n" +
" A.MaterialDesc 物料描述,\n" +
" A.Qty 数量,\n" +
" A.Kanban 看板号,\n" +
" A.IsAuto 手工或自动 ,\n" +
" A.Warehouse 收货仓库,\n" +
" A.WarehouseDesc 收货仓库描述,\n" +
" A.Supplier 供应商 \n" +
" FROM\n" +
" Set_HQ_H_Kanban AS A\n" +
" LEFT OUTER JOIN Set_HQ_F_Platform AS B ON A.Kanban = B.HQHKanBan \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS C ON A.MaterialCode = C.CustomerPartCode \n" +
" WHERE\n" +
" ( B.Id IS NULL ) \n" +
" {0} \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) TEMP2 ON temp1.Sap零件号= temp2.MaterialCode";
var _sql = string.Format(str, condition);
var _query = DbConnection.Query<HQFShippingDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
public class HQFShippingDiff
{
[ExporterHeader(DisplayName = "交货单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string { set; get; }
[ExporterHeader(DisplayName = "行号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap零件号")]
public string Sap零件号 { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "看板号")]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "供应商")]
public string { set; get; }
}
}

8
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -25,9 +25,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List<HQHSettledDetailDiff> _list = new List<HQHSettledDetailDiff>();
string condition = " where 1=1 ";
//string condition = " where 1=1 ";
string condition = " ";
////if (!string.IsNullOrEmpty(materialCode))
////{
@ -174,9 +174,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List<HQHSharePartSettledDetailDiff> _list = new List<HQHSharePartSettledDetailDiff>();
string condition = " where 1=1 ";
//string condition = " where 1=1 ";
string condition = " ";
if (!string.IsNullOrEmpty(begin))
{

109
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHShippingDapperRepository.cs

@ -0,0 +1,109 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class HQHShippingDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQHShippingDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQHShippingDiff> GetHQHShippingReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQHShippingDiff> _list = new List<HQHShippingDiff>();
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and b.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and b.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" Isnull( TEMP2.Price, 0 ) 单价 ,\n" +
" Round( Isnull( TEMP2.Price, 0 ) * temp1.数量, 2 ) 金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.LastModificationTime 交货时间,\n" +
" A.WmsBillNum 交货单号,\n" +
" A.PoLine 行号,\n" +
" A.MaterialCode 发货零件号,\n" +
" B.MaterialCode Sap零件号,\n" +
" A.MaterialDesc 物料描述,\n" +
" A.Qty 数量,\n" +
" A.Kanban 看板号,\n" +
" A.IsAuto 手工或自动 ,\n" +
" A.Warehouse 收货仓库,\n" +
" A.WarehouseDesc 收货仓库描述,\n" +
" A.Supplier 供应商 \n" +
" FROM\n" +
" Set_HQ_H_Kanban AS A\n" +
" LEFT OUTER JOIN Set_HQ_H_Platform AS B ON A.Kanban = B.HQHKanBan \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS C ON A.MaterialCode = C.CustomerPartCode \n" +
" WHERE\n" +
" ( B.Id IS NULL ) \n" +
" {0} \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) TEMP2 ON temp1.Sap零件号= temp2.MaterialCode";
var _sql = string.Format(str, condition);
var _query = DbConnection.Query<HQHShippingDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
public class HQHShippingDiff
{
[ExporterHeader(DisplayName = "交货单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string { set; get; }
[ExporterHeader(DisplayName = "行号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap零件号")]
public string Sap零件号 { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "看板号")]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "供应商")]
public string { set; get; }
}
}

8
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs

@ -25,7 +25,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List<HQMSettledDetailDiff> _list = new List<HQMSettledDetailDiff>();
string condition = " where 1=1 ";
string condition = " ";
////if (!string.IsNullOrEmpty(materialCode))
@ -112,7 +112,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.HQMKanBan <> 'BJ' ) \n" +
" AND a.Version= '{0}' { 1 } \n" +
" AND a.Version= '{0}' {1} \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition);
@ -155,7 +155,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List<HQMSharePartSettledDetailDiff> _list = new List<HQMSharePartSettledDetailDiff>();
string condition = " where 1=1 ";
string condition = " ";
@ -197,7 +197,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" Set_HQ_M_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND HQHKanBan = 'BJ' { 1 } \n" +
" AND HQHKanBan = 'BJ' {1} \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +

107
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMShippingDapperRepository.cs

@ -0,0 +1,107 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class HQMShippingDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQMShippingDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQMShippingDiff> GetHQFShippingReportList(string version, string begin, string end)
{
List<HQMShippingDiff> _list = new List<HQMShippingDiff>();
string condition = " ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and b.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and b.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" Isnull( TEMP2.Price, 0 ) 单价 ,\n" +
" Round( Isnull( TEMP2.Price, 0 ) * temp1.数量, 2 ) 金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.LastModificationTime 交货时间,\n" +
" A.WmsBillNum 交货单号,\n" +
" A.PoLine 行号,\n" +
" A.MaterialCode 发货零件号,\n" +
" B.MaterialCode Sap零件号,\n" +
" A.MaterialDesc 物料描述,\n" +
" A.Qty 数量,\n" +
" A.Kanban 看板号,\n" +
" A.IsAuto 手工或自动 ,\n" +
" A.Warehouse 收货仓库,\n" +
" A.WarehouseDesc 收货仓库描述,\n" +
" A.Supplier 供应商 \n" +
" FROM\n" +
" Set_HQ_H_Kanban AS A\n" +
" LEFT OUTER JOIN Set_HQ_M_Platform AS B ON A.Kanban = B.HQMKanBan \n" +
" AND A.MaterialCode = B.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS C ON A.MaterialCode = C.CustomerPartCode \n" +
" WHERE\n" +
" ( B.Id IS NULL ) \n" +
" {0} \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) TEMP2 ON temp1.Sap零件号= temp2.MaterialCode";
var _sql = string.Format(str, condition);
var _query = DbConnection.Query<HQMShippingDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
public class HQMShippingDiff
{
[ExporterHeader(DisplayName = "交货单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string { set; get; }
[ExporterHeader(DisplayName = "行号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap零件号")]
public string Sap零件号 { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "看板号")]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "供应商")]
public string { set; get; }
}
}

253
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

@ -2,6 +2,7 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -23,59 +24,53 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public virtual List<SettleSparePartExport> GetSettleSparePartReportList(string purchaseOrderNo, string version, string sapCode, string matialCode,
string begintime, string endtime)
{
string sqlString = "SELECT\n" +
" * ,\n" +
" ( Price - InvoicePrice ) AS InvoiceDiffPrice,--单价差异\n" +
" ISNULL( Price * ReceiptQty - InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异\n" +
" \n" +
"FROM\n" +
string sqlString =
" SELECT\n" +
" temp1.期间,\n" +
" temp1.交货单号,\n" +
" temp1.发货日期,\n" +
" temp1.采购订单号,\n" +
" temp1.SAP编码,\n" +
" temp1.物料代码,\n" +
" temp1.物料描述,\n" +
" temp1.物料组,\n" +
" temp1.开票单价,\n" +
" temp1.数量差异,\n" +
" temp1.发货数量,\n" +
" temp1.开票数量,\n" +
" ISNULL( TEMP2.Price, 0 ) AS 定价,\n" +
" temp1.开票单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" c.LineNumber,--行号\n" +
" c.Period AS WMSDeliveryDate,--交货日期\n" +
" c.WMSDeliveryNote,--交货单号\n" +
" c.SpareDate AS OrderDate,--订单日期\n" +
" a.PurchaseOrderNo,--采购订单号\n" +
" b.MaterialCode AS SAPCode,--SAP编码,即厂内物料号\n" +
" a.MaterialCode,--物料代码\n" +
" b.MaterialDesc,--物料描述\n" +
" a.PurchaseOrderNoText,--采购订单文本\n" +
" c.ReceiptQty,-- 发货数量\n" +
" a.InvoicedQty AS InvoicedQty,--开票数量\n" +
" ( c.ReceiptQty- d.Amt ) AS SettleInvoiceDiffQty,--发货与开票差异\n" +
" d.InvoicePrice,--开票单价\n" +
" 0 AS InvoiceMoney --开票金额\n" +
" \n" +
" a.Version AS 期间,\n" +
" b.WMSDeliveryNote AS 交货单号,\n" +
" b.SpareDate AS 发货日期,\n" +
" a.PurchaseOrderNo AS 采购订单号,\n" +
" c.MaterialCode AS SAP编码,\n" +
" a.MaterialCode AS 物料代码,\n" +
" c.MaterialDesc AS 物料描述,\n" +
" c.EstimateTypeDesc AS 物料组,\n" +
" a.PurchasePriceNoTax AS 开票单价,\n" +
" 0 AS 数量差异,\n" +
" ISNULL( b.ReceiptQty, 0 ) AS 发货数量,\n" +
" ISNULL( b.ReceiptQty, 0 ) AS 开票数量 \n" +
" FROM\n" +
" (SELECT SUM( ReceiptQty ) AS ReceiptQty, PurchaseOrderNo, MaterialCode, Version, PurchasePriceNoTax FROM Set_SparePart GROUP BY PurchaseOrderNo, MaterialCode, Version, PurchasePriceNoTax ) AS a\n" +
" LEFT OUTER JOIN Set_WMSSparePart AS b ON a.PurchaseOrderNo = b.PurchaseOrderNo \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.Version = '{0}' )) AS temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" t.PurchaseOrderNoText,\n" +
" t.LineNumber,\n" +
" t.PurchaseOrderNo,\n" +
" t.MaterialCode,\n" +
" MAX ( t.SpareDate ) SpareDate,\n" +
" t.DeliveryOrderNo,\n" +
" SUM ( t.InvoicedQty ) AS InvoicedQty \n" +
" FROM\n" +
" Set_SparePart t \n" +
" WHERE\n" +
" t.Version= '{0}' \n" +
" GROUP BY\n" +
" t.PurchaseOrderNo,\n" +
" t.MaterialCode,\n" +
" t.SpareDate,\n" +
" t.DeliveryOrderNo,\n" +
" t.LineNumber,\n" +
" t.PurchaseOrderNoText \n" +
" ) AS a\n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode\n" +
" LEFT JOIN Set_WMSSparePart c ON a.PurchaseOrderNo= c.WMSDeliveryNote \n" +
" AND a.MaterialCode= c.MaterialCode\n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode, Amt FROM set_invoice WHERE version = '{0}' GROUP BY materialcode, Amt ) d ON a.MaterialCode= d.MaterialCode \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, --定价\n" +
" MaterialCode --厂内物料号\n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode";
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX(Version) AS Expr1 FROM Set_PriceList ))) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
//if (!string.IsNullOrEmpty(purchaseOrderNo))
@ -135,7 +130,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) TEMP1 \n" +
" LEFT JOIN ( SELECT Price, --定价 \n" +
" MaterialCode --厂内物料号 \n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode ";
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList_20 ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode ";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
//if (!string.IsNullOrEmpty(purchaseOrderNo))
@ -162,66 +157,146 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<SparePartSumQtyDiff> GetSettleSparePartSumQtyDiff(string version)
{
string sqlString = "SELECT\n" +
" ISNULL( A.ReceiptQty - ISNULL( B.ReceiptQty, 0 ), 0 ) 数量差异,\n" +
" a.PurchaseOrderNo 订单号,\n" +
" a.MaterialCode 物料号 \n" +
" FROM\n" +
" ( SELECT sum( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_SparePart where Version='{0}' GROUP BY PurchaseOrderNo, MaterialCode ) A\n" +
" LEFT JOIN ( SELECT sum( ReceiptQty ) ReceiptQty, PurchaseOrderNo, MaterialCode FROM Set_WMSSparePart GROUP BY PurchaseOrderNo, MaterialCode ) B ON A.MaterialCode = B.MaterialCode \n" +
" AND A.PurchaseOrderNo = B.PurchaseOrderNo";
string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version);
string _sql = string.Format(addSqlStr, addwhere);
var _query = DbConnection.Query<SparePartSumQtyDiff>(_sql, null, null, true, 1200, null);
return _query.ToList();
}
}
/// <summary>
/// 大众看板有条码报表
/// </summary>
//[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)]
public class SparePartSumQtyDiff
{
public decimal { set; get; }
public string { set; get; }
public string { set; get; }
}
/// <summary>
/// 大众看板有条码报表
/// </summary>
//[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)]
public class SettleSparePartExport
{
[ExporterHeader(DisplayName = "行号")]
public string LineNumber { set; get; }
[ExporterHeader(DisplayName = "交货日期")]
public string WMSDeliveryDate { set; get; }
[ExporterHeader(DisplayName = "期间 ")]
public string {set;get;}
[ExporterHeader(DisplayName = "交货单号 ")]
public string {set;get;}
[ExporterHeader(DisplayName = "发货日期")]
public string {set;get;}
[ExporterHeader(DisplayName = "采购订单号")]
public string {set;get;}
[ExporterHeader(DisplayName = "SAP编码")]
public string SAP编码 {set;get;}
[ExporterHeader(DisplayName = "物料代码")]
public string {set;get;}
[ExporterHeader(DisplayName = "物料描述")]
public string {set;get;}
[ExporterHeader(DisplayName = "物料组")]
public string {set;get;}
[ExporterHeader(DisplayName = "开票单价")]
public decimal {set;get;}
[ExporterHeader(DisplayName = "数量差异")]
public decimal {set;get;}
[ExporterHeader(DisplayName = "发货数量")]
public decimal {set;get;}
[ExporterHeader(DisplayName = "开票数量")]
public decimal {set;get;}
[ExporterHeader(DisplayName = "定价")]
public decimal {set;get;}
[ExporterHeader(DisplayName = "单价差异")]
public decimal { set; get;}
[ExporterHeader(DisplayName = "交货单号")]
public string DeliveryOrderNo { set; get; }
[ExporterHeader(DisplayName = "订单日期")]
public DateTime OrderDate{ set; get; }
[ExporterHeader(DisplayName = "采购订单号")]
public string PurchaseOrderNo { set; get; }
[ExporterHeader(DisplayName = "SAP编码")]
public string SAPCode { set; get; }
[ExporterHeader(DisplayName = "物料代码")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "采购订单文本")]
public string PurchaseOrderNoText { set; get; }
//[ExporterHeader(DisplayName = "行号")]
//public string LineNumber { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal ReceiptQty { set; get; }
//[ExporterHeader(DisplayName = "交货日期")]
//public string WMSDeliveryDate { set; get; }
[ExporterHeader(DisplayName = "开票数量")]
public decimal InvoicedQty { set; get; }
//[ExporterHeader(DisplayName = "交货单号")]
//public string DeliveryOrderNo { set; get; }
[ExporterHeader(DisplayName = "发货与开票差异")]
public decimal SettleInvoiceDiffQty { set; get; }
//[ExporterHeader(DisplayName = "订单日期")]
//public DateTime OrderDate{ set; get; }
[ExporterHeader(DisplayName = "开票单价")]
public decimal InvoicePrice { set; get; }
//[ExporterHeader(DisplayName = "采购订单号")]
//public string PurchaseOrderNo { set; get; }
[ExporterHeader(DisplayName = "开票金额")]
public decimal InvoiceMoney { set; get; }
[ExporterHeader(DisplayName = "定价")]
public decimal Price { set; get; }
//[ExporterHeader(DisplayName = "SAP编码")]
//public string SAPCode { set; get; }
[ExporterHeader(DisplayName = "单价差异")]
public decimal InvoiceDiffPrice { set; get; }
//[ExporterHeader(DisplayName = "物料代码")]
//public string MaterialCode { set; get; }
//[ExporterHeader(DisplayName = "物料描述")]
//public string MaterialDesc { set; get; }
//[ExporterHeader(DisplayName = "采购订单文本")]
//public string PurchaseOrderNoText { set; get; }
//[ExporterHeader(DisplayName = "发货数量")]
//public decimal ReceiptQty { set; get; }
//[ExporterHeader(DisplayName = "开票数量")]
//public decimal InvoicedQty { set; get; }
//[ExporterHeader(DisplayName = "发货与开票差异")]
//public decimal SettleInvoiceDiffQty { set; get; }
//[ExporterHeader(DisplayName = "开票单价")]
//public decimal InvoicePrice { set; get; }
//[ExporterHeader(DisplayName = "开票金额")]
//public decimal InvoiceMoney { set; get; }
//[ExporterHeader(DisplayName = "定价")]
//public decimal Price { set; get; }
//[ExporterHeader(DisplayName = "单价差异")]
//public decimal InvoiceDiffPrice { set; get; }
[ExporterHeader(DisplayName = "总金额差异")]
public decimal SumDiffMoney { set; get; }
//[ExporterHeader(DisplayName = "总金额差异")]
//public decimal SumDiffMoney { set; get; }
}
}

103
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQCarSettledDetailDiffExportService.cs

@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// 一汽轿车核对明细
/// </summary>
public class HQCarSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQCarSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQCarSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQCarSettledDetailDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var kanban = p_list.Where(p => p.Name == "Kanban").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetHQCarSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQCarSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

18
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs

@ -51,17 +51,16 @@ namespace SettleAccount.Job.Services
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst=_dapperRepository.GetDiffQtyList(version);
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst = _dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p.==itm.);
if(_first!=null)
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first.+ itm.;
_first. = _first. + itm.;
_first. = itm.;
}
}
}
if (!string.IsNullOrEmpty(kanban))
{
@ -71,9 +70,7 @@ namespace SettleAccount.Job.Services
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
@ -81,7 +78,6 @@ namespace SettleAccount.Job.Services
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(acceptNo))
{
var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();

51
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFShippingExportService.cs

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class HQFShippingExportService : ITransientDependency, IExportJob
{
private readonly HQFShippingDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQFShippingExportService(
ErpPartDapperRepository erpdapperRepository,
HQFShippingDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _ls = _dapperRepository.GetHQFShippingReportList(version, begin, end);
_outputService.Export<HQFShippingDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

5
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs

@ -51,13 +51,12 @@ namespace SettleAccount.Job.Services.Report
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst = _dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first. + itm.;
_first. = _first. + itm.;
_first. = itm.;
}
}
@ -69,8 +68,6 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();

57
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHShippingExportService.cs

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class HQHShippingExportService : ITransientDependency, IExportJob
{
private readonly HQHShippingDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQHShippingExportService(
ErpPartDapperRepository erpdapperRepository,
HQHShippingDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var kanban = p_list.Where(p => p.Name == "Kanban").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
//var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetHQHShippingReportList(version, materialCode, begin, end, materialGroup);
_outputService.Export<HQHShippingDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

4
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs

@ -11,7 +11,7 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// 红旗H平台
/// 红旗M平台
/// </summary>
public class HQMSettledDetailDiffExportService : ITransientDependency, IExportJob
{
@ -57,7 +57,7 @@ namespace SettleAccount.Job.Services.Report
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first. + itm.;
_first. = _first. + itm.;
_first. = itm.;
}
}

118
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSharePartSettledDetailDiffExportService.cs

@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class HQMSharePartSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQMSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQMSharePartSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQMSettledDetailDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var kanban = p_list.Where(p => p.Name == "Kanban").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _lst=_dapperRepository.GetDiffQtyList(version);
//foreach (var itm in _lst)
//{
// var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号==itm.客户物料号);
// if(_first!=null)
// {
// _first.发货数量 = _first.结算数量+ itm.差异数量;
// _first.数量差异 = itm.差异数量;
// }
//}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = acceptNo.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQMSharePartSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

51
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMShippingExportService.cs

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class HQMShippingExportService : ITransientDependency, IExportJob
{
private readonly HQMShippingDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQMShippingExportService(
ErpPartDapperRepository erpdapperRepository,
HQMShippingDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _ls = _dapperRepository.GetHQFShippingReportList(version, begin, end);
_outputService.Export<HQMShippingDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

7
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs

@ -43,11 +43,7 @@ namespace SettleAccount.Job.Services
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
@ -129,8 +125,6 @@ namespace SettleAccount.Job.Services
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
}
}
if (!string.IsNullOrEmpty(kenncode))
{
var _groupList = kenncode.Split("\n").ToList();
@ -163,7 +157,6 @@ namespace SettleAccount.Job.Services
_ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
_ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();
}

56
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs

@ -26,30 +26,70 @@ namespace SettleAccount.Job.Services.Report
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var fileName=exportName.FirstOrDefault();
var purchaseOrderNo = p_list.Where(p => p.Name == "PurchaseOrderNo").FirstOrDefault().Value;
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SAPCode").FirstOrDefault().Value;
var matialCode = p_list.Where(p => p.Name == "MatialCode").FirstOrDefault().Value;
var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value;
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _list = _dapper.GetSettleSparePartReportList(purchaseOrderNo, version, sapCode, matialCode, beginTime, endTime);
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
var _ls = _dapper.GetSettleSparePartReportList(purchaseOrderNo, version, sapCode, matialCode, beginTime, endTime);
var diffList = _dapper.GetSettleSparePartSumQtyDiff(version);
if (diffList != null)
{
foreach (var itm in diffList)
{
var _first = _list.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode);
var _first = _ls.FirstOrDefault(p => p. == itm. && p.==itm.);
if (_first != null)
{
_first.InvoicedQty = _first.InvoicedQty + itm.DiffQty;//开票数量(结算数量+差异)
_first.InvoiceMoney = Math.Round(_first.InvoicedQty * _first.InvoicePrice, 2);//开票总金额(开票数量*开票单价)
_first.SumDiffMoney = (_first.ReceiptQty * _first.Price) - _first.InvoiceMoney;//总金额差异(结算金额-开票金额)
_first. = _first. + itm.;//开票数量(结算数量+差异)
_first. = itm.;
}
}
}
_outputService.Export<SettleSparePartExport>(id, string.Format("大众备件结算核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _list);
//if (!string.IsNullOrEmpty(materialGroup))
//{
// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
// }
//}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList();
}
}
if (!string.IsNullOrEmpty(matialCode))
{
var _groupList = matialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(purchaseOrderNo))
{
var _groupList = purchaseOrderNo.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
_outputService.Export<SettleSparePartExport>(id, fileName, _ls);
return id.ToString();

38
src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

@ -148,6 +148,7 @@ namespace Win.Sfs.SettleAccount
{
return implementationFactory.GetService<SharePartUnSettledExport>();
}
//红旗、一汽轿车结算报表
if (key.Equals(typeof(HQFSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQFSettledDetailDiffExportService>();
@ -156,8 +157,43 @@ namespace Win.Sfs.SettleAccount
{
return implementationFactory.GetService<HQFSharePartSettledDetailDiffExportService>();
}
if (key.Equals(typeof(HQMSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQMSettledDetailDiffExportService>();
}
if (key.Equals(typeof(HQMSharePartSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQMSharePartSettledDetailDiffExportService>();
}
if (key.Equals(typeof(HQHSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQHSettledDetailDiffExportService>();
}
if (key.Equals(typeof(HQHSharePartSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQHSharePartSettledDetailDiffExportService>();
}
//一汽轿车
if (key.Equals(typeof(HQCarSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQCarSettledDetailDiffExportService>();
}
//红旗、轿车发运报表
if (key.Equals(typeof(HQMShippingExportService).FullName))
{
return implementationFactory.GetService<HQMShippingExportService>();
}
if (key.Equals(typeof(HQHShippingExportService).FullName))
{
return implementationFactory.GetService<HQHShippingExportService>();
}
if (key.Equals(typeof(HQFShippingExportService).FullName))
{
return implementationFactory.GetService<HQFShippingExportService>();
}
else
{

BIN
src/Modules/SettleAccount/数据库修改记录.xlsx

Binary file not shown.

64
vue/src/router/modules/hq_out_order.js

@ -0,0 +1,64 @@
//大众-FIS结算-路由
import Layout from '@/layout'
const hqOutOrderDataRouter = {
path: '/cpat-order',
component: Layout,
redirect: 'pg',
name: '业务数据',
//hidden: true,
meta: {
//requiresAuth: true,
title: '红旗出库单管理',
index: 0,
type: 'crm',
icon: '单据导入',
keepAlive: false,
},
children: [
{
path: 'hq-h-outorder',
component: () => import('@/views/ux/billManage/vwOutOrder/index'),
name: 'SettleAccount',//命名路由
meta: {
title: '大众准时化出库单',
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
icon: '结算'
}
},
{
path: 'hq-m-outorder',
component: () => import('@/views/ux/billManage/kanbanOutOrder/index'),
name: 'SettleAccount',//命名路由
meta: {
title: '大众看板出库单',
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
icon: '结算'
}
},
{
path: 'hq-f-withoutorder',
component: () => import('@/views/ux/billManage/kanbanWithOutOrder/index'),
name: 'SettleAccount',//命名路由
meta: {
title: '大众无条码看板出库单',
roles: ['SettleAccount.SettleAccounts'],//控制页面角色(可以设置多个角色)
icon: '结算'
}
},
{
path: 'hq-car-outorder',
component: () => import('@/views/ux/billManage/sparepartOutOrder/index'),
name: 'Invoices',//命名路由
meta: {
title: '大众备件出库单',
roles: ['SettleAccount.Invoices'],
icon: '对比'
}
},
]
}
export default hqOutOrderDataRouter
Loading…
Cancel
Save