已重命名1个文件
已添加18个文件
已修改28个文件
已删除7个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | version: '3.8' |
| | | services: |
| | | # zookeeper |
| | | zookeeper: |
| | | image: zookeeper:3.4.9 |
| | | ports: |
| | | - 2181:2181 |
| | | # - 2888:2888 |
| | | # - 3888:3888 |
| | | volumes: |
| | | - ./zookeeper_data:/data |
| | | environment: |
| | | ZOO_MY_ID: 1 |
| | | ZOO_SERVERS: server.1=0.0.0.0:2888:3888 |
| | | networks: |
| | | - kafka_net |
| | | #kafka |
| | | kafka: |
| | | image: bitnami/kafka:3.4 |
| | | depends_on: |
| | | - zookeeper |
| | | ports: |
| | | - 9092:9092 |
| | | environment: |
| | | KAFKA_BROKER_ID: 1 |
| | | ALLOW_PLAINTEXT_LISTENER: "yes" |
| | | KAFKA_CFG_LISTENERS: PLAINTEXT://:9092 |
| | | KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 |
| | | KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://192.168.11.203:9092 |
| | | #KKAFKA_LISTENERS: PLAINTEXT://:9092 |
| | | #AFKA_ADVERTISED_LISTENERS: PLAINTEXT://192.168.11.203:9092 |
| | | #KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 |
| | | #KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' |
| | | volumes: |
| | | - ./kafka_data:/bitnami/kafka |
| | | # å°å®¿ä¸»æºçDocker奿¥åæä»¶æè½½å°å®¹å¨å
é¨ |
| | | - /var/run/docker.sock:/var/run/docker.sock |
| | | networks: |
| | | - kafka_net |
| | | # kafka-ui |
| | | kafka-ui: |
| | | image: provectuslabs/kafka-ui |
| | | depends_on: |
| | | - kafka |
| | | ports: |
| | | - 8081:8080 |
| | | environment: |
| | | DYNAMIC_CONFIG_ENABLED: true |
| | | #KAFKA_CLUSTERS_0_NAME: local |
| | | #KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092 |
| | | networks: |
| | | - kafka_net |
| | | networks: |
| | | kafka_net: |
| | | driver: bridge |
| | |
| | | <tobato.version>1.27.2</tobato.version> |
| | | <kaptcha.version>2.3.3</kaptcha.version> |
| | | <pagehelper.boot.version>2.0.0</pagehelper.boot.version> |
| | | <!-- <druid.version>1.2.23</druid.version>--> |
| | | <druid.version>1.2.25</druid.version> |
| | | <dynamic-ds.version>4.3.1</dynamic-ds.version> |
| | | <commons.io.version>2.19.0</commons.io.version> |
| | | <velocity.version>2.3</velocity.version> |
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-thymeleaf</artifactId> |
| | | <!-- <version>2.2.2.RELEASE</version>--> |
| | | <!--<version>2.2.2.RELEASE</version>--> |
| | | </dependency> |
| | | |
| | | <!--lombok--> |
| | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid</artifactId> |
| | | <version>1.1.22</version> |
| | | <version>1.2.25</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>1.1.22</version> |
| | | <version>1.2.25</version> |
| | | </dependency> |
| | | |
| | | <!--text--> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.config; |
| | | |
| | | import com.alibaba.druid.support.http.StatViewServlet; |
| | | import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | public class DruidConfig { |
| | | @Bean |
| | | public ServletRegistrationBean druidServlet() { |
| | | ServletRegistrationBean bean = new ServletRegistrationBean(); |
| | | bean.setServlet(new StatViewServlet()); |
| | | bean.addUrlMappings("/druid/*"); |
| | | Map<String, String> initParameters = new HashMap<>(); |
| | | //initParameters.put("resetEnable", "false"); //ç¦ç¨HTML页é¢ä¸çâRest Allâåè½ |
| | | //initParameters.put("allow", "127.0.0.1"); //ipç½ååï¼æ²¡æé
ç½®æè
为空ï¼åå
许ææè®¿é®ï¼ |
| | | //initParameters.put("loginUsername", "admin"); //++çæ§é¡µé¢ç»å½ç¨æ·å |
| | | //initParameters.put("loginPassword", "admin"); //++çæ§é¡µé¢ç»å½ç¨æ·å¯ç |
| | | //initParameters.put("deny", ""); //ipé»åå |
| | | |
| | | bean.setInitParameters(initParameters); |
| | | |
| | | return bean; |
| | | } |
| | | } |
| | |
| | | public void run(ApplicationArguments args) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | //String enable1 = env.getProperty("spring.datasource.druid.stat-view-servlet.enabled"); |
| | | //String enable2 = env.getProperty("spring.datasource.druid.web-stat-filter.enabled"); |
| | | //String filters = env.getProperty("spring.datasource.druid.filters"); |
| | | //String pattern = env.getProperty("spring.datasource.druid.stat-view-servlet.url-pattern"); |
| | | |
| | | GdalHelper.init(env.getProperty("sys.gdal_path")); |
| | | UploadAttachService.init(env.getProperty("sys.attachTabs")); |
| | | |
| | |
| | | protected void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/druid/**").addResourceLocations("classpath:/META-INF/resources/druid/"); |
| | | registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); |
| | | super.addResourceHandlers(registry); |
| | | } |
| | |
| | | import com.terra.system.entity.all.*; |
| | | import com.terra.system.entity.data.LayerEntity; |
| | | import com.terra.system.entity.sys.MenuEntity; |
| | | import com.terra.system.entity.sys.ResEntity; |
| | | import com.terra.system.entity.sys.UserEntity; |
| | | import com.terra.system.service.all.PermsService; |
| | | import com.terra.system.service.data.LayerService; |
| | |
| | | LayerService layerService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çèµæºææ") |
| | | @GetMapping(value = "/selectRes") |
| | | public ResponseMsg<List<ResAuthEntity>> selectRes(HttpServletRequest req) { |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çå¾å±ææ") |
| | | @GetMapping(value = "/selectLayers") |
| | | public ResponseMsg<Object> selectLayers(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | |
| | | } |
| | | |
| | | String uid = StaticData.ADMIN.equals(ue.getUid()) ? null : ue.getUid(); |
| | | List<ResAuthEntity> rs = permsService.selectRes(uid); |
| | | List<LayerEntity> rs = layerService.selectLayers(uid); |
| | | |
| | | return success(rs); |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çæå½±å¾å±ææ") |
| | | @GetMapping(value = "/selectProjectLayers") |
| | | public ResponseMsg<Object> selectProjectLayers(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | String uid = StaticData.ADMIN.equals(ue.getUid()) ? null : ue.getUid(); |
| | | List<LayerEntity> rs = layerService.selectProjectLayers(uid); |
| | | |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çèµæºææ") |
| | | @GetMapping(value = "/selectRes") |
| | | public ResponseMsg<Object> selectRes(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | String uid = StaticData.ADMIN.equals(ue.getUid()) ? null : ue.getUid(); |
| | | List<ResEntity> rs = permsService.selectRes(uid); |
| | | |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¸
ç©ºææææç¼å") |
| | | @ApiOperation(value = "æ¸
空ææç¼å") |
| | | @GetMapping(value = "/deletePermsCache") |
| | | public ResponseMsg<Boolean> deletePermsCache() { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | |
| | | return success(true); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¸
空ææç¼å") |
| | | @GetMapping(value = "/deleteAllCache") |
| | | public ResponseMsg<Boolean> deleteAllCache() { |
| | | try { |
| | |
| | | |
| | | String uid = StaticData.ADMIN.equals(ue.getUid()) ? null : ue.getUid(); |
| | | List<MenuEntity> list = permsService.selectMenuRecursive(id, uid); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææå¾å±") |
| | | @GetMapping(value = "/selectLayers") |
| | | public ResponseMsg<Object> selectLayers(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<LayerEntity> list = layerService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
ÎļþÃû´Ó se-system/src/main/java/com/terra/system/controller/data/LayerController.java ÐÞ¸Ä |
| | |
| | | package com.terra.system.controller.data; |
| | | package com.terra.system.controller.sys; |
| | | |
| | | import com.terra.system.annotation.SysLog; |
| | | import com.terra.system.controller.all.BaseController; |
| | | import com.terra.system.entity.all.ResponseMsg; |
| | | import com.terra.system.entity.data.LayerEntity; |
| | | import com.terra.system.entity.sys.LayerEntity; |
| | | import com.terra.system.entity.sys.UserEntity; |
| | | import com.terra.system.service.data.LayerService; |
| | | import com.terra.system.service.all.PermsService; |
| | | import com.terra.system.service.sys.LayerService; |
| | | import com.terra.system.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¾å±ç®¡ç |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\å¾å±ç®¡ç") |
| | | @Api(tags = "è¿ç»´ç®¡ç\\å¾å±ç®¡ç") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/layer") |
| | | public class LayerController extends BaseController { |
| | | @Resource |
| | | @Autowired |
| | | LayerService layerService; |
| | | |
| | | @Resource |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cnName", value = "䏿åç§°", dataType = "String", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String cnName) { |
| | | try { |
| | | int count = layerService.selectCount(cnName); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cnName", value = "䏿åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<LayerEntity>> selectByPage(String cnName, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<LayerEntity> rs = layerService.selectByPage(cnName, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "cnName", value = "䏿åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<LayerEntity>> selectByPageAndCount(String cnName, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<LayerEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = layerService.selectCount(cnName); |
| | | int count = layerService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<LayerEntity> rs = layerService.selectByPage(cnName, pageSize, pageSize * (pageIndex - 1)); |
| | | List<LayerEntity> rs = layerService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<LayerEntity>> selectAll() { |
| | | public ResponseMsg<List<LayerEntity>> selectAll(Integer flag) { |
| | | try { |
| | | List<LayerEntity> list = layerService.selectAll(); |
| | | List<LayerEntity> list = layerService.selectAll(flag); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = layerService.insert(entity); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = layerService.inserts(list); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | int count = layerService.delete(id); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = layerService.deletes(ids); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = layerService.update(entity); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = layerService.updates(list); |
| | | if (count > 0) { |
| | | layerService.clearCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | import com.terra.system.entity.all.ResponseMsg; |
| | | import com.terra.system.entity.sys.ResEntity; |
| | | import com.terra.system.entity.sys.UserEntity; |
| | | import com.terra.system.helper.StringHelper; |
| | | import com.terra.system.service.all.PermsService; |
| | | import com.terra.system.service.all.UploadAttachService; |
| | | import com.terra.system.service.data.DownloadService; |
| | | import com.terra.system.service.sys.ResService; |
| | | import com.terra.system.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | PermsService permsService; |
| | | |
| | | @Resource |
| | | DownloadService downloadService; |
| | | |
| | | @Resource |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | private final static String TAB_NAME = "lf.sys_res"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", required = false, example = "sys_res") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name) { |
| | | try { |
| | | int count = resService.selectCount(name); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "sys_res"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<ResEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<ResEntity> rs = resService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "sys_res"), |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "status", value = "ç¶æ", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "category", value = "æå¡ç±»å«", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "type", value = "æå¡ç±»å", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "data", value = "æ°æ®ç±»å", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<ResEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | public ResponseMsg<List<ResEntity>> selectByPageAndCount(String name, Integer status, Integer category, Integer type, Integer data, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = resService.selectCount(name); |
| | | int count = resService.selectCount(name, status, category, type, data); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<ResEntity> rs = resService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | List<ResEntity> rs = resService.selectByPage(name, status, category, type, data, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<ResEntity>> selectAll() { |
| | | try { |
| | | List<ResEntity> list = resService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<ResEntity> selectById(int id) { |
| | | try { |
| | | ResEntity entity = resService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.terra.system.entity.sys.ResEntity", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ResEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertRes", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRes(@RequestBody ResEntity entity, HttpServletRequest req) { |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody ResEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | entity.setDepid(ue.getDepcode()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = resService.insertRes(entity); |
| | | int count = resService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<ResEntity>", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ResEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertRess", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRess(@RequestBody List<ResEntity> list, HttpServletRequest req) { |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<ResEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ResEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | entity.setDepid(ue.getDepcode()); |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = resService.insertRess(list); |
| | | int count = resService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteRes") |
| | | public ResponseMsg<Integer> deleteRes(int id) { |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | int count = resService.deleteRes(id); |
| | | int count = resService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteRess") |
| | | public ResponseMsg<Integer> deleteRess(@RequestParam List<Integer> ids) { |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = resService.deleteRess(ids); |
| | | String strs = StringHelper.join(ids, ","); |
| | | int count = resService.deletes(strs); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ResEntity", paramType = "body", example = "") |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ResEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateRes", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateRes(@RequestBody ResEntity entity, HttpServletRequest req) { |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody ResEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | entity.setDepid(ue.getDepcode()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = resService.updateRes(entity); |
| | | int count = resService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ResEntity", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/selectRes") |
| | | public ResponseMsg<ResEntity> selectRes(int id) { |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<ResEntity> list, HttpServletRequest req) { |
| | | try { |
| | | ResEntity resEntity = resService.selectRes(id); |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ResEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | entity.setDepid(ue.getDepcode()); |
| | | } |
| | | } |
| | | |
| | | return success(resEntity); |
| | | permsService.clearPermsCache(); |
| | | int count = resService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectResAll") |
| | | public ResponseMsg<List<ResEntity>> selectResAll() { |
| | | try { |
| | | List<ResEntity> list = resService.selectResAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.controller.sys; |
| | | |
| | | import com.terra.system.annotation.SysLog; |
| | | import com.terra.system.controller.all.BaseController; |
| | | import com.terra.system.entity.all.ResponseMsg; |
| | | import com.terra.system.entity.sys.ResLogEntity; |
| | | import com.terra.system.entity.sys.UserEntity; |
| | | import com.terra.system.service.sys.ResLogService; |
| | | import com.terra.system.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "è¿ç»´ç®¡ç\\èµæºæ¥å¿") |
| | | @RestController |
| | | @RequestMapping("/resLog") |
| | | public class ResLogController extends BaseController { |
| | | @Autowired |
| | | ResLogService resLogService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "resid", value = "èµæºID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer resid) { |
| | | try { |
| | | int count = resLogService.selectCount(resid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "resid", value = "èµæºID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<ResLogEntity>> selectByPage(Integer resid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<ResLogEntity> rs = resLogService.selectByPage(resid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "resid", value = "èµæºID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<ResLogEntity>> selectByPageAndCount(Integer resid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = resLogService.selectCount(resid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ResLogEntity> rs = resLogService.selectByPage(resid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<ResLogEntity> selectById(int id) { |
| | | try { |
| | | ResLogEntity entity = resLogService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | int count = resLogService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = resLogService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
| | |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.insertRole(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.insertRoles(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | @GetMapping(value = "/deleteRole") |
| | | public ResponseMsg<Integer> deleteRole(int id) { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.deleteRole(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.deleteRoles(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleService.updateRole(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.controller.sys; |
| | | |
| | | import com.terra.system.annotation.SysLog; |
| | | import com.terra.system.controller.all.BaseController; |
| | | import com.terra.system.entity.all.ResponseMsg; |
| | | import com.terra.system.entity.sys.RoleLayerEntity; |
| | | import com.terra.system.entity.sys.RoleResEntity; |
| | | import com.terra.system.entity.sys.UserEntity; |
| | | import com.terra.system.service.all.PermsService; |
| | | import com.terra.system.service.sys.RoleLayerService; |
| | | import com.terra.system.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "è¿ç»´ç®¡ç\\è§è²å¾å±") |
| | | @RestController |
| | | @RequestMapping("/roleLayer") |
| | | public class RoleLayerController extends BaseController { |
| | | @Autowired |
| | | RoleLayerService roleLayerService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²IDæ¥è¯¢å¾å±") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectResByRole") |
| | | public ResponseMsg<Object> selectLayersByRole(Integer roleid) { |
| | | try { |
| | | List<RoleLayerEntity> rs = roleLayerService.selectLayersByRole(roleid); |
| | | |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<RoleLayerEntity>> selectByPageAndCount(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = roleLayerService.selectCount(roleid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<RoleLayerEntity> rs = roleLayerService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<RoleLayerEntity> selectById(int id) { |
| | | try { |
| | | RoleLayerEntity entity = roleLayerService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleLayerEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody RoleLayerEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleLayerService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleLayerEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<RoleLayerEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleLayerEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleLayerService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | | try { |
| | | permsService.clearPermsCache(); |
| | | int count = roleLayerService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleLayerService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleLayerEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody RoleLayerEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleLayerService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleLayerEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<RoleLayerEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleLayerEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | permsService.clearPermsCache(); |
| | | int count = roleLayerService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
| | |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiOperation(value = "æ ¹æ®è§è²IDæ¥è¯¢èµæº") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer roleid) { |
| | | @GetMapping(value = "/selectResByRole") |
| | | public ResponseMsg<List<RoleResEntity>> selectResByRole(Integer roleid) { |
| | | try { |
| | | int count = roleResService.selectCount(roleid); |
| | | List<RoleResEntity> rs = roleResService.selectResByRole(roleid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<RoleResEntity>> selectByPage(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<RoleResEntity> rs = roleResService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | return success(null == rs ? 0 : rs.size(), rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = roleResService.selectCount(roleid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | |
| | | List<RoleResEntity> rs = roleResService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<RoleResEntity>> selectAll() { |
| | | try { |
| | | List<RoleResEntity> list = roleResService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | |
| | | return "perms:layer:" + key; |
| | | } |
| | | |
| | | public static String permsProjectLayerKey(String key) { |
| | | return "perms:projectLayer:" + key; |
| | | } |
| | | |
| | | /** |
| | | * èåææé® |
| | | */ |
| | |
| | | |
| | | private String url; |
| | | |
| | | private String testUrl; |
| | | private int isLayer; |
| | | |
| | | private int type; |
| | | private int isShow; |
| | | |
| | | private String icon; |
| | | |
| | |
| | | |
| | | private int orderNum; |
| | | |
| | | private int isShow; |
| | | private int status; |
| | | |
| | | private int data; |
| | | |
| | | private String tab; |
| | | |
| | | private int createUser; |
| | | |
| | |
| | | |
| | | private String bak; |
| | | |
| | | private String serveType; |
| | | |
| | | private String dataType; |
| | | |
| | | private double elev; |
| | | |
| | | private String ns; |
| | | private int resid; |
| | | |
| | | private int type; |
| | | |
| | | private String proxy; |
| | | |
| | | private int category; |
| | | |
| | | private int flag; |
| | | |
| | | private Integer pubid; |
| | | |
| | | private Integer isProject; |
| | | |
| | | private String json; |
| | | private String unit; |
| | | |
| | | public LayerEntity() { |
| | | } |
| | |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getTestUrl() { |
| | | return testUrl; |
| | | public int getIsLayer() { |
| | | return isLayer; |
| | | } |
| | | |
| | | public void setTestUrl(String testUrl) { |
| | | this.testUrl = testUrl; |
| | | public void setIsLayer(int isLayer) { |
| | | this.isLayer = isLayer; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | public int getIsShow() { |
| | | return isShow; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | public void setIsShow(int isShow) { |
| | | this.isShow = isShow; |
| | | } |
| | | |
| | | public String getIcon() { |
| | |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public int getIsShow() { |
| | | return isShow; |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setIsShow(int isShow) { |
| | | this.isShow = isShow; |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(int data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getServeType() { |
| | | return serveType; |
| | | } |
| | | |
| | | public void setServeType(String serveType) { |
| | | this.serveType = serveType; |
| | | } |
| | | |
| | | public String getDataType() { |
| | | return dataType; |
| | | } |
| | | |
| | | public void setDataType(String dataType) { |
| | | this.dataType = dataType; |
| | | } |
| | | |
| | | public double getElev() { |
| | | return elev; |
| | | } |
| | |
| | | this.elev = elev; |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | public int getResid() { |
| | | return resid; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | public void setResid(int resid) { |
| | | this.resid = resid; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getProxy() { |
| | | return proxy; |
| | | } |
| | | |
| | | public void setProxy(String proxy) { |
| | | this.proxy = proxy; |
| | | } |
| | | |
| | | public int getCategory() { |
| | | return category; |
| | | } |
| | | |
| | | public void setCategory(int category) { |
| | | this.category = category; |
| | | } |
| | | |
| | | public int getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(int flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Integer getPubid() { |
| | |
| | | this.pubid = pubid; |
| | | } |
| | | |
| | | public Integer getIsProject() { |
| | | return isProject; |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setIsProject(Integer isProject) { |
| | | this.isProject = isProject; |
| | | } |
| | | |
| | | public String getJson() { |
| | | return json; |
| | | } |
| | | |
| | | public void setJson(String json) { |
| | | this.json = json; |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.entity.sys; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class LayerEntity implements Serializable { |
| | | private static final long serialVersionUID = -371902381708800000L; |
| | | |
| | | private int id; |
| | | |
| | | private int pid; |
| | | |
| | | private String cnName; |
| | | |
| | | private String enName; |
| | | |
| | | private String url; |
| | | |
| | | private int isLayer; |
| | | |
| | | private int isShow; |
| | | |
| | | private String icon; |
| | | |
| | | private int level; |
| | | |
| | | private int orderNum; |
| | | |
| | | private int status; |
| | | |
| | | private int data; |
| | | |
| | | private String tab; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | private double elev; |
| | | |
| | | private int resid; |
| | | |
| | | private int type; |
| | | |
| | | private String proxy; |
| | | |
| | | private int category; |
| | | |
| | | private int flag; |
| | | |
| | | private Integer pubid; |
| | | |
| | | private String unit; |
| | | |
| | | public LayerEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setPid(int pid) { |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public String getCnName() { |
| | | return cnName; |
| | | } |
| | | |
| | | public void setCnName(String cnName) { |
| | | this.cnName = cnName; |
| | | } |
| | | |
| | | public String getEnName() { |
| | | return enName; |
| | | } |
| | | |
| | | public void setEnName(String enName) { |
| | | this.enName = enName; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getIsLayer() { |
| | | return isLayer; |
| | | } |
| | | |
| | | public void setIsLayer(int isLayer) { |
| | | this.isLayer = isLayer; |
| | | } |
| | | |
| | | public int getIsShow() { |
| | | return isShow; |
| | | } |
| | | |
| | | public void setIsShow(int isShow) { |
| | | this.isShow = isShow; |
| | | } |
| | | |
| | | public String getIcon() { |
| | | return icon; |
| | | } |
| | | |
| | | public void setIcon(String icon) { |
| | | this.icon = icon; |
| | | } |
| | | |
| | | public int getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(int level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public int getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(int orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(int data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(int createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public double getElev() { |
| | | return elev; |
| | | } |
| | | |
| | | public void setElev(double elev) { |
| | | this.elev = elev; |
| | | } |
| | | |
| | | public int getResid() { |
| | | return resid; |
| | | } |
| | | |
| | | public void setResid(int resid) { |
| | | this.resid = resid; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getProxy() { |
| | | return proxy; |
| | | } |
| | | |
| | | public void setProxy(String proxy) { |
| | | this.proxy = proxy; |
| | | } |
| | | |
| | | public int getCategory() { |
| | | return category; |
| | | } |
| | | |
| | | public void setCategory(int category) { |
| | | this.category = category; |
| | | } |
| | | |
| | | public int getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(int flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Integer getPubid() { |
| | | return pubid; |
| | | } |
| | | |
| | | public void setPubid(Integer pubid) { |
| | | this.pubid = pubid; |
| | | } |
| | | |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ResEntity implements Serializable { |
| | | private static final long serialVersionUID = 9047079519693255710L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | private String cnName; |
| | | |
| | | private String server; |
| | | private String enName; |
| | | |
| | | private String source; |
| | | private int status; |
| | | |
| | | private int depid; |
| | | private int type; |
| | | |
| | | private String depName; |
| | | private int data; |
| | | |
| | | private int dirid; |
| | | private int category; |
| | | |
| | | private String dirName; |
| | | private String url; |
| | | |
| | | private String code; |
| | | private String test; |
| | | |
| | | private String proxy; |
| | | |
| | | private String descr; |
| | | |
| | | private String depid; |
| | | |
| | | private String dirid; |
| | | |
| | | private String img; |
| | | |
| | | private int createUser; |
| | | |
| | | private String createName; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private String updateName; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | private String tab; |
| | | |
| | | private String args; |
| | | |
| | | private String fileGuid; |
| | | private String createName; |
| | | |
| | | private String updateName; |
| | | |
| | | private Integer pubid; |
| | | |
| | | public ResEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | public String getCnName() { |
| | | return cnName; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | public void setCnName(String cnName) { |
| | | this.cnName = cnName; |
| | | } |
| | | |
| | | public String getServer() { |
| | | return server; |
| | | public String getEnName() { |
| | | return enName; |
| | | } |
| | | |
| | | public void setServer(String server) { |
| | | this.server = server; |
| | | public void setEnName(String enName) { |
| | | this.enName = enName; |
| | | } |
| | | |
| | | public String getSource() { |
| | | return source; |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setSource(String source) { |
| | | this.source = source; |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | public int getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | public void setData(int data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public int getDirid() { |
| | | return dirid; |
| | | public int getCategory() { |
| | | return category; |
| | | } |
| | | |
| | | public void setDirid(int dirid) { |
| | | this.dirid = dirid; |
| | | public void setCategory(int category) { |
| | | this.category = category; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | public String getTest() { |
| | | return test; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | public void setTest(String test) { |
| | | this.test = test; |
| | | } |
| | | |
| | | public String getProxy() { |
| | | return proxy; |
| | | } |
| | | |
| | | public void setProxy(String proxy) { |
| | | this.proxy = proxy; |
| | | } |
| | | |
| | | public String getDescr() { |
| | |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(String depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public String getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(String dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public String getImg() { |
| | |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public String getCreateName() { |
| | | return createName; |
| | | } |
| | | |
| | | public void setCreateName(String createName) { |
| | | this.createName = createName; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public String getUpdateName() { |
| | | return updateName; |
| | | } |
| | | |
| | | public void setUpdateName(String updateName) { |
| | | this.updateName = updateName; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getFileGuid() { |
| | | return fileGuid; |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setFileGuid(String fileGuid) { |
| | | this.fileGuid = fileGuid; |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getArgs() { |
| | | return args; |
| | | } |
| | | |
| | | public void setArgs(String args) { |
| | | this.args = args; |
| | | } |
| | | |
| | | public String getCreateName() { |
| | | return createName; |
| | | } |
| | | |
| | | public void setCreateName(String createName) { |
| | | this.createName = createName; |
| | | } |
| | | |
| | | public String getUpdateName() { |
| | | return updateName; |
| | | } |
| | | |
| | | public void setUpdateName(String updateName) { |
| | | this.updateName = updateName; |
| | | } |
| | | |
| | | public Integer getPubid() { |
| | | return pubid; |
| | | } |
| | | |
| | | public void setPubid(Integer pubid) { |
| | | this.pubid = pubid; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.entity.sys; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class ResLogEntity implements Serializable { |
| | | private static final long serialVersionUID = -766548673513600896L; |
| | | |
| | | private long id; |
| | | |
| | | private int resid; |
| | | |
| | | private int type; |
| | | |
| | | private String ip; |
| | | |
| | | private String url; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | public ResLogEntity() { |
| | | } |
| | | |
| | | public long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getResid() { |
| | | return resid; |
| | | } |
| | | |
| | | public void setResid(int resid) { |
| | | this.resid = resid; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getIp() { |
| | | return ip; |
| | | } |
| | | |
| | | public void setIp(String ip) { |
| | | this.ip = ip; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(int createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.entity.sys; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class RoleLayerEntity implements Serializable { |
| | | private static final long serialVersionUID = -773018130926889472L; |
| | | |
| | | private Integer id; |
| | | |
| | | private int roleid; |
| | | |
| | | private int layerid; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String cnName; |
| | | |
| | | private String enName; |
| | | |
| | | private Integer isLayer; |
| | | |
| | | private Integer pid; |
| | | |
| | | private Integer level; |
| | | |
| | | private Integer orderNum; |
| | | |
| | | public RoleLayerEntity() { |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getRoleid() { |
| | | return roleid; |
| | | } |
| | | |
| | | public void setRoleid(int roleid) { |
| | | this.roleid = roleid; |
| | | } |
| | | |
| | | public int getLayerid() { |
| | | return layerid; |
| | | } |
| | | |
| | | public void setLayerid(int layerid) { |
| | | this.layerid = layerid; |
| | | } |
| | | |
| | | public int getCreateUser() { |
| | | return createUser; |
| | | } |
| | | |
| | | public void setCreateUser(int createUser) { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public int getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(int updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public String getCnName() { |
| | | return cnName; |
| | | } |
| | | |
| | | public void setCnName(String cnName) { |
| | | this.cnName = cnName; |
| | | } |
| | | |
| | | public String getEnName() { |
| | | return enName; |
| | | } |
| | | |
| | | public void setEnName(String enName) { |
| | | this.enName = enName; |
| | | } |
| | | |
| | | public Integer getIsLayer() { |
| | | return isLayer; |
| | | } |
| | | |
| | | public void setIsLayer(Integer isLayer) { |
| | | this.isLayer = isLayer; |
| | | } |
| | | |
| | | public Integer getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setPid(Integer pid) { |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public Integer getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public Integer getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.terra.system.entity.all.MenusAuthEntity; |
| | | import com.terra.system.entity.all.PermsAuthEntity; |
| | | import com.terra.system.entity.all.ResAuthEntity; |
| | | import com.terra.system.entity.sys.MenuEntity; |
| | | import com.terra.system.entity.sys.ResEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | @Mapper |
| | | @Repository |
| | | public interface PermsMapper { |
| | | /** |
| | | * æ ¹æ®ç¨æ·Uidæ¥è¯¢èµæºææ |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public List<ResAuthEntity> selectRes(String uid); |
| | | public List<ResEntity> selectRes(String uid); |
| | | |
| | | public List<ResEntity> selectAllRes(); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·Uidæ¥è¯¢èåææ |
| | |
| | | @Mapper |
| | | @Repository |
| | | public interface LayerMapper { |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param cnName 䏿åç§° |
| | | * @return è®°å½æ° |
| | | */ |
| | | public Integer selectCount(String cnName); |
| | | public List<LayerEntity> selectLayers(String uid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param cnName 䏿åç§° |
| | | * @param limit è®°å½æ° |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<LayerEntity> selectByPage(String cnName, Integer limit, Integer offset); |
| | | public List<LayerEntity> selectProjectLayers(String uid); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<LayerEntity> selectAll(); |
| | | public Integer selectCount(String name); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset); |
| | | |
| | | public List<LayerEntity> selectAll(Integer flag); |
| | | |
| | | public LayerEntity selectById(int id); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer selectIdByName(String name); |
| | | |
| | | public Integer selectMaxOrderNumByPid(Integer pid); |
| | | |
| | | public LayerEntity selectByResId(Integer resid); |
| | | |
| | | public Integer insert(LayerEntity entity); |
| | | |
| | | /** |
| | | * æå
¥å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer inserts(List<LayerEntity> list); |
| | | |
| | | /** |
| | | * å é¤ä¸æ¡ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer delete(int id); |
| | | |
| | | /** |
| | | * å é¤å¤æ¡ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer update(LayerEntity entity); |
| | | |
| | | /** |
| | | * æ´æ°å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer updates(List<LayerEntity> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.mapper.sys; |
| | | |
| | | import com.terra.system.entity.sys.LayerEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | @SuppressWarnings("ALL") |
| | | public interface LayerMapper { |
| | | public List<LayerEntity> selectLayers(String uid); |
| | | |
| | | public List<LayerEntity> selectProjectLayers(String uid); |
| | | |
| | | public Integer selectCount(String name); |
| | | |
| | | public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset); |
| | | |
| | | public List<LayerEntity> selectAll(Integer flag); |
| | | |
| | | public LayerEntity selectById(int id); |
| | | |
| | | public Integer selectIdByName(String name); |
| | | |
| | | public Integer selectMaxOrderNumByPid(Integer pid); |
| | | |
| | | public LayerEntity selectByResId(Integer resid); |
| | | |
| | | public Integer insert(LayerEntity entity); |
| | | |
| | | public Integer inserts(List<LayerEntity> list); |
| | | |
| | | public Integer delete(int id); |
| | | |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | public Integer update(LayerEntity entity); |
| | | |
| | | public Integer updates(List<LayerEntity> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.mapper.sys; |
| | | |
| | | import com.terra.system.entity.sys.ResLogEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | @SuppressWarnings("ALL") |
| | | public interface ResLogMapper { |
| | | public Integer selectCount(Integer resid); |
| | | |
| | | public List<ResLogEntity> selectByPage(Integer resid, Integer limit, Integer offset); |
| | | |
| | | public List<ResLogEntity> selectAll(); |
| | | |
| | | public ResLogEntity selectById(int id); |
| | | |
| | | public Integer insert(ResLogEntity entity); |
| | | |
| | | public Integer inserts(List<ResLogEntity> list); |
| | | |
| | | public Integer delete(int id); |
| | | |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | public Integer update(ResLogEntity entity); |
| | | |
| | | public Integer updates(List<ResLogEntity> list); |
| | | } |
| | |
| | | */ |
| | | @Mapper |
| | | @ResponseBody |
| | | @SuppressWarnings("ALL") |
| | | public interface ResMapper { |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param name 表å |
| | | * @return è®°å½æ° |
| | | */ |
| | | public Integer selectCount(String name); |
| | | public Integer selectCount(String name, Integer status, Integer category, Integer type, Integer data); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param name 表å |
| | | * @param limit è®°å½æ° |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<ResEntity> selectByPage(String name, Integer limit, Integer offset); |
| | | public List<ResEntity> selectByPage(String name, Integer status, Integer category, Integer type, Integer data, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param roleid |
| | | * @return |
| | | */ |
| | | public List<ResEntity> selectAll(); |
| | | |
| | | public ResEntity selectById(int id); |
| | | |
| | | public ResEntity selectByPubid(Integer pubid); |
| | | |
| | | public Integer selectCountForRole(Integer roleid); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²å页æ¥è¯¢ |
| | | * |
| | | * @param roleid |
| | | * @param limit |
| | | * @param offset |
| | | * @return |
| | | */ |
| | | public List<ResEntity> selectByPageForRole(Integer roleid, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | | * |
| | | * @param resEntity |
| | | * @return |
| | | */ |
| | | public Integer insertRes(ResEntity resEntity); |
| | | public Integer insert(ResEntity entity); |
| | | |
| | | /** |
| | | * æå
¥å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer insertRess(List<ResEntity> list); |
| | | public Integer inserts(List<ResEntity> list); |
| | | |
| | | /** |
| | | * å é¤ä¸æ¡ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer deleteRes(int id); |
| | | public Integer delete(int id); |
| | | |
| | | /** |
| | | * å é¤å¤æ¡ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deleteRess(List<Integer> ids); |
| | | public Integer deletes(String ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
| | | * |
| | | * @param resEntity |
| | | * @return |
| | | */ |
| | | public Integer updateRes(ResEntity resEntity); |
| | | public Integer update(ResEntity entity); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public ResEntity selectRes(int id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<ResEntity> selectResAll(); |
| | | |
| | | |
| | | |
| | | public Integer updates(List<ResEntity> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.mapper.sys; |
| | | |
| | | import com.terra.system.entity.sys.RoleLayerEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | @SuppressWarnings("ALL") |
| | | public interface RoleLayerMapper { |
| | | public List<RoleLayerEntity> selectLayersByRole(Integer roleid); |
| | | |
| | | public Integer selectCount(Integer roleid); |
| | | |
| | | public List<RoleLayerEntity> selectByPage(Integer roleid, Integer limit, Integer offset); |
| | | |
| | | public List<RoleLayerEntity> selectAll(); |
| | | |
| | | public RoleLayerEntity selectById(int id); |
| | | |
| | | public Integer insert(RoleLayerEntity entity); |
| | | |
| | | public Integer inserts(List<RoleLayerEntity> list); |
| | | |
| | | public Integer delete(int id); |
| | | |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | public Integer update(RoleLayerEntity entity); |
| | | |
| | | public Integer updates(List<RoleLayerEntity> list); |
| | | } |
| | |
| | | @Mapper |
| | | @Repository |
| | | public interface RoleResMapper { |
| | | /** |
| | | * æ¥è¯¢è®°å½æ° |
| | | * |
| | | * @param roleid è§è²ID |
| | | * @return è®°å½æ° |
| | | */ |
| | | public List<RoleResEntity> selectResByRole(Integer roleid); |
| | | |
| | | public Integer selectCount(Integer roleid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param roleid è§è²ID |
| | | * @param limit è®°å½æ° |
| | | * @param offset åç§»é |
| | | * @return å表 |
| | | */ |
| | | public List<RoleResEntity> selectByPage(Integer roleid, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ |
| | | * |
| | | * @return |
| | | */ |
| | | public List<RoleResEntity> selectAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public RoleResEntity selectById(int id); |
| | | |
| | | /** |
| | | * æå
¥ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer insert(RoleResEntity entity); |
| | | |
| | | /** |
| | | * æå
¥å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer inserts(List<RoleResEntity> list); |
| | | |
| | | /** |
| | | * å é¤ä¸æ¡ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public Integer delete(int id); |
| | | |
| | | /** |
| | | * å é¤å¤æ¡ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | public Integer deletes(List<Integer> ids); |
| | | |
| | | /** |
| | | * æ´æ°ä¸æ¡ |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer update(RoleResEntity entity); |
| | | |
| | | /** |
| | | * æ´æ°å¤æ¡ |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public Integer updates(List<RoleResEntity> list); |
| | | } |
| | |
| | | |
| | | import com.terra.system.entity.all.*; |
| | | import com.terra.system.entity.sys.MenuEntity; |
| | | import com.terra.system.entity.sys.ResEntity; |
| | | import com.terra.system.mapper.all.PermsMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | RedisService redisService; |
| | | |
| | | @Override |
| | | public List<ResAuthEntity> selectRes(String uid) { |
| | | public List<ResEntity> selectRes(String uid) { |
| | | return selectResByUid(uid, false); |
| | | } |
| | | |
| | | @Override |
| | | public List<ResEntity> selectAllRes() { |
| | | return selectResByUid(StaticData.ADMIN, true); |
| | | } |
| | | |
| | | private List<ResEntity> selectResByUid(String uid, boolean isAll) { |
| | | String key = RedisCacheKey.permsResKey(uid); |
| | | Object obj = redisService.get(key); |
| | | if (obj instanceof List<?>) { |
| | | return (List<ResAuthEntity>) obj; |
| | | return (List<ResEntity>) obj; |
| | | } |
| | | |
| | | List<ResAuthEntity> list = permsMapper.selectRes(uid); |
| | | List<ResEntity> list = isAll ? permsMapper.selectAllRes() : permsMapper.selectRes(uid); |
| | | if (list != null && list.size() > 0) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | |
| | | } |
| | | |
| | | List<MenusAuthEntity> list = permsMapper.selectMenus(uid); |
| | | if (list != null && list.size() > 0) { |
| | | if (list != null && !list.isEmpty()) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | List<String> list = permsMapper.selectPerms(uid); |
| | | if (list != null && list.size() > 0) { |
| | | if (list != null && !list.isEmpty()) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | List<PermsAuthEntity> list = permsMapper.selectPermsEntity(uid); |
| | | if (list != null && list.size() > 0) { |
| | | if (list != null && !list.isEmpty()) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | |
| | | * æ¥è¯¢æå¡èµæºç¶æ |
| | | */ |
| | | public List<ResEntity> selectResStatus() { |
| | | List<ResEntity> resList = resService.selectResAll(); |
| | | List<ResEntity> resList = resService.selectAll(); |
| | | |
| | | return testResStatus(resList); |
| | | } |
| | |
| | | for (ResEntity re : resList) { |
| | | Socket socket = new Socket(); |
| | | try { |
| | | if (StringHelper.isEmpty(re.getServer())) { |
| | | if (StringHelper.isEmpty(re.getUrl())) { |
| | | list.add(re); |
| | | continue; |
| | | } |
| | | |
| | | URI uri = new URI(re.getServer()); |
| | | URI uri = new URI(re.getUrl()); |
| | | SocketAddress add = new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()); |
| | | |
| | | // Pingéå°å |
| | | socket.connect(add, 2000); |
| | | socket.connect(add, 1500); |
| | | } catch (Exception e) { |
| | | // log.error(e.getMessage()) |
| | | list.add(re); |
| | |
| | | * ç»è®¡æå¡èµæºç¶æ |
| | | */ |
| | | public JSONObject countResStatus() { |
| | | List<ResEntity> resList = resService.selectResAll(); |
| | | List<ResEntity> resList = resService.selectAll(); |
| | | List<ResEntity> unableList = testResStatus(resList); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | import com.terra.system.entity.ctrl.CountEntity; |
| | | import com.terra.system.entity.data.MetaEntity; |
| | | import com.terra.system.entity.data.MetaFileEntity; |
| | | import com.terra.system.entity.sys.ResEntity; |
| | | import com.terra.system.helper.*; |
| | | import com.terra.system.service.data.MetaService; |
| | | import com.terra.system.service.data.UploadService; |
| | |
| | | } |
| | | |
| | | public void testPerms() { |
| | | List<ResAuthEntity> raeList = permsService.selectRes("admin"); |
| | | List<ResAuthEntity> raeList2 = permsService.selectRes("admin"); |
| | | List<ResEntity> raeList = permsService.selectRes("admin"); |
| | | List<ResEntity> raeList2 = permsService.selectRes("admin"); |
| | | |
| | | List<MenusAuthEntity> maeList = permsService.selectMenus("admin"); |
| | | List<MenusAuthEntity> maeList2 = permsService.selectMenus("admin"); |
| | |
| | | package com.terra.system.service.data; |
| | | |
| | | import com.terra.system.entity.all.RedisCacheKey; |
| | | import com.terra.system.entity.all.SettingData; |
| | | import com.terra.system.entity.data.LayerEntity; |
| | | import com.terra.system.helper.StringHelper; |
| | | import com.terra.system.mapper.data.LayerMapper; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * å¾å± |
| | |
| | | RedisService redisService; |
| | | |
| | | @Override |
| | | public Integer selectCount(String cnName) { |
| | | cnName = StringHelper.getLikeUpperStr(cnName); |
| | | public List<LayerEntity> selectLayers(String uid) { |
| | | String key = RedisCacheKey.permsLayerKey(uid); |
| | | Object obj = redisService.get(key); |
| | | if (obj instanceof List<?>) { |
| | | return (List<LayerEntity>) obj; |
| | | } |
| | | |
| | | return layerMapper.selectCount(cnName); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectByPage(String cnName, Integer limit, Integer offset) { |
| | | cnName = StringHelper.getLikeUpperStr(cnName); |
| | | |
| | | return layerMapper.selectByPage(cnName, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectAll() { |
| | | String key = RedisCacheKey.permsLayerKey("selectAll"); |
| | | List<LayerEntity> list = redisService.getListByKey(key); |
| | | if (null == list) { |
| | | list = layerMapper.selectAll(); |
| | | redisService.saveListByKey(key, list); |
| | | List<LayerEntity> list = layerMapper.selectLayers(uid); |
| | | if (list != null && list.size() > 0) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * æ¸
é¤ç¼å |
| | | */ |
| | | public void clearCache() { |
| | | redisService.clearKeys(RedisCacheKey.permsLayerKey("")); |
| | | @Override |
| | | public List<LayerEntity> selectProjectLayers(String uid) { |
| | | String key = RedisCacheKey.permsProjectLayerKey(uid); |
| | | Object obj = redisService.get(key); |
| | | if (obj instanceof List<?>) { |
| | | return (List<LayerEntity>) obj; |
| | | } |
| | | |
| | | List<LayerEntity> list = layerMapper.selectProjectLayers(uid); |
| | | if (list != null && list.size() > 0) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCount(String name) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return layerMapper.selectCount(name); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return layerMapper.selectByPage(name, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectAll(Integer flag) { |
| | | return layerMapper.selectAll(flag); |
| | | } |
| | | |
| | | @Override |
| | | public LayerEntity selectById(int id) { |
| | | return layerMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectIdByName(String name) { |
| | | Integer id = layerMapper.selectIdByName(name); |
| | | return null == id ? 0 : id; |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectMaxOrderNumByPid(Integer pid) { |
| | | return layerMapper.selectMaxOrderNumByPid(pid); |
| | | } |
| | | |
| | | @Override |
| | | public LayerEntity selectByResId(Integer resid) { |
| | | return layerMapper.selectByResId(resid); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public Integer updates(List<LayerEntity> list) { |
| | | return layerMapper.updates(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¸
é¤ç¼å |
| | | */ |
| | | public void clearCache() { |
| | | redisService.clearKeys(RedisCacheKey.permsLayerKey("")); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.service.sys; |
| | | |
| | | import com.terra.system.entity.all.RedisCacheKey; |
| | | import com.terra.system.entity.all.SettingData; |
| | | import com.terra.system.entity.sys.LayerEntity; |
| | | import com.terra.system.helper.StringHelper; |
| | | import com.terra.system.mapper.sys.LayerMapper; |
| | | import com.terra.system.service.all.RedisService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service |
| | | @SuppressWarnings("ALL") |
| | | public class LayerService implements LayerMapper { |
| | | @Resource |
| | | LayerMapper layerMapper; |
| | | |
| | | @Resource |
| | | RedisService redisService; |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectLayers(String uid) { |
| | | String key = RedisCacheKey.permsLayerKey(uid); |
| | | Object obj = redisService.get(key); |
| | | if (obj instanceof List<?>) { |
| | | return (List<LayerEntity>) obj; |
| | | } |
| | | |
| | | List<LayerEntity> list = layerMapper.selectLayers(uid); |
| | | if (list != null && list.size() > 0) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectProjectLayers(String uid) { |
| | | String key = RedisCacheKey.permsProjectLayerKey(uid); |
| | | Object obj = redisService.get(key); |
| | | if (obj instanceof List<?>) { |
| | | return (List<LayerEntity>) obj; |
| | | } |
| | | |
| | | List<LayerEntity> list = layerMapper.selectProjectLayers(uid); |
| | | if (list != null && list.size() > 0) { |
| | | redisService.put(key, list, SettingData.CACHE_EXPIRE, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCount(String name) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return layerMapper.selectCount(name); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectByPage(String name, Integer limit, Integer offset) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return layerMapper.selectByPage(name, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<LayerEntity> selectAll(Integer flag) { |
| | | return layerMapper.selectAll(flag); |
| | | } |
| | | |
| | | @Override |
| | | public LayerEntity selectById(int id) { |
| | | return layerMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectIdByName(String name) { |
| | | Integer id = layerMapper.selectIdByName(name); |
| | | return null == id ? 0 : id; |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectMaxOrderNumByPid(Integer pid) { |
| | | return layerMapper.selectMaxOrderNumByPid(pid); |
| | | } |
| | | |
| | | @Override |
| | | public LayerEntity selectByResId(Integer resid) { |
| | | return layerMapper.selectByResId(resid); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insert(LayerEntity entity) { |
| | | return layerMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer inserts(List<LayerEntity> list) { |
| | | return layerMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer delete(int id) { |
| | | return layerMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deletes(List<Integer> ids) { |
| | | return layerMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer update(LayerEntity entity) { |
| | | return layerMapper.update(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<LayerEntity> list) { |
| | | return layerMapper.updates(list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.service.sys; |
| | | |
| | | import com.terra.system.entity.sys.ResLogEntity; |
| | | import com.terra.system.helper.StringHelper; |
| | | import com.terra.system.mapper.sys.ResLogMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @SuppressWarnings("ALL") |
| | | public class ResLogService implements ResLogMapper { |
| | | @Autowired |
| | | ResLogMapper resLogMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(Integer resid) { |
| | | return resLogMapper.selectCount(resid); |
| | | } |
| | | |
| | | @Override |
| | | public List<ResLogEntity> selectByPage(Integer resid, Integer limit, Integer offset) { |
| | | return resLogMapper.selectByPage(resid, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<ResLogEntity> selectAll() { |
| | | return resLogMapper.selectAll(); |
| | | } |
| | | |
| | | @Override |
| | | public ResLogEntity selectById(int id) { |
| | | return resLogMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insert(ResLogEntity entity) { |
| | | return resLogMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer inserts(List<ResLogEntity> list) { |
| | | return resLogMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer delete(int id) { |
| | | return resLogMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deletes(List<Integer> ids) { |
| | | return resLogMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer update(ResLogEntity entity) { |
| | | return resLogMapper.update(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<ResLogEntity> list) { |
| | | return resLogMapper.updates(list); |
| | | } |
| | | } |
| | |
| | | ResMapper resMapper; |
| | | |
| | | @Override |
| | | public Integer selectCount(String name) { |
| | | public Integer selectCount(String name, Integer status, Integer category, Integer type, Integer data) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return resMapper.selectCount(name); |
| | | return resMapper.selectCount(name, status, category, type, data); |
| | | } |
| | | |
| | | @Override |
| | | public List<ResEntity> selectByPage(String name, Integer limit, Integer offset) { |
| | | public List<ResEntity> selectByPage(String name, Integer status, Integer category, Integer type, Integer data, Integer limit, Integer offset) { |
| | | name = StringHelper.getLikeUpperStr(name); |
| | | |
| | | return resMapper.selectByPage(name, limit, offset); |
| | | return resMapper.selectByPage(name, status, category, type, data, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<ResEntity> selectAll() { |
| | | return resMapper.selectAll(); |
| | | } |
| | | |
| | | @Override |
| | | public ResEntity selectById(int id) { |
| | | return resMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public ResEntity selectByPubid(Integer pubid) { |
| | | return resMapper.selectByPubid(pubid); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertRes(ResEntity resEntity) { |
| | | return resMapper.insertRes(resEntity); |
| | | public Integer insert(ResEntity entity) { |
| | | return resMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertRess(List<ResEntity> resEntity) { |
| | | return resMapper.insertRess(resEntity); |
| | | public Integer inserts(List<ResEntity> list) { |
| | | return resMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteRes(int id) { |
| | | return resMapper.deleteRes(id); |
| | | public Integer delete(int id) { |
| | | return resMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deleteRess(List<Integer> ids) { |
| | | return resMapper.deleteRess(ids); |
| | | public Integer deletes(String ids) { |
| | | return resMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateRes(ResEntity resEntity) { |
| | | return resMapper.updateRes(resEntity); |
| | | public Integer update(ResEntity entity) { |
| | | return resMapper.update(entity); |
| | | } |
| | | |
| | | @Override |
| | | public ResEntity selectRes(int id) { |
| | | return resMapper.selectRes(id); |
| | | public Integer updates(List<ResEntity> list) { |
| | | return resMapper.updates(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<ResEntity> selectResAll() { |
| | | return resMapper.selectResAll(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.terra.system.service.sys; |
| | | |
| | | import com.terra.system.entity.sys.RoleLayerEntity; |
| | | import com.terra.system.helper.StringHelper; |
| | | import com.terra.system.mapper.sys.RoleLayerMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @SuppressWarnings("ALL") |
| | | public class RoleLayerService implements RoleLayerMapper { |
| | | @Autowired |
| | | RoleLayerMapper roleLayerMapper; |
| | | |
| | | @Override |
| | | public List<RoleLayerEntity> selectLayersByRole(Integer roleid) { |
| | | return roleLayerMapper.selectLayersByRole(roleid); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCount(Integer roleid) { |
| | | return roleLayerMapper.selectCount(roleid); |
| | | } |
| | | |
| | | @Override |
| | | public List<RoleLayerEntity> selectByPage(Integer roleid, Integer limit, Integer offset) { |
| | | return roleLayerMapper.selectByPage(roleid, limit, offset); |
| | | } |
| | | |
| | | @Override |
| | | public List<RoleLayerEntity> selectAll() { |
| | | return roleLayerMapper.selectAll(); |
| | | } |
| | | |
| | | @Override |
| | | public RoleLayerEntity selectById(int id) { |
| | | return roleLayerMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insert(RoleLayerEntity entity) { |
| | | return roleLayerMapper.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer inserts(List<RoleLayerEntity> list) { |
| | | return roleLayerMapper.inserts(list); |
| | | } |
| | | |
| | | @Override |
| | | public Integer delete(int id) { |
| | | return roleLayerMapper.delete(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer deletes(List<Integer> ids) { |
| | | return roleLayerMapper.deletes(ids); |
| | | } |
| | | |
| | | @Override |
| | | public Integer update(RoleLayerEntity entity) { |
| | | return roleLayerMapper.update(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<RoleLayerEntity> list) { |
| | | return roleLayerMapper.updates(list); |
| | | } |
| | | } |
| | |
| | | RoleResMapper roleResMapper; |
| | | |
| | | @Override |
| | | public List<RoleResEntity> selectResByRole(Integer roleid) { |
| | | return roleResMapper.selectResByRole(roleid); |
| | | } |
| | | |
| | | @Override |
| | | public Integer selectCount(Integer roleid) { |
| | | return roleResMapper.selectCount(roleid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | server: |
| | | tomcat: |
| | | uri-encoding: UTF-8 |
| | | max-connections: 5000 |
| | | max-http-form-post-size: 100MB |
| | | threads: |
| | | max: 2000 |
| | | servlet: |
| | | context-path: / |
| | | |
| | | spring: |
| | | application: |
| | | name: se-system |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | # redis |
| | | redis: |
| | | database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6369 |
| | | password: rediS_5L#F4_Server |
| | | # è¿æ¥è¶
æ¶æ¶é¿ï¼æ¯«ç§ï¼ |
| | | timeout: 10000 |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± æå¤§è¿æ¥æ°ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-active: 1000 |
| | | # è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 10 |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 5 |
| | | # session |
| | | session: |
| | | # 20åé |
| | | timeout: PT20M |
| | | # 设置ä¸ä¼ æä»¶å¤§å° |
| | | servlet: |
| | | multipart: |
| | | enabled: true |
| | | max-file-size: 204800MB |
| | | max-request-size: 1048576MB |
| | | # jackson |
| | | jackson: |
| | | time-zone: GMT+8 |
| | | date-format: yyyy-MM-dd HH:mm:ss |
| | | locale: zh_CN |
| | | thymeleaf: |
| | | cache: false |
| | | # datasource |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | #url: jdbc:postgresql://192.168.11.205:5433/jhs?useAffectedRows=true |
| | | url: jdbc:postgresql://127.0.0.1:5433/jhs?useAffectedRows=true |
| | | username: postgres |
| | | #password: Postgres!_14_Lf |
| | | password: postgres |
| | | driver-class-name: org.postgresql.Driver |
| | | platform: POSTGRESQL |
| | | filters: stat,wall,log4j |
| | | connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
| | | logAbandoned: true |
| | | # é
ç½®è¿æ¥æ± ä¿¡æ¯ |
| | | druid: |
| | | initial-size: 5 |
| | | min-idle: 5 |
| | | max-active: 100 |
| | | max-wait: 60000 |
| | | time-between-eviction-runs-millis: 60000 |
| | | min-evictable-idle-time-millis: 300000 |
| | | max-pool-prepared-statement-per-connection-size: 50 |
| | | pool-prepared-statements: true |
| | | validation-query: SELECT 1 |
| | | test-while-idle: true |
| | | test-on-borrow: false |
| | | test-on-return: false |
| | | filters: stat,wall |
| | | web-stat-filter: |
| | | enabled: true |
| | | stat-view-servlet: |
| | | enabled: true |
| | | url-pattern: /druid/* |
| | | reset-enable: false |
| | | login-username: admin |
| | | login-password: ad_!Druid!_min |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.terra.system.entity |
| | | config-location: classpath:mybatis.xml |
| | | mapper-locations: classpath:mapper/**/*.xml |
| | | |
| | | # logging |
| | | logging: |
| | | config: classpath:logback.xml |
| | | |
| | | # RestTemplate config |
| | | remote: |
| | | maxTotalConnect: 0 |
| | | maxConnectPerRoute: 1000 |
| | | connectTimeout: 30000 |
| | | readTimeout: -1 |
| | | |
| | | # ç³»ç»é
ç½® |
| | | sys: |
| | | # å¯ç¨swagger |
| | | swaggerEnable: true |
| | | # èªå¨æ¥è¯¢ |
| | | autoQuery: 0 |
| | | # 管çåID |
| | | admin: ad_Lf1122_min |
| | | # IISç主æºå°å |
| | | iisHost: 127.0.0.1 |
| | | # FMEæå¡å°å |
| | | fmeUrl: http://192.168.11.205:88/ |
| | | # FME令ç |
| | | fmeToken: c36e4f94-dfde-401e-9967-2c4a449f1300 |
| | | # åºå¾æå¡ |
| | | exportServer: http://127.0.0.1/ExportMap |
| | | # Turfæå¡ |
| | | turfServer: http://127.0.0.1/Turf |
| | | # Gdal驱å¨ç®å½ |
| | | gdal_path: E:\terrait\TianJin\Zip\release-1928-x64-dev\release-1928-x64\bin |
| | | # ç¦çå°å |
| | | tile_path: E:\data\2d\tiles |
| | | path: |
| | | # ä¸è½½ç®å½ |
| | | download: D:\JHS\data\download |
| | | # ä¸ä¼ ç®å½ |
| | | upload: D:\JHS\data\upload |
| | | # 临æ¶ç®å½ |
| | | temp: D:\JHS\data\temp |
| | | cad: |
| | | exePath: C:/360/MxDrawCloudServer1.0TryVersion/MxDrawCloudServer/Bin/MxCAD/Release/mxcadassembly.exe |
| | | targetPath: C:/360/MxDrawCloudServer1.0TryVersion/MxDrawCloudServer/SRC/TsWeb/public/data |
| | | # ä¸ä¼ é件表 |
| | | attachTabs: bd.b_pac_hydrogeology,bd.b_pac_frozensoil |
| | |
| | | locale: zh_CN |
| | | thymeleaf: |
| | | cache: false |
| | | # datasource |
| | | # datasourceï¼https://blog.csdn.net/weixin_43724911/article/details/147566522 |
| | | datasource: |
| | | name: prod |
| | | # JDBC åºæ¬é
ç½® ¤tSchema=public |
| | |
| | | |
| | | # logging |
| | | logging: |
| | | config: classpath:logback-spring.xml |
| | | config: classpath:logback.xml |
| | | |
| | | # RestTemplate config |
| | | remote: |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- æ¥å¿åæ¾è·¯å¾ --> |
| | | <property name="log.path" value="logs/se-system" /> |
| | | <!-- æ¥å¿è¾åºæ ¼å¼ --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | <property name="log.path" value="logs/se-system" /> |
| | | <!-- æ¥å¿è¾åºæ ¼å¼ --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- æ§å¶å°è¾åº --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- ç³»ç»æ¥å¿è¾åº --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/info.log</file> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/info.log</file> |
| | | <!-- å¾ªç¯æ¿çï¼åºäºæ¶é´å建æ¥å¿æä»¶ --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>INFO</level> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/error.log</file> |
| | | <file>${log.path}/error.log</file> |
| | | <!-- å¾ªç¯æ¿çï¼åºäºæ¶é´å建æ¥å¿æä»¶ --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>ERROR</level> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- ç³»ç»æ¨¡åæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="com.terra" level="info" /> |
| | | <!-- Springæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | <logger name="com.terra" level="info" /> |
| | | <!-- Springæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--ç³»ç»æä½æ¥å¿--> |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--ç³»ç»æä½æ¥å¿--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.terra.system.mapper.all.PermsMapper"> |
| | | <select id="selectRes" resultType="com.terra.system.entity.all.ResAuthEntity"> |
| | | select distinct d.id,d.name,d.server |
| | | <select id="selectRes" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select distinct e.* |
| | | from lf.sys_user a |
| | | inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role_res c on b.roleid = c.roleid |
| | | inner join lf.sys_res d on c.resid = d.id |
| | | inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role_layer c on b.roleid = c.roleid |
| | | inner join lf.sys_layer d on c.layerid = d.id |
| | | inner join lf.sys_res e on d.resid = e.id |
| | | <where> |
| | | d.status between 1 and 2 and e.status between 1 and 2 |
| | | <if test="uid != null"> |
| | | a.uid = #{uid} |
| | | and a.uid = #{uid} |
| | | </if> |
| | | </where> |
| | | order by d.id |
| | | order by e.id; |
| | | </select> |
| | | |
| | | <select id="selectAllRes" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select e.* |
| | | from lf.sys_res e |
| | | where e.status between 1 and 2 |
| | | order by e.id; |
| | | </select> |
| | | |
| | | <select id="selectMenus" resultType="com.terra.system.entity.all.MenusAuthEntity"> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.terra.system.mapper.data.LayerMapper"> |
| | | <select id="selectLayers" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select distinct d.*, e.proxy, e.pubid |
| | | from lf.sys_user a |
| | | inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role_layer c on b.roleid = c.roleid |
| | | inner join lf.sys_layer d on c.layerid = d.id |
| | | left join lf.sys_res e on d.resid = e.id and e.status = 2 |
| | | <where> |
| | | d.status = 1 and d.flag = 0 |
| | | <if test="uid != null"> |
| | | and a.uid = #{uid} |
| | | </if> |
| | | </where> |
| | | order by d.id; |
| | | </select> |
| | | |
| | | <select id="selectProjectLayers" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select distinct d.*, e.proxy |
| | | from lf.sys_user a |
| | | inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role_layer c on b.roleid = c.roleid |
| | | inner join lf.sys_layer d on c.layerid = d.id |
| | | left join lf.sys_res e on d.resid = e.id and e.status = 2 |
| | | <where> |
| | | d.status = 1 and d.flag = 1 |
| | | <if test="uid != null"> |
| | | and a.uid = #{uid} |
| | | </if> |
| | | </where> |
| | | order by d.id; |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_layer |
| | | <where> |
| | | <if test="cnName != null"> |
| | | upper(cn_name) like #{cnName} |
| | | <if test="name != null"> |
| | | upper(cn_name) like #{name} or upper(en_name) like #{name} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.data.LayerEntity"> |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer |
| | | <where> |
| | | <if test="cnName != null"> |
| | | upper(cn_name) like #{cnName} |
| | | <if test="name != null"> |
| | | upper(cn_name) like #{name} or upper(en_name) like #{name} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.terra.system.entity.data.LayerEntity"> |
| | | select a.*, |
| | | (select ns from lf.sys_dict b where b.field = 'gid' and b.tab = a.en_name) "ns", |
| | | (select json from lf.sys_publish c where c.id = a.pubid) |
| | | from lf.sys_layer a |
| | | order by id; |
| | | <select id="selectAll" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * |
| | | from lf.sys_layer |
| | | <where> |
| | | <if test="flag != null"> |
| | | flag = #{flag} |
| | | </if> |
| | | </where> |
| | | order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.terra.system.entity.data.LayerEntity"> |
| | | <select id="selectById" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.terra.system.entity.data.LayerEntity"> |
| | | <select id="selectIdByName" resultType="java.lang.Integer"> |
| | | select id from lf.sys_dir where name = #{name}; |
| | | </select> |
| | | |
| | | <select id="selectMaxOrderNumByPid" resultType="java.lang.Integer"> |
| | | select coalesce(max(order_num), 0) + 1 from lf.sys_layer where pid = #{pid}; |
| | | </select> |
| | | |
| | | <select id="selectByResId" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer where resid = #{resid} limit 1; |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.terra.system.entity.sys.LayerEntity"> |
| | | insert into lf.sys_layer |
| | | (pid,cn_name,en_name,url,test_url,type,icon,level,order_num,is_show,create_user,create_time,bak,serve_type,data_type,elev,is_project) |
| | | (pid,cn_name,en_name,url,is_layer,is_show,icon,level,order_num,status,create_user,create_time,bak,elev,resid,type,data,tab,category,flag,unit) |
| | | values |
| | | (#{pid},#{cnName},#{enName},#{url},#{testUrl},#{type},#{icon},#{level},#{orderNum},#{isShow},#{createUser},now(),#{bak},#{serveType},#{dataType},#{elev},#{isProject}) |
| | | (#{pid},#{cnName},#{enName},#{url},#{isLayer},#{isShow},#{icon},#{level},#{orderNum},#{status},#{createUser},now(),#{bak},#{elev},#{resid},#{type},#{data},#{tab},#{category},#{flag},#{unit}) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_layer |
| | | (pid,cn_name,en_name,url,test_url,type,icon,level,order_num,is_show,create_user,create_time,bak,serve_type,data_type,elev,is_project) |
| | | (pid,cn_name,en_name,url,is_layer,is_show,icon,level,order_num,status,create_user,create_time,bak,elev,resid,type,data,tab,category,flag,unit) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.pid},#{item.cnName},#{item.enName},#{item.url},#{item.testUrl},#{item.type},#{item.icon},#{item.level},#{item.orderNum},#{item.isShow},#{item.createUser},now(),#{item.bak},#{item.serveType},#{item.dataType},#{item.elev},#{item.isProject}) |
| | | (#{item.pid},#{item.cnName},#{item.enName},#{item.url},#{item.isLayer},#{item.isShow},#{item.icon},#{item.level},#{item.orderNum},#{item.status},#{item.createUser},now(),#{item.bak},#{item.elev},#{item.resid},#{item.type},#{item.data},#{item.tab},#{item.category},#{item.flag},#{item.unit}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | |
| | | <update id="update"> |
| | | update lf.sys_layer |
| | | set pid=#{pid},cn_name=#{cnName},en_name=#{enName},url=#{url},test_url=#{testUrl},type=#{type},icon=#{icon},level=#{level},order_num=#{orderNum},is_show=#{isShow},update_user=#{updateUser},update_time=now(),bak=#{bak},serve_type=#{serveType},data_type=#{dataType},elev=#{elev},is_project=#{isProject} |
| | | set pid=#{pid},cn_name=#{cnName},en_name=#{enName},url=#{url},is_layer=#{isLayer},is_show=#{isShow},icon=#{icon},level=#{level},order_num=#{orderNum},status=#{status},update_user=#{updateUser},update_time=now(),bak=#{bak},elev=#{elev},resid=#{resid},type=#{type},data=#{data},tab=#{tab},category=#{category},flag=#{flag},unit=#{unit} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_layer |
| | | <set> |
| | | pid=#{item.pid},cn_name=#{item.cnName},en_name=#{item.enName},url=#{item.url},test_url=#{item.testUrl},type=#{item.type},icon=#{item.icon},level=#{item.level},order_num=#{item.orderNum},is_show=#{item.isShow},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak},serve_type=#{item.serveType},data_type=#{item.dataType},elev=#{item.elev},is_project=#{item.isProject} |
| | | </set> |
| | | set pid=#{item.pid},cn_name=#{item.cnName},en_name=#{item.enName},url=#{item.url},is_layer=#{item.isLayer},is_show=#{item.isShow},icon=#{item.icon},level=#{item.level},order_num=#{item.orderNum},status=#{item.status},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak},elev=#{item.elev},resid=#{item.resid},type=#{item.type},data=#{item.data},tab=#{item.tab},category=#{item.category},flag=#{item.flag},unit=#{item.unit} |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.terra.system.mapper.sys.LayerMapper"> |
| | | <select id="selectLayers" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select distinct d.*, e.proxy, e.pubid |
| | | from lf.sys_user a |
| | | inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role_layer c on b.roleid = c.roleid |
| | | inner join lf.sys_layer d on c.layerid = d.id |
| | | left join lf.sys_res e on d.resid = e.id and e.status = 2 |
| | | <where> |
| | | d.status = 1 and d.flag = 0 |
| | | <if test="uid != null"> |
| | | and a.uid = #{uid} |
| | | </if> |
| | | </where> |
| | | order by d.id; |
| | | </select> |
| | | |
| | | <select id="selectProjectLayers" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select distinct d.*, e.proxy |
| | | from lf.sys_user a |
| | | inner join lf.sys_role_user b on a.id = b.userid |
| | | inner join lf.sys_role_layer c on b.roleid = c.roleid |
| | | inner join lf.sys_layer d on c.layerid = d.id |
| | | left join lf.sys_res e on d.resid = e.id and e.status = 2 |
| | | <where> |
| | | d.status = 1 and d.flag = 1 |
| | | <if test="uid != null"> |
| | | and a.uid = #{uid} |
| | | </if> |
| | | </where> |
| | | order by d.id; |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_layer |
| | | <where> |
| | | <if test="name != null"> |
| | | upper(cn_name) like #{name} or upper(en_name) like #{name} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer |
| | | <where> |
| | | <if test="name != null"> |
| | | upper(cn_name) like #{name} or upper(en_name) like #{name} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * |
| | | from lf.sys_layer |
| | | <where> |
| | | <if test="flag != null"> |
| | | flag = #{flag} |
| | | </if> |
| | | </where> |
| | | order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer where id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectIdByName" resultType="java.lang.Integer"> |
| | | select id from lf.sys_dir where name = #{name}; |
| | | </select> |
| | | |
| | | <select id="selectMaxOrderNumByPid" resultType="java.lang.Integer"> |
| | | select coalesce(max(order_num), 0) + 1 from lf.sys_layer where pid = #{pid}; |
| | | </select> |
| | | |
| | | <select id="selectByResId" resultType="com.terra.system.entity.sys.LayerEntity"> |
| | | select * from lf.sys_layer where resid = #{resid} limit 1; |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.terra.system.entity.sys.LayerEntity"> |
| | | insert into lf.sys_layer |
| | | (pid,cn_name,en_name,url,is_layer,is_show,icon,level,order_num,status,create_user,create_time,bak,elev,resid,type,data,tab,category,flag,unit) |
| | | values |
| | | (#{pid},#{cnName},#{enName},#{url},#{isLayer},#{isShow},#{icon},#{level},#{orderNum},#{status},#{createUser},now(),#{bak},#{elev},#{resid},#{type},#{data},#{tab},#{category},#{flag},#{unit}) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_layer |
| | | (pid,cn_name,en_name,url,is_layer,is_show,icon,level,order_num,status,create_user,create_time,bak,elev,resid,type,data,tab,category,flag,unit) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.pid},#{item.cnName},#{item.enName},#{item.url},#{item.isLayer},#{item.isShow},#{item.icon},#{item.level},#{item.orderNum},#{item.status},#{item.createUser},now(),#{item.bak},#{item.elev},#{item.resid},#{item.type},#{item.data},#{item.tab},#{item.category},#{item.flag},#{item.unit}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="delete"> |
| | | delete from lf.sys_layer where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_layer where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_layer |
| | | set pid=#{pid},cn_name=#{cnName},en_name=#{enName},url=#{url},is_layer=#{isLayer},is_show=#{isShow},icon=#{icon},level=#{level},order_num=#{orderNum},status=#{status},update_user=#{updateUser},update_time=now(),bak=#{bak},elev=#{elev},resid=#{resid},type=#{type},data=#{data},tab=#{tab},category=#{category},flag=#{flag},unit=#{unit} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_layer |
| | | set pid=#{item.pid},cn_name=#{item.cnName},en_name=#{item.enName},url=#{item.url},is_layer=#{item.isLayer},is_show=#{item.isShow},icon=#{item.icon},level=#{item.level},order_num=#{item.orderNum},status=#{item.status},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak},elev=#{item.elev},resid=#{item.resid},type=#{item.type},data=#{item.data},tab=#{item.tab},category=#{item.category},flag=#{item.flag},unit=#{item.unit} |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.terra.system.mapper.sys.ResLogMapper"> |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_res_log |
| | | <where> |
| | | <if test="resid != null"> |
| | | resid = #{resid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.ResLogEntity"> |
| | | select * from lf.sys_res_log |
| | | <where> |
| | | <if test="resid != null"> |
| | | resid = #{resid} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.terra.system.entity.sys.ResLogEntity"> |
| | | select * from lf.sys_res_log order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.terra.system.entity.sys.ResLogEntity"> |
| | | select * from lf.sys_res_log where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.terra.system.entity.sys.ResLogEntity"> |
| | | insert into lf.sys_res_log |
| | | (resid,type,ip,url,create_user,create_time) |
| | | values |
| | | (#{resid},#{type},#{ip},#{url},#{createUser},now()) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_res_log |
| | | (resid,type,ip,url,create_user,create_time) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.resid},#{item.type},#{item.ip},#{item.url},#{item.createUser},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="delete"> |
| | | delete from lf.sys_res_log where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_res_log where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_res_log |
| | | set resid=#{resid},type=#{type},ip=#{ip},url=#{url} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_res_log |
| | | set resid=#{item.resid},type=#{item.type},ip=#{item.ip},url=#{item.url} |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
| | |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_res |
| | | <where> |
| | | 1 = 1 |
| | | <if test="name != null"> |
| | | upper(name) like #{name} |
| | | and (upper(cn_name) like #{name} or upper(en_name) like #{name}) |
| | | </if> |
| | | <if test="status != null"> |
| | | and status = #{status} |
| | | </if> |
| | | <if test="category != null"> |
| | | and category = #{category} |
| | | </if> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | | </if> |
| | | <if test="data != null"> |
| | | and data = #{data} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select a.*,fn_rec_query(a.depid, 'dep') depName,fn_rec_query(a.dirid, 'dir') dirName,fn_uname(a.create_user) createName,fn_uname(a.update_user) updateName from lf.sys_res a |
| | | select a.*, fn_uname(a.create_user) createName, fn_uname(a.update_user) updateName from lf.sys_res a |
| | | <where> |
| | | 1 = 1 |
| | | <if test="name != null"> |
| | | upper(a.name) like #{name} |
| | | and (upper(cn_name) like #{name} or upper(en_name) like #{name}) |
| | | </if> |
| | | <if test="status != null"> |
| | | and status = #{status} |
| | | </if> |
| | | <if test="category != null"> |
| | | and category = #{category} |
| | | </if> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | | </if> |
| | | <if test="data != null"> |
| | | and data = #{data} |
| | | </if> |
| | | </where> |
| | | order by a.id desc |
| | | limit #{limit} offset #{offset} |
| | | limit #{limit} offset #{offset}; |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select a.*, fn_uname(a.create_user) createName, fn_uname(a.update_user) updateName |
| | | from lf.sys_res a |
| | | order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select a.*, fn_uname(a.create_user) createName, fn_uname(a.update_user) updateName |
| | | from lf.sys_res a |
| | | where id = #{id}; |
| | | </select> |
| | | |
| | | <select id="selectByPubid" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select * from lf.sys_res where pubid = #{pubid} limit 1; |
| | | </select> |
| | | |
| | | <select id="selectCountForRole" resultType="java.lang.Integer"> |
| | |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectResAll" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select * from lf.sys_res order by id desc |
| | | </select> |
| | | <insert id="insert" parameterType="com.terra.system.entity.sys.ResEntity"> |
| | | <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id"> |
| | | select currval('lf.sys_res_id_seq'::regclass) as id |
| | | </selectKey> |
| | | |
| | | <select id="selectRes" resultType="com.terra.system.entity.sys.ResEntity"> |
| | | select * from lf.sys_res where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertRes" parameterType="com.terra.system.entity.data.DictEntity"> |
| | | insert into lf.sys_res |
| | | (name,server,source,depid,dirid,code,descr,img,create_user,create_time,bak) |
| | | values |
| | | (#{name},#{server},#{source},#{depid},#{dirid},#{code},#{descr},#{img},#{createUser},now(),#{bak}); |
| | | insert into lf.sys_res |
| | | (cn_name,en_name,status,type,data,category,url,test,descr,depid,dirid,img,create_user,create_time,bak,tab,args,pubid) |
| | | values |
| | | (#{cnName},#{enName},#{status},#{type},#{data},#{category},#{url},#{test},#{descr},#{depid},#{dirid},#{img},#{createUser},now(),#{bak},#{tab},#{args},#{pubid}) |
| | | </insert> |
| | | |
| | | <insert id="insertRess"> |
| | | insert into lf.sys_res |
| | | (name,server,source,depid,dirid,code,descr,img,create_user,create_time,bak) |
| | | values |
| | | <insert id="inserts"> |
| | | insert into lf.sys_res |
| | | (cn_name,en_name,status,type,data,category,url,test,descr,depid,dirid,img,create_user,create_time,bak,tab,args,pubid) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | #{item.name},#{item.server},#{item.source},#{item.depid},#{item.dirid},#{item.code},#{item.descr},#{item.img},#{item.createUser},now(),#{item.bak}) |
| | | (#{item.cnName},#{item.enName},#{item.status},#{item.type},#{item.data},#{item.category},#{item.url},#{item.test},#{item.descr},#{item.depid},#{item.dirid},#{item.img},#{item.createUser},now(),#{item.bak},#{item.tab},#{item.args},#{item.pubid}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="deleteRes"> |
| | | delete from lf.sys_role_res where resid = #{id}; |
| | | <delete id="delete"> |
| | | delete from lf.sys_layer where resid = #{id}; |
| | | delete from lf.sys_res where id = #{id}; |
| | | </delete> |
| | | |
| | | <delete id="deleteRess"> |
| | | delete from lf.sys_role_res where resid in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach>; |
| | | delete from lf.sys_res where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach>; |
| | | <delete id="deletes"> |
| | | delete from lf.sys_layer where resid in (${ids}); |
| | | delete from lf.sys_res where id in (${ids}); |
| | | </delete> |
| | | |
| | | <update id="updateRes"> |
| | | update lf.sys_res set name=#{name},server=#{server},source=#{source},depid=#{depid},dirid=#{dirid},code=#{code},descr=#{descr},img=#{img}, |
| | | update_user=#{updateUser},update_time=now(),bak=#{bak} where id=#{id} |
| | | <update id="update"> |
| | | update lf.sys_res |
| | | set cn_name=#{cnName},en_name=#{enName},status=#{status},type=#{type},data=#{data},category=#{category},url=#{url},test=#{test},descr=#{descr},depid=#{depid},dirid=#{dirid},img=#{img},update_user=#{updateUser},update_time=now(),bak=#{bak},tab=#{tab},args=#{args},pubid=#{pubid} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_res |
| | | set cn_name=#{item.cnName},en_name=#{item.enName},status=#{item.status},type=#{item.type},data=#{item.data},category=#{item.category},url=#{item.url},test=#{item.test},descr=#{item.descr},depid=#{item.depid},dirid=#{item.dirid},img=#{item.img},update_user=#{item.updateUser},update_time=now(),bak=#{item.bak},tab=#{item.tab},args=#{item.args},pubid=#{item.pubid} |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
| | |
| | | <where> |
| | | 1 = 1 |
| | | <if test="name != null"> |
| | | and upper(c.name) like #{name} |
| | | and upper(c.cn_name) like #{name} |
| | | </if> |
| | | <if test="type != null"> |
| | | and a.type = #{type} |
| | |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.ResOpEntity"> |
| | | select a.*,b.uname,c.name from lf.sys_res_op a inner join lf.sys_user b on a.userid = b.id inner join lf.sys_res c on a.resid=c.id |
| | | select a.*, b.uname, c.cn_name "name" |
| | | from lf.sys_res_op a |
| | | inner join lf.sys_user b on a.userid = b.id inner join lf.sys_res c on a.resid=c.id |
| | | <where> |
| | | 1 = 1 |
| | | <if test="name != null"> |
| | | and upper(c.name) like #{name} |
| | | and upper(c.cn_name) like #{name} |
| | | </if> |
| | | <if test="type != null"> |
| | | and a.type = #{type} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.terra.system.mapper.sys.RoleLayerMapper"> |
| | | <select id="selectLayersByRole" resultType="com.terra.system.entity.sys.RoleLayerEntity"> |
| | | with rs as (select id, layerid from lf.sys_role_layer where roleid = #{roleid}) |
| | | select (select id from rs b where b.layerid = a.id) "id", a.id "layerid", a.cn_name, a.en_name, a.is_layer, a.pid, a.level, a.order_num |
| | | from lf.sys_layer a |
| | | order by a.id; |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_role_layer |
| | | <where> |
| | | <if test="roleid != null"> |
| | | roleid = #{roleid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.RoleLayerEntity"> |
| | | select * from lf.sys_role_layer |
| | | <where> |
| | | <if test="roleid != null"> |
| | | roleid = #{roleid} |
| | | </if> |
| | | </where> |
| | | order by id desc |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectAll" resultType="com.terra.system.entity.sys.RoleLayerEntity"> |
| | | select * from lf.sys_role_layer order by id desc; |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.terra.system.entity.sys.RoleLayerEntity"> |
| | | select * from lf.sys_role_layer where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.terra.system.entity.sys.RoleLayerEntity"> |
| | | insert into lf.sys_role_layer |
| | | (roleid,layerid,create_user,create_time) |
| | | values |
| | | (#{roleid},#{layerid},#{createUser},now()) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | | insert into lf.sys_role_layer |
| | | (roleid,layerid,create_user,create_time) |
| | | values |
| | | <foreach collection="list" item="item" index="index" separator=","> |
| | | (#{item.roleid},#{item.layerid},#{item.createUser},now()) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <delete id="delete"> |
| | | delete from lf.sys_role_layer where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_role_layer where id in |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_role_layer |
| | | set roleid=#{roleid},layerid=#{layerid},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_role_layer |
| | | set roleid=#{item.roleid},layerid=#{item.layerid},update_user=#{item.updateUser},update_time=now() |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.terra.system.mapper.sys.RoleResMapper"> |
| | | <select id="selectResByRole" resultType="com.terra.system.entity.sys.RoleResEntity"> |
| | | with rs as (select id, resid from lf.sys_role_res where roleid = #{roleid}) |
| | | select (select id from rs b where b.resid = a.id) "id", a.id "resid", a.cn_name, a.en_name, a.type, a.data, a.tab |
| | | from lf.sys_res a; |
| | | </select> |
| | | |
| | | <select id="selectCount" resultType="java.lang.Integer"> |
| | | select count(*) from lf.sys_role_res |
| | | <where> |
| | |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.terra.system.entity.sys.RoleResEntity"> |
| | | select a.*,b.name as resName from lf.sys_role_res a inner join lf.sys_res b |
| | | on a.resid = b.id |
| | | select a.* |
| | | from lf.sys_role_res a |
| | | <where> |
| | | <if test="roleid != null"> |
| | | a.roleid = #{roleid} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | order by a.id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="selectById" resultType="com.terra.system.entity.sys.RoleResEntity"> |
| | | select * from lf.sys_role_res where id = #{id} |
| | | select * from lf.sys_role_res where id = #{id}; |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.terra.system.entity.sys.RoleResEntity"> |
| | | insert into lf.sys_role_res |
| | | (roleid,resid,create_user,create_time) |
| | | values |
| | | (#{roleid},#{resid},#{createUser},now()) |
| | | insert into lf.sys_role_res |
| | | (roleid,resid,create_user,create_time) |
| | | values |
| | | (#{roleid},#{resid},#{createUser},now()) |
| | | </insert> |
| | | |
| | | <insert id="inserts"> |
| | |
| | | </delete> |
| | | |
| | | <update id="update"> |
| | | update lf.sys_role_res |
| | | set roleid=#{roleid},resid=#{resid},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | update lf.sys_role_res |
| | | set roleid=#{roleid},resid=#{resid},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ------------------------------------------------------------------- |
| | | admin:Admin@1234_lf |
| | | nacosï¼nAcos_!9#_admIn |
| | | |
| | | http://localhost:8848/nacos |
| | | http://localhost:8002/ |
| | | http://localhost:8001/system/ |
| | | |
| | | http://localhost:8001/system/sign/getPublicKey |
| | | http://localhost:8002/sign/getPublicKey |
| | | |
| | | http://localhost:8001/system/dir/selectDir?id=1 |
| | | http://localhost:8002/dir/selectDir?id=1 |
| | | ------------------------------------------------------------------- |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ------------------------------------------------------------------- |