Sfoglia il codice sorgente

api 根据商户标识查询模板列表

limingming 1 anno fa
parent
commit
3d80328753

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

@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.system.domain.BaseParam;
 import com.ruoyi.system.domain.BasicLibrary;
+import com.ruoyi.system.domain.MerchantUser;
 import com.ruoyi.system.domain.TemplateLibrary;
 import com.ruoyi.system.domain.vo.GetDeviceInfoVo;
 import com.ruoyi.system.service.BasicLibraryService;
+import com.ruoyi.system.service.MerchantUserService;
 import com.ruoyi.system.service.TemplateLibraryService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,6 +34,9 @@ public class GetDeviceInfoController {
     @Autowired
     private TemplateLibraryService templateLibraryService;
 
+    @Autowired
+    private MerchantUserService merchantUserService;
+
     @ApiOperation("获取遥控设备信息")
     @PostMapping("/getDeviceInfo")
     public R<List<GetDeviceInfoVo>> getDeviceInfo(@RequestBody BaseParam param) {
@@ -63,10 +68,12 @@ public class GetDeviceInfoController {
      * 查询已启的模板库列表
      */
     @PostMapping("/getEnableTemplateList")
-    public R<List<TemplateLibrary>> getEnableTemplateList() {
+    public R<List<TemplateLibrary>> getEnableTemplateList(@RequestBody BaseParam param) {
+        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::getDelFlag, 0)
+                .eq(TemplateLibrary::getMerchantId,one.getId()));
         return R.ok(templateIPage);
     }