| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | } |
| | | insOrderMapper.updateById(order); |
| | | //查询该订单是A类还是B类 |
| | | if (order.getOrderType().equals("A")) { |
| | | //如果是A类,1和2和3都审核通过这个单子就审核通过 |
| | | if (order.getOrderType().equals("B")) { |
| | | //如果是B类,1和2和3都审核通过这个单子就审核通过 |
| | | if (order.getCheckState1() == 1 && order.getCheckState2() == 1 && order.getCheckState3() == 1) { |
| | | order.setState(1); |
| | | upInsOrderOfState(order); |
| | |
| | | order.setState(2); |
| | | upInsOrderOfState(order); |
| | | } |
| | | } else if (order.getOrderType().equals("B")) { |
| | | //如果是B类,1和2审核通过后这个单子就审核通过 |
| | | } else if (order.getOrderType().equals("A")) { |
| | | //如果是A类,1和2审核通过后这个单子就审核通过 |
| | | if (order.getCheckState1() == 1 && order.getCheckState2() == 1) { |
| | | order.setState(1); |
| | | upInsOrderOfState(order); |
| | |
| | | .filter(dto -> dto.getPrice() != null) // 过滤掉价格为 null 的对象 |
| | | .mapToDouble(value -> value.getPrice().doubleValue() * value.getNum()) |
| | | .sum(); |
| | | map.put("total", totalPrice); |
| | | BigDecimal bd = new BigDecimal(totalPrice).setScale(2, RoundingMode.HALF_UP); |
| | | double roundedTotalPrice = bd.doubleValue(); |
| | | map.put("total", roundedTotalPrice); |
| | | return map; |
| | | } |
| | | |