Administrator 3 years ago
parent
commit
34e96c0d33
  1. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs
  2. 35
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  3. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs
  4. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  5. 17
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  6. 49
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  7. 284
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
  8. 306
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  9. 26
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQCarSettledDetailDiffExportService.cs
  10. 4
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs

@ -197,7 +197,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls
if (_first != null)
{
throw new BusinessException("001", "已经存数据请修改后创建");
throw new BusinessException("001", "已经存在该期间,不能重复添加!");
}
var entity = new CentralizedControl(

35
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs

@ -106,42 +106,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
return true;
}
/// <summary>
/// 出库单导出
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(WmsSharePartOutPutRequestDto input)
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true);
IExporter _excel = new ExcelExporter();
byte[] result = null;
var _fileName = string.Format("大众备件调整数据出库单_{0}.xlsx", Guid.NewGuid().ToString());
result = await _excel.ExportAsByteArray(entities);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
private async Task<long> GetCountAsync(WmsSharePartOutPutRequestDto input)
{
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters);

6
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs

@ -313,7 +313,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
"EXEC @return_value = [dbo].[p_wms_ou" +
"tput]\n" +
" @billnum = N'{0}',\n" +
" @type = 21,\n" +
" @type = 22,\n" +
" @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
@ -347,7 +347,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
"EXEC @return_value = [dbo].[p_wms_output_cancel]\n" +
" @Guids ='{0}', \n" +
" @billnum = N'{1}',\n" +
" @type = 21,\n" +
" @type = 22,\n" +
" @accountdate = N'{2}'\n" +
"SELECT 'Return Value' = @return_value";
@ -380,7 +380,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" +
" @billnum = N'{0}',\n" +
" @type = 21\n" +
" @type = 22\n" +
"SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum)

6
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -257,6 +257,7 @@ namespace Win.Sfs.SettleAccount
CreateMapWmsSharePart90();
CreateMapWmsHQWithOutKanban();
CreateMapWmsHQCar();
CreateMapWmsOneTimeSale();
#endregion
@ -296,6 +297,11 @@ namespace Win.Sfs.SettleAccount
CreateMap<WmsHQWithOutKanbanOutPutDetial, WmsHQWithOutKanbanOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsOneTimeSale()
{
CreateMap<WmsOneTimeSaleOutPutDetial, WmsOneTimeSaleOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsHQCar()
{
CreateMap<WmsHQCarOutPutDetial, WmsHQCarOutPutDetialDto>().ReverseMap();

17
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs

@ -767,6 +767,23 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; }
[ImporterHeader(Name = "出库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "出库库位", IsIgnore = true)]
//出库库位
public string OutPut { set; get; }
[ImporterHeader(Name = "入库库位", IsIgnore = true)]
[ExporterHeader(DisplayName = "入库库位", IsIgnore = true)]
//入库库位
public string InPut { set; get; }
[ExporterHeader(DisplayName = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; }
[ExporterHeader(DisplayName = "交货单号", IsIgnore = true)]
public string WmsBillNum { set; get; }
[ExporterHeader(DisplayName = "订单号", IsIgnore = true)]
//KENN号
public string OrderBillNum { set; get; }
}

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

@ -368,6 +368,11 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureWmsHQWithOutKanbanOutPutVersion(options);
builder.ConfigureWmsHQWithOutKanbanOutPutDetail(options);
//一次性寄售销售库
builder.ConfigureWmsOneTimeSaleOutPutVersion(options);
builder.ConfigureWmsOneTimeSaleOutPutDetial(options);
#endregion
@ -1671,6 +1676,50 @@ namespace Win.Sfs.SettleAccount
private static void ConfigureWmsOneTimeSaleOutPutVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsOneTimeSaleOutPut>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsOneTimeSaleOutPut", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
private static void ConfigureWmsOneTimeSaleOutPutDetial(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<WmsOneTimeSaleOutPutDetial>(b =>
{
b.ToTable($"{options.TablePrefix}_WmsOneTimeSaleOutPutDetial", options.Schema);
b.ConfigureByConvention();
b.Property(x => x.BillNum).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.WmsBillNum).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OutPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.InPut).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.OrderBillNum).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.ParentMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.Extend1).HasMaxLength(CommonConsts.MaxCodeLength);
//b.Property(x => x.Extend2).HasMaxLength(CommonConsts.MaxCodeLength);
b.Property(x => x.SapMaterialCode).HasMaxLength(CommonConsts.MaxCodeLength);
b.HasIndex(x => new { x.BillNum });
});
}
#endregion
#region 天合

