Browse Source

更新版本

FoShanPG
Administrator 3 years ago
parent
commit
bcb4f6ff56
  1. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs
  2. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledMaterialReportRepository.cs
  3. 6
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs
  4. 56
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs

@ -46,7 +46,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "交货单号")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期")]
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
public override DateTime CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
@ -77,7 +77,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "结算数量")]
public decimal SettledQty { set; get; }
//结算日期
[ExporterHeader(DisplayName = "结算日期")]
[ExporterHeader(DisplayName = "结算日期", Format = "yyyy-MM-dd")]
public override DateTime CP7Time { set; get; }
//结算与发货差异
[ExporterHeader(DisplayName = "结算与发货差异")]

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledMaterialReportRepository.cs

@ -37,12 +37,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary>
/// CP5A日期
/// </summary>
[ExporterHeader(DisplayName = "CP5日期")]
[ExporterHeader(DisplayName = "CP5日期",Format = "yyyy-MM-dd")]
public virtual DateTime CP5A { set; get; }
/// <summary>
/// CP7
/// </summary>
[ExporterHeader(DisplayName = "CP7日期")]
[ExporterHeader(DisplayName = "CP7日期",Format = "yyyy-MM-dd")]
public virtual DateTime CP7 { set; get; }
/// <summary>
/// 零件号

6
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs

@ -16,9 +16,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
[ExporterHeader(DisplayName = "交货单号 ")]
[ExporterHeader(DisplayName = "交货单号")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期 ")]
[ExporterHeader(DisplayName = "实际发货日期",Format = "yyyy-MM-dd")]
public override DateTime CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
@ -68,7 +68,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//[ExporterHeader(DisplayName = "交货单号 ")]
//public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期 ")]
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
public DateTime CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public string KENNCode { set; get; }

56
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs

@ -244,8 +244,6 @@ namespace SettleAccount.Job.Services.Report
public List<UnSettleDetailReport> ExportList( List<CustomCondition> p_list)
{
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
@ -254,23 +252,53 @@ namespace SettleAccount.Job.Services.Report
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value;
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
//var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value;
//var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value;
var _list = _dapper1.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, string.Empty, version, materialCode, materialGroup, sapCode);
var _compareLs = _list.Where(p => p.DiffQty == 0).Select(p => new { p.ChassisNumber, p.KENNCode, p.ParentSapMaterialCode });
var _list = _dapper1.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, string.Empty, version, materialCode, materialGroup, sapCode);
var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
var _lst = _erpdapperRepository.GetSapList(_ls, version, false);
_lst.ForEach(p =>
{
p.Qty = 1;
p.DiffAMT = p.Qty * p.Price;
p.DiffQty = 1;
}
);
_list.AddRange(_lst);
var rangeList = _erpdapperRepository.GetSapList(_ls, version, false);
var query = from itm1 in rangeList
join itm2 in _compareLs on
new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals
new { itm2.ParentSapMaterialCode, itm2.KENNCode, itm2.ChassisNumber }
into temp1
from tm1 in temp1.DefaultIfEmpty()
select new UnSettleDetailReport
{
WmsBillNum = itm1.WmsBillNum,
CP5Time = itm1.CP5Time,
KENNCode = itm1.KENNCode,
ChassisNumber = itm1.ChassisNumber,
WmsState = itm1.WmsState,
SapMaterialCode = itm1.SapMaterialCode,
MaterialDesc = itm1.MaterialDesc,
MaterialCode = itm1.MaterialCode,
ParentSapMaterialCode = itm1.ParentSapMaterialCode,
ParentMaterialDesc = itm1.ParentMaterialDesc,
MaterialGroup = itm1.MaterialGroup,
Price = itm1.Price,
Amt = itm1.Amt,
Qty = 1,
UnSettleQty = tm1 != null ? 1 : 0,
DiffQty = tm1 != null ? 0 : -1,
DiffAMT = tm1 != null ? 0 : Math.Round(itm1.Qty * itm1.Price)
};
rangeList = query.ToList();
//_lst.ForEach(p =>
//{
// p.Qty = 1;
// p.DiffAMT = 0;
// p.DiffQty = 1;
//}
//);
_list.AddRange(rangeList);
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();

Loading…
Cancel
Save