|
@@ -9524,6 +9524,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
*/
|
|
|
@Override
|
|
|
public AjaxResult stockWarning(String tWarehousebillsitems) {
|
|
|
+
|
|
|
+ BigDecimal stockWarning = new BigDecimal(0);
|
|
|
+
|
|
|
// 库存明细添加
|
|
|
if (StringUtils.isNotNull(tWarehousebillsitems) && !"[]".equals(tWarehousebillsitems)) {
|
|
|
JSONArray warehouseJSON = JSONArray.parseArray(tWarehousebillsitems);
|
|
@@ -9532,13 +9535,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
for (TWarehousebillsitems warehousebillsitems : warehousebillsitemsList) {
|
|
|
//查看商品信息
|
|
|
TGoods tGoods = tGoodsMapper.selectTGoodsById(warehousebillsitems.getfGoodsid());
|
|
|
- //判断结余净重、出库净重、商品信息是否为空
|
|
|
- if (ObjectUtil.isNotNull(warehousebillsitems.getfNetweight()) && ObjectUtil.isNotNull(tGoods) && ObjectUtil.isNotNull(warehousebillsitems.getfPlannetweight())) {
|
|
|
- //计算库存剩余净重
|
|
|
- BigDecimal surplus = warehousebillsitems.getfPlannetweight().subtract(warehousebillsitems.getfNetweight());
|
|
|
- //判断库存剩余净重是否小于等于库存预警重量 如果是返回预警信息 (=-1小于 =0为等于 =1为大于)
|
|
|
- if (surplus.compareTo(tGoods.getStockWarning()) != 1) {
|
|
|
- return AjaxResult.error("品名为" + tGoods.getfName() + "提单号为" + warehousebillsitems.getfMblno() + "库存量已小于等于预警量!");
|
|
|
+ //判断商品预警库存是否不为0 true 继续判断是否小于预警库存 false 直接返回
|
|
|
+ if(stockWarning.compareTo(tGoods.getStockWarning()) != 0){
|
|
|
+ //判断结余净重、出库净重、商品信息是否为空
|
|
|
+ if (ObjectUtil.isNotNull(warehousebillsitems.getfNetweight()) && ObjectUtil.isNotNull(tGoods) && ObjectUtil.isNotNull(warehousebillsitems.getfPlannetweight())) {
|
|
|
+ //计算库存剩余净重
|
|
|
+ BigDecimal surplus = warehousebillsitems.getfPlannetweight().subtract(warehousebillsitems.getfNetweight());
|
|
|
+ //判断库存剩余净重是否小于等于库存预警重量 如果是返回预警信息 (=-1小于 =0为等于 =1为大于)
|
|
|
+ if (surplus.compareTo(tGoods.getStockWarning()) != 1) {
|
|
|
+ return AjaxResult.error("品名为" + tGoods.getfName() + "提单号为" + warehousebillsitems.getfMblno() + "库存量已小于等于预警量!");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|