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 MeterWorkStorageActualService
    {
        /// <summary>
        /// 数据查询：查询当天的数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkStorageActual>> doQueryWf(MeterWorkStorageActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkStorageActual>> rm = db.doOption<List<MeterWorkStorageActual>>("meterworkstorageactuals", "doQueryWf", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 数据查询，平台默认方法
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkStorageActual>> doQuery(MeterWorkStorageActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<PageList<List<MeterWorkStorageActual>>> rm = db.doOption<PageList<List<MeterWorkStorageActual>>>("meterworkstorageactuals", "/", new object[] { info }, 0);

            RESTfulResult<List<MeterWorkStorageActual>> result = new RESTfulResult<List<MeterWorkStorageActual>>();
            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;
        }

        /// <summary>
        /// 成品秤数据保存
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doAddWf(MeterWorkStorageActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkstorageactuals", "doAddWf", new object[] { info }, 1);
            return rm;
        }

        public RESTfulResult<List<MeterWorkStorageActual>> doQueryTimeWf(CommonPage<MeterWorkStorageActual> info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkStorageActual>> rm = db.doOption<List<MeterWorkStorageActual>>("meterworkstorageactuals", "doQueryTimeWf", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 更新实绩数据
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<int> doUpdateWf(List<MeterWorkStorageActual> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<int> rm = db.doOption<int>("meterworkstorageactuals", "doUpdateWf", new object[] { lt }, 1);
            return rm;
        }

        /// <summary>
        /// 更新实绩数据<不更新序号>
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<string> doUpdateClient(List<MeterWorkStorageActual> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkstorageactuals", "doUpdateClient", new object[] { lt }, 1);
            return rm;
        }


        /// <summary>
        /// 更新实绩数据
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<string> doUpdateClientXH(List<MeterWorkStorageActual> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkstorageactuals", "doUpdateClientXH", new object[] { lt }, 1);
            return rm;
        }

        /// <summary>
        /// 热送磅数据保存
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doAddHotDeliveryBelt(MeterWorkStorageActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkstorageactuals", "doAddHotDeliveryBelt", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 查询分组的数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkStorageActual>> doQueryGroup(MeterWorkStorageActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkStorageActual>> rm = db.doOption<List<MeterWorkStorageActual>>("meterworkstorageactuals", "doQueryGroup", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 按照审核状态查询分组的数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkStorageActual>> doQueryCheckCount(MeterWorkStorageActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkStorageActual>> rm = db.doOption<List<MeterWorkStorageActual>>("meterworkstorageactuals", "doQueryCheckCount", new object[] { info }, 1);
            return rm;
        }
    }
}
