|
|
@ -31,6 +31,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
@ -211,7 +212,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
|
|
|
|
MesOrderBind mesOrderBind = mesOrderBindMapper.selectMesOrderBindByOrderBindId(orderBindId);
|
|
|
|
MesOrderBind mesOrderBind = mesOrderBindMapper.selectMesOrderBindByOrderBindId(orderBindId);
|
|
|
|
BigDecimal bindAmount = mesOrderBind.getBindAmount();
|
|
|
|
BigDecimal bindAmount = mesOrderBind.getBindAmount();
|
|
|
|
BigDecimal bindBarcodeAmount = mesOrderBind.getBarcodeAmount();//已经生成的条码数量
|
|
|
|
BigDecimal bindBarcodeAmount = mesOrderBind.getBarcodeAmount();//已经生成的条码数量
|
|
|
|
BigDecimal availableAmount = bindAmount.subtract(bindBarcodeAmount);
|
|
|
|
BigDecimal availableAmount = bindAmount.subtract(bindBarcodeAmount).setScale(0, RoundingMode.CEILING);;//可用数量向上取整
|
|
|
|
if (barcodeAmount.compareTo(availableAmount) > 0) {
|
|
|
|
if (barcodeAmount.compareTo(availableAmount) > 0) {
|
|
|
|
throw new ServiceException("条码数量不能大于可用数量");
|
|
|
|
throw new ServiceException("条码数量不能大于可用数量");
|
|
|
|
}
|
|
|
|
}
|
|
|
|