根据code查物料;

This commit is contained in:
王奎兴
2026-06-01 17:15:40 +08:00
parent 07b1863680
commit b6fd5fb08d
4 changed files with 12 additions and 7 deletions
@@ -30,6 +30,8 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
public MaterialBaseInfoPO getByName(@Param("name") String name);
public MaterialBaseInfoPO getByCode(@Param("code") String code);
public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id);
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id);
@@ -180,7 +180,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
List<Map<String,Object>> shipperIds = new ArrayList<>();
Set<Long> processedShipperIds = new HashSet<>();
for (ProductDetail productDetail : productDetailList) {
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(productDetail.getProductName());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
Long shipperId = materialBaseInfoPO.getShipperId();
if (processedShipperIds.add(shipperId)) {
@@ -234,7 +234,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
for (ProductDetail productDetail : productDetailList) {
ReservationOutMaterialDetailDO reservationOutMaterialDetailDO = new ReservationOutMaterialDetailDO();
reservationOutMaterialDetailDO.setOutOrderNumber(reservationStockOutOrderDO.getOutOrderNumber());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(productDetail.getProductName());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
reservationOutMaterialDetailDO.setQuantity(new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(productDetail.getBoxCount()).setScale(2, BigDecimal.ROUND_HALF_UP)));
reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
@@ -325,7 +325,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
List<Map<String,Object>> shipperIds = new ArrayList<>();
Set<Long> processedShipperIds = new HashSet<>();
for (StockInProductDetail productDetail : productDetailList) {
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(productDetail.getProductName());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
Long shipperId = materialBaseInfoPO.getShipperId();
if (processedShipperIds.add(shipperId)) {
@@ -374,7 +374,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
reservationInMaterialDetailDO.setCreateTime(new Date());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(stockInProductDetail.getProductName());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(stockInProductDetail.getProductCode());
if (materialBaseInfoPO != null) {
reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
reservationInMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
@@ -10,7 +10,7 @@ import java.util.Date;
@Data
public class StockInProductDetail {
// 产品编号(Excel第1列)
private Integer productCode;
private String productCode;
// 产品名称(Excel第2列)
private String productName;
// 箱含量(Excel第5列)
@@ -23,11 +23,11 @@ public class StockInProductDetail {
private Date drinkDate;
// Getter和Setter方法
public Integer getProductCode() {
public String getProductCode() {
return productCode;
}
public void setProductCode(Integer productCode) {
public void setProductCode(String productCode) {
this.productCode = productCode;
}
@@ -465,6 +465,9 @@
<select id="getByName" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_NAME = #{name}
</select>
<select id="getByCode" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_CODE = #{code}
</select>
<select id="getMaterialBaseInfoList" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and material_code = #{id}
</select>