284
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs

@ -75,33 +75,33 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//}
string str = "SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 定价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
" a.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" Set_BT_Car_Platform A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" \n" +
" WHERE\n" +
" a.Version= '{0}' \n" +
" AND a.StorageLocationDesc NOT LIKE '%备品%'\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\n" +
" ";
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 定价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.MaterialCode Sap编码,\n" +
" A.MaterialCode 结算物料号,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" Set_BT_Car_Platform A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" a.Version= '{0}' \n" +
" AND a.StorageLocationDesc NOT LIKE '%备品%' \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";
@ -142,59 +142,65 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//}
string str = "SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 定价,\n" +
" ISNULL( temp3.Price, 0 ) 结算单价,\n" +
" ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( temp3.Price * temp1.结算数量 ) 结算金额,\n" +
" ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\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 SUM\n" +
" ( Qty ) Qty,\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Version \n" +
" FROM\n" +
" Set_BT_Car_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND StorageLocationDesc NOT LIKE '%备品%' \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Version \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\n" +
" LEFT JOIN (\n" +
" SELECT SUM\n" +
" ( Amt ) / SUM ( Qty ) AS Price,\n" +
" MaterialCode,\n" +
" Version \n" +
" FROM\n" +
" Set_BT_Car_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND StorageLocationDesc NOT LIKE '%备品%' \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" Version \n" +
" ) AS TEMP3 ON temp1.[结算物料号] = temp3.MaterialCode";
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 定价,\n" +
" ISNULL( temp3.Price, 0 ) 结算单价,\n" +
" ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( temp3.Price * temp1.结算数量 ) 结算金额,\n" +
" ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
" SELECT SUM\n" +
" ( Qty ) Qty,\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" FROM\n" +
" Set_BT_Car_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND StorageLocationDesc NOT LIKE '%备品%' \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \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\n" +
" LEFT JOIN (\n" +
" SELECT SUM\n" +
" ( Amt ) / SUM ( Qty ) AS Price,\n" +
" MaterialCode,\n" +
" Version \n" +
" FROM\n" +
" Set_BT_Car_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND StorageLocationDesc NOT LIKE '%备品%' \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" Version \n" +
" ) AS TEMP3 ON temp1.[结算物料号] = temp3.MaterialCode";
@ -235,33 +241,33 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//}
string str = "SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 定价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
" a.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" Set_BT_Car_Platform A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" \n" +
" WHERE\n" +
" a.Version= '{0}' \n" +
" AND a.StorageLocationDesc LIKE '%备品%'\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\n" +
" ";
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 定价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" C.MaterialCode Sap编码,\n" +
" A.MaterialCode 结算物料号,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" ISNULL( A.Price, 0 ) 结算单价,\n" +
" ISNULL( A.Qty, 0 ) 结算数量,\n" +
" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" Set_BT_Car_Platform A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" a.Version= '{0}' \n" +
" AND a.StorageLocationDesc LIKE '%备品%' \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";
@ -318,6 +324,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
@ -326,7 +334,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Version \n" +
" Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" FROM\n" +
" Set_BT_Car_Platform \n" +
" WHERE\n" +
@ -336,7 +346,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" MaterialCode,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" Version \n" +
" Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" +
@ -350,7 +362,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" Set_BT_Car_Platform \n" +
" WHERE\n" +
" version = '{0}' \n" +
" AND StorageLocationDesc LIKE '%备品%' \n" +
" AND StorageLocationDesc LIKE '%备品%' \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" Version \n" +
@ -379,7 +391,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public HQCarSettledDetailDiff(string sapMaterialCode, string materialCode, string materialDesc, decimal price,
string storageLocation, string storageLocationDesc, decimal selprice, decimal diffprice, decimal sumprice, decimal settleprice, decimal qty,
decimal sockQty,string metarialGroup)
decimal sockQty,string metarialGroup,string acceptanceNo,string acceptanceDate)
{
SAP编码 = sapMaterialCode;
= materialDesc;
@ -394,55 +406,53 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
= qty;
= settleprice;
= metarialGroup;
= acceptanceNo;
= acceptanceDate;
}
[ExporterHeader(DisplayName = "交货日期")]
[ExporterHeader(DisplayName = "交货日期",IsIgnore = true)]
public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")]
[ExporterHeader(DisplayName = "手工或自动", IsIgnore = true)]
public string { set; get; }
[ExporterHeader(DisplayName = "交货单号")]
[ExporterHeader(DisplayName = "交货单号", IsIgnore = true)]
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 string { set; get; }
[ExporterHeader(DisplayName = "SAP编码")]
public string SAP编码 { set; get; }
[ExporterHeader(DisplayName = "物料组")]
public string { 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 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 = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "数量差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "价格差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]

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

