| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 返回缓存列表 |
| | | /// </summary> |
| | | /// <param name="sWhere">拼接的SQL</param> |
| | | /// <returns>object</returns> |
| | | [Route("GroupOrderBill/CacheList")] |
| | | [HttpGet] |
| | | public object CacheList(string sWhere) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select top 5000 * from h_v_GroupOrderBillCacheList order by 扫码时间 desc", "h_v_GroupOrderBillCacheList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_GroupOrderBillCacheList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | string sql2 = " order by 扫码时间 desc"; |
| | | sql += sql2; |
| | | ds = oCN.RunProcReturn(sql, "h_v_GroupOrderBillCacheList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无数据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据ID删除缓存表中扫码记录 |
| | | /// </summary> |
| | | /// <param name="sHitemID">缓存表ID</param> |
| | | /// <returns>object</returns> |
| | | [Route("GroupOrderBill/DelCacheList")] |
| | | [HttpGet] |
| | | public object DelCacheList(long sHitemID) |
| | | { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | oCn.RunProc("Delete from KF_PonderationBillMain_Temp where HitemID = " + sHitemID); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!"; |
| | | objJsonResult.data = e.ToString(); |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | // |
| | | } |