Browse Source

更新版本

branch_ccpg_220107
Administrator 3 years ago
parent
commit
d50e1d557d
  1. 15275
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211202.txt
  2. 6493
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211203.txt
  3. 119
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  4. 18
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  5. 39
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs
  6. 54
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs
  7. 5
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs
  8. 20
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleDoorPanelDapperRepository.cs
  9. 116
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs
  10. 142
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs
  11. 7
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs
  12. 1
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs
  13. 91
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs
  14. 139
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs
  15. 12
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs
  16. 20
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs
  17. 16
      src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

15275
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211202.txt

File diff suppressed because it is too large

6493
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211203.txt

File diff suppressed because it is too large

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

@ -88,16 +88,28 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[Route("SettleDoorPanel")]
[DisableRequestSizeLimit]
public async Task<string> SettleDoorPanel( string materialCode, string version, string customerCode, string sapCode, string estimateTypeDesc)
public async Task<string> SettleDoorPanel(
string version,
string materialCode,
string begin,
string end,
string cp7begin,
string cp7end,
string kenncode,
string chassisNumber
)
{
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 = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = estimateTypeDesc ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众准时化结算门板价格差异比对报表" });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = materialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(materialCode) ? string.Empty : materialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(begin) ? string.Empty : materialCode });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(end) ? string.Empty : materialCode });
customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(cp7begin) ? string.Empty : cp7begin });
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(cp7end) ? string.Empty : cp7end });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
var _taskid = await _service.ExportEnqueueAsync("大众准时化结算门板价格差异比对报表", ExportExtentsion.Excel, CurrentUser, typeof(SettleDoorPanelExportService), customConditionList, (rs) =>
{
@ -337,7 +349,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
}
/// <summary>
/// 大众发票与结算核对明细表
/// 2.大众发票与结算核对明细表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
@ -373,6 +385,44 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
return _taskid;
}
/// <summary>
/// 2.大众结算未发运核对明细表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("UnInvoiceSettledDetailDiff-Make")]
[DisableRequestSizeLimit]
public async Task<string> UnInvoiceSettledDetailDiffMake(
string version,
string materialCode,
string begin,
string end,
string cp7begin,
string cp7end,
string kenncode,
string chassisNumber
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(materialCode) ? string.Empty : materialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(begin) ? string.Empty : materialCode });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(end) ? string.Empty : materialCode });
customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(cp7begin) ? string.Empty : cp7begin });
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(cp7end) ? string.Empty : cp7end });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
var _taskid = await _service.ExportEnqueueAsync("大众结算未发运核对明细表", ExportExtentsion.Excel, CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
/// 3.大众准时化结算数量差异比对表
@ -396,6 +446,59 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
return _taskid;
}
/// <summary>
/// 7.大众准时化未结明细表(包含漏结,漏结要有标识)
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("UnsettledDetailReportService-Make")]
[DisableRequestSizeLimit]
public async Task<string> UnsettledDetailReportServiceMake(string version,string customerCode,string materialGroup, string materialCode, string begin, string end,string sapCode)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = !string.IsNullOrEmpty(version)?version:string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = !string.IsNullOrEmpty(customerCode)?version:string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(materialCode)?materialCode:string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = !string.IsNullOrEmpty(materialGroup)? materialGroup:string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value =!string.IsNullOrEmpty(sapCode)?sapCode:string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(materialCode)?materialCode:string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Begin", Value = !string.IsNullOrEmpty(begin)?string.Empty: begin });
customConditionList.Add(new CustomCondition() { Name = "End", Value = !string.IsNullOrEmpty(end)?string.Empty: end });
//var _first = exportName.FirstOrDefault();
//var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
//var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value;
//var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
//var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
//var sapcode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
//var begin = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value;
//var end = p_list.Where(p => p.Name == "End").FirstOrDefault().Value;
var _taskid = await _service.ExportEnqueueAsync("大众准时化未结明细表", ExportExtentsion.Excel, CurrentUser, typeof(UnsettledDetailReportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
///6.大众准时化未结差异比对表

18
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -2406,7 +2406,7 @@
<param name="repository">仓储接口</param>
<param name="cache">缓存</param>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.SettleDoorPanel(System.String,System.String,System.String,System.String,System.String)">
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.SettleDoorPanel(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
大众准时化结算门板价格差异比对报表
</summary>
@ -2497,7 +2497,14 @@
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.InvoiceSettledDetailDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
大众发票与结算核对明细表
2.大众发票与结算核对明细表
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnInvoiceSettledDetailDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
2.大众结算未发运核对明细表
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
@ -2509,6 +2516,13 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnsettledDetailReportServiceMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
7.大众准时化未结明细表(包含漏结,漏结要有标识)
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnSettleDiffExportServiceMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
6.大众准时化未结差异比对表

39
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs

@ -10,6 +10,45 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle
{
public class UnSettleDetailReport:ReportDetailBase
{
[ExporterHeader(DisplayName = "交货单号 ")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期 ")]
public override DateTime CP5Time { set; get; }
[ExporterHeader(DisplayName = "KENN号")]
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
public override string ChassisNumber { set; get; }
[ExporterHeader(DisplayName = "交货状态 ")]
public override string WmsState { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public override string SapMaterialCode { set; get; }
[ExporterHeader(DisplayName = "物料描述 ")]
public override string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "客户物料 ")]
public override string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "组件组物料 ")]
public override string ParentSapMaterialCode { set; get; }
[ExporterHeader(DisplayName = "组件组物料描述 ")]
public override string ParentMaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型) ")]
public override string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "定价 ")]
public override decimal Price { set; get; }
[ExporterHeader(DisplayName = "金额 ")]
public override decimal Amt { set; get; }
[ExporterHeader(DisplayName = "结算日期")]
public override DateTime CP7Time { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
public override decimal InvoicePrice { set; get; }
[ExporterHeader(DisplayName = "结算平台未结数量 ")]
public decimal Qty { set; get; }

54
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs

@ -20,6 +20,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public string KENNCode { set; get; }
public string ChassisNumber { set; get; }
public string ErpMaterialCode { set; get; }
}
public class InvoiceSettleDiff
{
@ -39,7 +40,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<T> GetSapList<T>(List<T> childList,string version, bool isNotHistoryPart = false) where T : ReportDetailBase, new()
public virtual List<T> GetSapList<T>(List<T> childList, string version, bool isNotHistoryPart = false) where T : ReportDetailBase, new()
{
List<Material> _materialList = new List<Material>();
List<ErpPrice> _priceList = new List<ErpPrice>();
@ -69,7 +70,47 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
if (isNotHistoryPart == true)
{
var _list = DbConnection.Query<SettleInfo>(string.Format("select distinct ChassisNumber, kenncode from Set_Settle where version < '{0}'", isNotHistoryPart)).ToList();
var str = "SELECT\n" +
" temp2.ErpMaterialCode,\n" +
" temp2.OrderBillNum KENNCode ,\n" +
" temp2.ChassisNumber\n" +
" FROM\n" +
" (\n" +
" SELECT DISTINCT\n" +
" ErpMaterialCode,\n" +
" b.OrderBillNum, \n" +
" " +
"b.KENNCode,\n" +
" b.ChassisNumber2, \n" +
" b.ChassisNumber \n" +
" FROM\n" +
" Set_fis b\n" +
" INNER JOIN set_settle a ON a.KENNCode = b.KENNCode \n" +
" AND a.ChassisNumber = b.ChassisNumber2 \n" +
" AND a.MaterialCode = b.ItemCode \n" +
" WHERE\n" +
" a.Version = '{0}' \n" +
" ) temp1\n" +
" INNER JOIN (\n" +
" SELECT DISTINCT\n" +
" ErpMaterialCode,\n" +
" d.OrderBillNum, \n" +
" d.KENNCode,\n" +
" d.ChassisNumber2 ,\n" +
" d.ChassisNumber \n" +
" FROM\n" +
" Set_fis d\n" +
" INNER JOIN set_settle c ON c.KENNCode = d.KENNCode \n" +
" AND c.ChassisNumber = d.ChassisNumber2 \n" +
" AND c.MaterialCode = d.ItemCode \n" +
" WHERE\n" +
" c.Version < '{0}' \n" +
" ) temp2 ON temp1.ChassisNumber2 = temp2.ChassisNumber2 \n" +
" AND temp1.ErpMaterialCode = temp2.ErpMaterialCode \n" +
" AND temp1.KENNCode = temp2.KENNCode";
var _list = DbConnection.Query<SettleInfo>(string.Format(str, version)).ToList();
@ -79,8 +120,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
join itm3 in _materialList on itm1.ParentSapMaterialCode equals itm3.MaterialCode into temp2
from tm2 in temp2.DefaultIfEmpty(new Material())
join itm4 in _list
on new { itm1.ChassisNumber, itm1.KENNCode } equals new { itm4.ChassisNumber, itm4.KENNCode } into temp3
from tm3 in temp3
on new { itm1.ChassisNumber, itm1.KENNCode, itm1.ParentSapMaterialCode } equals new { itm4.ChassisNumber, itm4.KENNCode, ParentSapMaterialCode = itm4.ErpMaterialCode } into temp3
from tm3 in temp3.DefaultIfEmpty()
where tm3 == null
select new T
{
@ -97,7 +138,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
Price = tm1.SapPrice,
Amt = tm1.SapPrice,
MaterialGroup = tm2.EstimateTypeDesc,
CP7Time=itm1.CP7Time,
CP7Time = itm1.CP7Time,
};
tmpList = query.ToList();
@ -126,7 +167,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
ParentMaterialDesc = itm1.ParentMaterialDesc,
Price = tm1.SapPrice,
Amt = tm1.SapPrice,
MaterialGroup = tm2.EstimateTypeDesc
MaterialGroup = tm2.EstimateTypeDesc,
CP7Time = itm1.CP7Time,
};
tmpList = query.ToList();

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

@ -142,10 +142,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" (\n" +
" SELECT\n" +
" b.YEAR,\n" +
" b.KENNCode,\n" +
" a.OrderBillNum Kenncode,\n" +
" b.MaterialCode,\n" +
" b.Model,\n" +
" b.ChassisNumber,\n" +
" a.ChassisNumber,\n" +
" a.Qty,\n" +
" a.BeginTime CP5Time,\n" +
" a.ChassisNumber2,\n" +
@ -193,3 +193,4 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
}

20
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleDoorPanelDapperRepository.cs

@ -78,7 +78,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public class SettleDoorPanelExport
{
[ExporterHeader(DisplayName = "物料组(车型)")]
public string EstimateTypeDesc { set; get; }
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public string SAPCode { set; get; }
@ -99,4 +99,22 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public decimal InvoiceDiffPrice { set; get; }
}
public class SettleDoorPanelSumExport
{
// 期间 物料组 价格差异总金额
[ExporterHeader(DisplayName = "期间")]
public string Version { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "价格差异总金额")]
public decimal InvoiceDiffPrice { set; get; }
}
}

