|
|
using Dapper;
|
|
|
using Estsh.Core.Dapper;
|
|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Models;
|
|
|
using Estsh.Core.Repository.IRepositories;
|
|
|
using System.Collections;
|
|
|
using System.Data;
|
|
|
using System.Text;
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:盘点单生产
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Repositories
|
|
|
{
|
|
|
|
|
|
public class CheckOrderCreateRepository : BaseRepository<GCheckOrderMain>, ICheckOrderCreateRepository
|
|
|
{
|
|
|
public CheckOrderCreateRepository(DapperDbContext _dapperDbContext) : base(_dapperDbContext)
|
|
|
{
|
|
|
}
|
|
|
#region 成员方法
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取分页数据列表
|
|
|
/// </summary>
|
|
|
public Hashtable getListByPage(string cbChkCommand)
|
|
|
{
|
|
|
using (IDbConnection dbConn = dapperDbContext.GetDbConnection())
|
|
|
{
|
|
|
dbConn.Open();
|
|
|
Hashtable result = new Hashtable();
|
|
|
//string SqlString = "sys_check_sapcommand @check_order";
|
|
|
DynamicParameters Params = new DynamicParameters();
|
|
|
Params.Add("@orderNo", cbChkCommand);
|
|
|
List<SysStock> depts = dbConn.Query<SysStock>("sys_check_sapcommand", Params, commandType: CommandType.StoredProcedure).ToList();
|
|
|
result.Add("dataList", depts);
|
|
|
result.Add("totalCount", depts.Count);
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
///盘点单集合
|
|
|
/// </summary>
|
|
|
/// <returns>数据集</returns>
|
|
|
public List<KeyValueResult> GetChkCommandList()
|
|
|
{
|
|
|
using (IDbConnection dbConn = dapperDbContext.GetDbConnection())
|
|
|
{
|
|
|
dbConn.Open();
|
|
|
StringBuilder querySen = new StringBuilder(1024);
|
|
|
querySen.AppendLine("SELECT DISTINCT ");
|
|
|
querySen.AppendLine(" CAST(IBLNR AS VARCHAR) + CAST(GJAHR AS VARCHAR) AS [value] , ");
|
|
|
querySen.AppendLine(" CAST(IBLNR AS VARCHAR) + CAST(GJAHR AS VARCHAR) AS [key] ");
|
|
|
querySen.AppendLine("FROM dbo.SAP_CYCO ");
|
|
|
querySen.AppendLine("WHERE ISNULL(STAFLG, '') = '' ");
|
|
|
querySen.AppendLine(" AND WERKS = 1010 ");
|
|
|
querySen.AppendLine(" AND SYNFLG = 'N' ");
|
|
|
querySen.AppendLine(" AND ISNULL(XLOEK, '') = '' ");
|
|
|
List<KeyValueResult> result = dbConn.Query<KeyValueResult>(querySen.ToString()).ToList();
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
///盘点单集合
|
|
|
/// </summary>
|
|
|
/// <returns>数据集</returns>
|
|
|
public List<dynamic> CreateChkNo(string cbChkCommand, string userId)
|
|
|
{
|
|
|
using (IDbConnection dbConn = dapperDbContext.GetDbConnection())
|
|
|
{
|
|
|
dbConn.Open();
|
|
|
|
|
|
DynamicParameters Params = new DynamicParameters();
|
|
|
Params.Add("@orderNo", cbChkCommand);
|
|
|
Params.Add("@userID", userId);
|
|
|
Params.Add("@rVal", "");
|
|
|
Params.Add("@rMsg", "");
|
|
|
List<dynamic> result = dbConn.Query<dynamic>("sys_check_createchk", Params, commandType: CommandType.StoredProcedure).ToList();
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
#endregion 成员方法
|
|
|
}
|
|
|
}
|