| | |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.common.service.CommonService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 入库报表 |
| | | * 入库报表 -- 折线图 |
| | | */ |
| | | @GetMapping("/pakin/rep") |
| | | public R monitorPakinRep(){ |
| | |
| | | return R.ok(report); |
| | | } |
| | | |
| | | @GetMapping("/loc/rep") |
| | | public R monitorLocRep(){ |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRate(); |
| | | if(locUseRate!=null) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", "在库库位"); |
| | | map.put("value", locUseRate.getFqty()); |
| | | result.add(map); |
| | | |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("name", "空库位"); |
| | | map1.put("value", locUseRate.getOqty()); |
| | | result.add(map1); |
| | | |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | map2.put("name", "使用库位"); |
| | | map2.put("value", locUseRate.getUqty()); |
| | | result.add(map2); |
| | | |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("name", "禁用库位"); |
| | | map3.put("value", locUseRate.getXqty()); |
| | | result.add(map3); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | /** |
| | | * 库位占用百分比 |
| | | * @author admin |
| | | * @date 2018年12月12日 |
| | | */ |
| | | public class LocChartPie { |
| | | private int fqty; |
| | | private int oqty; |
| | | private int uqty; |
| | | private int xqty; |
| | | public int getFqty() { |
| | | return fqty; |
| | | } |
| | | public void setFqty(int fqty) { |
| | | this.fqty = fqty; |
| | | } |
| | | public int getOqty() { |
| | | return oqty; |
| | | } |
| | | public void setOqty(int oqty) { |
| | | this.oqty = oqty; |
| | | } |
| | | public int getUqty() { |
| | | return uqty; |
| | | } |
| | | public void setUqty(int uqty) { |
| | | this.uqty = uqty; |
| | | } |
| | | public int getXqty() { |
| | | return xqty; |
| | | } |
| | | public void setXqty(int xqty) { |
| | | this.xqty = xqty; |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | "order by Min(wm.io_time) asc\n") |
| | | List<Map<String, Object>> queryPakinRep(); |
| | | |
| | | @Select("select * from asr_loc_use_view") |
| | | LocChartPie getLocUseRate(); |
| | | |
| | | } |
| | |
| | | |
| | | setInterval(function () { |
| | | setDate(); |
| | | initVisits(); |
| | | initlinChart(); |
| | | // initPieChart(); |
| | | }, 1000); |
| | | |
| | | function setDate() { |
| | |
| | | var data = []; |
| | | |
| | | |
| | | // 折线图 |
| | | /***********************************************************************************/ |
| | | /************************************* 折线图 ***************************************/ |
| | | /***********************************************************************************/ |
| | | |
| | | var lineCharts = echarts.init(document.getElementById('line-charts')); |
| | | lineChartOption = { |
| | | var lineChartOption = { |
| | | // animation: false, |
| | | grid: { |
| | | top: '0%', |
| | |
| | | }; |
| | | |
| | | // 访问量报表加载 |
| | | function initVisits() { |
| | | function initlinChart() { |
| | | var reportView = lineChartOption; |
| | | var xAxisDate = []; |
| | | var seriesDate=[]; |
| | |
| | | }); |
| | | } |
| | | |
| | | // 饼图 |
| | | let pieCharts = echarts.init(document.getElementById('pie-charts')); |
| | | pieChartOption = { |
| | | /***********************************************************************************/ |
| | | /************************************* 饼图 *****************************************/ |
| | | /***********************************************************************************/ |
| | | |
| | | var pieCharts = echarts.init(document.getElementById('pie-charts')); |
| | | var pieChartOption = { |
| | | // animation: false, |
| | | grid: { |
| | | top: '0%', |
| | |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 10, |
| | | data: ['1', '2', '3'] |
| | | data: ['在库库位', '空库位', '使用库位', '禁用库位'] |
| | | }, |
| | | series: [ |
| | | { |
| | |
| | | show: false |
| | | }, |
| | | data: [ |
| | | {value: 335, name: '1'}, |
| | | {value: 310, name: '2'}, |
| | | {value: 234, name: '3'}, |
| | | {value: 1, name: '在库库位'}, |
| | | {value: 1, name: '空库位'}, |
| | | {value: 1, name: '使用库位'}, |
| | | {value: 1, name: '禁用库位'}, |
| | | ], |
| | | itemStyle: { |
| | | emphasis: { |
| | |
| | | } |
| | | ] |
| | | }; |
| | | pieCharts.setOption(pieChartOption); |
| | | // pieCharts.setOption(pieChartOption) |
| | | // 饼图加载 |
| | | function initPieChart() { |
| | | $.ajax({ |
| | | url: baseUrl+"/monitor/loc/rep", |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | pieChartOption.series[0].data = res.data; |
| | | pieCharts.setOption(pieChartOption) |
| | | } else if (res.code === 403){ |
| | | top.location.href = "/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | </html> |