Administrator 3 years ago
parent
commit
1c0c374edf
  1. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  2. 11
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs
  3. 6
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  4. 173
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQCarSettledDetailDapperRepository.cs

7
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -472,9 +472,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{ {
WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial( WmsSharePartOutPutDetial _detail = new WmsSharePartOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
itm.WmsBillNum, //itm.WmsBillNum,
itm.OrderBillNum, //itm.OrderBillNum,
string.Empty,
string.Empty,
itm.MaterialCode, itm.MaterialCode,
itm.MaterialDesc, itm.MaterialDesc,
itm.MaterialGroup, itm.MaterialGroup,

11
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs

@ -151,6 +151,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
itm.Remark, itm.Remark,
itm.Qty, itm.Qty,
tm1 == null ? 0 : tm1.Qty, tm1 == null ? 0 : tm1.Qty,
itm.OutPutQty,
itm.IsSparePart, itm.IsSparePart,
itm.Price, itm.Price,
itm.Amt itm.Amt
@ -207,7 +208,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var _lsAry = _list.Select(p => new var _lsAry = _list.Select(p => new
WmsHQCarOutPutDetial( WmsHQCarOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
"", string.Empty,
string.Empty, string.Empty,
p.MaterialCode, p.MaterialCode,
p.MaterialDesc, p.MaterialDesc,
@ -224,7 +225,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
p.Qty, p.Qty,
p.StockQty p.StockQty
,p.IsSparePart ,p.Qty
, p.IsSparePart
,p.Price ,p.Price
,p.Amt ,p.Amt
)); ));
@ -392,8 +394,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{ {
WmsHQCarOutPutDetial _detail = new WmsHQCarOutPutDetial( WmsHQCarOutPutDetial _detail = new WmsHQCarOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
itm.WmsBillNum, string.Empty,
itm.OrderBillNum, string.Empty,
itm.MaterialCode, itm.MaterialCode,
itm.MaterialDesc, itm.MaterialDesc,
itm.MaterialGroup, itm.MaterialGroup,
@ -409,6 +411,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
, string.Empty , string.Empty
, itm.Qty , itm.Qty
, 0 , 0
,itm.Qty
,itm.IsSparePart ,itm.IsSparePart
,itm.Price ,itm.Price
,itm.Amt ,itm.Amt

6
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, 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 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; Id = id;
WmsBillNum = wmsBillNum; WmsBillNum = wmsBillNum;
@ -822,6 +822,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
Remark = remark; Remark = remark;
Qty = qty; Qty = qty;
StockQty = stockQty; StockQty = stockQty;
OutPutQty = outputQty;
IsSparePart = issparepart; IsSparePart = issparepart;
Price = price; Price = price;
Amt = amt; Amt = amt;
@ -838,6 +839,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[ImporterHeader(Name = "寄销库数量", IsIgnore = true)] [ImporterHeader(Name = "寄销库数量", IsIgnore = true)]
public decimal StockQty { set; get; } public decimal StockQty { set; get; }
[ImporterHeader(Name = "出库数量", IsIgnore = true)]
public decimal OutPutQty { set; get; }
[ImporterHeader(Name = "组件组物料", IsIgnore = true)] [ImporterHeader(Name = "组件组物料", IsIgnore = true)]
public string ParentMaterialCode { set; get; } public string ParentMaterialCode { set; get; }
[ImporterHeader(Name = "交货单号", IsIgnore = true)] [ImporterHeader(Name = "交货单号", IsIgnore = true)]

173
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" + string str = "SELECT\n" +
" temp1.*,\n" + " temp1.交货日期,\n" +
" temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" + " temp1.手工或自动,\n" +
" ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 -- isnull( temp2.Price, 0 ) 销售单价,\n" + " '' 订单日期,\n" +
"-- ( isnull( temp1.结算单价, 0 ) - isnull( temp2.Price, 0 ) ) 价格差异\n" + " temp1.[收货仓库],\n" +
" \n" + " temp1.[收货仓库描述],\n" +
"FROM\n" + " temp1.[订货看板号],\n" +
" (\n" + " temp1.[订货零件号],\n" +
" SELECT NULL AS\n" + " temp1.[SAP编码],\n" +
" 交货日期,\n" + " temp1.[发货零件号],\n" +
" '手工看板' AS 手工或自动,\n" + " temp1.[物料组],\n" +
" '' 交货单号,\n" + " temp1.[物料描述],\n" +
" A.StorageLocation 收货仓库,\n" + " temp1.[发货数量],\n" +
" A.StorageLocationDesc 收货仓库描述,\n" + " ISNULL( TEMP2.Price, 0 ) AS 发货定价,\n" +
" A.AcceptanceNo 订货看板号,\n" + " temp1.[发货总金额],\n" +
" '' 订货零件号,\n" + " temp1.[发货状态],\n" +
" C.MaterialCode AS SAP编码,\n" + " temp1.[结算验收单],\n" +
" '' 发货零件号,\n" + " temp1.[结算零件号],\n" +
" C.EstimateTypeDesc 物料组,\n" + " temp1.[结算数量],\n" +
" C.MaterialDesc 物料描述,\n" + " temp1.[结算单价],\n" +
" 0 AS 发货数量,\n" + " temp1.[结算金额],\n" +
" 0 发货总金额,\n" + " temp1.[发货数量] - temp1.[结算数量] AS 数量差异,\n" +
" '' 发货状态,\n" + " temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) AS 单价差异 ,\n" +
" '' 结算验收单,\n" + " ( temp1.结算单价 - ISNULL( TEMP2.Price, 0 ) ) * temp1.结算数量 AS 差异总金额 \n" +
" '' 结算零件号,\n" + "FROM\n" +
" isnull(A.Qty,0) AS 结算数量,\n" + " (\n" +
" isnull(A.Price,0) AS 结算单价,\n" + " SELECT NULL AS\n" +
" isnull(A.Amt,0) AS 结算金额,\n" + " 交货日期,\n" +
"--A.MaterialCode 物料号,\n" + " '' AS 手工或自动,\n" +
" 0 寄销库数量 \n" + " '' 交货单号,\n" +
" FROM\n" + " '' 收货仓库,\n" +
" (\n" + " '' 收货仓库描述,\n" +
" SELECT\n" + " '' 订货看板号,\n" +
" Price,\n" + " '' 订货零件号,\n" +
" SUM ( Qty ) Qty,\n" + " C.MaterialCode AS SAP编码,\n" +
" MaterialCode,\n" + " '' 发货零件号,\n" +
" StorageLocation,\n" + " C.EstimateTypeDesc 物料组,\n" +
" StorageLocationDesc,\n" + " C.MaterialDesc 物料描述,\n" +
" AcceptanceNo,\n" + " 0 AS 发货数量,\n" +
" Amt \n" + " 0 发货总金额,\n" +
" FROM\n" + " '' 发货状态,\n" +
" Set_BT_Car_Platform \n" + " '' 结算验收单,\n" +
" WHERE\n" + " '' 结算零件号,\n" +
" version = '{0}' \n" + " isnull( A.Qty, 0 ) AS 结算数量,\n" +
" GROUP BY\n" + " isnull( A.Price, 0 ) AS 结算单价,\n" +
" MaterialCode,\n" + " isnull( A.Price, 0 ) * isnull( A.Qty, 0 ) AS 结算金额,\n" +
" StorageLocation,\n" + " 0 寄销库数量 \n" +
" StorageLocationDesc,\n" + " FROM\n" +
" price,\n" + " ( SELECT Price, SUM ( Qty ) Qty, MaterialCode, Version FROM Set_BT_Car_Platform GROUP BY MaterialCode, price, Version ) A\n" +
" AcceptanceNo,\n" + " INNER JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" Amt \n" + " WHERE\n" +
" ) A\n" + " A.Version= '{0}' \n" +
" INNER 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" +
// " 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 _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQCarSettledDetailDiff>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<HQCarSettledDetailDiff>(_sql, null, null, true, 1200, null);
@ -226,6 +281,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string { 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; }
[ExporterHeader(DisplayName = "发货状态")] [ExporterHeader(DisplayName = "发货状态")]
@ -240,12 +297,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public decimal { set; get; } 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 = "单价差异")] [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; }
} }

Loading…
Cancel
Save