| | |
| | | */ |
| | | @Excel(name = "数量") |
| | | private BigDecimal quantity; |
| | | |
| | | /** |
| | | * 已入库数量 |
| | | */ |
| | | private BigDecimal stockedQuantity; |
| | | |
| | | /** |
| | | * 已出库数量 |
| | | */ |
| | | private BigDecimal shippedQuantity; |
| | | |
| | | @Excel(name = "最低库存数量") |
| | | private BigDecimal minStock; |
| | | |
| | | /** |
| | | * 剩余待入库数量(订单数量 − 合格已入库数量,多入时记为 0) |
| | | */ |
| | | @Excel(name = "剩余数量") |
| | | @ApiModelProperty("剩余待入库数量(订单数量-合格已入库)") |
| | | private BigDecimal remainingQuantity; |
| | | |
| | | /** |
| | | * 剩余出库数量 |
| | | */ |
| | | private BigDecimal remainingShippedQuantity; |
| | | |
| | | /** |
| | | * 不合格入库数量 |
| | | */ |
| | | private BigDecimal unqualifiedStockedQuantity; |
| | | |
| | | |
| | | /** |
| | | * 不合格出库数量 |
| | | */ |
| | | private BigDecimal unqualifiedShippedQuantity; |
| | | |
| | | /** |
| | | * 税率 |
| | | */ |
| | |
| | | @ApiModelProperty(value = "是否质检") |
| | | private Boolean isChecked; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("重箱") |
| | | private BigDecimal thickness; |
| | | |
| | | @ApiModelProperty("宽") |
| | | private BigDecimal width; |
| | | |
| | |
| | | @ApiModelProperty("楼层编号") |
| | | private String floorCode; |
| | | |
| | | /** |
| | | * 产品入库状态:0-未入库,1-部分入库,2-已入库 |
| | | */ |
| | | @ApiModelProperty("产品入库状态:0-未入库,1-部分入库,2-已入库") |
| | | private Integer productStockStatus; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("销售产品额外加工") |
| | | private List<SalesLedgerProductProcess> salesProductProcessList; |
| | |
| | | // 可用数量 quantity - returnQuality |
| | | @TableField(exist = false) |
| | | private BigDecimal availableQuality; |
| | | |
| | | |
| | | public void fillRemainingQuantity() { |
| | | BigDecimal q = this.quantity == null ? BigDecimal.ZERO : this.quantity; |
| | | |
| | | BigDecimal stocked = this.stockedQuantity == null ? BigDecimal.ZERO : this.stockedQuantity; |
| | | BigDecimal remIn = q.subtract(stocked); |
| | | this.remainingQuantity = remIn.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : remIn; |
| | | |
| | | BigDecimal shipped = this.shippedQuantity == null ? BigDecimal.ZERO : this.shippedQuantity; |
| | | // 剩余出库数量:以“已入库数量”为基准(出库只能从已入库中扣减) |
| | | BigDecimal remOut = stocked.subtract(shipped); |
| | | this.remainingShippedQuantity = remOut.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : remOut; |
| | | } |
| | | } |