Beispiel #1
0
        /// <summary>
        /// 职工结算
        /// </summary>
        /// <param name="paramc"></param>
        /// <param name="baseParam"></param>
        /// <returns></returns>
        public ApiJsonResultData WorkerHospitalizationSettlement(string paramc, HisBaseParam baseParam)
        {
            var resultValue = new ApiJsonResultData {
                Success = true
            };

            try
            {
                Logs.LogWrite(new LogParam()
                {
                    Params = paramc,
                    Msg    = JsonConvert.SerializeObject(baseParam)
                });
                var loginData = MedicalInsuranceDll.ConnectAppServer_cxjb(baseParam.Account, baseParam.Pwd);
                var param     = JsonConvert.DeserializeObject <WorkerHospitalizationSettlementParam>(paramc);

                //社保住院号
                var documentNo = new byte[1024];
                //发生费用金额
                var totalAmount = new byte[1024];
                //基本统筹支付
                var basicOverallPay = new byte[1024];
                //补充医疗保险支付金额
                var supplementPayAmount = new byte[1024];
                //专项基金支付金额
                var specialFundPayAmount = new byte[1024];
                //公务员补贴
                var civilServantsSubsidies = new byte[1024];
                //公务员补助
                var civilServantsSubsidy = new byte[1024];
                //其它支付金额
                var otherPaymentAmount = new byte[1024];
                //账户支付
                var accountPayment = new byte[1024];
                //现金支付
                var cashPayment = new byte[1024];
                //起付金额
                var paidAmount = new byte[1024];
                // 备注
                var remark = new byte[1024];
                //返回状态
                var resultState = new byte[1024];
                //消息
                var msg = new byte[1024];
                MedicalInsuranceDll.WorkerHospitalizationSettlement
                    (param.OrganizationCode,
                    param.MedicalInsuranceHospitalizationNo,
                    param.AdministrativeArea,
                    param.IsHospitalizationFrequency,
                    param.Operators,
                    param.LeaveHospitalDate,
                    param.LeaveHospitalState,
                    param.AdmissionMainDiagnosisIcd10,
                    param.DiagnosisIcd10Two,
                    param.DiagnosisIcd10Three,
                    param.LeaveHospitalMainDiagnosis,
                    totalAmount,
                    basicOverallPay,
                    supplementPayAmount,
                    specialFundPayAmount,
                    civilServantsSubsidies,
                    civilServantsSubsidy,
                    otherPaymentAmount,
                    accountPayment,
                    cashPayment,
                    paidAmount,
                    documentNo,
                    remark,
                    resultState,
                    msg
                    );
                if (CommonHelp.StrToTransCoding(resultState) != "1")
                {
                    throw new Exception(CommonHelp.StrToTransCoding(msg));
                }
                var resultData = new WorkerHospitalizationPreSettlementDto()
                {
                    DocumentNo             = CommonHelp.StrToTransCoding(documentNo),
                    TotalAmount            = Convert.ToDecimal(CommonHelp.StrToTransCoding(totalAmount)),
                    BasicOverallPay        = Convert.ToDecimal(CommonHelp.StrToTransCoding(basicOverallPay)),
                    SupplementPayAmount    = Convert.ToDecimal(CommonHelp.StrToTransCoding(supplementPayAmount)),
                    SpecialFundPayAmount   = Convert.ToDecimal(CommonHelp.StrToTransCoding(specialFundPayAmount)),
                    CivilServantsSubsidies = Convert.ToDecimal(CommonHelp.StrToTransCoding(civilServantsSubsidies)),
                    CivilServantsSubsidy   = Convert.ToDecimal(CommonHelp.StrToTransCoding(civilServantsSubsidy)),
                    OtherPaymentAmount     = Convert.ToDecimal(CommonHelp.StrToTransCoding(otherPaymentAmount)),
                    AccountPayment         = Convert.ToDecimal(CommonHelp.StrToTransCoding(accountPayment)),
                    CashPayment            = Convert.ToDecimal(CommonHelp.StrToTransCoding(cashPayment)),
                    PaidAmount             = Convert.ToDecimal(CommonHelp.StrToTransCoding(paidAmount)),
                    Remark = CommonHelp.StrToTransCoding(cashPayment),
                };
                var infoEntity = GetUserInfoEntity(baseParam);
                resultValue.OtherInfo = infoEntity.WorkersInsuranceBalance.ToString();
                Logs.LogWriteData(new LogWriteDataParam()
                {
                    JoinJson   = JsonConvert.SerializeObject(param),
                    ReturnJson = JsonConvert.SerializeObject(resultData),
                    OperatorId = baseParam.OperatorId
                });
                resultValue.Data = JsonConvert.SerializeObject(resultData);
            }
            catch (Exception e)
            {
                resultValue.Success = false;
                resultValue.Message = e.Message;
            }
            return(resultValue);
        }