Browse Source

api 调整模板编辑商户可以为空,调整h5查询模板列表会同时查出该商户绑定的和未绑定任何商户的

limingming 1 year ago
parent
commit
912f75baee

+ 5 - 2
rouyi-api/src/main/java/com/info666/infraredRemote/controller/GetDeviceInfoController.java

@@ -69,11 +69,14 @@ public class GetDeviceInfoController {
      */
     @PostMapping("/getEnableTemplateList")
     public R<List<TemplateLibrary>> getEnableTemplateList(@RequestBody BaseParam param) {
-        MerchantUser one = merchantUserService.getOne(new LambdaQueryWrapper<MerchantUser>().eq(MerchantUser::getMerchantCode,param.getName()),false);
+        MerchantUser one = merchantUserService.getOne(new LambdaQueryWrapper<MerchantUser>().eq(MerchantUser::getMerchantCode, param.getName()), false);
         List<TemplateLibrary> templateIPage = templateLibraryService.list(new LambdaQueryWrapper<TemplateLibrary>()
                 .eq(TemplateLibrary::getStatus, 0)
                 .eq(TemplateLibrary::getDelFlag, 0)
-                .eq(TemplateLibrary::getMerchantId,one.getId()));
+                .isNull(TemplateLibrary::getMerchantId)
+                .or()
+                .eq(TemplateLibrary::getMerchantId, one.getId()));
+
         return R.ok(templateIPage);
     }
 

+ 3 - 3
ruoyi-system/src/main/java/com/ruoyi/system/domain/TemplateLibrary.java

@@ -1,11 +1,10 @@
 package com.ruoyi.system.domain;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.annotation.Excel;
 import lombok.Data;
+import org.apache.ibatis.type.JdbcType;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -32,6 +31,7 @@ public class TemplateLibrary implements Serializable {
 
     /** 商户id */
     @Excel(name = "商户di")
+    @TableField(updateStrategy = FieldStrategy.IGNORED,jdbcType = JdbcType.VARCHAR)
     private Long merchantId;
 
     /** 模板名称 */