Bläddra i källkod

系统配置-配置列表查询、新增、修改增加大屏路径字段1

jichaobo 3 år sedan
förälder
incheckning
9ecfd42f29

+ 2 - 1
fiveep-controller/src/main/java/com/bizmatics/controller/web/SysPlatformController.java

@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 平台挂管理
@@ -51,7 +52,7 @@ public class SysPlatformController {
      * @return
      */
     @GetMapping("/getPlatformMenu")
-    public ApiResult<List<Object>> getPlatformMenu(@RequestParam Long platformId) {
+    public ApiResult<Map<String, Object>> getPlatformMenu(@RequestParam Long platformId) {
         return ApiResult.success(sysPlatformService.getPlatformMenu(platformId));
     }
 

+ 4 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/SysPlatformMapper.java

@@ -2,6 +2,7 @@ package com.bizmatics.persistence.mapper;
 
 import com.bizmatics.model.SysPlatform;
 import com.bizmatics.common.mvc.base.CrudMapper;
+import com.bizmatics.model.SysPlatformMenu;
 import com.bizmatics.model.system.SysMenu;
 import com.bizmatics.model.vo.SysPlatformVo;
 import com.bizmatics.model.vo.SysTenantTwoVo;
@@ -29,4 +30,7 @@ public interface SysPlatformMapper extends CrudMapper<SysPlatform> {
     List<SysMenu> getMenuIdListOne(Long[] menuIds, String menuType);
 
     int deletePlatformMenuBy(Long platformId);
+
+
+    List<SysPlatformMenu> getMenuListOne(Long platformId, String menuType);
 }

+ 14 - 1
fiveep-persistence/src/main/resources/mapper/mysql/SysPlatformMapper.xml

@@ -22,7 +22,6 @@
         sys_platform AS a
         LEFT JOIN sys_tenant AS b ON a.id = b.system_name
         <where>
-            b. STATUS = 0
             and a.status=1
             <if test="platformName != null and platformName != ''">
                 and a.platform_name LIKE CONCAT(CONCAT('%', #{platformName}), '%')
@@ -60,4 +59,18 @@
         delete from sys_platform_menu where platform_id=#{platformId}
     </delete>
 
+
+    <select id="getMenuListOne"  resultType="com.bizmatics.model.SysPlatformMenu" >
+        SELECT
+        b.*
+        FROM
+        sys_menu AS a
+        JOIN sys_platform_menu AS b ON a.menu_id = b.menu_id
+        WHERE
+        b.platform_id = #{platformId}
+        <if test="menuType != null and menuType != ''">
+            AND a.menu_type = #{menuType}
+        </if>
+    </select>
+
 </mapper>

+ 2 - 1
fiveep-service/src/main/java/com/bizmatics/service/SysPlatformService.java

@@ -7,6 +7,7 @@ import com.bizmatics.model.vo.PlatformMenuVo;
 import com.bizmatics.model.vo.SysPlatformVo;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -21,7 +22,7 @@ public interface SysPlatformService extends CrudService<SysPlatform> {
 
     CommonPage<SysPlatformVo> getPlatformList(String platformName, String startTime, String endTime, Integer page, Integer size, Integer id);
 
-    List<Object> getPlatformMenu(Long platformId);
+    Map<String, Object> getPlatformMenu(Long platformId);
 
     void updatePlatformMenu(PlatformMenuVo platformMenuVo);
 }

+ 26 - 7
fiveep-service/src/main/java/com/bizmatics/service/impl/SysPlatformServiceImpl.java

@@ -20,7 +20,9 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -62,7 +64,7 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
     }
 
     @Override
-    public List<Object> getPlatformMenu(Long platformId){
+    public Map<String, Object> getPlatformMenu(Long platformId){
         //全部目录查询
         List<SysMenu> sysMenuListTwo = menuMapper.getSysMenuList("M");
         //全部菜单查询
@@ -74,6 +76,14 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
         queryWrapper.eq(SysPlatformMenu::getPlatformId, platformId);
         List<SysPlatformMenu> sysMenuListFour = sysPlatformMenuService.list(queryWrapper);
 
+        List<SysPlatformMenu> menuList = baseMapper.getMenuListOne(platformId, "F");
+        Long[] arr = new Long[menuList.size()];
+        for (int i = 0; i < menuList.size(); i++) {
+            arr[i] = menuList.get(i).getMenuId();
+        }
+
+
+
         List<SysMenuTwoVo> sysMenuVoListOne = new ArrayList<>();
         List<SysMenuOneVo> SysMenuVoList = new ArrayList<>();
         List<SysMenuVo> SysMenuVoListOne = new ArrayList<>();
@@ -167,7 +177,12 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
                 }
             }
         }
-        return list;
+        Map<String,Object> ajax = new HashMap<>();
+        ajax.put("checkedKeys",arr);
+        ajax.put("menus", list);
+
+        return ajax;
+//        return list;
     }
 
 
@@ -175,11 +190,15 @@ public class SysPlatformServiceImpl extends AbstractCrudService<SysPlatformMappe
     @Transactional
     public void updatePlatformMenu(PlatformMenuVo platformMenuVo){
         SysPlatform sysPlatform = new SysPlatform();
-        sysPlatform.setId(platformMenuVo.getPlatformId().intValue());
-        sysPlatform.setPlatformName(platformMenuVo.getPlatformName());
-        sysPlatform.setUpdateBy(SecurityUtils.getUser().getUserName());
-        sysPlatform.setUpdateTime(LocalDateTime.now());
-        this.updateById(sysPlatform);
+        if(platformMenuVo.getPlatformId().intValue()==0){
+            sysPlatform.setPlatformName(platformMenuVo.getPlatformName());
+            sysPlatform.setUpdateBy(SecurityUtils.getUser().getUserName());
+            sysPlatform.setUpdateTime(LocalDateTime.now());
+            this.save(sysPlatform);
+            Integer fid = sysPlatform.getId();
+            platformMenuVo.setPlatformId(fid.longValue());
+        }
+
         Long[] arr = platformMenuVo.getMenuIds();
         //菜单ID
         List<SysMenu> menuIdList = baseMapper.getMenuIdListOne(arr, "F");