Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zhou-hongcheng
2026-03-03 13:59:41 +08:00
6 changed files with 156 additions and 26 deletions
@@ -1303,8 +1303,10 @@ public class StockInOrderApplicationService {
r.getMaterialCode(), topOrganizationId, shipperId);
List<MaterialBaseInfoPO> materialList = materialBaseInfoService.queryList(queryDO);
log.info("料号查询结果,查询到 {} 条记录", materialList != null ? materialList.size() : 0);
MaterialBaseInfoPO materialBaseInfoPO = null;
if (materialList != null && !materialList.isEmpty()) {
materialBaseInfoId = materialList.get(0).getMaterialBaseInfoId();
materialBaseInfoPO = materialList.get(0);
materialBaseInfoId = materialBaseInfoPO.getMaterialBaseInfoId();
log.info("通过料号查询到物料基础信息,料号: {}, 物料ID: {}, 货主ID: {}",
r.getMaterialCode(), materialBaseInfoId, shipperId);
} else {
@@ -1356,12 +1358,17 @@ public class StockInOrderApplicationService {
}
}
d.setInboundQuantity(inboundQuantity);
// 单位:优先使用"单位"字段,如果为空则使用"申报单位"
// 单位:优先使用Excel中的"单位"字段,如果为空则使用"申报单位",如果还为空则从物料主数据获取
String unit = StringUtils.isNotBlank(r.getUnit()) ? r.getUnit() : null;
if (StringUtils.isBlank(unit) && StringUtils.isNotBlank(r.getDeclarationUnit())) {
unit = r.getDeclarationUnit();
log.info("单位字段为空,使用申报单位: {}", unit);
}
// 如果Excel中单位仍为空,从物料主数据获取
if (StringUtils.isBlank(unit) && materialBaseInfoPO != null && StringUtils.isNotBlank(materialBaseInfoPO.getUnitName())) {
unit = materialBaseInfoPO.getUnitName();
log.info("Excel中单位为空,从物料主数据自动填充单位: {}", unit);
}
d.setUnit(unit);
// 总净重:优先使用主字段,如果为空则使用备用字段
d.setTotalNetWeight(r.getTotalNetWeight() != null ? r.getTotalNetWeight() : r.getTotalNetWeight2());
@@ -1373,10 +1380,22 @@ public class StockInOrderApplicationService {
d.setTotalArea(r.getTotalArea() != null ? r.getTotalArea() : r.getTotalArea2());
d.setBatchRefNo(r.getBatchRefNo());
d.setSheetRefNo(r.getSheetRefNo());
d.setOriginCountry(r.getOriginCountry());
// 原产国:优先使用Excel中的数据,如果为空则从物料主数据获取
String originCountry = StringUtils.isNotBlank(r.getOriginCountry()) ? r.getOriginCountry() : null;
if (StringUtils.isBlank(originCountry) && materialBaseInfoPO != null && StringUtils.isNotBlank(materialBaseInfoPO.getOriginCountry())) {
originCountry = materialBaseInfoPO.getOriginCountry();
log.info("Excel中原产国为空,从物料主数据自动填充原产国: {}", originCountry);
}
d.setOriginCountry(originCountry);
d.setBoxPalletNo(r.getBoxPalletNo());
d.setTotalPrice(r.getTotalPrice());
d.setCurrency(r.getCurrency());
// 币制:优先使用Excel中的数据,如果为空则从物料主数据获取
String currency = StringUtils.isNotBlank(r.getCurrency()) ? r.getCurrency() : null;
if (StringUtils.isBlank(currency) && materialBaseInfoPO != null && StringUtils.isNotBlank(materialBaseInfoPO.getCurrency())) {
currency = materialBaseInfoPO.getCurrency();
log.info("Excel中币制为空,从物料主数据自动填充币制: {}", currency);
}
d.setCurrency(currency);
d.setRemark(r.getDetailRemark());
// 记录即将保存的明细数据,用于调试
@@ -209,6 +209,49 @@ public class StockReceiptOrderApplicationService {
// 3. 为每个物料明细设置更多属性(从缓存中获取),递归处理所有层级
setMaterialMoreDetailListRecursively(receiptMaterialDetailPOList, batchDetailMap);
// 4. 批量查询物料基础信息和包装规格信息,填充明细行的物料单位信息(如果单位信息为空)
// 4.1 批量查询物料基础信息
Map<Long, MaterialBaseInfoPO> materialBaseInfoMap = new HashMap<>();
for (Long materialBaseInfoId : materialBaseInfoIdSet) {
try {
MaterialBaseInfoPO materialBaseInfoPO = materialBaseInfoService.getInfo(materialBaseInfoId);
if (materialBaseInfoPO != null) {
materialBaseInfoMap.put(materialBaseInfoId, materialBaseInfoPO);
}
} catch (Exception e) {
log.warn("获取物料基础信息失败,物料基础信息ID:{},错误:{}", materialBaseInfoId, e.getMessage());
}
}
// 4.2 批量查询包装规格信息(单位代码为EA的单位名称)
Map<Long, PackDetailFeignPO> packDetailMap = new HashMap<>();
for (Long materialBaseInfoId : materialBaseInfoIdSet) {
MaterialBaseInfoPO materialBaseInfoPO = materialBaseInfoMap.get(materialBaseInfoId);
if (materialBaseInfoPO != null && materialBaseInfoPO.getPackId() != null) {
try {
AjaxResult packDetailResult = systemServiceFeign.getInfoByPackIdAndUnitCode(materialBaseInfoPO.getPackId(), "EA");
if (packDetailResult != null && "200".equals(String.valueOf(packDetailResult.get("code")))
&& packDetailResult.get("data") != null) {
PackDetailFeignPO packDetailFeignPO = JSON.parseObject(
JSONObject.toJSONString(packDetailResult.get("data")),
PackDetailFeignPO.class);
if (packDetailFeignPO != null) {
packDetailMap.put(materialBaseInfoId, packDetailFeignPO);
}
}
} catch (Exception e) {
log.warn("获取包装规格EA单位信息失败,物料基础信息ID:{},包装ID:{},错误:{}",
materialBaseInfoId, materialBaseInfoPO.getPackId(), e.getMessage());
}
}
}
// 4.3 为每个明细行填充物料单位信息(如果单位信息为空)
fillMaterialDetailUnitInfoRecursively(receiptMaterialDetailPOList, materialBaseInfoMap, packDetailMap);
// 5. 清空质检相关字段(如果是否质检为否)
clearQualityInspectionFieldsRecursively(receiptMaterialDetailPOList);
stockReceiptOrderPO.setMaterialDetailList(receiptMaterialDetailPOList);
log.info("返回收货单信息,receiptOrderId={}, materialDetailList大小={}",
stockReceiptOrderPO.getReceiptOrderId(),
@@ -394,6 +437,80 @@ public class StockReceiptOrderApplicationService {
});
}
/**
* 递归填充明细行的物料单位信息(如果单位信息为空)
* @param receiptMaterialDetailPOList 收货物料明细列表
* @param materialBaseInfoMap 物料基础信息Mapkey: materialBaseInfoId, value: MaterialBaseInfoPO
* @param packDetailMap 包装规格明细Mapkey: materialBaseInfoId, value: PackDetailFeignPO,单位代码为EA
*/
private void fillMaterialDetailUnitInfoRecursively(List<ReceiptMaterialDetailPO> receiptMaterialDetailPOList,
Map<Long, MaterialBaseInfoPO> materialBaseInfoMap,
Map<Long, PackDetailFeignPO> packDetailMap) {
if (CollectionUtils.isEmpty(receiptMaterialDetailPOList)) {
return;
}
receiptMaterialDetailPOList.forEach(receiptMaterialDetailPO -> {
Long materialBaseInfoId = receiptMaterialDetailPO.getMaterialBaseInfoId();
if (materialBaseInfoId != null) {
// 只有当单位信息为空时才填充
if (StringUtils.isBlank(receiptMaterialDetailPO.getUnitCode())
|| StringUtils.isBlank(receiptMaterialDetailPO.getUnitName())) {
// 填充物料单位名称(从包装规格明细中获取单位代码为EA的单位名称)
PackDetailFeignPO packDetailFeignPO = packDetailMap.get(materialBaseInfoId);
if (packDetailFeignPO != null && StringUtils.isNotBlank(packDetailFeignPO.getName())) {
// 物料单位EA显示物料绑定的包装规格维护的单位代码为EA的单位名称
if (StringUtils.isBlank(receiptMaterialDetailPO.getUnitName())) {
receiptMaterialDetailPO.setUnitName(packDetailFeignPO.getName());
}
if (StringUtils.isBlank(receiptMaterialDetailPO.getUnitCode())) {
receiptMaterialDetailPO.setUnitCode(packDetailFeignPO.getUnitCode() != null
? packDetailFeignPO.getUnitCode() : "EA");
}
log.debug("填充物料单位信息,materialBaseInfoId={}, unitCode={}, unitName={}",
materialBaseInfoId, receiptMaterialDetailPO.getUnitCode(), receiptMaterialDetailPO.getUnitName());
}
}
}
// 递归处理子明细
if (!CollectionUtils.isEmpty(receiptMaterialDetailPO.getChildren())) {
fillMaterialDetailUnitInfoRecursively(receiptMaterialDetailPO.getChildren(),
materialBaseInfoMap, packDetailMap);
}
});
}
/**
* 递归清空质检相关字段(如果是否质检为否)
* @param receiptMaterialDetailPOList 收货物料明细列表
*/
private void clearQualityInspectionFieldsRecursively(List<ReceiptMaterialDetailPO> receiptMaterialDetailPOList) {
if (CollectionUtils.isEmpty(receiptMaterialDetailPOList)) {
return;
}
receiptMaterialDetailPOList.forEach(receiptMaterialDetailPO -> {
// 如果是否质检管理为2(否),则清空所有质检相关字段
if (receiptMaterialDetailPO.getQualityInspectionManage() != null
&& receiptMaterialDetailPO.getQualityInspectionManage() == 2) {
receiptMaterialDetailPO.setQualityInspectionStage(null);
receiptMaterialDetailPO.setQualityInspectionRule(null);
receiptMaterialDetailPO.setQualityInspectionRatio(null);
receiptMaterialDetailPO.setQualityInspectionTerm(null);
receiptMaterialDetailPO.setQualityInspectionResults(null);
log.debug("清空质检相关字段,materialDetailId={}, qualityInspectionManage=2",
receiptMaterialDetailPO.getMaterialDetailId());
}
// 递归处理子明细
if (!CollectionUtils.isEmpty(receiptMaterialDetailPO.getChildren())) {
clearQualityInspectionFieldsRecursively(receiptMaterialDetailPO.getChildren());
}
});
}
/**
* 根据批次标签(batchLabels)映射到字段名
* @param batchLabel 批次标签
@@ -3,6 +3,7 @@ package com.mhd.wms.domain.handoverTaskOrder.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.bean.BeanUtils;
@@ -271,7 +272,8 @@ public class HandoverTaskOrderDomainService {
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryPO.getAllocationQuantity());
inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventoryPO.getAllocationQuantity());
@@ -279,9 +281,6 @@ public class HandoverTaskOrderDomainService {
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity);
inventoryAdjustmentRecord.setInventoryAfterQuantity(newInventoryQuantity);
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
}
}
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.StringUtils;
@@ -484,7 +485,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -492,9 +494,6 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
}
/*Long uniqueId = outMaterialDetail.getUniqueId();
@@ -569,7 +568,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -804,7 +804,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -812,9 +813,6 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
}
@@ -880,7 +878,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setStorageSectionId(materialInventoryPO.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventoryPO.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(newAllocationQuantity);
inventoryAdjustmentRecord.setAllocationBeforeQuantity(oldAllocationQuantity);
@@ -888,9 +887,6 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
inventoryAdjustmentRecord.setFreezeAfterQuantity(newFreezeQuantity);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryPO.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
}
}
@@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.domain.po.UserPo;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.StringUtils;
@@ -729,7 +730,8 @@ public class StockShelfOrderDomainService {
inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId());
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
UserPo userPo = loginUser.getUserPo();
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO);
@@ -737,9 +739,6 @@ public class StockShelfOrderDomainService {
inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
inventoryAdjustmentRecord.setCreateByName(loginUser.getRealname());
inventoryAdjustmentRecord.setCreateTime(new Date());
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
} else if (materialInventoryPOS.size() == 1) {
MaterialInventory materialInventory = new MaterialInventory();
@@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ifnull(a.MATERIAL_NAME, c.MATERIAL_NAME) MATERIAL_NAME,
a.BAR_CODE,
c.SPECIFICATION_MODEL,
a.QUANTITY, a.ALREADY_RECEIPT_QUANTITY, a.RECEIPT_QUANTITY, a.RECEIPT_STATUS, a.PACK_ID, a.PACK_CODE, a.PACK_NAME, a.PACK_DETAIL_ID, a.UNIT_CODE, a.UNIT_NAME, a.UNIT_NUMBER, a.MATERIAL_WAREHOUSE_CONTROL_ID, a.SERIAL_NUMBER_MANAGE, a.QUALITY_INSPECTION_MANAGE, a.QUALITY_INSPECTION_STAGE, a.QUALITY_INSPECTION_RULE, a.QUALITY_INSPECTION_RATIO, a.QUALITY_INSPECTION_TERM, a.QUALITY_INSPECTION_RESULTS, a.ALLOW_OVERCHARGE, a.OVERCHARGE_RATIO, a.BATCH_NUMBER, a.MATERIAL_STATUS_CODE, a.MATERIAL_STATUS_NAME, a.DISTRIBUTE_RULE_ID, a.DISTRIBUTE_RULE_CODE, a.DISTRIBUTE_RULE_NAME, a.CONTAINER_ID, a.CONTAINER_CODE, a.CONTAINER_TYPE, a.CONTAINER_TYPE_NAME, a.LEVEL, a.PARENT_UNIQUE_ID, a.IN_UNIQUE_ID, a.ALLOW_MODIFY, a.REMARK, a.CREATE_TIME, a.CREATE_BY, a.CREATE_BY_NAME, a.UPDATE_TIME, a.UPDATE_BY, a.UPDATE_BY_NAME, a.GEN_STOCK_SHELF, a.DEL_FLAG,
a.QUANTITY, a.ALREADY_RECEIPT_QUANTITY, a.RECEIPT_QUANTITY, a.RECEIPT_STATUS, a.PACK_ID, a.PACK_CODE, a.PACK_NAME, a.PACK_DETAIL_ID, ifnull(a.UNIT_CODE, b.UNIT_CODE) UNIT_CODE, ifnull(a.UNIT_NAME, b.UNIT_NAME) UNIT_NAME, a.UNIT_NUMBER, a.MATERIAL_WAREHOUSE_CONTROL_ID, a.SERIAL_NUMBER_MANAGE, a.QUALITY_INSPECTION_MANAGE, a.QUALITY_INSPECTION_STAGE, a.QUALITY_INSPECTION_RULE, a.QUALITY_INSPECTION_RATIO, a.QUALITY_INSPECTION_TERM, a.QUALITY_INSPECTION_RESULTS, a.ALLOW_OVERCHARGE, a.OVERCHARGE_RATIO, a.BATCH_NUMBER, a.MATERIAL_STATUS_CODE, a.MATERIAL_STATUS_NAME, a.DISTRIBUTE_RULE_ID, a.DISTRIBUTE_RULE_CODE, a.DISTRIBUTE_RULE_NAME, a.CONTAINER_ID, a.CONTAINER_CODE, a.CONTAINER_TYPE, a.CONTAINER_TYPE_NAME, a.LEVEL, a.PARENT_UNIQUE_ID, a.IN_UNIQUE_ID, a.ALLOW_MODIFY, a.REMARK, a.CREATE_TIME, a.CREATE_BY, a.CREATE_BY_NAME, a.UPDATE_TIME, a.UPDATE_BY, a.UPDATE_BY_NAME, a.GEN_STOCK_SHELF, a.DEL_FLAG,
ifnull(a.TOTAL_NET_WEIGHT, b.TOTAL_NET_WEIGHT) TOTAL_NET_WEIGHT,
ifnull(a.TOTAL_GROSS_WEIGHT, b.TOTAL_GROSS_WEIGHT) TOTAL_GROSS_WEIGHT,
ifnull(a.TOTAL_VOLUME, b.TOTAL_VOLUME) TOTAL_VOLUME,