From c4503d7b0d3fb95962de916ee137896b5c94718c Mon Sep 17 00:00:00 2001 From: erdanergou Date: Sat, 18 Feb 2023 11:17:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=A1=E5=BD=A2=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../depository_manage/controller/MaterialController.java | 2 +- .../depository_manage/controller/PlaceController.java | 7 ++++++- .../resources/templates/pages/material/material-view.html | 4 ++-- src/main/resources/templates/pages/place/place_edit.html | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java index 0509eab5..665af9d1 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java @@ -543,7 +543,7 @@ public class MaterialController { } try { // 二维码保存信息 - return RestResponse.CreateQrCode(qrCode); + return RestResponse.CreateBarCode(qrCode,material.getMname()); } catch (IOException e) { return new RestResponse("err: " + e.getMessage(), 678, new StatusInfo("失败", "请联系开发人员")); } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java index 2f51dda2..d9c0d9da 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java @@ -298,7 +298,12 @@ public class PlaceController { } try { // 二维码保存信息 - return RestResponse.CreateQrCode(qrCode); + + Place placeById = placeService.findPlaceById(pid); + + Depository depositoryById = depositoryService.findDepositoryById(placeById.getDid()); + + return RestResponse.CreateBarCode(qrCode,depositoryById.getDname() + "-" + placeById.getCode()); } catch (IOException e) { return new RestResponse("err: " + e.getMessage(), 678, new StatusInfo("失败", "请联系开发人员")); } diff --git a/src/main/resources/templates/pages/material/material-view.html b/src/main/resources/templates/pages/material/material-view.html index fdf26332..0c674843 100644 --- a/src/main/resources/templates/pages/material/material-view.html +++ b/src/main/resources/templates/pages/material/material-view.html @@ -123,7 +123,7 @@ @@ -279,7 +279,7 @@ success: function (d) { var data = d.data; layer.close(this.layerIndex); - //$("#qrCode").attr("src", data); + $("#barCode").attr("src", data.qrCode); $("#codeItem").show(); $("#createCode").hide(); } diff --git a/src/main/resources/templates/pages/place/place_edit.html b/src/main/resources/templates/pages/place/place_edit.html index 80426f5d..b7845691 100644 --- a/src/main/resources/templates/pages/place/place_edit.html +++ b/src/main/resources/templates/pages/place/place_edit.html @@ -62,7 +62,7 @@
@@ -156,7 +156,7 @@ success: function (d) { var data = d.data; layer.close(this.layerIndex); - //$("#qrCode").attr("src", data); + $("#barCode").attr("src", data.qrCode); $("#codeItem").show(); $("#createCode").hide(); }