116
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs

@ -0,0 +1,116 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
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;
using Win.Sfs.SettleAccount.Reports;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
/// <summary>
///3.大众准时化结算数量差异比对表
/// </summary>
public class UnInvoiceSettledDetailDiffDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public UnInvoiceSettledDetailDiffDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<InvoiceSettledDetailDiff> GetDetailDiffReportList(string version, string materialCode, string begin, string end ,string cp7begin,string cp7end,string kennCode,string chassisNumber)
{
List<InvoiceSettledDetailDiff> _list = new List<InvoiceSettledDetailDiff>();
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(materialCode))
{
condition += string.Format(" d.MaterialCode='{0}' ", materialCode);
}
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" a.BeginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" a.BeginTime<='{0}' ", end);
}
if (!string.IsNullOrEmpty(cp7begin))
{
condition += string.Format(" B.cp7Time>='{0}' ", cp7begin);
}
if (!string.IsNullOrEmpty(cp7end))
{
condition += string.Format(" B.cp7Time<='{0}' ", cp7end);
}
if (!string.IsNullOrEmpty(kennCode))
{
condition += string.Format(" B.kenncode='{0}' ", kennCode);
}
if (!string.IsNullOrEmpty(chassisNumber))
{
condition += string.Format(" B.chassisNumber='{0}' ", chassisNumber);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" TEMP2.Price,(\n" +
" Isnull( temp2.Price, 0 ) * isnull( temp1.SettledQty, 0 )) Amt \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.YEAR,\n" +
" a.Kenncode,\n" +
" a.MaterialCode,\n" +
" a.Model,\n" +
" a.ChassisNumber,\n" +
" isnull( b.Qty, 0 ) Qty,\n" +
" a.CP5A CP5Time,\n" +
" a.CP7 CP7Time,\n" +
" a.QTY SettledQty,\n" +
" '' ParentSapMaterialCode,\n" +
" '' WMSState,\n" +
" '' WMSBillNum,\n" +
" d.MaterialCode SapMaterialCode,\n" +
" d.MaterialDesc MaterialDesc,\n" +
" d.EstimateTypeDesc MaterialGroup,\n" +
" '' ParentMaterialDesc,\n" +
" c.InvoicePrice,\n" +
" ( c.InvoicePrice * a.qty ) InvoiceAmt,\n" +
" ( c.InvoicePrice * a.Qty ) SettleAmt,\n" +
" a.Qty - IsNull( B.Qty, 0 ) DiffSettleFisQty,\n" +
" 0 DiffSettleInvQty,\n" +
" a.Qty InvoiceQty \n" +
" FROM\n" +
" ( SELECT * FROM set_settle WHERE version = '202110' ) a\n" +
" LEFT JOIN Set_fis b ON a.ChassisNumber = b.ChassisNumber2 \n" +
" AND a.KENNCode = b.KENNCode \n" +
" AND a.MaterialCode = b.ItemCode\n" +
" LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '202110' GROUP BY materialcode ) c ON a.MaterialCode = c.MaterialCode\n" +
" LEFT JOIN set_material d ON a.MaterialCode = d.CustomerPartCode \n" +
" WHERE\n" +
" b.Qty IS NULL \n" +
" ) temp1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) AND type = 10 ) TEMP2 ON TEMP1.SapMaterialCode = TEMP2.MaterialCode";
var _sql = string.Format(str, version,condition);
var _query = DbConnection.Query<InvoiceSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list=_query.ToList();
return _list;
}
}
}

