refactor(service):优化库存查找逻辑并移除冗余代码
- 修改 findOrCreateStock 方法返回类型为 void- 移除 warehouseId 的重复设置逻辑 - 简化库存存在时的处理流程- 删除多个与出入库及库存流水相关的实体类和业务对象- 清理无用的业务逻辑代码,提升代码可维护性
This commit is contained in:
@@ -1,103 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 出入库单明细视图对象 wms_stock_io_detail
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-07-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsStockIoDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 明细ID
|
||||
*/
|
||||
@ExcelProperty(value = "明细ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 出入库单ID
|
||||
*/
|
||||
@ExcelProperty(value = "出入库单ID")
|
||||
private Long stockIoId;
|
||||
|
||||
/**
|
||||
* 库区/库位ID
|
||||
*/
|
||||
@ExcelProperty(value = "库区/库位ID")
|
||||
private Long warehouseId;
|
||||
|
||||
/**
|
||||
* 物品类型(raw_material/product)
|
||||
*/
|
||||
@ExcelProperty(value = "物品类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "r=aw_material/product")
|
||||
private String itemType;
|
||||
|
||||
/**
|
||||
* 物品ID
|
||||
*/
|
||||
@ExcelProperty(value = "物品ID")
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@ExcelProperty(value = "批次号")
|
||||
private String batchNo;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 记录类型,0:详情,1:扫码枪记录
|
||||
*/
|
||||
private Integer recordType;
|
||||
|
||||
/**
|
||||
* 库区/库位名称
|
||||
*/
|
||||
private String warehouseName;
|
||||
/**
|
||||
* 源库区/库位名称(移库用)
|
||||
*/
|
||||
private String fromWarehouseName;
|
||||
|
||||
/**
|
||||
* 源库位ID(移库时使用)
|
||||
*/
|
||||
private Long fromWarehouseId;
|
||||
|
||||
//主表的 数据号 类型以及业务类型
|
||||
private String stockIoCode;
|
||||
private String ioType;
|
||||
private String bizType;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 出入库单主视图对象 wms_stock_io
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-07-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsStockIoVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 出入库单ID
|
||||
*/
|
||||
@ExcelProperty(value = "出入库单ID")
|
||||
private Long stockIoId;
|
||||
|
||||
/**
|
||||
* 出入库单号
|
||||
*/
|
||||
@ExcelProperty(value = "出入库单号")
|
||||
private String stockIoCode;
|
||||
|
||||
/**
|
||||
* 类型(in=入库,out=出库)
|
||||
*/
|
||||
@ExcelProperty(value = "类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "i=n=入库,out=出库")
|
||||
private String ioType;
|
||||
|
||||
/**
|
||||
* 业务类型(采购、销售、退货、调拨等)
|
||||
*/
|
||||
@ExcelProperty(value = "业务类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "采=购、销售、退货、调拨等")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 单据状态(0=草稿,1=已提交,2=已审核,3=已完成)
|
||||
*/
|
||||
@ExcelProperty(value = "单据状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0==草稿,1=已提交,2=已审核,3=已完成")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 库存流水视图对象 wms_stock_log
|
||||
*
|
||||
* @author JR
|
||||
* @date 2025-08-11
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsStockLogVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 仓库/库区/库位ID
|
||||
*/
|
||||
@ExcelProperty(value = "仓库/库区/库位ID")
|
||||
private Long warehouseId;
|
||||
|
||||
/**
|
||||
* 物品ID(指向原材料或产品主键)
|
||||
*/
|
||||
@ExcelProperty(value = "物品ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "指=向原材料或产品主键")
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 物品类型(raw_material/product)
|
||||
*/
|
||||
@ExcelProperty(value = "物品类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "r=aw_material/product")
|
||||
private String itemType;
|
||||
|
||||
/**
|
||||
* 变动数量(正=入库,负=出库)
|
||||
*/
|
||||
@ExcelProperty(value = "变动数量", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "正==入库,负=出库")
|
||||
private BigDecimal changeQty;
|
||||
|
||||
/**
|
||||
* 变动后的库存数量
|
||||
*/
|
||||
@ExcelProperty(value = "变动后的库存数量")
|
||||
private BigDecimal afterQty;
|
||||
|
||||
/**
|
||||
* 变动类型(入库/出库等)
|
||||
*/
|
||||
@ExcelProperty(value = "变动类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "入=库/出库等")
|
||||
private String changeType;
|
||||
|
||||
/**
|
||||
* 实际库存变动时间
|
||||
*/
|
||||
@ExcelProperty(value = "实际库存变动时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date changeTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 仓库/库区名称
|
||||
*/
|
||||
@ExcelProperty(value = "仓库/库区名称")
|
||||
private String warehouseName;
|
||||
|
||||
//批次号
|
||||
private String batchNo;
|
||||
}
|
||||
Reference in New Issue
Block a user