Browse Source

所有出库单的导出功能修改,已经完成;

备件相关优化
FoShanPG
44673626 3 years ago
parent
commit
68e4d0da64
  1. 526
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs
  2. 111
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs
  3. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs
  4. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  5. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanExtendAppService.cs
  6. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  7. 523
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  8. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs
  9. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs
  10. 42
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  11. 59
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  12. 175
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  13. 51
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  14. 22
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  15. 23
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs

526
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs

@ -0,0 +1,526 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Win.Sfs.SettleAccount.Entities
{
/// <summary>
/// 大众准时化出库单
/// </summary>
public class WmsJitOutPutDetialDto
{
[ExporterHeader(DisplayName = "出库库位")]
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "入库库位")]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态")]
[ExporterHeader(DisplayName = "状态")]
public int State { get; set; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ExporterHeader(DisplayName = "版本号")]
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ExporterHeader(DisplayName = "单号")]
[ImporterHeader(Name = "单号", IsIgnore = true)]
public string BillNum { set; get; }
[ExporterHeader(DisplayName = "任务号", IsIgnore = true)]
[ImporterHeader(Name = "任务号", IsIgnore = true)]
public Guid TaskId { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
[ImporterHeader(Name = "交货单号", AutoTrim = true)]
public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
[ImporterHeader(Name = "KENN号")]
//KENN号
public string KennCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
[ImporterHeader(Name = "底盘号", AutoTrim = true)]
//底盘号
public string ChassisNumber { set; get; }
[ExporterHeader(DisplayName = "物料号")]
[ImporterHeader(Name = "物料号", AutoTrim = true)]
//物料号
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "组件组物料")]
[ImporterHeader(Name = "组件组物料", AutoTrim = true)]
//物料号
public string ParentMaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
[ImporterHeader(Name = "物料描述", AutoTrim = true)]
//物料描述
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
[ImporterHeader(Name = "物料组(车型)", AutoTrim = true)]
//物料组(车型)
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
}
/// <summary>
/// 大众看板出库单
/// </summary>
public class WmsKanbanOutPutDetialDto
{
[ExporterHeader(DisplayName = "组件组物料", IsIgnore = true)]
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
[ImporterHeader(Name = "交货单号")]
public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "条码号")]
[ImporterHeader(Name = "条码号")]
//KENN号
public string Kanban { set; get; }
[ExporterHeader(DisplayName = "物料号")]
[ImporterHeader(Name = "物料号")]
//物料号
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
[ImporterHeader(Name = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
[ImporterHeader(Name = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "出库库位")]
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ExporterHeader(DisplayName = "入库库位")]
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ExporterHeader(DisplayName = "状态")]
[ImporterHeader(Name = "状态", IsIgnore = true)]
public int State { get; set; }
[ExporterHeader(DisplayName = "客户物料")]
[ImporterHeader(Name = "客户物料")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ExporterHeader(DisplayName = "订单日期")]
[ImporterHeader(Name = "订单日期")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "单据")]
[ImporterHeader(Name = "单据", IsIgnore = true)]
public string BillNum { set; get; }
[ExporterHeader(DisplayName = "任务", IsIgnore = true)]
[ImporterHeader(Name = "任务", IsIgnore = true)]
public Guid TaskId { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
[ImporterHeader(Name = "开票单价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "开票金额")]
[ImporterHeader(Name = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
/// 大众无条码看板出库单
/// </summary>
public class WmsWithOutKanbanOutPutDetialDto
{
[ImporterHeader(Name = "单据类型")]
[ExporterHeader(DisplayName = "单据类型")]
public string Type { set; get; }
[ImporterHeader(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string SapMaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "版本号")]
[ExporterHeader(DisplayName = "版本号")]
public string Version { set; get; }
[ImporterHeader(Name = "是否备件")]
[ExporterHeader(DisplayName = "是否备件")]
public string IsBack { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
public decimal SockQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "真实数量", IsIgnore = true)]
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutputQty { set; get; }
[ImporterHeader(Name = "Extend", IsIgnore = true)]
[ExporterHeader(DisplayName = "Extend", IsIgnore = true)]
public string Extend { set; get; }
[ImporterHeader(Name = "BillNum", IsIgnore = true)]
[ExporterHeader(DisplayName = "BillNum", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
/// 大众备件出库单
/// </summary>
public class WmsSharePartOutPutDetialDto
{
[ExporterHeader(DisplayName = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "采购订单号")]
//KENN号
public string OrderBillNum { set; get; }
[ExporterHeader(DisplayName = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ExporterHeader(DisplayName = "物料代码")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ExporterHeader(DisplayName = "扩展字段2", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ExporterHeader(DisplayName = "开票数量")]
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "单据", IsIgnore = true)]
public string BillNum { set; get; }
[ExporterHeader(DisplayName = "任务代码", IsIgnore = true)]
public Guid TaskId { set; get; }
[ExporterHeader(DisplayName = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
/// 大众备件手工出库单
/// </summary>
public class WmsSharePart90OutPutDetialDto
{
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
[ExporterHeader(DisplayName = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "采购订单号")]
[ExporterHeader(DisplayName = "采购订单号")]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP编码")]
[ExporterHeader(DisplayName = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组(车型)", IsIgnore = true)]
[ExporterHeader(DisplayName = "物料组(车型)", IsIgnore = true)]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "物料代码")]
[ExporterHeader(DisplayName = "物料代码")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "扩展字段2", IsIgnore = true)]
[ExporterHeader(DisplayName = "扩展字段2", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
[ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "开票数量")]
[ExporterHeader(DisplayName = "开票数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "单据", IsIgnore = true)]
[ExporterHeader(DisplayName = "单据", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务代码", IsIgnore = true)]
[ExporterHeader(DisplayName = "任务代码", IsIgnore = true)]
public Guid TaskId { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
/// 红旗数据手工出库单
/// </summary>
public class WmsHQWithOutKanbanOutPutDetialDto
{
[ImporterHeader(Name = "单据类型", IsIgnore = true)]
[ExporterHeader(DisplayName = "单据类型", IsIgnore = true)]
public string Type { set; get; }
[ImporterHeader(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string SapMaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "版本号")]
[ExporterHeader(DisplayName = "版本号")]
public string Version { set; get; }
[ImporterHeader(Name = "是否备件")]
[ExporterHeader(DisplayName = "是否备件")]
public string IsBack { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "寄售库存数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)]
public decimal SockQty { set; get; }
[ImporterHeader(Name = "真实数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "真实数量", IsIgnore = true)]
public decimal RealityNumber { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutputQty { set; get; }
[ImporterHeader(Name = "客户")]
[ExporterHeader(DisplayName = "客户")]
public string Extend { set; get; }
[ImporterHeader(Name = "BillNum", IsIgnore = true)]
[ExporterHeader(DisplayName = "BillNum", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { set; get; }
[ImporterHeader(Name = "开票单价")]
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "开票金额")]
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}
/// <summary>
///一汽轿车出库单
/// </summary>
public class WmsHQCarOutPutDetialDto
{
[ImporterHeader(Name = "是否备件", IsIgnore = true)]
[ExporterHeader(DisplayName = "是否备件", IsIgnore = true)]
public string IsSparePart { set; get; }
//交货单号
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)]
[ExporterHeader(DisplayName = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号", IsIgnore = true)]
[ExporterHeader(DisplayName = "交货单号", IsIgnore = true)]
public string WmsBillNum { set; get; }
[ImporterHeader(Name = "看板号", IsIgnore = true)]
[ExporterHeader(DisplayName = "看板号", IsIgnore = true)]
//KENN号
public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP编码")]
[ExporterHeader(DisplayName = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ImporterHeader(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ImporterHeader(Name = "物料组")]
[ExporterHeader(DisplayName = "物料组")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ImporterHeader(Name = "状态", IsIgnore = true)]
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ImporterHeader(Name = "结算物料号")]
[ExporterHeader(DisplayName = "结算物料号")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ImporterHeader(Name = "收货仓库")]
[ExporterHeader(DisplayName = "收货仓库")]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ImporterHeader(Name = "版本号", IsIgnore = true)]
[ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ImporterHeader(Name = "结算数量")]
[ExporterHeader(DisplayName = "结算数量")]
public decimal Qty { set; get; }
[ImporterHeader(Name = "结算单价")]
[ExporterHeader(DisplayName = "结算单价")]
public decimal Price { set; get; }
[ImporterHeader(Name = "结算金额")]
[ExporterHeader(DisplayName = "结算金额")]
public decimal Amt { set; get; }
[ImporterHeader(Name = "单据号", IsIgnore = true)]
[ExporterHeader(DisplayName = "单据号", IsIgnore = true)]
public string BillNum { set; get; }
[ImporterHeader(Name = "任务ID", IsIgnore = true)]
[ExporterHeader(DisplayName = "任务ID", IsIgnore = true)]
public Guid TaskId { set; get; }
}
}

111
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs

@ -11,6 +11,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories;
@ -19,6 +20,7 @@ using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.HQ_M;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.Filter;
@ -28,7 +30,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
/// <summary>
/// 红旗H平台导入
/// </summary>
[Authorize(SettleAccountPermissions.HQ_HPlatform.Default)]
//[Authorize(SettleAccountPermissions.HQ_HPlatform.Default)]
//[AllowAnonymous]
[Route("api/settleaccount/HQHPlatform")]
public class HQ_H_PlatformAppService : SettleAccountApplicationBase<HQ_H_Platform>, IHQ_H_PlatformAppService
@ -40,6 +42,11 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
private readonly ISettleAccountBranchEfCoreRepository<HQ_H_PlatformVersion, Guid> _versionRepository;
private readonly ISettleAccountBranchEfCoreRepository<HQ_H_Platform, Guid> _repository;
private readonly ISettleAccountBranchEfCoreRepository<HQ_M_PlatformVersion, Guid> _versionMRepository;
private readonly ISettleAccountBranchEfCoreRepository<HQ_M_Platform, Guid> _repositoryM;
/// <summary>
/// 构建方法
/// </summary>
@ -52,29 +59,43 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
IDistributedCache<HQ_H_Platform> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
ICommonManager commonManager,
ISettleAccountBranchEfCoreRepository<HQ_M_PlatformVersion, Guid> versionMRepository,
ISettleAccountBranchEfCoreRepository<HQ_M_Platform, Guid> repositoryM
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_versionRepository = versionRepository;
_guidGenerator = guidGenerator;
_excelImportService = excelImportService;
_repository = repository;
_versionMRepository = versionMRepository;
_repositoryM = repositoryM;
}
/// <summary>
/// 导入功能
/// 统一导入红旗平台数据,包括H、M、F平台
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <param name="files"></param>
/// <param name="branchId"></param>
/// <param name="year"></param>
/// <param name="period"></param>
/// <param name="version"></param>
/// <param name="customerCode"></param>
/// <returns></returns>
[HttpPost]
[Route("ExcelImport")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.HQ_HPlatform.Create)]
//[Authorize(SettleAccountPermissions.HQ_HPlatform.Create)]
public async Task<string> HQ_H_PlatformUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<HQ_H_PlatformImportDto>(files, _excelImportService);
if (result == null || result.Count == 0)
{
throw new BusinessException("导入模板数据不能为空!");
}
var entityList = ObjectMapper.Map<List<HQ_H_PlatformImportDto>, List<HQ_H_Platform>>(result);
//删除版本
var _versionQuery = _versionRepository.Where(p => p.Version == version);
@ -83,17 +104,6 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
var _query = _repository.Where(p => p.Version == version);
await _query.BatchDeleteAsync();
//插入数据前检验
var checkList = new List<ErrorExportDto>();
var _group = entityList.GroupBy(x => new { x.Factory, x.HQHKanBan, x.Version }).Select(p => new { Count = p.Count(), Factory = p.Key.Factory, HQHKanBan = p.Key.HQHKanBan });
foreach (var itm in _group)
{
if (itm.Factory != "H")
{
checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的平台数据不是{0}平台的,请检查!", itm.Factory), string.Empty));
break;
}
}
var _id = GuidGenerator.Create();
var _bomList = new List<HQ_H_PlatformVersion>();
_bomList.Add(new HQ_H_PlatformVersion(_id, branchId, year, period, version, customerCode));
@ -109,15 +119,70 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version);
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
await _repository.GetDbContext().BulkInsertAsync<HQ_H_Platform>(entityList);
await _versionRepository.GetDbContext().BulkInsertAsync(_bomList);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
//[HttpPost]
//[Route("ExcelImport")]
//[DisableRequestSizeLimit]
//[Authorize(SettleAccountPermissions.HQ_HPlatform.Create)]
//public async Task<string> HQ_H_PlatformUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
//{
// ExportImporter _exportImporter = new ExportImporter();
// var result = await _exportImporter.UploadExcelImport<HQ_H_PlatformImportDto>(files, _excelImportService);
// var entityList = ObjectMapper.Map<List<HQ_H_PlatformImportDto>, List<HQ_H_Platform>>(result);
// //删除版本
// var _versionQuery = _versionRepository.Where(p => p.Version == version);
// await _versionQuery.BatchDeleteAsync();
// //删除明细
// var _query = _repository.Where(p => p.Version == version);
// await _query.BatchDeleteAsync();
// //插入数据前检验
// var checkList = new List<ErrorExportDto>();
// var _group = entityList.GroupBy(x => new { x.Factory, x.HQHKanBan, x.Version }).Select(p => new { Count = p.Count(), Factory = p.Key.Factory, HQHKanBan = p.Key.HQHKanBan });
// foreach (var itm in _group)
// {
// if (itm.Factory != "H")
// {
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入的平台数据不是{0}平台的,请检查!", itm.Factory), string.Empty));
// break;
// }
// }
// var _id = GuidGenerator.Create();
// var _bomList = new List<HQ_H_PlatformVersion>();
// _bomList.Add(new HQ_H_PlatformVersion(_id, branchId, year, period, version, customerCode));
// foreach (var itm in entityList)
// {
// if (string.IsNullOrEmpty(itm.HQHKanBan) && itm.StorageLocationDesc.Contains("备品"))
// {
// //赋值上主键ID
// itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, "BJ");//备品库没有看板号,需要特殊标识一下BJ,已经和客户确认
// }
// else
// {
// itm.SetValue(GuidGenerator.Create(), branchId, year, period, version);
// }
// }
// if (checkList.Count > 0)
// {
// return await ExportErrorReportAsync(checkList);
// }
// await _repository.GetDbContext().BulkInsertAsync<HQ_H_Platform>(entityList);
// await _versionRepository.GetDbContext().BulkInsertAsync(_bomList);
// return ApplicationConsts.SuccessStr;
//}
/// <summary>
/// 按ID获取唯一实体
/// </summary>
@ -184,11 +249,11 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
switch (input.FileType)
{
case 0:
_fileName = string.Format("红旗工厂H平台验收结算明细_{0}.csv", input.UserId.ToString());
_fileName = string.Format("红旗工厂结算明细_{0}.csv", input.UserId.ToString());
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
_fileName = string.Format("红旗工厂H平台验收结算明细_{0}.xlsx", input.UserId.ToString());
_fileName = string.Format("红旗工厂结算明细_{0}.xlsx", input.UserId.ToString());
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}

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

@ -56,7 +56,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
//[AllowAnonymous]
[Route("api/settleaccount/wmsjitoutput")]
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
//[Authorize(SettleAccountPermissions.WMSJIT.Default)]
public class WMSJitAppService :
SettleAccountApplicationBase<WmsJitOutPutDetial>
{
@ -600,12 +600,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsJitOutPutDetial>, List<WmsJitOutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("准时化出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();

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

@ -772,11 +772,13 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsKanbanOutPutDetial>, List<WmsKanbanOutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
var _fileName = string.Format("大众看板出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();

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

@ -440,11 +440,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsWithOutKanbanOutPutDetial>, List<WmsWithOutKanbanOutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("大众无条码看板出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();

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

@ -651,11 +651,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsSharePart90OutPutDetial>, List<WmsSharePart90OutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
var _fileName = string.Format("大众备件手工出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();

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

@ -63,6 +63,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePartOutPut, Guid> _wmsVersionRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPutDetial, Guid> _wmsRepository90;
private readonly ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPut, Guid> _wmsVersionRepository90;
private readonly WMSEfCoreRepository<WmsSharePartOutPutDetial> _wmsefRespository;
private readonly WmsDapperRepository _wmsDapper;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
@ -89,6 +94,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
IDistributedCache<WmsSharePartOutPutDetial> cache,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager,
ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPutDetial, Guid> wmsRepository90,
ISettleAccountBranchEfCoreRepository<WmsSharePart90OutPut, Guid> wmsVersionRepository90,
WmsDapperRepository wmsDapper
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
@ -99,6 +106,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
_wmsVersionRepository = wmsVersionRepository;
_wmsDapper = wmsDapper;
_wmsefRespository = wmsefRespository;
_wmsRepository90 = wmsRepository90;
_wmsVersionRepository90 = wmsVersionRepository90;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutDetialRequestDto input)
@ -218,44 +228,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
/// <summary>
/// 出库单导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("大众备件出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray<WmsSharePartOutPutDetial>(entities);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
@ -274,16 +246,18 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
List<WmsSharePartOutPutDetial> _lstBill = new List<WmsSharePartOutPutDetial>();
List<WmsSharePart90OutPutDetial> _lstBill = new List<WmsSharePart90OutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
ExcelHelper _excelHelper = new ExcelHelper(fileSavePath);
var _listSummary = _excelHelper.ExcelToListOne<WmsSharePartOutPutDetial>();//导入模板有多页签,需要取第一个页签
var _list = _listSummary.Where(p => p.OrderBillNum == "").ToList();//过滤 采购订单号为空的集合
var _listBill = _listSummary.Where(p => p.OrderBillNum != "").ToList();//过滤 采购订单号不为空的集合
var _listSummary = _excelHelper.ExcelToListOne<WmsSharePartOutPutDetial>();//无单号
var _list90Summary = _excelHelper.ExcelToListOne<WmsSharePart90OutPutDetial>();//有单号
var _list = _listSummary.Where(p => p.OrderBillNum == "").ToList();//过滤 没有采购订单号为空的集合
var _listBill = _list90Summary.Where(p => p.OrderBillNum != "").ToList();//过滤 有采购订单号的集合
@ -433,12 +407,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
//有采购订单号
//往Set_WmsSharePart90OutPutDetial表中存储
if (_lstBill != null && _lstBill.Count>0)
{
//有采购订单号
var outPutDetailBill = await _wmsRepository.Where(p => p.Version == input.Version && p.OrderBillNum != "").ToListAsync();
var outPutDetailBill = await _wmsRepository90.Where(p => p.Version == input.Version && p.OrderBillNum != "").ToListAsync();
var error = from itm1 in outPutDetailBill
join itm2 in _lstBill on
@ -460,7 +434,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
select itm1;
var _wmslstBill = queryBill.ToList();
_wmslstBill = _wmslstBill.Select(p => new
WmsSharePartOutPutDetial(
WmsSharePart90OutPutDetial(
GuidGenerator.Create(),
p.WmsBillNum,
p.OrderBillNum,
@ -484,27 +458,19 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
p.Amt
)).ToList();
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslstBill, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
await _wmsRepository90.GetDbContext().BulkInsertAsync(_wmslstBill, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository90.Count(p => p.Version == input.Version && p.BillNum == _billNum);
if (_wmslstBill.Count() > 0 && _count == 0)
{
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
var _version = new WmsSharePart90OutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
_version.Remark= !string.IsNullOrEmpty(_joblist.FirstOrDefault().Remark) ? _joblist.FirstOrDefault().Remark : string.Empty;
await _wmsVersionRepository.InsertAsync(_version, true);
await _wmsVersionRepository90.InsertAsync(_version, true);
}
foreach (var job in _joblist)
{
if (_lst != null && _lst.Count > 0)
{
job.FileName = _billNum + "/" + _billNoNum;
}
else
{
job.FileName = _billNum;
}
await _job.UpdateAsync(job);
}
}
@ -548,37 +514,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[UnitOfWork(false)]
public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
{
if (input.BillNum.Contains("NoBill"))
{
//没有采购订单号的出库方式
if (input.Guids != null)
{
List<WmsSharePartOutPutDetial> _ls = new List<WmsSharePartOutPutDetial>();
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" +
" @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum, input.AccountDate.ToShortDateString()));
}
}
}
else
{
//有采购订单号的出库方式
if (input.Guids != null)
{
List<WmsSharePartOutPutDetial> _ls = new List<WmsSharePartOutPutDetial>();
@ -603,191 +538,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
}
}
return true;
}
/// <summary>
/// 选择任务,生成出库单,只包含已确认的单据
/// </summary>
/// <param name="ids"></param>
/// <param name="version"></param>
/// <returns></returns>
//[HttpPost]
//[Route("WmsSharePartOutPut")]
//public async Task<string> WmsSharePartOutPut(WmsJitRequestDto input)
//{
// var _billNum = "B" + 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<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
// 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<WmsSharePartOutPutDetial>();
// if (_list.Count() > 0)
// {
// var _lsAry = _list.Select(p => new
// WmsSharePartOutPutDetial(
// GuidGenerator.Create(),
// string.Empty,
// string.Empty,
// p.MaterialCode,
// p.MaterialDesc,
// p.MaterialGroup,
// string.Empty,
// string.Empty,
// 0,
// !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,
// string.Empty,
// string.Empty,
// p.MaterialCode,
// _billNum,
// GuidGenerator.Create(),
// string.Empty,
// p.Qty,
// p.StockQty,
// p.Qty,
// p.Price,
// p.Amt
// ));
// _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.OrderBillNum, itm1.WmsBillNum }
// equals
// new { itm2.MaterialCode, itm2.OrderBillNum, itm2.WmsBillNum }
// select itm1;
// var errList = error.GroupBy(p => new { p.BillNum }).Select(p => new { BillNum = p.Key.BillNum, Number = p.Sum(itm => itm.Qty) });
// if (errList.Count() == 0)
// {
// var query = from itm1 in _lst
// join itm2 in outPutDetail on
// new { itm1.MaterialCode, itm1.OrderBillNum, itm1.WmsBillNum }
// equals
// new { itm2.MaterialCode, itm2.OrderBillNum, itm2.WmsBillNum } into temp1
// from tm1 in temp1.DefaultIfEmpty()
// where tm1 == null
// select itm1;
// var _wmslst = query.ToList();
// _wmslst = _wmslst.Select(p => new
// WmsSharePartOutPutDetial(
// GuidGenerator.Create(),
// string.Empty,
// string.Empty,
// p.MaterialCode,
// p.MaterialDesc,
// p.MaterialGroup,
// string.Empty,
// string.Empty,
// 0,
// !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,
// string.Empty,
// input.Version,
// p.MaterialCode,
// _billNum,
// GuidGenerator.Create(),
// string.Empty,
// p.Qty,
// p.StockQty,
// p.Qty,
// p.Price,
// p.Amt
// )).ToList();
// await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
// int _count = _wmsVersionRepository.Count(p => p.Version == input.Version && p.BillNum == _billNum);
// if (_wmslst.Count() > 0 && _count == 0)
// {
// var _version = new WmsSharePartOutPut(GuidGenerator.Create(), input.Version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
// }
// foreach (var job in _joblist)
// {
// job.FileName = _billNum;
// 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("WmsSharePartOutPut-Pass")]
//[UnitOfWork(false)]
//public async Task<bool> WmsSharePartOutPutPass(WmsJitRequestDto input)
//{
// if (input.Guids != null)
// {
// List<WmsSharePartOutPutDetial> _ls = new List<WmsSharePartOutPutDetial>();
// 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" +
// " @date = N'{1}'\n" +
// "SELECT 'Return Value' = @return_value";
// await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
// string.Format(sql, input.BillNum,input.AccountDate.ToShortDateString()));
// }
// }
// return true;
//}
[HttpPost]
[Route("WmsSharePartOutPutModify")]
[DisableRequestSizeLimit]
@ -814,8 +570,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[HttpPost]
[Route("WmsSharePartOutPut-Cancel")]
public async Task<bool> WmsSharePartOutPutCancel(WmsJitRequestDto input)
{
if (input.BillNum.Contains("NoBill"))
{
//没有有采购单据号的单子
if (input.Guids != null && input.Guids.Count() > 0)
@ -843,36 +597,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
);
}
}
else
{
//有采购单据号的单子
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 = 10,\n" +
" @accountdate = N'{2}'\n" +
"SELECT 'Return Value' = @return_value";
sql = string.Format(sql, str, input.BillNum, input.AccountDate.ToShortDateString());
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
sql
);
}
}
return true;
}
@ -887,8 +611,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("WmsOutPutDelete")]
[UnitOfWork(false)]
public async Task<bool> WmsOutPutDelete(WmsJitRequestDto input)
{
if (input.BillNum.Contains("NoBill"))
{
//没有采购单据号的单子
var count = _wmsRepository.Count(p => p.BillNum == input.BillNum && p.State != 0);
@ -905,27 +627,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum)
);
}
else
{
//有采购单据号的单子
var count = _wmsRepository.Count(p => p.BillNum == input.BillNum && p.State != 0);
if (count > 0)
{
return false;
}
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" +
" @billnum = N'{0}',\n" +
" @type = 10\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum)
);
}
return true;
}
@ -946,8 +647,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
throw new BusinessException("导入的模板中没有数据,不能为空,请检查!");
}
var result_withbill = result.Where(p => p.OrderBillNum != "").ToList();
var result90 = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePart90OutPutDetial>(files, _excelImportService);
var result_nobill = result.Where(p => p.OrderBillNum == "").ToList();
var result_withbill = result90.Where(p => p.OrderBillNum != "").ToList();
//没有采购单号
if (result_nobill != null)
@ -1034,12 +738,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
if (result_withbill != null)
{
var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss");
List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
List<WmsSharePart90OutPutDetial> _lst = new List<WmsSharePart90OutPutDetial>();
var _lsCopy = new List<WmsSharePartOutPutDetial>();
var _lsCopy = new List<WmsSharePart90OutPutDetial>();
foreach (var itm in result_withbill)
{
WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial(
WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial(
GuidGenerator.Create(),
itm.WmsBillNum,
itm.OrderBillNum,
@ -1066,7 +770,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
_lst.AddRange(_lsCopy.ToArray());
var outPutDetail = await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var outPutDetail = await _wmsRepository90.Where(p => p.Version == version).ToListAsync();
var error = from itm1 in outPutDetail
@ -1103,12 +807,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
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);
await _wmsRepository90.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository90.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0 && _wmslst.Count() > 0)
{
var _version = new WmsSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository.InsertAsync(_version, true);
var _version = new WmsSharePart90OutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
await _wmsVersionRepository90.InsertAsync(_version, true);
}
}
@ -1116,119 +820,46 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
//[HttpPost]
//[Route("ExcelImport")]
//[DisableRequestSizeLimit]
////[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
//public async Task<string> ExcelImport([FromForm] IFormFileCollection files, string version)
//{
// var _billNum = "B" + DateTime.Now.ToString("yyyyMMddhhmmss");
// ExportImporter _exportImporter = new ExportImporter();
// var result = await _exportImporter.ExtendExcelImport<WmsSharePartOutPutDetial>(files, _excelImportService);
// //if (result == null)
// //{
// // throw new BusinessException("导入的模板中没有数据,不能为空,请检查!");
// //}
// //var result_withbill = result.Select(p => p.BillNum != string.Empty).ToList();
// //var result_nobill = result.Select(p => p.BillNum == string.Empty).ToList();
// List<WmsSharePartOutPutDetial> _lst = new List<WmsSharePartOutPutDetial>();
// var _lsCopy = new List<WmsSharePartOutPutDetial>();
// foreach (var itm in result)
// {
// WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial(
// GuidGenerator.Create(),
// //itm.WmsBillNum,
// //itm.OrderBillNum,
// string.Empty,
// string.Empty,
// itm.MaterialCode,
// itm.MaterialDesc,
// itm.MaterialGroup,
// string.Empty,
// string.Empty,
// 0,
// !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,
// string.Empty,
// version,
// itm.ParentMaterialCode,
// itm.BillNum,
// GuidGenerator.Create()
// , string.Empty
// , itm.Qty
// , 0
// , itm.Qty
// , itm.Price
// , itm.Amt
// );
// _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.OrderBillNum,itm1.WmsBillNum }
// // equals
// // new { itm2.MaterialCode, itm2.OrderBillNum,itm2.WmsBillNum }
// // select itm1;
// 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 _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 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 && _wmslst.Count() > 0)
// {
// var _version = new WmsSharePartOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email);
// await _wmsVersionRepository.InsertAsync(_version, true);
// }
// return ApplicationConsts.SuccessStr;
//}
/// <summary>
/// 出库单导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsSharePartOutPutDetial>, List<WmsSharePartOutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("大众备件出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
}

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

@ -502,11 +502,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsHQCarOutPutDetial>, List<WmsHQCarOutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("一汽轿车平台出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();

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

@ -421,11 +421,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtos = ObjectMapper.Map<List<WmsHQWithOutKanbanOutPutDetial>, List<WmsHQWithOutKanbanOutPutDetialDto>>(entities);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("红旗数据调整出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
var _fileName = string.Format("红旗数据手工出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(dtos);
result.ShouldNotBeNull();

42
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -820,7 +820,7 @@
红旗H平台导入
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformAppService.#ctor(Volo.Abp.Guids.IGuidGenerator,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformVersion,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_Platform,System.Guid},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_Platform},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<member name="M:Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformAppService.#ctor(Volo.Abp.Guids.IGuidGenerator,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformVersion,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_Platform,System.Guid},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_Platform},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.HQ_M.HQ_M_PlatformVersion,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.HQ_M.HQ_M_Platform,System.Guid})">
<summary>
构建方法
</summary>
@ -830,9 +830,14 @@
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformAppService.HQ_H_PlatformUploadExcelImport(Microsoft.AspNetCore.Http.IFormFileCollection,System.Guid,System.String,System.String,System.String,System.String)">
<summary>
导入功能
统一导入红旗平台数据,包括H、M、F平台
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<param name="files"></param>
<param name="branchId"></param>
<param name="year"></param>
<param name="period"></param>
<param name="version"></param>
<param name="customerCode"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.HQ_H.HQ_H_PlatformAppService.GetAsync(System.Guid)">
@ -2132,13 +2137,6 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSJitAppService.ExportAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsJitOutPutDetialRequestDto)">
<summary>
准时化出库明细
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSJitAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsJitOutPutDetialRequestDto)">
<summary>
准时化出库明细
@ -2293,7 +2291,7 @@
wms出库
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial},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.WmsSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager,Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.WmsDapperRepository)">
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial},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.WmsSharePartOutPutDetial},Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsSharePart90OutPut,System.Guid},Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.WmsDapperRepository)">
<summary>
</summary>
@ -2331,13 +2329,6 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.ExportAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutDetialRequestDto)">
<summary>
出库单导出
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.WmsSharePartOutPut(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
选择任务,生成出库单,只包含已确认的单据
@ -2354,14 +2345,6 @@
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.WmsSharePartUpdate(Win.Sfs.SettleAccount.Entities.WMS.WmsSharePartOutPutDetial)">
<summary>
选择任务,生成出库单,只包含已确认的单据
</summary>
<param name="ids"></param>
<param name="version"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.WmsSharePartOutPutCancel(Win.Sfs.SettleAccount.Entities.Wms.WmsJitRequestDto)">
<summary>
出库界面功能, 撤销核准出库
@ -2378,6 +2361,13 @@
<param name="p_list"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSSharePartAppService.ExportAsync(Win.Sfs.SettleAccount.Entities.Wms.WmsKanbanOutPutDetialRequestDto)">
<summary>
出库单导出
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePart.SettlementPakAndSparePartsAppService">
<summary>
结算包与散件对应关系服务

59
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -87,6 +87,8 @@ using Win.Sfs.SettleAccount.Entities.HQ_H;
using Win.Sfs.SettleAccount.Entities.HQ_M;
using Win.Sfs.SettleAccount.Entities.HQ_F;
using Win.Sfs.SettleAccount.Entities.BT_Car;
using Win.Sfs.SettleAccount.Entities.WMS;
using Win.Sfs.SettleAccount.Entities;
namespace Win.Sfs.SettleAccount
{
@ -245,10 +247,67 @@ namespace Win.Sfs.SettleAccount
CreateMapBT_Car_Platform();
CreateMapBT_Car_PlatformVersion();
#endregion
#region 出库单导出
CreateMapWMSJit();
CreateMapWmsKanban();
CreateMapWMSKanbanExtend();
CreateMapWmsSharePart();
CreateMapWmsSharePart90();
CreateMapWmsHQWithOutKanban();
CreateMapWmsHQCar();
#endregion
}
#region 派格出库单
private void CreateMapWMSJit()
{
CreateMap<WmsJitOutPutDetial, WmsJitOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsKanban()
{
CreateMap<WmsKanbanOutPutDetial, WmsKanbanOutPutDetialDto>().ReverseMap();
}
private void CreateMapWMSKanbanExtend()
{
CreateMap<WmsWithOutKanbanOutPutDetial, WmsWithOutKanbanOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsSharePart()
{
CreateMap<WmsSharePartOutPutDetial, WmsSharePartOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsSharePart90()
{
CreateMap<WmsSharePart90OutPutDetial, WmsSharePart90OutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsHQWithOutKanban()
{
CreateMap<WmsHQWithOutKanbanOutPutDetial, WmsHQWithOutKanbanOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsHQCar()
{
CreateMap<WmsHQCarOutPutDetial, WmsHQCarOutPutDetialDto>().ReverseMap();
}
#endregion
#region PG-派格映射
/// <summary>
/// 红旗F平台导入
/// </summary>

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

@ -212,46 +212,46 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ImporterHeader(Name = "结算数量")]
public decimal Qty { set; get; }
//以下继承的全部不导出
////以下继承的全部不导出
[ExporterHeader(DisplayName = "BranchId", IsIgnore = true)]
public Guid BranchId { set; get; }
//[ExporterHeader(DisplayName = "BranchId", IsIgnore = true)]
//public Guid BranchId { set; get; }
[ExporterHeader(DisplayName = "Enabled", IsIgnore = true)]
public bool Enabled { set; get; }
//[ExporterHeader(DisplayName = "Enabled", IsIgnore = true)]
//public bool Enabled { set; get; }
[ExporterHeader(DisplayName = "Remark", IsIgnore = true)]
public string Remark { set; get; }
//[ExporterHeader(DisplayName = "Remark", IsIgnore = true)]
//public string Remark { set; get; }
[ExporterHeader(DisplayName = "IsDeleted", IsIgnore = true)]
public bool IsDeleted { set; get; }
//[ExporterHeader(DisplayName = "IsDeleted", IsIgnore = true)]
//public bool IsDeleted { set; get; }
[ExporterHeader(DisplayName = "DeleterId", IsIgnore = true)]
public bool DeleterId { set; get; }
//[ExporterHeader(DisplayName = "DeleterId", IsIgnore = true)]
//public bool DeleterId { set; get; }
[ExporterHeader(DisplayName = "DeletionTime", IsIgnore = true)]
public DateTime DeletionTime { set; get; }
//[ExporterHeader(DisplayName = "DeletionTime", IsIgnore = true)]
//public DateTime DeletionTime { set; get; }
[ExporterHeader(DisplayName = "LastModificationTime", IsIgnore = true)]
public DateTime LastModificationTime { set; get; }
//[ExporterHeader(DisplayName = "LastModificationTime", IsIgnore = true)]
//public DateTime LastModificationTime { set; get; }
[ExporterHeader(DisplayName = "LastModifierId", IsIgnore = true)]
public Guid LastModifierId { set; get; }
//[ExporterHeader(DisplayName = "LastModifierId", IsIgnore = true)]
//public Guid LastModifierId { set; get; }
[ExporterHeader(DisplayName = "CreationTime", IsIgnore = true)]
public DateTime CreationTime { set; get; }
//[ExporterHeader(DisplayName = "CreationTime", IsIgnore = true)]
//public DateTime CreationTime { set; get; }
[ExporterHeader(DisplayName = "CreatorId", IsIgnore = true)]
public Guid CreatorId { set; get; }
//[ExporterHeader(DisplayName = "CreatorId", IsIgnore = true)]
//public Guid CreatorId { set; get; }
[ExporterHeader(DisplayName = "ExtraProperties", IsIgnore = true)]
public string ExtraProperties { set; get; }
//[ExporterHeader(DisplayName = "ExtraProperties", IsIgnore = true)]
//public string ExtraProperties { set; get; }
[ExporterHeader(DisplayName = "ConcurrencyStamp", IsIgnore = true)]
public DateTime ConcurrencyStamp { set; get; }
//[ExporterHeader(DisplayName = "ConcurrencyStamp", IsIgnore = true)]
//public DateTime ConcurrencyStamp { set; get; }
[ExporterHeader(DisplayName = "Id", IsIgnore = true)]
public Guid Id { set; get; }
//[ExporterHeader(DisplayName = "Id", IsIgnore = true)]
//public Guid Id { set; get; }
@ -262,9 +262,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
public class WmsKanbanOutPut : FullAuditedAggregateRootBase<Guid>
{
public WmsKanbanOutPut()
@ -516,44 +513,44 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
//以下继承的全部不导出
[ExporterHeader(DisplayName = "BranchId", IsIgnore = true)]
public Guid BranchId { set; get; }
//[ExporterHeader(DisplayName = "BranchId", IsIgnore = true)]
//public Guid BranchId { set; get; }
[ExporterHeader(DisplayName = "Enabled", IsIgnore = true)]
public bool Enabled { set; get; }
//[ExporterHeader(DisplayName = "Enabled", IsIgnore = true)]
//public bool Enabled { set; get; }
[ExporterHeader(DisplayName = "Remark", IsIgnore = true)]
public string Remark { set; get; }
//[ExporterHeader(DisplayName = "Remark", IsIgnore = true)]
//public string Remark { set; get; }
[ExporterHeader(DisplayName = "IsDeleted", IsIgnore = true)]
public bool IsDeleted { set; get; }
//[ExporterHeader(DisplayName = "IsDeleted", IsIgnore = true)]
//public bool IsDeleted { set; get; }
[ExporterHeader(DisplayName = "DeleterId", IsIgnore = true)]
public bool DeleterId { set; get; }
//[ExporterHeader(DisplayName = "DeleterId", IsIgnore = true)]
//public bool DeleterId { set; get; }
[ExporterHeader(DisplayName = "DeletionTime", IsIgnore = true)]
public DateTime DeletionTime { set; get; }
//[ExporterHeader(DisplayName = "DeletionTime", IsIgnore = true)]
//public DateTime DeletionTime { set; get; }
[ExporterHeader(DisplayName = "LastModificationTime", IsIgnore = true)]
public DateTime LastModificationTime { set; get; }
//[ExporterHeader(DisplayName = "LastModificationTime", IsIgnore = true)]
//public DateTime LastModificationTime { set; get; }
[ExporterHeader(DisplayName = "LastModifierId", IsIgnore = true)]
public Guid LastModifierId { set; get; }
//[ExporterHeader(DisplayName = "LastModifierId", IsIgnore = true)]
//public Guid LastModifierId { set; get; }
[ExporterHeader(DisplayName = "CreationTime", IsIgnore = true)]
public DateTime CreationTime { set; get; }
//[ExporterHeader(DisplayName = "CreationTime", IsIgnore = true)]
//public DateTime CreationTime { set; get; }
[ExporterHeader(DisplayName = "CreatorId", IsIgnore = true)]
public Guid CreatorId { set; get; }
//[ExporterHeader(DisplayName = "CreatorId", IsIgnore = true)]
//public Guid CreatorId { set; get; }
[ExporterHeader(DisplayName = "ExtraProperties", IsIgnore = true)]
public string ExtraProperties { set; get; }
//[ExporterHeader(DisplayName = "ExtraProperties", IsIgnore = true)]
//public string ExtraProperties { set; get; }
[ExporterHeader(DisplayName = "ConcurrencyStamp", IsIgnore = true)]
public DateTime ConcurrencyStamp { set; get; }
//[ExporterHeader(DisplayName = "ConcurrencyStamp", IsIgnore = true)]
//public DateTime ConcurrencyStamp { set; get; }
[ExporterHeader(DisplayName = "Id", IsIgnore = true)]
public Guid Id { set; get; }
//[ExporterHeader(DisplayName = "Id", IsIgnore = true)]
//public Guid Id { set; get; }
}
@ -1910,72 +1907,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
public class ExportWmsSharePartOutPutDetial
{
[ExporterHeader(DisplayName = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "采购订单号")]
//KENN号
public string OrderBillNum { set; get; }
[ExporterHeader(DisplayName = "SAP编码")]
//物料号
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
//物料描述
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
//物料组(车型)
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ExporterHeader(DisplayName = "状态", IsIgnore = true)]
public int State { get; set; }
[ExporterHeader(DisplayName = "物料代码")]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
/// <summary>
/// 扩展字段2
/// </summary>
[ExporterHeader(DisplayName = "扩展字段2", IsIgnore = true)]
public string Extend2 { set; get; }
/// <summary>
/// 扩展字段3
/// </summary>
[ExporterHeader(DisplayName = "版本号", IsIgnore = true)]
public string Version { set; get; }
[ExporterHeader(DisplayName = "开票数量")]
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "单据", IsIgnore = true)]
public string BillNum { set; get; }
[ExporterHeader(DisplayName = "任务代码", IsIgnore = true)]
public Guid TaskId { set; get; }
[ExporterHeader(DisplayName = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; }
[ExporterHeader(DisplayName = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
}

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

@ -61,66 +61,59 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
////{
//// condition += string.Format(" B.chassisNumber='{0}' ", materialGroup);
////}
string str =
"SELECT\n" +
" isnull(temp1.交货单号,'') 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull(temp1.手工或自动,'') 手工或自动,\n" +
string str = "SELECT\n" +
" temp1.交货日期,\n" +
" isnull( 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" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull(TEMP2.Price,0) AS 发货定价,\n" +
" isnull(temp1.发货数量,0) * isnull(TEMP2.Price,0) AS 发货总金额,\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" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额\n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" b.LastModificationTime AS 交货时间,\n" +
" b.LastModificationTime 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" +
" '' AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull(b.Qty,0) AS 发货数量,\n" +
" isnull(b.State,0) 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" +
" isnull( a.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}' {1}) 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";
" ( a.HQHKanBan <> 'BJ' ) \n" +
" AND a.Version= '{0}' {1} \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode" ;
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null);

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

@ -356,6 +356,25 @@ public class SparePartSumQtyDiff
//[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)]
public class SettleSparePartExport
{
public SettleSparePartExport()
{
}
public SettleSparePartExport( string sapMaterialCode, string materialCode, string materialDesc,
decimal qty, decimal sockQty)
{
SAP编码 = sapMaterialCode;
= materialDesc;
= materialCode;
= qty;
= sockQty;
}
[ExporterHeader(DisplayName = "交货日期 ")]
public string { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
@ -395,5 +414,8 @@ public class SparePartSumQtyDiff
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "寄售库存数量")]
public decimal { set; get; }
}
}

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

@ -20,21 +20,24 @@ namespace SettleAccount.Job.Services.Report
private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly WmsDapperRepository _wmsDapper;
public SettleSparePartExportService(SettleSparePartDapperReportRepository dapper, ErpPartDapperRepository erpdapperRepository, OutputService outputService
, WmsDapperRepository wmsDapper
, IBlobContainer<MyFileContainer> fileContainer)
{
_dapper = dapper;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_fileContainer = fileContainer;
_wmsDapper = wmsDapper;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var fileName=exportName.FirstOrDefault();
var fileName = exportName.FirstOrDefault();
var purchaseOrderNo = p_list.Where(p => p.Name == "PurchaseOrderNo").FirstOrDefault().Value;
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SAPCode").FirstOrDefault().Value;
@ -51,6 +54,20 @@ namespace SettleAccount.Job.Services.Report
//反向对比,有发货无结算
var _reversels = _dapper.GetReverseSettleSparePartReportList(purchaseOrderNo, version, sapCode, matialCode, beginTime, endTime);
//按照零件号汇总数量,有一列显示寄售库数量
var stockList = _wmsDapper.GetSalesStock();
var queryStockList = from itm in _forwardls
join itm1 in stockList on itm.SAP编码 equals itm1.SapCode into temp1
from tm1 in temp1.DefaultIfEmpty()
select new SettleSparePartExport(
itm.SAP编码,
itm.,
itm.,
itm.,
tm1 == null ? 0 : tm1.Qty
);
//var diffList = _dapper.GetSettleSparePartSumQtyDiff(version);
//if (diffList != null)
@ -113,7 +130,9 @@ namespace SettleAccount.Job.Services.Report
.SeparateBySheet()
.Append(_forwardls.ToList(), "有结算无发货对比")
.SeparateBySheet()
.Append(_reversels.ToList(),"有发货无结算对比")
.Append(_reversels.ToList(), "有发货无结算对比")
.SeparateBySheet()
.Append(queryStockList.ToList(), "零件汇总比对寄售库存")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(fileName, result.Result, true);

Loading…
Cancel
Save