廖井涛
2024-07-08 5ef2f54b94d0f0d6f50bbdfa9ee8b79d6d9aaf92
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -51,7 +51,10 @@
        Order order = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("title")), Order.class);
        List<OrderDetail> OrderDetails = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("detail")), OrderDetail.class);
        List<OrderOtherMoney> orderOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("otherMoney")), OrderOtherMoney.class);
        orderOtherMoneyList = orderOtherMoneyList.stream().filter(o -> o.getColumn().indexOf("M")==0).collect(Collectors.toList());
        if(orderOtherMoneyList != null ){
            orderOtherMoneyList = orderOtherMoneyList.stream().filter(o -> o.getColumn().indexOf("M")==0).collect(Collectors.toList());
        }
        boolean saveState = true;
        //设置回滚点
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
@@ -213,6 +216,9 @@
                    }
                });
            }else if(OrderDetails.get(i).getOtherColumns()==null){
                OrderDetails.get(i).setOtherColumns("{}");
            }
        }
@@ -490,15 +496,7 @@
            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);
@@ -557,4 +555,8 @@
    }
    public boolean updateOrderPrintNumber(String orderId) {
        return orderMapper.updateOrderPrintNumber(orderId);
    }
}