Browse Source

后端H平台、M平台、F平台输出报表的功能

branch_ccpg_220107
44673626 3 years ago
parent
commit
eac1bea150
  1. 12086
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs
  2. 33
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  3. 17
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  4. 242
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs
  5. 334
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  6. 306
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs
  7. 49
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs
  8. 49
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs
  9. 120
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs
  10. 118
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs
  11. 120
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs

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

File diff suppressed because it is too large

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

@ -662,6 +662,37 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
// return _taskid;
//}
#region 红旗、一汽轿车的输出报表
/// <summary>
///红旗H平台核对明细
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("HQHSettledDetailDiffExportService")]
[DisableRequestSizeLimit]
public async Task<string> HQHSettledDetailDiffExportServiceMake(
HQKanbanRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("H平台核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
/// <summary>
///红旗F平台核对明细
@ -726,7 +757,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
#endregion
}
}

17
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -3150,6 +3150,13 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQHSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗H平台核对明细
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.HQFSettledDetailDiffExportServiceMake(Win.Sfs.SettleAccount.Reports.ReportRequestDto.HQKanbanRequestDto)">
<summary>
红旗F平台核对明细
@ -3164,6 +3171,16 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.SettleAccountApplicationAutoMapperProfile.CreateMapBT_Car_Platform">
<summary>
红旗F平台导入
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.SettleAccountApplicationAutoMapperProfile.CreateMapBT_Car_PlatformVersion">
<summary>
红旗F平台-版本
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.SettleAccountApplicationAutoMapperProfile.CreateMapHQ_F_Platform">
<summary>
红旗F平台导入

242
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs

