Commit ff201708 by 张新旗

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

parent 611e29e7
......@@ -580,7 +580,11 @@ public class OrderServiceImpl implements IOrderService
}
Long takeTimeCount =0L;
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;
takeTimeCount+=takeTime;
}
......@@ -605,9 +609,12 @@ public class OrderServiceImpl implements IOrderService
}
Long takeTimeCount =0L;
for (OrderDetail orderDetail : list) {
Long takeTime = goodsMapper.selectGoodsById(orderDetail.getGoodsId()).getTakeTime();
takeTime = Integer.parseInt(orderDetail.getNum())*takeTime;
takeTimeCount+=takeTime;
Goods goods = goodsMapper.selectGoodsById(orderDetail.getGoodsId());
if(goods!=null){
Long takeTime = goods.getTakeTime();
takeTime = Integer.parseInt(orderDetail.getNum())*takeTime;
takeTimeCount+=takeTime;
}
}
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