|
|
@@ -0,0 +1,67 @@
|
|
|
+package com.jeesite.modules.mes.web;
|
|
|
+
|
|
|
+import com.jeesite.common.config.Global;
|
|
|
+import com.jeesite.common.lang.StringUtils;
|
|
|
+import com.jeesite.common.web.BaseController;
|
|
|
+import com.jeesite.modules.mes.resp.CommonResp;
|
|
|
+import com.jeesite.modules.mes.service.MesLaserService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * PDA产品接口
|
|
|
+ * @author hzd
|
|
|
+ * @version 2026-07-08
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping(value = "${adminPath}/mes/pda/product")
|
|
|
+public class MesPdaProductController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MesLaserService mesLaserService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据客户码查询钢印码,并在提交钢印码时校验是否一致。
|
|
|
+ * 请求参数:sn=客户码,steelSn=用户提交的钢印码(可选)
|
|
|
+ */
|
|
|
+ @GetMapping(value = "steelSn")
|
|
|
+ @ResponseBody
|
|
|
+ public CommonResp<Map<String, String>> steelSn(@RequestParam("sn") String sn,
|
|
|
+ @RequestParam(value = "steelSn", required = false) String submitSteelSn) {
|
|
|
+ CommonResp<Map<String, String>> resp = new CommonResp<>();
|
|
|
+ Map<String, String> data = new HashMap<>();
|
|
|
+ data.put("sn", sn);
|
|
|
+ resp.setData(data);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(sn)) {
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("客户码不能为空");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ String steelSn = mesLaserService.findSteelSnByCustomerSn(sn);
|
|
|
+ data.put("steelSn", steelSn);
|
|
|
+ if (StringUtils.isBlank(steelSn)) {
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("未查询到客户码对应的钢印码");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(submitSteelSn) && !steelSn.equals(submitSteelSn)) {
|
|
|
+ resp.setResult(Global.FALSE);
|
|
|
+ resp.setMessage("钢印码不一致");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+
|
|
|
+ resp.setResult(Global.TRUE);
|
|
|
+ resp.setMessage("OK");
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+}
|