| | |
| | | /// 采购主表,数据从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> |
| | |
| | | [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), |
| | |
| | | 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; |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取 |
| | | /// 读取明细 |
| | | /// </summary> |
| | | /// <param name="guid"></param> |
| | | /// <returns></returns> |
| | |
| | | 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; |
| | | } |
| | |
| | | "读取成功!"); |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Default, "读取失败!"); |
| | | } |
| | | |
| | | |
| | | } |