产品入库,执行入库
This commit is contained in:
parent
32db6b48fa
commit
447da050f0
@ -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<ProductRecptTxBean> beans = wmProductRecptService.getTxBean(recptId);
|
||||
storageCoreService.processProductRecpt(beans);
|
||||
|
||||
recpt.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
wmProductRecptService.updateWmProductRecpt(recpt);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -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 +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -38,10 +38,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ProductRecptTxBean" id="ProductRecptTxBeanResult">
|
||||
<result property="materialStockId" column="material_stock_id" ></result>
|
||||
<result property="itemId" column="item_id"></result>
|
||||
<result property="itemCode" column="item_code"></result>
|
||||
<result property="itemName" column="item_name"></result>
|
||||
<result property="specification" column="specification"></result>
|
||||
<result property="unitOfMeasure" column="unit_of_measure"></result>
|
||||
<result property="batchCode" column="batch_code"></result>
|
||||
<result property="warehouseId" column="warehouse_id"></result>
|
||||
<result property="warehouseCode" column="warehouse_code"></result>
|
||||
<result property="warehouseName" column="warehouse_name"></result>
|
||||
<result property="locationId" column="location_id"></result>
|
||||
<result property="locationCode" column="location_code"></result>
|
||||
<result property="locationName" column="location_name"></result>
|
||||
<result property="areaId" column="area_id"></result>
|
||||
<result property="areaCode" column="area_code"></result>
|
||||
<result property="areaName" column="area_name"></result>
|
||||
<result property="workorderId" column="workorder_id"></result>
|
||||
<result property="workorderCode" column="workorder_code"></result>
|
||||
<result property="sourceDocType" column="source_doc_type"></result>
|
||||
<result property="sourceDocId" column="source_doc_id"></result>
|
||||
<result property="sourceDocCode" column="source_doc_code"></result>
|
||||
<result property="sourceDocLineId" column="source_doc_line_id"></result>
|
||||
<result property="transactionQuantity" column="transaction_quantity"></result>
|
||||
<result property="recptDate" column="recpt_date"></result>
|
||||
<result property="expireDate" column="expire_date"></result>
|
||||
<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="selectWmProductRecptVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="getTxBean" parameterType="Long" resultMap="ProductRecptTxBeanResult">
|
||||
SELECT irl.`item_id`,irl.`item_code`,irl.`item_name`,irl.`specification`,irl.`unit_of_measure`,irl.`batch_code`,
|
||||
irl.`warehouse_id`,irl.`warehouse_code`,irl.`warehouse_name`,irl.`location_id`,irl.`location_code`,irl.`location_name`,irl.`area_id`,irl.`area_code`,irl.`area_name`,
|
||||
irl.workorder_id,irl.workorder_code,irl.workorder_name,
|
||||
'PR' AS source_doc_type,ir.`recpt_id` AS source_doc_id,ir.`recpt_code` AS source_doc_code,irl.`line_id` AS source_doc_line_id,
|
||||
irl.`quantity_recived` AS transaction_quantity,ir.recpt_date, irl.`expire_date`,
|
||||
ir.`create_by`,ir.`create_time`,ir.`update_by`,ir.`update_time`
|
||||
FROM wm_product_recpt ir
|
||||
LEFT JOIN wm_product_recpt_line irl
|
||||
ON ir.recpt_id = irl.`recpt_id`
|
||||
WHERE ir.`recpt_id` = #{recptId}
|
||||
</select>
|
||||
|
||||
<select id="selectWmProductRecptList" parameterType="WmProductRecpt" resultMap="WmProductRecptResult">
|
||||
<include refid="selectWmProductRecptVo"/>
|
||||
<where>
|
||||
|
Loading…
Reference in New Issue
Block a user