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

namespace Common
{

    /// <summary>
    /// 皮带秤实绩接口
    /// </summary>
    public class MeterWorkBeltActualService
    {
        /// <summary>
        /// 数据查询：查询当天的数据
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltActual>> doQueryWf(MeterWorkBeltActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltActual>> rm = db.doOption<List<MeterWorkBeltActual>>("meterworkbeltscaleactuals", "doQueryWf", new object[] { info }, 1);
            return rm;
        }

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

            RESTfulResult<List<MeterWorkBeltActual>> result = new RESTfulResult<List<MeterWorkBeltActual>>();
            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(MeterWorkBeltActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkbeltscaleactuals", "doAddBeltScaleActual", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 补录
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doAdd(MeterWorkBeltActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkbeltscaleactuals", "doAddBeltScaleActualadd", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 结束计量
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> endMeter(MeterWorkBeltActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterworkbeltscaleactuals", "endMeter", new object[] { info }, 1);
            return rm;
        }

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

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

        /// <summary>
        /// 根据状态自定义话查询
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltActual>> doQueryActualInfoFlags(MeterWorkBeltActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltActual>> rm = db.doOption<List<MeterWorkBeltActual>>("meterworkbeltscaleactuals", "doQueryActualInfoFlags", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 根据状态自定义话查询
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltActual>> doQueryMaxPno(MeterWorkBeltActual info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltActual>> rm = db.doOption<List<MeterWorkBeltActual>>("meterworkbeltscaleactuals", "doQueryMaxPno", new object[] { info }, 1);
            return rm;
        }


        //多条件模糊查询 自带自定义状态
        public RESTfulResult<List<MeterWorkBeltActual>> doQueryAndMultiple(CommonPage<MeterWorkBeltActual> info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltActual>> rm = db.doOption<List<MeterWorkBeltActual>>("meterworkbeltscaleactuals", "doQueryAndMultiple", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 统计查询
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterWorkBeltActual>> doQueryActualInfoAndGroup(CommonPage<MeterWorkBeltActual> info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterWorkBeltActual>> rm = db.doOption<List<MeterWorkBeltActual>>("meterworkbeltscaleactuals", "doQueryActualInfoAndGroup", new object[] { info }, 1);
            return rm;
        }


        /// <summary>
        /// 成品秤预报数据更新状态
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<int> doUpdateFlags(List<MeterWorkBeltActual> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<int> rm = db.doOption<int>("meterworkbeltscaleactuals", "doUpdateFlags", new object[] { lt }, 1);
            return rm;
        }

        /// <summary>
        /// 成品秤实绩数据更新审核状态
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        public RESTfulResult<int> doUpdateCheckFlags(List<MeterWorkBeltActual> lt)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<int> rm = db.doOption<int>("meterworkbeltscaleactuals", "doUpdateCheckFlags", new object[] { lt }, 1);
            return rm;
        }


    }
}
