From f79d622544f3aac10918f8dfe1903d76155457cc Mon Sep 17 00:00:00 2001 From: yangk Date: Wed, 10 Jun 2026 15:40:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(rfid):=20=E4=B8=BARFID=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E7=B1=BB=E5=88=AB=E7=AD=9B=E9=80=89=E5=92=8C=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在AmsRfidTagController中注入IAmsAssetCategoryService服务 - 为selectAsset方法添加ModelMap参数并查询启用状态的资产类别列表 - 将资产状态标签显示逻辑从简单字典转换改为循环匹配确保正确显示 - 在前端模板中将资产类别输入框改为下拉选择框支持按类别筛选 - 添加资产类别数据绑定到前端模板的categories变量中 --- .../ruoyi/asset/controller/AmsRfidTagController.java | 10 +++++++++- .../src/main/resources/templates/asset/tag/bind.html | 9 ++++++++- .../resources/templates/asset/tag/selectAsset.html | 5 ++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ruoyi-asset/src/main/java/com/ruoyi/asset/controller/AmsRfidTagController.java b/ruoyi-asset/src/main/java/com/ruoyi/asset/controller/AmsRfidTagController.java index d56bb34..9e5765d 100644 --- a/ruoyi-asset/src/main/java/com/ruoyi/asset/controller/AmsRfidTagController.java +++ b/ruoyi-asset/src/main/java/com/ruoyi/asset/controller/AmsRfidTagController.java @@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.asset.domain.AmsAsset; +import com.ruoyi.asset.domain.AmsAssetCategory; import com.ruoyi.asset.domain.AmsRfidTag; import com.ruoyi.asset.domain.RfidBindingContext; +import com.ruoyi.asset.service.IAmsAssetCategoryService; import com.ruoyi.asset.service.IAmsAssetService; import com.ruoyi.asset.service.IAmsRfidTagService; import com.ruoyi.asset.service.IRfidBindingService; @@ -46,6 +48,9 @@ public class AmsRfidTagController extends BaseController @Autowired private IRfidBindingService rfidBindingService; + @Autowired + private IAmsAssetCategoryService amsAssetCategoryService; + @RequiresPermissions("asset:tag:view") @GetMapping() public String tag() @@ -198,8 +203,11 @@ public class AmsRfidTagController extends BaseController */ @RequiresPermissions("asset:tag:bind") @GetMapping("/selectAsset") - public String selectAsset() + public String selectAsset(ModelMap mmap) { + AmsAssetCategory categoryQuery = new AmsAssetCategory(); + categoryQuery.setEnabled("Y"); + mmap.put("categories", amsAssetCategoryService.selectAmsAssetCategoryList(categoryQuery)); return prefix + "/selectAsset"; } diff --git a/ruoyi-asset/src/main/resources/templates/asset/tag/bind.html b/ruoyi-asset/src/main/resources/templates/asset/tag/bind.html index ed0f3d7..3b7c1c9 100644 --- a/ruoyi-asset/src/main/resources/templates/asset/tag/bind.html +++ b/ruoyi-asset/src/main/resources/templates/asset/tag/bind.html @@ -87,7 +87,14 @@ } $("#assetCode").val(selectedAsset.assetCode); $("#assetName").val(selectedAsset.assetName); - $("#assetStatusName").val($.table.selectDictLabel(assetStatusDatas, selectedAsset.assetStatus)); + var statusLabel = ""; + $.each(assetStatusDatas, function(index, dict) { + if (dict.dictValue == ('' + selectedAsset.assetStatus)) { + statusLabel = dict.dictLabel; + return false; + } + }); + $("#assetStatusName").val(statusLabel || selectedAsset.assetStatus); $("#assetLocation").val((selectedAsset.warehouseName || "-") + " / " + (selectedAsset.locationName || "-")); $.modal.close(index); } diff --git a/ruoyi-asset/src/main/resources/templates/asset/tag/selectAsset.html b/ruoyi-asset/src/main/resources/templates/asset/tag/selectAsset.html index fe9c6b5..183bfbb 100644 --- a/ruoyi-asset/src/main/resources/templates/asset/tag/selectAsset.html +++ b/ruoyi-asset/src/main/resources/templates/asset/tag/selectAsset.html @@ -20,7 +20,10 @@
  • - +