佐 张 3 years ago
parent
commit
d438964654
  1. 1
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
  2. 10
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
  3. 10
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  4. 63
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Kanban.cs
  5. 63
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Kanban.cs
  6. 7
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs
  7. 63
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_M/HQ_M_Kanban.cs
  8. 18
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  9. 135
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  10. 91
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartExtendDapperReportRepository.cs

1
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj

@ -54,7 +54,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Migrations\" />
<Folder Include="wwwroot\files\host\my-file-container\" /> <Folder Include="wwwroot\files\host\my-file-container\" />
</ItemGroup> </ItemGroup>

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

@ -7,11 +7,11 @@
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;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=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;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.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;" //"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {

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

@ -7,11 +7,11 @@
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;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=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;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.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;" //"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
}, },
"Logging": { "Logging": {

63
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_F/HQ_F_Kanban.cs

@ -0,0 +1,63 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.HQ_F
{
//行号
//零件号
//零件中文名称
//需求数
//已接收数
//订货看板编号
//手工或自动
//收货仓库
//收货仓库描述
//交货时间
//发货状态
//供应商
public class HQ_F_Kanban:FullAuditedAggregateRootBase<Guid>
{
[ExporterHeader(DisplayName = "行号")]
public string PoLine { set; get; }
[ExporterHeader(DisplayName = "零件号")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "零件中文名称 ")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string Kanban { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string IsAuto { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string Warehouse { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述 ")]
public string WarehouseDesc { set; get; }
[ExporterHeader(DisplayName = "供应商")]
public string Supplier { set; get; }
[ExporterHeader(DisplayName = "发货状态")]
public string State { set; get; }
public HQ_F_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)
{
Id = id;
PoLine = poLine;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
Qty = qty;
Kanban = kanban;
IsAuto = isAuto;
Warehouse = warehouse;
WarehouseDesc = warehouseDesc;
Supplier = supplier;
State = state;
}
}
}

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

@ -0,0 +1,63 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.HQ_F
{
//行号
//零件号
//零件中文名称
//需求数
//已接收数
//订货看板编号
//手工或自动
//收货仓库
//收货仓库描述
//交货时间
//发货状态
//供应商
public class HQ_H_Kanban:FullAuditedAggregateRootBase<Guid>
{
[ExporterHeader(DisplayName = "行号")]
public string PoLine { set; get; }
[ExporterHeader(DisplayName = "零件号")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "零件中文名称 ")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string Kanban { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string IsAuto { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string Warehouse { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述 ")]
public string WarehouseDesc { set; get; }
[ExporterHeader(DisplayName = "供应商")]
public string Supplier { set; get; }
[ExporterHeader(DisplayName = "发货状态")]
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)
{
Id = id;
PoLine = poLine;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
Qty = qty;
Kanban = kanban;
IsAuto = isAuto;
Warehouse = warehouse;
WarehouseDesc = warehouseDesc;
Supplier = supplier;
State = state;
}
}
}

7
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_H/HQ_H_Platform.cs

@ -24,7 +24,7 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
public HQ_H_Platform(Guid Id,string materialVoucherNo,string externalKanbanNumber, public HQ_H_Platform(Guid Id,string materialVoucherNo,string externalKanbanNumber,
string kanbanNumber, string year,string factory,DateTime acceptanceDate, string kanbanNumber, string year,string factory,DateTime acceptanceDate,
string period, string version,string kanBan,string supplier,string storageLocation,string storageLocationDesc, string period, string version,string kanBan,string supplier,string storageLocation,string storageLocationDesc,
string materialCode) : base(Id) string materialCode,string acceptanceNo, decimal qty, decimal price, decimal amt) : base(Id)
{ {
MaterialVoucherNo = materialVoucherNo; MaterialVoucherNo = materialVoucherNo;
KanbanNumber = kanbanNumber; KanbanNumber = kanbanNumber;
@ -39,8 +39,13 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
Supplier = supplier; Supplier = supplier;
StorageLocation = storageLocation; StorageLocation = storageLocation;
StorageLocationDesc = storageLocationDesc; StorageLocationDesc = storageLocationDesc;
AcceptanceNo = acceptanceNo;
Qty = qty;
Price = price;
Amt = amt;
} }
//验收单号 外部单号 物料凭证号 物料凭证日期 物料凭证记账日期 看板编号 外部看板编号 物料号 物料描述 数量 单价 金额 //验收单号 外部单号 物料凭证号 物料凭证日期 物料凭证记账日期 看板编号 外部看板编号 物料号 物料描述 数量 单价 金额
//工厂 备注 创建者 创建时间 修改人 修改时间 公司 验收单号 外部单号 发票号 会计年度 金额 计划员 存储地点 //工厂 备注 创建者 创建时间 修改人 修改时间 公司 验收单号 外部单号 发票号 会计年度 金额 计划员 存储地点
//存储地点描述 状态 验收单日期 供应商 录入人 录入人描述 看板号 //存储地点描述 状态 验收单日期 供应商 录入人 录入人描述 看板号

63
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_M/HQ_M_Kanban.cs

@ -0,0 +1,63 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.HQ_F
{
//行号
//零件号
//零件中文名称
//需求数
//已接收数
//订货看板编号
//手工或自动
//收货仓库
//收货仓库描述
//交货时间
//发货状态
//供应商
public class HQ_M_Kanban:FullAuditedAggregateRootBase<Guid>
{
[ExporterHeader(DisplayName = "行号")]
public string PoLine { set; get; }
[ExporterHeader(DisplayName = "零件号")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "零件中文名称 ")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string Kanban { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string IsAuto { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string Warehouse { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述 ")]
public string WarehouseDesc { set; get; }
[ExporterHeader(DisplayName = "供应商")]
public string Supplier { set; get; }
[ExporterHeader(DisplayName = "发货状态")]
public string State { set; get; }
public HQ_M_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)
{
Id = id;
PoLine = poLine;
MaterialCode = materialCode;
MaterialDesc = materialDesc;
Qty = qty;
Kanban = kanban;
IsAuto = isAuto;
Warehouse = warehouse;
WarehouseDesc = warehouseDesc;
Supplier = supplier;
State = state;
}
}
}

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

@ -55,7 +55,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
/// <summary>
/// 准时化出库主表
/// </summary>
public class WmsJitOutPut : FullAuditedAggregateRootBase<Guid> public class WmsJitOutPut : FullAuditedAggregateRootBase<Guid>
{ {
public WmsJitOutPut() public WmsJitOutPut()
@ -82,7 +84,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary> /// <summary>
/// /// 准时化出库明细
/// </summary> /// </summary>
public class WmsJitOutPutDetial : FullAuditedAggregateRootBase<Guid> public class WmsJitOutPutDetial : FullAuditedAggregateRootBase<Guid>
{ {
@ -229,7 +231,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary> /// <summary>
/// /// 看板明细
/// </summary> /// </summary>
public class WmsKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid> public class WmsKanbanOutPutDetial : FullAuditedAggregateRootBase<Guid>
{ {
@ -331,7 +333,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 备件出库
/// </summary>
public class WmsSharePartOutPut : FullAuditedAggregateRootBase<Guid> public class WmsSharePartOutPut : FullAuditedAggregateRootBase<Guid>
{ {
public WmsSharePartOutPut() public WmsSharePartOutPut()
@ -358,7 +362,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary> /// <summary>
/// /// 备件出库明细
/// </summary> /// </summary>
public class WmsSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid> public class WmsSharePartOutPutDetial : FullAuditedAggregateRootBase<Guid>
{ {
@ -452,7 +456,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 备件无订单号出库
/// </summary>
public class WmsSharePartOutPutDetial2: FullAuditedAggregateRootBase<Guid> public class WmsSharePartOutPutDetial2: FullAuditedAggregateRootBase<Guid>
{ {

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

@ -73,6 +73,7 @@ using Win.Sfs.SettleAccount.Entities.BT_Car;
using Win.Sfs.SettleAccount.Entities.WMS; using Win.Sfs.SettleAccount.Entities.WMS;
using Win.Sfs.SettleAccount.Entities.HQ_F; using Win.Sfs.SettleAccount.Entities.HQ_F;
namespace Win.Sfs.SettleAccount namespace Win.Sfs.SettleAccount
{ {
public static class SettleAccountDbContextModelCreatingExtensions public static class SettleAccountDbContextModelCreatingExtensions
@ -332,13 +333,147 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsKanbanOutPutDetail(options); builder.ConfigureWmsKanbanOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutDetail(options); builder.ConfigureWmsSharePartOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutVersion(options); builder.ConfigureWmsSharePartOutPutVersion(options);
builder.ConfigureHQFKanban(options);
builder.ConfigureHQMKanban(options);
builder.ConfigureHQHKanban(options);
#endregion #endregion
} }
#region PG-派格 #region PG-派格
private static void ConfigureHQFKanban(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<HQ_F_Kanban>(b =>
{
b.ToTable($"{options.TablePrefix}_HQ_F_Kanban", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Kanban).IsRequired().HasMaxLength(50);//必填项
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(100);
b.Property(x => x.PoLine).IsRequired().HasMaxLength(50);
b.Property(x => x.Supplier).HasMaxLength(50);
b.Property(x => x.Warehouse).HasMaxLength(50);
b.Property(x => x.WarehouseDesc).HasMaxLength(150);
b.Property(x => x.State).HasMaxLength(50);
//创建组合索引
b.HasIndex(x => new { x.Kanban, x.PoLine, x.MaterialCode });
});
}
private static void ConfigureHQMKanban(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<HQ_M_Kanban>(b =>
{
b.ToTable($"{options.TablePrefix}_HQ_M_Kanban", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Kanban).IsRequired().HasMaxLength(50);//必填项
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(100);
b.Property(x => x.PoLine).IsRequired().HasMaxLength(50);
b.Property(x => x.Supplier).HasMaxLength(50);
b.Property(x => x.Warehouse).HasMaxLength(50);
b.Property(x => x.WarehouseDesc).HasMaxLength(150);
b.Property(x => x.State).HasMaxLength(50);
//创建组合索引
b.HasIndex(x => new { x.Kanban, x.PoLine, x.MaterialCode });
});
}
private static void ConfigureHQHKanban(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<HQ_H_Kanban>(b =>
{
b.ToTable($"{options.TablePrefix}_HQ_H_Kanban", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.Kanban).IsRequired().HasMaxLength(50);//必填项
b.Property(x => x.MaterialCode).HasMaxLength(50);
b.Property(x => x.MaterialDesc).HasMaxLength(100);
b.Property(x => x.PoLine).IsRequired().HasMaxLength(50);
b.Property(x => x.Supplier).HasMaxLength(50);
b.Property(x => x.Warehouse).HasMaxLength(50);
b.Property(x => x.WarehouseDesc).HasMaxLength(150);
b.Property(x => x.State).HasMaxLength(50);
//创建组合索引
b.HasIndex(x => new { x.Kanban, x.PoLine, x.MaterialCode });
});
}
/// <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>

91
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartExtendDapperReportRepository.cs

@ -80,42 +80,44 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
} }
public virtual List<SettleSparePartExport> GetSettleSparePartNoOrderList(string purchaseOrderNo, string version, string sapCode, string matialCode, public virtual List<SettleSpareExtendPartExport> GetSettleSparePartNoOrderList(string purchaseOrderNo, string version, string sapCode, string matialCode,
string begintime, string endtime) string begintime, string endtime)
{ {
string sqlString = " SELECT \n" +
" * , \n" +
" (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异 \n" + var sql = "SELECT\n" +
" ISNULL( Price * ReceiptQty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异 \n" + " temp1.*,\n" +
" FROM \n" + " Isnull( TEMP2.Price, 0 ) Price,\n" +
" ( \n" + " Round( Isnull( TEMP2.Price, 0 )* InvoicedQty, 2 ) Amt \n" +
" SELECT \n" + "FROM\n" +
" c.Period as WMSDeliveryDate,--交货日期 \n" + " (\n" +
" c.WMSDeliveryNote,--交货单号 \n" + " SELECT\n" +
" c.SpareDate as OrderDate,--订单日期 \n" + " a.*,\n" +
" a.PurchaseOrderNo,--采购订单号 \n" + " b.EstimateTypeDesc MaterialGroup,\n" +
" b.MaterialCode as SAPCode,--SAP编码,即厂内物料号 \n" + " b.EstimateType MaterialGroupCode,\n" +
" a.MaterialCode,--物料代码 \n" + " b.MaterialCode SapCode,\n" +
" b.MaterialDesc,--物料描述 \n" + " 0 SockQty \n" +
" a.PurchaseOrderNoText,--采购订单文本 \n" + " FROM\n" +
" c.ReceiptQty,-- 发货数量 \n" + " (\n" +
" a.InvoicedQty as InvoicedQty,--开票数量 \n" + " SELECT\n" +
" (c.ReceiptQty-d.Amt) as SettleInvoiceDiffQty,--发货与开票差异 \n" + " sum( ReceiptQty ) ReceiptQty,\n" +
" d.InvoicePrice,--开票单价 \n" + " SUM( InvoicedQty ) InvoicedQty,\n" +
" 0 as InvoiceMoney --开票金额 \n" + " SUM( AmountNoTax ) AmountNoTax,\n" +
" \n" + " SUM( PurchasePriceNoTax ) PurchasePriceNoTax,\n" +
" FROM \n" + " MaterialCode \n" +
" Set_SparePart AS a \n" + " FROM\n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode \n" + " Set_SparePart \n" +
" LEFT JOIN Set_WMSSparePart c ON a.PurchaseOrderNo= c.WMSDeliveryNote \n" + " WHERE\n" +
" AND a.MaterialCode= c.MaterialCode \n" + " Version = '{0}' \n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode,Amt FROM set_invoice WHERE version = '{0}' GROUP BY materialcode,Amt ) d ON a.MaterialCode= d.MaterialCode \n" + " GROUP BY\n" +
" ) TEMP1 \n" + " MaterialCode \n" +
" LEFT JOIN ( SELECT Price, --定价 \n" + " ) A\n" +
" MaterialCode --厂内物料号 \n" + " LEFT JOIN Set_material B ON A.MaterialCode = B.CustomerPartCode \n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode "; " ) temp1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT MAX( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode = TEMP2.MaterialCode";
string addwhere = string.Empty; string addwhere = string.Empty;
string addSqlStr = string.Format(sqlString, version); string addSqlStr = string.Format(sql, version);
//if (!string.IsNullOrEmpty(purchaseOrderNo)) //if (!string.IsNullOrEmpty(purchaseOrderNo))
//{ //{
// addwhere += string.Format(" AND PurchaseOrderNo LIKE '{0}%' ", purchaseOrderNo); // addwhere += string.Format(" AND PurchaseOrderNo LIKE '{0}%' ", purchaseOrderNo);
@ -135,7 +137,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string _sql = string.Format(addSqlStr, addwhere); string _sql = string.Format(addSqlStr, addwhere);
//string _sql = string.Format(sqlString, version); //string _sql = string.Format(sqlString, version);
var _query = DbConnection.Query<SettleSparePartExport>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<SettleSpareExtendPartExport>(_sql, null, null, true, 1200, null);
return _query.ToList(); return _query.ToList();
} }
@ -144,6 +146,27 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
} }
public class SettleSpareExtendPartExport
{
//交货日期 交货单号 订单日期 采购订单号 SAP编码 物料代码 物料描述 采购订单文本 发货数量 开票数量 发货与开票差异 开票单价 开票金额 定价 单价差异 差异总金额
[ExporterHeader("收货数量数量")]
public decimal ReceiptQty { set; get; }
[ExporterHeader("开票数量")]
public decimal InvoicedQty { set; get; }
[ExporterHeader("金额")]
public decimal AmountNoTax { set; get; }
[ExporterHeader("金额")]
public decimal PurchasePriceNoTax { set; get; }
public string MaterialCode { set; get; }
public string MaterialGroup { set; get; }
public string MaterialGroupCode { set; get; }
public string SapCode { set; get; }
public string SockQty { set; get; }
}
// ReceiptQty InvoicedQty AmountNoTax PurchasePriceNoTax MaterialCode MaterialGroup MaterialGroupCode SapCode
///// <summary> ///// <summary>
///// 大众看板有条码报表 ///// 大众看板有条码报表

Loading…
Cancel
Save