diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmProductRecptController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmProductRecptController.java index 1a026dd..84cbabc 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmProductRecptController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmProductRecptController.java @@ -7,7 +7,9 @@ import cn.hutool.core.collection.CollUtil; import com.ktg.common.constant.UserConstants; import com.ktg.common.utils.StringUtils; import com.ktg.mes.wm.domain.*; +import com.ktg.mes.wm.domain.tx.ProductRecptTxBean; import com.ktg.mes.wm.service.*; +import com.sun.deploy.panel.ExceptionListDialog; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +53,9 @@ public class WmProductRecptController extends BaseController @Autowired private IWmStorageAreaService wmStorageAreaService; + @Autowired + private IStorageCoreService storageCoreService; + /** * 查询产品入库录列表 */ @@ -172,7 +177,7 @@ public class WmProductRecptController extends BaseController @PreAuthorize("@ss.hasPermi('mes:wm:productrecpt:edit')") @Log(title = "产品入库记录", businessType = BusinessType.UPDATE) @Transactional - @PutMapping("/{issueId}") + @PutMapping("/{recptId}") public AjaxResult execute(@PathVariable Long recptId){ WmProductRecpt recpt = wmProductRecptService.selectWmProductRecptByRecptId(recptId); @@ -183,7 +188,11 @@ public class WmProductRecptController extends BaseController return AjaxResult.error("请添加要入库的产品"); } + List beans = wmProductRecptService.getTxBean(recptId); + storageCoreService.processProductRecpt(beans); + recpt.setStatus(UserConstants.ORDER_STATUS_FINISHED); + wmProductRecptService.updateWmProductRecpt(recpt); return AjaxResult.success(); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmProductRecptLine.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmProductRecptLine.java index 7fbd641..5c6907e 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmProductRecptLine.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmProductRecptLine.java @@ -1,6 +1,9 @@ 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; @@ -91,6 +94,11 @@ public class WmProductRecptLine extends BaseEntity @Excel(name = "库位名称") private String areaName; + /** 有效期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd") + private Date expireDate; + /** 预留字段1 */ private String attr1; @@ -274,7 +282,16 @@ public class WmProductRecptLine extends BaseEntity { return areaName; } - public void setAttr1(String attr1) + + public Date getExpireDate() { + return expireDate; + } + + public void setExpireDate(Date expireDate) { + this.expireDate = expireDate; + } + + public void setAttr1(String attr1) { this.attr1 = attr1; } @@ -313,35 +330,31 @@ public class WmProductRecptLine extends BaseEntity @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("lineId", getLineId()) - .append("recptId", getRecptId()) - .append("materialStockId", getMaterialStockId()) - .append("itemId", getItemId()) - .append("itemCode", getItemCode()) - .append("itemName", getItemName()) - .append("specification", getSpecification()) - .append("unitOfMeasure", getUnitOfMeasure()) - .append("quantityRecived", getQuantityRecived()) - .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("remark", getRemark()) - .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(); + return "WmProductRecptLine{" + + "lineId=" + lineId + + ", recptId=" + recptId + + ", materialStockId=" + materialStockId + + ", itemId=" + itemId + + ", itemCode='" + itemCode + '\'' + + ", itemName='" + itemName + '\'' + + ", specification='" + specification + '\'' + + ", unitOfMeasure='" + unitOfMeasure + '\'' + + ", quantityRecived=" + quantityRecived + + ", batchCode='" + batchCode + '\'' + + ", warehouseId=" + warehouseId + + ", warehouseCode='" + warehouseCode + '\'' + + ", warehouseName='" + warehouseName + '\'' + + ", locationId=" + locationId + + ", locationCode='" + locationCode + '\'' + + ", locationName='" + locationName + '\'' + + ", areaId=" + areaId + + ", areaCode='" + areaCode + '\'' + + ", areaName='" + areaName + '\'' + + ", expireDate=" + expireDate + + ", attr1='" + attr1 + '\'' + + ", attr2='" + attr2 + '\'' + + ", attr3=" + attr3 + + ", attr4=" + attr4 + + '}'; } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/ProductRecptTxBean.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/ProductRecptTxBean.java index 3e023d0..33a7049 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/ProductRecptTxBean.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/ProductRecptTxBean.java @@ -1,8 +1,10 @@ package com.ktg.mes.wm.domain.tx; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ktg.common.core.domain.BaseEntity; import java.math.BigDecimal; +import java.util.Date; public class ProductRecptTxBean extends BaseEntity { @@ -81,4 +83,242 @@ public class ProductRecptTxBean extends BaseEntity { */ private String workorderCode; + /** 入库日期 */ + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") + private Date recptDate; + + /** 库存有效期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date expireDate; + + public Long getMaterialStockId() { + return materialStockId; + } + + public void setMaterialStockId(Long materialStockId) { + this.materialStockId = materialStockId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getItemCode() { + return itemCode; + } + + public void setItemCode(String itemCode) { + this.itemCode = itemCode; + } + + public String getItemName() { + return itemName; + } + + public void setItemName(String itemName) { + this.itemName = itemName; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + + public String getUnitOfMeasure() { + return unitOfMeasure; + } + + public void setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + } + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public Long getWarehouseId() { + return warehouseId; + } + + public void setWarehouseId(Long warehouseId) { + this.warehouseId = warehouseId; + } + + public String getWarehouseCode() { + return warehouseCode; + } + + public void setWarehouseCode(String warehouseCode) { + this.warehouseCode = warehouseCode; + } + + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public Long getLocationId() { + return locationId; + } + + public void setLocationId(Long locationId) { + this.locationId = locationId; + } + + public String getLocationCode() { + return locationCode; + } + + public void setLocationCode(String locationCode) { + this.locationCode = locationCode; + } + + public String getLocationName() { + return locationName; + } + + public void setLocationName(String locationName) { + this.locationName = locationName; + } + + public Long getAreaId() { + return areaId; + } + + public void setAreaId(Long areaId) { + this.areaId = areaId; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getSourceDocType() { + return sourceDocType; + } + + public void setSourceDocType(String sourceDocType) { + this.sourceDocType = sourceDocType; + } + + public Long getSourceDocId() { + return sourceDocId; + } + + public void setSourceDocId(Long sourceDocId) { + this.sourceDocId = sourceDocId; + } + + public String getSourceDocCode() { + return sourceDocCode; + } + + public void setSourceDocCode(String sourceDocCode) { + this.sourceDocCode = sourceDocCode; + } + + public Long getSourceDocLineId() { + return sourceDocLineId; + } + + public void setSourceDocLineId(Long sourceDocLineId) { + this.sourceDocLineId = sourceDocLineId; + } + + public BigDecimal getTransactionQuantity() { + return transactionQuantity; + } + + public void setTransactionQuantity(BigDecimal transactionQuantity) { + this.transactionQuantity = transactionQuantity; + } + + public Long getWorkorderId() { + return workorderId; + } + + public void setWorkorderId(Long workorderId) { + this.workorderId = workorderId; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public Date getRecptDate() { + return recptDate; + } + + public void setRecptDate(Date recptDate) { + this.recptDate = recptDate; + } + + public Date getExpireDate() { + return expireDate; + } + + public void setExpireDate(Date expireDate) { + this.expireDate = expireDate; + } + + @Override + public String toString() { + return "ProductRecptTxBean{" + + "materialStockId=" + materialStockId + + ", itemId=" + itemId + + ", itemCode='" + itemCode + '\'' + + ", itemName='" + itemName + '\'' + + ", specification='" + specification + '\'' + + ", unitOfMeasure='" + unitOfMeasure + '\'' + + ", batchCode='" + batchCode + '\'' + + ", warehouseId=" + warehouseId + + ", warehouseCode='" + warehouseCode + '\'' + + ", warehouseName='" + warehouseName + '\'' + + ", locationId=" + locationId + + ", locationCode='" + locationCode + '\'' + + ", locationName='" + locationName + '\'' + + ", areaId=" + areaId + + ", areaCode='" + areaCode + '\'' + + ", areaName='" + areaName + '\'' + + ", sourceDocType='" + sourceDocType + '\'' + + ", sourceDocId=" + sourceDocId + + ", sourceDocCode='" + sourceDocCode + '\'' + + ", sourceDocLineId=" + sourceDocLineId + + ", transactionQuantity=" + transactionQuantity + + ", workorderId=" + workorderId + + ", workorderCode='" + workorderCode + '\'' + + ", recptDate=" + recptDate + + ", expireDate=" + expireDate + + '}'; + } } diff --git a/ktg-mes/src/main/resources/mapper/wm/WmProductRecptMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmProductRecptMapper.xml index 1c8130e..0901089 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmProductRecptMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmProductRecptMapper.xml @@ -38,10 +38,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select recpt_id, recpt_code, recpt_name, workorder_id, workorder_code, workorder_name,item_id, item_code, item_name, specification, unit_of_measure, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, recpt_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_product_recpt + +