Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:6090/Win.Sfs.SmartSettlementSystem.PG

# Conflicts:
#	src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
branch_ccpg_220107
44673626 3 years ago
parent
commit
91a3ba6a30
  1. BIN
      .vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo
  2. 18
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
  3. 14
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  4. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs
  5. 29
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs
  6. 489
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFKanbanAppService.cs
  7. 418
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQFSharePartAppService .cs
  8. 57
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  9. 134
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  10. 25
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Kanban.cs
  11. 281
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  12. 51
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  13. 341
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs
  14. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs
  15. 124
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs
  16. 123
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs
  17. 9
      src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

BIN
.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo

Binary file not shown.

18
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json

@ -2,17 +2,17 @@
"App": { "App": {
"CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088" "CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088"
}, },
//"ConnectionStrings": {
// "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;" "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//"Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
//"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
}, },
//"ConnectionStrings": {
// "Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
// "SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;"
// //"Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
// //"SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
// //"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
//},
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",

14
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -2,18 +2,18 @@
"App": { "App": {
"CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088" "CorsOrigins": "https://*.abc.com,http://localhost:9528,http://149.223.116.5:8088"
}, },
//"ConnectionStrings": {
// "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": { "ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1", "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;", "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService1;user id=sa;Password=1q2w!@#;"
},
//"ConnectionStrings": {
// //"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
// //"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;",
// "Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;", // "Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
// "SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;", // "SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
// "Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;" // "Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
}, //},
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",

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

@ -287,8 +287,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms
//物料号 //物料号
public string MaterialCode { set; get; } public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")] [ImporterHeader(Name = "物料描述")]
//物料描述 //物料描述
public string MaterialDesc { set; get; } public string MaterialDesc { set; get; }
@ -301,6 +299,8 @@ namespace Win.Sfs.SettleAccount.Entities.Wms
} }

29
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs

