chenlu
2024-07-04 0de3d79c54c5d75db2dbd3867e377c1a3c544479
Merge branch 'master' of http://bore.pub:10439/r/ERP_override
4个文件已修改
55 ■■■■■ 已修改文件
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderDetailMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderDetailMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java
@@ -185,5 +185,12 @@
        return   Result.seccess(orderService.printOrderProductGlassDetail(orderId));
    }
    @ApiOperation("订单加工单打印-成品2")
    @GetMapping ("/printOrderProductDetail/{orderId}/{productId}")
    public Result printOrderProductDetail(@PathVariable String orderId,@PathVariable String productId)  {
        return   Result.seccess(orderService.printOrderProductDetails(orderId,productId));
    }
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderDetailMapper.java
@@ -33,6 +33,8 @@
    List<Map<String,Object>> getOrderProductDistinctById(String orderId);
    List<Map<String,Object>> getOrderProductDistinctByIds(String orderId,String productId);
    List<OrderDetail> getOrderProductByProductId(Object productId, String orderId);
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -449,6 +449,41 @@
        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)));
north-glass-erp/src/main/resources/mapper/sd/OrderDetailMapper.xml
@@ -775,6 +775,17 @@
        group by a.product_id
    </select>
    <select id="getOrderProductDistinctByIds">
        select
            (a.product_id) as 'productId',
            a.product_name as 'productName',
            a.order_number as 'orderNumber'
        from order_detail as a
        where a.order_id = #{orderId} and a.product_id regexp #{productId}
        group by a.product_id
    </select>
    <select id="getOrderProductByProductId">
        select
            *