소스 검색

Merge branch 'Release2.4' of http://36.129.163.148:10080/gaoshipeng/OTS2_0 into Release2.4

GZ 3 년 전
부모
커밋
8f70ce69c7

+ 1 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -1023,7 +1023,7 @@ namespace OTSIncAReportApp.Control_ECharts
         }
         private string getWhere(string max, string min, string col)
         {
-            return col + ">=" + min + " and " + col + "<=" + max;
+            return col + ">=" + min + " and " + col + "<" + max;
         }
         #endregion
 

+ 1 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_Trianglediagram.cs

@@ -535,7 +535,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 //为页面图形提供数据参数
                 string str = m_ReportApp.data;
                 //执行网页脚本事件
-                m_ReportApp.browser_trio.ExecuteScriptAsync("showchart('" + str + "','triangle')");
+                m_ReportApp.browser_trio.ExecuteScriptAsync("showchart('" + str + "','','triangle')");
             }
         }
         //public string GetPic()

+ 33 - 4
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -356,7 +356,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         public Particle GetParticleByFidAndPid(string fieldid, string particleid)
         {
             string sqlp = @"select *,(select xraydata from xraydata where xrayindex=INcAData.xrayid and fieldid="
-            + fieldid + ") as XRayData,(select group_concat(name || '-' || Percentage, ';')from ElementChemistry where XRayId = INcAData.XRayId and fieldid ="
+            + fieldid + ") as XRayData,(select group_concat(name || '_' || Percentage, ';')from ElementChemistry where XRayId = INcAData.XRayId and fieldid ="
             + fieldid + ") as Element from INcAData where fieldid="
             + fieldid + " and particleid= " + particleid;
 
@@ -372,7 +372,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 {
                     if (element.Split(';')[i] != "")
                     {
-                        Element ele = new Element() { Name = element.Split(';')[i].Split('-')[0], Percentage = Convert.ToDouble(element.Split(';')[i].Split('-')[1]) };
+                        Element ele = new Element() { Name = element.Split(';')[i].Split('_')[0], Percentage = Convert.ToDouble(element.Split(';')[i].Split('_')[1]) };
                         ElementList.Add(ele);
                     }
                 }
@@ -446,7 +446,17 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             }
             //particlesAll = GetInfoForPartucleDevidePage2("");
 
-            DataTable elementchemistry = GetElementChemistry();
+            //DataTable elementchemistry = GetElementChemistry();
+
+            DataTable dt_element = GetElementChemistry();
+            DataTable elementchemistry = dt_element.Clone();
+            for (int i = 0; i < dt_element.Rows.Count; i++)
+            {
+                if (dt_element.Rows[i]["Name"].ToString() != "Fe")
+                {
+                    elementchemistry.Rows.Add(dt_element.Rows[i].ItemArray);
+                }
+            }
             for (int i = 0; i < particlesAll.Rows.Count; i++)
             {
                 string str = "XRayId = " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
@@ -454,7 +464,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
                 string ConcatenatedString = "";
                 for (int j = 0; j < drs.Length; j++)
                 {
-                    ConcatenatedString += drs[j]["name"] + "-" + drs[j]["Percentage"] + ';';
+                    ConcatenatedString += drs[j]["name"] + "-" + ChangeDataToD(drs[j]["Percentage"].ToString()) + ';';
                 }
                 particlesAll.Rows[i]["Element"] = ConcatenatedString;
             }
@@ -465,6 +475,25 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             //DataTable dt = dbHelper.ExecuteQuery(sqlliteString);
             return particlesAll;
         }
+
+        /// <summary>
+        /// 保留两位小数
+        /// </summary>
+        /// <param name="strData"></param>
+        /// <returns></returns>
+        private string ChangeDataToD(string strData)
+        {
+            Decimal dData = 0.00M;
+            if (strData.Contains("E"))
+            {
+                dData = Convert.ToDecimal(Decimal.Parse(strData.ToString(), System.Globalization.NumberStyles.Float));
+            }
+            else
+            {
+                return Convert.ToDouble(strData).ToString("0.00");
+            }
+            return Convert.ToDouble(dData).ToString("0.00");
+        }
         public DataTable GetInfoForPartucleDevidePage2(string condition)
         {
             string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;