diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/BoxBroadController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/BoxBroadController.java index dd178ae..f3100bb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/BoxBroadController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/broad/BoxBroadController.java @@ -6,16 +6,14 @@ import com.alibaba.fastjson.JSONPObject; import com.ruoyi.common.core.text.Convert; import com.ruoyi.system.domain.BoxOutputByType; import com.ruoyi.system.domain.BoxPlanCompletion; +import com.ruoyi.system.domain.BoxStock; import com.ruoyi.system.domain.EchartsDTO; import com.ruoyi.system.service.IBroadDataService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -46,16 +44,26 @@ public class BoxBroadController { return JSONObject.toJSONString(completion); } // 库存 - @PostMapping("/selectStock") - public String selectStock(){ - return JSONObject.toJSONString(service.selectStock()); + @PostMapping("/selectStock/{id}") + @ResponseBody + public String selectStock(@PathVariable("id")String id){ + + List seriesInfo = new ArrayList(); + List xAxisInfo = new ArrayList(); + List list=service.selectStock(id); + list.stream().forEach(t->{ + seriesInfo.add(Long.valueOf(t.getStock())); + xAxisInfo.add(t.getOrder_type()); + }); + + return JSONObject.toJSONString(new EchartsDTO(xAxisInfo,seriesInfo)); } // 按类型查询产量 @PostMapping("/selectOutputByType") + @ResponseBody public String selectOutputByType(){ -// List boxOutputByType=service.selectOutputByType(); -// return JSONArray.toJSONString(boxOutputByType); + EchartsDTO echarts = new EchartsDTO(); List seriesInfo = new ArrayList(); List xAxisInfo = new ArrayList(); diff --git a/ruoyi-admin/src/main/resources/templates/broad/box.html b/ruoyi-admin/src/main/resources/templates/broad/box.html index c2b36d6..52287ff 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/box.html +++ b/ruoyi-admin/src/main/resources/templates/broad/box.html @@ -378,14 +378,14 @@ const rowName1 = '箱体壳' const rowName2 = '内胆库' - + var url='/broad/box' $(() => { //生产计划工单 - /* autoUpdate('/broad/box/order ', INTERVAL, data => { - planWorkOrderTable.loadData(data.map(value => [value[0], value[1], value[2], value[3], value[5]]), Object.keys(planWorkOrderColumns)) - }) + // autoUpdate('/broad/box/order ', INTERVAL, data => { + // planWorkOrderTable.loadData(data.map(value => [value[0], value[1], value[2], value[3], value[5]]), Object.keys(planWorkOrderColumns)) + // }) - autoUpdate('/system/UShellMes/getInventoryInfo', INTERVAL, data => { + autoUpdate(url+'/selectStock/S001', INTERVAL, data => { inventoryInfoDataMerger.merge( data['xAxisInfo'].map(value => getSC(value)), data['seriesInfo'], @@ -399,7 +399,7 @@ ) }) - autoUpdate('/system/UShellMes/getLinerInventoryInfo', INTERVAL, data => { + autoUpdate(url+'/selectStock/S002', INTERVAL, data => { inventoryInfoDataMerger.merge( data['xAxisInfo'].map(value => getSC(value)), data['seriesInfo'], @@ -411,7 +411,7 @@ inventoryInfoDataMerger.getData()[rowName2], rowName2, ) - })*/ + }) autoUpdate('/broad/box/selectOutputByType', INTERVAL, data => { statByType.setOption({ @@ -491,6 +491,7 @@ //formatter: '{b1}: {c1}', }, legend: { + show: true, show: true, top: 0, textStyle: { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java index 6259dfe..9d86480 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BroadDataMapper.java @@ -17,6 +17,8 @@ import java.util.List; @Repository public interface BroadDataMapper { BoxPlanCompletion selectplanCompletion(); - BoxStock selectStock(); + + List selectStock(String id); + List selectOutputByType(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java index 7d0217a..289a651 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBroadDataService.java @@ -16,7 +16,7 @@ public interface IBroadDataService { BoxPlanCompletion selectplanCompletion(); - BoxStock selectStock(); + List selectStock(String id); List selectOutputByType(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDataServiceImpl.java index 98097f6..2edf0de 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDataServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BroadDataServiceImpl.java @@ -41,8 +41,8 @@ public class BroadDataServiceImpl implements IBroadDataService } @Override - public BoxStock selectStock() { - return mapper.selectStock(); + public List selectStock(String id) { + return mapper.selectStock(id); } @Override diff --git a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml index 1d1559c..287b9a6 100644 --- a/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/BroadDataMapper.xml @@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from IMOS_LO_STORE_DETIAL losd left join IMOS_LO_STORE ls on ls.STORE_CODE = losd.STORE_CODE - where ls.Store_Code in ('S001', 'S002') + where ls.Store_Code =#{id} and Material_Code is not null and Store_Qty > 0 group by material_name, ls.STORE_DESC