Beispiel #1
0
        public string GetDataByBZ(string projectid, string projectname, string filePath, string userId)
        {
            _logger.LogWarning($"输入参数, projectid:{projectid},projectname:{projectname},filepath:{filePath},userid:{userId}");

            string  url       = "";
            decimal datasetId = 0;

            try
            {
                DataTable dt = ExcelImport(filePath);
                if (dt != null & dt.Rows.Count > 0)
                {
                    datasetId = _dataSetRepository.ExtractEngineDataForService(projectid, projectname, userId, dt);
                }
            }
            catch (Exception ex)
            {
                return("导入数据失败");

                _logger.LogError("GetDataByBZ ex.Message:" + ex.Message + Environment.NewLine + "ex.StackTrace" + ex.StackTrace);
            }
            if (datasetId > 0)
            {
                string sitePath = GlobalSetting.SiteUrl;
                url = $"{sitePath}/" + "?datasetId=" + datasetId;
            }

            return(url);
        }