diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index 82bdc4fe..4601266d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -472,9 +472,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial( GuidGenerator.Create(), - itm.WmsBillNum, - itm.OrderBillNum, - + //itm.WmsBillNum, + //itm.OrderBillNum, + string.Empty, + string.Empty, itm.MaterialCode, itm.MaterialDesc, itm.MaterialGroup, diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs index e855f508..bcca16c2 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs @@ -151,6 +151,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS itm.Remark, itm.Qty, tm1 == null ? 0 : tm1.Qty, + itm.OutPutQty, itm.IsSparePart, itm.Price, itm.Amt @@ -207,7 +208,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS var _lsAry = _list.Select(p => new WmsHQCarOutPutDetial( GuidGenerator.Create(), - "", + string.Empty, string.Empty, p.MaterialCode, p.MaterialDesc, @@ -224,7 +225,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS string.Empty, p.Qty, p.StockQty - ,p.IsSparePart + ,p.Qty + , p.IsSparePart ,p.Price ,p.Amt )); @@ -392,8 +394,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS { WmsHQCarOutPutDetial _detail = new WmsHQCarOutPutDetial( GuidGenerator.Create(), - itm.WmsBillNum, - itm.OrderBillNum, + string.Empty, + string.Empty, itm.MaterialCode, itm.MaterialDesc, itm.MaterialGroup, @@ -409,6 +411,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS , string.Empty , itm.Qty , 0 + ,itm.Qty ,itm.IsSparePart ,itm.Price ,itm.Amt diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs index 3aee9aef..0a23290e 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -802,7 +802,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } public WmsHQCarOutPutDetial(Guid id, string wmsBillNum, string orderBillNum, string materialCode, string materialDesc, string materialGroup, string outPut, string inPut, int state, string extend1, string extend2, - string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty,string issparepart,decimal price,decimal amt) + string extend3, string parentMaterialCode, string billNum, Guid taskId, string remark, decimal qty, decimal stockQty, decimal outputQty, string issparepart,decimal price,decimal amt) { Id = id; WmsBillNum = wmsBillNum; @@ -822,6 +822,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS Remark = remark; Qty = qty; StockQty = stockQty; + OutPutQty = outputQty; IsSparePart = issparepart; Price = price; Amt = amt; @@ -838,6 +839,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS [ImporterHeader(Name = "寄销库数量", IsIgnore = true)] public decimal StockQty { set; get; } + [ImporterHeader(Name = "出库数量", IsIgnore = true)] + public decimal OutPutQty { set; get; } + [ImporterHeader(Name = "组件组物料", IsIgnore = true)] public string ParentMaterialCode { set; get; } [ImporterHeader(Name = "交货单号", IsIgnore = true)] diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs index d9af1e53..766f9da4 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs @@ -67,61 +67,116 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } string str = "SELECT\n" + - " temp1.*,\n" + - " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + - " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 -- isnull( temp2.Price, 0 ) 销售单价,\n" + - "-- ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异\n" + - " \n" + - "FROM\n" + - " (\n" + - " SELECT NULL AS\n" + - " 交货日期,\n" + - " '手工看板' AS 手工或自动,\n" + - " '' 交货单号,\n" + - " A.StorageLocation 收货仓库,\n" + - " A.StorageLocationDesc 收货仓库描述,\n" + - " A.AcceptanceNo 订货看板号,\n" + - " '' 订货零件号,\n" + - " C.MaterialCode AS SAP编码,\n" + - " '' 发货零件号,\n" + - " C.EstimateTypeDesc 物料组,\n" + - " C.MaterialDesc 物料描述,\n" + - " 0 AS 发货数量,\n" + - " 0 发货总金额,\n" + - " '' 发货状态,\n" + - " '' 结算验收单,\n" + - " '' 结算零件号,\n" + - " isnull(A.Qty,0) AS 结算数量,\n" + - " isnull(A.Price,0) AS 结算单价,\n" + - " isnull(A.Amt,0) AS 结算金额,\n" + - "--A.MaterialCode 物料号,\n" + - " 0 寄销库数量 \n" + - " FROM\n" + - " (\n" + - " SELECT\n" + - " Price,\n" + - " SUM ( Qty ) Qty,\n" + - " MaterialCode,\n" + - " StorageLocation,\n" + - " StorageLocationDesc,\n" + - " AcceptanceNo,\n" + - " Amt \n" + - " FROM\n" + - " Set_BT_Car_Platform \n" + - " WHERE\n" + - " version = '{0}' \n" + - " GROUP BY\n" + - " MaterialCode,\n" + - " StorageLocation,\n" + - " StorageLocationDesc,\n" + - " price,\n" + - " AcceptanceNo,\n" + - " Amt \n" + - " ) A\n" + - " INNER 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"; - ; + " temp1.交货日期,\n" + + " temp1.手工或自动,\n" + + " '' 订单日期,\n" + + " temp1.[收货仓库],\n" + + " temp1.[收货仓库描述],\n" + + " temp1.[订货看板号],\n" + + " temp1.[订货零件号],\n" + + " temp1.[SAP编码],\n" + + " temp1.[发货零件号],\n" + + " temp1.[物料组],\n" + + " temp1.[物料描述],\n" + + " temp1.[发货数量],\n" + + " ISNULL( TEMP2.Price, 0 ) AS 发货定价,\n" + + " temp1.[发货总金额],\n" + + " temp1.[发货状态],\n" + + " temp1.[结算验收单],\n" + + " temp1.[结算零件号],\n" + + " temp1.[结算数量],\n" + + " temp1.[结算单价],\n" + + " temp1.[结算金额],\n" + + " temp1.[发货数量] - temp1.[结算数量] AS 数量差异,\n" + + " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" + + "FROM\n" + + " (\n" + + " SELECT NULL AS\n" + + " 交货日期,\n" + + " '' AS 手工或自动,\n" + + " '' 交货单号,\n" + + " '' 收货仓库,\n" + + " '' 收货仓库描述,\n" + + " '' 订货看板号,\n" + + " '' 订货零件号,\n" + + " C.MaterialCode AS SAP编码,\n" + + " '' 发货零件号,\n" + + " C.EstimateTypeDesc 物料组,\n" + + " C.MaterialDesc 物料描述,\n" + + " 0 AS 发货数量,\n" + + " 0 发货总金额,\n" + + " '' 发货状态,\n" + + " '' 结算验收单,\n" + + " '' 结算零件号,\n" + + " isnull( A.Qty, 0 ) AS 结算数量,\n" + + " isnull( A.Price, 0 ) AS 结算单价,\n" + + " isnull( A.Price, 0 ) * isnull( A.Qty, 0 ) AS 结算金额,\n" + + " 0 寄销库数量 \n" + + " FROM\n" + + " ( SELECT Price, SUM ( Qty ) Qty, MaterialCode, Version FROM Set_BT_Car_Platform GROUP BY MaterialCode, price, Version ) A\n" + + " INNER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + + " WHERE\n" + + " A.Version= '{0}' \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" + + // " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + + // " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 -- isnull( temp2.Price, 0 ) 销售单价,\n" + + // "-- ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异\n" + + // " \n" + + // "FROM\n" + + // " (\n" + + // " SELECT NULL AS\n" + + // " 交货日期,\n" + + // " '手工看板' AS 手工或自动,\n" + + // " '' 交货单号,\n" + + // " A.StorageLocation 收货仓库,\n" + + // " A.StorageLocationDesc 收货仓库描述,\n" + + // " A.AcceptanceNo 订货看板号,\n" + + // " '' 订货零件号,\n" + + // " C.MaterialCode AS SAP编码,\n" + + // " '' 发货零件号,\n" + + // " C.EstimateTypeDesc 物料组,\n" + + // " C.MaterialDesc 物料描述,\n" + + // " 0 AS 发货数量,\n" + + // " 0 发货总金额,\n" + + // " '' 发货状态,\n" + + // " '' 结算验收单,\n" + + // " '' 结算零件号,\n" + + // " isnull(A.Qty,0) AS 结算数量,\n" + + // " isnull(A.Price,0) AS 结算单价,\n" + + // " isnull(A.Amt,0) AS 结算金额,\n" + + // "--A.MaterialCode 物料号,\n" + + // " 0 寄销库数量 \n" + + // " FROM\n" + + // " (\n" + + // " SELECT\n" + + // " Price,\n" + + // " SUM ( Qty ) Qty,\n" + + // " MaterialCode,\n" + + // " StorageLocation,\n" + + // " StorageLocationDesc,\n" + + // " AcceptanceNo,\n" + + // " Amt \n" + + // " FROM\n" + + // " Set_BT_Car_Platform \n" + + // " WHERE\n" + + // " version = '{0}' \n" + + // " GROUP BY\n" + + // " MaterialCode,\n" + + // " StorageLocation,\n" + + // " StorageLocationDesc,\n" + + // " price,\n" + + // " AcceptanceNo,\n" + + // " Amt \n" + + // " ) A\n" + + // " INNER 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(_sql, null, null, true, 1200, null); @@ -226,6 +281,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 物料描述 { set; get; } [ExporterHeader(DisplayName = "发货数量")] public decimal 发货数量 { set; get; } + [ExporterHeader(DisplayName = "发货定价")] + public decimal 发货定价 { set; get; } [ExporterHeader(DisplayName = "发货总金额")] public decimal 发货总金额 { set; get; } [ExporterHeader(DisplayName = "发货状态")] @@ -240,12 +297,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report 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; } }