/// <summary> /// 项目下载总条数 /// </summary> /// <param name="param"></param> /// <returns></returns> public Int64 ProjectDownloadCount(ResidentProjectDownloadParam param) { Int64 resultData = 0; var xmlStr = XmlHelp.SaveXml(param); if (!xmlStr) { throw new Exception("项目下载总条数保存参数出错"); } int result = MedicalInsuranceDll.CallService_cxjb("CXJB019"); if (result != 1) { throw new Exception("项目下载总条数执行出错!!!"); } var data = XmlHelp.DeSerializerModel(new ProjectDownloadCountDto(), true); resultData = data.PO_CNT; return(resultData); }
/// <summary> /// 项目下载 /// </summary> public ResidentProjectDownloadDto ProjectDownload(ResidentProjectDownloadParam param) { ResidentProjectDownloadDto data = null; var xmlStr = XmlHelp.SaveXml(param); if (!xmlStr) { throw new Exception("项目下载保存参数出错"); } int result = MedicalInsuranceDll.CallService_cxjb("CXJB019"); if (result != 1) { throw new Exception("项目下载执行出错!!!"); } string strXml = XmlHelp.DeSerializerModelStr("ROWDATA"); data = XmlHelp.DeSerializer <ResidentProjectDownloadDto>(strXml); return(data); }
/// <summary> /// 医保项目下载 /// </summary> /// <param name="param"></param> /// <returns></returns> public string ProjectDownload(ResidentProjectDownloadParam param) { ResidentProjectDownloadDto data; var pageIni = param.Page; param.QueryType = 1; var updateTime = _medicalInsuranceSqlRepository.ProjectDownloadTimeMax(); if (!string.IsNullOrWhiteSpace(updateTime)) { param.UpdateTime = Convert.ToDateTime(updateTime).ToString("yyyyMMdd"); } var count = _residentMedicalInsuranceRepository.ProjectDownloadCount(param); var cnt = Convert.ToInt32(count / param.Limit) + ((count % param.Limit) > 0 ? 1 : 0); param.QueryType = 2; Int64 allNum = 0; var i = 0; while (i < cnt) { param.Page = i + pageIni; data = _residentMedicalInsuranceRepository.ProjectDownload(param); if (data != null && data.Row.Any()) { allNum += data.Row.Count; _medicalInsuranceSqlRepository.ProjectDownload(new UserInfoDto() { UserId = param.UserId }, data.Row); } i++; } var resultData = "下载成功共" + allNum + "条记录"; return(resultData); }