using Newtonsoft.Json.Linq;
using PTMedicalInsurance.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMedicalInsurance.Business
{
    class OPFeeUploadProcess : AbstractProcess
    {
        public override CallResult Process(JObject input)
        {
            string outParam = "";
            var ret = hBus.getFeeDetail();
            if (ret.code < 0)
            {
                outParam = ret.data.ToString();
                return Error("获取费用明细失败");
            }
            JArray jaFeeDetail = (JArray)ret.data;
            //按指定条数分割后上传，保存，更新
            if (hBus.uploadFeeToCenter(TradeEnum.OutpatientFeeUpload, 50, jaFeeDetail, out outParam) != 0)
            {
                return Exception("费用上传", outParam);
            }
            return Success();
        }
    }
}
