yunfeng.liu
3 years ago
38 changed files with 5906 additions and 674 deletions
File diff suppressed because it is too large
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -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; |
|||
} |
|||
} |
|||
|
|||
} |
@ -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; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
@ -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; |
|||
} |
|||
} |
|||
} |
@ -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; } |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -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; } |
|||
} |
|||
} |
@ -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; } |
|||
|
|||
} |
|||
} |
@ -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; } |
|||
|
|||
} |
|||
|
|||
} |
@ -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; } |
|||
|
|||
} |
|||
} |
@ -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(); |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
@ -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(); |
|||
} |
|||
|
|||
} |
|||
} |
@ -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(); |
|||
} |
|||
|
|||
} |
|||
} |
@ -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(); |
|||
} |
|||
|
|||
} |
|||
} |
@ -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(); |
|||
} |
|||
|
|||
} |
|||
} |
Binary file not shown.
@ -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…
Reference in new issue