diff --git a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java index 536d357..c96b4c3 100644 --- a/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java +++ b/productionboard/src/main/java/com/productionboard/controller/FoamBoxController.java @@ -67,8 +67,9 @@ public class FoamBoxController { */ @GetMapping("/getTeamStatisticsJson") @ResponseBody - public String getTeamStatisticsJson(){ - List mesTeamStatisticsList = iMesProductionDataService.getMesTeamStatisticsList("1002"); + public String getTeamStatisticsJson(String ids){ + String type=(ids.equals("0"))?"1029":"1012"; + List mesTeamStatisticsList = iMesProductionDataService.getMesTeamStatisticsList(type); if(mesTeamStatisticsList.size()>0){ return JSONArray.toJSONString(mesTeamStatisticsList.get(0)); } @@ -85,6 +86,7 @@ public class FoamBoxController { @GetMapping("/getRunStatusJson") @ResponseBody public String getRunStatusJson(String ids){ + System.out.println("发泡机状态"+ids); String runStatus = ifamBoxDeviceInfoService.getRunStatus(ids); return runStatus; @@ -133,11 +135,16 @@ public class FoamBoxController { * @author WenJY * @date 2022-06-09 16:54 * @return java.lang.String + * Proce_Code =1029 发泡前出库南线 + * Proce_Code =1012 发泡前出库北线 */ @GetMapping("/getHourProdutionJson") @ResponseBody - public String getHourProdutionStatisticsJson(){ - List mesHourProdutionStatisticsList = iMesProductionDataService.getMesHourProdutionStatisticsList("1002"); + public String getHourProdutionStatisticsJson(String ids){ + System.out.println("通过工位号获取MES小时产量:"+ids); + String type=(ids.equals("0"))?"1029":"1012"; + List mesHourProdutionStatisticsList = + iMesProductionDataService.getMesHourProdutionStatisticsList(type); if(mesHourProdutionStatisticsList.size()>0){ return JSONArray.toJSONString(mesHourProdutionStatisticsList); } @@ -152,9 +159,10 @@ public class FoamBoxController { */ @GetMapping("/getMaterialProdutionJson") @ResponseBody - public String getMaterialProdutionStatisticsJson(){ - - List mesMaterialProductionStatisticsList = iMesProductionDataService.getMesMaterialProductionStatisticsList("1002"); + public String getMaterialProdutionStatisticsJson(String ids){ + String type=(ids.equals("0"))?"1029":"1012"; + List mesMaterialProductionStatisticsList = + iMesProductionDataService.getMesMaterialProductionStatisticsList(type); return JSONArray.toJSONString(mesMaterialProductionStatisticsList); } @@ -168,7 +176,9 @@ public class FoamBoxController { @GetMapping("/getMaterialStoreJson") @ResponseBody public String getMesMaterialStoreStatisticsJson(){ - List mesMaterialStoreStatisticsList = iMesProductionDataService.getMesMaterialStoreStatisticsList("1002"); + + List mesMaterialStoreStatisticsList = + iMesProductionDataService.getMesMaterialStoreStatisticsList("B001"); return JSONArray.toJSONString(mesMaterialStoreStatisticsList); } diff --git a/productionboard/src/main/resources/static/js/foamBox/index.js b/productionboard/src/main/resources/static/js/foamBox/index.js index 18b021c..534791c 100644 --- a/productionboard/src/main/resources/static/js/foamBox/index.js +++ b/productionboard/src/main/resources/static/js/foamBox/index.js @@ -1,7 +1,7 @@ $(() => { //班组计划统计 - $.getJSON('/foamBox/getTeamStatisticsJson', function (result) { + $.getJSON(`/foamBox/getTeamStatisticsJson?ids=${ids}`, function (result) { onDutyPlan(result.planAmount, result.actualAmount, result.differenceAmount,) }); @@ -18,12 +18,12 @@ $(() => { }); //按型号统计产量 - $.getJSON('/foamBox/getMaterialProdutionJson', function (result) { + $.getJSON(`/foamBox/getMaterialProdutionJson?ids=${ids}`, function (result) { horizontalBarChart(result, document.getElementById("statisticalOutputByModel")); }); //小时产量 - $.getJSON('/foamBox/getHourProdutionJson', function (result) { + $.getJSON(`/foamBox/getHourProdutionJson?ids=${ids}`, function (result) { brokenLineAreaDiagram(result, document.getElementById("hourlyOutputStatistics")); }); diff --git a/productionboard/src/main/resources/templates/foamBox/index.html b/productionboard/src/main/resources/templates/foamBox/index.html index e40df48..044cd87 100644 --- a/productionboard/src/main/resources/templates/foamBox/index.html +++ b/productionboard/src/main/resources/templates/foamBox/index.html @@ -49,6 +49,7 @@ + \ No newline at end of file diff --git a/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class b/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class index ca996e9..df193fd 100644 Binary files a/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class and b/productionboard/target/classes/com/productionboard/controller/FoamBoxController.class differ diff --git a/productionboard/target/classes/static/js/common/echarts.common.js b/productionboard/target/classes/static/js/common/echarts.common.js index 8cf5959..b67df25 100644 --- a/productionboard/target/classes/static/js/common/echarts.common.js +++ b/productionboard/target/classes/static/js/common/echarts.common.js @@ -79,7 +79,7 @@ const horizontalBarChart = (res, ids) => { }, grid: { top: "9%", - left: "-30%", + left: "0%", right: "4%", bottom: "3%", containLabel: true, @@ -137,24 +137,24 @@ const horizontalBarChart = (res, ids) => { data: dataFormat(yValue), }, - { - type: "category", - inverse: true, - offset: -10, - position: "left", - axisTick: "none", - axisLine: "none", - show: true, - axisLabel: { - interval: 0, - color: ["#A8A6AB"], - align: "left", - verticalAlign: "bottom", - lineHeight: 32, - fontSize: 12, - }, - data: dataFormat(xValue), - }, + // { + // type: "category", + // inverse: true, + // offset: -10, + // position: "left", + // axisTick: "none", + // axisLine: "none", + // show: true, + // axisLabel: { + // interval: 0, + // color: ["#A8A6AB"], + // align: "left", + // verticalAlign: "bottom", + // lineHeight: 32, + // fontSize: 12, + // }, + // data: dataFormat(xValue), + // }, ], series: [ { @@ -170,11 +170,16 @@ const horizontalBarChart = (res, ids) => { }, }, label: { - show: false, + show: true, fontSize: 12, color: "#A8A6AB", textBorderWidth: 2, - padding: [2, 0, 0, 0], + position:'insideTopLeft', + padding: [-20, 0, 0, 0], + formatter:function (params) { + console.log(dataFormat(xValue)[params[`dataIndex`]]) + return dataFormat(xValue)[params[`dataIndex`]].value + } }, }, { diff --git a/productionboard/target/classes/templates/foamBox/index.html b/productionboard/target/classes/templates/foamBox/index.html index e40df48..044cd87 100644 --- a/productionboard/target/classes/templates/foamBox/index.html +++ b/productionboard/target/classes/templates/foamBox/index.html @@ -49,6 +49,7 @@ + \ No newline at end of file