库存相关后台逻辑
This commit is contained in:
parent
952c8f38b0
commit
b1b806a200
@ -106,4 +106,11 @@ public class UserConstants
|
||||
public static final String GANTT_TASK_TYPE_TASK="task";
|
||||
public static final String GANTT_TASK_TYPE_PROJECT="project";
|
||||
|
||||
|
||||
public static final String REPORT_PRINT_TYPE ="print";
|
||||
public static final String REPORT_PDF_TYPE ="pdf";
|
||||
public static final String REPORT_EXCEL_TYPE ="excel";
|
||||
public static final String REPORT_WORD_TYPE ="word";
|
||||
|
||||
|
||||
}
|
||||
|
339
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmMaterialStock.java
Normal file
339
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmMaterialStock.java
Normal file
@ -0,0 +1,339 @@
|
||||
package com.ktg.mes.wm.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 库存记录对象 wm_material_stock
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
public class WmMaterialStock extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 事务ID */
|
||||
private Long materialStockId;
|
||||
|
||||
/** 产品物料ID */
|
||||
@Excel(name = "产品物料ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
@Excel(name = "产品物料编码")
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
@Excel(name = "产品物料名称")
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 入库批次号 */
|
||||
@Excel(name = "入库批次号")
|
||||
private String batchCode;
|
||||
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 库区ID */
|
||||
@Excel(name = "库区ID")
|
||||
private Long locationId;
|
||||
|
||||
/** 库区编码 */
|
||||
@Excel(name = "库区编码")
|
||||
private String locationCode;
|
||||
|
||||
/** 库区名称 */
|
||||
@Excel(name = "库区名称")
|
||||
private String locationName;
|
||||
|
||||
/** 库位ID */
|
||||
@Excel(name = "库位ID")
|
||||
private Long areaId;
|
||||
|
||||
/** 库位编码 */
|
||||
@Excel(name = "库位编码")
|
||||
private String areaCode;
|
||||
|
||||
/** 库位名称 */
|
||||
@Excel(name = "库位名称")
|
||||
private String areaName;
|
||||
|
||||
/** 在库数量 */
|
||||
@Excel(name = "在库数量")
|
||||
private BigDecimal quantityOnhand;
|
||||
|
||||
/** 库存有效期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "库存有效期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
|
||||
/** 预留字段1 */
|
||||
@Excel(name = "预留字段1")
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
@Excel(name = "预留字段2")
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
@Excel(name = "预留字段3")
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
@Excel(name = "预留字段4")
|
||||
private Long attr4;
|
||||
|
||||
public void setMaterialStockId(Long materialStockId)
|
||||
{
|
||||
this.materialStockId = materialStockId;
|
||||
}
|
||||
|
||||
public Long getMaterialStockId()
|
||||
{
|
||||
return materialStockId;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setItemCode(String itemCode)
|
||||
{
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemCode()
|
||||
{
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
public void setSpecification(String specification)
|
||||
{
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getSpecification()
|
||||
{
|
||||
return specification;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setBatchCode(String batchCode)
|
||||
{
|
||||
this.batchCode = batchCode;
|
||||
}
|
||||
|
||||
public String getBatchCode()
|
||||
{
|
||||
return batchCode;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setWarehouseCode(String warehouseCode)
|
||||
{
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseCode()
|
||||
{
|
||||
return warehouseCode;
|
||||
}
|
||||
public void setWarehouseName(String warehouseName)
|
||||
{
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getWarehouseName()
|
||||
{
|
||||
return warehouseName;
|
||||
}
|
||||
public void setLocationId(Long locationId)
|
||||
{
|
||||
this.locationId = locationId;
|
||||
}
|
||||
|
||||
public Long getLocationId()
|
||||
{
|
||||
return locationId;
|
||||
}
|
||||
public void setLocationCode(String locationCode)
|
||||
{
|
||||
this.locationCode = locationCode;
|
||||
}
|
||||
|
||||
public String getLocationCode()
|
||||
{
|
||||
return locationCode;
|
||||
}
|
||||
public void setLocationName(String locationName)
|
||||
{
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public String getLocationName()
|
||||
{
|
||||
return locationName;
|
||||
}
|
||||
public void setAreaId(Long areaId)
|
||||
{
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public Long getAreaId()
|
||||
{
|
||||
return areaId;
|
||||
}
|
||||
public void setAreaCode(String areaCode)
|
||||
{
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaCode()
|
||||
{
|
||||
return areaCode;
|
||||
}
|
||||
public void setAreaName(String areaName)
|
||||
{
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaName()
|
||||
{
|
||||
return areaName;
|
||||
}
|
||||
public void setQuantityOnhand(BigDecimal quantityOnhand)
|
||||
{
|
||||
this.quantityOnhand = quantityOnhand;
|
||||
}
|
||||
|
||||
public BigDecimal getQuantityOnhand()
|
||||
{
|
||||
return quantityOnhand;
|
||||
}
|
||||
public void setExpireDate(Date expireDate)
|
||||
{
|
||||
this.expireDate = expireDate;
|
||||
}
|
||||
|
||||
public Date getExpireDate()
|
||||
{
|
||||
return expireDate;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("materialStockId", getMaterialStockId())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("specification", getSpecification())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("batchCode", getBatchCode())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("warehouseCode", getWarehouseCode())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("locationId", getLocationId())
|
||||
.append("locationCode", getLocationCode())
|
||||
.append("locationName", getLocationName())
|
||||
.append("areaId", getAreaId())
|
||||
.append("areaCode", getAreaCode())
|
||||
.append("areaName", getAreaName())
|
||||
.append("quantityOnhand", getQuantityOnhand())
|
||||
.append("expireDate", getExpireDate())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
407
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmTransaction.java
Normal file
407
ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmTransaction.java
Normal file
@ -0,0 +1,407 @@
|
||||
package com.ktg.mes.wm.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 库存事务对象 wm_transaction
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
public class WmTransaction extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 事务ID */
|
||||
private Long transactionId;
|
||||
|
||||
/** 事务类型 */
|
||||
@Excel(name = "事务类型")
|
||||
private String transactionType;
|
||||
|
||||
/** 产品物料ID */
|
||||
@Excel(name = "产品物料ID")
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
@Excel(name = "产品物料编码")
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
@Excel(name = "产品物料名称")
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 入库批次号 */
|
||||
@Excel(name = "入库批次号")
|
||||
private String batchCode;
|
||||
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 库区ID */
|
||||
@Excel(name = "库区ID")
|
||||
private Long locationId;
|
||||
|
||||
/** 库区编码 */
|
||||
@Excel(name = "库区编码")
|
||||
private String locationCode;
|
||||
|
||||
/** 库区名称 */
|
||||
@Excel(name = "库区名称")
|
||||
private String locationName;
|
||||
|
||||
/** 库位ID */
|
||||
@Excel(name = "库位ID")
|
||||
private Long areaId;
|
||||
|
||||
/** 库位编码 */
|
||||
@Excel(name = "库位编码")
|
||||
private String areaCode;
|
||||
|
||||
/** 库位名称 */
|
||||
@Excel(name = "库位名称")
|
||||
private String areaName;
|
||||
|
||||
/** 库存记录ID */
|
||||
@Excel(name = "库存记录ID")
|
||||
private Long materialStockId;
|
||||
|
||||
/** 库存方向 */
|
||||
@Excel(name = "库存方向")
|
||||
private Integer transactionFlag;
|
||||
|
||||
/** 事务数量 */
|
||||
@Excel(name = "事务数量")
|
||||
private BigDecimal transactionQuantity;
|
||||
|
||||
/** 事务日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "事务日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date transactionDate;
|
||||
|
||||
/** ERP账期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "ERP账期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date erpDate;
|
||||
|
||||
/** 库存有效期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "库存有效期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setTransactionId(Long transactionId)
|
||||
{
|
||||
this.transactionId = transactionId;
|
||||
}
|
||||
|
||||
public Long getTransactionId()
|
||||
{
|
||||
return transactionId;
|
||||
}
|
||||
public void setTransactionType(String transactionType)
|
||||
{
|
||||
this.transactionType = transactionType;
|
||||
}
|
||||
|
||||
public String getTransactionType()
|
||||
{
|
||||
return transactionType;
|
||||
}
|
||||
public void setItemId(Long itemId)
|
||||
{
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
}
|
||||
public void setItemCode(String itemCode)
|
||||
{
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemCode()
|
||||
{
|
||||
return itemCode;
|
||||
}
|
||||
public void setItemName(String itemName)
|
||||
{
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getItemName()
|
||||
{
|
||||
return itemName;
|
||||
}
|
||||
public void setSpecification(String specification)
|
||||
{
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getSpecification()
|
||||
{
|
||||
return specification;
|
||||
}
|
||||
public void setUnitOfMeasure(String unitOfMeasure)
|
||||
{
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure()
|
||||
{
|
||||
return unitOfMeasure;
|
||||
}
|
||||
public void setBatchCode(String batchCode)
|
||||
{
|
||||
this.batchCode = batchCode;
|
||||
}
|
||||
|
||||
public String getBatchCode()
|
||||
{
|
||||
return batchCode;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setWarehouseCode(String warehouseCode)
|
||||
{
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseCode()
|
||||
{
|
||||
return warehouseCode;
|
||||
}
|
||||
public void setWarehouseName(String warehouseName)
|
||||
{
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getWarehouseName()
|
||||
{
|
||||
return warehouseName;
|
||||
}
|
||||
public void setLocationId(Long locationId)
|
||||
{
|
||||
this.locationId = locationId;
|
||||
}
|
||||
|
||||
public Long getLocationId()
|
||||
{
|
||||
return locationId;
|
||||
}
|
||||
public void setLocationCode(String locationCode)
|
||||
{
|
||||
this.locationCode = locationCode;
|
||||
}
|
||||
|
||||
public String getLocationCode()
|
||||
{
|
||||
return locationCode;
|
||||
}
|
||||
public void setLocationName(String locationName)
|
||||
{
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public String getLocationName()
|
||||
{
|
||||
return locationName;
|
||||
}
|
||||
public void setAreaId(Long areaId)
|
||||
{
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public Long getAreaId()
|
||||
{
|
||||
return areaId;
|
||||
}
|
||||
public void setAreaCode(String areaCode)
|
||||
{
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaCode()
|
||||
{
|
||||
return areaCode;
|
||||
}
|
||||
public void setAreaName(String areaName)
|
||||
{
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaName()
|
||||
{
|
||||
return areaName;
|
||||
}
|
||||
public void setMaterialStockId(Long materialStockId)
|
||||
{
|
||||
this.materialStockId = materialStockId;
|
||||
}
|
||||
|
||||
public Long getMaterialStockId()
|
||||
{
|
||||
return materialStockId;
|
||||
}
|
||||
public void setTransactionFlag(Integer transactionFlag)
|
||||
{
|
||||
this.transactionFlag = transactionFlag;
|
||||
}
|
||||
|
||||
public Integer getTransactionFlag()
|
||||
{
|
||||
return transactionFlag;
|
||||
}
|
||||
public void setTransactionQuantity(BigDecimal transactionQuantity)
|
||||
{
|
||||
this.transactionQuantity = transactionQuantity;
|
||||
}
|
||||
|
||||
public BigDecimal getTransactionQuantity()
|
||||
{
|
||||
return transactionQuantity;
|
||||
}
|
||||
public void setTransactionDate(Date transactionDate)
|
||||
{
|
||||
this.transactionDate = transactionDate;
|
||||
}
|
||||
|
||||
public Date getTransactionDate()
|
||||
{
|
||||
return transactionDate;
|
||||
}
|
||||
public void setErpDate(Date erpDate)
|
||||
{
|
||||
this.erpDate = erpDate;
|
||||
}
|
||||
|
||||
public Date getErpDate()
|
||||
{
|
||||
return erpDate;
|
||||
}
|
||||
public void setExpireDate(Date expireDate)
|
||||
{
|
||||
this.expireDate = expireDate;
|
||||
}
|
||||
|
||||
public Date getExpireDate()
|
||||
{
|
||||
return expireDate;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("transactionId", getTransactionId())
|
||||
.append("transactionType", getTransactionType())
|
||||
.append("itemId", getItemId())
|
||||
.append("itemCode", getItemCode())
|
||||
.append("itemName", getItemName())
|
||||
.append("specification", getSpecification())
|
||||
.append("unitOfMeasure", getUnitOfMeasure())
|
||||
.append("batchCode", getBatchCode())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("warehouseCode", getWarehouseCode())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("locationId", getLocationId())
|
||||
.append("locationCode", getLocationCode())
|
||||
.append("locationName", getLocationName())
|
||||
.append("areaId", getAreaId())
|
||||
.append("areaCode", getAreaCode())
|
||||
.append("areaName", getAreaName())
|
||||
.append("materialStockId", getMaterialStockId())
|
||||
.append("transactionFlag", getTransactionFlag())
|
||||
.append("transactionQuantity", getTransactionQuantity())
|
||||
.append("transactionDate", getTransactionDate())
|
||||
.append("erpDate", getErpDate())
|
||||
.append("expireDate", getExpireDate())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmMaterialStock;
|
||||
|
||||
/**
|
||||
* 库存记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
public interface WmMaterialStockMapper
|
||||
{
|
||||
/**
|
||||
* 查询库存记录
|
||||
*
|
||||
* @param materialStockId 库存记录主键
|
||||
* @return 库存记录
|
||||
*/
|
||||
public WmMaterialStock selectWmMaterialStockByMaterialStockId(Long materialStockId);
|
||||
|
||||
/**
|
||||
* 查询库存记录列表
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 库存记录集合
|
||||
*/
|
||||
public List<WmMaterialStock> selectWmMaterialStockList(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 新增库存记录
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmMaterialStock(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 修改库存记录
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmMaterialStock(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 删除库存记录
|
||||
*
|
||||
* @param materialStockId 库存记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmMaterialStockByMaterialStockId(Long materialStockId);
|
||||
|
||||
/**
|
||||
* 批量删除库存记录
|
||||
*
|
||||
* @param materialStockIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmMaterialStockByMaterialStockIds(Long[] materialStockIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmTransaction;
|
||||
|
||||
/**
|
||||
* 库存事务Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
public interface WmTransactionMapper
|
||||
{
|
||||
/**
|
||||
* 查询库存事务
|
||||
*
|
||||
* @param transactionId 库存事务主键
|
||||
* @return 库存事务
|
||||
*/
|
||||
public WmTransaction selectWmTransactionByTransactionId(Long transactionId);
|
||||
|
||||
/**
|
||||
* 查询库存事务列表
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 库存事务集合
|
||||
*/
|
||||
public List<WmTransaction> selectWmTransactionList(WmTransaction wmTransaction);
|
||||
|
||||
/**
|
||||
* 新增库存事务
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmTransaction(WmTransaction wmTransaction);
|
||||
|
||||
/**
|
||||
* 修改库存事务
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmTransaction(WmTransaction wmTransaction);
|
||||
|
||||
/**
|
||||
* 删除库存事务
|
||||
*
|
||||
* @param transactionId 库存事务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransactionByTransactionId(Long transactionId);
|
||||
|
||||
/**
|
||||
* 批量删除库存事务
|
||||
*
|
||||
* @param transactionIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransactionByTransactionIds(Long[] transactionIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmMaterialStock;
|
||||
|
||||
/**
|
||||
* 库存记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
public interface IWmMaterialStockService
|
||||
{
|
||||
/**
|
||||
* 查询库存记录
|
||||
*
|
||||
* @param materialStockId 库存记录主键
|
||||
* @return 库存记录
|
||||
*/
|
||||
public WmMaterialStock selectWmMaterialStockByMaterialStockId(Long materialStockId);
|
||||
|
||||
/**
|
||||
* 查询库存记录列表
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 库存记录集合
|
||||
*/
|
||||
public List<WmMaterialStock> selectWmMaterialStockList(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 新增库存记录
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmMaterialStock(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 修改库存记录
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmMaterialStock(WmMaterialStock wmMaterialStock);
|
||||
|
||||
/**
|
||||
* 批量删除库存记录
|
||||
*
|
||||
* @param materialStockIds 需要删除的库存记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmMaterialStockByMaterialStockIds(Long[] materialStockIds);
|
||||
|
||||
/**
|
||||
* 删除库存记录信息
|
||||
*
|
||||
* @param materialStockId 库存记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmMaterialStockByMaterialStockId(Long materialStockId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmTransaction;
|
||||
|
||||
/**
|
||||
* 库存事务Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
public interface IWmTransactionService
|
||||
{
|
||||
/**
|
||||
* 查询库存事务
|
||||
*
|
||||
* @param transactionId 库存事务主键
|
||||
* @return 库存事务
|
||||
*/
|
||||
public WmTransaction selectWmTransactionByTransactionId(Long transactionId);
|
||||
|
||||
/**
|
||||
* 查询库存事务列表
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 库存事务集合
|
||||
*/
|
||||
public List<WmTransaction> selectWmTransactionList(WmTransaction wmTransaction);
|
||||
|
||||
/**
|
||||
* 新增库存事务
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmTransaction(WmTransaction wmTransaction);
|
||||
|
||||
/**
|
||||
* 修改库存事务
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmTransaction(WmTransaction wmTransaction);
|
||||
|
||||
/**
|
||||
* 批量删除库存事务
|
||||
*
|
||||
* @param transactionIds 需要删除的库存事务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransactionByTransactionIds(Long[] transactionIds);
|
||||
|
||||
/**
|
||||
* 删除库存事务信息
|
||||
*
|
||||
* @param transactionId 库存事务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmTransactionByTransactionId(Long transactionId);
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.ktg.mes.wm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.mes.wm.domain.WmMaterialStock;
|
||||
import com.ktg.mes.wm.mapper.WmMaterialStockMapper;
|
||||
import com.ktg.mes.wm.service.IWmMaterialStockService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 库存记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
@Service
|
||||
public class WmMaterialStockServiceImpl implements IWmMaterialStockService
|
||||
{
|
||||
@Autowired
|
||||
private WmMaterialStockMapper wmMaterialStockMapper;
|
||||
|
||||
/**
|
||||
* 查询库存记录
|
||||
*
|
||||
* @param materialStockId 库存记录主键
|
||||
* @return 库存记录
|
||||
*/
|
||||
@Override
|
||||
public WmMaterialStock selectWmMaterialStockByMaterialStockId(Long materialStockId)
|
||||
{
|
||||
return wmMaterialStockMapper.selectWmMaterialStockByMaterialStockId(materialStockId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库存记录列表
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 库存记录
|
||||
*/
|
||||
@Override
|
||||
public List<WmMaterialStock> selectWmMaterialStockList(WmMaterialStock wmMaterialStock)
|
||||
{
|
||||
return wmMaterialStockMapper.selectWmMaterialStockList(wmMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存记录
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmMaterialStock(WmMaterialStock wmMaterialStock)
|
||||
{
|
||||
wmMaterialStock.setCreateTime(DateUtils.getNowDate());
|
||||
return wmMaterialStockMapper.insertWmMaterialStock(wmMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存记录
|
||||
*
|
||||
* @param wmMaterialStock 库存记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmMaterialStock(WmMaterialStock wmMaterialStock)
|
||||
{
|
||||
wmMaterialStock.setUpdateTime(DateUtils.getNowDate());
|
||||
return wmMaterialStockMapper.updateWmMaterialStock(wmMaterialStock);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存记录
|
||||
*
|
||||
* @param materialStockIds 需要删除的库存记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmMaterialStockByMaterialStockIds(Long[] materialStockIds)
|
||||
{
|
||||
return wmMaterialStockMapper.deleteWmMaterialStockByMaterialStockIds(materialStockIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存记录信息
|
||||
*
|
||||
* @param materialStockId 库存记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmMaterialStockByMaterialStockId(Long materialStockId)
|
||||
{
|
||||
return wmMaterialStockMapper.deleteWmMaterialStockByMaterialStockId(materialStockId);
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.ktg.mes.wm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmTransactionMapper;
|
||||
import com.ktg.mes.wm.domain.WmTransaction;
|
||||
import com.ktg.mes.wm.service.IWmTransactionService;
|
||||
|
||||
/**
|
||||
* 库存事务Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-24
|
||||
*/
|
||||
@Service
|
||||
public class WmTransactionServiceImpl implements IWmTransactionService
|
||||
{
|
||||
@Autowired
|
||||
private WmTransactionMapper wmTransactionMapper;
|
||||
|
||||
/**
|
||||
* 查询库存事务
|
||||
*
|
||||
* @param transactionId 库存事务主键
|
||||
* @return 库存事务
|
||||
*/
|
||||
@Override
|
||||
public WmTransaction selectWmTransactionByTransactionId(Long transactionId)
|
||||
{
|
||||
return wmTransactionMapper.selectWmTransactionByTransactionId(transactionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库存事务列表
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 库存事务
|
||||
*/
|
||||
@Override
|
||||
public List<WmTransaction> selectWmTransactionList(WmTransaction wmTransaction)
|
||||
{
|
||||
return wmTransactionMapper.selectWmTransactionList(wmTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存事务
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmTransaction(WmTransaction wmTransaction)
|
||||
{
|
||||
wmTransaction.setCreateTime(DateUtils.getNowDate());
|
||||
return wmTransactionMapper.insertWmTransaction(wmTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存事务
|
||||
*
|
||||
* @param wmTransaction 库存事务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmTransaction(WmTransaction wmTransaction)
|
||||
{
|
||||
wmTransaction.setUpdateTime(DateUtils.getNowDate());
|
||||
return wmTransactionMapper.updateWmTransaction(wmTransaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存事务
|
||||
*
|
||||
* @param transactionIds 需要删除的库存事务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmTransactionByTransactionIds(Long[] transactionIds)
|
||||
{
|
||||
return wmTransactionMapper.deleteWmTransactionByTransactionIds(transactionIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存事务信息
|
||||
*
|
||||
* @param transactionId 库存事务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmTransactionByTransactionId(Long transactionId)
|
||||
{
|
||||
return wmTransactionMapper.deleteWmTransactionByTransactionId(transactionId);
|
||||
}
|
||||
}
|
172
ktg-mes/src/main/resources/mapper/wm/WmMaterialStockMapper.xml
Normal file
172
ktg-mes/src/main/resources/mapper/wm/WmMaterialStockMapper.xml
Normal file
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ktg.mes.md.mapper.WmMaterialStockMapper">
|
||||
|
||||
<resultMap type="WmMaterialStock" id="WmMaterialStockResult">
|
||||
<result property="materialStockId" column="material_stock_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="batchCode" column="batch_code" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseCode" column="warehouse_code" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="locationId" column="location_id" />
|
||||
<result property="locationCode" column="location_code" />
|
||||
<result property="locationName" column="location_name" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="quantityOnhand" column="quantity_onhand" />
|
||||
<result property="expireDate" column="expire_date" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmMaterialStockVo">
|
||||
select material_stock_id, item_id, item_code, item_name, specification, unit_of_measure, batch_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, quantity_onhand, expire_date, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_material_stock
|
||||
</sql>
|
||||
|
||||
<select id="selectWmMaterialStockList" parameterType="WmMaterialStock" resultMap="WmMaterialStockResult">
|
||||
<include refid="selectWmMaterialStockVo"/>
|
||||
<where>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="locationId != null "> and location_id = #{locationId}</if>
|
||||
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
|
||||
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="quantityOnhand != null "> and quantity_onhand = #{quantityOnhand}</if>
|
||||
<if test="expireDate != null "> and expire_date = #{expireDate}</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null "> and attr3 = #{attr3}</if>
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmMaterialStockByMaterialStockId" parameterType="Long" resultMap="WmMaterialStockResult">
|
||||
<include refid="selectWmMaterialStockVo"/>
|
||||
where material_stock_id = #{materialStockId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmMaterialStock" parameterType="WmMaterialStock" useGeneratedKeys="true" keyProperty="materialStockId">
|
||||
insert into wm_material_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="specification != null">specification,</if>
|
||||
<if test="unitOfMeasure != null">unit_of_measure,</if>
|
||||
<if test="batchCode != null">batch_code,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="warehouseCode != null">warehouse_code,</if>
|
||||
<if test="warehouseName != null">warehouse_name,</if>
|
||||
<if test="locationId != null">location_id,</if>
|
||||
<if test="locationCode != null">location_code,</if>
|
||||
<if test="locationName != null">location_name,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="quantityOnhand != null">quantity_onhand,</if>
|
||||
<if test="expireDate != null">expire_date,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
<if test="specification != null">#{specification},</if>
|
||||
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
|
||||
<if test="batchCode != null">#{batchCode},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="warehouseCode != null">#{warehouseCode},</if>
|
||||
<if test="warehouseName != null">#{warehouseName},</if>
|
||||
<if test="locationId != null">#{locationId},</if>
|
||||
<if test="locationCode != null">#{locationCode},</if>
|
||||
<if test="locationName != null">#{locationName},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="quantityOnhand != null">#{quantityOnhand},</if>
|
||||
<if test="expireDate != null">#{expireDate},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWmMaterialStock" parameterType="WmMaterialStock">
|
||||
update wm_material_stock
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="specification != null">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="batchCode != null">batch_code = #{batchCode},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
|
||||
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
|
||||
<if test="locationId != null">location_id = #{locationId},</if>
|
||||
<if test="locationCode != null">location_code = #{locationCode},</if>
|
||||
<if test="locationName != null">location_name = #{locationName},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="quantityOnhand != null">quantity_onhand = #{quantityOnhand},</if>
|
||||
<if test="expireDate != null">expire_date = #{expireDate},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where material_stock_id = #{materialStockId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWmMaterialStockByMaterialStockId" parameterType="Long">
|
||||
delete from wm_material_stock where material_stock_id = #{materialStockId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmMaterialStockByMaterialStockIds" parameterType="String">
|
||||
delete from wm_material_stock where material_stock_id in
|
||||
<foreach item="materialStockId" collection="array" open="(" separator="," close=")">
|
||||
#{materialStockId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
193
ktg-mes/src/main/resources/mapper/wm/WmTransactionMapper.xml
Normal file
193
ktg-mes/src/main/resources/mapper/wm/WmTransactionMapper.xml
Normal file
@ -0,0 +1,193 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ktg.mes.wm.mapper.WmTransactionMapper">
|
||||
|
||||
<resultMap type="WmTransaction" id="WmTransactionResult">
|
||||
<result property="transactionId" column="transaction_id" />
|
||||
<result property="transactionType" column="transaction_type" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
<result property="specification" column="specification" />
|
||||
<result property="unitOfMeasure" column="unit_of_measure" />
|
||||
<result property="batchCode" column="batch_code" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseCode" column="warehouse_code" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="locationId" column="location_id" />
|
||||
<result property="locationCode" column="location_code" />
|
||||
<result property="locationName" column="location_name" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="areaCode" column="area_code" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="materialStockId" column="material_stock_id" />
|
||||
<result property="transactionFlag" column="transaction_flag" />
|
||||
<result property="transactionQuantity" column="transaction_quantity" />
|
||||
<result property="transactionDate" column="transaction_date" />
|
||||
<result property="erpDate" column="erp_date" />
|
||||
<result property="expireDate" column="expire_date" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmTransactionVo">
|
||||
select transaction_id, transaction_type, item_id, item_code, item_name, specification, unit_of_measure, batch_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, material_stock_id, transaction_flag, transaction_quantity, transaction_date, erp_date, expire_date, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_transaction
|
||||
</sql>
|
||||
|
||||
<select id="selectWmTransactionList" parameterType="WmTransaction" resultMap="WmTransactionResult">
|
||||
<include refid="selectWmTransactionVo"/>
|
||||
<where>
|
||||
<if test="transactionType != null and transactionType != ''"> and transaction_type = #{transactionType}</if>
|
||||
<if test="itemId != null "> and item_id = #{itemId}</if>
|
||||
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
|
||||
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
||||
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
|
||||
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
|
||||
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="locationId != null "> and location_id = #{locationId}</if>
|
||||
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
|
||||
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="materialStockId != null "> and material_stock_id = #{materialStockId}</if>
|
||||
<if test="transactionFlag != null "> and transaction_flag = #{transactionFlag}</if>
|
||||
<if test="transactionQuantity != null "> and transaction_quantity = #{transactionQuantity}</if>
|
||||
<if test="transactionDate != null "> and transaction_date = #{transactionDate}</if>
|
||||
<if test="erpDate != null "> and erp_date = #{erpDate}</if>
|
||||
<if test="expireDate != null "> and expire_date = #{expireDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmTransactionByTransactionId" parameterType="Long" resultMap="WmTransactionResult">
|
||||
<include refid="selectWmTransactionVo"/>
|
||||
where transaction_id = #{transactionId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmTransaction" parameterType="WmTransaction" useGeneratedKeys="true" keyProperty="transactionId">
|
||||
insert into wm_transaction
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="transactionType != null and transactionType != ''">transaction_type,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
<if test="specification != null">specification,</if>
|
||||
<if test="unitOfMeasure != null">unit_of_measure,</if>
|
||||
<if test="batchCode != null">batch_code,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="warehouseCode != null">warehouse_code,</if>
|
||||
<if test="warehouseName != null">warehouse_name,</if>
|
||||
<if test="locationId != null">location_id,</if>
|
||||
<if test="locationCode != null">location_code,</if>
|
||||
<if test="locationName != null">location_name,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="materialStockId != null">material_stock_id,</if>
|
||||
<if test="transactionFlag != null">transaction_flag,</if>
|
||||
<if test="transactionQuantity != null">transaction_quantity,</if>
|
||||
<if test="transactionDate != null">transaction_date,</if>
|
||||
<if test="erpDate != null">erp_date,</if>
|
||||
<if test="expireDate != null">expire_date,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="transactionType != null and transactionType != ''">#{transactionType},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
<if test="specification != null">#{specification},</if>
|
||||
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
|
||||
<if test="batchCode != null">#{batchCode},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="warehouseCode != null">#{warehouseCode},</if>
|
||||
<if test="warehouseName != null">#{warehouseName},</if>
|
||||
<if test="locationId != null">#{locationId},</if>
|
||||
<if test="locationCode != null">#{locationCode},</if>
|
||||
<if test="locationName != null">#{locationName},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="materialStockId != null">#{materialStockId},</if>
|
||||
<if test="transactionFlag != null">#{transactionFlag},</if>
|
||||
<if test="transactionQuantity != null">#{transactionQuantity},</if>
|
||||
<if test="transactionDate != null">#{transactionDate},</if>
|
||||
<if test="erpDate != null">#{erpDate},</if>
|
||||
<if test="expireDate != null">#{expireDate},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWmTransaction" parameterType="WmTransaction">
|
||||
update wm_transaction
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="transactionType != null and transactionType != ''">transaction_type = #{transactionType},</if>
|
||||
<if test="itemId != null">item_id = #{itemId},</if>
|
||||
<if test="itemCode != null">item_code = #{itemCode},</if>
|
||||
<if test="itemName != null">item_name = #{itemName},</if>
|
||||
<if test="specification != null">specification = #{specification},</if>
|
||||
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
|
||||
<if test="batchCode != null">batch_code = #{batchCode},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="warehouseCode != null">warehouse_code = #{warehouseCode},</if>
|
||||
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
|
||||
<if test="locationId != null">location_id = #{locationId},</if>
|
||||
<if test="locationCode != null">location_code = #{locationCode},</if>
|
||||
<if test="locationName != null">location_name = #{locationName},</if>
|
||||
<if test="areaId != null">area_id = #{areaId},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="materialStockId != null">material_stock_id = #{materialStockId},</if>
|
||||
<if test="transactionFlag != null">transaction_flag = #{transactionFlag},</if>
|
||||
<if test="transactionQuantity != null">transaction_quantity = #{transactionQuantity},</if>
|
||||
<if test="transactionDate != null">transaction_date = #{transactionDate},</if>
|
||||
<if test="erpDate != null">erp_date = #{erpDate},</if>
|
||||
<if test="expireDate != null">expire_date = #{expireDate},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where transaction_id = #{transactionId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWmTransactionByTransactionId" parameterType="Long">
|
||||
delete from wm_transaction where transaction_id = #{transactionId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmTransactionByTransactionIds" parameterType="String">
|
||||
delete from wm_transaction where transaction_id in
|
||||
<foreach item="transactionId" collection="array" open="(" separator="," close=")">
|
||||
#{transactionId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user