Commit 12a42586 by 杨浩

订单的仓库信息补全

parent ee958e7a
...@@ -174,7 +174,17 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService, ErpWarehous ...@@ -174,7 +174,17 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService, ErpWarehous
.eq(ErpWarehouseDO::getId, warehouseAreaId) .eq(ErpWarehouseDO::getId, warehouseAreaId)
.eq(ErpWarehouseDO::getStatus, CommonStatusEnum.ENABLE.getStatus())); .eq(ErpWarehouseDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
if (CommonUtil.isNotEmpty(erpWarehouseDO)) { if (CommonUtil.isNotEmpty(erpWarehouseDO)) {
ErpWarehouseDO parentWarehouse = warehouseMapper.selectById(erpWarehouseDO.getParentId());
WarehouseInfo info = BeanUtils.toBean(erpWarehouseDO, WarehouseInfo.class); WarehouseInfo info = BeanUtils.toBean(erpWarehouseDO, WarehouseInfo.class);
String parentAddress = Optional.ofNullable(parentWarehouse).map(ErpWarehouseDO::getAddress).orElse("");
String parentName = Optional.ofNullable(parentWarehouse).map(ErpWarehouseDO::getName).orElse("");
String split = "";
if (!CommonUtil.isAnyBlank(parentAddress, erpWarehouseDO.getName())) {
split = " ";
}
String address = parentAddress + split + erpWarehouseDO.getName();
info.setAddress(address);
info.setName(CommonUtil.isBlank(parentName) ? "" : parentName + "/" + erpWarehouseDO.getName());
info.setWarehouseId(erpWarehouseDO.getParentId()); info.setWarehouseId(erpWarehouseDO.getParentId());
info.setWarehouseId(erpWarehouseDO.getId()); info.setWarehouseId(erpWarehouseDO.getId());
return info; return info;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment