| | |
| | | package com.ruoyi.web.test; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.ruoyi.RuoYiApplication; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.context.EnvironmentAware; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = RuoYiApplication.class,webEnvironment = WebEnvironment.MOCK) |
| | | @Slf4j |
| | | public class BaseTest implements ApplicationContextAware, EnvironmentAware { |
| | | |
| | | static { |
| | | System.setProperty("spring.profiles.active","test"); |
| | | } |
| | | |
| | | protected ApplicationContext applicationContext; |
| | | protected Environment environment; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) { |
| | | this.applicationContext = applicationContext; |
| | | } |
| | | |
| | | public ApplicationContext getApplicationContext() { |
| | | return applicationContext; |
| | | } |
| | | |
| | | @Override |
| | | public void setEnvironment(Environment environment) { |
| | | this.environment = environment; |
| | | } |
| | | |
| | | public Environment getEnvironment() { |
| | | return environment; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | //package com.ruoyi.web.test; |
| | | // |
| | | //import com.alibaba.fastjson.JSON; |
| | | //import com.alibaba.fastjson.JSONArray; |
| | | //import com.alibaba.fastjson.JSONObject; |
| | | //import com.alibaba.fastjson.TypeReference; |
| | | //import com.ruoyi.RuoYiApplication; |
| | | //import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | //import com.ruoyi.system.domain.SysRoleMenu; |
| | | //import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | | //import com.ruoyi.system.service.ISysMenuService; |
| | | //import com.ruoyi.system.service.ISysRoleService; |
| | | //import com.tencentcloudapi.cws.v20180312.models.Site; |
| | | //import lombok.extern.slf4j.Slf4j; |
| | | //import org.junit.jupiter.api.Test; |
| | | //import org.junit.runner.RunWith; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.boot.test.context.SpringBootTest; |
| | | //import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; |
| | | //import org.springframework.context.ApplicationContext; |
| | | //import org.springframework.context.ApplicationContextAware; |
| | | //import org.springframework.context.EnvironmentAware; |
| | | //import org.springframework.core.env.Environment; |
| | | //import org.springframework.test.context.junit4.SpringRunner; |
| | | //import org.springframework.util.CollectionUtils; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | //import java.util.ArrayList; |
| | | //import java.util.List; |
| | | //import java.util.stream.Collectors; |
| | | // |
| | | //@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = RuoYiApplication.class) |
| | | //public class BaseTest{ |
| | | // |
| | | // @Resource |
| | | // private ISysMenuService sysMenuService; |
| | | // |
| | | // public String menuStr = "[\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/financialStatements\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"财务报表\",\n" + |
| | | // " \"icon\": \"hugeicons:menu\",\n" + |
| | | // " \"rank\": 1\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/financialStatements/clinicProcurementReport\",\n" + |
| | | // " \"component\": \"financialStatements/clinicProcurementReport/index\",\n" + |
| | | // " \"name\": \"ClinicProcurementReport\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"诊所采购报表\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:export\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"导出\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/featured\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"热门推荐\",\n" + |
| | | // " \"icon\": \"hugeicons:menu\",\n" + |
| | | // " \"rank\": 2\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/featured/educationalInformation\",\n" + |
| | | // " \"component\": \"featured/educationalInformation/index\",\n" + |
| | | // " \"name\": \"EducationalInformation\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"教育资讯\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": []\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/featured/productIntroduction\",\n" + |
| | | // " \"component\": \"featured/productIntroduction/index\",\n" + |
| | | // " \"name\": \"ProductIntroduction\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"产品介绍\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": []\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/featured/popularEvent\",\n" + |
| | | // " \"component\": \"featured/popularEvent/index\",\n" + |
| | | // " \"name\": \"PopularEvent\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"热门活动\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": []\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/featured/popularLiveStream\",\n" + |
| | | // " \"component\": \"featured/popularLiveStream/index\",\n" + |
| | | // " \"name\": \"PopularLiveStream\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"热门直播\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": []\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/system\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"系统管理\",\n" + |
| | | // " \"icon\": \"hugeicons:menu\",\n" + |
| | | // " \"rank\": 3\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/system/permissionManagement\",\n" + |
| | | // " \"component\": \"system/permissionManagement/index\",\n" + |
| | | // " \"name\": \"PermissionManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"权限管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:edit\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"编辑\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:delete\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"删除\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/system/accountManagement\",\n" + |
| | | // " \"component\": \"system/accountManagement/index\",\n" + |
| | | // " \"name\": \"AccountManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"账号管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:edit\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"编辑\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:delete\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"删除\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:resetPassword\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"重置密码\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"ERP系统\",\n" + |
| | | // " \"icon\": \"hugeicons:menu\",\n" + |
| | | // " \"rank\": 4\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/productManagement\",\n" + |
| | | // " \"component\": \"erpSystem/productManagement/index\",\n" + |
| | | // " \"name\": \"ProductManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"商品管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:fetchProduct\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"一键获取商品\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:edit\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"修改\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:delete\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"删除\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryManagement\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryManagement/index\",\n" + |
| | | // " \"name\": \"InventoryManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"库存管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:fetchProduct\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"一键采购\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"问题上报\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryManagement/:id\",\n" + |
| | | // " \"name\": \"InventoryManagementDetail\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryManagement/detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"库存详情\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryProcurement\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryProcurement/index\",\n" + |
| | | // " \"name\": \"InventoryProcurement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"库存采购\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加采购\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:delete\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"删除\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:cancel\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"取消\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryProcurement/addPurchase\",\n" + |
| | | // " \"name\": \"AddPurchase\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryProcurement/addPurchase\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加采购\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryProcurement/:id\",\n" + |
| | | // " \"name\": \"InventoryProcurementDetail\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryProcurement/detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"采购详情\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryInbound\",\n" + |
| | | // " \"name\": \"InventoryInbound\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryInbound/index\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"库存入库\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryInbound/:id\",\n" + |
| | | // " \"name\": \"InventoryInboundDetail\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryInbound/detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"入库详情\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryInbound/productInbound\",\n" + |
| | | // " \"name\": \"ProductInbound\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryInbound/productInbound\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"商品入库\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryOutbound\",\n" + |
| | | // " \"name\": \"InventoryOutbound\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryOutbound/index\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"库存出库\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryOutbound/:id\",\n" + |
| | | // " \"name\": \"InventoryOutboundDetail\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryOutbound/detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"出库详情\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/inventoryOutbound/productOutbound\",\n" + |
| | | // " \"name\": \"ProductOutbound\",\n" + |
| | | // " \"component\": \"erpSystem/inventoryOutbound/productOutbound\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"商品出库\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/issueReport\",\n" + |
| | | // " \"component\": \"erpSystem/issueReport/index\",\n" + |
| | | // " \"name\": \"IssueReport\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"问题上报\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"问题上报\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/maintenanceReminder\",\n" + |
| | | // " \"component\": \"erpSystem/maintenanceReminder/index\",\n" + |
| | | // " \"name\": \"MaintenanceReminder\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"保养提醒\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/erpSystem/expirationWarning\",\n" + |
| | | // " \"component\": \"erpSystem/expirationWarning/index\",\n" + |
| | | // " \"name\": \"ExpirationWarning\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"有效期预警\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:addStockOut\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加出库\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"患者诊疗\",\n" + |
| | | // " \"icon\": \"hugeicons:menu\",\n" + |
| | | // " \"rank\": 5\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem/orderManagement\",\n" + |
| | | // " \"component\": \"crmSystem/orderManagement/index\",\n" + |
| | | // " \"name\": \"OrderManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"订单管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem/orderManagement/addPurchaseRecord\",\n" + |
| | | // " \"component\": \"crmSystem/orderManagement/addPurchaseRecord\",\n" + |
| | | // " \"name\": \"AddPurchaseRecord\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加购药记录\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": []\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem/patientManagement/index\",\n" + |
| | | // " \"component\": \"crmSystem/patientManagement/index\",\n" + |
| | | // " \"name\": \"patientManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"用户管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:add\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"添加\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:edit\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"修改\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem/patientManagement/:id\",\n" + |
| | | // " \"name\": \"PatientDetail\",\n" + |
| | | // " \"component\": \"/crmSystem/patientManagement/detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"患者详情\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem/chronicDiseasePatientManagement\",\n" + |
| | | // " \"component\": \"crmSystem/chronicDiseasePatientManagement/index\",\n" + |
| | | // " \"name\": \"ChronicDiseasePatientManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"慢性病患者管理\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:export\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"导出\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:edit\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"用药提醒\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/crmSystem/chronicDiseasePatientManagement/:id\",\n" + |
| | | // " \"name\": \"ChronicDiseasePatientDetail\",\n" + |
| | | // " \"component\": \"/crmSystem/chronicDiseasePatientManagement/detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"慢性病患者详情\",\n" + |
| | | // " \"showLink\": false\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/pointsMallManagement\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"积分商城\",\n" + |
| | | // " \"icon\": \"hugeicons:menu\",\n" + |
| | | // " \"rank\": 6\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/pointsMallManagement/pointsMall\",\n" + |
| | | // " \"component\": \"pointsMallManagement/pointsMall/index\",\n" + |
| | | // " \"name\": \"PointsMall\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"积分商城\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/pointsMallManagement/redemptionRecord\",\n" + |
| | | // " \"component\": \"pointsMallManagement/redemptionRecord/index\",\n" + |
| | | // " \"name\": \"RedemptionRecord\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"兑换记录\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": [\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"\",\n" + |
| | | // " \"component\": \"permission:btn:detail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"详情\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " }\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " },\n" + |
| | | // " {\n" + |
| | | // " \"path\": \"/pointsMallManagement/pointsChangeDetail\",\n" + |
| | | // " \"component\": \"pointsMallManagement/pointsChangeDetail/index\",\n" + |
| | | // " \"name\": \"PointsChangeDetail\",\n" + |
| | | // " \"meta\": {\n" + |
| | | // " \"title\": \"积分变更明细\",\n" + |
| | | // " \"showLink\": true\n" + |
| | | // " },\n" + |
| | | // " \"children\": []\n" + |
| | | // " }\n" + |
| | | // " ]\n" + |
| | | // " }\n" + |
| | | // "]\n"; |
| | | // |
| | | // @Test |
| | | // public void insertMenu(){ |
| | | // JSONArray jsonArray = JSON.parseArray(menuStr); |
| | | // for (int i = 0; i < jsonArray.size(); i++) { |
| | | // JSONObject jsonObject = JSONObject.parseObject(jsonArray.get(i).toString()); |
| | | // String path = jsonObject.getString("path"); |
| | | // JSONObject meta = jsonObject.getJSONObject("meta"); |
| | | // String menu_name = meta.getString("title"); |
| | | // String icon = meta.getString("icon"); |
| | | // Integer order_num = meta.getInteger("rank"); |
| | | // SysMenu sysMenu = new SysMenu(); |
| | | // sysMenu.setParentId(0L); |
| | | // sysMenu.setMenuName(menu_name); |
| | | // sysMenu.setPath(path); |
| | | // sysMenu.setIcon(icon); |
| | | // sysMenu.setOrderNum(order_num); |
| | | // sysMenu.setRoleType(5); |
| | | // sysMenu.setMenuType("M"); |
| | | // sysMenuService.insertMenu(sysMenu); |
| | | // JSONArray children1 = jsonObject.getJSONArray("children"); |
| | | // if(!CollectionUtils.isEmpty(children1)){ |
| | | // for (int j = 0; j < children1.size(); j++) { |
| | | // JSONObject jsonObject1 = JSONObject.parseObject(children1.get(j).toString()); |
| | | // String path1 = jsonObject1.getString("path"); |
| | | // String component = jsonObject1.getString("component"); |
| | | // String name1 = jsonObject1.getString("name"); |
| | | // JSONObject meta1 = jsonObject1.getJSONObject("meta"); |
| | | // String menu_name1 = meta1.getString("title"); |
| | | // Boolean showLink1 = meta1.getBoolean("showLink"); |
| | | // SysMenu sysMenu1 = new SysMenu(); |
| | | // sysMenu1.setParentId(sysMenu.getMenuId()); |
| | | // sysMenu1.setMenuName(menu_name1); |
| | | // sysMenu1.setPath(path1); |
| | | // sysMenu1.setComponent(component); |
| | | // sysMenu1.setRoleType(5); |
| | | // sysMenu1.setMenuType("C"); |
| | | // sysMenu1.setRouterName(name1); |
| | | // if(showLink1){ |
| | | // sysMenu1.setVisible("0"); |
| | | // }else{ |
| | | // sysMenu1.setVisible("1"); |
| | | // } |
| | | // sysMenuService.insertMenu(sysMenu1); |
| | | // JSONArray children2 = jsonObject1.getJSONArray("children"); |
| | | // if(!CollectionUtils.isEmpty(children2)){ |
| | | // for (int k = 0; k < children2.size(); k++) { |
| | | // JSONObject jsonObject2 = JSONObject.parseObject(children2.get(k).toString()); |
| | | // String path2 = jsonObject2.getString("path"); |
| | | // String component2 = jsonObject2.getString("component"); |
| | | // JSONObject meta2 = jsonObject2.getJSONObject("meta"); |
| | | // String title = meta2.getString("title"); |
| | | // String showLink2 = meta2.getString("showLink"); |
| | | // SysMenu sysMenu2 = new SysMenu(); |
| | | // sysMenu2.setParentId(sysMenu1.getMenuId()); |
| | | // sysMenu2.setMenuName(title); |
| | | // sysMenu2.setPath(path2); |
| | | // sysMenu2.setComponent(component2); |
| | | // sysMenu2.setRoleType(5); |
| | | // sysMenu2.setMenuType("F"); |
| | | // sysMenuService.insertMenu(sysMenu2); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private ISysRoleService sysRoleService; |
| | | // @Autowired |
| | | // private SysRoleMenuMapper roleMenuMapper; |
| | | // @Test |
| | | // public void insertRoleMenu(){ |
| | | // |
| | | // List<SysMenu> list = sysMenuService.selectList(); |
| | | // List<SysMenu> platform = list.stream().filter(e -> e.getRoleType().equals(1)).collect(Collectors.toList()); |
| | | // List<SysMenu> supplier = list.stream().filter(e -> e.getRoleType().equals(4)).collect(Collectors.toList()); |
| | | // List<SysMenu> clinic = list.stream().filter(e -> e.getRoleType().equals(5)).collect(Collectors.toList()); |
| | | // |
| | | // List<SysRoleMenu> sysRoleMenus = new ArrayList<>(); |
| | | // for (SysMenu sysMenu : platform) { |
| | | // SysRoleMenu sysRoleMenu = new SysRoleMenu(); |
| | | // sysRoleMenu.setRoleId(1L); |
| | | // sysRoleMenu.setMenuId(sysMenu.getMenuId()); |
| | | // sysRoleMenus.add(sysRoleMenu); |
| | | // } |
| | | // roleMenuMapper.batchRoleMenu(sysRoleMenus); |
| | | // List<SysRoleMenu> sysRoleMenus1 = new ArrayList<>(); |
| | | // for (SysMenu sysMenu : supplier) { |
| | | // SysRoleMenu sysRoleMenu = new SysRoleMenu(); |
| | | // sysRoleMenu.setRoleId(4L); |
| | | // sysRoleMenu.setMenuId(sysMenu.getMenuId()); |
| | | // sysRoleMenus1.add(sysRoleMenu); |
| | | // } |
| | | // roleMenuMapper.batchRoleMenu(sysRoleMenus1); |
| | | // List<SysRoleMenu> sysRoleMenus2 = new ArrayList<>(); |
| | | // for (SysMenu sysMenu : clinic) { |
| | | // SysRoleMenu sysRoleMenu = new SysRoleMenu(); |
| | | // sysRoleMenu.setRoleId(5L); |
| | | // sysRoleMenu.setMenuId(sysMenu.getMenuId()); |
| | | // sysRoleMenus2.add(sysRoleMenu); |
| | | // } |
| | | // roleMenuMapper.batchRoleMenu(sysRoleMenus2); |
| | | // |
| | | // } |
| | | // |
| | | //} |