44673626 3 years ago
parent
commit
431f5b61dd
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs
  2. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs
  3. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHSharePartAppService.cs
  4. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs
  5. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  6. 1
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs
  7. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  8. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs
  9. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs
  10. 9
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs

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

@ -313,7 +313,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsHQFKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsHQFKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }

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

@ -310,7 +310,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }
@ -514,6 +514,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email); var _version = new WmsHQHKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;

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

@ -315,6 +315,8 @@ into temp1
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsHQHSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsHQHSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark= !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs

@ -408,6 +408,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
,itm.Qty ,itm.Qty
,itm.Price ,itm.Price
,Math.Round(itm.Qty*itm.Price,2) ,Math.Round(itm.Qty*itm.Price,2)
); );
_lsCopy.Add(_detail); _lsCopy.Add(_detail);
} }
@ -443,6 +444,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_count == 0 && _wmslst.Count()>0) if (_count == 0 && _wmslst.Count()>0)
{ {
var _version = new WmsJitOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsJitOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
//var _ls = new List<WmsJitOutPut>(); //var _ls = new List<WmsJitOutPut>();
//_ls.Add(_version); //_ls.Add(_version);
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);

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

@ -344,13 +344,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
foreach (var itm in _wmslst) foreach (var itm in _wmslst)
{ {
itm.BillNum = _billNum; itm.BillNum = _billNum;
} }
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum); int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_count == 0 && _wmslst.Count()>0) if (_count == 0 && _wmslst.Count()>0)
{ {
var _version = new WmsKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }

1
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs

@ -296,6 +296,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsWithOutKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsWithOutKanbanOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }
return ApplicationConsts.SuccessStr; ; return ApplicationConsts.SuccessStr; ;

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

@ -404,6 +404,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_wmslst.Count() > 0 && _count == 0) if (_wmslst.Count() > 0 && _count == 0)
{ {
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNoNum, CurrentUser.Email); var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNoNum, CurrentUser.Email);
_version.Remark= !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }
foreach (var job in _joblist) foreach (var job in _joblist)
@ -486,6 +489,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (_wmslstBill.Count() > 0 && _count == 0) if (_wmslstBill.Count() > 0 && _count == 0)
{ {
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark= !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }
foreach (var job in _joblist) foreach (var job in _joblist)

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs

@ -268,7 +268,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsHQCarOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email); var _version = new WmsHQCarOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark = !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }

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

@ -152,9 +152,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.CustomerPartCode,\n" + " C.CustomerPartCode,\n" +
" C.EstimateTypeDesc MaterialGroup,\n" + " C.EstimateTypeDesc MaterialGroup,\n" +
" ISNULL( B.Qty, 0 ) SettleQty,\n" + " ISNULL( B.Qty, 0 ) SettleQty,\n" +
" a.Qty,\n" + " a.WMSDeliveryQty,\n" +
" (\n" + " (\n" +
" a.Qty - ISNULL( b.Qty, 0 )) AS DiffQty \n" + " a.WMSDeliveryQty - ISNULL( b.Qty, 0 )) AS DiffQty \n" +
" FROM\n" + " FROM\n" +
" Set_WMSKanBanSettle A\n" + " Set_WMSKanBanSettle A\n" +
" LEFT JOIN ( SELECT * FROM Set_KanBanSettle WHERE version = '{0}' ) B ON A.Kanban = B.Kanban \n" + " LEFT JOIN ( SELECT * FROM Set_KanBanSettle WHERE version = '{0}' ) B ON A.Kanban = B.Kanban \n" +

9
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs

@ -42,7 +42,7 @@ namespace SettleAccount.Job.Services.Report
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var _ls = _dapper.GetKanbanReportList(version, begin,end); var _ls = _dapper.GetKanbanReportList(version, begin,end);
var _lst = _dapper.GetNoKanbanReportList(version, begin, end); // var _lst = _dapper.GetNoKanbanReportList(version, begin, end);
if (!string.IsNullOrEmpty(materialGroup)) if (!string.IsNullOrEmpty(materialGroup))
{ {
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
@ -72,7 +72,7 @@ namespace SettleAccount.Job.Services.Report
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0) if (_groupList.Count() > 0)
{ {
_lst = _lst.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
} }
} }
//if (!string.IsNullOrEmpty(materialCode)) //if (!string.IsNullOrEmpty(materialCode))
@ -88,13 +88,12 @@ namespace SettleAccount.Job.Services.Report
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0) if (_groupList.Count() > 0)
{ {
_lst = _lst.Where(p => _groupList.Contains(p.SapCode)).ToList(); _ls = _ls.Where(p => _groupList.Contains(p.SapCode)).ToList();
} }
} }
ExcelExporter _exporter = new ExcelExporter();//导出Excel ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(_ls.ToList(), "有看板号未结差异对比") var result = _exporter.Append(_ls.ToList(), "有看板号未结差异对比")
.SeparateBySheet()
.Append(_lst.ToList(), "无看板号未结差异对比")
.ExportAppendDataAsByteArray(); .ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(_filename, result.Result, true); _fileContainer.SaveAsync(_filename, result.Result, true);

Loading…
Cancel
Save