Browse Source

报表代码生成

branch_ccpg_220107
44673626 3 years ago
parent
commit
3cab81f47c
  1. 9
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs
  2. 17
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs
  3. 15
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  4. 16
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs
  5. 3
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  6. 59
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs

9
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs

@ -6810,6 +6810,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2") .HasColumnType("datetime2")
.HasColumnName("DeletionTime"); .HasColumnName("DeletionTime");
b.Property<string>("DeliveryOrderNo")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Enabled") b.Property<bool>("Enabled")
.HasColumnType("bit"); .HasColumnType("bit");
@ -6888,12 +6891,18 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Version") b.Property<string>("Version")
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
b.Property<string>("WMSActualGoodsDate")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSDeliverGoodsState") b.Property<string>("WMSDeliverGoodsState")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("WMSDeliveryNote") b.Property<string>("WMSDeliveryNote")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<decimal>("WMSDeliveryQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("WMSKanBanState") b.Property<string>("WMSKanBanState")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");

17
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs

@ -77,6 +77,17 @@ namespace Win.Sfs.SettleAccount.Entities.WMSKanBan
/// </summary> /// </summary>
public string WMSDeliveryNote { set; get; } public string WMSDeliveryNote { set; get; }
/// <summary>
/// WMS实际发货日期
/// </summary>
public string WMSActualGoodsDate { set; get; }
/// <summary>
/// WMS交货数量
/// </summary>
public decimal WMSDeliveryQty { set; get; }
/// <summary> /// <summary>
/// WMS发货状态 /// WMS发货状态
/// </summary> /// </summary>
@ -93,8 +104,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMSKanBan
public virtual string State { get; set; } public virtual string State { get; set; }
/// <summary> /// <summary>
/// 备注 /// 出库单号
/// </summary> /// </summary>
public virtual string Remark { get; set; } public string DeliveryOrderNo { set; get; }
} }
} }

15
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -2406,6 +2406,21 @@
<param name="repository">仓储接口</param> <param name="repository">仓储接口</param>
<param name="cache">缓存</param> <param name="cache">缓存</param>
</member> </member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.SettledKanBanWithCode(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.DateTime,System.DateTime)">
<summary>
有条码看板结算核对
</summary>
<param name="year"></param>
<param name="period"></param>
<param name="version"></param>
<param name="customerCode"></param>
<param name="factory"></param>
<param name="matialCode"></param>
<param name="state"></param>
<param name="begin"></param>
<param name="end"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnSettledMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.DateTime,System.DateTime)"> <member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnSettledMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.DateTime,System.DateTime)">
<summary> <summary>
未结算对比 未结算对比

16
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS-KanBan/WMSKanBanSettle.cs

