huminmin
3 天以前 e52dfc522497311025b277b5e0ef3590fb3de990
src/main/java/com/ruoyi/productionPlan/pojo/ProductionPlan.java
@@ -7,6 +7,7 @@
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@@ -126,6 +127,7 @@
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty("开始日期")
    @Excel(name = "开始日期", width = 20, dateFormat = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    /**
@@ -134,6 +136,7 @@
    @ApiModelProperty("结束日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "结束日期", width = 20, dateFormat = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    /**
@@ -227,4 +230,19 @@
    @ApiModelProperty(value = "下发数量")
    @Excel(name = "下发数量")
    private BigDecimal assignedQuantity;
    /**
     * 计算剩余方数
     * @return 剩余方数
     */
    @ApiModelProperty(value = "剩余方数")
    public BigDecimal getRemainingVolume() {
        if (volume == null) {
            return BigDecimal.ZERO;
        }
        if (assignedQuantity == null) {
            return volume;
        }
        return volume.subtract(assignedQuantity);
    }
}