Browse Source

大众看板报表

branch_ccpg_220107
44673626 3 years ago
parent
commit
ba7e029552
  1. 274
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs
  2. 16
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSKanBan/WMSVWKanBanDto.cs
  3. 15
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSSparePart/WMSSparePartDto.cs
  4. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWScrapClaims/ScrapClaimsAppService.cs
  5. 39
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  6. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  7. 114
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs
  8. 43
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs

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

@ -5155,7 +5155,7 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<DateTime>("CP5A")
.HasColumnType("datetime2");
b.Property<DateTime>("CP7")
b.Property<DateTime?>("CP7")
.HasColumnType("datetime2");
b.Property<string>("ChassisNumber")
@ -6252,14 +6252,14 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(50)");
b.Property<string>("Version")
.HasColumnType("nvarchar(max)");
.HasColumnType("nvarchar(450)");
b.Property<string>("Year")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Kanban", "MaterialCode")
b.HasIndex("Version", "Kanban", "MaterialCode")
.IsUnique()
.HasFilter("IsDeleted=0");
@ -6685,7 +6685,11 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasKey("Id");
b.ToTable("Set_SparePart");
b.HasIndex("Version", "PurchaseOrderNo", "MaterialCode")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WMSSparePart");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartVersion", b =>
@ -6768,7 +6772,224 @@ namespace Win.Sfs.SettleAccount.Migrations
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_SparePart_Version");
b.ToTable("Set_WMSSparePart_Version");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanSettle", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("Batch")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Extend")
.HasColumnType("nvarchar(max)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Factory")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Flag")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Kanban")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("MaterialCode")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<Guid>("ParentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("PartType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Period")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("Relation")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("SettleDate")
.HasColumnType("datetime2");
b.Property<DateTime>("SettleInputDate")
.HasColumnType("datetime2");
b.Property<string>("State")
.HasColumnType("nvarchar(max)");
b.Property<string>("SupplierCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Version")
.HasColumnType("nvarchar(450)");
b.Property<string>("WMSDeliverGoodsState")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSDeliveryNote")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSKanBanState")
.HasColumnType("nvarchar(max)");
b.Property<string>("Year")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("Version", "Kanban", "MaterialCode")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WMSKanBanSettle");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.WMS_KanBan.WMSKanBanVersion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CustomerCode")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Period")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("Year")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.HasKey("Id");
b.HasIndex("Version")
.IsUnique()
.HasFilter("IsDeleted=0");
b.ToTable("Set_WMSKanBanSettle_Version");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.EstimatedInventories.EstimatedInventoryDetail", b =>
@ -7108,6 +7329,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("AccountDate")
.HasColumnType("datetime2");
b.Property<DateTime>("BeginTime")
.HasColumnType("datetime2");
@ -7229,11 +7453,20 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<int>("State")
.HasColumnType("int");
b.Property<string>("UnSettleVersion")
.HasColumnType("nvarchar(max)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
b.Property<string>("WMSBillNum")
.HasColumnType("nvarchar(max)");
b.Property<string>("WMSState")
.HasColumnType("nvarchar(max)");
b.Property<string>("Year")
.HasMaxLength(36)
.HasColumnType("nvarchar(36)");
@ -8180,6 +8413,12 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<decimal>("CP7ScrapQty")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("ClaimQty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
@ -8202,6 +8441,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<decimal>("DiffPrice")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("DiffQty")
.HasColumnType("decimal(18,2)");
@ -8212,6 +8454,15 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("Factory")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("InvoiceAmt")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("InvoicePrice")
.HasColumnType("decimal(18,2)");
b.Property<decimal>("InvoiceQty")
.HasColumnType("decimal(18,2)");
@ -8233,12 +8484,21 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid>("ParentId")
.HasColumnType("uniqueidentifier");
b.Property<string>("MaterialDesc")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("SalePrice")
.HasColumnType("decimal(18,2)");
b.Property<string>("SapMaterialCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("SapMaterialGroup")
.HasColumnType("nvarchar(max)");
b.Property<decimal>("SettleQty")
.HasColumnType("decimal(18,2)");

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

@ -71,6 +71,22 @@ namespace Win.Sfs.SettleAccount.Entities.WMSKanBan
/// </summary>
public virtual DateTime SettleDate { get; set; }
/// <summary>
/// WMS交货单
/// </summary>
public string WMSDeliveryNote { set; get; }
/// <summary>
/// WMS发货状态
/// </summary>
public string WMSDeliverGoodsState { set; get; }
/// <summary>
/// 看板结算状态
/// </summary>
public string WMSKanBanState { set; get; }
/// <summary>
/// 结算状态
/// </summary>

15
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/WMSSparePart/WMSSparePartDto.cs

@ -118,5 +118,20 @@ namespace Win.Sfs.SettleAccount.Entities.WMSSparePart
/// 备注
/// </summary>
public string Extend { set; get; }
/// <summary>
/// WMS交货单
/// </summary>
public string WMSDeliveryNote { set; get; }
/// <summary>
/// WMS发货状态
/// </summary>
public string WMSDeliverGoodsState { set; get; }
/// <summary>
/// 看板结算状态
/// </summary>
public string WMSKanBanState { set; get; }
}
}

4
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWScrapClaims/ScrapClaimsAppService.cs

@ -159,9 +159,9 @@ namespace Win.Sfs.SettleAccount.Entities.VWScrapClaims
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
if (input.ParentId != Guid.Empty)
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);