@ -6,6 +6,35 @@ using System.Threading.Tasks;
namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto
{ {
public class HQKanbanRequestDto
{
public string Version { set; get; }
public string MaterialCode { set; get; }
public string Begin { set; get; }
public string End { set; get; }
public string MaterialGroup { set; get; }
public string SapCode { set; get; }
public string WarehouseDesc { set; get; }
public string AcceptNo { set; get; }
public string Kanban { set; get; }
public string State { set; get; }
}
public class BaseRequestDto public class BaseRequestDto
{ {
public string Version { set; get; } public string Version { set; get; }

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

@ -0,0 +1,489 @@
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/WMSHQFKanbanoutput")]
public class WmsHQFKanbanAppService :
SettleAccountApplicationBase<WmsHQFKanbanOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsHQFKanbanOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQFKanbanOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQFKanbanOutPutDetial> _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 WmsHQFKanbanAppService(
IExcelImportAppService excelImportService,
ISettleAccountBranchEfCoreRepository<WmsHQFKanbanOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQFKanbanOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQFKanbanOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IDistributedCache<WmsHQFKanbanOutPutDetial> 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("WmsHQFKanbanList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQFKanbanOutPut>> 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<WmsHQFKanbanOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQFKanbanDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQFKanbanOutPutDetial>> 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<WmsHQFKanbanOutPutDetial>(totalCount, entities);
}
/// <summary>
/// 任务明细标记已确认
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQFKanbanOutPutAudit")]
[DisableRequestSizeLimit]
public async Task<bool> WmsHQFKanbanAudit(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<WmsHQFKanbanOutPutDetial> _lst = new List<WmsHQFKanbanOutPutDetial>();
// 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 WmsHQFKanbanOutPutDetial(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 WmsHQFKanbanOutPut(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("WmsHQFKanbanOutPut")]
public async Task<string> WmsHQFKanbanOutPut(WmsJitRequestDto input)
{
var _billNum = "K" + 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<WmsHQFKanbanOutPutDetial> _lst = new List<WmsHQFKanbanOutPutDetial>();
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<WmsHQFKanbanOutPutDetial>();
foreach (var itm in _list)
{
itm.SetData(GuidGenerator.Create(),string.Empty,!string.IsNullOrEmpty(itm.WmsBillNum)? itm.WmsBillNum:string.Empty,input.Version,GuidGenerator.Create());
}
_lst.AddRange(_list.ToArray());
}
// var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == input.Version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _lst on
new { itm1.MaterialCode, itm1.Kanban}
equals
new { itm2.MaterialCode, itm2.Kanban }
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 WmsHQFKanbanOutPut(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("WmsHQFKanbanOutPut-Pass")]
[UnitOfWork(false)]
public async Task<bool> WmsHQFKanbanOutPutPass(WmsJitRequestDto input)
{
if (input.Guids != null)
{
List<WmsHQFKanbanOutPutDetial> _ls = new List<WmsHQFKanbanOutPutDetial>();
if (input.Guids.Count() > 0)
{
_ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version ==input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == input.Version && p.BillNum == input.BillNum && p.State != 2).ToListAsync();
}
if (_ls.Count() > 0)
{
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output]\n" +
" @billnum = N'{0}',\n" +
" @type = 3\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum));
}
}
return true;
}
/// <summary>
///出库界面功能, 撤销核准出库
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsHQFKanbanOutPut-Cancel")]
public async Task<bool> WmsHQFKanbanOutPutCancel(WmsJitRequestDto input)
{
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).ToListAsync();
var _first = _ls.FirstOrDefault();
if (_ls.Count()>0)
{
var _guid = GuidGenerator.Create();
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", input.Version, "WmsHQFKanbanOutPutDetail", _first.BillNum, 0,0, _guid)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
TableName = "WmsHQFKanbanOutPutDetail",
InterfaceType = "2",
Version = input.Version,
WmsState = 0,
SettleAccountState=0
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
return true;
}
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
{
var _billNum = "K" + DateTime.Now.ToString("yyyyMMddhhmmss");
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelImport<WmsHQFKanbanOutPutDetial>(files, _excelImportService);
List<WmsHQFKanbanOutPutDetial> _lst = new List<WmsHQFKanbanOutPutDetial>();
var _lsCopy = new List<WmsHQFKanbanOutPutDetial>();
foreach (var itm in result)
{
WmsHQFKanbanOutPutDetial _detail = new WmsHQFKanbanOutPutDetial(
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 _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
join itm2 in _ls1 on
new { itm1.MaterialCode, itm1.Kanban }
equals
new { itm2.MaterialCode, itm2.Kanban }
select itm1;
var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
var checkList = new List<ErrorExportDto>();
foreach (var itm in errList)
{
checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var query = from itm1 in _ls1
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.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 == version && p.BillNum == _billNum);
if (_count == 0)
{
var _version = new WmsHQFKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
}
return _billNum;
}
}
}

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

@ -0,0 +1,418 @@
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/wmsHQFSharePartoutput")]
public class WMSHQFSharePartAppService :
SettleAccountApplicationBase<WmsHQFSharePartOutPutDetial>
{
private readonly ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsHQFSharePartOutPutDetial> _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 WMSHQFSharePartAppService(
ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsHQFSharePartOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsHQFSharePartOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository,
IExcelImportAppService excelImportService,
IDistributedCache<WmsHQFSharePartOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_excelImportService = excelImportService;
_job = job;
_wmstbRespository = wmstbRespository;
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
}
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<WmsHQFSharePartOutPut>> 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<WmsHQFSharePartOutPut>(totalCount, entities);
}
/// <summary>
/// 准时化出库明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("WmsSharePartDetailList")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<WmsHQFSharePartOutPutDetial>> GetListAsync(WmsSharePartOutPutDetialRequestDto 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<WmsHQFSharePartOutPutDetial>(totalCount, entities);
}
/// <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<WmsHQFSharePartOutPutDetial> _lst = new List<WmsHQFSharePartOutPutDetial>();
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
WmsHQFSharePartOutPutDetial(
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.
));
_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 WmsHQFSharePartOutPut(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<WmsHQFSharePartOutPutDetial> _ls = new List<WmsHQFSharePartOutPutDetial>();
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 = 2\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)
{
var _ls = await _wmsRepository.Where(p => input.Guids.Contains(p.Id) && p.Version == input.Version && p.State == 1).ToListAsync();
var _first = _ls.FirstOrDefault();
if (_ls.Count() > 0)
{
//var _guid = GuidGenerator.Create();
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
//var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", input.Version, "WmsSharePartOutPutDetail", _first.BillNum, 0,0, _guid)
//{
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsSharePartOutPutDetail",
// InterfaceType = "3",
// Version = input.Version,
// WmsState = 0,
// SettleAccountState=0
//};
//var _l = new List<TS_UNI_API>();
//_l.Add(uniapi);
//await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
return true;
}
//[HttpPost]
//[Route("ExcelImport")]
//[DisableRequestSizeLimit]
////[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
//{
//var _billNum = "BHQ" + DateTime.Now.ToString("yyyyMMddhhmmss");
//ExportImporter _exportImporter = new ExportImporter();
//var result = await _exportImporter.ExtendExcelImport<WmsHQFSharePartOutPutDetial>(files, _excelImportService);
//List<WmsHQFSharePartOutPutDetial> _lst = new List<WmsHQFSharePartOutPutDetial>();
//var _lsCopy = new List<WmsHQFSharePartOutPutDetial>();
//foreach (var itm in result)
//{
// WmsHQFSharePartOutPutDetial _detail = new WmsHQFSharePartOutPutDetial(
// GuidGenerator.Create(),
// itm.WmsBillNum,
// itm.OrderBillNum,
// itm.MaterialCode,
// itm.MaterialDesc,
// itm.MaterialGroup,
// string.Empty,
// string.Empty,
// 0,
// string.Empty,
// string.Empty,
// version,
// itm.ParentMaterialCode,
// itm.BillNum,
// GuidGenerator.Create()
// , string.Empty
// , itm.Qty
// );
// _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.OrderBillNum,itm1.WmsBillNum,itm1.po }
// equals
// new { itm2.MaterialCode, itm2.OrderBillNum }
// select itm1;
//var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
//var checkList = new List<ErrorExportDto>();
//foreach (var itm in errList)
//{
// checkList.Add(new ErrorExportDto() { Message = string.Format("出库单号:{0}重复记录数:{1}条", itm.BillNum, itm.Number) });
//}
//if (checkList.Count > 0)
//{
// return await ExportErrorReportAsync(checkList);
//}
//var query = from itm1 in _ls1
// join itm2 in outPutDetail on
// new { itm1.MaterialCode, itm1.OrderBillNum }
// equals
// new { itm2.MaterialCode, itm2.OrderBillNum } into temp1
// from tm1 in temp1.DefaultIfEmpty()
// where tm1 == null
// select itm1;
//var _wmslst = query.ToList();
//foreach (var itm in _wmslst)
//{
// itm.BillNum = _billNum;
//}
//await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
//int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
//if (_count == 0)
//{
// var _version = new WmsHQFSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
//}
//return _billNum;
}
}

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

@ -663,8 +663,63 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
//} //}
/// <summary>
///红旗F平台核对明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQFSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("F平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 红旗F平台备件结算出库
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("HQFSharePartSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQFSharePartSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("F平台核备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}

134
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -1667,6 +1667,126 @@
<param name="input">请求条件</param> <param name="input">请求条件</param>
<returns>实体DTO列表</returns> <returns>实体DTO列表</returns>
</member> </member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService">
<summary>
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.#ctor(Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFKanbanOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFKanbanOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFKanbanOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFKanbanOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
</summary>
<param name="wmsRepository"></param>
<param name="job"></param>
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutRequestDto)">
<summary>
准时化出库主表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.WmsHQFKanbanAudit(System.Collections.Generic.List{System.Guid})">
<summary>
任务明细标记已确认
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.WmsHQFKanbanOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.WmsHQFKanbanOutPutPass(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能,核准出库功能
</summary>
<param name="version"></param>
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WmsHQFKanbanAppService.WmsHQFKanbanOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService">
<summary>
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.WMS.WmsHQFSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
</summary>
<param name="wmsRepository"></param>
<param name="job"></param>
<param name="wmsVersionRepository"></param>
<param name="wmsefRespository"></param>
<param name="wmstbRespository"></param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutRequestDto)">
<summary>
准时化出库主表
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsSharePartOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.WmsSharePartAudit(System.Collections.Generic.List{System.Guid})">
<summary>
任务明细标记已确认
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.WmsSharePartOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.WmsSharePartOutPutPass(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能,核准出库功能
</summary>
<param name="version"></param>
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSHQFSharePartAppService.WmsSharePartOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSJitAppService"> <member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSJitAppService">
<summary> <summary>
wms出库 wms出库
@ -3030,6 +3150,20 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param> <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQFSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗F平台核对明细
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQFSharePartSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗F平台备件结算出库
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.SettleAccountApplicationAutoMapperProfile.CreateMapHQ_F_Platform"> <member name="M:Win.Sfs.SettleAccount.SettleAccountApplicationAutoMapperProfile.CreateMapHQ_F_Platform">
<summary> <summary>
红旗F平台导入 红旗F平台导入

25
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Kanban.cs

@ -24,6 +24,10 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_F
public class HQ_H_Kanban:FullAuditedAggregateRootBase<Guid> public class HQ_H_Kanban:FullAuditedAggregateRootBase<Guid>
{ {
[ExporterHeader(DisplayName = "交货时间")]
public DateTime BillDate { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "行号")] [ExporterHeader(DisplayName = "行号")]
public string PoLine { set; get; } public string PoLine { set; get; }
[ExporterHeader(DisplayName = "零件号")] [ExporterHeader(DisplayName = "零件号")]
@ -45,9 +49,28 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_F
[ExporterHeader(DisplayName = "发货状态")] [ExporterHeader(DisplayName = "发货状态")]
public string State { set; get; } public string State { set; get; }
public HQ_H_Kanban(Guid id,string poLine, string materialCode, string materialDesc, decimal qty, string kanban, string isAuto, string warehouse, string warehouseDesc, string supplier, string state):base(id) //public HQ_H_Kanban(DateTime billDate, string wmsBillNum, string poLine, string materialCode, string materialDesc, decimal qty, string kanban, string isAuto, string warehouse, string warehouseDesc, string supplier, string state)
//{
// BillDate = billDate;
// WmsBillNum = wmsBillNum;
// PoLine = poLine;
// MaterialCode = materialCode;
// MaterialDesc = materialDesc;
// Qty = qty;
// Kanban = kanban;
// IsAuto = isAuto;
// Warehouse = warehouse;
// WarehouseDesc = warehouseDesc;
// Supplier = supplier;
// State = state;
//}
public HQ_H_Kanban(Guid id, DateTime billDate, string wmsBillNum, string poLine, string materialCode, string materialDesc, decimal qty, string kanban, string isAuto, string warehouse, string warehouseDesc, string supplier, string state):base(id)
{ {
Id = id; Id = id;
BillDate = billDate;
WmsBillNum = wmsBillNum;
PoLine = poLine; PoLine = poLine;
MaterialCode = materialCode; MaterialCode = materialCode;
MaterialDesc = materialDesc; MaterialDesc = materialDesc;

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

@ -258,6 +258,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
TaskId = taskId; TaskId = taskId;
Remark = remark; Remark = remark;
Qty = qty; Qty = qty;
} }
public void SetData(Guid id,string remark,string wmsbillnum,string version,Guid taskId) public void SetData(Guid id,string remark,string wmsbillnum,string version,Guid taskId)
{ {
@ -275,8 +276,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明 // 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
//交货单号
[ImporterHeader(Name = "组件组物料",IsIgnore =true)] [ImporterHeader(Name = "组件组物料",IsIgnore =true)]
public string ParentMaterialCode { set; get; } public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")] [ImporterHeader(Name = "交货单号")]
@ -329,34 +328,144 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
#region 红旗看板
public class WmsHQFKanbanOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsHQFKanbanOutPut()
{
}
public WmsHQFKanbanOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
/// <summary> /// <summary>
/// 备件出库 /// 看板明细
/// </summary> /// </summary>
public class WmsSharePartOutPut : FullAuditedAggregateRootBase<Guid> public class WmsHQFKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid>
{ {
public WmsSharePartOutPut() public WmsHQFKanbanOutPutDetial()
{ {
} }
public WmsSharePartOutPut(Guid id, string version, string billNum, string creator) : base(id) public WmsHQFKanbanOutPutDetial(Guid id, string wmsBillNum, string kanban, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty,string poline)
{ {
Id = id; Id = id;
Version = version; WmsBillNum = wmsBillNum;
Kanban = kanban;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum; BillNum = billNum;
Creator = creator; TaskId = taskId;
Remark = remark;
Qty = qty;
PoLine = poline;
} }
public void SetData(Guid id, string remark, string wmsbillnum, string version, Guid taskId)
{
Id = id;
Remark = remark;
WmsBillNum = wmsbillnum;
Version = version;
TaskId = taskId;
}
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
[ImporterHeader(Name = "行号")]
public string PoLine { set; get; }
//交货单号
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "条码号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "物料号")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "客户物料")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "订单日期")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; } public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "单据", IsIgnore = true)]
public string BillNum { set; get; } public string BillNum { set; get; }
public string Creator { set; get; } [ImporterHeader(Name = "任务", IsIgnore = true)]
public Guid TaskId { set; get; }
}
/// <summary>
/// 备件出库
/// </summary>
public class WmsHQFSharePartOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsHQFSharePartOutPut()
{
}
public WmsHQFSharePartOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
} }
@ -364,13 +473,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary> /// <summary>
/// 备件出库明细 /// 备件出库明细
/// </summary> /// </summary>
public class WmsSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid> public class WmsHQFSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid>
{ {
public WmsSharePartOutPutDetial() public WmsHQFSharePartOutPutDetial()
{ {
} }
public WmsHQFSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId,string remark,decimal qty )
public WmsSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId,string remark,decimal qty )
{ {
Id = id; Id = id;
WmsBillNum = wmsBillNum; WmsBillNum = wmsBillNum;
@ -390,16 +498,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
Remark = remark; Remark = remark;
Qty = qty; Qty = qty;
} }
public void SetId(Guid id) public void SetId(Guid id)
{ {
Id = id; Id = id;
} }
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
//交货单号 //交货单号
[ImporterHeader(Name = "组件组物料")] [ImporterHeader(Name = "组件组物料")]
@ -409,7 +511,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ImporterHeader(Name = "看板号")] [ImporterHeader(Name = "看板号")]
//KENN号 //KENN号
public string OrderBillNum { set; get; } public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP编码")] [ImporterHeader(Name = "SAP编码")]
//物料号 //物料号
public string MaterialCode { set; get; } public string MaterialCode { set; get; }
@ -444,17 +545,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public string Version { set; get; } public string Version { set; get; }
[ImporterHeader(Name = "开票数量")] [ImporterHeader(Name = "开票数量")]
public decimal Qty { set; get; } public decimal Qty { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)] [ImporterHeader(Name = "数量", IsIgnore = true)]
public string BillNum { set; get; } public string BillNum { set; get; }
public Guid TaskId { set; get; } public Guid TaskId { set; get; }
} }
#endregion
/// <summary> /// <summary>
/// 备件无订单号出库 /// 备件无订单号出库
@ -553,5 +649,138 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 备件出库
/// </summary>
public class WmsSharePartOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsSharePartOutPut()
{
}
public WmsSharePartOutPut(Guid id, string version, string billNum, string creator) : base(id)
{
Id = id;
Version = version;
BillNum = billNum;
Creator = creator;
}
public string Version { set; get; }
public string BillNum { set; get; }
public string Creator { set; get; }
}
/// <summary>
/// 备件出库明细
/// </summary>
public class WmsSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid>
{
public WmsSharePartOutPutDetial()
{
}
public WmsSharePartOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty)
{
Id = id;
WmsBillNum = wmsBillNum;
OrderBillNum = orderBillNum;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
OutPut = outPut;
InPut = inPut;
State = state;
Extend1 = extend1;
Extend2 = extend2;
Version = extend3;
ParentMaterialCode = parentMaterialCode;
BillNum = billNum;
TaskId = taskId;
Remark = remark;
Qty = qty;
}
public void SetId(Guid id)
{
Id = id;
}
// 交货单号 实际发货日期 KENN号 底盘号 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 定价 金额 结算平台未结数量 大众R3未结数量 差异金额 差异数量 漏结标识 漏结期间 说明
//交货单号
[ImporterHeader(Name = "组件组物料")]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "看板号")]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "物料代码")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "扩展字段2", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "开票数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "数量", IsIgnore = true)]
public string BillNum { set; get; }
public Guid TaskId { set; get; }
}
} }

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

