库存日志

This commit is contained in:
sxu 2024-08-05 13:32:53 +08:00
parent da356b8535
commit 93a46f8842
2 changed files with 16 additions and 0 deletions

View File

@ -176,4 +176,7 @@ public class LeaseOutDetails implements Serializable {
@ApiModelProperty(value = "数量出库 -> 操作前库存量")
private Integer num;
/** 操作后库存 */
private String postStoreNum;
}

View File

@ -185,6 +185,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
if (res == 0) {
throw new RuntimeException("出库失败,插入结算记录失败");
}
record.setPostStoreNum(String.valueOf(getStorageNum(record)));
} else {
return AjaxResult.error("领料出库失败,机具库存不足");
}
@ -264,6 +265,18 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
return 1;
}
private int getStorageNum(LeaseOutDetails record) {
if (StringUtils.isNull(record)) {
return 0;
}
//判断(ma_type 设备规格表)中的库存够不够出库的
MaType maType = leaseOutDetailsMapper.selectByTypeId(record);
if (maType != null) {
return maType.getNum().intValue();
}
return 0;
}
private int checkStorageNumCt(LeaseOutDetails record) {
int res = 0;
double outNum = 0.1;