142
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs

@ -54,60 +54,66 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
// str += string.Format(" and SapCode='{0}' ", materialGroup);
//}
var sqlString =
"SELECT\n" +
" A.*,\n" +
" C.Price,\n" +
" ISNULL( A.QTY, 0 )* ISNULL( C.Price, 0 ) AMT,\n" +
" B.EstimateTypeDesc MaterialGroup,\n" +
" B.MaterialDesc MaterialDesc,\n" +
" d.MaterialDesc ParentMaterialDesc \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" WMSState,\n" +
" WMSBillNum,\n" +
" UnSettleVersion,\n" +
" BeginTime CP5Time,\n" +
" ItemCode MaterialCode,\n" +
" ChassisNumber,\n" +
" KENNCode,\n" +
" QTY,\n" +
" ErpMaterialCode ParentSapMaterialCode,\n" +
" '' FLAG \n" +
" FROM\n" +
" Set_fis {0} \n" +
" WHERE\n" +
" 1 = 1 \n" +
" AND STATE = 0 UNION ALL\n" +
" SELECT\n" +
" WMSState,\n" +
" UnSettleVersion,\n" +
" WMSBillNum,\n" +
" BeginTime CP5Time,\n" +
" ItemCode MaterialCode,\n" +
" ChassisNumber,\n" +
" KENNCode,\n" +
" QTY,\n" +
" ErpMaterialCode ParentSapMaterialCode,\n" +
" 'L' FLAG \n" +
" FROM\n" +
" Set_fis {0} \n" +
" WHERE\n" +
" 1 = 1 \n" +
" AND STATE = 4 \n" +
" ) A\n" +
" LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) C ON a.MaterialCode = c.MaterialCode\n" +
" LEFT JOIN Set_material d ON a.ParentSapMaterialCode = d.MaterialCode";
var _materialList = DbConnection.Query<Material>("select * from set_material").ToList();
var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();
"SELECT\n" +
" temp1.*,\n" +
" temp2.Price,\n" +
" ISNULL( temp1.QTY, 0 )* ISNULL( temp2.Price, 0 ) AMT \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.*,\n" +
" B.EstimateTypeDesc MaterialGroup,\n" +
" B.MaterialDesc MaterialDesc,\n" +
" d.MaterialDesc ParentMaterialDesc,\n" +
" B.MaterialCode SapMaterialCode \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" WMSState,\n" +
" WMSBillNum,\n" +
" UnSettleVersion,\n" +
" BeginTime CP5Time,\n" +
" ItemCode MaterialCode,\n" +
" ChassisNumber,\n" +
" OrderBillNum KENNCode,,\n" +
" QTY,\n" +
" ErpMaterialCode ParentSapMaterialCode,\n" +
" '' FLAG \n" +
" FROM\n" +
" Set_fis {0}\n" +
" WHERE\n" +
" 1 = 1 \n" +
" AND STATE = 0 UNION ALL\n" +
" SELECT\n" +
" WMSState,\n" +
" UnSettleVersion,\n" +
" WMSBillNum,\n" +
" BeginTime CP5Time,\n" +
" ItemCode MaterialCode,\n" +
" ChassisNumber,\n" +
" OrderBillNum KENNCode,\n" +
" QTY,\n" +
" ErpMaterialCode ParentSapMaterialCode,\n" +
" 'L' FLAG \n" +
" FROM\n" +
" Set_fis {0}\n" +
" WHERE\n" +
" 1 = 1 \n" +
" AND STATE = 4 \n" +
" ) A\n" +
" LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode\n" +
" LEFT JOIN Set_material d ON a.ParentSapMaterialCode = d.MaterialCode \n" +
" ) temp1\n" +
" LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode";
//var _materialList = DbConnection.Query<Material>("select * from set_material").ToList();
//var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();
@ -117,37 +123,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var _list = _query.ToList();
var _ls = _list.Where(p=>p.Flag!="L").GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
foreach (var itm in _ls)
{
var parentMaterial = new UnSettleDetailReport();
parentMaterial.WmsBillNum = itm.WmsBillNum;
parentMaterial.CP5Time = itm.CP5Time;
parentMaterial.KENNCode = itm.KENNCode;
parentMaterial.ChassisNumber = itm.ChassisNumber;
parentMaterial.WmsState = itm.WmsState;
parentMaterial.SapMaterialCode = itm.ParentSapMaterialCode;
parentMaterial.MaterialDesc = itm.ParentMaterialDesc;
parentMaterial.MaterialCode = itm.ParentSapMaterialCode;
parentMaterial.ParentSapMaterialCode = itm.ParentSapMaterialCode;
parentMaterial.ParentMaterialDesc = itm.ParentMaterialDesc;
var _price=_priceList.Where(p => p.MaterialCode == itm.ParentSapMaterialCode).FirstOrDefault();
if (_price != null)
{
parentMaterial.Price = _price.Price;
parentMaterial.Amt = _price.Price;
}
var _material=_materialList.Where(p => p.MaterialCode == itm.ParentSapMaterialCode).FirstOrDefault();
if (_material != null)
{
parentMaterial.MaterialGroup = _material.EstimateTypeDesc;
}
_list.Add(parentMaterial);
}
return _list;
}

