add:大屏仓位增加物料编码和名称
This commit is contained in:
@@ -298,7 +298,7 @@
|
||||
INNER JOIN st_ivt_structattr attr ON ext.storagevehicle_code = attr.storagevehicle_code
|
||||
INNER JOIN md_me_materialbase mater ON mater.material_code = ext.material_id
|
||||
<where>
|
||||
1 = 1
|
||||
ext.qty>0
|
||||
<if test="param.stor_id != null and param.stor_id != ''">
|
||||
AND
|
||||
attr.stor_id = #{param.stor_id}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.bigscreen_manage.service.impl;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -12,12 +13,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleextService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.BsrealStorattrMapper;
|
||||
import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto;
|
||||
import org.nl.wms.bigscreen_manage.service.BigScreenService;
|
||||
import org.nl.wms.bigscreen_manage.service.dto.IvtAnalyse;
|
||||
import org.nl.wms.bigscreen_manage.service.dto.StructIvtAnalyse;
|
||||
@@ -50,6 +53,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -93,6 +97,9 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
@Autowired
|
||||
private ISchBaseTaskService iSchBaseTaskService;
|
||||
|
||||
@Resource
|
||||
private IMdPbStoragevehicleextService iMdPbStoragevehicleextService;
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getData(List<String> stors) {
|
||||
// String storCode = "GW";
|
||||
@@ -539,6 +546,10 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
List<StructIvtAnalyse> structList = screenMapper.querySectStruct(storCode);
|
||||
// 内存中查询货位上的空料箱载具集合(载具组盘物料为空料箱KL001)
|
||||
Set<String> emptyBoxSet = queryEmptyBoxSet(structList);
|
||||
// 查询仓位库存物料,按照仓位分组
|
||||
List<MdPbStoragevehicleextDto> mdPbStoragevehicleextDtos = iMdPbStoragevehicleextService.queryAll(MapUtil.empty());
|
||||
Map<String, MdPbStoragevehicleextDto> structItemMap = mdPbStoragevehicleextDtos.stream()
|
||||
.collect(Collectors.toMap(MdPbStoragevehicleextDto::getStruct_code, Function.identity()));
|
||||
// 按库区编码分组(升序)
|
||||
Map<String, List<StructIvtAnalyse>> sectGroup = structList.stream()
|
||||
.collect(Collectors.groupingBy(StructIvtAnalyse::getSect_code,
|
||||
@@ -573,7 +584,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
JSONObject layer = new JSONObject();
|
||||
layer.put("layer_num", layerEntry.getKey());
|
||||
layer.put("structs", layerEntry.getValue().stream()
|
||||
.map(item -> convertStructJson(item, emptyBoxSet))
|
||||
.map(item -> convertStructJson(item, emptyBoxSet, structItemMap))
|
||||
.collect(Collectors.toList()));
|
||||
layerList.add(layer);
|
||||
}
|
||||
@@ -626,7 +637,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
* @param emptyBoxSet 空料箱载具编码集合
|
||||
* @return 货位JSON
|
||||
*/
|
||||
private JSONObject convertStructJson(StructIvtAnalyse item, Set<String> emptyBoxSet) {
|
||||
private JSONObject convertStructJson(StructIvtAnalyse item, Set<String> emptyBoxSet, Map<String, MdPbStoragevehicleextDto> structItemMap) {
|
||||
JSONObject struct = new JSONObject();
|
||||
struct.put("struct_code", item.getStruct_code());
|
||||
struct.put("struct_name", item.getStruct_name());
|
||||
@@ -643,6 +654,9 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
status = "已入库";
|
||||
}
|
||||
struct.put("status", status);
|
||||
MdPbStoragevehicleextDto storagevehicleextDto = structItemMap.get(item.getStruct_code());
|
||||
struct.put("material_code", ObjectUtil.isEmpty(storagevehicleextDto) ? "" : storagevehicleextDto.getMaterial_code());
|
||||
struct.put("material_name", ObjectUtil.isEmpty(storagevehicleextDto) ? "" : storagevehicleextDto.getMaterial_name());
|
||||
return struct;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user