|
@@ -53,19 +53,35 @@ var failnum=0;
|
|
var passnum=0
|
|
var passnum=0
|
|
var passdata=[];
|
|
var passdata=[];
|
|
var faildata=[];
|
|
var faildata=[];
|
|
-var num=1;
|
|
|
|
|
|
+var num=0;
|
|
var hispass=[];
|
|
var hispass=[];
|
|
var hisfail=[];
|
|
var hisfail=[];
|
|
var hisstack=[];
|
|
var hisstack=[];
|
|
var hisrate=[];
|
|
var hisrate=[];
|
|
|
|
+var goodpass=[];
|
|
|
|
+var goodid=[];
|
|
|
|
+var goodfailrate=[];
|
|
|
|
+var badpass=[];
|
|
|
|
+var badid=[];
|
|
|
|
+var badfailrate=[];
|
|
var t=0;
|
|
var t=0;
|
|
|
|
+var n=0;
|
|
|
|
+var flowID=1;
|
|
function firsttime_load_spots_data() {
|
|
function firsttime_load_spots_data() {
|
|
get_data("fcWorkRaw/allSpots?flowId=" + thisPageFlow, first_success)
|
|
get_data("fcWorkRaw/allSpots?flowId=" + thisPageFlow, first_success)
|
|
}
|
|
}
|
|
function secondtime_load_spots_data() {
|
|
function secondtime_load_spots_data() {
|
|
- get_data("fcWorkRaw/allFlows?type=" + num, second_success);
|
|
|
|
|
|
+ get_data("fcBiFlowDaily/list?type=" + num +"&flowId="+flowID, second_success);
|
|
num++;
|
|
num++;
|
|
}
|
|
}
|
|
|
|
+function chart_load_spots_data() {
|
|
|
|
+ get_data("fcBiWorkerDaily/get?type=0&limit=3", chart_success);
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+function chart1_load_spots_data() {
|
|
|
|
+ get_data("fcBiWorkerDaily/get?type=4&limit=3", chart1_success);
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
|
|
function first_success(obj, sta) {
|
|
function first_success(obj, sta) {
|
|
var output = first_parse(this, obj);
|
|
var output = first_parse(this, obj);
|
|
@@ -100,6 +116,9 @@ function first_success(obj, sta) {
|
|
for(i=1;i<5;i++) {
|
|
for(i=1;i<5;i++) {
|
|
secondtime_load_spots_data();
|
|
secondtime_load_spots_data();
|
|
}
|
|
}
|
|
|
|
+ chart_load_spots_data();
|
|
|
|
+ chart1_load_spots_data();
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -108,33 +127,71 @@ function first_success(obj, sta) {
|
|
setInterval(function(){
|
|
setInterval(function(){
|
|
get_data("fcWorkRaw/allSpots?flowId=" + thisPageFlow, realtime_success);
|
|
get_data("fcWorkRaw/allSpots?flowId=" + thisPageFlow, realtime_success);
|
|
},1000);
|
|
},1000);
|
|
- document.getElementById("test1").innerHTML = passnum;
|
|
|
|
- document.getElementById("test2").innerHTML = failnum;
|
|
|
|
- document.getElementById("test3").innerHTML = Math.floor(passnum/(passnum+failnum)*100)/100+'%';
|
|
|
|
- document.getElementById("test4").innerHTML = stacknum;
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
function second_success(obj, sta) {
|
|
function second_success(obj, sta) {
|
|
var history = first_parse(this, obj);
|
|
var history = first_parse(this, obj);
|
|
var i, j;
|
|
var i, j;
|
|
- for (i = 0; i < history.length; i++) {
|
|
|
|
- if (history[i].flowId == thisPageFlow) {
|
|
|
|
- hispass[t] = history[t].flowPass;
|
|
|
|
- hisfail[t] = history[t].flowFail;
|
|
|
|
- hisstack[t] = 0;
|
|
|
|
|
|
+ console.log(" history : ");
|
|
|
|
+ console.log(history);
|
|
|
|
+ hispass[t] = 0;
|
|
|
|
+ hisfail[t] = 0;
|
|
|
|
+ hisstack[t] = 0;
|
|
|
|
+ hisrate[t]=0;
|
|
|
|
+ for(i=0;i<history.length;i++){
|
|
|
|
|
|
|
|
|
|
- if (hispass[t] + hisfail[t] == 0) {
|
|
|
|
- hisrate[t] = 0;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- hisrate[t] = hisfail[i] / (hispass[i] + hisfail[i]) * 100;
|
|
|
|
- }
|
|
|
|
- hisrate[t]=Math.floor(hisrate[t]);
|
|
|
|
|
|
+ hispass[t] = history[i].passNum+hispass[t];
|
|
|
|
+ hisfail[t] = history[i].failNum+hisfail[t];
|
|
|
|
+ hisstack[t] = history[i].avgDue+hisstack[t];
|
|
|
|
+ hisrate[t] = history[i].failRate;
|
|
|
|
+ hisrate[t]=hisrate[t]/100;
|
|
|
|
|
|
|
|
|
|
- t++;
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ if(history.length!=1){
|
|
|
|
+ hisrate[t]=hisfail[t]/(hispass[t]+hisfail[t]);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+ if(hispass[t]+hisfail[t]==0){
|
|
|
|
+ hisrate[t]=0;
|
|
|
|
+ }
|
|
|
|
+ t++;
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+function chart_success(obj, sta) {
|
|
|
|
+ var redchart = first_parse(this, obj);
|
|
|
|
+ var i, j;
|
|
|
|
+ i=j=0;
|
|
|
|
+ console.log(" redchart : ");
|
|
|
|
+ console.log(redchart);
|
|
|
|
+
|
|
|
|
+ for(i=0;i<3;i++){
|
|
|
|
+ goodid[i]=redchart.list[i].workerId;
|
|
|
|
+ goodpass[i]=redchart.list[i].passNum;
|
|
|
|
+ goodfailrate[i]=redchart.list[i].failRate/100;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+function chart1_success(obj, sta) {
|
|
|
|
+ var blackchart = first_parse(this, obj);
|
|
|
|
+ var i, j;
|
|
|
|
+ i=j=0;
|
|
|
|
+ console.log(" black chart : ");
|
|
|
|
+ console.log(blackchart);
|
|
|
|
+
|
|
|
|
+ for(i=0;i<3;i++){
|
|
|
|
+ badid[i]=blackchart.list[i].workerId;
|
|
|
|
+ badpass[i]=blackchart.list[i].passNum;
|
|
|
|
+ badfailrate[i]=blackchart.list[i].failRate/100;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -163,10 +220,7 @@ function realtime_success(obj, sta) {
|
|
stacknum = stackeverynum[i] + stacknum;
|
|
stacknum = stackeverynum[i] + stacknum;
|
|
}
|
|
}
|
|
updateChart();
|
|
updateChart();
|
|
- document.getElementById("test1").innerHTML = passnum;
|
|
|
|
- document.getElementById("test2").innerHTML = failnum;
|
|
|
|
- document.getElementById("test3").innerHTML = Math.floor(passnum/(passnum+failnum)*100)/100+'%';
|
|
|
|
- document.getElementById("test4").innerHTML = stacknum;
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function on_load_success_spots(obj, status) {
|
|
function on_load_success_spots(obj, status) {
|