From 4ca4444ad33a2a1a51f5c06e78ee9365dfb1eed6 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期四, 08 十月 2026 17:11:11 +0800
Subject: [PATCH] feat(mes): 种子二维码标签国标四要素合规改造
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/trace/MesProTraceResolveController.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/trace/MesProTraceResolveController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/trace/MesProTraceResolveController.java
new file mode 100644
index 0000000..0061b4b
--- /dev/null
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/trace/MesProTraceResolveController.java
@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.mes.controller.admin.pro.trace;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.mes.service.pro.bagcode.MesProBagCodeService;
+import cn.iocoder.yudao.module.mes.service.pro.batch.MesProBatchService;
+import cn.iocoder.yudao.module.mes.service.pro.pallet.MesProPalletService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * MES 鎵爜杩芥函 - 缂栫爜绫诲瀷瑙f瀽銆�
+ *
+ * <p>缂栫爜缁熶竴涓恒��16 浣嶇函鏁板瓧銆嶅悗锛屾棤娉曞啀鎸夊墠缂�鍒ゆ柇绫诲瀷锛圔AG-/PL-/PB- 绛夊墠缂�宸插彇娑堬級锛�
+ * 鍓嶇鎵爜鍚庡厛璋冪敤鏈帴鍙f寜缂栫爜鍙嶆煡鍏舵墍灞炵被鍨嬶紝鍐嶈皟鐢ㄥ搴旂被鍨嬬殑杩芥函鎺ュ彛銆�
+ */
+@Tag(name = "绠$悊鍚庡彴 - MES 鎵爜婧簮锛堢被鍨嬭В鏋愶級")
+@RestController
+@RequestMapping("/mes/pro/trace")
+@Validated
+public class MesProTraceResolveController {
+
+ @Resource
+ private MesProBagCodeService bagCodeService;
+ @Resource
+ private MesProPalletService palletService;
+ @Resource
+ private MesProBatchService batchService;
+
+ @GetMapping("/resolve-type")
+ @Operation(summary = "鏍规嵁缂栫爜瑙f瀽婧簮绫诲瀷锛歜ag / pallet / batch锛涘潎涓嶅尮閰嶈繑鍥炵┖")
+ @Parameter(name = "code", description = "缂栫爜锛堜簩缁寸爜鍐呭锛�", required = true)
+ @PreAuthorize("@ss.hasPermission('mes:pro-bag-code:query')")
+ public CommonResult<String> resolveType(@RequestParam("code") String code) {
+ if (bagCodeService.getBagCodeByCode(code) != null) {
+ return success("bag");
+ }
+ if (palletService.getPalletByCode(code) != null) {
+ return success("pallet");
+ }
+ if (batchService.getBatchByCode(code) != null) {
+ return success("batch");
+ }
+ return success(null);
+ }
+
+}
--
Gitblit v1.9.3