增加 库存查询

master
wangh 4 years ago
parent e10bb39f5e
commit 172a329e74

@ -6,16 +6,14 @@ import com.alibaba.fastjson.JSONPObject;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.BoxOutputByType; import com.ruoyi.system.domain.BoxOutputByType;
import com.ruoyi.system.domain.BoxPlanCompletion; import com.ruoyi.system.domain.BoxPlanCompletion;
import com.ruoyi.system.domain.BoxStock;
import com.ruoyi.system.domain.EchartsDTO; import com.ruoyi.system.domain.EchartsDTO;
import com.ruoyi.system.service.IBroadDataService; import com.ruoyi.system.service.IBroadDataService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -46,16 +44,26 @@ public class BoxBroadController {
return JSONObject.toJSONString(completion); return JSONObject.toJSONString(completion);
} }
// 库存 // 库存
@PostMapping("/selectStock") @PostMapping("/selectStock/{id}")
public String selectStock(){ @ResponseBody
return JSONObject.toJSONString(service.selectStock()); public String selectStock(@PathVariable("id")String id){
List<Long> seriesInfo = new ArrayList<Long>();
List<String> xAxisInfo = new ArrayList<String>();
List<BoxStock> 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") @PostMapping("/selectOutputByType")
@ResponseBody
public String selectOutputByType(){ public String selectOutputByType(){
// List<BoxOutputByType> boxOutputByType=service.selectOutputByType();
// return JSONArray.toJSONString(boxOutputByType);
EchartsDTO echarts = new EchartsDTO(); EchartsDTO echarts = new EchartsDTO();
List<Long> seriesInfo = new ArrayList<Long>(); List<Long> seriesInfo = new ArrayList<Long>();
List<String> xAxisInfo = new ArrayList<String>(); List<String> xAxisInfo = new ArrayList<String>();

@ -378,14 +378,14 @@
const rowName1 = '箱体壳' const rowName1 = '箱体壳'
const rowName2 = '内胆库' const rowName2 = '内胆库'
var url='/broad/box'
$(() => { $(() => {
//生产计划工单 //生产计划工单
/* autoUpdate('/broad/box/order ', INTERVAL, data => { // autoUpdate('/broad/box/order ', INTERVAL, data => {
planWorkOrderTable.loadData(data.map(value => [value[0], value[1], value[2], value[3], value[5]]), Object.keys(planWorkOrderColumns)) // 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( inventoryInfoDataMerger.merge(
data['xAxisInfo'].map(value => getSC(value)), data['xAxisInfo'].map(value => getSC(value)),
data['seriesInfo'], data['seriesInfo'],
@ -399,7 +399,7 @@
) )
}) })
autoUpdate('/system/UShellMes/getLinerInventoryInfo', INTERVAL, data => { autoUpdate(url+'/selectStock/S002', INTERVAL, data => {
inventoryInfoDataMerger.merge( inventoryInfoDataMerger.merge(
data['xAxisInfo'].map(value => getSC(value)), data['xAxisInfo'].map(value => getSC(value)),
data['seriesInfo'], data['seriesInfo'],
@ -411,7 +411,7 @@
inventoryInfoDataMerger.getData()[rowName2], inventoryInfoDataMerger.getData()[rowName2],
rowName2, rowName2,
) )
})*/ })
autoUpdate('/broad/box/selectOutputByType', INTERVAL, data => { autoUpdate('/broad/box/selectOutputByType', INTERVAL, data => {
statByType.setOption({ statByType.setOption({
@ -491,6 +491,7 @@
//formatter: '{b1}: {c1}', //formatter: '{b1}: {c1}',
}, },
legend: { legend: {
show: true,
show: true, show: true,
top: 0, top: 0,
textStyle: { textStyle: {

@ -17,6 +17,8 @@ import java.util.List;
@Repository @Repository
public interface BroadDataMapper { public interface BroadDataMapper {
BoxPlanCompletion selectplanCompletion(); BoxPlanCompletion selectplanCompletion();
BoxStock selectStock();
List<BoxStock> selectStock(String id);
List<BoxOutputByType> selectOutputByType(); List<BoxOutputByType> selectOutputByType();
} }

@ -16,7 +16,7 @@ public interface IBroadDataService {
BoxPlanCompletion selectplanCompletion(); BoxPlanCompletion selectplanCompletion();
BoxStock selectStock(); List<BoxStock> selectStock(String id);
List<BoxOutputByType> selectOutputByType(); List<BoxOutputByType> selectOutputByType();
} }

@ -41,8 +41,8 @@ public class BroadDataServiceImpl implements IBroadDataService
} }
@Override @Override
public BoxStock selectStock() { public List<BoxStock> selectStock(String id) {
return mapper.selectStock(); return mapper.selectStock(id);
} }
@Override @Override

@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from IMOS_LO_STORE_DETIAL losd from IMOS_LO_STORE_DETIAL losd
left join IMOS_LO_STORE ls on ls.STORE_CODE = losd.STORE_CODE 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 Material_Code is not null
and Store_Qty > 0 and Store_Qty > 0
group by material_name, ls.STORE_DESC group by material_name, ls.STORE_DESC

Loading…
Cancel
Save