| | |
| | | return returns; |
| | | } |
| | | |
| | | public Object printOrderProductDetails(String orderId,String productId) { |
| | | List<Map<String,Object>> orderProductDistinct; |
| | | if (productId!=""){ |
| | | orderProductDistinct = orderDetailMapper.getOrderProductDistinctByIds(orderId,productId); |
| | | }else{ |
| | | orderProductDistinct = orderDetailMapper.getOrderProductDistinctById(orderId); |
| | | } |
| | | |
| | | List<Map<String,Object>> orderProductDetail = new ArrayList<>(); |
| | | orderProductDistinct.forEach(map->{ |
| | | Map<String,Object> orderProductDetailMap = new HashMap<>(); |
| | | orderProductDetailMap.put("productId",map.get("productId")); |
| | | orderProductDetailMap.put("productName",map.get("productName")); |
| | | List<OrderDetail> orderDetails = orderDetailMapper.getOrderProductByProductId(map.get("productId"),orderId); |
| | | orderDetails.forEach(orderDetail->{ |
| | | |
| | | orderDetail.setGrossArea( |
| | | Double.parseDouble(String.format("%.3f",Double.parseDouble( |
| | | String.format("%.3f", |
| | | orderDetail.getWidth()*orderDetail.getHeight()/1000000) |
| | | ) * orderDetail.getQuantity())) |
| | | ); |
| | | }); |
| | | |
| | | orderProductDetailMap.put("productDetail",orderDetails); |
| | | orderProductDetail.add(orderProductDetailMap); |
| | | }); |
| | | |
| | | Map<String,Object> returns = new HashMap<>(); |
| | | |
| | | returns.put("orderProductDetail",orderProductDetail); |
| | | returns.put("order",orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",orderId))); |
| | | return returns; |
| | | } |
| | | |
| | | public Object printOrderProductGlassDetail(String orderId) { |
| | | Map<String,Object> returns = new HashMap<>(); |
| | | returns.put("order",orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",orderId))); |