@ -412,8 +412,6 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.Warehouse).HasMaxLength(50); b.Property(x => x.Warehouse).HasMaxLength(50);
b.Property(x => x.WarehouseDesc).HasMaxLength(150); b.Property(x => x.WarehouseDesc).HasMaxLength(150);
b.Property(x => x.State).HasMaxLength(50); b.Property(x => x.State).HasMaxLength(50);
//创建组合索引 //创建组合索引
b.HasIndex(x => new { x.Kanban, x.PoLine, x.MaterialCode }); b.HasIndex(x => new { x.Kanban, x.PoLine, x.MaterialCode });
@ -421,6 +419,55 @@ namespace Win.Sfs.SettleAccount
} }
/// <summary>
/// 一汽轿车平台验收结算明细-导入
/// </summary>
/// <param name="builder"></param>
/// <param name="options"></param>
//private static void ConfigureHQCar(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
//{
// builder.Entity<HQ_Car_Platform>(b =>
// {
// b.ToTable($"{options.TablePrefix}_HQ_Car_Platform", options.Schema);
// b.ConfigureByConvention();
// b.Property(x => x.HQCarKanBan).HasMaxLength(150);//看板号(一汽轿车没有看板号)
// b.Property(x => x.MaterialVoucherNo).HasMaxLength(150);
// b.Property(x => x.Factory).HasMaxLength(50);
// b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150);
// b.Property(x => x.ExternalKanbanNumber).HasMaxLength(50);
// b.Property(x => x.KanbanNumber).HasMaxLength(150);//看板编号
// b.Property(x => x.Period).HasMaxLength(50);
// b.Property(x => x.Year).HasMaxLength(50);
// b.Property(x => x.Version).HasMaxLength(50);
// b.Property(x => x.Supplier).HasMaxLength(50);
// b.Property(x => x.StorageLocation).HasMaxLength(50);
// b.Property(x => x.StorageLocationDesc).HasMaxLength(150);
// //创建组合索引
// b.HasIndex(x => new { x.Version, x.KanbanNumber, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
// });
//}
//private static void ConfigureHQCarVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
//{
// builder.Entity<HQ_Car_PlatformVersion>(b =>
// {
// b.ToTable($"{options.TablePrefix}_HQ_Car_PlatformVersion", options.Schema);
// b.ConfigureByConvention();
// b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
// b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
// b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
// b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength);
// b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter);
// });
//}
/// <summary> /// <summary>
/// 红旗工厂F平台验收结算明细-导入 /// 红旗工厂F平台验收结算明细-导入
/// </summary> /// </summary>

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

