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

            string floor   = "";
            var    regInfo = reginfoBLL.GetReg_Info(Convert.ToInt32(payCurReg.model.hisOrdNum));

            if (regInfo == null)
            {
                return(RsXmlHelper.ResXml(99, "挂号信息为空"));
            }
            try
            {
                payCurReg.model.payMode = CodeConvertUtils.GetChannByCode(Convert.ToInt32(payCurReg.model.payMode));
            }
            catch
            {
                payCurReg.model.payMode = payCurReg.model.payMode;
            }

            var fee_info = feeinfoBLL.GetFee_InfoByRegInfo(Convert.ToInt32(payCurReg.model.hisOrdNum));

            fee_info.del         = false;
            fee_info.addtime     = payCurReg.model.payTime == null ? DateTime.Now : Convert.ToDateTime(payCurReg.model.payTime);
            fee_info.amountrec   = Convert.ToDecimal(payCurReg.model.payAmout) / 100;
            fee_info.amountcol   = Convert.ToDecimal(payCurReg.model.payAmout) / 100;
            fee_info.extern_memo = "hisOrdNum:" + payCurReg.model.hisOrdNum + ",psOrdNum:" + payCurReg.model.psOrdNum + ",agtOrdNum:" + payCurReg.model.agtOrdNum + ",agtCode:" + payCurReg.model.agtCode + ",payMode:" + payCurReg.model.payMode + ",payMethod:" + payCurReg.model.payMethod + ",payAmout:" + Convert.ToDecimal(payCurReg.model.payAmout) / 100 + ",payTime:" + payCurReg.model.payTime + (!string.IsNullOrWhiteSpace(payCurReg.model.SSSerialNo) ? ",自费金额:" + (Convert.ToDecimal(payCurReg.model.payAmout) - Convert.ToDecimal(payCurReg.model.SSMoney)) + "。" : "。");

            var feeinfodetails = feeInfodetailBLL.GetFee_Infodetails(fee_info.feeid);

            feeinfodetails.ForEach(x => x.del    = false);
            feeinfodetails.ForEach(x => x.status = 1);
            feeInfodetailBLL.Updates(feeinfodetails);

            regInfo.del = false;
            reginfoBLL.UpdateRegInfo(regInfo);
            floor = sysDeptBLL.GetFloorByName(regInfo.dept);

            feeinfoBLL.Update(fee_info);

            if ((Convert.ToDecimal(payCurReg.model.payAmout) - Convert.ToDecimal(payCurReg.model.SSMoney)) > 0)
            {
                feeinfoBLL.AddFeechannel(new fee_channel()
                {
                    feeid   = fee_info.feeid,
                    chnn    = payCurReg.model.payMode,
                    amount  = (Convert.ToDecimal(payCurReg.model.payAmout) - Convert.ToDecimal(payCurReg.model.SSMoney)) / 100,
                    del     = false,
                    chnnsno = payCurReg.model.psOrdNum
                });
            }

            if (payCurReg.model.payMethod == "2")//医保
            {
                feeinfoBLL.AddFeechannel(new fee_channel()
                {
                    feeid   = fee_info.feeid,
                    chnn    = "医疗保险",
                    amount  = Convert.ToDecimal(payCurReg.model.SSMoney) / 100,
                    del     = false,
                    chnnsno = payCurReg.model.SSSerialNo
                });
            }

            return(XMLHelper.XmlSerialize(new response <Entity.SResponse.payCurReg>()
            {
                model = new Entity.SResponse.payCurReg()
                {
                    resultCode = 0,
                    resultMessage = "",
                    visitLocation = floor
                }
            }));
        }
Beispiel #2
0
        public string GetDepositList(request <Entity.SRequest.GetDepositList> getDepositList)
        {
            if (getDepositList == null)
            {
                return(RsXmlHelper.ResXml(-1, "XML不能为空"));
            }
            var feeDeposit = feeDepositBLL.GetFee_Deposit(x => x.inid == Convert.ToInt32(getDepositList.model.patientID));

            if (feeDeposit == null)
            {
                return(RsXmlHelper.ResXml(-1, "暂无预交金缴费记录"));
            }
            var list = feeDepositBLL.GetDepositItems(feeDeposit.did, !string.IsNullOrWhiteSpace(getDepositList.model.payMode) ? CodeConvertUtils.GetChannByCode(Convert.ToInt32(getDepositList.model.payMode)) : "", getDepositList.model.beginDate, getDepositList.model.endDate, getDepositList.model.psOrdNum);

            if (list.Count > 0)
            {
                return(XMLHelper.XmlSerialize(new response <Entity.SResponse.GetDepositList>()
                {
                    model = new Entity.SResponse.GetDepositList()
                    {
                        resultCode = 0,
                        resultMessage = "",
                        item = list
                    }
                }));
            }
            else
            {
                return(RsXmlHelper.ResXml(99, "暂无缴费记录"));
            }
        }