啊鑫
4 天以前 eb65436c2312821e3e513ab9ada41dd486d6d7cf
WebApi/Gs.Warehouse/Services/MesRohInManager.cs
@@ -14,17 +14,25 @@
///     采购主表,数据从erp来
/// </summary>
[ApiGroup(ApiGroupNames.PerMission)]
public class MesRohInManager :IRomteService
public class MesRohInManager : IRomteService
{
    /// <summary>
    /// HTTP上下文
    /// </summary>
    private readonly IHttpContextAccessor _http;
    /// <summary>
    /// 用户code,用户guid,组织id列表
    /// </summary>
    private readonly string _userCode, _userGuid, _orgFids;
    public MesRohInManager(IHttpContextAccessor httpContextAccessor)
    {
        //变量附值
        _http = httpContextAccessor;
        (_userCode, _userGuid, _orgFids) =
            UtilityHelper.GetUserGuidAndOrgGuid(_http);
        (_userCode, _userGuid, _orgFids) =UtilityHelper.GetUserGuidAndOrgGuid(_http);
    }
    /// <summary>
@@ -35,10 +43,10 @@
    [RequestMethod(RequestMethods.POST)]
    public ReturnDto<PageList<dynamic>> GetListPage([FromBody] dynamic model)
    {
        int currentPage = model.currentPage;
        int everyPageSize = model.everyPageSize;
        string sortName = model.sortName;
        string keyWhere = model.keyWhere;
        int currentPage = model.currentPage;//当前页
        int everyPageSize = model.everyPageSize;//每页大小
        string sortName = model.sortName;//排序
        string keyWhere = model.keyWhere;//查询条件
        SqlParameter[] parameters =
        {
            new("@inCurrentPage", currentPage),
@@ -66,8 +74,9 @@
            if (dset != null && dset.Tables.Count > 0 &&
                dset.Tables[0].Rows.Count > 0) //有数据
            {
                var intTotal =
                    int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
                //总记录数
                var intTotal =int.Parse(dset.Tables[1].Rows[0]["intTotal"].ToString());
                //计算共有几页
                var pages = intTotal % everyPageSize != 0
                    ? intTotal / everyPageSize + 1
                    : intTotal / everyPageSize;
@@ -88,7 +97,7 @@
    /// <summary>
    ///     读取
    ///     读取明细
    /// </summary>
    /// <param name="guid"></param>
    /// <returns></returns>
@@ -114,11 +123,13 @@
            if (dset != null && dset.Tables.Count > 0 &&
                dset.Tables[0].Rows.Count > 0)
            {
                //主体信息
                var dr = dset.Tables[0].Rows[0];
                m = dr.RowToDynamic();
                //表1
                var _tb = dset.Tables[1].TableToDynamicList();
                m.list = _tb;
                //表2
                var _tb2 = dset.Tables[2].TableToDynamicList();
                m.list2 = _tb2;
            }
@@ -133,4 +144,6 @@
                "读取成功!");
        return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "读取失败!");
    }
}