39
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -76,7 +76,46 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
_service = service;
}
#region 派格结算报表
/// <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>
[HttpGet]
[Route("SettleKanBan-WithCode")]
[DisableRequestSizeLimit]
public async Task<string> SettledKanBanWithCode(string year, string period, string version, string customerCode, string factory, string matialCode,
string state, DateTime begin, DateTime end)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
var _taskid = await _service.ExportEnqueueAsync("未结算对比", ExportExtentsion.Excel, CurrentUser, typeof(UnSettledExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
#endregion

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

@ -351,7 +351,7 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.FactoryName).HasMaxLength(50);
b.Property(x => x.Extend).HasMaxLength(250);
//创建索引(没有版本一说)
b.HasIndex(x => new { x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
b.HasIndex(x => new { x.Version,x.PurchaseOrderNo, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
});
}
@ -399,7 +399,7 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.Batch).HasMaxLength(50);
b.Property(x => x.Flag).HasMaxLength(50);
//创建组合索引
b.HasIndex(x => new { x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
b.HasIndex(x => new { x.Version,x.Kanban, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter);
});
}

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

@ -0,0 +1,114 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class SettleKBWithCodeDapperReportRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public SettleKBWithCodeDapperReportRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{ }
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" +
"( select ErpMaterialCode, MaterialDesc, SUM(Price) as SumPrice from(\n" +
"select a.ErpMaterialCode, b.SettlementPartCode, a.MaterialDesc, (a.Qty * b.Price) as Price from\n" +
"(SELECT ErpMaterialCode, MaterialDesc, SettleMaterialCode, Qty, Version ,CustomerCode \n" +
"FROM [Set_MaterialRelationshipDetail] mdetail \n" +
" where mdetail.Version='{0}' and mdetail.CustomerCode='{1}' \n" +
") a \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 " +
" on r2.MaterialCode=r1.ErpMaterialCode and r2.Version='{0}'\n";
string _sql = string.Format(sqlString, version, customcode);
var _query = DbConnection.Query<SettleKBWithCode>(_sql, null, null, true, 1200, null);
return _query.ToList();
}
}
/// <summary>
/// 大众看板有条码报表
/// </summary>
//[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)]
public class SettleKBWithCode
{
[ExporterHeader(DisplayName = "交货单号")]
public string WMSDeliveryNote { set; get; }
[ExporterHeader(DisplayName = "实际发货日期")]
public string ActualGoodsDate { set; get; }
[ExporterHeader(DisplayName = "条码号")]
public string Kanban { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "客户物料")]
public string CustomerMaterial { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string Model { set; get; }
[ExporterHeader(DisplayName = "交货数量")]
public decimal WMSBillNum { set; get; }
[ExporterHeader(DisplayName = "定价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "金额")]
public decimal Amount { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal SettleNumber { set; get; }
[ExporterHeader(DisplayName = "结算日期")]
public DateTime SettleDate { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal SettleQty { set; get; }
[ExporterHeader(DisplayName = "结算与发货差异")]
public decimal SettleWMSDiffQty { set; get; }
[ExporterHeader(DisplayName = "结算与开票差异")]
public decimal SettleInvoiceDiffQty { set; get; }
[ExporterHeader(DisplayName = "开票差量")]
public decimal InvoiceDiffQty { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
public decimal InvoicePrice { set; get; }
[ExporterHeader(DisplayName = "开票金额")]
public decimal InvoiceMoney { set; get; }
[ExporterHeader(DisplayName = "单价差异")]
public decimal InvoiceDiffPrice { set; get; }
[ExporterHeader(DisplayName = "总金额差异")]
public decimal SumDiffMoney { set; get; }
[ExporterHeader(DisplayName = "出库单号")]
public decimal DeliveryOrderNo { set; get; }
}
}

43
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class SettleKBWithCodeExportService : ITransientDependency, IExportJob
{
private readonly SettleKBWithCodeDapperReportRepository _dapper;
private readonly OutputService _outputService;
public SettleKBWithCodeExportService(SettleKBWithCodeDapperReportRepository dapper, OutputService outputService)
{
_dapper = dapper;
_outputService = outputService;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value;
var state = p_list.Where(p => p.Name == "State").FirstOrDefault().Value;
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value;
var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value;
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _list = _dapper.GetSettleKBWithCodeReportList(state, version, year, customerCode, beginTime, endTime);
_outputService.Export<SettleKBWithCode>(id, string.Format("大众看板结算与交货核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _list);
return id.ToString();
}
}
}
Loading…
Cancel
Save