Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
WeComApi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
changjin.pan
WeComApi
Commits
5ef3e985
Commit
5ef3e985
authored
May 10, 2022
by
姚传斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交更新
parent
ff99a7c5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
111 deletions
+1
-111
EPPlusExcelHelper.cs
src/Siger.WeComApi.Common/Helpers/EPPlusExcelHelper.cs
+0
-0
EpPlusEchartHelper.cs
src/Siger.WeComApi.Common/Helpers/EpPlusEchartHelper.cs
+0
-109
Siger.WeComApi.Common.csproj
src/Siger.WeComApi.Common/Siger.WeComApi.Common.csproj
+0
-1
appsettings.json
src/Siger.WeComApi.WebApi/appsettings.json
+1
-1
No files found.
src/Siger.WeComApi.Common/Helpers/EPPlusExcelHelper.cs
deleted
100644 → 0
View file @
ff99a7c5
This diff is collapsed.
Click to expand it.
src/Siger.WeComApi.Common/Helpers/EpPlusEchartHelper.cs
deleted
100644 → 0
View file @
ff99a7c5
using
System
;
using
System.Linq
;
using
System.Text
;
using
OfficeOpenXml
;
using
OfficeOpenXml.Drawing.Chart
;
namespace
Siger.WeComApi.Common.Helpers
{
public
class
EpPlusEchartHelper
{
private
readonly
ExcelWorksheet
_worksheet1
;
private
readonly
ExcelWorksheet
_worksheet2
;
private
int
_rowCount
;
public
EpPlusEchartHelper
(
ExcelWorksheet
worksheet1
,
ExcelWorksheet
worksheet2
,
int
rowCount
)
{
_worksheet1
=
worksheet1
;
_worksheet2
=
worksheet2
;
_rowCount
=
rowCount
;
}
//OEE 柱形图
public
void
CreateOeeChart
()
{
ExcelChart
chart
=
_worksheet1
.
Drawings
.
AddChart
(
"chart"
,
eChartType
.
ColumnStacked
);
ExcelChartSerie
serie
=
chart
.
Series
.
Add
(
_worksheet2
.
Cells
[
2
,
3
,
_rowCount
,
3
],
_worksheet2
.
Cells
[
2
,
2
,
_rowCount
,
2
]);
serie
.
HeaderAddress
=
_worksheet2
.
Cells
[
1
,
3
];
chart
.
SetPosition
(
50
,
10
);
chart
.
Title
.
Text
=
"OEE"
;
chart
.
Title
.
Font
.
Size
=
15
;
chart
.
Title
.
Font
.
Bold
=
true
;
chart
.
Style
=
eChartStyle
.
Style15
;
}
//OEE 多条簇状柱形图
public
void
CreateOeeDetailChart
()
{
ExcelChartSerie
serie
=
null
;
ExcelChart
chart
=
_worksheet1
.
Drawings
.
AddChart
(
"chart"
,
eChartType
.
ColumnClustered
);
for
(
var
i
=
2
;
i
<=
_rowCount
+
1
;
i
++)
{
var
x
=
_worksheet2
.
Cells
[
i
,
2
].
Value
.
ToString
();
var
y
=
string
.
Empty
;
for
(
var
j
=
3
;
j
<=
6
;
j
++)
{
y
+=
_worksheet2
.
Cells
[
i
,
j
].
Value
+
","
;
}
serie
=
chart
.
Series
.
Add
(
y
.
TrimEnd
(
','
),
x
);
serie
.
HeaderAddress
=
_worksheet2
.
Cells
[
1
,
6
];
}
chart
.
SetPosition
(
50
,
10
);
chart
.
Title
.
Text
=
"OEE"
;
chart
.
Title
.
Font
.
Size
=
15
;
chart
.
Title
.
Font
.
Bold
=
true
;
chart
.
Style
=
eChartStyle
.
Style15
;
}
//切片 百分比堆积柱状图
public
void
CreateSliceChart
()
{
ExcelChartSerie
serie
=
null
;
ExcelChart
chart
=
_worksheet1
.
Drawings
.
AddChart
(
"chart"
,
eChartType
.
ColumnStacked100
);
var
cells
=
$"B1:
{
ToAlphaString
(
_worksheet2
.
Dimension
.
End
.
Column
)}
1"
;
ExcelRangeBase
rowRange
=
_worksheet2
.
Cells
[
cells
];
//X
for
(
int
i
=
_worksheet2
.
Dimension
.
Start
.
Row
;
i
<
_worksheet2
.
Dimension
.
End
.
Row
+
1
;
i
++)
{
if
(
i
>
1
)
{
ExcelRangeBase
yRange
=
_worksheet2
.
Cells
[
i
,
2
,
i
,
_worksheet2
.
Dimension
.
End
.
Column
];
//X
serie
=
chart
.
Series
.
Add
(
yRange
,
rowRange
);
//设置Y轴,X轴
serie
.
HeaderAddress
=
_worksheet2
.
Cells
[
i
,
1
];
//设置图表的图例
}
}
chart
.
SetPosition
(
50
,
10
);
chart
.
Title
.
Text
=
"设备切片分析"
;
chart
.
Title
.
Font
.
Size
=
15
;
chart
.
Title
.
Font
.
Bold
=
true
;
chart
.
Style
=
eChartStyle
.
Style10
;
}
public
void
CreateEfficiencyAnalysis
()
{
ExcelChart
chart
=
_worksheet1
.
Drawings
.
AddChart
(
"chart"
,
eChartType
.
ColumnStacked
);
ExcelChartSerie
serie
=
chart
.
Series
.
Add
(
_worksheet2
.
Cells
[
2
,
2
,
_rowCount
,
2
],
_worksheet2
.
Cells
[
2
,
1
,
_rowCount
,
1
]);
serie
.
HeaderAddress
=
_worksheet2
.
Cells
[
1
,
3
];
chart
.
SetPosition
(
50
,
10
);
chart
.
Title
.
Text
=
"时间稼动率"
;
chart
.
Title
.
Font
.
Size
=
15
;
chart
.
Title
.
Font
.
Bold
=
true
;
chart
.
Style
=
eChartStyle
.
Style15
;
}
private
static
string
ToAlphaString
(
int
value
)
{
var
dividend
=
value
;
var
columnName
=
string
.
Empty
;
while
(
dividend
>
0
)
{
var
modulo
=
(
dividend
-
1
)
%
26
;
columnName
=
Convert
.
ToChar
(
65
+
modulo
)
+
columnName
;
dividend
=
(
dividend
-
modulo
)
/
26
;
}
return
columnName
;
}
}
}
src/Siger.WeComApi.Common/Siger.WeComApi.Common.csproj
View file @
5ef3e985
...
...
@@ -20,7 +20,6 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="CSRedisCore" Version="3.6.8" />
<PackageReference Include="EPPlus.Core" Version="1.5.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Siger.Common.UniformConfigApplicationEntity" Version="1.0.0" />
<PackageReference Include="Siger.CommonUtil" Version="1.0.15" />
...
...
src/Siger.WeComApi.WebApi/appsettings.json
View file @
5ef3e985
{
"IsUseConfigCenter"
:
"1"
,
"GroupId"
:
"1_21"
,
"UnifromUrl"
:
"http://
localhost
:8800/api"
,
"UnifromUrl"
:
"http://
172.8.10.112
:8800/api"
,
"Logging"
:
{
"LogLevel"
:
{
"Default"
:
"Trace"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment