public bool SendImage(List <ImageInfo> imageInfoList, DownloadConfig config) { var batchNo = imageInfoList.Select(x => x.BatchNo).FirstOrDefault(); var list = imageInfoList.Cast <ImageInfoByHpList>().ToList(); var entity = new SPEH_IMDI_IMAGE_DETAIL_INFO_SENT_STS_UPDATE_OCR { ConnectionString = ConnectionStringConfig <SPEH_IMDI_IMAGE_DETAIL_INFO_SENT_STS_UPDATE_OCR> .GetConnectionString(config.ConnectionStringDictionary), pIMIM_KY_LIST = list.Select(x => new Entites.HpList.TableType.KY_LIST(x.ImimKy)).ToList().ToDataTable(), pSTS = ((int)ResultJsonStatus.Success).ToString() }; _commonBl.Execute(entity); return(entity.ReturnValue == 1); }
public bool GetResult(int imimKey, string json, DownloadConfig config, bool status) { if (!status) { var e = new SPEH_IMDI_IMAGE_DETAIL_INFO_SENT_STS_UPDATE_OCR { ConnectionString = ConnectionStringConfig <SPEH_CLIM_CLM_IMIM_STTS_UPDATE_OCR> .GetConnectionString(config.ConnectionStringDictionary), pIMIM_KY_LIST = new List <Entites.HpList.TableType.KY_LIST> { new Entites.HpList.TableType.KY_LIST(imimKey) } .ToDataTable(), pSTS = ((int)ResultJsonStatus.Failed).ToString(), }; _commonBl.Execute(e); return(e.ReturnValue == 1); } var item = json.FromJson <HospitalListJson>(); //Console.WriteLine(imimKey + ":" + json); var pclslList = item.data.Select(x => new USDF_CLSL_INFO_OCR { CLSL_TYPE = x.name.Contains(@"门诊") ? "1" : x.name.Contains(@"住院") ? "2" : "0", CLSL_NAME = x.value1, CLSL_VALUES = x.value2, CLSL_VALUES_3 = x.value3, CLSL_VALUES_4 = x.value4, CLSL_VALUES_5 = x.value5, IMCO_COORDINATE_INFO = x.coord.ToJson(), //IMCO_PRJ_COORDINATE_1_Y = !string.IsNullOrEmpty(x.coord1) ? float.Parse(x.coord1.Split(',')[1]) : 0F, //IMCO_PRJ_COORDINATE_2_X = !string.IsNullOrEmpty(x.coord2) ? float.Parse(x.coord2.Split(',')[0]) : 0F, //IMCO_PRJ_COORDINATE_2_Y = !string.IsNullOrEmpty(x.coord2) ? float.Parse(x.coord2.Split(',')[1]) : 0F, CONF_1 = x.conf1, CONF_2 = x.conf2, CONF_3 = x.conf3, CONF_4 = x.conf4, CONF_5 = x.conf5, }).ToList(); var entity = new SPIN_CLSL_INSERT_OCR { ConnectionString = ConnectionStringConfig <SPIN_CLSL_INSERT_OCR> .GetConnectionString(config.ConnectionStringDictionary), pFLFL_KY = $"{config.SourceServerIp }{ imimKey}", pIMIM_KY = imimKey.ToString(), pCLSL_INFO = pclslList.ToDataTable(), }; try { _commonBl.Execute(entity); return(entity.ReturnValue == 1); } catch (Exception ex) { Nlog.Info($"{config.NLogName}.json", $"getresult catch:{ex.Message}"); var e = new SPEH_IMDI_IMAGE_DETAIL_INFO_SENT_STS_UPDATE_OCR { ConnectionString = ConnectionStringConfig <SPEH_CLIM_CLM_IMIM_STTS_UPDATE_OCR> .GetConnectionString(config.ConnectionStringDictionary), pIMIM_KY_LIST = new List <Entites.HpList.TableType.KY_LIST> { new Entites.HpList.TableType.KY_LIST(imimKey) } .ToDataTable(), pSTS = ((int)ResultJsonStatus.Failed).ToString(), }; _commonBl.Execute(e); return(false); } }