Ejemplo n.º 1
0
        public ClaimListModel PrepareClaimListModel(ClaimSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }
            List <ClaimModel> claimModels = new List <ClaimModel>();
            var direction  = searchModel.Sort.Equals("asc") ? false : true;
            var paidClaims = _customerService.GetPaidClaims(searchQuery: searchModel.Query, sortField: searchModel.Field, pageIndex: searchModel.Page - 1, pageSize: searchModel.Perpage, orderByDec: direction);
            var osClaims   = _customerService.GetOSClaims(searchQuery: searchModel.Query, sortField: searchModel.Field, pageIndex: searchModel.Page - 1, pageSize: searchModel.Perpage, orderByDec: direction);

            foreach (var claim in osClaims)
            {
                claimModels.Add(new ClaimModel {
                    Code            = claim.Code, NationalID = claim.NationalID, YearofBirth = claim.YearofBirth, InsPolicyNo = claim.InsPolicyNo, CL_STATUS = claim.CL_STATUS, CL_COUNTRY = claim.CL_COUNTRY, CL_SEQID = claim.CL_SEQID, CL_VISA_CODE = claim.CL_VISA_CODE, CL_VISA = claim.CL_VISA,
                    CL_VISA_STS     = claim.CL_VISA_STS, CL_ADMDATE = claim.CL_ADMDATE, CL_DCLDTE = claim.CL_DCLDTE, POLICY_SEQ = claim.POLICY_SEQ, CL_PP_NO = claim.CL_PP_NO, CL_ClASS = claim.CL_CLASS, CL_RISK = claim.CL_RISK, CL_SUBRISK = claim.CL_SUBRISK, CL_SUBADM = claim.CL_SUBADM, CL_DISCHARGE = claim.CL_DISCHARGE,
                    CL_PROVIDERTYPE = claim.CL_PROVIDER_TYPE, CL_PROVIDERNO = claim.CL_PROVIDER_NO, CL_CURR = claim.CL_CURR, CL_INV_DATE = claim.CL_INV_DATE, CL_BATCH = claim.CL_BATCH, CL_DIAG = claim.CL_DIAG, CL_DIAG_DESC = claim.CL_DIAG_DESC, CL_INV_NO = claim.CL_INV_NO, CL_ACCIDATE = claim.CL_ACCIDT, CL_CLMAMT_OR = claim.CL_CLMAMT_OR,
                    CL_CLMAMT_LL    = claim.CL_CLMAMT_LL, CL_STSER = claim.CL_STSER, CL_PROD = claim.CL_PROD, CL_STLDATE = claim.CL_STLDATE, CL_INV_RDATE = claim.CL_INV_RDATE, CL_PAIDAMT_OR = claim.CL_PAIDAMT_OR, CL_PAIDAMT_LL = claim.CL_PAIDAMT_LL, CL_HOSPAMT_OR = claim.CL_HOSPAMT_OR, CL_HOSPAMT_LL = claim.CL_HOSPAMT_LL, CL_CALCAMT_OR = claim.CL_CALCAMT_OR, CL_CALCAMT_LL = claim.CL_CALCAMT_LL, CL_PAYABLE_OR = claim.CL_PAYABLE_OR, CL_PAYABLE_LL = claim.CL_PAYABLE_LL,
                    CL_DEDCTN_OR    = claim.CL_DEDCTN_OR, CL_DEDCTN_LL = claim.CL_DEDCTN_LL, CL_DEDCTBL_OR = claim.CL_DEDCTBL_OR, CL_DEDCTBL_LL = claim.CL_DEDCTBL_LL, CL_FSTVSA = claim.CL_FSTVSA, CL_CCHINO = claim.CL_CCHINO, CL_CLMTYPE = claim.CL_CLMTYPE,
                    CL_SRVC         = claim.CL_SRVC, CL_DEDREASON = claim.CL_DEDREASON, CL_INSPOLNO = claim.CL_INSPOLNO, CL_INSINSURD = claim.CL_INSINSURD, CL_PROVNAME = claim.CL_PROVNAME, CL_BATCH_STS = claim.CL_BATCH_STS, CL_TRFTUI = claim.CL_TRFTUI, CL_SUBOFF = claim.CL_SUBOFF,
                    CL_FILENO       = claim.CL_FILENO, CL_DEDMED = claim.CL_DEDMED, CL_DEDPROV = claim.CL_DEDPROV, CL_FTYPE = claim.CL_FTYPE, CL_VATAMT = claim.CL_VATAMT, CL_VATNET = claim.CL_VATNET, SRV_DESC = claim.SRV_DESC, SERIAL = claim.SERIAL, GROSS_OR = claim.GROSS_OR,
                    GROSS_LL        = claim.GROSS_LL, NETPAYABLE_OR = claim.NETPAYABLE_OR, NETPAYABLE_LL = claim.NETPAYABLE_LL, ADM_TYPE = claim.ADM_TYPE, POLICY_INC = claim.POLICY_INC, PROVIDER_CITY = claim.PROVIDER_CITY, EMERGENCY_CHK = claim.EMERGENCY_CHK, CONGINATAL_CHK = claim.CONGINATAL_CHK, PRE_DISEASE_CHK = claim.PRE_DISEASE_CHK,
                    LOGINDATE       = claim.LOGIN_DATE, FROMDATE = claim.FROM_DATE, TODATE = claim.TO_DATE, STATUS = claim.STATUS,
                });
            }
            foreach (var claim in paidClaims)
            {
                claimModels.Add(new ClaimModel
                {
                    Code          = claim.Code, NationalID = claim.NationalID, YearofBirth = claim.YearofBirth, InsPolicyNo = claim.InsPolicyNo, CL_STATUS = claim.CL_STATUS, CL_COUNTRY = claim.CL_COUNTRY, CL_SEQID = claim.CL_SEQID, CL_VISA_CODE = claim.CL_VISA_CODE, CL_VISA = claim.CL_VISA,
                    CL_VISA_STS   = claim.CL_VISA_STS, CL_ADMDATE = claim.CL_ADMDATE, CL_DCLDTE = claim.CL_DCLDTE, POLICY_SEQ = claim.POLICY_SEQ, CL_PP_NO = claim.CL_PP_NO, CL_ClASS = claim.CL_ClASS, CL_RISK = claim.CL_RISK, CL_SUBRISK = claim.CL_SUBRISK, CL_SUBADM = claim.CL_SUBADM,
                    CL_DISCHARGE  = claim.CL_DISCHARGE, CL_PROVIDERTYPE = claim.CL_PROVIDERTYPE, CL_PROVIDERNO = claim.CL_PROVIDERNO, CL_CURR = claim.CL_CURR, CL_INV_DATE = claim.CL_INV_DATE, CL_BATCH = claim.CL_BATCH, CL_DIAG = claim.CL_DIAG, CL_DIAG_DESC = claim.CL_DIAG_DESC,
                    CL_INV_NO     = claim.CL_INV_NO, CL_ACCIDATE = claim.CL_ACCIDATE, CL_CLMAMT_OR = claim.CL_CLMAMT_OR, CL_CLMAMT_LL = claim.CL_CLMAMT_LL, CL_STSER = claim.CL_STSER, CL_PROD = claim.CL_PROD, CL_STLDATE = claim.CL_STLDATE, CL_INV_RDATE = claim.CL_INV_RDATE, CL_PAIDAMT_OR = claim.CL_PAIDAMT_OR,
                    CL_PAIDAMT_LL = claim.CL_PAIDAMT_LL, CL_HOSPAMT_OR = claim.CL_HOSPAMT_OR, CL_HOSPAMT_LL = claim.CL_HOSPAMT_LL, CL_CALCAMT_OR = claim.CL_CALCAMT_OR, CL_CALCAMT_LL = claim.CL_CALCAMT_LL, CL_PAYABLE_OR = claim.CL_PAYABLE_OR, CL_PAYABLE_LL = claim.CL_PAYABLE_LL,
                    CL_DEDCTN_OR  = claim.CL_DEDCTN_OR, CL_DEDCTN_LL = claim.CL_DEDCTN_LL, CL_DEDCTBL_OR = claim.CL_DEDCTBL_OR, CL_DEDCTBL_LL = claim.CL_DEDCTBL_LL, CL_FSTVSA = claim.CL_FSTVSA, CL_CCHINO = claim.CL_CCHINO, CL_CLMTYPE = claim.CL_CLMTYPE, CL_SRVC = claim.CL_SRVC,
                    CL_DEDREASON  = claim.CL_DEDREASON, CL_INSPOLNO = claim.CL_INSPOLNO, CL_INSINSURD = claim.CL_INSINSURD, CL_PROVNAME = claim.CL_PROVNAME, CL_BATCH_STS = claim.CL_BATCH_STS, CL_TRFTUI = claim.CL_TRFTUI, CL_SUBOFF = claim.CL_SUBOFF, CL_FILENO = claim.CL_FILENO, CL_DEDMED = claim.CL_DEDMED,
                    CL_DEDPROV    = claim.CL_DEDPROV, CL_FTYPE = claim.CL_FTYPE, CL_VATAMT = claim.CL_VATAMT, CL_VATNET = claim.CL_VATNET, SRV_DESC = claim.SRV_DESC, SERIAL = claim.SERIAL, GROSS_OR = claim.GROSS_OR, GROSS_LL = claim.GROSS_LL, NETPAYABLE_OR = claim.NETPAYABLE_OR, NETPAYABLE_LL = claim.NETPAYABLE_LL,
                    ADM_TYPE      = claim.ADM_TYPE, POLICY_INC = claim.POLICY_INC, PROVIDER_CITY = claim.PROVIDER_CITY, EMERGENCY_CHK = claim.EMERGENCY_CHK, CONGINATAL_CHK = claim.CONGINATAL_CHK, PRE_DISEASE_CHK = claim.PRE_DISEASE_CHK, LOGINDATE = claim.LOGINDATE,
                    FROMDATE      = claim.FROMDATE, TODATE = claim.TODATE, STATUS = claim.STATUS,
                });
            }
            var IpagedClaims = new PagedList <ClaimModel>(claimModels.AsQueryable(), searchModel.Page - 1, searchModel.Perpage);
            var model        = new ClaimListModel()
            {
                Data = IpagedClaims.AsEnumerable()
            };

            model.Meta = new PageListMetadata
            {
                Page    = IpagedClaims.PageIndex + 1,
                Perpage = IpagedClaims.PageSize,
                Pages   = IpagedClaims.TotalPages,
                Sort    = searchModel.Sort,
                Field   = searchModel.Field,
                Total   = IpagedClaims.TotalCount
            };
            return(model);
        }
        /// <summary>
        /// Handler=Ajax
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public async Task <IActionResult> OnGetAjaxAsync(int pageIndex = 1, int pageSize = 10)
        {
            var result = await _mpAccountService.GetObjectListAsync(pageIndex, pageSize, z => true, z => z.Id, Ncf.Core.Enums.OrderingType.Descending);

            var mpAccountDtos = new PagedList <MpAccountDto>(result.Select(z => _mpAccountService.Mapper.Map <MpAccountDto>(z)).ToList(), result.PageIndex, result.PageCount, result.TotalCount);

            return(Ok(new { mpAccountDtos.TotalCount, pageIndex, pageSize, list = mpAccountDtos.AsEnumerable() }));
            //测试,将用户加入某个组
            //await Senparc.Weixin.MP.AdvancedAPIs.UserTagApi.BatchTaggingAsync(MpAccountDtos[0].AppId, 2, new System.Collections.Generic.List<string> { "oxRg0uLsnpHjb8o93uVnwMK_WAVw" });
        }