@ -0,0 +1,341 @@
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 HQFSharePartSettledDetailDiff
{
[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 HQFSettledDetailDiff
{
[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; }
[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 decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "数量差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "单价差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
}
public class HQFSettleQtyDiff
{
public string { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public string { set; get; }
}
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
public class HQFSettledDetailDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQFSettledDetailDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQFSettledDetailDiff> GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQFSettledDetailDiff> _list = new List<HQFSettledDetailDiff>();
string condition = " where 1=1 ";
////if (!string.IsNullOrEmpty(materialCode))
////{
//// condition += string.Format(" and d.MaterialCode in ({0}) ", materialCode);
////}
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.BeginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.BeginTime<='{0}' ", end);
}
//if (!string.IsNullOrEmpty(cp7begin))
//{
// condition += string.Format(" and B.cp7>='{0}' ", cp7begin);
//}
//if (!string.IsNullOrEmpty(cp7end))
//{
// condition += string.Format(" and B.cp7<='{0}' ", cp7end);
//}
////if (!string.IsNullOrEmpty(kennCode))
////{
//// condition += string.Format(" and B.kenncode='{0}' ", kennCode);
////}
////if (!string.IsNullOrEmpty(chassisNumber))
////{
//// condition += string.Format(" and B.chassisNumber='{0}' ", chassisNumber);
////}
////if (!string.IsNullOrEmpty(materialGroup))
////{
//// condition += string.Format(" B.chassisNumber='{0}' ", materialGroup);
////}
string str =
"SELECT\n" +
" isnull(temp1.交货单号,'') 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull(temp1.手工或自动,'') 手工或自动,\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.发货零件号,\n" +
" temp1.零件中文名称,\n" +
" temp1.Sap编码,\n" +
" temp1.物料组,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.结算验收单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull(TEMP2.Price,0) AS 发货定价,\n" +
" isnull(temp1.发货数量,0) * isnull(TEMP2.Price,0) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" 0 AS 单价差异,\n" +
" 0 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" a.CreationTime AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull(b.Qty,0) AS 发货数量,\n" +
" isnull(b.State,0) AS 发货状态,\n" +
" a.AcceptanceNo AS 结算验收单号,\n" +
" isnull(b.Qty,0) AS 结算数量,\n" +
" isnull(a.Price,0) AS 结算单价,\n" +
" isnull(a.Amt,0) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组\n" +
" FROM\n" +
" Set_HQ_H_Platform AS a\n" +
" LEFT OUTER JOIN Set_HQ_H_Kanban AS b ON a.HQHKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.HQHKanBan <> 'BJ' ) and a.Version='{0}') AS temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX( Version ) FROM Set_PriceList ))) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQFSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQFSettleQtyDiff> GetDiffQtyList(string version)
{
List<HQFSettleQtyDiff> _list = new List<HQFSettleQtyDiff>();
var str =
"SELECT temp1.MaterialCode 客户物料号,temp1.HQHKanBan 看板号 ,temp1.SettleQty 结算数量, temp2.Qty 发货数量,( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" SUM( Qty ) SettleQty,\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Platform where version='{0}'\n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" ) temp1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" SUM( Qty ) Qty,\n" +
" Kanban,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Kanban \n" +
" GROUP BY\n" +
" Kanban,\n" +
" MaterialCode \n" +
" ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode where temp1.SettleQty!=temp2.Qty ";
str = string.Format(str, version);
var _query = DbConnection.Query<HQFSettleQtyDiff>(str, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQFSharePartSettledDetailDiff> GetSharePartSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQFSharePartSettledDetailDiff> _list = new List<HQFSharePartSettledDetailDiff>();
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.BeginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.BeginTime<='{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_HQ_H_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND HQHKanBan = 'BJ' \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 (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" 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<HQFSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
}

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

@ -20,8 +20,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{ {
// Factory MaterialCode InvoiceQty InvoiceAmt InvoicePrice SapMaterialCode MaterialDesc SapMaterialGroup DiffPrice SalePrice SocketQty // Factory MaterialCode InvoiceQty InvoiceAmt InvoicePrice SapMaterialCode MaterialDesc SapMaterialGroup DiffPrice SalePrice SocketQty
[ExporterHeader(DisplayName = "期间")] [ExporterHeader(DisplayName = "期间")]
public string Version { get; set; } public string Version { get; set; }
[ExporterHeader(DisplayName = "物料组")] [ExporterHeader(DisplayName = "物料组")]

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

@ -0,0 +1,124 @@
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.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Repository.SettleAccount;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services
{
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
public class HQFSharePartSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQFSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQFSharePartSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQFSettledDetailDapperRepository 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[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { ',' }).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<HQFSharePartSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

123
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs

@ -0,0 +1,123 @@
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.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Repository.SettleAccount;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services
{
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
public class HQFSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQFSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQFSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQFSettledDetailDapperRepository 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.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[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { ',' }).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<HQFSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

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

@ -148,7 +148,14 @@ namespace Win.Sfs.SettleAccount
{ {
return implementationFactory.GetService<SharePartUnSettledExport>(); return implementationFactory.GetService<SharePartUnSettledExport>();
} }
if (key.Equals(typeof(HQFSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQFSettledDetailDiffExportService>();
}
if (key.Equals(typeof(HQFSharePartSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<HQFSharePartSettledDetailDiffExportService>();
}

Loading…
Cancel
Save