库存相关数据类型由long修改为double
This commit is contained in:
parent
e3e16fa568
commit
0aee0b8971
|
|
@ -5,8 +5,6 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 物料操作流水对象 busi_material_operate
|
||||
*
|
||||
|
|
@ -30,7 +28,7 @@ public class BusiMaterialOperate extends BaseEntity {
|
|||
* 操作数量
|
||||
*/
|
||||
@Excel(name = "操作数量")
|
||||
private Long amount;
|
||||
private double amount;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
|
|
@ -137,12 +135,12 @@ public class BusiMaterialOperate extends BaseEntity {
|
|||
return materialStockId;
|
||||
}
|
||||
|
||||
public void setAmount(Long amount) {
|
||||
this.amount = amount;
|
||||
public double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public Long getAmount() {
|
||||
return amount;
|
||||
public void setAmount(double amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public void setOprateType(String oprateType) {
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ public class BusiMaterialStock extends BaseEntity
|
|||
|
||||
/** 进库量 */
|
||||
@Excel(name = "进库量")
|
||||
private Long amountIn = 0l;
|
||||
private double amountIn = 0;
|
||||
|
||||
/** 出库量 */
|
||||
@Excel(name = "出库量")
|
||||
private Long amountOut = 0l;
|
||||
private double amountOut = 0;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
|
|
@ -92,19 +92,19 @@ public class BusiMaterialStock extends BaseEntity
|
|||
return classify;
|
||||
}
|
||||
|
||||
public Long getAmountIn() {
|
||||
public double getAmountIn() {
|
||||
return amountIn;
|
||||
}
|
||||
|
||||
public void setAmountIn(Long amountIn) {
|
||||
public void setAmountIn(double amountIn) {
|
||||
this.amountIn = amountIn;
|
||||
}
|
||||
|
||||
public Long getAmountOut() {
|
||||
public double getAmountOut() {
|
||||
return amountOut;
|
||||
}
|
||||
|
||||
public void setAmountOut(Long amountOut) {
|
||||
public void setAmountOut(double amountOut) {
|
||||
this.amountOut = amountOut;
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ public class BusiMaterialStock extends BaseEntity
|
|||
this.orderName = orderName;
|
||||
}
|
||||
|
||||
public Long getStockAmount(){
|
||||
public double getStockAmount(){
|
||||
return this.amountIn - this.amountOut;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class BusiMaterialOperateServiceImpl implements IBusiMaterialOperateServi
|
|||
if ("1".equals(busiMaterialOperate.getOprateType())) { // 1为入库
|
||||
busiMaterialStock.setAmountIn(busiMaterialOperate.getAmount() + busiMaterialStock.getAmountIn());
|
||||
} else {// 2为入库
|
||||
long stockAmount = busiMaterialStock.getAmountIn() - busiMaterialStock.getAmountOut();
|
||||
double stockAmount = busiMaterialStock.getAmountIn() - busiMaterialStock.getAmountOut();
|
||||
if(busiMaterialOperate.getAmount() > stockAmount){
|
||||
throw new ServiceException("出库超过库存");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue