fix issue

This commit is contained in:
sxu 2024-08-20 10:17:41 +08:00
parent 7e9edd003e
commit 41a39c28ff
1 changed files with 9 additions and 2 deletions

View File

@ -279,10 +279,17 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
//判断(ma_type 设备规格表)中的库存够不够出库的
MaType maType = leaseOutDetailsMapper.selectByTypeId(record);
if (maType != null) {
if ("0".equals(maType.getManageType())) {
int count = leaseOutDetailsMapper.getCountOfCodeMachine(record);
if (BigDecimal.valueOf(count).compareTo(BigDecimal.valueOf(record.getOutNum())) < 0) {
return 0;
}
} else if ("1".equals(maType.getManageType())) {
if (maType.getNum() == null || maType.getNum().compareTo(BigDecimal.valueOf(record.getOutNum())) < 0) {
return 0;
}
}
}
return 1;
}