using com.hnshituo.core.webapp.vo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
    public class MeterWorkStockOnlineService
    {
        public RESTfulResult<List<MeterWorkStockOnline>> doQueryWf(MeterWorkStockOnline info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkStockOnline>>> rm = db.doOption<PageList<List<MeterWorkStockOnline>>>("meterworkstockonlines", "/", new object[] { info }, 0);

            RESTfulResult<List<MeterWorkStockOnline>> result = new RESTfulResult<List<MeterWorkStockOnline>>();
            result.Succeed = rm.Succeed;
            result.Status = rm.Status;
            result.Message = rm.Message;
            result.ResultMessage = rm.ResultMessage;
            result.Code = rm.Code;
            if (rm.Data != null && rm.Data.list != null && rm.Data.list.Count > 0)
            {
                result.Data = rm.Data.list;
            }

            return result;
        }

        public RESTfulResult<string> doSaveWf(MeterWorkStockOnline online)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkstockonlines", "doSaveWf", new object[] { online }, 1);
            return rm;
        }

        /// <summary>
        /// 获取采集数据
        /// </summary>
        public RESTfulResult<List<StorageCollectModel>> doQueryStaticDbWf()
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<StorageCollectModel>> result = db.doOption<List<StorageCollectModel>>("meterworkstockonlines", "doQueryStaticDbWf", new object[] { }, 1);
            return result;
        }
    }
}
