修改精度问题
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.service.order;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
@ -106,8 +107,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
AppOrderRespVO appOrderRespVO = BeanUtils.toBean(order, AppOrderRespVO.class);
|
||||
List<AppOrderDetailRespVO> appOrderDetailRespVOS = orderDetailService.selectListByOrderId(id);
|
||||
appOrderRespVO.setDetailList(appOrderDetailRespVOS);
|
||||
BigDecimal reduce1 = appOrderDetailRespVOS.stream().map(m-> BigDecimal.valueOf(m.getHeat())).filter(heat -> ObjUtil.isNotEmpty(heat)).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
double reduce= reduce1.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
BigDecimal reduce1 = appOrderDetailRespVOS.stream().filter(heat -> ObjUtil.isNotEmpty(heat.getHeat())).map(m-> BigDecimal.valueOf(m.getHeat())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
Double reduce= reduce1.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
appOrderRespVO.setIntake(reduce);
|
||||
//判断时间
|
||||
int hour = order.getCreateTime().getHour();
|
||||
@ -118,7 +119,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
}else{
|
||||
appOrderRespVO.setProposeIntake(proposeNight);
|
||||
}
|
||||
appOrderRespVO.setDifference(reduce-appOrderRespVO.getProposeIntake());
|
||||
appOrderRespVO.setDifference(NumberUtil.sub(reduce,appOrderRespVO.getProposeIntake()));
|
||||
return appOrderRespVO;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user