@ -80,11 +80,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
/// </summary> /// </summary>
public string State { set; get; } public string State { set; get; }
/// <summary> /// <summary>
/// WMS交货单 /// WMS交货单
/// </summary> /// </summary>
public string WMSDeliveryNote { set; get; } public string WMSDeliveryNote { set; get; }
/// <summary>
/// WMS实际发货日期
/// </summary>
public string WMSActualGoodsDate { set; get; }
/// <summary>
/// WMS交货数量
/// </summary>
public decimal WMSDeliveryQty { set; get; }
/// <summary> /// <summary>
/// WMS发货状态 /// WMS发货状态
/// </summary> /// </summary>
@ -95,6 +106,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS_KanBan
/// </summary> /// </summary>
public string WMSKanBanState { set; get; } public string WMSKanBanState { set; get; }
/// <summary>
/// 出库单号
/// </summary>
public string DeliveryOrderNo { set; get; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>

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

@ -66,6 +66,7 @@ using Win.Sfs.SettleAccount.Entities.VWKanBan;
using Win.Sfs.SettleAccount.Entities.VWScrapClaims; using Win.Sfs.SettleAccount.Entities.VWScrapClaims;
using Win.Sfs.SettleAccount.Entities.VWSparePart; using Win.Sfs.SettleAccount.Entities.VWSparePart;
using Win.Sfs.SettleAccount.Entities.WMS_KanBan; using Win.Sfs.SettleAccount.Entities.WMS_KanBan;
using Win.Sfs.SettleAccount.Entities.WMS_SparePart;
namespace Win.Sfs.SettleAccount namespace Win.Sfs.SettleAccount
{ {
@ -315,7 +316,7 @@ namespace Win.Sfs.SettleAccount
private static void ConfigureWMSSparePart(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) private static void ConfigureWMSSparePart(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{ {
builder.Entity<SparePart>(b => builder.Entity<WMSSparePart>(b =>
{ {
b.ToTable($"{options.TablePrefix}_WMSSparePart", options.Schema); b.ToTable($"{options.TablePrefix}_WMSSparePart", options.Schema);

59
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs

@ -19,19 +19,44 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public virtual List<SettleKBWithCode> GetSettleKBWithCodeReportList(string state, string version, string year,string customcode, string begintime, string endtime) public virtual List<SettleKBWithCode> GetSettleKBWithCodeReportList(string state, string version, string year,string customcode, string begintime, string endtime)
{ {
string sqlString = " select " + string.Format(" {0} as Version , ", version) + " r1.ErpMaterialCode, r2.Price, r1.SumPrice , r1.MaterialDesc, (isnull(r2.Price,0)-isnull(r1.SumPrice,0)) as diffPrice from \n" + string sqlString = "SELECT\n" +
"( select ErpMaterialCode, MaterialDesc, SUM(Price) as SumPrice from(\n" + " * ,\n" +
"select a.ErpMaterialCode, b.SettlementPartCode, a.MaterialDesc, (a.Qty * b.Price) as Price from\n" + " ISNULL( Price * WMSDeliveryQty, 0 ) AS Amount, --金额\n" +
"(SELECT ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty, Version ,CustomerCode \n" + " ISNULL( InvoicePrice * Qty, 0 ) AS SettleQty, --结算金额\n" +
"FROM [Set_MaterialRelationshipDetail] mdetail \n" + " (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异\n" +
" ISNULL( Price * Qty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异\n" +
" where mdetail.Version='{0}' and mdetail.CustomerCode='{1}' \n" + "FROM\n" +
") a \n" + " (\n" +
"inner join Set_settlement_part b on a.Version = b.Version and a.SettleMaterialCode = b.SettlementPartCode and a.CustomerCode = b.CustomerCode) temp group by ErpMaterialCode, MaterialDesc) r1 left join set_pricelist r2 " + " SELECT\n" +
" on r2.MaterialCode=r1.ErpMaterialCode and r2.Version='{0}'\n"; " c.WMSDeliveryNote,--交货单号\n" +
" c.WMSActualGoodsDate,--实际发货日期\n" +
string _sql = string.Format(sqlString, version, customcode); " a.Kanban,--条码号\n" +
" b.MaterialCode SapMaterialCode,--厂内物料号\n" +
" b.MaterialDesc,--物料描述\n" +
" b.CustomerPartCode,--客户物料\n" +
" b.EstimateTypeDesc,--物料组(车型)\n" +
" c.WMSDeliveryQty,--交货数量\n" +
" a.Qty AS SettleNumber,--结算数量\n" +
" a.SettleDate, --结算日期\n" +
" a.Qty,--用于计算\n" +
" (a.Qty-c.WMSDeliveryQty) as SettleWMSDiffQty,--结算与发货差异\n" +
" (a.Qty-a.Qty) as SettleInvoiceDiffQty,--结算与发货差异\n" +
" a.Qty AS InvoiceDiffQty, --开票数量,暂时等同于结算数量\n" +
" d.InvoicePrice,--开票单价\n" +
" (a.Qty * d.InvoicePrice) as InvoiceMoney, --开票金额\n" +
" c.DeliveryOrderNo --出库单号\n" +
" \n" +
" FROM\n" +
" Set_KanBanSettle AS a\n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode\n" +
" LEFT JOIN Set_WMSKanBanSettle c ON a.Kanban= c.Kanban \n" +
" AND a.MaterialCode= c.MaterialCode\n" +
" LEFT JOIN ( SELECT SUM ( amt ) / SUM ( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '202109' GROUP BY materialcode ) d ON a.MaterialCode= d.MaterialCode \n" +
" ) TEMP1\n" +
" LEFT JOIN ( SELECT Price, --定价\n" +
" MaterialCode --厂内物料号\n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SapMaterialCode= TEMP2.MaterialCode";
string _sql = string.Format(sqlString, version);
var _query = DbConnection.Query<SettleKBWithCode>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<SettleKBWithCode>(_sql, null, null, true, 1200, null);
return _query.ToList(); return _query.ToList();
@ -61,13 +86,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string MaterialDesc { set; get; } public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "客户物料")] [ExporterHeader(DisplayName = "客户物料")]
public string CustomerMaterial { set; get; } public string CustomerPartCode { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")] [ExporterHeader(DisplayName = "物料组(车型)")]
public string Model { set; get; } public string EstimateTypeDesc { set; get; }
[ExporterHeader(DisplayName = "交货数量")] [ExporterHeader(DisplayName = "交货数量")]
public decimal WMSBillNum { set; get; } public decimal WMSDeliveryQty { set; get; }
[ExporterHeader(DisplayName = "定价")] [ExporterHeader(DisplayName = "定价")]
public decimal Price { set; get; } public decimal Price { set; get; }
@ -90,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算与开票差异")] [ExporterHeader(DisplayName = "结算与开票差异")]
public decimal SettleInvoiceDiffQty { set; get; } public decimal SettleInvoiceDiffQty { set; get; }
[ExporterHeader(DisplayName = "开票量")] [ExporterHeader(DisplayName = "开票量")]
public decimal InvoiceDiffQty { set; get; } public decimal InvoiceDiffQty { set; get; }
[ExporterHeader(DisplayName = "开票单价")] [ExporterHeader(DisplayName = "开票单价")]

Loading…
Cancel
Save