| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 工作联系单列表 分页 |
| | | [Route("Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListPage")] |
| | | [HttpGet] |
| | | public object GetOA_WorkLinkBillListPage(string sWhere, string user, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | //查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log("OA_WorkLinkBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | string sql = $@" |
| | | select count(1) count from h_v_OA_WorkLinkBillAllList |
| | | select * from h_v_OA_WorkLinkBillAllList order by 单据号 desc |
| | | offset {(page - 1) * size} rows fetch next {size} rows only"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_OA_WorkLinkBillAllList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = $@" |
| | | select count(1) count from h_v_OA_WorkLinkBillAllList where 1 = 1 {sWhere} |
| | | select * from h_v_OA_WorkLinkBillAllList where 1 = 1 |
| | | {sWhere} order by 单据号 desc |
| | | offset {(page - 1) * size} rows fetch next {size} rows only"; |
| | | ds = oCN.RunProcReturn(sql1, "h_v_OA_WorkLinkBillAllList"); |
| | | } |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[1].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = int.Parse(ds.Tables[0].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[1]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 工作联系单编辑获取数据 |
| | | [Route("Sc_MESTransFerWorkBill/GetOA_WorkLinkBillListCheckDetai")] |
| | | [HttpGet] |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 设备点检记录PDA 保存后 查询是否有NG 调整安灯 |
| | | |
| | | [Route("Sc_MESTransFerWorkBill/getGy_EquipFile_AD")] |
| | | [HttpGet] |
| | | public object getGy_EquipFile_AD(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | string sql = "select * from h_v_Gy_EquipFileMainList where hmainid='" + HInterID + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipFileMainList"); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |