diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java index 499f54c0..f0fd3062 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java @@ -176,4 +176,7 @@ public class LeaseOutDetails implements Serializable { @ApiModelProperty(value = "数量出库 -> 操作前库存量") private Integer num; + /** 操作后库存 */ + private String postStoreNum; + } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java index 4aa3c6ea..bb20754c 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseOutDetailsServiceImpl.java @@ -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;