This commit is contained in:
2025-11-06 18:12:17 +08:00
parent 92a7c811ef
commit ce9868a655
12 changed files with 291 additions and 203 deletions

View File

@@ -19,68 +19,107 @@ namespace MyCode.Project.Repositories
{ }
// SELECT
// -- 分组字段
// CONVERT(date, InOutDate2) AS 出入库日期,
// WarehouseCode AS 仓库编码,
// WarehouseName AS 仓库名称,
// GoodsNo AS 商品编码,
// GoodsName AS 商品名称,
// SkuName AS 规格,
// UnitName AS 单位,
// -- 合计数据
// SUM(Quantity) AS 总数量,
// SUM(BaceCurrencyCostAmount) AS 总入库金额,
// SUM(BaceCurrencyNoTaxAmount) AS 总本币无税金额,
// SUM(BaceCurrencyWithTaxAmount) AS 总本币含税金额,
// SUM(BaceCurrencyTaxAmount) AS 总本币税额,
// SUM(TransNoTaxAmount) AS 总原币无税金额,
// SUM(TransHasTaxAmount) AS 总原币含税金额,
// SUM(TransTaxAmount) AS 总原币税额,
// -- 计数统计
// COUNT(DISTINCT GoodsdocNo) AS 入库单数,
// COUNT(*) AS 明细行数
// SELECT
// -- 分组字段
// CONVERT(date, InOutDate2) AS 出入库日期,
// WarehouseCode AS 仓库编码,
// WarehouseName AS 仓库名称,
// GoodsNo AS 商品编码,
// GoodsName AS 商品名称,
// SkuName AS 规格,
// UnitName AS 单位,
// -- 合计数据
// SUM(Quantity) AS 总数量,
// SUM(BaceCurrencyCostAmount) AS 总入库金额,
// SUM(BaceCurrencyNoTaxAmount) AS 总本币无税金额,
// SUM(BaceCurrencyWithTaxAmount) AS 总本币含税金额,
// SUM(BaceCurrencyTaxAmount) AS 总本币税额,
// SUM(TransNoTaxAmount) AS 总原币无税金额,
// SUM(TransHasTaxAmount) AS 总原币含税金额,
// SUM(TransTaxAmount) AS 总原币税额,
// -- 计数统计
// COUNT(DISTINCT GoodsdocNo) AS 入库单数,
// COUNT(*) AS 明细行数
//FROM[dbo].[BusiOrderGoodsDocIn]
// WHERE Status IN(0) -- 根据业务需求调整状态筛选
// GROUP BY
// CONVERT(date, InOutDate2),
// WarehouseCode,
// WarehouseName,
// GoodsNo,
// GoodsName,
// SkuName,
// UnitName
//ORDER BY
// CONVERT(date, InOutDate2) DESC,
// WarehouseCode,
// GoodsNo;
//FROM[dbo].[BusiOrderGoodsDocIn]
// WHERE Status IN(0) -- 根据业务需求调整状态筛选
// GROUP BY
// CONVERT(date, InOutDate2),
// WarehouseCode,
// WarehouseName,
// GoodsNo,
// GoodsName,
// SkuName,
// UnitName
//ORDER BY
// CONVERT(date, InOutDate2) DESC,
// WarehouseCode,
// GoodsNo;
#region GetPushOrder()
#region GetPushGoodsDocInOrder()
/// <summary>
/// 获取合并后的吉客云订单
/// 获取合并后的吉客云采购入库单订单
/// </summary>
/// <returns></returns>
public List<PushOrderListResp> GetPushReturnOrder()
public List<BusiOrderGoodsDocInSummary> GetPushGoodsDocInOrder()
{
string sql = $@"
SELECT [shopCode], [shopName], [shopId], [warehouseName], [warehouseCode],
[status], CONVERT(NVARCHAR(30),[consignTime],23) [consignTime],
[goodsNo], [goodsId],SUM([sellTotal]*-1) [sellTotal],
SUM([returnCount]*-1) [sellCount], SUM([ShareShouldReturnFee]*-1) AS [divideSellTotal],
[barcode], [TradeType] ,[warehouseId],Unit
FROM [JackOrders] a WITH (NOLOCK)
LEFT JOIN [dbo].[ReturnChangeGoodsDetail] b WITH (NOLOCK)
ON a.id = b.JackOrdersId
WHERE a.status = 0 and [TradeType]=8 and returnCount <> 0
GROUP BY [shopCode],[shopName], [shopId], [warehouseName], [warehouseCode], [status], CONVERT(NVARCHAR(30),[consignTime],23) ,[goodsNo],
[goodsId], [barcode] ,[warehouseId], [TradeType],Unit
ORDER BY [shopCode],[consignTime] desc,[TradeType]
";
var list = this.SelectList<PushOrderListResp>(sql);
SELECT
-- 分组字段
CONVERT(date, InOutDate2) AS InOutDate2,
WarehouseCode AS WarehouseCode,
WarehouseName AS WarehouseName,
GoodsNo AS GoodsNo,
GoodsName AS GoodsName,
SkuName AS SkuName,
UnitName AS UnitName,
SkuBarcode AS SkuBarcode,
[CurrencyCode]
,[CurrencyCodeName]
,[CurrencyRate]
,[CreateUserName]
,[CompanyName],VendCustomerName,VendCode ,[ApplyCompanyName],
[TaxRate]
,[TransNoTaxPrice]
,[TransHasTaxPrice],
-- 合计数据
SUM(Quantity) AS Quantity ,-- 总数量,
SUM(BaceCurrencyCostAmount) AS BaceCurrencyCostAmount,--总入库金额,
SUM(BaceCurrencyNoTaxAmount) AS BaceCurrencyNoTaxAmount,--总本币无税金额,
SUM(BaceCurrencyWithTaxAmount) AS BaceCurrencyWithTaxAmount,--总本币含税金额,
SUM(BaceCurrencyTaxAmount) AS BaceCurrencyTaxAmount,-- 总本币税额,
SUM(TransNoTaxAmount) AS TransNoTaxAmount,--总原币无税金额,
SUM(TransHasTaxAmount) AS TransHasTaxAmount,--总原币含税金额,
SUM(TransTaxAmount) AS TransTaxAmount,--总原币税额,
-- 计数统计
COUNT(DISTINCT GoodsdocNo) AS 入库单数,
COUNT(*) AS 明细行数
FROM [dbo].[BusiOrderGoodsDocIn]
WHERE Status IN (0) -- 根据业务需求调整状态筛选
GROUP BY
CONVERT(DATE, InOutDate2),
WarehouseCode,
WarehouseName,
GoodsNo,
GoodsName,
SkuName,
UnitName,SkuBarcode ,[CurrencyCode]
,[CurrencyCodeName]
,[CurrencyRate]
,[CreateUserName]
,[CompanyName],CompanyName,VendCustomerName,VendCode ,[ApplyCompanyName], [TaxRate]
,[TransNoTaxPrice]
,[TransHasTaxPrice]
ORDER BY
CONVERT(date, InOutDate2) DESC,
WarehouseCode,
GoodsNo;";
var list = this.SelectList<BusiOrderGoodsDocInSummary>(sql);
return list;
}
#endregion