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

namespace Common
{
    public class MeterBaseTermTareDataService
    {
        /// <summary>
        /// 期限皮重保存
        /// 服务端有条件结束时间大于sysdate时间
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<List<MeterBaseTermTareData>> doQueryWf(MeterBaseTermTareData info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<List<MeterBaseTermTareData>> rm = db.doOption<List<MeterBaseTermTareData>>("meterbasetermtaredatas", "doQueryWf", new object[] { info }, 1);
            return rm;
        }

        /// <summary>
        /// 期限皮重查询
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<MeterBaseTermTareData> doQueryPageWf(MeterBaseTermTareData info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<MeterBaseTermTareData> rm = db.doOption<MeterBaseTermTareData>("meterbasetermtaredatas", "/listBycarNo", new object[] { info }, 0);

            return rm;
        }

        /// <summary>
        /// 期限皮重保存
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> doSaveWf(MeterBaseTermTareData info, MeterMonitorNote monitorNote)
        {
            DbHelper db = new DbHelper();
            PbSomeModel<MeterBaseTermTareData, MeterMonitorNote, string, string> pbSomeModel = new PbSomeModel<MeterBaseTermTareData, MeterMonitorNote, string, string>();
            pbSomeModel.one = info;
            pbSomeModel.two = monitorNote;
            RESTfulResult<string> rm = db.doOption<string>("meterbasetermtaredatas", "doSaveWf", new object[] { pbSomeModel }, 1);
            return rm;
        }

        /// <summary>
        /// C#一次计量完成后，作废期限皮重信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public RESTfulResult<string> abolishForCSharp(MeterBaseTermTareData info)
        {
            DbHelper db = new DbHelper();
            RESTfulResult<string> rm = db.doOption<string>("meterbasetermtaredatas", "abolishForCSharp", new object[] { info }, 1);
            return rm;
        }
    }
}
