Переглянути джерело

fix: 设备门店绑定穿梭框 label 错误导致解绑失效

问题:
- el-transfer 的 label prop 写成了 'deviceName',但 ShopDeviceVO 和 Device
  实体都不存在该字段(两者字段名均为 'name')
- 导致穿梭框两侧所有条目标签为空,用户无法识别设备,操作无效
- 表现为「移出设备后刷新页面仍在原地」

修复:
- label: 'deviceName' → label: 'name'
- ShopServiceImpl.linkDevice/unlinkDevice 补充 @Transactional 注解

Co-Authored-By: Claude <noreply@anthropic.com>
skyline 2 тижнів тому
батько
коміт
fc8a2176e7

+ 1 - 1
haha-admin-web/src/views/shop/utils/hook.tsx

@@ -617,7 +617,7 @@ export function useShop(tableRef: Ref) {
             titles={["可选设备", "已关联设备"]}
             props={{
               key: "deviceId",
-              label: "deviceName"
+              label: "name"
             }}
           />
         </div>

+ 2 - 0
haha-service/src/main/java/com/haha/service/impl/ShopServiceImpl.java

@@ -289,6 +289,7 @@ public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements Sh
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean linkDevice(Long shopId, Long deviceId) {
         // 检查门店是否存在
         Shop shop = this.getById(shopId);
@@ -345,6 +346,7 @@ public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements Sh
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean unlinkDevice(Long shopId, Long deviceId) {
         // 检查设备是否属于该门店
         Device device = deviceService.getById(deviceId);