Browse Source

1. 調整生產效率看板畫面

master
Sai 1 year ago
parent
commit
2d00da6950
  1. 60
      AMESCoreStudio.Web/Views/RPT/RPT001.cshtml
  2. 20
      AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs

60
AMESCoreStudio.Web/Views/RPT/RPT001.cshtml

@ -69,7 +69,7 @@
<script src="~/Highcharts-7.1.2/modules/export-data.js"></script> <script src="~/Highcharts-7.1.2/modules/export-data.js"></script>
<div class="layui-card"> <div class="layui-card">
<form enctype="multipart/form-data" method="post" asp-action="RPT001" class="layui-form"> <form enctype="multipart/form-data" method="post" asp-action="RPT001" class="layui-form">
<div class="layui-card-header" style="background-color:#404040"> <div class="layui-card-header" style="background-color:#404040">
<div class="layui-form"> <div class="layui-form">
<div class="layui-form-item" style="color:#FFFFFF"> <div class="layui-form-item" style="color:#FFFFFF">
@ -222,13 +222,17 @@
</div> </div>
</div> </div>
</div> </div>
</div> <div class="layui-row DetailRow">
<div class="layui-row DetailRow"> <div class="layui-col-md6">
<div class="layui-col-md6"> <div class="layui-row ColRight">
<div id="divChart1" style="width: 100%; height: 300px; margin: 0 auto"></div> <div id="divChart1" style="width: 100%; height: 300px; margin: 0 auto"></div>
</div> </div>
<div class="layui-col-md6"> </div>
<div id="divChart2" style="width: 100%; height: 300px; margin: 0 auto"></div> <div class="layui-col-md6">
<div class="layui-row ColLeft">
<div id="divChart2" style="width: 100%; height: 300px; margin: 0 auto"></div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -248,7 +252,9 @@
}); });
$(document).ready(function () { $(document).ready(function () {
// Sai 取得查詢月份
var month = queryDate.value.substring(4, 6);
var numericmonth = parseInt(month);
$.ajax({ $.ajax({
type: "Post", type: "Post",
url: '/RPT/GetMonthData4RPT001A?id=01_' + queryDate.value, url: '/RPT/GetMonthData4RPT001A?id=01_' + queryDate.value,
@ -262,15 +268,20 @@
yieldData[idx] = item["yield"]; yieldData[idx] = item["yield"];
xAxisData[idx] = item["month"]; xAxisData[idx] = item["month"];
idx = idx + 1; idx = idx + 1;
// Sai 指定效率值
if (idx == numericmonth) {
yieldData[idx - 1] = @Model.productiveForces
}
}); });
Highcharts.chart('divChart1', { Highcharts.chart('divChart1', {
title: { title: {
text: queryYear.value + '生產力', text: queryYear.value + '生產力',
style: style:
{ {
color:'#FFFFFF' color:'#FFFFFF'
} }
}, },
subtitle: { subtitle: {
text: '' text: ''
@ -278,7 +289,7 @@
chart: { chart: {
backgroundColor:'#262626', backgroundColor:'#262626',
color:'#FFFFFF' color:'#FFFFFF'
}, },
xAxis: { xAxis: {
categories: xAxisData, categories: xAxisData,
@ -292,10 +303,10 @@
yAxis: { yAxis: {
title: { title: {
text: queryYear.value + '生產力', text: queryYear.value + '生產力',
style: style:
{ {
color:'#FFFFFF' color:'#FFFFFF'
} }
}, },
labels: { labels: {
style: style:
@ -305,7 +316,7 @@
} }
}, },
plotOptions: { plotOptions: {
series: series:
{ {
lineColor:'yellow', lineColor:'yellow',
marker: { marker: {
@ -330,7 +341,7 @@
}, },
itemHoverStyle:{ itemHoverStyle:{
color: '#FFFFFF' color: '#FFFFFF'
} }
}, },
series: [{ series: [{
type: 'column', type: 'column',
@ -363,15 +374,20 @@
yieldData[idx] = item["yield"]; yieldData[idx] = item["yield"];
xAxisData[idx] = item["month"]; xAxisData[idx] = item["month"];
idx = idx + 1; idx = idx + 1;
// Sai 指定效率值
if (idx == numericmonth) {
yieldData[idx - 1] = @Model.productivity
}
}); });
Highcharts.chart('divChart2', { Highcharts.chart('divChart2', {
title: { title: {
text: queryYear.value + '效率', text: queryYear.value + '效率',
style: style:
{ {
color:'#FFFFFF' color:'#FFFFFF'
} }
}, },
subtitle: { subtitle: {
text: '' text: ''
@ -379,7 +395,7 @@
chart: { chart: {
backgroundColor:'#262626', backgroundColor:'#262626',
color:'#FFFFFF' color:'#FFFFFF'
}, },
xAxis: { xAxis: {
categories: xAxisData, categories: xAxisData,
@ -393,7 +409,7 @@
yAxis: { yAxis: {
title: { title: {
text: queryYear.value + '效率', text: queryYear.value + '效率',
style: style:
{ {
color:'#FFFFFF' color:'#FFFFFF'
} }
@ -406,7 +422,7 @@
} }
}, },
plotOptions: { plotOptions: {
series: series:
{ {
lineColor:'yellow', lineColor:'yellow',
marker: { marker: {
@ -431,7 +447,7 @@
}, },
itemHoverStyle:{ itemHoverStyle:{
color: '#FFFFFF' color: '#FFFFFF'
} }
}, },
series: [{ series: [{
type: 'column', type: 'column',

20
AMESCoreStudio.WebApi/Controllers/BLL/RPTController.cs

@ -2033,24 +2033,22 @@ namespace AMESCoreStudio.WebApi.Controllers.BLL
TimeSpan ts = end.Subtract(str); TimeSpan ts = end.Subtract(str);
var WorkTime = (double)Math.Abs(Math.Round(ts.TotalMinutes, 2)); var WorkTime = (double)Math.Abs(Math.Round(ts.TotalMinutes, 2));
// 計算效率 // SMT 交接時間
var sfis = new CheckSfisKayPartController(); // 0750 - 0800
result.workTime = await sfis.GetWorkTime(result.product, result.unitNo,
q.FirstOrDefault().LINE_DESC, q.FirstOrDefault().STATION_NAME);
// SMT 交班時間
// 0750-0800
if (str < Convert.ToDateTime("07:50:00") && Convert.ToDateTime("08:00:00") < end) if (str < Convert.ToDateTime("07:50:00") && Convert.ToDateTime("08:00:00") < end)
WorkTime -= 10; WorkTime -= 10;
// 1550 - 1600
// 1550-1600
if (str < Convert.ToDateTime("15:50:00") && Convert.ToDateTime("16:00:00") < end) if (str < Convert.ToDateTime("15:50:00") && Convert.ToDateTime("16:00:00") < end)
WorkTime -= 10; WorkTime -= 10;
// 2350 - 2400
// 2350-0000
if (str < Convert.ToDateTime("23:50:00") && Convert.ToDateTime("23:59:00") < end) if (str < Convert.ToDateTime("23:50:00") && Convert.ToDateTime("23:59:00") < end)
WorkTime -= 10; WorkTime -= 10;
// 計算效率
var sfis = new CheckSfisKayPartController();
result.workTime = await sfis.GetWorkTime(result.product, result.unitNo,
q.FirstOrDefault().LINE_DESC, q.FirstOrDefault().STATION_NAME);
// 標準總工時 = 標準工時 * 實際投入數量 // 標準總工時 = 標準工時 * 實際投入數量
var allWorkTime = result.workTime * result.actualQty; var allWorkTime = result.workTime * result.actualQty;
result.efficiency = Math.Round((allWorkTime / WorkTime * 100), 2); result.efficiency = Math.Round((allWorkTime / WorkTime * 100), 2);

Loading…
Cancel
Save