廖井涛
2024-08-07 215a413fa2bb598cc70c71a0c9691925f814f90b
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -169,6 +169,13 @@
            String formattedDate = dateFormat.format(currentDate);
            orderId =  "NG"+formattedDate+formattedNumber;
        }else if(dateType.equals("year")){
            Integer maxOrderId = orderMapper.selectMaxOrderIdByYear();
            String formattedNumber = String.format("%06d", maxOrderId+1);
            Date currentDate = new Date();
            SimpleDateFormat dateFormat = new SimpleDateFormat("yy");
            String formattedDate = dateFormat.format(currentDate);
            orderId =  "NG"+formattedDate+formattedNumber;
        }
        return orderId;