7
src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs

@ -71,13 +71,6 @@ namespace SettleAccount.Job.Services
public void Export<T>(Guid Id, string fileName,Dictionary<string,List<T>> p_dic) where T : class, new()
{
//string methodName = (isDesc) ? "OrderByDescendingInternal" : "OrderByInternal";
//var memberProp = typeof(T).GetProperty(propertyName);
//var method = typeof(QueryableExtension).GetMethod(methodName)?.MakeGenericMethod(typeof(T), memberProp?.PropertyType);
//var result = method?.Invoke(null, new object[] { query, memberProp });
//return (IOrderedQueryable<T>)result;
foreach (var itm in p_dic)

1
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs

@ -90,6 +90,7 @@ namespace SettleAccount.Job.Services
foreach (var itm in _ls)
{
itm.InvocieAmt = itm.InvoiceQty * itm.InvoicePrice;
itm.DiffPrice = itm.Price - itm.InvoicePrice;
}
_ls.AddRange(rangeList);

91
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs

@ -1,41 +1,110 @@
using System;
using Magicodes.ExporterAndImporter.Excel;
using Shouldly;
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.BlobStoring;
using Volo.Abp.DependencyInjection;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class SettleDoorPanelExportService : ITransientDependency, IExportJob
{
private readonly SettleDoorPanelDapperRepository _dapper;
private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public SettleDoorPanelExportService(SettleDoorPanelDapperRepository dapper, OutputService outputService)
public SettleDoorPanelExportService(
IBlobContainer<MyFileContainer> fileContainer,
ErpPartDapperRepository erpdapperRepository,
InvoiceSettledDetailDiffDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_dapper = dapper;
_fileContainer = fileContainer;
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
//public virtual List<SettleDoorPanelExport> GetSettleDoorPanelReportList(string purchaseOrderNo, string version, string sapCode, string matialCode)
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var estimateTypeDesc = p_list.Where(p => p.Name == "EstimateTypeDesc").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SAPCode").FirstOrDefault().Value;
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var customerPartCode = p_list.Where(p => p.Name == "CustomerPartCode").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var cp7begin = p_list.Where(p => p.Name == "Cp7BeginTime").FirstOrDefault().Value;
var cp7end = p_list.Where(p => p.Name == "Cp7EndTime").FirstOrDefault().Value;
var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value;
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber);
var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }).Select(p => p.FirstOrDefault()).ToList();
var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list, version,true);
var erpPriceList = _erpdapperRepository.GetErpPartCodePriceList(version);
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
rangeList.ForEach(p => {
p.Qty = 1;
p.InvoiceQty = 1;
p.SettledQty = 1;
p.DiffSettleFisQty = 0;
p.DiffSettleInvQty = 0;
var _first = erpPriceList.FirstOrDefault(itm => itm.SapErpPartCode == p.SapMaterialCode);
if (_first != null)
{
p.InvoicePrice = _first.SapPrice;
p.Amt = p.Price * 1;
p.InvocieAmt = p.InvoicePrice * 1;
p.SettleAmt = p.SettledQty * p.Price;
}
p.DiffPrice = p.InvoicePrice - p.Price;
});
foreach (var itm in diffList)
{
var _first = _ls.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode);
_first.InvoiceQty = _first.SettledQty + itm.DiffQty;
_first.DiffSettleInvQty = itm.DiffQty;
}
foreach (var itm in _ls)
{
itm.InvocieAmt = itm.InvoiceQty * itm.InvoicePrice;
}
_ls.AddRange(rangeList);
_ls = _ls.Where(p=>p.DiffPrice!=0).OrderBy(p => p.SapMaterialCode).ToList();
var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value;
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var report1List = _ls.GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode })
.Select(t => new SettleDoorPanelExport{ MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode });
var _list = _dapper.GetSettleDoorPanelReportList(estimateTypeDesc, version, sapCode, customerPartCode);
var report2List = _ls.GroupBy(p => new {p.MaterialGroup }).Select(p=>new SettleDoorPanelSumExport { MaterialGroup= p.Key.MaterialGroup, InvoiceDiffPrice=p.Sum(itm=>itm.DiffPrice)*p.Sum(itm=>itm.Qty), Version="" });
ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(report1List.ToList(), "按物料价格差异明细表")
.SeparateBySheet()
.Append(report2List.ToList(), "差异汇总验证表")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(string.Format("大众准时化结算门板价格差异比对报表_{0}.xlsx", Guid.NewGuid().ToString()), result.Result, true);
_outputService.Export<SettleDoorPanelExport>(id, string.Format("大众准时化结算门板价格差异比对报表_{0}.xlsx", Guid.NewGuid().ToString()), _list);
// _outputService.Export<SettleDoorPanelExport>(id, string.Format("大众准时化结算门板价格差异比对报表_{0}.xlsx", Guid.NewGuid().ToString()), _list);
return id.ToString();
}

