Explorar el Código

feature:
补打接口提交、补打记录提交、品相获取接口平江的机器获取,过滤掉北海的

yingjian.wu hace 2 meses
padre
commit
4fc3abf66f

+ 1 - 1
src/main/java/com/qlm/controller/jinzai/ItemNewController.java

@@ -264,7 +264,7 @@ public class ItemNewController extends CommonController {
 
     public void getItemAll(){
         ApiResponse apiResponse;
-        List<Record> list = Db.find("select id,item_name from t_jz_item where Status =1");
+        List<Record> list = Db.find("select sku,id,item_name from t_jz_item where Status =1");
         if(CollUtil.isEmpty(list)){
             apiResponse = ApiResponse.success(new ArrayList<>());
             renderJson(apiResponse);

+ 81 - 4
src/main/java/com/qlm/controller/jinzai/ProdBatchController.java

@@ -13,16 +13,14 @@ import com.qlm.annotation.RequestUrl;
 import com.qlm.common.ApiResponse;
 import com.qlm.common.PageResult;
 import com.qlm.controller.common.CommonController;
-import com.qlm.dto.DeviceMonitorRecordDto;
-import com.qlm.dto.ItemModifyRecordDto;
-import com.qlm.dto.ItemModifyRecordVO;
-import com.qlm.dto.ProdTaskUploadRecordDto;
+import com.qlm.dto.*;
 import com.qlm.netty.constant.CommandType;
 import com.qlm.netty.manager.DeviceSessionManager;
 import com.qlm.netty.util.WhitelistValidator;
 import com.qlm.tools.WxUtil;
 import com.qlm.view.core.AdminView;
 import io.netty.channel.ChannelHandlerContext;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -108,6 +106,58 @@ public class ProdBatchController extends CommonController {
         renderJsp("/page/jinzai/reprint_record.jsp");
     }
 
+
+
+    public void getReprintRecord() {
+        // 1. 获取前端分页和查询参数
+        int pageNumber = getParaToInt("pageNumber", 1);
+        int pageSize = getParaToInt("pageSize", 10);
+        // 查询参数
+        String reprintTime = getPara("reprintTime");
+        String factoryId = getPara("factoryId");
+        String sku = getPara("sku");
+
+        String selectSql = "select distinct b.task_no as taskOrderNo, b.device_no, b.sku, a.box_code as boxCode, b.duo_code as palletCode, a.reprint_time as reprintTime, c.item_name as productName, e.workshop_name as workshopName, f.factory_name as factoryName,d.`desc` as lineName";
+        StringBuilder fromSql = new StringBuilder("FROM t_reprint_record a ");
+        fromSql.append(" inner join jinzai_upload_master b on a.box_code = b.id");
+        fromSql.append(" left join t_jz_item c on b.sku = c.sku");
+        fromSql.append(" left join t_jz_device d on b.device_no = d.device_no");
+        fromSql.append(" left join t_workshop e on d.workshop_id = e.id");
+        fromSql.append(" left join t_factory f on e.factory_id = f.id");
+
+        // WHERE 条件和参数
+        fromSql.append(" WHERE 1=1");
+        List<Object> params = new ArrayList<>();
+
+        // 补打时间查询
+        if (StringUtils.isNotBlank(reprintTime)) {
+            fromSql.append(" AND DATE(a.reprint_time) = ? ");
+            params.add(reprintTime);
+        }
+
+        // 工厂名称查询
+        if (StringUtils.isNotBlank(factoryId)) {
+            fromSql.append(" AND d.factory_id = ? ");
+            params.add(factoryId);
+        }
+
+        // 产品名称查询
+        if (StringUtils.isNotBlank(sku)) {
+            fromSql.append(" AND b.sku = ? ");
+            params.add(sku);
+        }
+
+        fromSql.append(" ORDER BY a.reprint_time DESC ");
+
+        // 3. 执行分页查询
+        Page<Record> page = Db.paginate(pageNumber, pageSize, selectSql, fromSql.toString(), params.toArray());
+        if (page == null) {
+            renderJson(new PageResult<>(0, pageNumber, pageSize, new ArrayList<>()));
+            return;
+        }
+        renderJson(new PageResult<>(page.getTotalRow(), pageNumber, pageSize, page.getList()));
+    }
+
     /**
      * 工控机监控记录路由
      */
@@ -452,6 +502,33 @@ public class ProdBatchController extends CommonController {
         }
     }
 
+    @Clear
+    public void reprint(){
+        ApiResponse apiResponse = new ApiResponse();
+        try {
+            String bodyData = HttpKit.readData(getRequest());
+            ReprintDto reprintDto = JSON.parseObject(bodyData, ReprintDto.class);
+            Record record = new Record();
+            record.set("box_code",reprintDto.getBoxCode());
+            if(StringUtils.isNotBlank(reprintDto.getReprintTime())){
+                record.set("reprint_time", DateUtil.parse(reprintDto.getReprintTime()));
+            }
+            boolean save = Db.save("t_reprint_record", record);
+            if(save){
+                apiResponse.setCode(200);
+                apiResponse.setMsg("补打成功");
+            }else{
+                apiResponse.setCode(500);
+                apiResponse.setMsg("补打失败");
+            }
+        } catch (Exception e) {
+            logger.error("补打异常:", e);
+            apiResponse.setCode(500);
+            apiResponse.setMsg("系统异常:" + e.getMessage());
+        }
+        renderJson(apiResponse);
+    }
+
 
 
     private ProdTaskUploadRecordDto convertRecordToDto(Record record) {

+ 1 - 1
src/main/java/com/qlm/controller/jinzai/ProductController.java

@@ -51,7 +51,7 @@ public class ProductController extends CommonController{
 			sql.append(" where tjd.device_no = ? and p.line_on = 1 and i.sku is not null");
 			t_jz_productList = Db.find(sql.toString(), device_no);
 		}else{
-			t_jz_productList = Db.find("SELECT i.sku,i.kouwei,p.product_name,i.id,i.product_id,p.xiang_num,p.tuo_num from t_jz_item i left join t_jz_product p on (i.product_id = p.id) where p.line_on = 1 and i.sku is not null");
+			t_jz_productList = Db.find("SELECT i.sku,i.kouwei,p.product_name,i.id,i.product_id,p.xiang_num,p.tuo_num from t_jz_item i left join t_jz_product p on (i.product_id = p.id) and p.product_name  not like '%北海%' where p.line_on = 1 and i.sku is not null");
 		}
 		obj.put("products", t_jz_productList);
 		renderJson(obj);

+ 37 - 0
src/main/java/com/qlm/dto/ReprintDto.java

@@ -0,0 +1,37 @@
+package com.qlm.dto;
+
+/**
+ * @program: jinzaifoodadmin
+ * @ClassName: ReprintDto
+ * @description: TODO
+ * @author: yingjian.wu
+ * @create: 2025-10-14 10:48
+ * @Version 1.0
+ **/
+public class ReprintDto {
+    /**
+     * 补打时间
+     */
+    private String reprintTime;
+
+    /**
+     * 箱码
+     */
+    private String boxCode;
+
+    public String getReprintTime() {
+        return reprintTime;
+    }
+
+    public void setReprintTime(String reprintTime) {
+        this.reprintTime = reprintTime;
+    }
+
+    public String getBoxCode() {
+        return boxCode;
+    }
+
+    public void setBoxCode(String boxCode) {
+        this.boxCode = boxCode;
+    }
+}

+ 121 - 0
src/main/java/com/qlm/dto/ReprintRecordVO.java

@@ -0,0 +1,121 @@
+package com.qlm.dto;
+
+import java.io.Serializable;
+
+/**
+ * @program: jinzaifoodadmin
+ * @ClassName: ReprintRecordVO
+ * @description: TODO
+ * @author: yingjian.wu
+ * @create: 2025-10-13 18:29
+ * @Version 1.0
+ **/
+public class ReprintRecordVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 任务单号
+     */
+    private String taskOrderNo;
+
+    /**
+     * 工厂名称
+     */
+    private String factoryName;
+
+    /**
+     * 生产车间
+     */
+    private String workshopName;
+
+    /**
+     * 产线
+     */
+    private String lineName;
+
+    /**
+     * 产品名称
+     */
+    private String productName;
+
+    /**
+     * 箱码
+     */
+    private String boxCode;
+
+    /**
+     * 托码
+     */
+    private String palletCode;
+
+    /**
+     * 补打时间
+     */
+    private String reprintTime;
+
+    // --- Standard Getters and Setters ---
+
+    public String getTaskOrderNo() {
+        return taskOrderNo;
+    }
+
+    public void setTaskOrderNo(String taskOrderNo) {
+        this.taskOrderNo = taskOrderNo;
+    }
+
+    public String getFactoryName() {
+        return factoryName;
+    }
+
+    public void setFactoryName(String factoryName) {
+        this.factoryName = factoryName;
+    }
+
+    public String getWorkshopName() {
+        return workshopName;
+    }
+
+    public void setWorkshopName(String workshopName) {
+        this.workshopName = workshopName;
+    }
+
+    public String getLineName() {
+        return lineName;
+    }
+
+    public void setLineName(String lineName) {
+        this.lineName = lineName;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getBoxCode() {
+        return boxCode;
+    }
+
+    public void setBoxCode(String boxCode) {
+        this.boxCode = boxCode;
+    }
+
+    public String getPalletCode() {
+        return palletCode;
+    }
+
+    public void setPalletCode(String palletCode) {
+        this.palletCode = palletCode;
+    }
+
+    public String getReprintTime() {
+        return reprintTime;
+    }
+
+    public void setReprintTime(String reprintTime) {
+        this.reprintTime = reprintTime;
+    }
+}

+ 159 - 165
src/main/webapp/page/jinzai/reprint_record.jsp

@@ -8,32 +8,38 @@
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>补打信息记录</title>
-    <meta name="keywords" content="补打记录,信息管理">
+    <meta name="keywords" content="补打信息,记录">
     <meta name="description" content="补打信息记录管理页面">
-    <!-- 引入Bootstrap CSS -->
-    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
-    <!-- 引入Font Awesome图标 -->
-    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
+    <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
+    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="${ctx}/css/bootstrap-select.min.css" rel="stylesheet">
     <link href="${ctx}/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
     <link href="${ctx}/css/animate.css" rel="stylesheet">
     <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
     <style>
-        .required::before {
-            content: '*';
-            color: red;
-            margin-right: 5px;
+        .row.mb-4 {
+            margin-bottom: 1.5rem;
         }
 
-        .form-group {
-            margin-bottom: 1.5rem;
+        .form-inline-flex {
+            display: flex;
+            flex-wrap: wrap;
+            align-items: center;
+            gap: 5px;
         }
 
-        .form-container {
-            padding: 20px;
-            border-radius: 8px;
-            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
-            background-color: #fff;
+        @media (max-width: 768px) {
+            .form-inline-flex {
+                flex-direction: column;
+                align-items: stretch;
+            }
+
+            .form-inline-flex .form-control,
+            .form-inline-flex .btn,
+            .form-inline-flex .selectpicker {
+                width: 100% !important;
+                margin-right: 0 !important;
+            }
         }
     </style>
 </head>
@@ -54,30 +60,27 @@
                 <div class="ibox-content">
                     <div class="row row-lg mb-4">
                         <div class="col-lg-12">
-                            <form id="searchForm" class="form-horizontal">
-                                <div class="row mb-3">
-                                    <div class="col-sm-3">
-                                        <label for="reprintTime" class="form-label">补打时间</label>
-                                        <input type="date" class="form-control" id="reprintTime" name="reprintTime">
-                                    </div>
-                                    <div class="col-sm-3">
-                                        <label for="factoryName" class="form-label">工厂名称</label>
-                                        <input type="text" class="form-control" id="factoryName" name="factoryName" placeholder="请输入工厂名称">
-                                    </div>
-                                    <div class="col-sm-3">
-                                        <label for="productName" class="form-label">产品名称</label>
-                                        <input type="text" class="form-control" id="productName" name="productName" placeholder="请输入产品名称">
-                                    </div>
-                                    <div class="col-sm-3" style="display: flex; align-items: flex-end;">
-                                        <button type="button" id="searchBtn" class="btn btn-success ms-2" onclick="search();return false;">
-                                            <i class="fas fa-search"></i> 查询
-                                        </button>
-                                        <button type="button" id="resetBtn" class="btn btn-secondary ms-2" onclick="reset();return false;">
-                                            <i class="fas fa-sync-alt"></i> 重置
-                                        </button>
-                                    </div>
+                            <div class="form-inline-flex">
+                                <input type="date" class="form-control" id="reprintTime" name="reprintTime" style="width: 180px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
+
+                                <div style="width: 200px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
+                                    <select id="factoryId" class="form-control selectpicker" data-live-search="true" title="请选择工厂">
+                                    </select>
                                 </div>
-                            </form>
+
+                                <div style="width: 200px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
+                                    <select id="productId" class="form-control selectpicker" data-live-search="true" title="请选择产品">
+                                    </select>
+                                </div>
+
+                                <button type="button" id="searchBtn" class="btn btn-success"
+                                        onclick="search();return false;" style="margin-right: 5px; margin-bottom: 5px;">
+                                    查询
+                                </button>
+                                <button type="button" id="resetBtn" class="btn btn-default"
+                                        onclick="reset();return false;" style="margin-right: 5px; margin-bottom: 5px;">重置
+                                </button>
+                            </div>
                         </div>
                     </div>
                     <div class="row row-lg mt-3">
@@ -91,12 +94,9 @@
     </div>
 </div>
 
-<!-- 全局js -->
-<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
-<!-- 引入Bootstrap JS -->
-<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
+<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
+<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
 <script src="${ctx}/js/bootstrap-select.min.js"></script>
-<!-- jQuery Validation plugin javascript-->
 <script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
 <script src="${ctx}/js/plugins/validate/messages_zh.min.js"></script>
 <script src="${ctx}/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
@@ -105,127 +105,184 @@
 <script src="${ctx}/js/common.js"></script>
 <script src="${ctx}/js/plugins/layer/layer.min.js"></script>
 <script src="${ctx}/js/Math.uuid.js"></script>
-<!-- 自定义js -->
 <script src="${ctx}/js/content.js?v=1.0.0"></script>
 </body>
 <script>
     var table = null;
-
     $(document).ready(function () {
         table = $('#table').bootstrapTable("destroy");
         initTable();
+        $('.selectpicker').selectpicker({
+            liveSearch: true,
+            size: 5,
+            actionsBox: true,
+            selectedTextFormat: 'count > 2'
+        });
+        initFactorySelect();
+        initProductSelect();
+        // Bind reset button click event
+        $('#resetBtn').on('click', function () {
+            reset();
+        });
     });
 
     function queryParams(param) {
-        // 获取查询参数
+        // Get search parameters
         let reprintTime = $.trim($("#reprintTime").val());
-        let factoryName = $.trim($("#factoryName").val());
-        let productName = $.trim($("#productName").val());
+        let factoryId = $.trim($("#factoryId").val());
+        let productId = $.trim($("#productId").val());
 
         if (reprintTime) {
             param['reprintTime'] = reprintTime;
         }
-        if (factoryName) {
-            param['factoryName'] = factoryName;
+        if (factoryId) {
+            param['factoryId'] = factoryId;
         }
-        if (productName) {
-            param['productName'] = productName;
+        if (productId) {
+            param['sku'] = productId;
         }
 
         return param;
     }
 
     function search() {
-        table = $('#table').bootstrapTable("destroy");
-        initTable();
+        table = $('#table').bootstrapTable("refresh");
     }
 
     function reset() {
-        $("#searchForm")[0].reset();
-        table = $('#table').bootstrapTable("destroy");
-        initTable();
+        // Reset form
+        $("#reprintTime").val("");
+        $("#factoryId").selectpicker('val', '');
+        $("#productId").selectpicker('val', '');
+
+        // Refresh table
+        table = $('#table').bootstrapTable("refresh");
     }
 
-    function initTable() {
-        // 模拟数据
-        var mockData = generateMockData();
+    // Load factory data (reused from original file)
+    function initFactorySelect() {
+        $.ajax({
+            url: '${ctx}/lineProduct/getFactoryList', // Assuming same endpoint
+            type: 'POST',
+            dataType: 'json',
+            beforeSend: function () {
+                $('#factoryId').prop('disabled', true).selectpicker('refresh');
+            },
+            success: function (res) {
+                $('#factoryId').empty();
+                if (res.data && res.data.length) {
+                    res.data.forEach(item => {
+                        $('#factoryId').append('<option value="' + item.id + '">' + item.factory_name + '</option>');
+                    });
+                }
+                $('#factoryId').selectpicker('refresh');
+            },
+            error: function (xhr) {
+                $('#factoryId').empty().append('<option value="">加载失败</option>');
+                $('#factoryId').selectpicker('refresh');
+                layer.msg('获取工厂数据失败: ' + xhr.statusText);
+            },
+            complete: function () {
+                $('#factoryId').prop('disabled', false).selectpicker('refresh');
+            }
+        });
+    }
 
+    // Load product data (reused from original file)
+    function initProductSelect() {
+        $.ajax({
+            url: '${ctx}/itemNew/getItemAll', // Assuming same endpoint
+            type: 'POST',
+            dataType: 'json',
+            beforeSend: function () {
+                $('#productId').prop('disabled', true).selectpicker('refresh');
+            },
+            success: function (res) {
+                $('#productId').empty();
+                if (res.data && res.data.length) {
+                    res.data.forEach(item => {
+                        $('#productId').append('<option value="' + item.sku + '">' + item.item_name + '</option>');
+                    });
+                }
+                $('#productId').selectpicker('refresh');
+            },
+            error: function (xhr) {
+                $('#productId').empty().append('<option value="">加载失败</option>');
+                $('#productId').selectpicker('refresh');
+                layer.msg('获取产品数据失败: ' + xhr.statusText);
+            },
+            complete: function () {
+                $('#productId').prop('disabled', false).selectpicker('refresh');
+            }
+        });
+    }
+
+    function initTable() {
         table = $('#table').bootstrapTable({
-            data: mockData,
+            url: '${ctx}/prodBatch/getReprintRecord', // ** IMPORTANT: Use the new data endpoint **
             method: 'get',
             sortable: true,
-            toolbar: '#toolbar',    //工具按钮用哪个容器
-            striped: true,      //是否显示行间隔色
-            cache: false,      //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
-            pagination: true,     //是否显示分页(*)
-            pageNumber: 1,      //初始化加载第一页,默认第一页
-            pageSize: 10,      //每页的记录行数(*)
-            pageList: [10, 25, 50, 100],  //可供选择的每页的行数(*)
-            queryParamsType: '', //默认值为 'limit' ,在默认情况下 传给服务端的参数为:offset,limit,sort
-            // 设置为 ''  在这种情况下传给服务器的参数为:pageSize,pageNumber
-            queryParams: queryParams,//前端调用服务时,会默认传递上边提到的参数,如果需要添加自定义参数,可以自定义一个函数返回请求参数
-            sidePagination: "client",   //客户端分页
+            striped: true,
+            cache: false,
+            pagination: true,
+            pageNumber: 1,
+            pageSize: 10,
+            pageList: [10, 25, 50, 100],
+            queryParamsType: '',
+            queryParams: queryParams,
+            sidePagination: "server",
             strictSearch: false,
-            minimumCountColumns: 2,    //最少允许的列数
-            clickToSelect: true,    //是否启用点击选中行
+            minimumCountColumns: 2,
+            clickToSelect: true,
             searchOnEnterKey: true,
-            idField: "id",
-            paginationDetailHAlign: 'right', // 将分页详细信息放在右边
+            idField: "id", // Assuming there is a unique ID field
+            responseHandler: function (res) {
+                return {
+                    total: res.total,
+                    rows: res.records
+                };
+            },
             columns: [{
                 title: '序号',
                 align: 'center',
                 formatter: function (value, row, index) {
-                    // 使用this关键字访问表格实例
                     var pageNumber = this.pageNumber || 1;
                     var pageSize = this.pageSize || 10;
                     return (pageNumber - 1) * pageSize + index + 1;
                 },
                 width: "5%"
             }, {
-                field: 'productionOrder',
-                title: '生产单号',
-                align: 'center',
-                width: "10%"
+                field: 'taskOrderNo',
+                title: '任务单号',
+                align: 'center'
             }, {
                 field: 'factoryName',
                 title: '工厂名称',
-                align: 'center',
-                width: "10%"
+                align: 'center'
             }, {
-                field: 'workshop',
+                field: 'workshopName',
                 title: '生产车间',
-                align: 'center',
-                width: "10%"
+                align: 'center'
             }, {
                 field: 'lineName',
                 title: '产线',
-                align: 'center',
-                width: "10%"
+                align: 'center'
             }, {
                 field: 'productName',
                 title: '产品名称',
-                align: 'center',
-                width: "10%"
-            }, {
-                field: 'reprintCount',
-                title: '补打次数',
-                align: 'center',
-                width: "8%"
+                align: 'center'
             }, {
                 field: 'boxCode',
                 title: '箱码',
-                align: 'center',
-                width: "12%"
+                align: 'center'
             }, {
                 field: 'palletCode',
                 title: '托码',
-                align: 'center',
-                width: "12%"
+                align: 'center'
             }, {
                 field: 'reprintTime',
                 title: '补打时间',
-                align: 'center',
-                width: "13%"
+                align: 'center'
             }],
             onLoadSuccess: function (data) {
                 console.log("数据加载成功", data);
@@ -234,69 +291,6 @@
                 layer.msg('数据加载失败', {icon: 2});
             }
         });
-
-        // 注释:当后端接口准备好后,可以替换为以下代码调用真实接口
-        /*
-        table = $('#table').bootstrapTable({
-            method: 'get',
-            sortable: true,
-            toolbar: '#toolbar',
-            striped: true,
-            cache: false,
-            pagination: true,
-            pageNumber: 1,
-            pageSize: 10,
-            pageList: [10, 25, 50, 100],
-            url: '${ctx}/reprint/list', // 后端接口URL
-            queryParamsType: '',
-            queryParams: queryParams,
-            sidePagination: "server",
-            strictSearch: false,
-            minimumCountColumns: 2,
-            clickToSelect: true,
-            searchOnEnterKey: true,
-            idField: "id",
-            responseHandler: function (res) {
-                return {
-                    total: res.total,
-                    rows: res.records
-                };
-            },
-            columns: [// 与上面相同的列定义...]
-        });
-        */
-    }
-
-    // 生成模拟数据
-    function generateMockData() {
-        var factories = ['金华工厂', '杭州工厂', '上海工厂', '苏州工厂', '广州工厂'];
-        var workshops = ['第一车间', '第二车间', '第三车间', '第四车间', '第五车间'];
-        var lines = ['A线', 'B线', 'C线', 'D线', 'E线'];
-        var products = ['食品A', '食品B', '食品C', '食品D', '食品E', '食品F', '食品G'];
-        var mockData = [];
-
-        for (var i = 1; i <= 50; i++) {
-            var date = new Date();
-            date.setDate(date.getDate() - Math.floor(Math.random() * 30));
-            var formattedDate = date.toISOString().split('T')[0];
-            var time = Math.floor(Math.random() * 24) + ':' + (Math.floor(Math.random() * 60) < 10 ? '0' : '') + Math.floor(Math.random() * 60);
-            var reprintTime = formattedDate + ' ' + time;
-
-            mockData.push({
-                id: i,
-                productionOrder: 'PO' + Date.now().toString().slice(-6) + i,
-                factoryName: factories[Math.floor(Math.random() * factories.length)],
-                workshop: workshops[Math.floor(Math.random() * workshops.length)],
-                lineName: lines[Math.floor(Math.random() * lines.length)],
-                productName: products[Math.floor(Math.random() * products.length)],
-                reprintCount: Math.floor(Math.random() * 5) + 1, // 1-5次
-                boxCode: 'BOX' + Math.floor(Math.random() * 1000000000),
-                palletCode: 'PAL' + Math.floor(Math.random() * 1000000000),
-                reprintTime: reprintTime
-            });
-        }
-
-        return mockData;
     }
 </script>
 </html>