PDA容器移位物料包装规格显示
This commit is contained in:
+34
@@ -18,6 +18,8 @@ import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryQuery
|
|||||||
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO;
|
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO;
|
||||||
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryQueryListDO;
|
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryQueryListDO;
|
||||||
import com.mhd.wms.domain.materialInventory.service.MaterialInventoryDomainService;
|
import com.mhd.wms.domain.materialInventory.service.MaterialInventoryDomainService;
|
||||||
|
import com.mhd.wms.domain.materialBarCode.repository.facade.IMaterialBarCodeService;
|
||||||
|
import com.mhd.wms.domain.materialBarCode.repository.po.MaterialBarCodePO;
|
||||||
import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO;
|
import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -44,6 +46,8 @@ public class MaterialInventoryApplicationService {
|
|||||||
private SystemServiceFeign systemServiceFeign;
|
private SystemServiceFeign systemServiceFeign;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MaterialInventoryMapper materialInventoryMapper;
|
private MaterialInventoryMapper materialInventoryMapper;
|
||||||
|
@Autowired
|
||||||
|
private IMaterialBarCodeService materialBarCodeService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -516,6 +520,7 @@ public class MaterialInventoryApplicationService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存查询列表批次属性填充,与按单移位 fillMaterialMoreDetailForShiftDetail 一致
|
* 库存查询列表批次属性填充,与按单移位 fillMaterialMoreDetailForShiftDetail 一致
|
||||||
|
* 物料条码、包装规格:优先用 material_base_info,为空时从 material_bar_code 取条码(参考收货单实现)
|
||||||
*/
|
*/
|
||||||
private void fillMaterialMoreDetailForInventoryQueryList(List<MaterialInventoryQueryListPO> list) {
|
private void fillMaterialMoreDetailForInventoryQueryList(List<MaterialInventoryQueryListPO> list) {
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
@@ -525,6 +530,16 @@ public class MaterialInventoryApplicationService {
|
|||||||
.map(MaterialInventoryQueryListPO::getMaterialBaseInfoId)
|
.map(MaterialInventoryQueryListPO::getMaterialBaseInfoId)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
// 物料条码:material_base_info.bar_code 为空时,从 material_bar_code 取第一条(参考 StockReceiptOrderApplicationService)
|
||||||
|
Map<Long, String> materialBarCodeMap = buildMaterialBarCodeMap(materialBaseInfoIdSet);
|
||||||
|
list.forEach(po -> {
|
||||||
|
if (StringUtils.isBlank(po.getBarCode()) && po.getMaterialBaseInfoId() != null) {
|
||||||
|
String barCode = materialBarCodeMap.get(po.getMaterialBaseInfoId());
|
||||||
|
if (StringUtils.isNotBlank(barCode)) {
|
||||||
|
po.setBarCode(barCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
Map<Long, List<BatchDetailFeignPO>> batchDetailMap = new HashMap<>();
|
Map<Long, List<BatchDetailFeignPO>> batchDetailMap = new HashMap<>();
|
||||||
for (Long materialBaseInfoId : materialBaseInfoIdSet) {
|
for (Long materialBaseInfoId : materialBaseInfoIdSet) {
|
||||||
try {
|
try {
|
||||||
@@ -567,6 +582,25 @@ public class MaterialInventoryApplicationService {
|
|||||||
po.setMaterialMoreDetailList(filtered);
|
po.setMaterialMoreDetailList(filtered);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量查询物料条码,取 material_bar_code 表第一条 barCode(参考 StockReceiptOrderApplicationService)
|
||||||
|
*/
|
||||||
|
private Map<Long, String> buildMaterialBarCodeMap(Set<Long> materialBaseInfoIdSet) {
|
||||||
|
Map<Long, String> map = new HashMap<>();
|
||||||
|
if (materialBaseInfoIdSet == null || materialBaseInfoIdSet.isEmpty()) return map;
|
||||||
|
for (Long materialBaseInfoId : materialBaseInfoIdSet) {
|
||||||
|
try {
|
||||||
|
List<MaterialBarCodePO> list = materialBarCodeService.getInfoByMaterialBaseInfoIds(materialBaseInfoId);
|
||||||
|
if (!CollectionUtils.isEmpty(list) && StringUtils.isNotBlank(list.get(0).getBarCode())) {
|
||||||
|
map.put(materialBaseInfoId, list.get(0).getBarCode());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取物料条码失败,materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
/** 净重、毛重、体积、面积、移位数量在底部表单区显示,从上面 materialMoreDetailList 中排除,与按单移位一致 */
|
/** 净重、毛重、体积、面积、移位数量在底部表单区显示,从上面 materialMoreDetailList 中排除,与按单移位一致 */
|
||||||
private static final String[] WEIGHT_VOLUME_AREA_SHIFT_LABELS = {
|
private static final String[] WEIGHT_VOLUME_AREA_SHIFT_LABELS = {
|
||||||
"净重(KG)", "净重", "总净重",
|
"净重(KG)", "净重", "总净重",
|
||||||
|
|||||||
+3
@@ -214,6 +214,9 @@ public class ShiftManageApplicationService {
|
|||||||
d.setBatchNumber(inv.getBatchNumber());
|
d.setBatchNumber(inv.getBatchNumber());
|
||||||
d.setMaterialStatusCode(inv.getMaterialStatusCode());
|
d.setMaterialStatusCode(inv.getMaterialStatusCode());
|
||||||
d.setMaterialStatusName(inv.getMaterialStatusName());
|
d.setMaterialStatusName(inv.getMaterialStatusName());
|
||||||
|
d.setPackId(inv.getPackId());
|
||||||
|
d.setPackCode(inv.getPackCode());
|
||||||
|
d.setPackName(inv.getPackName());
|
||||||
d.setUnitCode(inv.getUnit());
|
d.setUnitCode(inv.getUnit());
|
||||||
d.setUnitName(inv.getUnitName());
|
d.setUnitName(inv.getUnitName());
|
||||||
d.setNetWeight(inv.getNetWeight());
|
d.setNetWeight(inv.getNetWeight());
|
||||||
|
|||||||
+12
@@ -69,6 +69,18 @@ public class MaterialInventoryQueryListPO extends MaterialBasePO {
|
|||||||
@Excel(name = "物料条形码")
|
@Excel(name = "物料条形码")
|
||||||
private String barCode;
|
private String barCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("包装规格id")
|
||||||
|
@Excel(name = "包装规格id")
|
||||||
|
private Long packId;
|
||||||
|
|
||||||
|
@ApiModelProperty("包装规格编码")
|
||||||
|
@Excel(name = "包装规格编码")
|
||||||
|
private String packCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("包装规格名称")
|
||||||
|
@Excel(name = "包装规格名称")
|
||||||
|
private String packName;
|
||||||
|
|
||||||
@ApiModelProperty("仓库id")
|
@ApiModelProperty("仓库id")
|
||||||
@Excel(name = "仓库id")
|
@Excel(name = "仓库id")
|
||||||
private Long warehouseId;
|
private Long warehouseId;
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
b.material_classify_name,
|
b.material_classify_name,
|
||||||
b.material_type,
|
b.material_type,
|
||||||
b.material_type_name,
|
b.material_type_name,
|
||||||
b.common,b.pack_name
|
b.common,
|
||||||
|
b.pack_id,
|
||||||
|
b.pack_code,
|
||||||
|
b.pack_name
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectMaterialBaseInfoPo1">
|
<sql id="selectMaterialBaseInfoPo1">
|
||||||
|
|||||||
@@ -275,6 +275,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="materialCode" column="material_code" />
|
<result property="materialCode" column="material_code" />
|
||||||
<result property="materialName" column="material_name" />
|
<result property="materialName" column="material_name" />
|
||||||
<result property="barCode" column="bar_code" />
|
<result property="barCode" column="bar_code" />
|
||||||
|
<result property="packId" column="pack_id" />
|
||||||
|
<result property="packCode" column="pack_code" />
|
||||||
|
<result property="packName" column="pack_name" />
|
||||||
<result property="warehouseId" column="warehouse_id" />
|
<result property="warehouseId" column="warehouse_id" />
|
||||||
<result property="warehouseCode" column="warehouse_code" />
|
<result property="warehouseCode" column="warehouse_code" />
|
||||||
<result property="warehouseName" column="warehouse_name" />
|
<result property="warehouseName" column="warehouse_name" />
|
||||||
|
|||||||
Reference in New Issue
Block a user