增加 库存查询

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.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<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")
@ResponseBody
public String selectOutputByType(){
// List<BoxOutputByType> boxOutputByType=service.selectOutputByType();
// return JSONArray.toJSONString(boxOutputByType);
EchartsDTO echarts = new EchartsDTO();
List<Long> seriesInfo = new ArrayList<Long>();
List<String> xAxisInfo = new ArrayList<String>();

@ -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: {

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

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

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

@ -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

Loading…
Cancel
Save