From 34981c30a78e8bbd7791131059a9210f9928b62c Mon Sep 17 00:00:00 2001
From: 刘光辉 <347230014@qq.com>
Date: 星期四, 17 九月 2026 09:24:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtKanbanApiChecks.java | 81 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtKanbanApiChecks.java b/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtKanbanApiChecks.java
new file mode 100644
index 0000000..044d535
--- /dev/null
+++ b/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtKanbanApiChecks.java
@@ -0,0 +1,81 @@
+package jnpf.limsService.support;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import jnpf.limsEntity.LimsSxtKanbanItemVo;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.TimeZone;
+
+public class LimsSxtKanbanApiChecks {
+ public static void main(String[] args) throws Exception {
+ Path root = Paths.get("").toAbsolutePath().normalize();
+ String service = read(root, "jnpf-lims/jnpf-lims-biz/src/main/java/jnpf/limsService/LimsSxtKanbanService.java");
+ require(service, "listKanbanRows", "kanban rows contract missing");
+ require(service, "listKanbanItems", "kanban items contract missing");
+ require(service, "quxiaoWeilaiRenwu", "future Renwu cancellation contract missing");
+
+ String controller = read(root, "jnpf-lims/jnpf-lims-controller/src/main/java/jnpf/limsController/LimsSxtKanbanController.java");
+ require(controller, "@GetMapping(\"/options\")", "kanban options endpoint missing");
+
+ String implementation = read(root, "jnpf-lims/jnpf-lims-biz/src/main/java/jnpf/limsService/impl/LimsSxtKanbanServiceImpl.java");
+ require(implementation, "kanbanMapper.selectRows", "kanban rows must use point master data");
+
+ String mapper = read(root, "jnpf-lims/jnpf-lims-biz/src/main/resources/mapper/LimsSxtKanbanMapper.xml");
+ String sampleTypeQuery = selectBlock(mapper, "selectSampleTypes");
+ require(sampleTypeQuery, "FROM yangpin_guanli y", "sample types must start from sample master data");
+ require(sampleTypeQuery, "INNER JOIN qingyan_leixing ql", "sample types must resolve the inspection category");
+ require(sampleTypeQuery, "y.biz_enabled = 'enabled'", "disabled samples must be excluded");
+ require(sampleTypeQuery, "ql.fenlei_mingcheng = '姘寸郴缁�'", "sample types must be limited to water system samples");
+ reject(sampleTypeQuery, "activePointJoins", "sample types must not depend on sampling point configuration");
+ require(mapper, "FROM lims_sxt_quyangdian p", "kanban rows must start from sampling points");
+ require(mapper, "p.biz_enabled = 'enabled'", "disabled points must be excluded");
+ require(mapper, "p.f_delete_mark IS NULL OR p.f_delete_mark <> 1", "deleted points must be excluded");
+ reject(mapper, "lims_sxt_quyang_jihua_renwu", "kanban master rows must not depend on Renwu");
+ verifyCalendarDateSerialization();
+ }
+
+ private static String read(Path root, String relativePath) throws Exception {
+ return new String(Files.readAllBytes(root.resolve(relativePath)));
+ }
+
+ private static String selectBlock(String mapper, String id) {
+ int start = mapper.indexOf("<select id=\"" + id + "\"");
+ int end = mapper.indexOf("</select>", start);
+ requireCondition(start >= 0 && end >= 0, "mapper select block missing: " + id);
+ return mapper.substring(start, end);
+ }
+
+ private static void verifyCalendarDateSerialization() throws Exception {
+ TimeZone originalTimeZone = TimeZone.getDefault();
+ try {
+ TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
+ LimsSxtKanbanItemVo item = new LimsSxtKanbanItemVo();
+ item.setJihuaRiqi(Date.from(LocalDate.of(2026, 7, 1)
+ .atStartOfDay(ZoneId.of("GMT+8")).toInstant()));
+
+ JsonNode result = new ObjectMapper().readTree(new ObjectMapper().writeValueAsString(item));
+ requireCondition("2026-07-01".equals(result.path("jihua_riqi").asText()),
+ "kanban calendar date must retain the GMT+8 calendar day");
+ } finally {
+ TimeZone.setDefault(originalTimeZone);
+ }
+ }
+
+ private static void require(String source, String token, String message) {
+ if (!source.contains(token)) throw new AssertionError(message);
+ }
+
+ private static void reject(String source, String token, String message) {
+ if (source.contains(token)) throw new AssertionError(message);
+ }
+
+ private static void requireCondition(boolean condition, String message) {
+ if (!condition) throw new AssertionError(message);
+ }
+}
--
Gitblit v1.8.0