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

namespace PTMedicalInsurance.Business.Core.SelfServiceMachine.Process.OutPat
{
    class UploadFee : AbstractProcess
    {
        public override CallResult Process(JObject input)
        {
            string outParam = "";
            var ret = hBus.getFeeDetail();
            if (ret.Code < 0)
            {
                return Exception("费用上传", ret.Data);
            }
            JArray jaFeeDetail = JArray.Parse(ret.Data);
            //按指定条数分割后上传，保存，更新
            if (hBus.uploadFeeToCenter("2204", 50, jaFeeDetail, out outParam) != 0)
            {
                return Exception("费用上传", outParam);
            }

            return Success();
        }
    }
}
