Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
+4
@@ -223,4 +223,8 @@ public class MaterialInventory extends BaseVOEntity {
|
||||
@Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("ext_attr_4")
|
||||
private Date extAttr4;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Excel(name = "条码")
|
||||
private String barCode;
|
||||
}
|
||||
+4
@@ -217,4 +217,8 @@ public class MaterialInventoryPO extends MaterialBasePO {
|
||||
@ApiModelProperty("单位名")
|
||||
@Excel(name = "单位名")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Excel(name = "条码")
|
||||
private String barCode;
|
||||
}
|
||||
+38
@@ -709,6 +709,24 @@ public class StockShelfOrderDomainService {
|
||||
materialInventory.setNetWeight(shelfMaterialDetail.getTotalNetWeight());
|
||||
materialInventory.setUnit(materialBaseInfo.getUnitCode());
|
||||
materialInventory.setUnitName(materialBaseInfo.getUnitName());
|
||||
// 条码:优先取上架明细的 barCode,为空则从 material_bar_code 表取(优先 EA 单位)
|
||||
String insertBarCode = shelfMaterialDetail.getBarCode();
|
||||
if (StringUtils.isBlank(insertBarCode) && shelfMaterialDetail.getMaterialBaseInfoId() != null) {
|
||||
try {
|
||||
List<MaterialBarCodePO> barCodeList = materialBarCodeService.getInfoByMaterialBaseInfoIds(shelfMaterialDetail.getMaterialBaseInfoId());
|
||||
if (barCodeList != null && !barCodeList.isEmpty()) {
|
||||
MaterialBarCodePO eaBarCode = barCodeList.stream()
|
||||
.filter(po -> "EA".equals(po.getUnitCode()))
|
||||
.findFirst().orElse(barCodeList.get(0));
|
||||
if (eaBarCode != null && StringUtils.isNotBlank(eaBarCode.getBarCode())) {
|
||||
insertBarCode = eaBarCode.getBarCode();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取条码失败,materialBaseInfoId={},错误:{}", shelfMaterialDetail.getMaterialBaseInfoId(), e.getMessage());
|
||||
}
|
||||
}
|
||||
materialInventory.setBarCode(insertBarCode);
|
||||
|
||||
materialInventoryMapper.insert(materialInventory);
|
||||
|
||||
@@ -827,6 +845,26 @@ public class StockShelfOrderDomainService {
|
||||
materialInventory.setUpdateBy(loginUser.getUserid());
|
||||
materialInventory.setUpdateByName(loginUser.getUsername());
|
||||
materialInventory.setUpdateTime(new Date());
|
||||
// 如果库存记录没有 barCode,则补充写入
|
||||
if (StringUtils.isBlank(materialInventoryPO.getBarCode())) {
|
||||
String updateBarCode = shelfMaterialDetail.getBarCode();
|
||||
if (StringUtils.isBlank(updateBarCode) && shelfMaterialDetail.getMaterialBaseInfoId() != null) {
|
||||
try {
|
||||
List<MaterialBarCodePO> barCodeList = materialBarCodeService.getInfoByMaterialBaseInfoIds(shelfMaterialDetail.getMaterialBaseInfoId());
|
||||
if (barCodeList != null && !barCodeList.isEmpty()) {
|
||||
MaterialBarCodePO eaBarCode = barCodeList.stream()
|
||||
.filter(po -> "EA".equals(po.getUnitCode()))
|
||||
.findFirst().orElse(barCodeList.get(0));
|
||||
if (eaBarCode != null && StringUtils.isNotBlank(eaBarCode.getBarCode())) {
|
||||
updateBarCode = eaBarCode.getBarCode();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取条码失败,materialBaseInfoId={},错误:{}", shelfMaterialDetail.getMaterialBaseInfoId(), e.getMessage());
|
||||
}
|
||||
}
|
||||
materialInventory.setBarCode(updateBarCode);
|
||||
}
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="boxPalletNo" column="box_pallet_no" />
|
||||
<result property="packName" column="pack_name" />
|
||||
<result property="unitName" column="unit_name" />
|
||||
<result property="barCode" column="inv_bar_code" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -81,7 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
IFNULL (sum(a.VOLUME), 0) VOLUME,
|
||||
a.ext_attr_1, a.ext_attr_2, a.ext_attr_3, a.ext_attr_4,
|
||||
a.production_date, a.expiry_date, a.inventory_date,
|
||||
a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name
|
||||
a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name,
|
||||
a.bar_code as inv_bar_code
|
||||
</sql>
|
||||
|
||||
<sql id="selectMaterialInventoryPo1">
|
||||
@@ -274,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="barCode" column="bar_code" />
|
||||
<result property="barCode" column="inv_bar_code" />
|
||||
<result property="packId" column="pack_id" />
|
||||
<result property="packCode" column="pack_code" />
|
||||
<result property="packName" column="pack_name" />
|
||||
|
||||
Reference in New Issue
Block a user