139
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs

@ -0,0 +1,139 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Shouldly;
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.BlobStoring;
using Volo.Abp.DependencyInjection;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
using Win.Sfs.SettleAccount.Repository.SettleAccount;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services
{
//物料组车型 SAP编码 零件号 结算数量 M100数量 差异总数 开票单价 差异金额
public class UnInvoiceSettledDetailSum
{
[ExporterHeader(DisplayName = "物料组车型")]
public string MaterialGroup { set; get;}
[ExporterHeader(DisplayName = "SAP编码")]
public string SapMaterailCode { set; get; }
[ExporterHeader(DisplayName = "零件号")]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal SettleQty { set; get; }
[ExporterHeader(DisplayName = "M100数量")]
public decimal FisQty { set; get; }
[ExporterHeader(DisplayName = "差异总数")]
public decimal DiffQty { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "差异金额")]
public decimal DiffAmt { set; get; }
}
/// <summary>
///3.大众准时化结算数量差异比对表
/// </summary>
public class UnInvoiceSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly UnInvoiceSettledDetailDiffDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public UnInvoiceSettledDetailDiffExportService(
IBlobContainer<MyFileContainer> fileContainer,
ErpPartDapperRepository erpdapperRepository,
UnInvoiceSettledDetailDiffDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_fileContainer = fileContainer;
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository= erpdapperRepository;
//_repository = repository;
//_versionRepository = versionRepository;
_dapperRepository =dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, 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;
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var cp7begin = p_list.Where(p => p.Name == "Cp7BeginTime").FirstOrDefault().Value;
var cp7end = p_list.Where(p => p.Name == "Cp7EndTime").FirstOrDefault().Value;
var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value;
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value;
var _ls = _dapperRepository.GetDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber);
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
foreach (var itm in _ls)
{
itm.InvocieAmt = itm.InvoiceQty * itm.InvoicePrice;
itm.DiffPrice = itm.Price - itm.InvoicePrice;
}
_ls=_ls.OrderBy(p => p.ChassisNumber).ThenBy(p=>p.KENNCode).ThenBy(p=>p.SapMaterialCode).ToList();
var _lsSum=_ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup }).Select(p => new UnInvoiceSettledDetailSum
{
MaterialCode = p.Key.MaterialCode,
SapMaterailCode = p.Key.SapMaterialCode,
MaterialGroup = p.Key.MaterialGroup,
SettleQty = p.Sum(itm => itm.SettledQty),
FisQty=0,
DiffQty=- p.Sum(itm => itm.SettledQty),
Price=p.Sum(itm=>itm.InvoicePrice),
DiffAmt= p.Sum(itm => itm.SettledQty)* p.Sum(itm => itm.InvoicePrice)
}).ToList();
var _sumTotal= new UnInvoiceSettledDetailSum() {
SettleQty = _lsSum.Sum(p => p.SettleQty),
DiffQty = _lsSum.Sum(p => p.DiffQty),
Price = _lsSum.Sum(p => p.Price),
DiffAmt=_lsSum.Sum(p=>p.DiffAmt)
};
_lsSum.Add(_sumTotal);
ExcelExporter _exporter = new ExcelExporter();//导出Excel
//if (_ls.Count > 500000)
//{
//}
//if (_ls.Count > 1000000)
//{
//}
//if (_ls.Count > 1500000)
//{
//}
var result = _exporter.Append(_ls, "差异明细表")
.SeparateBySheet()
.Append(_lsSum, "数量差异汇总表")
.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(string.Format("大众准时化结算数量差异比对表_{0}.xlsx", Guid.NewGuid().ToString()), result.Result, true);
//_outputService.Export<InvoiceSettledDetailDiff>(id, string.Format("大众结算未发运核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls);
return id.ToString();
}
}
}

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

