PSI.DAL/StoreGoodsStockDAL.cs
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using PSI.Common;
using PSI.DbUtility;
using PSI.Models.DModels;
using PSI.Models.UIModels;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSI.DAL
{
public class StoreGoodsStockDAL : BQuery<StoreGoodsStockInfoModel>
{
/// <summary>
/// 获取指定商品没有添加库存记录的仓库编号集合
/// </summary>
/// <param name="goodsId"></param>
/// <returns></returns>
public List<int> GetHasNoStockStoreIds(int goodsId)
{
string sql = $"select StoreId from StoreInfos where IsDeleted=0 and StoreId not in (select StoreId from StoreGoodsStockInfos where goodsId = {goodsId} and storeid> 0)";
DataTable dt = SqlHelper.GetDataTable(sql, 1);
List<int> reStoreIds = new List<int>();
foreach (DataRow dr in dt.Rows)
{
int storeId = dr["StoreId"].ToString().GetInt();
reStoreIds.Add(storeId);
}
return reStoreIds;
}
/// <summary>
/// 指定仓库没有添加库存记录的商品编号集合
/// </summary>
/// <param name="storeId"></param>
/// <returns></returns>
public List<int> GetHasNoStockGoodsIds(int storeId)
{
string sql = $"select GoodsId from GoodsInfos where IsDeleted=0 and GoodsId not in (select GoodsId from StoreGoodsStockInfos where StoreId = {storeId} )";
DataTable dt = SqlHelper.GetDataTable(sql, 1);
List<int> reGoodsds = new List<int>();
foreach (DataRow dr in dt.Rows)
{
int goodsId = dr["GoodsId"].ToString().GetInt();
reGoodsds.Add(goodsId);
}
return reGoodsds;
}
/// <summary>
/// 获取指定商品列表在指定仓库中的当前库存量
/// </summary>
/// <param name="goodsIds"></param>
/// <param name="storeId"></param>
/// <returns></returns>
public List<StoreGoodsStockInfoModel> GetGoodsCurCountList(List<int> goodsIds, int storeId)
{
后面还有 134 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。