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. 104
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs
  8. 206
      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) if (_first != null)
{ {
throw new BusinessException("001", "已经存数据请修改后创建"); throw new BusinessException("001", "已经存在该期间,不能重复添加!");
} }
var entity = new CentralizedControl( 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; 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) private async Task<long> GetCountAsync(WmsSharePartOutPutRequestDto input)
{ {
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); 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" + "EXEC @return_value = [dbo].[p_wms_ou" +
"tput]\n" + "tput]\n" +
" @billnum = N'{0}',\n" + " @billnum = N'{0}',\n" +
" @type = 21,\n" + " @type = 22,\n" +
" @date = N'{1}'\n" + " @date = N'{1}'\n" +
"SELECT 'Return Value' = @return_value"; "SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
@ -347,7 +347,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
"EXEC @return_value = [dbo].[p_wms_output_cancel]\n" + "EXEC @return_value = [dbo].[p_wms_output_cancel]\n" +
" @Guids ='{0}', \n" + " @Guids ='{0}', \n" +
" @billnum = N'{1}',\n" + " @billnum = N'{1}',\n" +
" @type = 21,\n" + " @type = 22,\n" +
" @accountdate = N'{2}'\n" + " @accountdate = N'{2}'\n" +
"SELECT 'Return Value' = @return_value"; "SELECT 'Return Value' = @return_value";
@ -380,7 +380,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var sql = "DECLARE @return_value int\n" + var sql = "DECLARE @return_value int\n" +
"EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" + "EXEC @return_value = [dbo].[p_wms_output_cancel_all]\n" +
" @billnum = N'{0}',\n" + " @billnum = N'{0}',\n" +
" @type = 21\n" + " @type = 22\n" +
"SELECT 'Return Value' = @return_value"; "SELECT 'Return Value' = @return_value";
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync( await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
string.Format(sql, input.BillNum) string.Format(sql, input.BillNum)

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

@ -257,6 +257,7 @@ namespace Win.Sfs.SettleAccount
CreateMapWmsSharePart90(); CreateMapWmsSharePart90();
CreateMapWmsHQWithOutKanban(); CreateMapWmsHQWithOutKanban();
CreateMapWmsHQCar(); CreateMapWmsHQCar();
CreateMapWmsOneTimeSale();
#endregion #endregion
@ -296,6 +297,11 @@ namespace Win.Sfs.SettleAccount
CreateMap<WmsHQWithOutKanbanOutPutDetial, WmsHQWithOutKanbanOutPutDetialDto>().ReverseMap(); CreateMap<WmsHQWithOutKanbanOutPutDetial, WmsHQWithOutKanbanOutPutDetialDto>().ReverseMap();
} }
private void CreateMapWmsOneTimeSale()
{
CreateMap<WmsOneTimeSaleOutPutDetial, WmsOneTimeSaleOutPutDetialDto>().ReverseMap();
}
private void CreateMapWmsHQCar() private void CreateMapWmsHQCar()
{ {
CreateMap<WmsHQCarOutPutDetial, WmsHQCarOutPutDetialDto>().ReverseMap(); 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 = "开票金额")] [ExporterHeader(DisplayName = "开票金额")]
public decimal Amt { set; get; } 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.ConfigureWmsHQWithOutKanbanOutPutVersion(options);
builder.ConfigureWmsHQWithOutKanbanOutPutDetail(options); builder.ConfigureWmsHQWithOutKanbanOutPutDetail(options);
//一次性寄售销售库
builder.ConfigureWmsOneTimeSaleOutPutVersion(options);
builder.ConfigureWmsOneTimeSaleOutPutDetial(options);
#endregion #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 #endregion
#region 天合 #region 天合

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

@ -82,26 +82,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"FROM\n" + "FROM\n" +
" (\n" + " (\n" +
" SELECT\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.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" + " A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" + " C.MaterialCode Sap编码,\n" +
" A.MaterialCode 结算物料号,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\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" + " 0 寄销库数量 \n" +
" FROM\n" + " FROM\n" +
" Set_BT_Car_Platform A\n" + " Set_BT_Car_Platform A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" \n" +
" WHERE\n" + " WHERE\n" +
" a.Version= '{0}' \n" + " a.Version= '{0}' \n" +
" AND a.StorageLocationDesc NOT LIKE '%备品%'\n" + " AND a.StorageLocationDesc NOT LIKE '%备品%' \n" +
" ) temp1\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 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";
" ";
@ -158,6 +158,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" C.EstimateTypeDesc 物料组,\n" + " C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" + " C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" + " C.MaterialDesc 物料描述,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" 0 寄销库数量 \n" + " 0 寄销库数量 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
@ -166,7 +168,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" MaterialCode,\n" + " MaterialCode,\n" +
" StorageLocation,\n" + " StorageLocation,\n" +
" StorageLocationDesc,\n" + " StorageLocationDesc,\n" +
" Version \n" + " Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" FROM\n" + " FROM\n" +
" Set_BT_Car_Platform \n" + " Set_BT_Car_Platform \n" +
" WHERE\n" + " WHERE\n" +
@ -176,7 +180,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" MaterialCode,\n" + " MaterialCode,\n" +
" StorageLocation,\n" + " StorageLocation,\n" +
" StorageLocationDesc,\n" + " StorageLocationDesc,\n" +
" Version \n" + " Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
@ -242,26 +248,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"FROM\n" + "FROM\n" +
" (\n" + " (\n" +
" SELECT\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.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" + " A.StorageLocationDesc 收货仓库描述,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" + " C.MaterialCode Sap编码,\n" +
" A.MaterialCode 结算物料号,\n" +
" C.EstimateTypeDesc 物料组,\n" +
" C.MaterialDesc 物料描述,\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" + " 0 寄销库数量 \n" +
" FROM\n" + " FROM\n" +
" Set_BT_Car_Platform A\n" + " Set_BT_Car_Platform A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" \n" +
" WHERE\n" + " WHERE\n" +
" a.Version= '{0}' \n" + " a.Version= '{0}' \n" +
" AND a.StorageLocationDesc LIKE '%备品%'\n" + " AND a.StorageLocationDesc LIKE '%备品%' \n" +
" ) temp1\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 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.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\n" + " C.MaterialCode Sap编码,\n" +
" C.MaterialDesc 物料描述,\n" + " C.MaterialDesc 物料描述,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" CONVERT ( VARCHAR ( 100 ), A.AcceptanceDate, 23 ) 验收单日期,\n" +
" 0 寄销库数量 \n" + " 0 寄销库数量 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
@ -326,7 +334,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" MaterialCode,\n" + " MaterialCode,\n" +
" StorageLocation,\n" + " StorageLocation,\n" +
" StorageLocationDesc,\n" + " StorageLocationDesc,\n" +
" Version \n" + " Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" FROM\n" + " FROM\n" +
" Set_BT_Car_Platform \n" + " Set_BT_Car_Platform \n" +
" WHERE\n" + " WHERE\n" +
@ -336,7 +346,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" MaterialCode,\n" + " MaterialCode,\n" +
" StorageLocation,\n" + " StorageLocation,\n" +
" StorageLocationDesc,\n" + " StorageLocationDesc,\n" +
" Version \n" + " Version,\n" +
" AcceptanceNo,\n" +
" AcceptanceDate \n" +
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
@ -379,7 +391,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public HQCarSettledDetailDiff(string sapMaterialCode, string materialCode, string materialDesc, decimal price, public HQCarSettledDetailDiff(string sapMaterialCode, string materialCode, string materialDesc, decimal price,
string storageLocation, string storageLocationDesc, decimal selprice, decimal diffprice, decimal sumprice, decimal settleprice, decimal qty, 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; SAP编码 = sapMaterialCode;
= materialDesc; = materialDesc;
@ -394,55 +406,53 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
= qty; = qty;
= settleprice; = settleprice;
= metarialGroup; = metarialGroup;
= acceptanceNo;
= acceptanceDate;
} }
[ExporterHeader(DisplayName = "交货日期",IsIgnore = true)]
[ExporterHeader(DisplayName = "交货日期")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "手工或自动")] [ExporterHeader(DisplayName = "手工或自动", IsIgnore = true)]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "交货单号")] [ExporterHeader(DisplayName = "交货单号", IsIgnore = true)]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")] [ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")] [ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "订货看板号")]
public string { set; get; } [ExporterHeader(DisplayName = "Sap编码")]
public string SAP编码 { set; get; }
[ExporterHeader(DisplayName = "结算物料号")] [ExporterHeader(DisplayName = "结算物料号")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "订货零件号")]
public string { set; get; }
[ExporterHeader(DisplayName = "SAP编码")]
public string SAP编码 { set; get; }
[ExporterHeader(DisplayName = "物料组")] [ExporterHeader(DisplayName = "物料组")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "物料描述")] [ExporterHeader(DisplayName = "物料描述")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; } [ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "定价")] [ExporterHeader(DisplayName = "定价")]
public decimal { set; get; } 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 = "结算单价")] [ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")] [ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "数量差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "价格差异")] [ExporterHeader(DisplayName = "价格差异")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")] [ExporterHeader(DisplayName = "差异总金额")]

206
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="end"></param>
/// <param name="materialGroup"></param> /// <param name="materialGroup"></param>
/// <returns></returns> /// <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 = " "; string condition = " ";
@ -842,7 +842,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" temp1.订货零件号,\n" + " temp1.订货零件号,\n" +
" temp1.Sap编码,\n" + " temp1.Sap编码,\n" +
" temp1.[客户物料号],\n" + " temp1.[客户物料号],\n" +
" temp1.发货零件号,\n" +
" temp1.物料组,\n" + " temp1.物料组,\n" +
" temp1.零件中文名称,\n" + " temp1.零件中文名称,\n" +
" temp1.发货数量,\n" + " temp1.发货数量,\n" +
@ -855,7 +854,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" + " isnull( temp1.发货数量, 0 ) * isnull( TEMP2.Price, 0 ) AS 发货总金额,\n" +
" 0 AS 数量差异,\n" + " 0 AS 数量差异,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" + " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异,\n" +
" ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" + " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.发货数量 AS 差异总金额 \n" +
"FROM\n" + "FROM\n" +
" (\n" + " (\n" +
" SELECT\n" + " SELECT\n" +
@ -868,7 +867,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" b.MaterialCode AS 订货零件号,\n" + " b.MaterialCode AS 订货零件号,\n" +
" c.MaterialCode Sap编码,\n" + " c.MaterialCode Sap编码,\n" +
" c.CustomerPartCode 客户物料号,\n" + " c.CustomerPartCode 客户物料号,\n" +
" '' AS 发货零件号,\n" +
" c.MaterialDesc AS 零件中文名称,\n" + " c.MaterialDesc AS 零件中文名称,\n" +
" isnull( a.Qty, 0 ) AS 发货数量,\n" + " isnull( a.Qty, 0 ) AS 发货数量,\n" +
" isnull( a.State, 0 ) AS 发货状态,\n" + " isnull( a.State, 0 ) AS 发货状态,\n" +
@ -884,12 +882,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT OUTER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" WHERE\n" + " WHERE\n" +
" b.HQHKanBan IS NULL \n" + " b.HQHKanBan IS NULL \n" +
" AND b.MaterialCode IS NULL {0} \n" + " AND b.MaterialCode IS NULL {0}\n" +
" ) AS temp1\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"; " 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 _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(); _list = _query.ToList();
return _list; return _list;
@ -1061,9 +1059,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
// condition += string.Format(" and a.LastModificationTime<='{0}' ", end); // condition += string.Format(" and a.LastModificationTime<='{0}' ", end);
//} //}
string str = "SELECT\n" + string str = "SELECT\n" +
" temp1.*,\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 ) ) 价格差异,\n" +
" ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" + " ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
"FROM\n" + "FROM\n" +
@ -1075,20 +1074,27 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" A.MaterialCode 结算物料号,\n" + " A.MaterialCode 结算物料号,\n" +
" A.StorageLocation 收货仓库,\n" + " A.StorageLocation 收货仓库,\n" +
" A.StorageLocationDesc 收货仓库描述,\n" + " A.StorageLocationDesc 收货仓库描述,\n" +
" a.[AcceptanceNo] AS 结算验收单号,\n" +
" C.EstimateTypeDesc 物料组,\n" + " C.EstimateTypeDesc 物料组,\n" +
" C.MaterialCode Sap编码,\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" + " 0 寄销库数量 \n" +
" FROM\n" + " FROM\n" +
" (\n" + " (\n" +
" SELECT\n" + " SELECT SUM\n" +
" Price,\n" + " ( Qty ) AS Qty,\n" +
" SUM ( Qty ) Qty,\n" +
" MaterialCode,\n" + " MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" + " StorageLocation,\n" +
" StorageLocationDesc,\n" + " StorageLocationDesc,\n" +
" AcceptanceNo \n" + " Factory,\n" +
" AcceptanceNo,\n" +
" Price,\n" +
" HQHKanBan,\n" +
" CONVERT ( VARCHAR ( 100 ), AcceptanceDate, 23 ) AcceptanceDate \n" +
" FROM\n" + " FROM\n" +
" Set_HQ_H_Platform \n" + " Set_HQ_H_Platform \n" +
" WHERE\n" + " WHERE\n" +
@ -1096,14 +1102,63 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" AND HQHKanBan = 'BJ' \n" + " AND HQHKanBan = 'BJ' \n" +
" GROUP BY\n" + " GROUP BY\n" +
" MaterialCode,\n" + " MaterialCode,\n" +
" Version,\n" +
" StorageLocation,\n" + " StorageLocation,\n" +
" StorageLocationDesc,\n" + " StorageLocationDesc,\n" +
" price,\n" + " Factory,\n" +
" AcceptanceNo \n" + " AcceptanceNo,\n" +
" Price,\n" +
" HQHKanBan,\n" +
" AcceptanceDate \n" +
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\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"; " 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, condition);
var _sql = string.Format(str, version); var _sql = string.Format(str, version);
@ -1142,7 +1197,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
string str = "SELECT\n" + string str = "SELECT\n" +
" temp1.*,\n" + " temp1.*,\n" +
" isnull( temp2.Price, 0 ) 销售单价,\n" + " isnull( temp2.Price, 0 ) 发货定价,\n" +
" isnull( temp3.Price, 0 ) 结算单价,\n" + " isnull( temp3.Price, 0 ) 结算单价,\n" +
" ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" + " ( isnull( temp3.Price, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异,\n" +
" (temp3.Price * temp1.结算数量) 结算金额,\n" + " (temp3.Price * temp1.结算数量) 结算金额,\n" +
@ -1219,52 +1274,72 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
decimal sockQty) decimal sockQty)
{ {
Sap编码 = sapMaterialCode; Sap编码 = sapMaterialCode;
= materialDesc; = materialDesc;
= materialCode; = materialCode;
= sockQty; = sockQty;
= price; = price;
= storageLocation; = storageLocation;
= storageLocationDesc; = storageLocationDesc;
= selprice; = selprice;
= diffprice; = diffprice;
= sumprice; = sumprice;
= qty; = qty;
= settleprice; = settleprice;
} }
[ExporterHeader(DisplayName = "工厂")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")] [ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")] [ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "结算物料号")] [ExporterHeader(DisplayName = "结算物料号")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "结算物料描述")] [ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; } 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 = "结算数量")] [ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")] [ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "销售单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")] [ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; } [ExporterHeader(DisplayName = "价格差异")]
[ExporterHeader(DisplayName = "物料组(车型)")] public decimal { set; get; }
public string { set; get; }
[ExporterHeader(DisplayName = "差异总金额")] [ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "价格差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "寄销库数量")] [ExporterHeader(DisplayName = "寄销库数量")]
public decimal { set; get; } public decimal { set; get; }
} }
public class HQHSettledDetailDiff public class HQHSettledDetailDiff
{ {
@ -1288,12 +1363,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")] [ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; } public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "客户物料号")] [ExporterHeader(DisplayName = "客户物料号")]
public string { set; get; } public string { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货数量")] [ExporterHeader(DisplayName = "发货数量")]
public decimal { set; get; } public decimal { set; get; }
[ExporterHeader(DisplayName = "发货状态")] [ExporterHeader(DisplayName = "发货状态")]
@ -1333,6 +1409,72 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "验收单日期")] [ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; } 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 class HQHSettleQtyDiff
{ {
public string { set; get; } 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.,
itm., itm.,
tm1 == null ? 0 : tm1.Qty, tm1 == null ? 0 : tm1.Qty,
itm. itm.,
itm.,
itm.
); );
@ -108,7 +110,9 @@ namespace SettleAccount.Job.Services.Report
itm., itm.,
itm., itm.,
tm1 == null ? 0 : tm1.Qty, tm1 == null ? 0 : tm1.Qty,
itm. itm.,
itm.,
itm.
); );
//if (!string.IsNullOrEmpty(kanban)) //if (!string.IsNullOrEmpty(kanban))
@ -138,14 +142,16 @@ namespace SettleAccount.Job.Services.Report
_ls = _ls.Where(p => _groupList.Contains(p.)).ToList(); _ls = _ls.Where(p => _groupList.Contains(p.)).ToList();
} }
} }
//if (!string.IsNullOrEmpty(materialCode))
//{ if (!string.IsNullOrEmpty(materialCode))
// var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); {
// if (_groupList.Count() > 0) 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)) if (!string.IsNullOrEmpty(sapCode))
{ {
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); 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( select new HQHSharePartSettledDetailDiff(
itm.Sap编码, itm.Sap编码,
itm., itm.,
itm., itm.,
itm., itm.,
itm., itm.,
itm., itm.,
itm., itm.,
itm., itm.,
itm., itm.,
itm., itm.,

Loading…
Cancel
Save