Browse Source

更新版本

FoShanPG
Administrator 3 years ago
parent
commit
be3761bbc9
  1. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
  2. 4
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs
  3. 106
      src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs
  4. 3
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs
  5. 350
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs
  6. 1
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs
  7. 1
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs
  8. 1
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs
  9. 7
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs

3
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs

@ -276,6 +276,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
[Route("ExcelImport-PG")]
[DisableRequestSizeLimit]
[Authorize(SettleAccountPermissions.SettleAccounts.Create)]
[UnitOfWork(false)]
public async Task<string> SettleAccountUploadExcelImportTH([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
{
@ -302,6 +303,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
});
return _taskid;
}
/// <summary>

4
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
namespace Win.Sfs.SettleAccount.Entities
{
@ -13,6 +14,9 @@ namespace Win.Sfs.SettleAccount.Entities
{
public static List<Material> CacheMaterials { set; get; }
public static List<ErpPrice> CachePriceList { set; get; }
public static List<InvoiceSettledDetailDiff> CacheInvoiceSettledDetailDiff { set; get; }
}
public interface ISettleAccountEntityBase

106
src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs

@ -1,4 +1,5 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
@ -8,6 +9,111 @@ using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs
{
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class InvoiceSettledDetailDiff
: ReportDetailBase
{
//public InvoiceSettledDetailDiff(string wmsBillNum, DateTime cP5Time, string kENNCode, string chassisNumber, string wmsState, string sapMaterialCode, string materialDesc, string materialCode, string parentSapMaterialCode, string parentMaterialDesc, string materialGroup, decimal price, decimal amt, decimal qty, decimal settledQty, DateTime cP7Time, decimal diffSettleFisQty, decimal diffSettleInvQty, decimal invoiceQty, decimal invoicePrice, decimal invocieAmt, decimal settleAmt, decimal diffPrice)
//{
// WmsBillNum = wmsBillNum;
// CP5Time = cP5Time;
// KENNCode = kENNCode;
// ChassisNumber = chassisNumber;
// WmsState = wmsState;
// SapMaterialCode = sapMaterialCode;
// MaterialDesc = materialDesc;
// MaterialCode = materialCode;
// ParentSapMaterialCode = parentSapMaterialCode;
// ParentMaterialDesc = parentMaterialDesc;
// MaterialGroup = materialGroup;
// Price = price;
// Amt = amt;
// Qty = qty;
// SettledQty = settledQty;
// CP7Time = cP7Time;
// DiffSettleFisQty = diffSettleFisQty;
// DiffSettleInvQty = diffSettleInvQty;
// InvoiceQty = invoiceQty;
// InvoicePrice = invoicePrice;
// InvocieAmt = invocieAmt;
// SettleAmt = settleAmt;
// DiffPrice = diffPrice;
//}
[ExporterHeader(DisplayName = "交货单号")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
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 = "M100数量")]
public decimal Qty { set; get; }
//结算数量
[ExporterHeader(DisplayName = "结算数量")]
public decimal SettledQty { set; get; }
//结算日期
[ExporterHeader(DisplayName = "结算日期", Format = "yyyy-MM-dd")]
public override DateTime CP7Time { set; get; }
//结算与发货差异
[ExporterHeader(DisplayName = "结算与发货差异")]
public decimal DiffSettleFisQty { set; get; }
//结算与开票差异
[ExporterHeader(DisplayName = "结算与开票差异")]
public decimal DiffSettleInvQty { set; get; }
//开票数量
[ExporterHeader(DisplayName = "开票数量")]
public decimal InvoiceQty { set; get; }
//开票单价
[ExporterHeader(DisplayName = "开票单价")]
public override decimal InvoicePrice { set; get; }
//开票金额
[ExporterHeader(DisplayName = "开票金额")]
public decimal InvoiceAmt { set; get; }
//结算金额
[ExporterHeader(DisplayName = "结算金额")]
public decimal SettleAmt { set; get; }
//单价差异
[ExporterHeader(DisplayName = "单价差异")]
public decimal DiffPrice { set; get; }
[ExporterHeader(DisplayName = "结算实际数量", IsIgnore = true)]
public decimal SettleReadyQty { set; get; }
[ExporterHeader(DisplayName = "版本", IsIgnore = true)]
public string Version { set; get; }
//总金额差异
//[ExporterHeader(DisplayName = "总金额差异")]
//public decimal AmtDiffPrice { set; get; }
}
public class InvoiceSettledDiff: FullAuditedAggregateRootBase<Guid>
{
public InvoiceSettledDiff()

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

@ -47,6 +47,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
if (CacheManager.CacheMaterials != null)
{
_materialList = CacheManager.CacheMaterials;
_materialList= CacheManager.CacheMaterials.GroupBy(p => new { p.MaterialCode }).Select(p => p.FirstOrDefault()).ToList();
}
else
{
@ -55,6 +56,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
if (CacheManager.CachePriceList != null)
{
_priceList = CacheManager.CachePriceList;
_priceList = CacheManager.CachePriceList.GroupBy(p => new { p.SapErpPartCode }).Select(p => p.FirstOrDefault()).ToList();
}
else
{

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

@ -9,109 +9,13 @@ using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
[ExcelExporter(MaxRowNumberOnASheet = 900000)]
public class InvoiceSettledDetailDiff
: ReportDetailBase
{
//public InvoiceSettledDetailDiff(string wmsBillNum, DateTime cP5Time, string kENNCode, string chassisNumber, string wmsState, string sapMaterialCode, string materialDesc, string materialCode, string parentSapMaterialCode, string parentMaterialDesc, string materialGroup, decimal price, decimal amt, decimal qty, decimal settledQty, DateTime cP7Time, decimal diffSettleFisQty, decimal diffSettleInvQty, decimal invoiceQty, decimal invoicePrice, decimal invocieAmt, decimal settleAmt, decimal diffPrice)
//{
// WmsBillNum = wmsBillNum;
// CP5Time = cP5Time;
// KENNCode = kENNCode;
// ChassisNumber = chassisNumber;
// WmsState = wmsState;
// SapMaterialCode = sapMaterialCode;
// MaterialDesc = materialDesc;
// MaterialCode = materialCode;
// ParentSapMaterialCode = parentSapMaterialCode;
// ParentMaterialDesc = parentMaterialDesc;
// MaterialGroup = materialGroup;
// Price = price;
// Amt = amt;
// Qty = qty;
// SettledQty = settledQty;
// CP7Time = cP7Time;
// DiffSettleFisQty = diffSettleFisQty;
// DiffSettleInvQty = diffSettleInvQty;
// InvoiceQty = invoiceQty;
// InvoicePrice = invoicePrice;
// InvocieAmt = invocieAmt;
// SettleAmt = settleAmt;
// DiffPrice = diffPrice;
//}
[ExporterHeader(DisplayName = "交货单号")]
public override string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")]
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 = "M100数量")]
public decimal Qty { set; get; }
//结算数量
[ExporterHeader(DisplayName = "结算数量")]
public decimal SettledQty { set; get; }
//结算日期
[ExporterHeader(DisplayName = "结算日期", Format = "yyyy-MM-dd")]
public override DateTime CP7Time { set; get; }
//结算与发货差异
[ExporterHeader(DisplayName = "结算与发货差异")]
public decimal DiffSettleFisQty{ set; get; }
//结算与开票差异
[ExporterHeader(DisplayName = "结算与开票差异")]
public decimal DiffSettleInvQty { set; get; }
//开票数量
[ExporterHeader(DisplayName = "开票数量")]
public decimal InvoiceQty { set; get; }
//开票单价
[ExporterHeader(DisplayName = "开票单价")]
public override decimal InvoicePrice { set; get; }
//开票金额
[ExporterHeader(DisplayName = "开票金额")]
public decimal InvoiceAmt { set; get; }
//结算金额
[ExporterHeader(DisplayName = "结算金额")]
public decimal SettleAmt { set; get; }
//单价差异
[ExporterHeader(DisplayName = "单价差异")]
public decimal DiffPrice { set; get; }
[ExporterHeader(DisplayName = "结算实际数量",IsIgnore =true)]
public decimal SettleReadyQty { set; get; }
//总金额差异
//[ExporterHeader(DisplayName = "总金额差异")]
//public decimal AmtDiffPrice { set; get; }
}
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
@ -123,163 +27,117 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<InvoiceSettledDetailDiff> GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end ,string cp7begin,string cp7end,string kennCode,string chassisNumber,string materialGroup)
{
List<InvoiceSettledDetailDiff> _list = new List<InvoiceSettledDetailDiff>();
string condition = " where 1=1 ";
//if (!string.IsNullOrEmpty(materialCode))
//{
// condition += string.Format(" and d.MaterialCode in ({0}) ", materialCode);
//}
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.BeginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.BeginTime<='{0}' ", end);
}
if (!string.IsNullOrEmpty(cp7begin))
if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Count(p => p.Version == version)>0)
{
condition += string.Format(" and B.cp7>='{0}' ", cp7begin);
_list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p=>p.Version==version).ToList();
_list= _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
}
if (!string.IsNullOrEmpty(cp7end))
else
{
condition += string.Format(" and B.cp7<='{0}' ", cp7end);
}
//if (!string.IsNullOrEmpty(kennCode))
//{
// condition += string.Format(" and B.kenncode='{0}' ", kennCode);
//}
//if (!string.IsNullOrEmpty(chassisNumber))
//{
// condition += string.Format(" and B.chassisNumber='{0}' ", chassisNumber);
//}
//if (!string.IsNullOrEmpty(materialGroup))
//{
// condition += string.Format(" B.chassisNumber='{0}' ", materialGroup);
//}
// string str= "SELECT\n" +
//" temp1.*,\n" +
//" TEMP2.Price,(\n" +
//" Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" b.YEAR,\n" +
//" isnull( a.OrderBillNum, b.Kenncode ) kennocode,\n" +
//" b.MaterialCode,\n" +
//" b.Model,\n" +
//" isnull( a.ChassisNumber, b.ChassisNumber ) ChassisNumber,\n" +
//" isnull( a.Qty, 0 ) Qty,\n" +
//" isnull( a.BeginTime, b.CP5A ) CP5Time,\n" +
//" a.ChassisNumber2,\n" +
//" B.CP7 CP7Time,\n" +
//" isnull( a.QTY, b.Qty ) SettledQty,\n" +
//" a.ErpMaterialCode ParentSapMaterialCode,\n" +
//" isnull( a.WMSState, '' ) WMSState,\n" +
//" isnull( a.WMSBillNum, '' ) WMSBillNum,\n" +
//" d.MaterialCode SapMaterialCode,\n" +
//" d.MaterialDesc MaterialDesc,\n" +
//" d.EstimateTypeDesc MaterialGroup,\n" +
//" e.MaterialDesc ParentMaterialDesc,\n" +
//" c.InvoicePrice,\n" +
//" Round( c.InvoicePrice * isnull( a.QTY, b.Qty ), 2 ) InvoiceAmt,\n" +
//" Round( c.InvoicePrice * isnull( a.QTY, b.Qty ), 2 ) SettleAmt,\n" +
//" isnull( a.Qty, 0 ) - IsNull( B.Qty, 0 ) DiffSettleFisQty,\n" +
//" 0 DiffSettleInvQty,\n" +
//" isnull( a.QTY, b.Qty ) InvoiceQty \n" +
//" FROM\n" +
//" ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" +
//" LEFT JOIN Set_fis a ON b.ChassisNumber = a.ChassisNumber2 \n" +
//" AND b.KENNCode = a.KENNCode \n" +
//" AND b.MaterialCode = a.ItemCode\n" +
//" LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON b.MaterialCode = c.MaterialCode\n" +
//" LEFT JOIN set_material d ON b.MaterialCode = d.CustomerPartCode\n" +
//" LEFT JOIN set_material e ON a.ErpMaterialCode = e.MaterialCode \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"
string isExistSql = string.Format("SELECT count(1) lincount FROM [Set_Settle1] WITH(SNAPSHOT) where Version = '{0}'", version);
int _count = DbConnection.ExecuteScalar<int>(isExistSql);
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.BeginTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.BeginTime<='{0}' ", end);
}
if (!string.IsNullOrEmpty(cp7begin))
{
condition += string.Format(" and B.cp7>='{0}' ", cp7begin);
}
if (!string.IsNullOrEmpty(cp7end))
{
condition += string.Format(" and B.cp7<='{0}' ", cp7end);
}
string tablestr = (_count == 0) ?
" ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" :
" (SELECT count(1) lincount FROM [Set_Settle1] WITH(SNAPSHOT) where Version = '{0}') b \n";
string str =
"SELECT\n" +
string.Format(" '{0}' version ,\n",version)+
" temp1.*,\n" +
" TEMP2.Price,(\n" +
" Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.YEAR,\n" +
" a.OrderBillNum Kenncode,\n" +
" b.MaterialCode,\n" +
" b.Model,\n" +
" a.ChassisNumber,\n" +
" a.Qty,\n" +
" a.BeginTime CP5Time,\n" +
" a.ChassisNumber2,\n" +
" B.CP7 CP7Time,\n" +
" a.QTY SettledQty,\n" +
" a.ErpMaterialCode ParentSapMaterialCode,\n" +
" a.WMSState,\n" +
" a.WMSBillNum,\n" +
" d.MaterialCode SapMaterialCode,\n" +
" d.MaterialDesc MaterialDesc,\n" +
" d.EstimateTypeDesc MaterialGroup,\n" +
" e.MaterialDesc ParentMaterialDesc,\n" +
" c.InvoicePrice,\n" +
" Round( c.InvoicePrice * a.qty,2 ) InvoiceAmt,\n" +
" Round( c.InvoicePrice * a.Qty,2 ) SettleAmt,\n" +
" 0 DiffSettleFisQty,\n" +
" 0 DiffSettleInvQty, \n" +
" a.Qty InvoiceQty ,\n" +
" IsNull( B.Qty, 0 ) SettleReadyQty \n" +
" FROM\n" +
tablestr +
" INNER JOIN Set_fis a ON b.ChassisNumber = a.ChassisNumber2 \n" +
" AND b.KENNCode = a.KENNCode \n" +
" AND b.MaterialCode = a.ItemCode\n" +
" LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON a.ItemCode = c.MaterialCode\n" +
" LEFT JOIN set_material d ON a.ItemCode = d.CustomerPartCode\n" +
" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) e ON a.ErpMaterialCode = e.MaterialCode {1} \n" +
" ) TEMP1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" 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();
if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Count(p => p.Version == version) > 0)
{
_list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p => p.Version == version).ToList();
_list = _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
}
else
{
CacheManager.CacheInvoiceSettledDetailDiff.AddRange(_list);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" TEMP2.Price,(\n" +
" Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.YEAR,\n" +
" a.OrderBillNum Kenncode,\n" +
" b.MaterialCode,\n" +
" b.Model,\n" +
" a.ChassisNumber,\n" +
" a.Qty,\n" +
" a.BeginTime CP5Time,\n" +
" a.ChassisNumber2,\n" +
" B.CP7 CP7Time,\n" +
" a.QTY SettledQty,\n" +
" a.ErpMaterialCode ParentSapMaterialCode,\n" +
" a.WMSState,\n" +
" a.WMSBillNum,\n" +
" d.MaterialCode SapMaterialCode,\n" +
" d.MaterialDesc MaterialDesc,\n" +
" d.EstimateTypeDesc MaterialGroup,\n" +
" e.MaterialDesc ParentMaterialDesc,\n" +
" c.InvoicePrice,\n" +
" Round( c.InvoicePrice * a.qty,2 ) InvoiceAmt,\n" +
" Round( c.InvoicePrice * a.Qty,2 ) SettleAmt,\n" +
" 0 DiffSettleFisQty,\n" +
" 0 DiffSettleInvQty, \n" +
" a.Qty InvoiceQty ,\n" +
" IsNull( B.Qty, 0 ) SettleReadyQty \n" +
" FROM\n" +
" ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" +
" INNER JOIN Set_fis a ON b.ChassisNumber = a.ChassisNumber2 \n" +
" AND b.KENNCode = a.KENNCode \n" +
" AND b.MaterialCode = a.ItemCode\n" +
" LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON a.ItemCode = c.MaterialCode\n" +
" LEFT JOIN set_material d ON a.ItemCode = d.CustomerPartCode\n" +
" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) e ON a.ErpMaterialCode = e.MaterialCode {1} \n" +
" ) TEMP1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" 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;
}

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

@ -10,6 +10,7 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{

1
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs

@ -86,6 +86,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount
{
}
public virtual bool Delete(string version)
{
try

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

@ -10,6 +10,7 @@ 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.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report

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

@ -1,5 +1,6 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.EntityFrameworkCore;
using SettleAccount.Job.Services;
using System;
using System.Collections.Generic;
@ -11,6 +12,7 @@ using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Emailing;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.SettleAccounts;
@ -156,6 +158,11 @@ namespace TaskJob.Services
_setls = _setls.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.KENNCode }).Select(p => p.FirstOrDefault()).ToList();
_repository.Insert(_setls);
_versionRepository.Insert(_id, version, customerCode, customerCode);
_repository.GetDbContext().Database.ExecuteSqlRaw(
"EXEC sp_settle_fis_update"
);
return id.ToString();
}
}

Loading…
Cancel
Save