@ -152,66 +152,59 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
////{
//// condition += string.Format(" B.chassisNumber='{0}' ", materialGroup);
////}
string str =
"SELECT\n" +
" isnull(temp1.交货单号,'') 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull(temp1.手工或自动,'') 手工或自动,\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.发货零件号,\n" +
" temp1.零件中文名称,\n" +
" temp1.Sap编码,\n" +
" temp1.物料组,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.结算验收单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull(TEMP2.Price,0) AS 发货定价,\n" +
" isnull(temp1.发货数量,0) * isnull(TEMP2.Price,0) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" 0 AS 单价差异,\n" +
" 0 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" b.LastModificationTime AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull(b.Qty,0) AS 发货数量,\n" +
" isnull(b.State,0) AS 发货状态,\n" +
" a.AcceptanceNo AS 结算验收单号,\n" +
" isnull(b.Qty,0) AS 结算数量,\n" +
" isnull(a.Price,0) AS 结算单价,\n" +
" isnull(a.Amt,0) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组\n" +
" FROM\n" +
" Set_HQ_H_Platform AS a\n" +
" LEFT OUTER JOIN Set_HQ_H_Kanban AS b ON a.HQHKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.HQHKanBan <> 'BJ' ) and a.Version='{0}' {1}) AS temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX( Version ) FROM Set_PriceList ))) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
string str = "SELECT\n" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.发货零件号,\n" +
" temp1.零件中文名称,\n" +
" temp1.Sap编码,\n" +
" temp1.物料组,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.结算验收单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" 0 AS 单价差异,\n" +
" 0 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" b.LastModificationTime AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( b.Qty, 0 ) AS 发货数量,\n" +
" isnull( b.State, 0 ) AS 发货状态,\n" +
" a.AcceptanceNo AS 结算验收单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( a.Price, 0 ) AS 结算单价,\n" +
" isnull( a.Amt, 0 ) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
" Set_HQ_F_Platform AS a\n" +
" LEFT OUTER JOIN Set_HQ_F_Kanban AS b ON a.HQHKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.HQHKanBan <> 'BJ' ) \n" +
" AND a.Version='{0}' {1}\n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQFSettledDetailDiff>(_sql, null, null, true, 1200, null);
@ -226,31 +219,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
List<HQFSettleQtyDiff> _list = new List<HQFSettleQtyDiff>();
var str =
"SELECT temp1.MaterialCode 客户物料号,temp1.HQHKanBan 看板号 ,temp1.SettleQty 结算数量, temp2.Qty 发货数量,( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"SELECT\n" +
" temp1.MaterialCode 客户物料号,\n" +
" temp1.HQHKanBan 看板号 ,\n" +
" temp1.SettleQty 结算数量,\n" +
" temp2.Qty 发货数量,\n" +
" ( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" SUM( Qty ) SettleQty,\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Platform where version='{0}'\n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" ) temp1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" SUM( Qty ) Qty,\n" +
" Kanban,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Kanban \n" +
" GROUP BY\n" +
" Kanban,\n" +
" MaterialCode \n" +
" ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode where temp1.SettleQty!=temp2.Qty ";
" ( SELECT SUM ( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_F_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n" +
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_F_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode \n" +
"WHERE\n" +
" temp1.SettleQty!= temp2.Qty";
str = string.Format(str, version);
var _query = DbConnection.Query<HQFSettleQtyDiff>(str, null, null, true, 1200, null);
@ -278,54 +258,52 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
condition += string.Format(" and a.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 销售单价,(\n" +
" isnull( temp1.结算单价, 0 )- isnull( temp2.Price, 0 )) 价格差异 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.Price 结算单价,\n" +
" A.Qty 结算数量,\n" +
" A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" Price,\n" +
" SUM( Qty ) Qty,\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND HQHKanBan = 'BJ' {1}\n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" price \n" +
" ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX( Version ) AS Expr1 FROM Set_PriceList ))) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
;
string str = " SELECT \n" +
" temp1.*, \n" +
" isnull( temp2.Price, 0 ) 销售单价,( \n" +
" isnull( temp1.结算单价, 0 )- isnull( temp2.Price, 0 )) 价格差异 \n" +
" FROM \n" +
" ( \n" +
" SELECT \n" +
" A.Price 结算单价, \n" +
" A.Qty 结算数量, \n" +
" A.MaterialCode 结算物料号, \n" +
" A.StorageLocation 收货仓库, \n" +
" A.StorageLocationDesc 收货仓库描述, \n" +
" C.EstimateTypeDesc 物料组, \n" +
" C.MaterialCode Sap编码, \n" +
" C.MaterialDesc 物料描述, \n" +
" 0 寄销库数量 \n" +
" FROM \n" +
" ( \n" +
" SELECT \n" +
" Price, \n" +
" SUM( Qty ) Qty, \n" +
" MaterialCode, \n" +
" StorageLocation, \n" +
" StorageLocationDesc \n" +
" FROM \n" +
" Set_HQ_F_Platform \n" +
" WHERE \n" +
" version = '{0}' \n" +
" AND HQHKanBan = 'BJ' {1} \n" +
" GROUP BY \n" +
" MaterialCode, \n" +
" StorageLocation, \n" +
" StorageLocationDesc, \n" +
" price \n" +
" ) A \n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1 \n" +
" LEFT OUTER JOIN ( \n" +
" SELECT \n" +
" Price, \n" +
" MaterialCode \n" +
" FROM \n" +
" Set_PriceList \n" +
" WHERE \n" +
" ( \n" +
" Version = ( SELECT MAX( Version ) AS Expr1 FROM Set_PriceList ))) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode " ;
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQFSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);