@ -27,7 +27,6 @@ namespace SettleAccount.Job.Services.Report
var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
var beginTime = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
@ -35,10 +34,6 @@ namespace SettleAccount.Job.Services.Report
var _ls = new List<UnSettleDiff>();
_ls = _dapper.GetDiffReport(int.Parse(type),year,beginTime,endTime, materialCode,sapCode);
var _id = Guid.NewGuid();
List<UnSettleDiff> _lsExport = new List<UnSettleDiff>();
//foreach (var itm in _ls)
//{
@ -58,14 +53,7 @@ namespace SettleAccount.Job.Services.Report
// //State = itm.State,
// Qty = itm.Qty,
// Version = itm.Version,
// };
// _lsExport.Add(dto);
//}
_outputService.Export<UnSettleDiff>(id, _first, _ls);

20
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs

@ -18,10 +18,17 @@ namespace SettleAccount.Job.Services.Report
private readonly UnSettledDetailDapperRepository _dapper;
private readonly OutputService _outputService;
public UnsettledDetailReportService(UnSettledDetailDapperRepository dapper, OutputService outputService)
private readonly ErpPartDapperRepository _erpDapper;
public UnsettledDetailReportService(
UnSettledDetailDapperRepository dapper,
OutputService outputService,
ErpPartDapperRepository erpDapper
)
{
_dapper = dapper;
_outputService = outputService;
_erpDapper = erpDapper;
}
@ -37,8 +44,17 @@ namespace SettleAccount.Job.Services.Report
var end = p_list.Where(p => p.Name == "End").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 = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version,materailCode,materialGroup,sapcode);
var _ls = _list.Where(p => p.Flag != "L" ).Where(p=>p.MaterialCode!=p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
var _lst= _erpDapper.GetSapList(_ls, version, false);
_lst.ForEach(p =>
{
p.Qty = 1;
}
);
_list.AddRange(_lst);
_list= _list.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ThenBy(p => p.Flag).ToList();
_outputService.Export<UnSettleDetailReport>(id, _first, _list);
return id.ToString();

16
src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

@ -123,13 +123,25 @@ namespace Win.Sfs.SettleAccount
{
return implementationFactory.GetService<InvoiceSettledDetailDiffExportService>();
}
if (key.Equals(typeof(UnSettleDiffExportService).FullName))
if (key.Equals(typeof(UnInvoiceSettledDetailDiffExportService).FullName))
{
return implementationFactory.GetService<UnSettleDiffExportService>();
return implementationFactory.GetService<UnInvoiceSettledDetailDiffExportService>();
}
if (key.Equals(typeof(UnSettleDiffExportService).FullName))
{
return implementationFactory.GetService<UnSettleDiffExportService>();
}
if (key.Equals(typeof(SettleDoorPanelExportService).FullName))
{
return implementationFactory.GetService<SettleDoorPanelExportService>();
}
if (key.Equals(typeof(UnsettledDetailReportService).FullName))
{
return implementationFactory.GetService<UnsettledDetailReportService>();
}
else
{

Loading…
Cancel
Save