Browse Source

更新版本

branch_ccpg_220107
Administrator 3 years ago
parent
commit
7a266c2b0b
  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. 63
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/HQ_M/HQ_M_Kanban.cs
  7. 18
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  8. 84
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  9. 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>
<Folder Include="Migrations\" />
<Folder Include="wwwroot\files\host\my-file-container\" />
</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!@#;"
//},
"ConnectionStrings": {
//"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;"
"Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
"Wms": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;"
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;"
//"Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
//"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
},
"Logging": {
"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!@#;"
//},
"ConnectionStrings": {
//"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;",
"Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
"Wms": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;"
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;",
//"Default": "Server=192.168.0.67;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"SettleAccountService": "Server=192.168.0.67;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
//"Wms": "Server=192.168.0.63;Database=CPAT_WMS;user id=sa;password=Microsoft2008;"
},
"Logging": {

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;
}
}
}

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

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

@ -330,12 +330,96 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsKanbanOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutDetail(options);
builder.ConfigureWmsSharePartOutPutVersion(options);
builder.ConfigureHQFKanban(options);
builder.ConfigureHQMKanban(options);
builder.ConfigureHQHKanban(options);
#endregion
}
#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>
/// 红旗工厂F平台验收结算明细-导入
/// </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 sqlString = " SELECT \n" +
" * , \n" +
" (Price-InvoicePrice) as InvoiceDiffPrice, --单价差异 \n" +
" ISNULL( Price * ReceiptQty-InvoiceMoney, 0 ) AS SumDiffMoney --总金额差异 \n" +
" FROM \n" +
" ( \n" +
" SELECT \n" +
" c.Period as WMSDeliveryDate,--交货日期 \n" +
" c.WMSDeliveryNote,--交货单号 \n" +
" c.SpareDate as OrderDate,--订单日期 \n" +
" a.PurchaseOrderNo,--采购订单号 \n" +
" b.MaterialCode as SAPCode,--SAP编码,即厂内物料号 \n" +
" a.MaterialCode,--物料代码 \n" +
" b.MaterialDesc,--物料描述 \n" +
" a.PurchaseOrderNoText,--采购订单文本 \n" +
" c.ReceiptQty,-- 发货数量 \n" +
" a.InvoicedQty as InvoicedQty,--开票数量 \n" +
" (c.ReceiptQty-d.Amt) as SettleInvoiceDiffQty,--发货与开票差异 \n" +
" d.InvoicePrice,--开票单价 \n" +
" 0 as InvoiceMoney --开票金额 \n" +
" \n" +
" FROM \n" +
" Set_SparePart AS a \n" +
" LEFT JOIN Set_material AS b ON a.MaterialCode= b.CustomerPartCode \n" +
" LEFT JOIN Set_WMSSparePart c ON a.PurchaseOrderNo= c.WMSDeliveryNote \n" +
" AND a.MaterialCode= c.MaterialCode \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" +
" ) TEMP1 \n" +
" LEFT JOIN ( SELECT Price, --定价 \n" +
" MaterialCode --厂内物料号 \n" +
" FROM Set_PriceList WHERE version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) TEMP2 ON TEMP1.SAPCode= TEMP2.MaterialCode ";
var sql = "SELECT\n" +
" temp1.*,\n" +
" Isnull( TEMP2.Price, 0 ) Price,\n" +
" Round( Isnull( TEMP2.Price, 0 )* InvoicedQty, 2 ) Amt \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.*,\n" +
" b.EstimateTypeDesc MaterialGroup,\n" +
" b.EstimateType MaterialGroupCode,\n" +
" b.MaterialCode SapCode,\n" +
" 0 SockQty \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" sum( ReceiptQty ) ReceiptQty,\n" +
" SUM( InvoicedQty ) InvoicedQty,\n" +
" SUM( AmountNoTax ) AmountNoTax,\n" +
" SUM( PurchasePriceNoTax ) PurchasePriceNoTax,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_SparePart \n" +
" WHERE\n" +
" Version = '{0}' \n" +
" GROUP BY\n" +
" MaterialCode \n" +
" ) A\n" +
" LEFT JOIN Set_material B ON A.MaterialCode = B.CustomerPartCode \n" +
" ) 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 addSqlStr = string.Format(sqlString, version);
string addSqlStr = string.Format(sql, version);
//if (!string.IsNullOrEmpty(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(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();
}
@ -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>
///// 大众看板有条码报表

Loading…
Cancel
Save