334
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -0,0 +1,334 @@
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
{
/// <summary>
/// 红旗H平台输出报表
/// </summary>
public class HQHSettledDetailDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQHSettledDetailDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQHSettledDetailDiff> GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQHSettledDetailDiff> _list = new List<HQHSettledDetailDiff>();
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 b.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and b.LastModificationTime<='{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);
//}
////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" +
" isnull(temp1.交货单号,'') 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull(temp1.手工或自动,'') 手工或自动,\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.发货零件号,\n" +
" temp1.零件中文名称,\n" +
" temp1.Sap编码,\n" +
" temp1.物料组,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.结算验收单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull(TEMP2.Price,0) AS 发货定价,\n" +
" isnull(temp1.发货数量,0) * isnull(TEMP2.Price,0) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" 0 AS 单价差异,\n" +
" 0 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" b.LastModificationTime AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull(b.Qty,0) AS 发货数量,\n" +
" isnull(b.State,0) AS 发货状态,\n" +
" a.AcceptanceNo AS 结算验收单号,\n" +
" isnull(b.Qty,0) AS 结算数量,\n" +
" isnull(a.Price,0) AS 结算单价,\n" +
" isnull(a.Amt,0) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组\n" +
" FROM\n" +
" Set_HQ_H_Platform AS a\n" +
" LEFT OUTER JOIN Set_HQ_H_Kanban AS b ON a.HQHKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.HQHKanBan <> 'BJ' ) and a.Version='{0}' {1}) AS temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX( Version ) FROM Set_PriceList ))) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQHSettleQtyDiff> GetDiffQtyList(string version)
{
List<HQHSettleQtyDiff> _list = new List<HQHSettleQtyDiff>();
var str =
"SELECT temp1.MaterialCode 客户物料号,temp1.HQHKanBan 看板号 ,temp1.SettleQty 结算数量, temp2.Qty 发货数量,( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" SUM( Qty ) SettleQty,\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Platform where version='{0}'\n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" ) temp1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" SUM( Qty ) Qty,\n" +
" Kanban,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Kanban \n" +
" GROUP BY\n" +
" Kanban,\n" +
" MaterialCode \n" +
" ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode where temp1.SettleQty!=temp2.Qty ";
str = string.Format(str, version);
var _query = DbConnection.Query<HQHSettleQtyDiff>(str, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQHSharePartSettledDetailDiff> GetSharePartSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQHSharePartSettledDetailDiff> _list = new List<HQHSharePartSettledDetailDiff>();
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 销售单价,(\n" +
" isnull( temp1.结算单价, 0 )- isnull( temp2.Price, 0 )) 价格差异 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.Price 结算单价,\n" +
" A.Qty 结算数量,\n" +
" A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" Price,\n" +
" SUM( Qty ) Qty,\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND HQHKanBan = 'BJ' {1}\n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" price \n" +
" ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" +
" LEFT OUTER JOIN (\n" +
" SELECT\n" +
" Price,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_PriceList \n" +
" WHERE\n" +
" (\n" +
" Version = ( SELECT MAX( Version ) AS Expr1 FROM Set_PriceList ))) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
;
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQHSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
public class HQHSharePartSettledDetailDiff
{
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算物料号")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算物料描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "寄销库数量")]
public decimal { set; get; }
}
public class HQHSettledDetailDiff
{
[ExporterHeader(DisplayName = "交货单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "零件中文名称")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货状态")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "数量差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "单价差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
}
public class HQHSettleQtyDiff
{
public string { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public string { set; get; }
}
}

306
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs

@ -0,0 +1,306 @@
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
{
/// <summary>
/// 红旗M平台输出报表
/// </summary>
public class HQMSettledDetailDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public HQMSettledDetailDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual List<HQMSettledDetailDiff> GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQMSettledDetailDiff> _list = new List<HQMSettledDetailDiff>();
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 b.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and b.LastModificationTime<='{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);
//}
////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" +
" isnull( temp1.交货单号, '' ) 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" temp1.收货仓库,\n" +
" temp1.收货仓库描述,\n" +
" temp1.订货看板编号,\n" +
" temp1.订货零件号,\n" +
" temp1.发货零件号,\n" +
" temp1.零件中文名称,\n" +
" temp1.Sap编码,\n" +
" temp1.物料组,\n" +
" temp1.发货数量,\n" +
" temp1.发货状态,\n" +
" temp1.结算验收单号,\n" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" 0 AS 单价差异,\n" +
" 0 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" b.LastModificationTime AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
" a.StorageLocationDesc AS 收货仓库描述,\n" +
" a.HQMKanBan AS 订货看板编号,\n" +
" a.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" a.MaterialCode AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( b.Qty, 0 ) AS 发货数量,\n" +
" isnull( b.State, 0 ) AS 发货状态,\n" +
" a.AcceptanceNo AS 结算验收单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( a.Price, 0 ) AS 结算单价,\n" +
" isnull( a.Amt, 0 ) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
" Set_HQ_M_Platform AS a\n" +
" LEFT OUTER JOIN Set_HQ_M_Kanban AS b ON a.HQMKanBan = b.Kanban \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" ( a.HQMKanBan <> 'BJ' ) \n" +
" AND a.Version= '{0}' { 1 } \n" +
" ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQMSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQMSettleQtyDiff> GetDiffQtyList(string version)
{
List<HQMSettleQtyDiff> _list = new List<HQMSettleQtyDiff>();
var str =
"SELECT\n" +
" temp1.MaterialCode 客户物料号,\n" +
" temp1.HQMKanBan 看板号 ,\n" +
" temp1.SettleQty 结算数量,\n" +
" temp2.Qty 发货数量,\n" +
" ( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"FROM\n" +
" ( SELECT SUM ( Qty ) SettleQty, HQMKanBan, MaterialCode FROM Set_HQ_M_Platform WHERE version = '{0}' GROUP BY HQMKanBan, MaterialCode ) temp1\n" +
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_M_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQMKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode \n" +
"WHERE\n" +
" temp1.SettleQty!= temp2.Qty";
str = string.Format(str, version);
var _query = DbConnection.Query<HQMSettleQtyDiff>(str, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
public virtual List<HQMSharePartSettledDetailDiff> GetSharePartSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQMSharePartSettledDetailDiff> _list = new List<HQMSharePartSettledDetailDiff>();
string condition = " where 1=1 ";
if (!string.IsNullOrEmpty(begin))
{
condition += string.Format(" and a.LastModificationTime>='{0}' ", begin);
}
if (!string.IsNullOrEmpty(end))
{
condition += string.Format(" and a.LastModificationTime<='{0}' ", end);
}
string str =
"SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 销售单价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.Price 结算单价,\n" +
" A.Qty 结算数量,\n" +
" A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" Price,\n" +
" SUM ( Qty ) Qty,\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc \n" +
" FROM\n" +
" Set_HQ_M_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND HQHKanBan = 'BJ' { 1 } \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" price \n" +
" ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQMSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
}
}
public class HQMSharePartSettledDetailDiff
{
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算物料号")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算物料描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "寄销库数量")]
public decimal { set; get; }
}
public class HQMSettledDetailDiff
{
[ExporterHeader(DisplayName = "交货单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "交货时间")]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "零件中文名称")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货状态")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "发货总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "数量差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "单价差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
}
public class HQMSettleQtyDiff
{
public string { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public decimal { set; get; }
public string { set; get; }
}
}

49
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs

@ -16,7 +16,7 @@ namespace SettleAccount.Job.Services
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
public class HQFSharePartSettledDetailDiffExportService : ITransientDependency, IExportJob
public class HQFSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQFSettledDetailDapperRepository _dapperRepository;
@ -25,7 +25,7 @@ namespace SettleAccount.Job.Services
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQFSharePartSettledDetailDiffExportService(
public HQFSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQFSettledDetailDapperRepository dapperRepository,
@ -52,25 +52,24 @@ namespace SettleAccount.Job.Services
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls=_dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _lst=_dapperRepository.GetDiffQtyList(version);
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst=_dapperRepository.GetDiffQtyList(version);
//foreach (var itm in _lst)
//{
// var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号==itm.客户物料号);
// if(_first!=null)
// {
// _first.发货数量 = _first.结算数量+ itm.差异数量;
// _first.数量差异 = itm.差异数量;
// }
//}
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p.==itm.);
if(_first!=null)
{
_first. = _first.+ itm.;
_first. = itm.;
}
}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
@ -84,14 +83,14 @@ namespace SettleAccount.Job.Services
}
}
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = acceptNo.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
if (!string.IsNullOrEmpty(acceptNo))
{
var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
@ -105,7 +104,7 @@ namespace SettleAccount.Job.Services
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
@ -116,7 +115,7 @@ namespace SettleAccount.Job.Services
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQFSharePartSettledDetailDiff>(id, _filename, _ls);
_outputService.Export<HQFSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}

49
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs

@ -16,7 +16,7 @@ namespace SettleAccount.Job.Services
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
public class HQFSettledDetailDiffExportService : ITransientDependency, IExportJob
public class HQFSharePartSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQFSettledDetailDapperRepository _dapperRepository;
@ -25,7 +25,7 @@ namespace SettleAccount.Job.Services
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQFSettledDetailDiffExportService(
public HQFSharePartSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQFSettledDetailDapperRepository dapperRepository,
@ -52,24 +52,25 @@ namespace SettleAccount.Job.Services
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst=_dapperRepository.GetDiffQtyList(version);
var _ls=_dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _lst=_dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p.==itm.);
if(_first!=null)
{
_first. = _first.+ itm.;
_first. = itm.;
}
}
//foreach (var itm in _lst)
//{
// var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号==itm.客户物料号);
// if(_first!=null)
// {
// _first.发货数量 = _first.结算数量+ itm.差异数量;
// _first.数量差异 = itm.差异数量;
// }
//}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
@ -83,14 +84,14 @@ namespace SettleAccount.Job.Services
}
}
if (!string.IsNullOrEmpty(acceptNo))
{
var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = acceptNo.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
@ -104,7 +105,7 @@ namespace SettleAccount.Job.Services
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
@ -115,7 +116,7 @@ namespace SettleAccount.Job.Services
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQFSettledDetailDiff>(id, _filename, _ls);
_outputService.Export<HQFSharePartSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}

120
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs

@ -0,0 +1,120 @@
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
{
/// <summary>
/// 红旗H平台
/// </summary>
public class HQHSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQHSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQHSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQHSettledDetailDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var kanban = p_list.Where(p => p.Name == "Kanban").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 materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst = _dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first. + itm.;
_first. = itm.;
}
}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(acceptNo))
{
var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQHSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

118
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs

@ -0,0 +1,118 @@
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 HQHSharePartSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQHSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQHSharePartSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQHSettledDetailDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var kanban = p_list.Where(p => p.Name == "Kanban").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 materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
//var _lst=_dapperRepository.GetDiffQtyList(version);
//foreach (var itm in _lst)
//{
// var _first = _ls.FirstOrDefault(p => p.订货看板编号 == itm.看板号 && p.订货零件号==itm.客户物料号);
// if(_first!=null)
// {
// _first.发货数量 = _first.结算数量+ itm.差异数量;
// _first.数量差异 = itm.差异数量;
// }
//}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
//if (!string.IsNullOrEmpty(acceptNo))
//{
// var _groupList = acceptNo.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList();
// }
//}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQHSharePartSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}

120
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs

@ -0,0 +1,120 @@
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
{
/// <summary>
/// 红旗H平台
/// </summary>
public class HQMSettledDetailDiffExportService : ITransientDependency, IExportJob
{
private readonly HQMSettledDetailDapperRepository _dapperRepository;
private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly OutputService _outputService;
private readonly InputService _inputService;
public HQMSettledDetailDiffExportService(
ErpPartDapperRepository erpdapperRepository,
HQMSettledDetailDapperRepository dapperRepository,
OutputService outputService,
InputService inputService
)
{
_inputService = inputService;
_outputService = outputService;
_erpdapperRepository = erpdapperRepository;
_dapperRepository = dapperRepository;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var _filename = exportName.FirstOrDefault();
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var kanban = p_list.Where(p => p.Name == "Kanban").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 materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var acceptNo = p_list.Where(p => p.Name == "AcceptNo").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);
var _lst = _dapperRepository.GetDiffQtyList(version);
foreach (var itm in _lst)
{
var _first = _ls.FirstOrDefault(p => p. == itm. && p. == itm.);
if (_first != null)
{
_first. = _first. + itm.;
_first. = itm.;
}
}
if (!string.IsNullOrEmpty(kanban))
{
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(warehouseDesc))
{
var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(acceptNo))
{
var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(materialCode))
{
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList();
}
}
_outputService.Export<HQMSettledDetailDiff>(id, _filename, _ls);
return id.ToString();
}
}
}
Loading…
Cancel
Save