cmvr-wms/ruoyi-system/src/main/java/com/ruoyi/warehouse/domain/PurchaseRequest.java
lixiaolong 99cbd807a2 feat(item-category): 添加物品分类申请与审核管理功能
- 新增物品分类申请及审核记录相关数据库表结构
- 添加物品分类管理菜单及对应的角色权限配置
- 实现物品分类申请组件支持新增申请与历史记录查询
- 开发批量AI分类组件以支持采购明细的智能分类推荐
- 新增批量确认小类组件以便管理员快速处理待确认分类
- 构建物品分类管理页面提供分类审核调整及关联记录查看
2026-11-09 09:12:26 +08:00

285 lines
15 KiB
Java

package com.ruoyi.warehouse.domain;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
public class PurchaseRequest extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long id;
/** Ephemeral UI identity echoed on save; never stored in purchase_request. */
private String clientRowKey;
public String getClientRowKey(){return clientRowKey;}public void setClientRowKey(String value){clientRowKey=value;}
private String creatorName;
private String batchCreateBy;
private String batchCreatorName;
public String getCreatorName(){return creatorName;}
public void setCreatorName(String value){creatorName=value;}
public String getBatchCreateBy(){return batchCreateBy;}
public void setBatchCreateBy(String value){batchCreateBy=value;}
public String getBatchCreatorName(){return batchCreatorName;}
public void setBatchCreatorName(String value){batchCreatorName=value;}
@com.fasterxml.jackson.annotation.JsonProperty(access=com.fasterxml.jackson.annotation.JsonProperty.Access.READ_ONLY)
public boolean getEditable(){return com.ruoyi.warehouse.util.PurchaseDataAccess.canEdit(this);}
/** Optional list filter, bound to the authenticated creator by the controller. */
private Boolean onlyMine;
public Boolean getOnlyMine() { return onlyMine; }
public void setOnlyMine(Boolean onlyMine) { this.onlyMine = onlyMine; }
private String requestNo;
private Long productId;
@Excel(name="采购用途",readConverterExp="SELF=本项目使用,REPAY=归还借用") private String purchasePurpose;
private Long loanId;
private Long productionTaskId;
private String productionTaskNo;
public String getProductionTaskNo(){return productionTaskNo;}public void setProductionTaskNo(String v){productionTaskNo=v;}
private Boolean historical;
private java.time.LocalDate originalDate;
public Boolean getHistorical(){return historical;}
public void setHistorical(Boolean value){historical=value;}
public java.time.LocalDate getOriginalDate(){return originalDate;}
public void setOriginalDate(java.time.LocalDate value){originalDate=value;}
private Long supplierId;
private String supplierName;
private Boolean notArrived;
private Boolean arrivalReady;
/** Work queue only: confirmed, valid quote/supplier, and quantity still unregistered. */
private Boolean pendingRegistration;
public Boolean getPendingRegistration(){return pendingRegistration;}
public void setPendingRegistration(Boolean value){pendingRegistration=value;}
public Boolean getArrivalReady(){return arrivalReady;}
public void setArrivalReady(Boolean value){arrivalReady=value;}
private Boolean unbatched;
public Boolean getUnbatched(){return unbatched;}
public void setUnbatched(Boolean value){unbatched=value;}
private Boolean notReceived;
public Long getSupplierId(){return supplierId;}
public void setSupplierId(Long value){supplierId=value;}
public String getSupplierName(){return supplierName;}
public void setSupplierName(String value){supplierName=value;}
public Boolean getNotArrived(){return notArrived;}
public void setNotArrived(Boolean value){notArrived=value;}
public Boolean getNotReceived(){return notReceived;}
public void setNotReceived(Boolean value){notReceived=value;}
public Long getProductionTaskId(){return productionTaskId;}
public void setProductionTaskId(Long value){productionTaskId=value;}
private Long purchaseBatchId;
private Long projectId;
@Excel(name = "项目编码")
private String projectCode;
@Excel(name = "项目名称", prompt = "按名称选择项目;同名项目请选择带编号的完整名称,不要猜测")
private String projectName;
private Long expenseCategoryId;
@Excel(name = "经费科目编码")
private String expenseCategoryCode;
@Excel(name = "经费科目", prompt = "按名称选择经费科目(费用分类),与物品类别不同")
private String expenseCategoryName;
@Excel(name = "关联物料编码", prompt = "已有物料建议填写准确编码;留空时按名称、品牌、类别、参数规格匹配")
private String productCode;
@Excel(name = "物料名称", prompt = "须匹配已有物品档案;不会自动新增物品")
private String materialName;
@Excel(name = "品牌")
private String materialBrand;
@Excel(name = "类别")
private String category;
/** Import display path; persistence continues to store the maintained leaf label. */
@Excel(name = "物品类别", prompt = "从启用字典中选择“大类 / 小类”;留空时沿用已匹配物品档案")
private String importCategoryPath;
@Excel(name = "参数规格")
private String materialParams;
@Excel(name = "采购链接")
private String purchaseLink;
@Excel(name = "需求数量")
private BigDecimal quantity;
private BigDecimal estimatedUnitPrice;
@Excel(name = "采购总金额", type = Excel.Type.EXPORT)
private BigDecimal estimatedAmount;
@Excel(name = "最终含税单价")
private BigDecimal finalUnitPrice;
private Boolean quoteAvailable;
@com.fasterxml.jackson.annotation.JsonProperty(access=com.fasterxml.jackson.annotation.JsonProperty.Access.READ_ONLY)
public Boolean getQuoteAvailable() { return quoteAvailable; }
public void setQuoteAvailable(Boolean value) { quoteAvailable=value; }
/** Internal reference only. Never use these values in price locking or costing. */
@Excel(name = "实际单价(内部参考)", type = Excel.Type.EXPORT)
private BigDecimal actualUnitPrice;
private boolean actualUnitPriceProvided;
@JsonIgnore public boolean isActualUnitPriceProvided(){return actualUnitPriceProvided;}
public BigDecimal getActualUnitPrice() { return actualUnitPrice; }
public void setActualUnitPrice(BigDecimal value) { actualUnitPrice = value; actualUnitPriceProvided=true;recalculateActualAmount(); }
@Excel(name = "实际金额(内部参考)", type = Excel.Type.EXPORT)
private BigDecimal actualAmount;
@com.fasterxml.jackson.annotation.JsonProperty(access=com.fasterxml.jackson.annotation.JsonProperty.Access.READ_ONLY)
public BigDecimal getActualAmount() { return actualAmount; }
private void recalculateActualAmount() { actualAmount=actualUnitPrice==null||quantity==null?null:actualUnitPrice.multiply(quantity).setScale(2,java.math.RoundingMode.HALF_UP); }
@Excel(name = "价格锁定", readConverterExp = "true=已锁定,false=未锁定", type = Excel.Type.EXPORT)
private Boolean priceLocked;
@Excel(name = "已计项目费用", type = Excel.Type.EXPORT)
private BigDecimal lockedAmount;
private Integer lockRevision;
@Excel(name = "单位")
private String unit;
@JsonIgnore
private Long applicantId;
@JsonIgnore
private String applicantName;
@Excel(name = "采购状态", readConverterExp = "0=待采购,1=已下单,2=采购中,3=部分到货,4=已到齐,5=已取消", type = Excel.Type.EXPORT)
private Integer purchaseStatus;
@Excel(name = "采购批次", type = Excel.Type.EXPORT)
private String purchaseBatchNo;
private String purchaseBatchName;
@Excel(name = "进度说明", type = Excel.Type.EXPORT)
private String progressRemark;
@Excel(name = "产品备注")
private String productRemark;
@Excel(name = "申请备注")
private String requestRemark;
private String productName;
private String productBrand;
private String productCategory;
private String productSpec;
@Excel(name = "已验收数量", type = Excel.Type.EXPORT)
private BigDecimal acceptedQuantity;
@Excel(name = "待验收数量", type = Excel.Type.EXPORT)
private BigDecimal pendingArrivalQuantity;
/** 已确认入库数量,用于锁定采购价格和归属字段的编辑入口。 */
private BigDecimal receivedQuantity;
private BigDecimal remainingQuantity;
/** 仅查询存在待验收到货记录的采购申请。 */
private Boolean pendingAcceptance;
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getRequestNo() { return requestNo; }
public void setRequestNo(String requestNo) { this.requestNo = requestNo; }
public Long getProductId() { return productId; }
public String getPurchasePurpose() { return purchasePurpose; }
public void setPurchasePurpose(String v) { purchasePurpose=v; }
public Long getLoanId() { return loanId; }
public void setLoanId(Long v) { loanId=v; }
public void setProductId(Long productId) { this.productId = productId; }
public Long getPurchaseBatchId() { return purchaseBatchId; }
public void setPurchaseBatchId(Long purchaseBatchId) { this.purchaseBatchId = purchaseBatchId; }
public Long getProjectId() { return projectId; }
public void setProjectId(Long projectId) { this.projectId = projectId; }
public String getProjectCode() { return projectCode; }
public void setProjectCode(String projectCode) { this.projectCode = projectCode; }
public String getProjectName() { return projectName; }
public void setProjectName(String projectName) { this.projectName = projectName; }
public Long getExpenseCategoryId() { return expenseCategoryId; }
public void setExpenseCategoryId(Long expenseCategoryId) { this.expenseCategoryId = expenseCategoryId; }
public String getExpenseCategoryCode() { return expenseCategoryCode; }
public void setExpenseCategoryCode(String expenseCategoryCode) { this.expenseCategoryCode = expenseCategoryCode; }
public String getExpenseCategoryName() { return expenseCategoryName; }
public void setExpenseCategoryName(String expenseCategoryName) { this.expenseCategoryName = expenseCategoryName; }
public String getProductCode() { return productCode; }
public void setProductCode(String productCode) { this.productCode = productCode; }
@NotBlank(message = "物料名称不能为空")
public String getMaterialName() { return materialName; }
public void setMaterialName(String materialName) { this.materialName = materialName; }
public String getMaterialBrand() { return materialBrand; }
public void setMaterialBrand(String materialBrand) { this.materialBrand = materialBrand; }
public String getCategory() { return category; }
public String getImportCategoryPath() { return importCategoryPath; }
public void setImportCategoryPath(String value) { importCategoryPath = value; }
public void setCategory(String category) { this.category = category; }
public String getMaterialParams() { return materialParams; }
public void setMaterialParams(String materialParams) { this.materialParams = materialParams; }
public String getPurchaseLink() { return purchaseLink; }
public void setPurchaseLink(String purchaseLink) { this.purchaseLink = purchaseLink; }
@NotNull(message = "需求数量不能为空")
@DecimalMin(value = "0", inclusive = false, message = "需求数量必须大于0")
public BigDecimal getQuantity() { return quantity; }
public void setQuantity(BigDecimal quantity) { this.quantity = quantity; recalculateActualAmount(); }
public BigDecimal getEstimatedUnitPrice() { return estimatedUnitPrice; }
public void setEstimatedUnitPrice(BigDecimal estimatedUnitPrice) { this.estimatedUnitPrice = estimatedUnitPrice; }
public BigDecimal getEstimatedAmount() { return estimatedAmount; }
public void setEstimatedAmount(BigDecimal estimatedAmount) { this.estimatedAmount = estimatedAmount; }
public BigDecimal getFinalUnitPrice() { return finalUnitPrice; }
public void setFinalUnitPrice(BigDecimal value) { finalUnitPrice = value; }
public Boolean getPriceLocked() { return priceLocked; }
public void setPriceLocked(Boolean value) { priceLocked = value; }
public BigDecimal getLockedAmount() { return lockedAmount; }
public void setLockedAmount(BigDecimal value) { lockedAmount = value; }
public Integer getLockRevision() { return lockRevision; }
public void setLockRevision(Integer value) { lockRevision = value; }
public String getUnit() { return unit; }
public void setUnit(String unit) { this.unit = unit; }
public Long getApplicantId() { return applicantId; }
public void setApplicantId(Long applicantId) { this.applicantId = applicantId; }
public String getApplicantName() { return applicantName; }
public void setApplicantName(String applicantName) { this.applicantName = applicantName; }
public Integer getPurchaseStatus() { return purchaseStatus; }
public void setPurchaseStatus(Integer purchaseStatus) { this.purchaseStatus = purchaseStatus; }
public String getPurchaseBatchNo() { return purchaseBatchNo; }
public void setPurchaseBatchNo(String purchaseBatchNo) { this.purchaseBatchNo = purchaseBatchNo; }
public String getPurchaseBatchName() { return purchaseBatchName; }
public void setPurchaseBatchName(String purchaseBatchName) { this.purchaseBatchName = purchaseBatchName; }
public String getProgressRemark() { return progressRemark; }
public void setProgressRemark(String progressRemark) { this.progressRemark = progressRemark; }
public String getProductRemark() { return productRemark; }
public void setProductRemark(String productRemark) { this.productRemark = productRemark; }
public String getRequestRemark() { return requestRemark; }
public void setRequestRemark(String requestRemark) { this.requestRemark = requestRemark; }
public String getProductName() { return productName; }
public void setProductName(String productName) { this.productName = productName; }
public String getProductBrand() { return productBrand; }
public void setProductBrand(String productBrand) { this.productBrand = productBrand; }
public String getProductCategory() { return productCategory; }
public void setProductCategory(String productCategory) { this.productCategory = productCategory; }
public String getProductSpec() { return productSpec; }
public void setProductSpec(String productSpec) { this.productSpec = productSpec; }
public BigDecimal getAcceptedQuantity() { return acceptedQuantity; }
public void setAcceptedQuantity(BigDecimal acceptedQuantity) { this.acceptedQuantity = acceptedQuantity; }
public BigDecimal getPendingArrivalQuantity() { return pendingArrivalQuantity; }
public void setPendingArrivalQuantity(BigDecimal pendingArrivalQuantity) { this.pendingArrivalQuantity = pendingArrivalQuantity; }
public BigDecimal getReceivedQuantity() { return receivedQuantity; }
public void setReceivedQuantity(BigDecimal receivedQuantity) { this.receivedQuantity = receivedQuantity; }
public BigDecimal getRemainingQuantity() { return remainingQuantity; }
public void setRemainingQuantity(BigDecimal remainingQuantity) { this.remainingQuantity = remainingQuantity; }
public Boolean getPendingAcceptance() { return pendingAcceptance; }
public void setPendingAcceptance(Boolean pendingAcceptance) { this.pendingAcceptance = pendingAcceptance; }
}