public string SettleMZInsurance(request <settleMZInsurance> settleMZInsurance)
        {
            if (settleMZInsurance == null)
            {
                return(RsXmlHelper.ResXml(-1, "XML格式错误"));
            }

            var ptInfo = ptInfoBLL.GetPtInfoByCardNo("", Convert.ToInt32(settleMZInsurance.model.patCardType), settleMZInsurance.model.patCardNo);

            if (ptInfo == null)
            {
                return(RsXmlHelper.ResXml(-1, "XML格式错误"));
            }

            var dept   = sysDeptBLL.GetDeptByCode(settleMZInsurance.model.deptCode);
            var doctor = sysUserinfoBLL.GetRDoctor(settleMZInsurance.model.doctorCode);

            var pt_Info = ptInfoBLL.GetPtInfoByCardNo("", Convert.ToInt32(settleMZInsurance.model.patCardType), settleMZInsurance.model.patCardNo);

            if (pt_Info == null)
            {
                return(RsXmlHelper.ResXml(-1, "患者信息为空"));
            }

            var regInfo = reginfoBLL.GetReg_Info(Convert.ToInt32(settleMZInsurance.model.mzFeeId));

            var orderInfoList = orderInfoBLL.GetMZOrderInfo(settleMZInsurance.model.mzFeeId, settleMZInsurance.model.mzBillId);

            if (regInfo == null)
            {
                return(RsXmlHelper.ResXml(-1, "挂号信息为空"));
            }

            var ybsssno = commKeyBLL.GetYBNO();

            var FeeTrail = feeTrialBLL.Get(x => x.bke384 == settleMZInsurance.model.SSSerNo);

            if (FeeTrail == null && !string.IsNullOrWhiteSpace(FeeTrail.transBody))
            {
                //return RsXmlHelper.ResXml(0, JsonOperator.JsonSerialize(FeeTrail.transBody));
                return(XMLHelper.XmlSerialize(new response <FeeSettlement>()
                {
                    model = new FeeSettlement()
                    {
                        resultCode = 0,
                        resultMessage = FeeTrail.transBody,
                        akc190 = FeeTrail.akc190
                    }
                }));
            }
            FY005 fY005 = new FY005()
            {
                aaz500 = settleMZInsurance.model.socialSecurityNo,
                bzz269 = string.IsNullOrWhiteSpace(settleMZInsurance.model.patCardPwd) ? "000000" : settleMZInsurance.model.patCardPwd,
                akc190 = FeeTrail.akc190,
                aka130 = FeeTrail.aka130,
                bkc320 = FeeTrail.bkc320,
                ckc350 = FeeTrail.ckc350,
                aka030 = FeeTrail.aka030,
                akc264 = FeeTrail.akc264.ToString(),
                ckc601 = FeeTrail.ckc601,
                bke384 = FeeTrail.bke384
            };

            var ybSno = "HZS10" + DateTime.Now.ToString("yyyyMMdd") + ybsssno;
            var getVerifyCodeResult = JsonOperator.JsonDeserialize <Entity.SResponse.getVerifyCode>(HttpHelper.Post("http://192.168.88.134:8300/YBDLL/domain/getVerifyCode", JsonOperator.JsonSerialize(new getVerifyCode()
            {
                inParam = "FY005|" + ybSno + "|HZS10|"
            }), Encoding.UTF8, 1));

            if (getVerifyCodeResult.resultCode != 0)
            {
                return(null);
            }

            var version = getVerifyCodeResult.outParam.Split("|")[2];
            var verify  = getVerifyCodeResult.outParam.Split("|")[0] + "|" + getVerifyCodeResult.outParam.Split("|")[1];
            var result  = HealthInsuranceHelper.RegTrial <BaseMedInsurance <Entity.SResponse.FY005> >("FY005", version, verify, ybsssno.ToString(), fY005);

            if (result.transReturnCode == "0" || result.transReturnCode == "00000000")
            {
                var resultObj = new Entity.SResponse.getMZInsurance()
                {
                    resultCode    = 0,
                    resultMessage = "",
                    mzFeeId       = regInfo.regid,
                    mzBillId      = string.Join(",", orderInfoList.Select(x => x.billid)),
                    SSFeeNo       = ybSno,
                    SSBillNumber  = null,
                    time          = DateTime.Now,
                    recipeCount   = orderInfoList.Count.ToString(),
                    deptCode      = dept.code,
                    doctorCode    = doctor.userno,
                    doctorName    = doctor.username,
                    payType       = "医保",
                    payAmount     = result.transBody.akb067.ToString(),
                    totalAmout    = orderInfoList.Sum(x => x.totprice).ToString(),
                    akc190        = fY005.akc190,
                    SSInfoNew     = JsonOperator.JsonSerialize(result.transBody)
                };
                return(XMLHelper.XmlSerialize(new response <FeeSettlement>()
                {
                    model = new FeeSettlement()
                    {
                        resultCode = 0,
                        resultMessage = JsonOperator.JsonSerialize(result.transBody),
                        akc190 = fY005.akc190
                    }
                }));
            }
            else
            {
                return(RsXmlHelper.ResXml(-1, result.transReturnMessage + "{" + JsonOperator.JsonSerialize(fY005) + "}"));
            }
        }