Administrator 3 years ago
parent
commit
36487ac0ba
  1. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailCancelInterface.cs
  2. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailUnInterface.cs
  3. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnSumInterface.cs
  4. 83
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  5. 22
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs
  6. 19
      src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs

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

@ -30,6 +30,9 @@ using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// 撤销出库清单
/// </summary>
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Route("api/settleaccount/WMSOutputDetailCancelDiffReport")]
public class WMSOutputDetailCancelDiffReportAppService :

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

@ -30,6 +30,9 @@ using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// 出库差异清单
/// </summary>
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Route("api/settleaccount/WMSOutputDetailDiffReport")]
public class WMSOutputDetailDiffReportAppService :

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

@ -24,6 +24,9 @@ using Win.Sfs.Shared.Filter;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
/// <summary>
/// 已结算出库查询
/// </summary>
[Authorize(SettleAccountPermissions.WMSJIT.Default)]
[Route("api/settleaccount/WMSOutputDetailWithCodeReport")]
public class WMSOutputDetailWithCodeReportAppService :

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

@ -205,9 +205,92 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
/// <summary>
/// 根据DTO自动生成模板,供前端下载模板用
/// </summary>
public class WmsCustomerKanbanOutPutDetialDTO
{
public WmsCustomerKanbanOutPutDetialDTO()
{
}
[ImporterHeader(Name = "客户编码")]
[ExporterHeader(DisplayName = "客户编码")]
public string CustomerCode { set; get; }
[ImporterHeader(Name = "看板编号")]
[ExporterHeader(DisplayName = "看板编号")]
//KENN号
public string Kanban { set; get; }
[ImporterHeader(Name = "客户零件号", IsIgnore = true)]
[ExporterHeader(DisplayName = "客户零件号", IsIgnore = true)]
public string MaterialCode { set; get; }
[ImporterHeader(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { set; get; }
//[ImporterHeader(Name = "订货看板编号")]
////KENN号
//public string OrderBillNum { set; get; }
[ImporterHeader(Name = "SAP零件号")]
[ExporterHeader(DisplayName = "SAP零件号")]
//物料号
public string SapMaterialCode { 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 = "发货零件号", IsIgnore = true)]
[ExporterHeader(DisplayName = "发货零件号", IsIgnore = true)]
/// <summary>
/// 扩展字段1
/// </summary>
public string Extend1 { set; get; }
[ImporterHeader(Name = "收货仓库", IsIgnore = true)]
[ExporterHeader(DisplayName = "收货仓库", 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 = "结算单价")]
[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 = "任务描述", IsIgnore = true)]
[ExporterHeader(DisplayName = "任务描述", IsIgnore = true)]
public Guid TaskId { set; get; }
}

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

@ -1107,6 +1107,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"WHERE\n" +
" VERSION = '{0}' \n" +
" AND STATE = 3 union all \n"+
"SELECT\n" +
"'自定义发货出库' AS Type,\n" +
"customercode Client,\n" +
@ -1300,7 +1301,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" AND State =2 \n" +
"Union All\n"+
"UNION ALL\n" +
"SELECT\n" +
" '一次性销售' AS TYPE,\n" +
" '一次性销售' Client,\n" +
" BillNum,\n" +
" SapMaterialCode,\n" +
" Qty Qty,\n" +
" RealityNumber OutputQty,\n" +
" 0 IsBack,\n" +
" Price,\n" +
" '' CNumber,\n" +
" Remark \n" +
"FROM\n" +
" Set_WmsOneTimeSaleOutPutDetial \n" +
"WHERE\n" +
" VERSION = '{0}' \n" +
" AND STATE = 2 \n" +
"Union All\n" +
"SELECT\n" +
"'自定义发货出库' AS Type,\n" +

19
src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs

@ -38,12 +38,16 @@ namespace Win.Sfs.SettleAccount
return File(fileDto.Content, "application/octet-stream", fileDto.Name);
}
/// <summary>
/// 生成其他出库导入模板
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("saveCustomExcelTemplate")]
public async Task<string> SaveSalesContractExcelImportTemplate()
public async Task<string> SaveCustomExcelImportTemplate()
{
string fileName = "大众通用看板模板.xlsx";
var result = await Importer.GenerateTemplateBytes<WmsCustomerKanbanOutPutDetial>();
string fileName = "客户自定义发货结算导入模板.xlsx";
var result = await Importer.GenerateTemplateBytes<WmsCustomerKanbanOutPutDetialDTO>();
result.ShouldNotBeNull();
result.Length.ShouldBeGreaterThan(0);
await _excelImportService.SaveBlobAsync(
@ -53,15 +57,6 @@ namespace Win.Sfs.SettleAccount
Content = result
}
);
Stream stream = new MemoryStream(result);
using (var pck = new ExcelPackage(stream))
{
pck.Workbook.Worksheets.Count.ShouldBe(1);
var sheet = pck.Workbook.Worksheets.First();
var attr = typeof(WmsCustomerKanbanOutPutDetial).GetAttribute<ExcelImporterAttribute>();
var text = sheet.Cells["A1"].Text.Replace("\n", string.Empty).Replace("\r", string.Empty);
text.ShouldBe(attr.ImportDescription.Replace("\n", string.Empty).Replace("\r", string.Empty));
}
return fileName;
}

Loading…
Cancel
Save