Commit ff201708 by 张新旗

修改获取等待时长的的代码

parent 611e29e7
...@@ -580,7 +580,11 @@ public class OrderServiceImpl implements IOrderService ...@@ -580,7 +580,11 @@ public class OrderServiceImpl implements IOrderService
} }
Long takeTimeCount =0L; Long takeTimeCount =0L;
for (OrderDetail orderDetail : list) { for (OrderDetail orderDetail : list) {
Long takeTime = goodsMapper.selectGoodsById(orderDetail.getGoodsId()).getTakeTime(); Goods goods = goodsMapper.selectGoodsById(orderDetail.getGoodsId());
if(goods ==null){
continue;
}
Long takeTime = goods.getTakeTime();
takeTime = Integer.parseInt(orderDetail.getNum())*takeTime; takeTime = Integer.parseInt(orderDetail.getNum())*takeTime;
takeTimeCount+=takeTime; takeTimeCount+=takeTime;
} }
...@@ -605,10 +609,13 @@ public class OrderServiceImpl implements IOrderService ...@@ -605,10 +609,13 @@ public class OrderServiceImpl implements IOrderService
} }
Long takeTimeCount =0L; Long takeTimeCount =0L;
for (OrderDetail orderDetail : list) { for (OrderDetail orderDetail : list) {
Long takeTime = goodsMapper.selectGoodsById(orderDetail.getGoodsId()).getTakeTime(); Goods goods = goodsMapper.selectGoodsById(orderDetail.getGoodsId());
if(goods!=null){
Long takeTime = goods.getTakeTime();
takeTime = Integer.parseInt(orderDetail.getNum())*takeTime; takeTime = Integer.parseInt(orderDetail.getNum())*takeTime;
takeTimeCount+=takeTime; takeTimeCount+=takeTime;
} }
}
return String.valueOf((int)(takeTimeCount/60)); return String.valueOf((int)(takeTimeCount/60));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment