oms新增库存调整记录

This commit is contained in:
zhou-hongcheng
2026-04-24 09:23:26 +08:00
parent b3c4fb521b
commit 14f981b7d1
3 changed files with 213 additions and 4 deletions
@@ -35,4 +35,8 @@ public interface OmsServiceFeign {
@ApiOperation("编辑物料库存")
@PostMapping("/materialInventoryApi/omsEdit")
public AjaxResult omsEdit(@RequestBody MaterialInventoryOmsParamDO materialInventoryOmsParamDO);
@ApiOperation("库存调整记录插入")
@PostMapping("/reservationInventoryAdjustmentRecordApi/edit")
AjaxResult inventoryAdjustmentRecordInsert(InventoryAdjustmentRecord inventoryAdjustmentRecord);
}
@@ -0,0 +1,202 @@
package com.mhd.system.api.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 库存调整记录对象 inventory_adjustment_record
*
* @author gen
* @date 2024-07-17
*/
@Data
public class InventoryAdjustmentRecord extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("库存调整记录id")
@TableId(type = IdType.AUTO)
private Long inventoryAdjustmentId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("物料库存id")
private Long materialInventoryId;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("库区id")
@Excel(name = "库区id")
private Long storageSectionId;
@ApiModelProperty("库区编码")
@Excel(name = "库区编码")
private String storageCode;
@ApiModelProperty("库区名称")
@Excel(name = "库区名称")
private String storageName;
@ApiModelProperty("库位id")
@Excel(name = "库位id")
private Long storageLocationId;
@ApiModelProperty("库位编码")
@Excel(name = "库位编码")
private String storageLocationCode;
@ApiModelProperty("库位名称")
@Excel(name = "库位名称")
private String storageLocationName;
@ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
@Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
private Long adjustType;
@ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存")
@Excel(name = "调整方向:0:无状态 1:增库存 2:减库存")
private Long adjustDirection;
@ApiModelProperty("调整前状态编码")
@Excel(name = "调整前状态编码")
private String adjustBeforeStatusCode;
@ApiModelProperty("调整前状态名称")
@Excel(name = "调整前状态名称")
private String adjustBeforeStatusName;
@ApiModelProperty("调整后状态编码")
@Excel(name = "调整后状态编码")
private String adjustAfterStatusCode;
@ApiModelProperty("调整后状态名称")
@Excel(name = "调整后状态名称")
private String adjustAfterStatusName;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整动作")
@Excel(name = "调整动作")
private String adjustAction;
@ApiModelProperty("关联单号")
@Excel(name = "关联单号")
private String relateNo;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("LOT编号")
@Excel(name = "LOT编号")
private String lotNumber;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
}
@@ -10,6 +10,7 @@ import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.domain.BaseVOEntity;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.OmsServiceFeign;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.inventoryAdjustmentRecord.entity.InventoryAdjustmentRecord;
@@ -64,6 +65,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
private IMaterialBarCodeService materialBarCodeService;
@Autowired
private InventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
@Autowired
private OmsServiceFeign omsServiceFeign;
/**
* 查询物料库存列表
@@ -770,10 +773,10 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume());
inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea());
}
com.mhd.system.api.domain.InventoryAdjustmentRecord inventoryAdjustmentRecordOMS = new com.mhd.system.api.domain.InventoryAdjustmentRecord();
BeanUtils.copyProperties(inventoryAdjustmentRecord, inventoryAdjustmentRecordOMS);
//推送库存调整记录到oms
omsServiceFeign.inventoryAdjustmentRecordInsert(inventoryAdjustmentRecordOMS);
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
}