@ -816,10 +816,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <param name="end"></param>
/// <param name="materialGroup"></param>
/// <returns></returns>
public virtual List<HQHSettledDetailDiff> GetReverseSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
public virtual List<HQHUnSettledDetailDiff> GetReverseSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQHSettledDetailDiff> _list = new List<HQHSettledDetailDiff>();
List<HQHUnSettledDetailDiff> _list = new List<HQHUnSettledDetailDiff>();
string condition = " ";
@ -833,63 +833,61 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
string str = "SELECT\n" +
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" isnull( 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" +
" temp1.结算数量,\n" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.WmsBillNum AS 交货单号,\n" +
" CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) AS 交货时间 ,\n" +
" a.IsAuto AS 手工或自动,\n" +
" b.StorageLocation AS 收货仓库,\n" +
" b.StorageLocationDesc AS 收货仓库描述,\n" +
" a.Kanban AS 订货看板编号,\n" +
" b.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" c.CustomerPartCode 客户物料号,\n" +
" '' AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" isnull( a.State, 0 ) AS 发货状态,\n" +
" b.AcceptanceNo AS 结算验收单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( b.Price, 0 ) AS 结算单价,\n" +
" isnull( b.Amt, 0 ) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
" Set_HQ_H_Kanban AS a\n" +
" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" b.HQHKanBan IS NULL \n" +
" AND b.MaterialCode IS NULL {0} \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";
" temp1.交货时间,\n" +
" isnull( temp1.手工或自动, '' ) 手工或自动,\n" +
" isnull( 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" +
" temp1.结算单价,\n" +
" temp1.结算金额,\n" +
" isnull( TEMP2.Price, 0 ) AS 发货定价,\n" +
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.发货数量 AS 差异总金额 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" a.WmsBillNum AS 交货单号,\n" +
" CONVERT ( VARCHAR ( 100 ), a.LastModificationTime, 23 ) AS 交货时间 ,\n" +
" a.IsAuto AS 手工或自动,\n" +
" b.StorageLocation AS 收货仓库,\n" +
" b.StorageLocationDesc AS 收货仓库描述,\n" +
" a.Kanban AS 订货看板编号,\n" +
" b.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" +
" c.CustomerPartCode 客户物料号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" +
" isnull( a.State, 0 ) AS 发货状态,\n" +
" b.AcceptanceNo AS 结算验收单号,\n" +
" isnull( b.Qty, 0 ) AS 结算数量,\n" +
" isnull( b.Price, 0 ) AS 结算单价,\n" +
" isnull( b.Amt, 0 ) AS 结算金额 ,\n" +
" C.EstimateTypeDesc AS 物料组 \n" +
" FROM\n" +
" Set_HQ_H_Kanban AS a\n" +
" LEFT OUTER JOIN ( SELECT * FROM Set_HQ_H_Platform WHERE HQHKanBan <> 'BJ' ) AS b ON a.Kanban = b.HQHKanBan \n" +
" AND a.MaterialCode = b.MaterialCode\n" +
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" +
" b.HQHKanBan IS NULL \n" +
" AND b.MaterialCode IS NULL {0}\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, condition);
var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null);
var _query = DbConnection.Query<HQHUnSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
@ -1061,9 +1059,10 @@ 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( temp2.Price, 0 ) 发货定价,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" +
@ -1075,20 +1074,27 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" +
" C.MaterialDesc 零件中文名称,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" a.Factory AS 工厂,\n" +
" a.HQHKanBan AS 订货看板编号,\n" +
" a.AcceptanceDate 验收单日期,\n" +
" 0 寄销库数量 \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" Price,\n" +
" SUM ( Qty ) Qty,\n" +
" SELECT SUM\n" +
" ( Qty ) AS Qty,\n" +
" MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" AcceptanceNo \n" +
" Factory,\n" +
" AcceptanceNo,\n" +
" Price,\n" +
" HQHKanBan,\n" +
" CONVERT ( VARCHAR ( 100 ), AcceptanceDate, 23 ) AcceptanceDate \n" +
" FROM\n" +
" Set_HQ_H_Platform \n" +
" WHERE\n" +
@ -1096,14 +1102,63 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" AND HQHKanBan = 'BJ' \n" +
" GROUP BY\n" +
" MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" +
" StorageLocationDesc,\n" +
" price,\n" +
" AcceptanceNo \n" +
" Factory,\n" +
" AcceptanceNo,\n" +
" Price,\n" +
" HQHKanBan,\n" +
" AcceptanceDate \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";
//string str = "SELECT\n" +
//" temp1.*,\n" +
//" isnull( temp2.Price, 0 ) 销售单价,\n" +
//" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
//" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" ISNULL( A.Price, 0 ) 结算单价,\n" +
//" ISNULL( A.Qty, 0 ) 结算数量,\n" +
//" ISNULL( A.Price, 0 ) * ISNULL( A.Qty, 0 ) 结算金额,\n" +
//" A.MaterialCode 结算物料号,\n" +
//" A.StorageLocation 收货仓库,\n" +
//" A.StorageLocationDesc 收货仓库描述,\n" +
//" a.[AcceptanceNo] AS 结算验收单号,\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" +
//" AcceptanceNo \n" +
//" FROM\n" +
//" Set_HQ_H_Platform \n" +
//" WHERE\n" +
//" version = '{0}' \n" +
//" AND HQHKanBan = 'BJ' \n" +
//" GROUP BY\n" +
//" MaterialCode,\n" +
//" StorageLocation,\n" +
//" StorageLocationDesc,\n" +
//" price,\n" +
//" AcceptanceNo \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 _sql = string.Format(str, version);
@ -1142,7 +1197,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string str = "SELECT\n" +
" temp1.*,\n" +
" isnull( temp2.Price, 0 ) 销售单价,\n" +
" isnull( temp2.Price, 0 ) 发货定价,\n" +
" isnull( temp3.Price, 0 ) 结算单价,\n" +
" ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" (temp3.Price * temp1.结算数量) 结算金额,\n" +
@ -1219,51 +1274,71 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
decimal sockQty)
{
Sap编码 = sapMaterialCode;
= materialDesc;
= materialDesc;
= materialCode;
= sockQty;
= price;
= storageLocation;
= storageLocationDesc;
= selprice;
= selprice;
= diffprice;
= sumprice;
= qty;
= settleprice;
}
[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 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 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 = "Sap编码")]
public string Sap编码 { 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; }
}
public class HQHSettledDetailDiff
@ -1288,12 +1363,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { 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 = "发货状态")]
@ -1333,6 +1409,72 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; }
}
public class HQHUnSettledDetailDiff
{
[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 = "订货零件号",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "发货零件号", IsIgnore = true)]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { 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 decimal { set; get; }
[ExporterHeader(DisplayName = "发货状态", IsIgnore = true)]
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; }
[ExporterHeader(DisplayName = "工厂",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "看板编号")]
public string { set; get; }
}
public class HQHSettleQtyDiff
{
public string { set; get; }

26
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQCarSettledDetailDiffExportService.cs

@ -83,7 +83,9 @@ namespace SettleAccount.Job.Services.Report
itm.,
itm.,
tm1 == null ? 0 : tm1.Qty,
itm.
itm.,
itm.,
itm.
);
@ -108,7 +110,9 @@ namespace SettleAccount.Job.Services.Report
itm.,
itm.,
tm1 == null ? 0 : tm1.Qty,
itm.
itm.,
itm.,
itm.
);
//if (!string.IsNullOrEmpty(kanban))
@ -138,14 +142,16 @@ namespace SettleAccount.Job.Services.Report
_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(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();

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

@ -72,11 +72,11 @@ namespace SettleAccount.Job.Services.Report
select new HQHSharePartSettledDetailDiff(
itm.Sap编码,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,

Loading…
Cancel
Save