src/main/java/com/ruoyi/quality/service/impl/QualityInspectServiceImpl.java
@@ -32,6 +32,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@@ -119,6 +120,16 @@
            detail.setIndex(index);
            index++;
        }
        // 格式化检验日期
        String checkTimeStr;
        if (inspect.getCheckTime() != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            checkTimeStr = sdf.format(inspect.getCheckTime());
        } else {
            checkTimeStr = "";
        }
        InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx");
        Configure configure = Configure.builder()
                .bind("paramList", new HackLoopTableRenderPolicy())
@@ -127,8 +138,11 @@
        XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(
                new HashMap<String, Object>() {{
                    put("inspect", inspect);
                    put("customerLabel", inspect.getInspectType() == 0 ? "供应商" : "客户");
                    put("customer", inspect.getInspectType() == 0 ? inspect.getSupplier() : inspect.getCustomer());
                    put("inspectType", finalInspectType);
                    put("paramList", paramList);
                    put("checkTime", checkTimeStr);
                }});
        try {