已添加254个文件
已修改39个文件
已删除254个文件
| | |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <!--<version>2.3.0.RELEASE</version>--> |
| | | <configuration> |
| | | <mainClass>com.lf.server.LfApplication</mainClass> |
| | | <mainClass>com.moon.server.LfApplication</mainClass> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * Landåºç¨ç¨åº |
| | | * @author WWW |
| | | * æé¤Securityï¼, exclude = {SecurityAutoConfiguration.class, SecurityFilterAutoConfiguration.class} |
| | | * |
| | | * jar -> warï¼ç»§æ¿ SpringBootServletInitializerï¼å®ç° configure 彿° |
| | | */ |
| | | @EnableSwagger2 |
| | | @SpringBootApplication(scanBasePackages = {"com.moon.server.*"}) |
| | | public class LfApplication extends SpringBootServletInitializer { |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(LfApplication.class, args); |
| | | } |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder springApplicationBuilder) { |
| | | return springApplicationBuilder.sources(LfApplication.class); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.annotation; |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * Excel头注解类 |
| | | * @author WWW |
| | | */ |
| | | @Target(ElementType.TYPE) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface ExcelHead { |
| | | /** |
| | | * Excelå¤´è¡æ° |
| | | * |
| | | * @return å¤´è¡æ° |
| | | */ |
| | | int headRows() default 1; |
| | | |
| | | /** |
| | | * æé¤çSheetåç§°ï¼å¤ä¸ªç¨éå·éå¼ï¼ |
| | | * |
| | | * @return |
| | | */ |
| | | String excludeSheets() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.annotation; |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * ç³»ç»æ¥å¿æ³¨è§£ç±» |
| | | * @author WWW |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | public @interface SysLog { |
| | | String value() default ""; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.aspect; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.sys.OperateEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.sys.OperateService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * æ¥å¿åé¢ç±» |
| | | * @author WWW |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class LogAspect { |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private OperateService operateService; |
| | | |
| | | private final static String SELECT = "select"; |
| | | |
| | | private final static String INSERT = "insert"; |
| | | |
| | | private final static String UPDATE = "update"; |
| | | |
| | | private final static String DELETE = "delete"; |
| | | |
| | | private final static String UPLOAD = "upload"; |
| | | |
| | | private final static String DOWNLOAD = "download"; |
| | | |
| | | private final static String COUNT = "count"; |
| | | |
| | | private final static String SPLIT = "\\\\"; |
| | | |
| | | private static final Log log = LogFactory.getLog(LogAspect.class); |
| | | |
| | | @Pointcut("@annotation(com.moon.server.annotation.SysLog)") |
| | | public void logPointCut() { |
| | | // |
| | | } |
| | | |
| | | /** |
| | | * ç¯ç»éç¥ @Aroundï¼ä¹å¯ä»¥ä½¿ç¨ @Before (åç½®éç¥) æ @After (åç½®éç¥) |
| | | */ |
| | | @Around("logPointCut()") |
| | | public Object around(ProceedingJoinPoint point) throws Throwable { |
| | | long beginTime = System.currentTimeMillis(); |
| | | |
| | | // æ§è¡æ¹æ³ |
| | | Object result = point.proceed(); |
| | | |
| | | // æ§è¡æ¶é¿(毫ç§) |
| | | long time = System.currentTimeMillis() - beginTime; |
| | | |
| | | // ä¿åæ¥å¿ |
| | | saveLog(point, time); |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * ä¿åæ¥å¿ |
| | | */ |
| | | private void saveLog(ProceedingJoinPoint joinPoint, long time) { |
| | | try { |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | Class<?> clazz = joinPoint.getTarget().getClass(); |
| | | Method method = signature.getMethod(); |
| | | |
| | | HttpServletRequest req = WebHelper.getRequest(); |
| | | String url = req.getServletPath(); |
| | | |
| | | OperateEntity oe = new OperateEntity(); |
| | | oe.setIp(WebHelper.getIpAddress(req)); |
| | | oe.setUrl(url); |
| | | oe.setExec(time); |
| | | |
| | | // 设置模å |
| | | Api api = clazz.getAnnotation(Api.class); |
| | | if (api != null) { |
| | | String[] strs = api.tags()[0].split(SPLIT); |
| | | oe.setModular1(strs[0]); |
| | | oe.setModular2(strs[1]); |
| | | } |
| | | |
| | | // 设置类å\æ¹æ³åãç±»å« |
| | | oe.setClazz(clazz.getName() + "." + method.getName()); |
| | | oe.setType(getType(method.getName())); |
| | | |
| | | // è®¾ç½®å¤æ³¨ |
| | | SysLog sysLog = method.getAnnotation(SysLog.class); |
| | | if (sysLog != null) { |
| | | oe.setBak(sysLog.value()); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | oe.setUserid(ue.getId()); |
| | | } |
| | | |
| | | operateService.insertOperate(oe); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæä½ç±»å |
| | | */ |
| | | private static int getType(String methodName) { |
| | | if (methodName.contains(SELECT)) { |
| | | return 1; |
| | | } |
| | | if (methodName.contains(INSERT)) { |
| | | return 2; |
| | | } |
| | | if (methodName.contains(UPDATE)) { |
| | | return 3; |
| | | } |
| | | if (methodName.contains(DELETE)) { |
| | | return 4; |
| | | } |
| | | if (methodName.contains(UPLOAD)) { |
| | | return 5; |
| | | } |
| | | if (methodName.contains(DOWNLOAD)) { |
| | | return 6; |
| | | } |
| | | // methodName.indexOf(COUNT) > -1 |
| | | if (methodName.contains(COUNT)) { |
| | | return 7; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.sys.ArgsService; |
| | | import com.moon.server.helper.GdalHelper; |
| | | import com.moon.server.helper.PathHelper; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * åå§å宿é
置类 |
| | | * @author WWW |
| | | */ |
| | | @Component |
| | | public class InitConfig implements ApplicationRunner { |
| | | private final static Log log = LogFactory.getLog(InitConfig.class); |
| | | |
| | | @Autowired |
| | | PathHelper pathHelper; |
| | | |
| | | @Autowired |
| | | ArgsService argsService; |
| | | |
| | | @Autowired |
| | | Environment env; |
| | | |
| | | //@Autowired |
| | | //TestService testService; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | GdalHelper.init(env.getProperty("sys.gdal_path")); |
| | | UploadAttachService.init(env.getProperty("sys.attachTabs")); |
| | | |
| | | //testService.testRegister(); |
| | | pathHelper.init(); |
| | | argsService.initSettingData(); |
| | | |
| | | log.info("***************** ç³»ç»å¯å¨å®æ¯ *****************" + "\n"); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.multipart.MultipartResolver; |
| | | import org.springframework.web.multipart.support.StandardServletMultipartResolver; |
| | | |
| | | /** |
| | | * 夿件ä¸ä¼ é
ç½® |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | public class MultipartFileUploadConfig { |
| | | @Bean |
| | | public MultipartResolver multipartResolver() { |
| | | return new StandardServletMultipartResolver(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer; |
| | | import com.baomidou.mybatisplus.core.MybatisConfiguration; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import com.moon.server.extend.CustomizedSqlInjector; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * Mybatis-Pluså页é
ç½® |
| | | * @author WWW |
| | | */ |
| | | @EnableTransactionManagement |
| | | @Configuration |
| | | @MapperScan("com.lf.server.mapper") |
| | | public class MybatisPlusConfig { |
| | | /** |
| | | * æ°çå页æä»¶,ä¸ç¼åäºç¼éµå¾ªmybatisçè§å,éè¦è®¾ç½® |
| | | * MybatisConfiguration#useDeprecatedExecutor = false |
| | | * é¿å
ç¼ååºç°é®é¢(è¯¥å±æ§ä¼å¨æ§æä»¶ç§»é¤åä¸åç§»é¤) |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.POSTGRE_SQL)); |
| | | return interceptor; |
| | | } |
| | | |
| | | @Bean |
| | | public ConfigurationCustomizer configurationCustomizer() { |
| | | return new ConfigurationCustomizer() { |
| | | @Override |
| | | public void customize(MybatisConfiguration configuration) { |
| | | configuration.setCacheEnabled(true); |
| | | configuration.setMapUnderscoreToCamelCase(true); |
| | | configuration.setCallSettersOnNulls(true); |
| | | configuration.setJdbcTypeForNull(JdbcType.NULL); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | @Bean |
| | | public CustomizedSqlInjector customizedSqlInjector() { |
| | | return new CustomizedSqlInjector(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * 屿§é
置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("AlibabaCommentsMustBeJavadocFormat") |
| | | public class PropertiesConfig { |
| | | @Value("${sys.path.download}") |
| | | private String downloadPath; |
| | | |
| | | @Value("${sys.path.upload}") |
| | | private String uploadPath; |
| | | |
| | | @Value("${sys.path.temp}") |
| | | private String tempPath; |
| | | |
| | | // @Value("${spring.datasource.druid.stat-view-servlet.login-username}") |
| | | private String druidUser; |
| | | |
| | | // @Value("${spring.datasource.druid.stat-view-servlet.login-password}") |
| | | private String druidPwd; |
| | | |
| | | @Value("${sys.tile_path}") |
| | | private String tilePath; |
| | | |
| | | public String getDownloadPath() { |
| | | return downloadPath; |
| | | } |
| | | |
| | | public String getUploadPath() { |
| | | return uploadPath; |
| | | } |
| | | |
| | | public String getTempPath() { |
| | | return tempPath; |
| | | } |
| | | |
| | | public String getDruidUser() { |
| | | return druidUser; |
| | | } |
| | | |
| | | public String getDruidPwd() { |
| | | return druidPwd; |
| | | } |
| | | |
| | | public String getTilePath() { |
| | | return tilePath; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
| | | import com.fasterxml.jackson.annotation.PropertyAccessor; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
| | | import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; |
| | | import org.springframework.cache.Cache; |
| | | import org.springframework.cache.annotation.CachingConfigurerSupport; |
| | | import org.springframework.cache.interceptor.CacheErrorHandler; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Redisé
置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @AutoConfigureAfter(RedisAutoConfiguration.class) |
| | | public class RedisConfig extends CachingConfigurerSupport { |
| | | /** |
| | | * é
ç½®èªå®ä¹redisTemplate |
| | | */ |
| | | @SuppressWarnings("deprecation") |
| | | @Bean |
| | | public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { |
| | | RedisTemplate<String, Object> template = new RedisTemplate<>(); |
| | | template.setConnectionFactory(redisConnectionFactory); |
| | | |
| | | // 使ç¨Jackson2JsonRedisSerializeræ¥åºåååååºååredisçvalueå¼ |
| | | Jackson2JsonRedisSerializer<Object> serializer = new Jackson2JsonRedisSerializer<Object>(Object.class); |
| | | |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
| | | mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); |
| | | serializer.setObjectMapper(mapper); |
| | | |
| | | template.setValueSerializer(serializer); |
| | | |
| | | //使ç¨StringRedisSerializeræ¥åºåååååºååredisçkeyå¼ |
| | | template.setKeySerializer(new StringRedisSerializer()); |
| | | template.setHashKeySerializer(new StringRedisSerializer()); |
| | | template.setHashValueSerializer(serializer); |
| | | template.afterPropertiesSet(); |
| | | |
| | | return template; |
| | | } |
| | | |
| | | @Bean |
| | | @Override |
| | | public CacheErrorHandler errorHandler() { |
| | | // å¼å¸¸å¤çï¼å½Redisåçå¼å¸¸æ¶ï¼æå°æ¥å¿ï¼ä½æ¯ç¨åºæ£å¸¸èµ° |
| | | return new CacheErrorHandler() { |
| | | @Override |
| | | public void handleCacheGetError(RuntimeException e, Cache cache, Object key) { |
| | | Map<String, Object> error = new HashMap<String, Object>(3); |
| | | error.put("e", e); |
| | | error.put("cache", cache); |
| | | error.put("key", key); |
| | | } |
| | | |
| | | @Override |
| | | public void handleCachePutError(RuntimeException e, Cache cache, Object key, Object value) { |
| | | Map<String, Object> error = new HashMap<String, Object>(4); |
| | | error.put("e", e); |
| | | error.put("cache", cache); |
| | | error.put("key", key); |
| | | error.put("value", value); |
| | | } |
| | | |
| | | @Override |
| | | public void handleCacheEvictError(RuntimeException e, Cache cache, Object key) { |
| | | Map<String, Object> error = new HashMap<String, Object>(3); |
| | | error.put("e", e); |
| | | error.put("cache", cache); |
| | | error.put("key", key); |
| | | } |
| | | |
| | | @Override |
| | | public void handleCacheClearError(RuntimeException e, Cache cache) { |
| | | Map<String, Object> error = new HashMap<String, Object>(2); |
| | | error.put("e", e); |
| | | error.put("cache", cache); |
| | | } |
| | | }; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.impl.client.HttpClientBuilder; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.client.ClientHttpRequestFactory; |
| | | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
| | | import org.springframework.http.client.SimpleClientHttpRequestFactory; |
| | | import org.springframework.http.converter.HttpMessageConverter; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Rest模æ¿é
置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @ConditionalOnClass(value = {RestTemplate.class, HttpClient.class}) |
| | | public class RestTemplateConfig { |
| | | /** |
| | | * è¿æ¥æ± çæå¤§è¿æ¥æ°é»è®¤ä¸º0 |
| | | */ |
| | | @Value("${remote.maxTotalConnect:0}") |
| | | private int maxTotalConnect; |
| | | |
| | | /** |
| | | * å个主æºçæå¤§è¿æ¥æ° |
| | | */ |
| | | @Value("${remote.maxConnectPerRoute:1000}") |
| | | private int maxConnectPerRoute; |
| | | |
| | | /** |
| | | * è¿æ¥è¶
æ¶é»è®¤5s |
| | | */ |
| | | @Value("${remote.connectTimeout:5000}") |
| | | private int connectTimeout; |
| | | |
| | | /** |
| | | * 读åè¶
æ¶é»è®¤30s |
| | | */ |
| | | @Value("${remote.readTimeout:30000}") |
| | | private int readTimeout; |
| | | |
| | | /** |
| | | * å建HTTP客æ·ç«¯å·¥å |
| | | * |
| | | * @return 客æ·ç«¯å·¥å |
| | | */ |
| | | private ClientHttpRequestFactory createFactory() { |
| | | if (this.maxTotalConnect <= 0) { |
| | | SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); |
| | | factory.setConnectTimeout(this.connectTimeout); |
| | | factory.setReadTimeout(this.readTimeout); |
| | | return factory; |
| | | } |
| | | |
| | | HttpClient httpClient = HttpClientBuilder.create().setMaxConnTotal(this.maxTotalConnect).setMaxConnPerRoute(this.maxConnectPerRoute).build(); |
| | | |
| | | HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient); |
| | | factory.setConnectTimeout(this.connectTimeout); |
| | | factory.setReadTimeout(this.readTimeout); |
| | | |
| | | return factory; |
| | | } |
| | | |
| | | /** |
| | | * åå§åRestTemplate,å¹¶å å
¥springçBeanå·¥åï¼ç±springç»ä¸ç®¡ç |
| | | * å¿
é¡»å æ³¨è§£@LoadBalanced |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | @ConditionalOnMissingBean(RestTemplate.class) |
| | | public RestTemplate getRestTemplate() { |
| | | RestTemplate restTemplate = new RestTemplate(this.createFactory()); |
| | | List<HttpMessageConverter<?>> converterList = restTemplate.getMessageConverters(); |
| | | |
| | | // éæ°è®¾ç½®StringHttpMessageConverterå符é为UTF-8ï¼è§£å³ä¸æä¹±ç é®é¢ |
| | | HttpMessageConverter<?> converterTarget = null; |
| | | for (HttpMessageConverter<?> item : converterList) { |
| | | if (StringHttpMessageConverter.class == item.getClass()) { |
| | | converterTarget = item; |
| | | break; |
| | | } |
| | | } |
| | | if (null != converterTarget) { |
| | | converterList.remove(converterTarget); |
| | | } |
| | | converterList.add(1, new StringHttpMessageConverter(StandardCharsets.UTF_8)); |
| | | |
| | | return restTemplate; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.moon.server.entity.data.FmeLogEntity; |
| | | import com.moon.server.service.all.ScheduleService; |
| | | import com.moon.server.service.all.WebSocketService; |
| | | import com.moon.server.service.sys.AttachService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¥ç¨é
置类 |
| | | * @author WWW |
| | | */ |
| | | @Component |
| | | @EnableScheduling |
| | | public class ScheduleConfig { |
| | | @Autowired |
| | | AttachService attachService; |
| | | |
| | | @Autowired |
| | | ScheduleService scheduleService; |
| | | |
| | | private static boolean isBusy = false; |
| | | |
| | | private static final Log log = LogFactory.getLog(ScheduleConfig.class); |
| | | |
| | | @Scheduled(fixedRate = 15 * 1000) |
| | | public void pushMonitorInfo() { |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | // æ¥è¯¢Cpuä¿¡æ¯ |
| | | jsonObject.put("cpuInfo", scheduleService.selectCpuInfo()); |
| | | // æ¥è¯¢å
åä¿¡æ¯ |
| | | jsonObject.put("memInfo", scheduleService.selectMemInfo()); |
| | | // æ¥è¯¢å¨çº¿ç¨æ· |
| | | jsonObject.put("userInfo", scheduleService.selectOnlineUsers()); |
| | | |
| | | String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | |
| | | WebSocketService.broadCastInfo(json); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedRate = 30 * 1000) |
| | | public void checkSystemStatus() { |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | // æ¥è¯¢æå¡èµæºç¶æ |
| | | jsonObject.put("resInfo", scheduleService.selectResStatus()); |
| | | |
| | | String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | |
| | | WebSocketService.broadCastInfo(json); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedRate = 30 * 1000) |
| | | public void countSystemStatus() { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | // æå¡èµæºç¶æ sys_res |
| | | jsonObject.put("resUseCount", scheduleService.countResStatus()); |
| | | |
| | | // ç¨æ·ç»å½ç¶æ sys_login |
| | | jsonObject.put("userLoginCount", scheduleService.userLoginCount()); |
| | | |
| | | // èµæºæä½ç¶æ sys_operate |
| | | jsonObject.put("operateCount", scheduleService.operateCount()); |
| | | |
| | | // èµæºè°ç¨ç¶æ |
| | | String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | |
| | | WebSocketService.broadCastInfo(json); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 忥éä»¶ |
| | | */ |
| | | @Scheduled(fixedRate = 30 * 1000) |
| | | public void syncAttaches() { |
| | | try { |
| | | List<FmeLogEntity> list = attachService.selectFmeLogs(); |
| | | if (isBusy || null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | isBusy = true; |
| | | for (FmeLogEntity entity : list) { |
| | | attachService.syncAttaches(entity); |
| | | attachService.updateFmeLog(entity.getId()); |
| | | } |
| | | isBusy = false; |
| | | } catch (Exception ex) { |
| | | isBusy = false; |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.*; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spi.service.contexts.SecurityContext; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Swaggeré
置类 |
| | | * @author www |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | public class SwaggerConfig { |
| | | private List<ApiKey> securitySchemes() { |
| | | List<ApiKey> apiKeys = new ArrayList<ApiKey>(); |
| | | apiKeys.add(new ApiKey("Authorization", "token", "header")); |
| | | |
| | | return apiKeys; |
| | | } |
| | | |
| | | private List<SecurityContext> securityContexts() { |
| | | List<SecurityContext> securityContexts = new ArrayList<>(); |
| | | securityContexts.add(SecurityContext.builder() |
| | | .securityReferences(defaultAuth()) |
| | | .forPaths(PathSelectors.regex("^(?!auth).*$")).build()); |
| | | |
| | | return securityContexts; |
| | | } |
| | | |
| | | private List<SecurityReference> defaultAuth() { |
| | | AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); |
| | | AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; |
| | | authorizationScopes[0] = authorizationScope; |
| | | List<SecurityReference> securityReferences = new ArrayList<>(); |
| | | securityReferences.add(new SecurityReference("Authorization", authorizationScopes)); |
| | | |
| | | return securityReferences; |
| | | } |
| | | |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()).select() |
| | | .apis(RequestHandlerSelectors.basePackage("com.lf.server.controller")) |
| | | //.securitySchemes(securitySchemes()) |
| | | //.securityContexts(securityContexts()) |
| | | .paths(PathSelectors.any()).build(); |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("Spring Bootæ¥å£API") |
| | | .description("Spring Bootæ¥å£APIæ¥ç") |
| | | .version("1.0").build(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.alibaba.fastjson.support.config.FastJsonConfig; |
| | | import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; |
| | | import com.moon.server.interceptor.AuthInterceptor; |
| | | import com.moon.server.service.all.SysService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.http.converter.HttpMessageConverter; |
| | | import org.springframework.util.AntPathMatcher; |
| | | import org.springframework.web.servlet.config.annotation.*; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Webé
置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | public class WebConfig extends WebMvcConfigurationSupport { |
| | | @Autowired |
| | | private SysService sysService; |
| | | |
| | | @Override |
| | | public void addViewControllers(ViewControllerRegistry registry) { |
| | | // 设置访é®è·¯å¾ä¸º â/â è·³è½¬å°æå®é¡µé¢ |
| | | registry.addViewController("/").setViewName("redirect:/sign/toIndex"); |
| | | // 设置为æé«ä¼å
级 |
| | | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¦æªå¨å¯¹è±¡ |
| | | * |
| | | * @return |
| | | */ |
| | | public AuthInterceptor getAuthBean() { |
| | | return new AuthInterceptor(sysService); |
| | | } |
| | | |
| | | /** |
| | | * swaggeræ§å¶ |
| | | */ |
| | | @Override |
| | | 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("/**").addResourceLocations("classpath:/static/"); |
| | | super.addResourceHandlers(registry); |
| | | } |
| | | |
| | | /** |
| | | * 忽ç¥urlå°å大å°å |
| | | */ |
| | | @Override |
| | | protected void configurePathMatch(PathMatchConfigurer configurer) { |
| | | AntPathMatcher matcher = new AntPathMatcher(); |
| | | matcher.setCaseSensitive(false); |
| | | |
| | | configurer.setPathMatcher(matcher); |
| | | } |
| | | |
| | | /** |
| | | * è·¨åè¯·æ± |
| | | */ |
| | | @Override |
| | | protected void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |
| | | .allowCredentials(true) |
| | | .allowedOrigins("*") |
| | | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
| | | .allowedHeaders("*") |
| | | .maxAge(3600); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å ç»ä¸çæ¦æªå¨ |
| | | */ |
| | | @Override |
| | | protected void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(getAuthBean()) |
| | | // .excludePathPatterns("/swagger", "/webjars/**", "/v2/**", "/sign/**") |
| | | .addPathPatterns("/**"); |
| | | super.addInterceptors(registry); |
| | | } |
| | | |
| | | /** |
| | | * å¤çjsonæ ¼å¼ï¼å¼nullç转æ¢ä¸º"" |
| | | */ |
| | | @Override |
| | | public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { |
| | | FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); |
| | | FastJsonConfig config = new FastJsonConfig(); |
| | | config.setSerializerFeatures( |
| | | SerializerFeature.WriteNullListAsEmpty, |
| | | SerializerFeature.WriteMapNullValue, |
| | | //SerializerFeature.WriteNullStringAsEmpty, |
| | | SerializerFeature.WriteNullNumberAsZero, |
| | | SerializerFeature.WriteNullBooleanAsFalse); |
| | | // ç»ææ¯å¦æ ¼å¼å,é»è®¤ä¸ºfalse |
| | | //SerializerFeature.PrettyFormat); |
| | | |
| | | converter.setFastJsonConfig(config); |
| | | converter.setDefaultCharset(Charset.forName("UTF-8")); |
| | | converters.add(converter); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
| | | |
| | | /** |
| | | * WebSocketé
置类 |
| | | * @author WWW |
| | | */ |
| | | @Component |
| | | public class WebSocketConfig { |
| | | /** |
| | | * èªå¨æ³¨å使ç¨@ServerEndpoint |
| | | */ |
| | | @Bean |
| | | public ServerEndpointExporter serverEndpointExporter() { |
| | | return new ServerEndpointExporter(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | |
| | | /** |
| | | * Controlleråºç±» |
| | | * @author WWW |
| | | */ |
| | | public class BaseController { |
| | | public Log log = LogFactory.getLog(getClass()); |
| | | |
| | | public <T> ResponseMsg<T> success(T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> success(String msg, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, msg, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> success(long count, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, count, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> success(String msg, long count, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.OK, msg, count, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> fail(T result) { |
| | | return new ResponseMsg<T>(HttpStatus.ERROR, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> fail(String msg, T result) { |
| | | return new ResponseMsg<T>(HttpStatus.ERROR, msg, result); |
| | | } |
| | | |
| | | public <T> ResponseMsg<T> fail(Exception ex, T result) { |
| | | log.error(ex.getMessage(), ex); |
| | | |
| | | return new ResponseMsg<T>(HttpStatus.ERROR, ex.getMessage(), result); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.BaseGeoEntity; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.DownloadReqEntity; |
| | | import com.moon.server.entity.ctrl.IdNameEntity; |
| | | import com.moon.server.entity.ctrl.KeyValueEntity; |
| | | import com.moon.server.entity.ctrl.TabEntity; |
| | | import com.moon.server.entity.data.*; |
| | | import com.moon.server.entity.sys.AttachEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.AesHelper; |
| | | import com.moon.server.helper.ClassHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.mapper.all.BasicMapper; |
| | | import com.moon.server.mapper.all.GeomBaseMapper; |
| | | import com.moon.server.service.all.BaseQueryService; |
| | | import com.moon.server.service.data.DictService; |
| | | import com.moon.server.service.data.DirService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.data.MetaService; |
| | | import com.moon.server.service.show.DataLibService; |
| | | import com.moon.server.service.sys.AttachService; |
| | | import com.moon.server.service.sys.DepService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | 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 javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¶æ¥è¯¢æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | public class BaseQueryController extends BaseController { |
| | | @Autowired |
| | | AttachService attachService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DepService depService; |
| | | |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @Autowired |
| | | DataLibService dataLibService; |
| | | |
| | | @Autowired |
| | | public DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | public DownloadService downloadService; |
| | | |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | DictService dictService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "filter", value = "è¿æ»¤æ¡ä»¶", dataType = "String", paramType = "query", example = "gid >= 50 and name like 'å¿' and objectid < 5000.0"), |
| | | @ApiImplicitParam(name = "wkt", value = "WKTï¼èåææ¬ï¼", dataType = "String", paramType = "query", example = "gAPpDbZ53XfoQfvT8dj/uhBWX5os8kBJQ1LrNvH3VX7byFQdUJMPiEr8Fkj0q2i1pw+L8KFrvR0MLXq2xaO21nlQQXmEPofJxpDQZwEWUIFZsToXo1kLRD3t6WQezxWB8YTzXHM20Ba73x/ZuuezVhOFOq1U8HKf1dXQdv7gBzEB6fWMmFDc3FuH8GDDHv3LfT86Gio9VgMO6ohlrUdf3ZKtTHeLSuzGF4t0RZuX97YBNo25IIzpeTfRTXBxfdxA") |
| | | }) |
| | | @GetMapping(value = "/selectCount") |
| | | @PostMapping(value = "/selectCount") |
| | | public ResponseMsg<Long> selectCount(String name, String filter, String wkt) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | baseQueryService.addFilterWrapper(wrapper, filter); |
| | | baseQueryService.addGeomWrapper(baseMapper, wrapper, wkt); |
| | | |
| | | long count = baseMapper.selectCount(wrapper); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dirs", value = "ç®å½ç¼ç ", dataType = "String", paramType = "query", example = "00,01"), |
| | | @ApiImplicitParam(name = "filter", value = "è¿æ»¤æ¡ä»¶", dataType = "String", paramType = "query", example = "gid >= 50 and name like 'å¿' and objectid < 5000.0"), |
| | | @ApiImplicitParam(name = "wkt", value = "WKTï¼èåææ¬ï¼", dataType = "String", paramType = "query", example = ""), |
| | | //@ApiImplicitParam(name = "srid", value = "空é´å¼ç¨æ è¯ç¬¦", dataType = "Integer", paramType = "query", example = "4326"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "æ¯/å¦å
å«ç©ºé´ä¿¡æ¯", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | @PostMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<Object>> selectByPage(String name, String depcode, String dirs, String filter, String wkt, Integer pageIndex, Integer pageSize, Integer hasGeom) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (null == baseMapper) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | baseQueryService.addFilterWrapper(wrapper, filter); |
| | | baseQueryService.addGeomWrapper(baseMapper, wrapper, wkt); |
| | | if (!StringHelper.isEmpty(depcode)) { |
| | | wrapper.likeRight("depid", depcode); |
| | | } |
| | | |
| | | dirs = DataLibService.copeCodes(dirs, "dirid"); |
| | | if (!StringHelper.isEmpty(dirs)) { |
| | | wrapper.apply(dirs); |
| | | } |
| | | |
| | | boolean hasWkt = null != hasGeom && hasGeom > 0 && baseMapper instanceof GeomBaseMapper; |
| | | if (hasWkt) { |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | } |
| | | |
| | | Page<Object> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.desc("gid")); |
| | | IPage<Object> paged = baseMapper.selectPage(page, wrapper); |
| | | if (hasWkt && null != paged.getRecords()) { |
| | | copeWkt(paged.getRecords()); |
| | | } |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤çWKT |
| | | */ |
| | | private void copeWkt(List<?> list) { |
| | | for (int i = 0, c = list.size(); i < c; i++) { |
| | | Object obj = list.get(i); |
| | | setWktEncrypt(obj); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置WKTå å¯ |
| | | */ |
| | | private void setWktEncrypt(Object obj) { |
| | | if (obj instanceof BaseGeoEntity) { |
| | | BaseGeoEntity entity = (BaseGeoEntity) obj; |
| | | if (StringHelper.isEmpty(entity.getGeom())) { |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | String wkt = AesHelper.encrypt(entity.getGeom()); |
| | | entity.setGeom(wkt); |
| | | } catch (Exception ex) { |
| | | entity.setGeom(null); |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ç¼å²åºæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "wkt", value = "WKTï¼èåææ¬ï¼", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "buffer", value = "ç¼å²åºå¤§å°", dataType = "Double", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "limit", value = "éå¶æ¡æ°", dataType = "Integer", paramType = "query", example = "20") |
| | | }) |
| | | @GetMapping(value = "/selectByBuffer") |
| | | public ResponseMsg<List<?>> selectByBuffer(String name, String wkt, Double buffer, Integer limit) { |
| | | try { |
| | | if (StringHelper.isEmpty(wkt)) { |
| | | return fail("WKTä¸è½ä¸ºç©º", null); |
| | | } |
| | | if (null == limit || limit < 1 || limit > StaticData.ONE_HUNDRED) { |
| | | limit = 20; |
| | | } |
| | | if (null == buffer || buffer < 0 || buffer > StaticData.ONE_HUNDRED_THOUSAND) { |
| | | buffer = 10.0; |
| | | } |
| | | |
| | | GeomBaseMapper baseMapper = ClassHelper.getGeoBaseMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | baseQueryService.addBufferWrapper(baseMapper, wrapper, wkt, buffer); |
| | | wrapper.last("limit " + limit); |
| | | |
| | | List<?> list = baseMapper.selectList(wrapper); |
| | | |
| | | return success(null == list ? 0 : list.size(), list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¶IDå页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "metaid", value = "ç¶ID", dataType = "String", paramType = "query", example = "0"), |
| | | @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 = "/selectPageAndCountByPid") |
| | | public ResponseMsg<List<MetaEntity>> selectPageAndCountByPid(Integer metaid, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | if (null == metaid || metaid < 1) { |
| | | return fail("ç¶IDä¸è½ä¸ºç©ºä¸å¤§äº1", null); |
| | | } |
| | | |
| | | int count = metaService.selectCountByPid(metaid, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectPageByPid(metaid, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢WKT") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "gid", value = "GID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectWktById") |
| | | public ResponseMsg<String> selectWktById(String name, Integer gid) { |
| | | try { |
| | | GeomBaseMapper baseMapper = ClassHelper.getGeoBaseMapper(name); |
| | | if (null == baseMapper) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸å卿䏿¯ç©ºé´è¡¨", null); |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | if (StringHelper.isNull(tab)) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ç表åä¸åå¨", null); |
| | | } |
| | | |
| | | String wkt = baseMapper.selectWktById(tab, gid); |
| | | if (!StringHelper.isEmpty(wkt)) { |
| | | wkt = AesHelper.encrypt(wkt); |
| | | } |
| | | |
| | | return success(wkt); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®GIDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "gid", value = "GID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByGid") |
| | | public ResponseMsg<Object> selectByGid(String name, int gid) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (null == baseMapper) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | if (baseMapper instanceof GeomBaseMapper) { |
| | | wrapper.select("ST_AsText(geom) as geom, *"); |
| | | } |
| | | wrapper.eq("gid", gid); |
| | | |
| | | Object obj = baseMapper.selectOne(wrapper); |
| | | setWktEncrypt(obj); |
| | | |
| | | return success(null == obj ? 0 : 1, obj); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®å®ä½åæ¥è¯¢è¡¨å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp") |
| | | }) |
| | | @GetMapping(value = "/selectTabByEntity") |
| | | public ResponseMsg<Object> selectTabByEntity(String name) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | |
| | | return success(tab); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¨¡ç³æç´¢åæ®µ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlgagnp"), |
| | | @ApiImplicitParam(name = "field", value = "åæ®µ", dataType = "String", paramType = "query", example = "name"), |
| | | @ApiImplicitParam(name = "value", value = "å¼", dataType = "String", paramType = "query", example = "'å¿'") |
| | | }) |
| | | @GetMapping(value = "/selectFieldFuzzy") |
| | | public ResponseMsg<List<String>> selectFieldFuzzy(String name, String field, String value) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | String tab = BaseQueryService.getTabName(baseMapper); |
| | | if (StringHelper.isNull(tab)) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | if (StringHelper.isEmpty(field) || StringHelper.isSqlInjection(field)) { |
| | | return fail("æ¥è¯¢åæ®µä¸æ£ç¡®", null); |
| | | } |
| | | |
| | | value = StringHelper.isEmpty(value) ? "%" : StringHelper.getLikeUpperStr(value); |
| | | List<String> rs = baseMapper.selectFieldFuzzy(tab, field, value); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¨¡ç³æç´¢ç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "室") |
| | | }) |
| | | @GetMapping(value = "/selectUserFuzzy") |
| | | public ResponseMsg<List<IdNameEntity>> selectUserFuzzy(String name) { |
| | | try { |
| | | List<IdNameEntity> rs = baseQueryService.selectUserFuzzy(name); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¨¡ç³æç´¢åä½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åä½å", dataType = "String", paramType = "query", example = "å¸") |
| | | }) |
| | | @GetMapping(value = "/selectDepFuzzy") |
| | | public ResponseMsg<List<IdNameEntity>> selectDepFuzzy(String name) { |
| | | try { |
| | | List<IdNameEntity> rs = baseQueryService.selectDepFuzzy(name); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææè¡¨") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "ç¹"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "嫿Geomåæ®µ", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è¡¨åå页æ¥è¯¢è¡¨") |
| | | @GetMapping(value = "/selectTabsByPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dirs", value = "ç®å½ç¼ç ", dataType = "String", paramType = "query", example = "00,01"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "嫿Geomåæ®µ", dataType = "Boolean", paramType = "query", example = "false"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Boolean hasGeom, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | if (StringHelper.isSqlInjection(depcode)) { |
| | | return fail("åä½ä»£ç 嫿鿳å符", null); |
| | | } |
| | | |
| | | String filters = "1=1"; |
| | | if (!StringHelper.isEmpty(depcode)) { |
| | | filters += String.format(" and depid like '%s%%'", depcode); |
| | | } |
| | | dirs = DataLibService.copeCodes(dirs, "dirid"); |
| | | if (dirs != null) { |
| | | filters += String.format(" and %s", dirs); |
| | | } |
| | | |
| | | String field = null == hasGeom || !hasGeom ? "gid" : "geom"; |
| | | int count = baseQueryService.selectTabsForCount(tab, field); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, field, filters, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å段信æ¯") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlg25wAanp") |
| | | }) |
| | | @GetMapping(value = "/selectFields") |
| | | public ResponseMsg<List<DictEntity>> selectFields(String name) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | String tabName = BaseQueryService.getTabName(baseMapper); |
| | | if (tabName == null) { |
| | | return null; |
| | | } |
| | | |
| | | String[] strs = tabName.split("\\."); |
| | | List<DictEntity> list = baseQueryService.selectFields(strs[0], strs[1]); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å段信æ¯") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg25wAanp") |
| | | }) |
| | | @GetMapping(value = "/selectTabFields") |
| | | public ResponseMsg<List<DictEntity>> selectTabFields(String ns, String tab) { |
| | | try { |
| | | if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { |
| | | return fail("å称空é´å表åä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<DictEntity> list = baseQueryService.selectFields(ns, tab); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¼åä¿¡æ¯") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "æ å°åç§°", dataType = "String", paramType = "query", example = "dlg25wAanp") |
| | | }) |
| | | @GetMapping(value = "/selectDomains") |
| | | public ResponseMsg<List<DomainEntity>> selectDomains(String name) { |
| | | try { |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(name); |
| | | if (baseMapper == null) { |
| | | return fail("æ¥è¯¢å¯¹è±¡ä¸åå¨", null); |
| | | } |
| | | |
| | | String tabName = BaseQueryService.getTabName(baseMapper); |
| | | if (tabName == null) { |
| | | return null; |
| | | } |
| | | |
| | | String[] strs = tabName.split("\\."); |
| | | List<DomainEntity> list = baseQueryService.selectDomains(strs[0], strs[1]); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tabName", value = "表å", dataType = "String", paramType = "query", example = "lf.sys_style"), |
| | | @ApiImplicitParam(name = "eventid", value = "主é®", dataType = "String", paramType = "query", example = "fa25979a5ef8b43ba82a0be35b3fb0d4") |
| | | }) |
| | | @GetMapping(value = "/selectFiles") |
| | | public ResponseMsg<List<AttachEntity>> selectFiles(String tabName, String eventid) { |
| | | try { |
| | | if (StringHelper.isEmpty(tabName) || StringHelper.isEmpty(eventid)) { |
| | | return fail("åæ°ä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<AttachEntity> list = attachService.selectByTab(tabName, eventid); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å 餿件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deleteFiles(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int rows = attachService.deletes(ids); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, 0); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å
æ°æ®ä¸æº¢åºçåä½ID") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "reqEntity", value = "请æ±ä¸è½½å®ä½", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectMetaOverflowDep") |
| | | public ResponseMsg<Object> selectMetaOverflowDep(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çæä»¶ID"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return success(new ArrayList<String>()); |
| | | } |
| | | |
| | | List<String> list = metaService.selectMetaOverflowDep(ue, dr); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢DB䏿º¢åºçåä½ID") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "reqEntity", value = "请æ±ä¸è½½å®ä½", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectDbOverflowDep") |
| | | public ResponseMsg<Object> selectDbOverflowDep(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || null == dr.getEntities() || dr.getEntities().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çå®ä½å"); |
| | | } |
| | | if (!StringHelper.isEmpty(dr.getWkt())) { |
| | | dr.setWkt(AesHelper.decrypt(dr.getWkt())); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return success(new ArrayList<String>()); |
| | | } |
| | | |
| | | List<String> list = dataLibService.selectDbOverflowDep(ue, dr); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®åä½ç¼ç æ°ç»æ¥è¯¢åä½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "codes", value = "åä½ç¼ç æ°ç»", dataType = "String", paramType = "query", allowMultiple = true, example = "00,0001") |
| | | }) |
| | | @GetMapping(value = "/selectDepsByCodes") |
| | | public ResponseMsg<Object> selectDepsByCodes(String[] codes) { |
| | | try { |
| | | if (null == codes || codes.length == 0) { |
| | | return fail("åä½IDéå为空"); |
| | | } |
| | | |
| | | List<IdNameEntity> list = depService.selectDepsByCodes(codes); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½DBæ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dr", value = "请æ±ä¸è½½å®ä½", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadDbData") |
| | | public ResponseMsg<Object> downloadDbData(@RequestBody DownloadReqEntity dr, HttpServletRequest req) { |
| | | try { |
| | | if (null == dr || null == dr.getEntities() || dr.getEntities().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çå®ä½å"); |
| | | } |
| | | if (StringHelper.isEmpty(dr.getPwd())) { |
| | | return fail("å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (!DownloadService.decryptPwd(dr)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (StringHelper.isPwdInvalid(dr.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | if (!StringHelper.isEmpty(dr.getWkt())) { |
| | | dr.setWkt(AesHelper.decrypt(dr.getWkt())); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = dataLibService.downloadDbReq(ue, dr); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥çæä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/downloadForView") |
| | | public void downloadForView(String guid, HttpServletResponse res) { |
| | | metaService.downloadForView(guid, true, res); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @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 = "/selectPageCountForDownload") |
| | | public ResponseMsg<List<DownloadEntity>> selectPageCountForDownload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | int count = downloadService.selectCountForUser(ue.getId(), "3,4", name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), "3,4", name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®å½ç±»å«") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "D") |
| | | }) |
| | | @GetMapping(value = "/selectDirTypes") |
| | | public ResponseMsg<Object> selectDirTypes(String name) { |
| | | try { |
| | | List<KeyValueEntity> list = baseQueryService.selectDirTypes(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®åç§°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "西") |
| | | }) |
| | | @GetMapping(value = "/selectProject") |
| | | public ResponseMsg<Object> selectProject(String name) { |
| | | try { |
| | | List<DirEntity> list = dirService.selectProject(name); |
| | | |
| | | 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 = "/selectMetaById") |
| | | public ResponseMsg<MetaEntity> selectMetaById(int id) { |
| | | try { |
| | | MetaEntity entity = metaService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.data.DirEntity; |
| | | import com.moon.server.entity.data.MetaEntity; |
| | | import com.moon.server.helper.HttpHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.data.DirService; |
| | | import com.moon.server.service.data.FmeService; |
| | | import com.moon.server.service.data.MetaService; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * CRDSç³»ç»æ¥å£ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "ç³»ç»å¯¹æ¥\\CRDS") |
| | | @RestController |
| | | @RequestMapping("/crds") |
| | | public class CrdsController extends BaseController { |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @Autowired |
| | | FmeService fmeService; |
| | | |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "西") |
| | | }) |
| | | @GetMapping(value = "/selectProject") |
| | | public ResponseMsg<List<DirEntity>> selectProject(String name) { |
| | | try { |
| | | List<DirEntity> list = dirService.selectProject(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®ç®å½æ ") |
| | | @GetMapping(value = "/selectDirsForPrj") |
| | | public ResponseMsg<List<DirEntity>> selectDirsForPrj() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirsForPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ä»»å¡ç¶æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ä»»å¡ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") |
| | | }) |
| | | @GetMapping(value = "/selectTaskStatus") |
| | | public Object selectTaskStatus(String id, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(id)) { |
| | | return fail("idä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | return fmeService.getTaskStatus(id, req); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "è¯·æ±æå
") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirCode", value = "ç®å½ç¼ç ", dataType = "String", paramType = "01"), |
| | | @ApiImplicitParam(name = "major", value = "ä¸ä¸", dataType = "String", paramType = "ç©¿è·¨è¶"), |
| | | @ApiImplicitParam(name = "isCut", value = "æ¯å¦è£åª", dataType = "String", paramType = "NO") |
| | | }) |
| | | @GetMapping(value = "/uploadReqPackaging") |
| | | public ResponseMsg<Object> uploadReqPackaging(String dirCode, String major, String isCut, HttpServletRequest req) { |
| | | try { |
| | | boolean isMajor = StaticData.CROSSING.equals(major) || StaticData.ROUTE.equals(major); |
| | | if (!isMajor) { |
| | | return fail("ä¸ä¸åªè½æ¯âç©¿è·¨è¶âæâ线路â"); |
| | | } |
| | | |
| | | boolean bCut = StaticData.YES.equals(isCut) || StaticData.NO.equals(isCut); |
| | | if (!bCut) { |
| | | return fail("æ¯å¦è£åªåªè½æ¯âYESâæâNOâ"); |
| | | } |
| | | |
| | | if (StringHelper.isEmpty(dirCode)) { |
| | | return fail("ç®å½ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | DirEntity dir = dirService.selectByCode(dirCode); |
| | | if (null == dir) { |
| | | return fail("ç®å½ç¼ç 为" + dirCode + "çç®å½ä¸åå¨"); |
| | | } |
| | | |
| | | String id = fmeService.crdsPackaging(dirCode, major, isCut, req); |
| | | |
| | | return success(id); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ä»»å¡ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") |
| | | }) |
| | | @GetMapping(value = "/downloadFile") |
| | | public void downloadResult(String id, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (!StringHelper.isEmpty(id)) { |
| | | String url = fmeService.getDownloadUrl(id, req); |
| | | |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | httpHelper.service(req, res, url, null); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç®å½ç¼ç æ¥è¯¢å
æ°æ®æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dircode", value = "ç®å½ç¼ç ", dataType = "String", paramType = "query", example = "01") |
| | | }) |
| | | @GetMapping(value = "/selectMetasByDirCode") |
| | | public ResponseMsg<Object> selectMetasByDirCode(String dircode) { |
| | | try { |
| | | if (StringHelper.isEmpty(dircode)) { |
| | | return fail("ç®å½ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | List<MetaEntity> list = metaService.selectMetasByDirCode(dircode); |
| | | |
| | | return success(null == list ? 0 : list.size(), list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.moon.server.entity.ctrl.SdkDecryptEntity; |
| | | import com.moon.server.entity.ctrl.SdkSecretEntity; |
| | | import com.moon.server.entity.other.FloatServerResponse; |
| | | import com.moon.server.entity.other.ReqParamFloatServer; |
| | | import com.moon.server.helper.HttpHelper; |
| | | import com.moon.server.helper.LicHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.entity.InputStreamEntity; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * FloatServer |
| | | * @author WWW |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/floatserver") |
| | | public class FloatServerController extends BaseController { |
| | | private static LicHelper licHelper; |
| | | |
| | | private final static boolean IS_REDIRECT = false; |
| | | |
| | | @PostMapping({"/checkout/license"}) |
| | | public void license(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (IS_REDIRECT) { |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | httpHelper.service(req, res, "http://192.168.20.43:38080/floatserver/checkout/license", null); |
| | | return; |
| | | } |
| | | |
| | | HttpEntity entity = new InputStreamEntity(req.getInputStream(), getContentLength(req)); |
| | | String str = EntityUtils.toString(entity, "UTF-8"); |
| | | |
| | | LicHelper helper = getHelper(); |
| | | String reqJson = helper.b(str); |
| | | |
| | | ReqParamFloatServer rfs = JSON.parseObject(reqJson, ReqParamFloatServer.class); |
| | | FloatServerResponse fsr = new FloatServerResponse(rfs); |
| | | |
| | | String resJson = JSON.toJSONString(fsr); |
| | | String strRes = helper.a(resJson); |
| | | |
| | | res.getWriter().write(strRes); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | private Integer getContentLength(HttpServletRequest request) { |
| | | String contentLengthHeader = request.getHeader("Content-Length"); |
| | | if (contentLengthHeader != null) { |
| | | return Integer.parseInt(contentLengthHeader); |
| | | } |
| | | |
| | | return -1; |
| | | } |
| | | |
| | | private static LicHelper getHelper() { |
| | | if (licHelper == null) { |
| | | licHelper = new LicHelper(); |
| | | licHelper.d("&kdaow$IEW.##%5-"); |
| | | licHelper.c("*y91z72a;pclfleoqc20161v$DSP&%3+"); |
| | | } |
| | | |
| | | return licHelper; |
| | | } |
| | | |
| | | @SuppressWarnings("AlibabaUndefineMagicConstant") |
| | | private static String getClientIpAddr(HttpServletRequest req) { |
| | | String ip; |
| | | if ((ip = req.getHeader("x-forwarded-for")) == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = req.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = req.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = req.getRemoteAddr(); |
| | | } |
| | | |
| | | return ip; |
| | | } |
| | | |
| | | public static void test() { |
| | | try { |
| | | ReqParamFloatServer reqParam = new ReqParamFloatServer("192.168.20.106", "12316"); |
| | | String json = JSON.toJSONString(reqParam); |
| | | |
| | | String licCode = "78a82f0920de0f557f8177bec1e48601c4dc25e4054a00728e4314b56528d3a1632de5298edee38a65412277977a174fea5d91c452b19ef138dbc2ba089ba632"; |
| | | |
| | | LicHelper helper = getHelper(); |
| | | String str = helper.a(json); |
| | | System.out.println("ReqParamFloatServer: " + str); |
| | | |
| | | String data = "8dfb75298185cbcc4b2d485fdb4f25627f7aeb4dd41329076b5015586e4d56cfe2c56f12cd9852c447904210117b41fe2672b24d7e82fd581ad5a0983b501b5bcbe97d65dbbe770dbdc4a98e80d2966a71ecd0041a5282283bff853d70caf7aed671bc9c9d4bedf6d1d0294394861af40f195d68a965d957d53c78aa50ada3afc65d1a526c54648e6e081e8f7f7ab1c31b9f75916170e638b0b9216d30204864afe3a7a1bc8a6563bf44daf6a29e27c19f798c4f82dbb904ea4aa4fcc87a82226d9bf3e891ecb97b94263064fec025e3aa7c440d7c0e8ed559b84ae2438ec0fc438444a03c992883170ecdde20e08552efcf9d584de469930b27c81f946548d5c6e63e815671182b03b5e6e622ddb10a3f6a35ad3f44ec247a3b2dee0e936020d48efb7abc2d2abfb555f61d54c85eca"; |
| | | String rs = helper.b(data); |
| | | System.out.println("Lic: " + rs); |
| | | } catch (Exception ex) { |
| | | System.out.println(Arrays.toString(ex.getStackTrace())); |
| | | } |
| | | } |
| | | |
| | | @GetMapping({"/licenseEncryption/getLicenseSecret"}) |
| | | @PostMapping({"/licenseEncryption/getLicenseSecret"}) |
| | | public void getLicenseSecret(HttpServletResponse res) { |
| | | // http://127.0.0.1:12316/server/floatserver/licenseEncryption/getLicenseSecret |
| | | String json = JSON.toJSONString(new SdkSecretEntity()); |
| | | WebHelper.writeStr2Page(res, json); |
| | | } |
| | | |
| | | @GetMapping({"/licenseEncryption/getLicenseDecrypt"}) |
| | | @PostMapping({"/licenseEncryption/getLicenseDecrypt"}) |
| | | public void getLicenseDecrypt(HttpServletResponse res) { |
| | | // http://127.0.0.1:12316/server/floatserver/licenseEncryption/getLicenseDecrypt |
| | | String json = JSON.toJSONString(new SdkDecryptEntity()); |
| | | WebHelper.writeStr2Page(res, json); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.data.DirEntity; |
| | | import com.moon.server.entity.sys.RoleEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.data.DirService; |
| | | import com.moon.server.service.sys.RoleService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.service.sys.UserService; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * FMEæ¥å£æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "ç³»ç»å¯¹æ¥\\FME") |
| | | @RestController |
| | | @RequestMapping("/fmeIt") |
| | | public class FmeItController extends BaseController { |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | RoleService roleService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ¯/å¦ä¸ºç®¡çå") |
| | | @GetMapping(value = "/selectForIsAdmin") |
| | | public ResponseMsg<Boolean> selectForIsAdmin(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | |
| | | return success("æå", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectUser") |
| | | public ResponseMsg<UserEntity> selectUser(int id) { |
| | | try { |
| | | UserEntity userEntity = userService.selectUser(id); |
| | | |
| | | return success(userEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uid", value = "ç¨æ·ID", dataType = "String", paramType = "query", example = "admin") |
| | | }) |
| | | @GetMapping(value = "/selectByUid") |
| | | public ResponseMsg<UserEntity> selectByUid(String uid) { |
| | | try { |
| | | if (StringHelper.isEmpty(uid)) { |
| | | fail("ç¨æ·IDä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | UserEntity userEntity = userService.selectByUid(uid); |
| | | |
| | | return success(userEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ç¨æ·å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", 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 = "/selectByPageForUser") |
| | | public ResponseMsg<List<UserEntity>> selectByPageForUser(String uname, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = userService.selectCount(uname, null); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<UserEntity> rs = userService.selectByPage(uname, null, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ¯/å¦ä¸ºç®¡çå") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectIsAdmin") |
| | | public ResponseMsg<Boolean> selectIsAdmin(Integer id) { |
| | | try { |
| | | UserEntity ue = userService.selectUser(id); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·ä¸åå¨", false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | |
| | | return success("æå", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çåç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "管çåç±»å«", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectAdminUsers") |
| | | public ResponseMsg<Object> selectAdminUsers(Integer type) { |
| | | try { |
| | | if (null == type || type < 1) { |
| | | return fail("管çåç±»å«ä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectAdminUsers(type); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRoleByUserId") |
| | | public ResponseMsg<Object> selectRoleByUserId(Integer id) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return fail("ç¨æ·IDä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<RoleEntity> rs = userService.selectRoleByUserId(id); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²æ¥è¯¢ç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectUserByRoleId") |
| | | public ResponseMsg<Object> selectUserByRoleId(Integer id) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return fail("ç¨æ·IDä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectUserByRoleId(id); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRole") |
| | | public ResponseMsg<RoleEntity> selectRole(int id) { |
| | | try { |
| | | RoleEntity roleEntity = roleService.selectRole(id); |
| | | |
| | | return success(roleEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢è§è²å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "Admin"), |
| | | @ApiImplicitParam(name = "depid", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<RoleEntity>> selectByPageForRole(String name, Integer depid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = roleService.selectCount(name, depid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<RoleEntity> rs = roleService.selectByPage(name, depid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ ¹ç®å½") |
| | | @GetMapping(value = "/selectDirRoot") |
| | | public ResponseMsg<List<DirEntity>> selectDirRoot() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirRoot(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "西") |
| | | }) |
| | | @GetMapping(value = "/selectProject") |
| | | public ResponseMsg<List<DirEntity>> selectProject(String name) { |
| | | try { |
| | | List<DirEntity> list = dirService.selectProject(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®ç®å½æ ") |
| | | @GetMapping(value = "/selectDirsForPrj") |
| | | public ResponseMsg<List<DirEntity>> selectDirsForPrj() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirsForPrj(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.data.LayerEntity; |
| | | import com.moon.server.entity.sys.MenuEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.data.LayerService; |
| | | import com.moon.server.service.sys.MenuService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.entity.all.*; |
| | | 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; |
| | | |
| | | /** |
| | | * æææ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ææç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/perms") |
| | | public class PermsController extends BaseController { |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | MenuService menuService; |
| | | |
| | | @Autowired |
| | | LayerService layerService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çèµæºææ") |
| | | @GetMapping(value = "/selectRes") |
| | | public ResponseMsg<List<ResAuthEntity>> 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<ResAuthEntity> rs = permsService.selectRes(uid); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çèåææ") |
| | | @GetMapping(value = "/selectMenus") |
| | | public ResponseMsg<List<MenusAuthEntity>> selectMenus(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<MenusAuthEntity> rs = permsService.selectMenus(uid); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çæéææ") |
| | | @GetMapping(value = "/selectPerms") |
| | | public ResponseMsg<List<String>> selectPerms(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<String> rs = permsService.selectPerms(uid); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å½åç¨æ·çæéææå®ä½éå") |
| | | @GetMapping(value = "/selectPermsEntity") |
| | | public ResponseMsg<List<PermsAuthEntity>> selectPermsEntity(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<PermsAuthEntity> rs = permsService.selectPermsEntity(uid); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¸
ç©ºææææç¼å") |
| | | @GetMapping(value = "/deleteAllCache") |
| | | public ResponseMsg<Boolean> deleteAllCache() { |
| | | try { |
| | | permsService.clearAllCache(); |
| | | |
| | | return success(true); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç¨æ·è§è²") |
| | | @GetMapping("/selectRoles") |
| | | public ResponseMsg<Object> selectRoles(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<Integer> list = permsService.selectRoles(ue.getUid()); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "é彿¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "èåID", dataType = "Integer", paramType = "query", example = "14") |
| | | }) |
| | | @GetMapping(value = "/selectMenuRecursive") |
| | | public ResponseMsg<Object> selectMenuRecursive(int id, 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<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) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.all; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.config.PropertiesConfig; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.SettingData; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.sys.LoginEntity; |
| | | import com.moon.server.entity.sys.OperateEntity; |
| | | import com.moon.server.entity.sys.TokenEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.ScheduleService; |
| | | import com.moon.server.service.sys.LoginService; |
| | | import com.moon.server.service.sys.OperateService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.service.sys.UserService; |
| | | import com.moon.server.service.all.SignService; |
| | | import com.moon.server.helper.Md5Helper; |
| | | import com.moon.server.helper.RsaHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | 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 org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * ç¾åæ§å¶å¨ |
| | | * @author WWW |
| | | * @date 2022-09-21 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ç¾å管ç") |
| | | @RestController |
| | | @RequestMapping("/sign") |
| | | public class SignController extends BaseController { |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | LoginService loginService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | SignService signService; |
| | | |
| | | @Autowired |
| | | private OperateService operateService; |
| | | |
| | | @Autowired |
| | | PropertiesConfig propertiesConfig; |
| | | |
| | | @Autowired |
| | | private ScheduleService scheduleService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "跳转é¦é¡µ") |
| | | @GetMapping({"/", "/toIndex"}) |
| | | public ModelAndView toIndex(ModelAndView mv, HttpServletRequest req) { |
| | | mv.setViewName("index"); |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | mv.addObject("msg", "Hello " + ue.getUname() + " !"); |
| | | } |
| | | |
| | | return mv; |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "跳转ç»å½é¡µ") |
| | | @GetMapping("/toLogin") |
| | | public ModelAndView toLogin(ModelAndView mv) { |
| | | mv.setViewName("login"); |
| | | |
| | | return mv; |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ°æ®åºçæ§") |
| | | @GetMapping(value = "/toDruid") |
| | | public ModelAndView toDruid(HttpServletRequest req, HttpServletResponse res) { |
| | | ModelAndView mv = new ModelAndView(); |
| | | mv.setViewName("druid"); |
| | | |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | String sessionId = WebHelper.getCookieByKey(StaticData.DRUID_COOKIE_KEY, req); |
| | | if (StringHelper.isNull(sessionId)) { |
| | | signService.loginDruid(req, res); |
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | return mv; |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "èµæºçæ§") |
| | | @GetMapping(value = "/toMonitor") |
| | | public ModelAndView toMonitor(ModelAndView mv, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | mv.setViewName("redirect:/toLogin"); |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | mv.setViewName("monitor"); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | |
| | | return mv; |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ç»å½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "user", value = "ç¨æ¶å", dataType = "UsersEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/login", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<TokenEntity> login(@RequestBody UserEntity user, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | String str = userService.validateLoginPwd(user); |
| | | if (str != null) { |
| | | return fail(str, null); |
| | | } |
| | | |
| | | UserEntity ue = userService.selectByUid(user.getUid()); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·åä¸åå¨", null); |
| | | } |
| | | |
| | | if (!Md5Helper.validatePassword(user.getPwd(), ue.getPwd())) { |
| | | tokenService.setPwdErrCache(ue); |
| | | return fail("å¯ç 䏿£ç¡®", null); |
| | | } |
| | | |
| | | LoginEntity le = loginService.getNewLogin(ue.getId(), 1, 1, 1, req); |
| | | Integer rows = loginService.insertLogin(le); |
| | | if (rows == 0) { |
| | | return fail("å建ç»å½æ¥å¿å¤±è´¥", null); |
| | | } |
| | | |
| | | TokenEntity te = tokenService.getNewToken(ue, req); |
| | | rows = tokenService.insertToken(te); |
| | | if (rows == 0) { |
| | | return fail("å建令ç失败", null); |
| | | } |
| | | |
| | | te.setAutoLogOut(SettingData.AUTO_LOGOUT); |
| | | tokenService.saveToken(ue, te, req, res); |
| | | |
| | | int onlineUser = scheduleService.countOnlineUsers(); |
| | | String msg = onlineUser >= SettingData.MAX_USER_LOGIN ? "è¦åï¼ç³»ç»å·²ç»å°è¾¾ç¨æ·è®¿é®éçä¸éï¼" : ""; |
| | | |
| | | return success(msg, te); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ç»åº") |
| | | @GetMapping(value = "/logout") |
| | | public ResponseMsg<Boolean> logout(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | String token = WebHelper.getToken(req); |
| | | if (StringHelper.isEmpty(token)) { |
| | | return fail("æ²¡ææ£æµå°ä»¤ç", false); |
| | | } |
| | | |
| | | Boolean flag = tokenService.logout(token, req, res); |
| | | |
| | | return success(flag ? "ç»åºæå" : "ç»åºå¤±è´¥", flag); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ£æ¥æ¯/å¦ç»å½") |
| | | @GetMapping("/check") |
| | | public ResponseMsg<Boolean> check(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | Boolean flag = tokenService.isLogin(req, res); |
| | | if (flag) { |
| | | // åæ¥å¿ |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | LoginEntity le = loginService.getNewLogin(ue.getId(), 1, 2, 1, req); |
| | | Integer rows = loginService.insertLogin(le); |
| | | } |
| | | |
| | | return success(flag ? "ç¨æ·å·²ç»å½" : "ç¨æ·æªç»å½", flag); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "è·åå½åç¨æ·") |
| | | @GetMapping("/getCurrentUser") |
| | | public ResponseMsg<UserEntity> getCurrentUser(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("æ²¡ææ¾å°", null); |
| | | } |
| | | |
| | | return success(ue); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "è·åRSAå å¯å
¬é¥") |
| | | @GetMapping("/getPublicKey") |
| | | public ResponseMsg<String> getPublicKey() { |
| | | try { |
| | | String key = RsaHelper.getPublicKey(); |
| | | |
| | | return success(key); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "æå
¥æä½æ¥å¿") |
| | | @GetMapping("/insertOpLog") |
| | | public ResponseMsg<Object> insertOpLog(String m1, String m2, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(m1)) { |
| | | return fail("ä¸çº§æ¨¡åå¿
å¡«", 0); |
| | | } |
| | | |
| | | OperateEntity oe = new OperateEntity(); |
| | | oe.setIp(WebHelper.getIpAddress(req)); |
| | | oe.setModular1(m1); |
| | | oe.setModular2(m2); |
| | | oe.setType(0); |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | oe.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int rows = operateService.insertOperate(oe); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, 0); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.ctrl.CountEntity; |
| | | import com.moon.server.entity.sys.ReportEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.sys.ReportService; |
| | | import com.moon.server.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 javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ç»è®¡ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\æ°æ®ç»è®¡") |
| | | @RestController |
| | | @RequestMapping("/dataCount") |
| | | public class DataCountController extends BaseController { |
| | | @Autowired |
| | | ReportService reportService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "code", value = "ç¼ç ", dataType = "String", paramType = "query", example = "countOperates"), |
| | | @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<ReportEntity>> selectByPageAndCount(String name, String code, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = reportService.selectCount(name, code); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ReportEntity> rs = reportService.selectByPage(name, code, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ°æ®éç»è®¡") |
| | | @GetMapping(value = "/selectCountSizes") |
| | | public ResponseMsg<Object> selectCountSizes() { |
| | | try { |
| | | List<CountEntity> list = reportService.countSizes(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æå¡è°ç¨éç»è®¡") |
| | | @GetMapping(value = "/selectCountServices") |
| | | public ResponseMsg<Object> selectCountServices() { |
| | | try { |
| | | List<CountEntity> list = reportService.countServices(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç¨æ·æµéç»è®¡") |
| | | @GetMapping(value = "/selectCountOperates") |
| | | public ResponseMsg<Object> selectCountOperates() { |
| | | try { |
| | | List<CountEntity> list = reportService.countOperates(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æ¥å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "æ¥åID", dataType = "Integer", paramType = "7") |
| | | }) |
| | | @GetMapping(value = "/downloadReport") |
| | | public void downloadReport(Integer id, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return; |
| | | } |
| | | |
| | | ReportEntity re = reportService.selectById(id); |
| | | if (null == re || StringHelper.isEmpty(re.getGuid()) || StringHelper.isEmpty(re.getType()) || StringHelper.isEmpty(re.getCode())) { |
| | | return; |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | reportService.createReport(ue, re, res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseQueryController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.data.DataQueryService; |
| | | import com.moon.server.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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * æ°æ®æ£ç´¢ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\æ°æ®æ¥è¯¢") |
| | | @RestController |
| | | @RequestMapping("/dataQuery") |
| | | public class DataQueryController extends BaseQueryController { |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DataQueryService dataQueryService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ResponseBody |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tabName", value = "表å", dataType = "String", paramType = "query", example = "lf.sys_style"), |
| | | @ApiImplicitParam(name = "eventid", value = "主é®", dataType = "String", paramType = "query", example = "fa25979a5ef8b43ba82a0be35b3fb0d4") |
| | | }) |
| | | @PostMapping(value = "/uploadFiles") |
| | | public ResponseMsg<Integer> uploadFiles(String tabName, String eventid, @RequestParam("file") MultipartFile[] files, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(tabName) || StringHelper.isEmpty(eventid)) { |
| | | return fail("åæ°ä¸è½ä¸ºç©º", null); |
| | | } |
| | | if (null == files || files.length == 0) { |
| | | return fail("æä»¶ä¸ä¼ 为空", 0); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | Integer count = dataQueryService.uploadFiles(ue, tabName, eventid, files, req); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, 0); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.ctrl.TabEntity; |
| | | import com.moon.server.entity.data.DictEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.data.DictService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\åå
¸ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/dict") |
| | | public class DictController extends BaseController { |
| | | @Autowired |
| | | DictService dictService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "表空é´", dataType = "String", paramType = "query", required = false, example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_hyda") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String ns, String tab) { |
| | | try { |
| | | int count = dictService.selectCount(ns, tab); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "表空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_hyda"), |
| | | @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<DictEntity>> selectByPage(String ns, String tab, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<DictEntity> rs = dictService.selectByPage(ns, tab, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "表空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_hyda"), |
| | | @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<DictEntity>> selectByPageAndCount(String ns, String tab, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = dictService.selectCount(ns, tab); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<DictEntity> rs = dictService.selectByPage(ns, tab, 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<DictEntity> selectById(int id) { |
| | | try { |
| | | DictEntity entity = dictService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢åå
¸è¡¨ç»æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "ç¹"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "嫿Geomåæ®µ", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectDictTab") |
| | | public ResponseMsg<List<TabEntity>> selectDictTab(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody DictEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = dictService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<DictEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DictEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = dictService.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 { |
| | | int count = dictService.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 = dictService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody DictEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = dictService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DictEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<DictEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DictEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = dictService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.data.DirEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.data.DirService; |
| | | import com.moon.server.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 javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç®å½ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-22 |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\ç®å½ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/dir") |
| | | public class DirController extends BaseController { |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertDir", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertDir(@RequestBody DirEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | dirService.insert(entity); |
| | | |
| | | return success(entity.getId()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertDirs", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertDirs(@RequestBody List<DirEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | for (DirEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = dirService.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 = "/deleteDir") |
| | | public ResponseMsg<Integer> deleteDir(int id) { |
| | | try { |
| | | int count = dirService.deleteDir(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "com.lf.server.entity.data.DirEntity", paramType = "body", example = "") |
| | | }) |
| | | @GetMapping(value = "/deleteDirs") |
| | | public ResponseMsg<Integer> deleteDirs(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = dirService.deleteDirs(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DictEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateDir", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateDir(@RequestBody DirEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = dirService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DirEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateDirs", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateDirs(@RequestBody List<DirEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DirEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = dirService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectDir") |
| | | public ResponseMsg<DirEntity> selectDir(int id) { |
| | | try { |
| | | DirEntity dirEntity = dirService.selectDir(id); |
| | | |
| | | return success(dirEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æææ°æ®") |
| | | @GetMapping(value = "/selectDirAll") |
| | | public ResponseMsg<List<DirEntity>> selectDirAll() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirAll(); |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½ç®å½ç»æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç®å½ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/downloadDir") |
| | | public void downloadDir(int id, HttpServletResponse res) { |
| | | try { |
| | | DirEntity entity = dirService.selectDir(id); |
| | | if (null == entity || entity.getPid() > 0) { |
| | | return; |
| | | } |
| | | |
| | | String zipFile = dirService.createDirs(id); |
| | | if (null == zipFile) { |
| | | return; |
| | | } |
| | | |
| | | WebHelper.download(zipFile, entity.getName() + ".zip", res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.ctrl.TabEntity; |
| | | import com.moon.server.entity.data.DomainEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.all.BaseQueryService; |
| | | import com.moon.server.service.data.DictService; |
| | | import com.moon.server.service.data.DomainService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * å¼å |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\å¼å") |
| | | @RestController |
| | | @RequestMapping("/domain") |
| | | public class DomainController extends BaseController { |
| | | @Autowired |
| | | DomainService domainService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | DictService dictService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_aanp"), |
| | | @ApiImplicitParam(name = "code", value = "ç¼ç ", dataType = "String", paramType = "query", example = "210") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String ns, String tab, String code) { |
| | | try { |
| | | int count = domainService.selectCount(ns, tab, code); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg_25w_aanp"), |
| | | @ApiImplicitParam(name = "code", value = "ç¼ç ", dataType = "String", paramType = "query", example = "210"), |
| | | @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<DomainEntity>> selectByPage(String ns, String tab, String code, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<DomainEntity> rs = domainService.selectByPage(ns, tab, code, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "b_hy20w_s23"), |
| | | @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<DomainEntity>> selectByPageAndCount(String ns, String tab, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = domainService.selectCount(ns, tab, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<DomainEntity> rs = domainService.selectByPage(ns, tab, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<DomainEntity>> selectAll() { |
| | | try { |
| | | List<DomainEntity> list = domainService.selectAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¼å表éå") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "b_"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "嫿Geomåæ®µ", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectDomainTabs") |
| | | public ResponseMsg<List<TabEntity>> selectDomainTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è¡¨åæ¥è¯¢å¼ååç§°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "b_hy20w_s23") |
| | | }) |
| | | @GetMapping(value = "/selectDomainNames") |
| | | public ResponseMsg<List<String>> selectDomainNames(String ns, String tab) { |
| | | try { |
| | | if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { |
| | | return fail("å称空é´å表åä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<String> list = domainService.selectDomainNames(ns, tab); |
| | | |
| | | 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<DomainEntity> selectById(int id) { |
| | | try { |
| | | DomainEntity entity = domainService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DomainEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody DomainEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = domainService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DomainEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<DomainEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DomainEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = domainService.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 { |
| | | int count = domainService.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 = domainService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DomainEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody DomainEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = domainService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DomainEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<DomainEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DomainEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = domainService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.data.LayerEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.data.LayerService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * å¾å±ç®¡ç |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\å¾å±ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/layer") |
| | | public class LayerController extends BaseController { |
| | | @Autowired |
| | | LayerService layerService; |
| | | |
| | | @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); |
| | | } |
| | | } |
| | | |
| | | @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 = "/selectByPageAndCount") |
| | | public ResponseMsg<List<LayerEntity>> selectByPageAndCount(String cnName, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = layerService.selectCount(cnName); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<LayerEntity> rs = layerService.selectByPage(cnName, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<LayerEntity>> selectAll() { |
| | | try { |
| | | List<LayerEntity> list = layerService.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<LayerEntity> selectById(int id) { |
| | | try { |
| | | LayerEntity entity = layerService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "LayerEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody LayerEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = layerService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "LayerEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<LayerEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (LayerEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = layerService.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 { |
| | | int count = layerService.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 = layerService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "LayerEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody LayerEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = layerService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "LayerEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<LayerEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (LayerEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = layerService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.DownloadReqEntity; |
| | | import com.moon.server.entity.ctrl.IdNameEntity; |
| | | import com.moon.server.entity.data.DictEntity; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.data.MetaEntity; |
| | | import com.moon.server.entity.data.VerEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.ClassHelper; |
| | | import com.moon.server.helper.Md5Helper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.mapper.all.BasicMapper; |
| | | import com.moon.server.service.all.BaseQueryService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.data.MetaService; |
| | | import com.moon.server.service.data.VerService; |
| | | import com.moon.server.service.sys.DepService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.helper.StringHelper; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
æ°æ® |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\ä¿¡æ¯ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/meta") |
| | | public class MetaController extends BaseController { |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @Autowired |
| | | VerService verService; |
| | | |
| | | @Autowired |
| | | DepService depService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dircode", value = "ç®å½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "verid", value = "çæ¬ID", dataType = "Integer", paramType = "query", example = "0"), |
| | | @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<MetaEntity>> selectByPageAndCount(String depcode, String dircode, Integer verid, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = metaService.selectCount(depcode, dircode, verid, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectByPage(depcode, dircode, verid, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¶IDå页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "metaid", value = "ç¶ID", dataType = "String", paramType = "query", example = "0"), |
| | | @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 = "/selectPageAndCountByPid") |
| | | public ResponseMsg<List<MetaEntity>> selectPageAndCountByPid(Integer metaid, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | if (null == metaid || metaid < 1) { |
| | | return fail("ç¶IDä¸è½ä¸ºç©ºä¸å¤§äº1", null); |
| | | } |
| | | |
| | | int count = metaService.selectCountByPid(metaid, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectPageByPid(metaid, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç®å½IDæ¥è¯¢çæ¬å表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectVerByDirid") |
| | | public ResponseMsg<List<VerEntity>> selectVerByDirid(Integer dirid) { |
| | | try { |
| | | if (null == dirid || dirid < 0) { |
| | | dirid = 0; |
| | | } |
| | | |
| | | List<VerEntity> list = verService.selectByDirid(dirid); |
| | | if (null == list || list.isEmpty()) { |
| | | list = verService.selectByDirid(0); |
| | | } |
| | | |
| | | 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<MetaEntity> selectById(int id) { |
| | | try { |
| | | MetaEntity entity = metaService.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 = "115"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10") |
| | | }) |
| | | @GetMapping(value = "/selectDbData") |
| | | public ResponseMsg<Object> selectDbData(Integer id, Integer pageIndex, Integer pageSize) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | if (null == id || id < 0) { |
| | | return fail("å
æ°æ®IDä¸è½ä¸ºç©ºæå°äº0", null); |
| | | } |
| | | |
| | | MetaEntity meta = metaService.selectById(id); |
| | | if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) { |
| | | return fail("æ¾ä¸å°å
æ°æ®ä¿¡æ¯", null); |
| | | } |
| | | |
| | | String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase(); |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(entity); |
| | | if (null == baseMapper) { |
| | | return null; |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("parentid", meta.getEventid()); |
| | | |
| | | Page<Object> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.desc("gid")); |
| | | IPage<Object> paged = baseMapper.selectPage(page, wrapper); |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å段信æ¯") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg25wAanp") |
| | | }) |
| | | @GetMapping(value = "/selectTabFields") |
| | | public ResponseMsg<List<DictEntity>> selectTabFields(String ns, String tab) { |
| | | try { |
| | | if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { |
| | | return fail("å称空é´å表åä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<DictEntity> list = baseQueryService.selectFields(ns, tab); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody MetaEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | entity.setCreateTime(WebHelper.getCurrentTimestamp()); |
| | | int count = metaService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<MetaEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MetaEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = metaService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = metaService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody MetaEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = metaService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<MetaEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MetaEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = metaService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @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 = "/selectPageCountForDownload") |
| | | public ResponseMsg<List<DownloadEntity>> selectPageCountForDownload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | int count = downloadService.selectCountForUser(ue.getId(), "3,4", name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), "3,4", name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å
æ°æ®ä¸æº¢åºçåä½ID") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "reqEntity", value = "请æ±ä¸è½½å®ä½", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectMetaOverflowDep") |
| | | public ResponseMsg<Object> selectMetaOverflowDep(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çæä»¶ID"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return success(new ArrayList<String>()); |
| | | } |
| | | |
| | | List<String> list = metaService.selectMetaOverflowDep(ue, dr); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®åä½ç¼ç æ°ç»æ¥è¯¢åä½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "codes", value = "åä½ç¼ç æ°ç»", dataType = "String", paramType = "query", allowMultiple = true, example = "00,0001") |
| | | }) |
| | | @GetMapping(value = "/selectDepsByCodes") |
| | | public ResponseMsg<Object> selectDepsByCodes(String[] codes) { |
| | | try { |
| | | if (null == codes || codes.length == 0) { |
| | | return fail("åä½IDéå为空"); |
| | | } |
| | | |
| | | List<IdNameEntity> list = depService.selectDepsByCodes(codes); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请æ±å
æ°æ®ä¸è½½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dr", value = "请æ±ä¸è½½å®ä½ç±»", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReq") |
| | | public ResponseMsg<Object> downloadReq(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || StringHelper.isEmpty(dr.getPwd())) { |
| | | return fail("å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çæä»¶ID"); |
| | | } |
| | | if (!DownloadService.decryptPwd(dr)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (StringHelper.isPwdInvalid(dr.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = metaService.downloadMeteReq(ue, dr); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "pwd", value = "å¯ç ", dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectDownloadFile") |
| | | public ResponseMsg<Boolean> selectDownloadFile(String guid, String pwd) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { |
| | | return fail("æä»¶IDåå¯ç ä¸è½ä¸ºç©º", null); |
| | | } |
| | | if (!pwd.endsWith(StaticData.EQ)) { |
| | | pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); |
| | | } |
| | | |
| | | String password = DownloadService.decryptPwd(pwd); |
| | | if (null == password) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | return fail("æä»¶ä¸åå¨", null); |
| | | } |
| | | if (!StringHelper.isNull(de.getPwd()) && !Md5Helper.validatePassword(password, de.getPwd())) { |
| | | return fail("å¯ç 䏿£ç¡®", null); |
| | | } |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | File file = new File(filePath); |
| | | |
| | | return success(file.exists()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "pwd", value = "å¯ç ", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @GetMapping(value = "/downloadFile") |
| | | public void downloadFile(String guid, String pwd, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "æä»¶IDåå¯ç ä¸è½ä¸ºç©º", res); |
| | | } |
| | | if (!pwd.endsWith(StaticData.EQ)) { |
| | | pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); |
| | | } |
| | | |
| | | String password = DownloadService.decryptPwd(pwd); |
| | | if (null == password) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "å¯ç è§£å¯å¤±è´¥", res); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | WebHelper.writeInfo(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨", res); |
| | | return; |
| | | } |
| | | if (!StringHelper.isNull(de.getPwd()) && !Md5Helper.validatePassword(password, de.getPwd())) { |
| | | WebHelper.writeInfo(HttpStatus.UNAUTHORIZED, "å¯ç 䏿£ç¡®", res); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥çæä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/downloadForView") |
| | | public void downloadForView(String guid, HttpServletResponse res) { |
| | | metaService.downloadForView(guid, true, res); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.ctrl.PubEntity; |
| | | import com.moon.server.entity.data.MetaEntity; |
| | | import com.moon.server.entity.data.PublishEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.data.PublishService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * æ°æ®åå¸ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\åå¸ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/publish") |
| | | public class PublishController extends BaseController { |
| | | @Autowired |
| | | PublishService publishService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å
æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dircode", value = "ç®å½ç¼ç ", dataType = "String", paramType = "query", example = "01"), |
| | | @ApiImplicitParam(name = "verid", value = "çæ¬ID", dataType = "Integer", paramType = "query", example = "0"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å«", dataType = "String", paramType = "query", example = "DOM"), |
| | | @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 = "/selectMetasByPage") |
| | | public ResponseMsg<Object> selectMetasByPage(String depcode, String dircode, Integer verid, String type, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | if (StringHelper.isEmpty(type)) { |
| | | return fail("æ°æ®ç±»å«ä¸ºç©º", null); |
| | | } |
| | | |
| | | String types = getType(type); |
| | | int count = publishService.selectMetasByCount(depcode, dircode, verid, types, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = publishService.selectMetasByPage(depcode, dircode, verid, types, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åç±»å |
| | | */ |
| | | private String getType(String type) throws Exception { |
| | | switch (type) { |
| | | case "DOM": |
| | | return "type in ('tif', 'tiff', 'img')"; |
| | | case "DEM": |
| | | return "type in ('tif', 'tiff')"; |
| | | case "MPT": |
| | | return "type = 'mpt'"; |
| | | case "3DML": |
| | | return "type = '3dml'"; |
| | | case "BIM": |
| | | return "type in ('ifc', 'fbx', 'rvt')"; |
| | | default: |
| | | throw new Exception("æ°æ®ç±»åä¸å¹é
"); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @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<PublishEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = publishService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<PublishEntity> rs = publishService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<PublishEntity> selectById(int id) { |
| | | try { |
| | | PublishEntity entity = publishService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å叿°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "PubEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertForPub", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Object> insertForPub(@RequestBody PubEntity entity, HttpServletRequest req) { |
| | | try { |
| | | if (null == entity || null == entity.getIds() || entity.getIds().isEmpty()) { |
| | | return fail("å®ä½ç±»ä¸ºç©ºææ¾ä¸å°å
æ°æ®ID", 0); |
| | | } |
| | | if (StringHelper.isEmpty(entity.getType())) { |
| | | return fail("æ°æ®ç±»å«ä¸ºç©º", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserId(ue.getId()); |
| | | entity.setToken(WebHelper.getToken(req)); |
| | | } |
| | | |
| | | String method = getConvertMethod(entity.getType()); |
| | | long count = publishService.postForPub(entity, method, req); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åè½¬æ¢æ¹æ³ |
| | | */ |
| | | private String getConvertMethod(String type) throws Exception { |
| | | switch (type) { |
| | | case "DOM": |
| | | return "/Convert/ToTiles"; |
| | | case "DEM": |
| | | return "/Convert/ToTerra"; |
| | | case "MPT": |
| | | case "3DML": |
| | | return "/Convert/ToSG"; |
| | | case "BIM": |
| | | return "/Convert/ToTileset"; |
| | | default: |
| | | throw new Exception("æ°æ®ç±»åä¸å¹é
"); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids, HttpServletRequest req) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = publishService.deletes(ids, req); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "PublishEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody PublishEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = publishService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.ctrl.DownloadReqEntity; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.data.StyleEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.data.StyleService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ ·å¼ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09.26 |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\æ ·å¼ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/style") |
| | | public class StyleController extends BaseController { |
| | | @Autowired |
| | | StyleService styleService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | private final static String TAB_NAME = "lf.sys_style"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", required = false, example = "a") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name) { |
| | | try { |
| | | int count = styleService.selectCount(name); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", required = false, example = "a"), |
| | | @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<StyleEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 0) { |
| | | return fail("å页æ°å°äº1æå页索å¼å°äº0", null); |
| | | } |
| | | |
| | | List<StyleEntity> rs = styleService.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 = "a"), |
| | | @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<StyleEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 0) { |
| | | return fail("å页æ°å°äº1æå页索å¼å°äº0", null); |
| | | } |
| | | |
| | | int count = styleService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<StyleEntity> rs = styleService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.data.StyleEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertStyle", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertStyle(@RequestBody StyleEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = styleService.insertStyle(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "com.lf.server.entity.data.StyleEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertStyles", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertStyles(@RequestBody List<StyleEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (StyleEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = styleService.insertStyles(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 = "/deleteStyle") |
| | | public ResponseMsg<Integer> deleteStyle(int id) { |
| | | try { |
| | | int count = styleService.deleteStyle(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") |
| | | }) |
| | | @GetMapping(value = "/deleteStyles") |
| | | public ResponseMsg<Integer> deleteStyles(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = styleService.deleteStyles(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "StyleEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateStyle", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateStyle(@RequestBody StyleEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = styleService.updateStyle(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectStyle") |
| | | public ResponseMsg<StyleEntity> selectStyle(int id) { |
| | | try { |
| | | StyleEntity styleEntity = styleService.selectStyle(id); |
| | | |
| | | return success(styleEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectStyleAll") |
| | | public ResponseMsg<List<StyleEntity>> selectStyleAll() { |
| | | |
| | | try { |
| | | List<StyleEntity> list = styleService.selectStyleAll(); |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | return uploadAttachService.upload(ue, TAB_NAME, file, this); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, res); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query") |
| | | }) |
| | | @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) |
| | | public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | WebHelper.writeStr2Page(res, WebHelper.getErrJson(HttpStatus.UNAUTHORIZED, "ç¨æ·æªç»å½")); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (de == null) { |
| | | WebHelper.writeStr2Page(res, WebHelper.getErrJson(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨")); |
| | | } |
| | | |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeStr2Page(res, WebHelper.getErrJson(HttpStatus.UNAUTHORIZED, ex.getMessage())); |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请æ±ä¸è½½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guids", value = "éä»¶Guidæ°ç»", dataType = "String", paramType = "body", allowMultiple = true, example = "e5b6ae0889b88111f13a4b6e048348db,fa4f299e901a0c46e634f8fcc8185c0c") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReqForGuids") |
| | | public ResponseMsg<Object> downloadReqForGuids(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dre || null == dre.getGuids() || dre.getGuids().isEmpty()) { |
| | | return fail("Guidæ°ç»ä¸ºç©º"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = uploadAttachService.downloadReqForGuids(ue, dre.getGuids()); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.data.VerEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.data.VerService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * çæ¬è¡¨ |
| | | * @author SWS |
| | | * @date 2022-09.29 |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\çæ¬ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/ver") |
| | | public class VerController extends BaseController { |
| | | @Autowired |
| | | VerService versionService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query", example = "10"), |
| | | @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<VerEntity>> selectByPageAndCount(Integer dirid, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = versionService.selectCount(dirid, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<VerEntity> rs = versionService.selectByPage(dirid, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.data.VersionEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertVersion", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertVersion(@RequestBody VerEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = versionService.insertVersion(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<VersionEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertVersions", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertVersions(@RequestParam List<VerEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (VerEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = versionService.insertVersions(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 = "/deleteVersion") |
| | | public ResponseMsg<Integer> deleteVersion(int id) { |
| | | try { |
| | | int count = versionService.deleteVersion(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteVersions") |
| | | public ResponseMsg<Integer> deleteVersions(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | int count = versionService.deleteVersions(ids); |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "VersionEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateVersion", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateVersion(@RequestBody VerEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = versionService.updateVersion(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectVersion") |
| | | public ResponseMsg<VerEntity> selectVersion(int id) { |
| | | try { |
| | | VerEntity verEntity = versionService.selectVersion(id); |
| | | |
| | | return success(verEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectVersionAll") |
| | | public ResponseMsg<List<VerEntity>> selectVersionAll() { |
| | | try { |
| | | List<VerEntity> list = versionService.selectVersionAll(); |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.config.PropertiesConfig; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.server.ServerHttpRequest; |
| | | import org.springframework.http.server.ServerHttpResponse; |
| | | import org.springframework.http.server.ServletServerHttpRequest; |
| | | import org.springframework.http.server.ServletServerHttpResponse; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.Duration; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * WMTSæå¡ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\WMTSæå¡") |
| | | @RestController |
| | | @RequestMapping("/wmts") |
| | | public class WmtsController { |
| | | @Autowired |
| | | PropertiesConfig config; |
| | | |
| | | private final static Log log = LogFactory.getLog(WmtsController.class); |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "è·åWMTSå
æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "token", value = "令ç", required = true, dataType = "String", defaultValue = "token", paramType = "path") |
| | | }) |
| | | @GetMapping("select/{token}/WMTSCapabilities.xml") |
| | | public void selectWmtsCapabilities(@PathVariable(name = "token") String token, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | ClassPathResource resource = new ClassPathResource("wmts/web.xml"); |
| | | if (!resource.exists()) { |
| | | return; |
| | | } |
| | | |
| | | InputStream stream = resource.getInputStream(); |
| | | byte[] data = new byte[stream.available()]; |
| | | stream.read(data); |
| | | stream.close(); |
| | | |
| | | String url = req.getRequestURL().toString().replace("WMTSCapabilities.xml", "tile?"); |
| | | |
| | | String result = new String(data, StandardCharsets.UTF_8); |
| | | result = result.replace("{url}", url); |
| | | byte[] bytes = result.getBytes(StandardCharsets.UTF_8); |
| | | |
| | | res.setHeader("Content-Type", "application/xml;charset=UTF-8"); |
| | | ServletOutputStream os = res.getOutputStream(); |
| | | os.write(bytes); |
| | | os.flush(); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åWMTSç¦ç") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "token", value = "令ç", required = true, dataType = "String", defaultValue = "token", paramType = "path"), |
| | | @ApiImplicitParam(name = "layer", value = "å¾å±ç±»å", required = true, dataType = "String", defaultValue = "img"), |
| | | @ApiImplicitParam(name = "tilematrix", value = "å±çº§", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "tilerow", value = "è¡å·", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "tilecol", value = "åå·", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("select/{token}/tile") |
| | | public void selectWmtsTile(@PathVariable(name = "token") String token, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | String layer = WebHelper.getReqParamVal(req, "layer"); |
| | | String matrix = WebHelper.getReqParamVal(req, "tilematrix"); |
| | | String row = WebHelper.getReqParamVal(req, "tilerow"); |
| | | String col = WebHelper.getReqParamVal(req, "tilecol"); |
| | | if (StringHelper.isEmpty(layer) || StringHelper.isEmpty(matrix) || StringHelper.isEmpty(layer) || StringHelper.isEmpty(row) || StringHelper.isEmpty(col)) { |
| | | return; |
| | | } |
| | | |
| | | int z = Integer.parseInt(matrix); |
| | | int x = Integer.parseInt(row); |
| | | int y = Integer.parseInt(col); |
| | | |
| | | getWmtsTile(layer, z, x, y, req, res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åWMTSç¦ç |
| | | */ |
| | | private void getWmtsTile(String layer, int z, int x, int y, HttpServletRequest req, HttpServletResponse res) throws Exception { |
| | | ServletServerHttpRequest ssReq = new ServletServerHttpRequest(req); |
| | | ServletServerHttpResponse ssRes = new ServletServerHttpResponse(res); |
| | | |
| | | // æ£æ¥ç¼åæ¯å¦è¿æ |
| | | if (checkIfNotModify(ssReq, ssRes)) { |
| | | // 设置ç¼å头 |
| | | setBrowerCache(ssRes); |
| | | return; |
| | | } |
| | | |
| | | // 设置ç¼ååæ° |
| | | setBrowerCache(ssRes); |
| | | //res.setContentType("image/png") |
| | | |
| | | // éè¿response对象ï¼è·åå°è¾åºæµ |
| | | ServletOutputStream outputStream = res.getOutputStream(); |
| | | // å®ä¹è¾å
¥æµï¼éè¿è¾å
¥æµè¯»åæä»¶å
容 |
| | | FileInputStream fileInputStream; |
| | | |
| | | // y = (int) Math.pow(2, z) - y - 1; |
| | | String path = config.getTilePath() + File.separator + layer + File.separator + z + File.separator + y + File.separator + x + ".png"; |
| | | System.out.println(path); |
| | | |
| | | File file = new File(path); |
| | | if (!file.exists() || file.isDirectory()) { |
| | | ClassPathResource resource = new ClassPathResource("wmts/nofound.png"); |
| | | fileInputStream = new FileInputStream(resource.getFile()); |
| | | } else { |
| | | System.out.println(path); |
| | | fileInputStream = new FileInputStream(file); |
| | | } |
| | | |
| | | int len = 0; |
| | | byte[] bytes = new byte[1024]; |
| | | while ((len = fileInputStream.read(bytes)) != -1) { |
| | | outputStream.write(bytes, 0, len); |
| | | outputStream.flush(); |
| | | } |
| | | //outputStream.close() |
| | | fileInputStream.close(); |
| | | |
| | | // 设置è¿åå¾çç±»å |
| | | ssRes.getHeaders().set("Content-Type", "image/png"); |
| | | |
| | | OutputStream os = ssRes.getBody(); |
| | | os.write(bytes); |
| | | os.flush(); |
| | | } |
| | | |
| | | /** |
| | | * 设置æµè§å¨ç¼ååæ° |
| | | */ |
| | | private void setBrowerCache(ServerHttpResponse res) { |
| | | HttpHeaders headers = res.getHeaders(); |
| | | headers.setCacheControl("public, must-revalidate"); |
| | | |
| | | headers.setExpires(System.currentTimeMillis() + 24 * 60 * 60 * 1000); |
| | | headers.setAccessControlMaxAge(Duration.ofHours(24)); |
| | | headers.setETag("\"" + new Date().toString() + "\""); |
| | | // must-revalidate |
| | | // response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); |
| | | } |
| | | |
| | | /** |
| | | * éªè¯ç¼ååæ° |
| | | */ |
| | | boolean checkIfNotModify(ServerHttpRequest req, ServerHttpResponse res) { |
| | | List<String> etags = req.getHeaders().getIfNoneMatch(); |
| | | if (0 == etags.size() || StringHelper.isEmpty(etags.get(0))) { |
| | | return false; |
| | | } |
| | | |
| | | res.setStatusCode(HttpStatus.NOT_MODIFIED); |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data.upload; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.FmeReqEntity; |
| | | import com.moon.server.entity.ctrl.RegisterEntity; |
| | | import com.moon.server.helper.HttpHelper; |
| | | import com.moon.server.helper.PathHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.data.FmeService; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ£æ¥æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | public class CheckController extends BaseController { |
| | | @Autowired |
| | | protected PathHelper pathHelper; |
| | | |
| | | @Autowired |
| | | protected FmeService fmeService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ä»»å¡ç¶æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ä»»å¡ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") |
| | | }) |
| | | @GetMapping(value = "/selectTaskStatus") |
| | | public Object selectTaskStatus(String id, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(id)) { |
| | | return fail("idä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | return fmeService.getTaskStatus(id, req); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½è´¨æ£ç»æ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ä»»å¡ID", dataType = "String", paramType = "query", example = "29db09ee-2aae-4c62-bec0-0b5c5d8084e4") |
| | | }) |
| | | @GetMapping(value = "/downloadResult") |
| | | public void downloadResult(String id, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (!StringHelper.isEmpty(id)) { |
| | | String url = fmeService.getDownloadUrl(id, req); |
| | | |
| | | HttpHelper httpHelper = new HttpHelper(); |
| | | // res.sendRedirect(url) |
| | | httpHelper.service(req, res, url, null); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æäº¤æ°æ®è´¨æ£") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "FME请æ±å®ä½ç±»", dataType = "FmeReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadChecks") |
| | | public ResponseMsg<Object> uploadChecks(@RequestBody FmeReqEntity entity, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(entity.names)) { |
| | | return fail("ä»»å¡åç§°ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringHelper.isEmpty(entity.zipPath)) { |
| | | return fail("è¯·éæ©å¾
è´¨æ£çzipæä»¶"); |
| | | } |
| | | |
| | | entity.zipPath = getFullPath(entity.zipPath); |
| | | if (!isZipFile(entity.zipPath)) { |
| | | return fail("å¾
è´¨æ£çzipæä»¶ä¸åå¨"); |
| | | } |
| | | if (entity.names.contains(StaticData.CHECK_MAIN)) { |
| | | entity.wbsPath = getFullPath(entity.wbsPath); |
| | | if (!isXlsFile(entity.wbsPath)) { |
| | | return fail("å¾
è´¨æ£çWBSæä»¶ä¸åå¨"); |
| | | } |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | for (String name : entity.names.split(StaticData.COMMA)) { |
| | | String guid = invoke(name, entity, req); |
| | | list.add(guid); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶è·¯å¾ |
| | | */ |
| | | private String getFullPath(String filePath) { |
| | | return null == filePath ? null : pathHelper.getConfig().getTempPath() + File.separator + filePath; |
| | | } |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºZipæä»¶ |
| | | */ |
| | | private boolean isZipFile(String filePath) { |
| | | if (null == filePath || !filePath.toLowerCase().endsWith(StaticData.ZIP)) { |
| | | return false; |
| | | } |
| | | |
| | | File zipFile = new File(filePath); |
| | | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºExcelæä»¶ |
| | | */ |
| | | private boolean isXlsFile(String filePath) { |
| | | if (null == filePath) { |
| | | return false; |
| | | } |
| | | if (!(filePath.toLowerCase().endsWith(StaticData.XLS) || filePath.toLowerCase().endsWith(StaticData.XLSX))) { |
| | | return false; |
| | | } |
| | | |
| | | File zipFile = new File(filePath); |
| | | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * æ¹æ³è°ç¨ |
| | | */ |
| | | private String invoke(String name, FmeReqEntity entity, HttpServletRequest req) throws Exception { |
| | | Method method; |
| | | try { |
| | | method = FmeService.class.getDeclaredMethod(name, FmeReqEntity.class, HttpServletRequest.class); |
| | | } catch (Exception ex) { |
| | | throw new Exception(name + "ï¼è¯¥æ£æ¥æ¹æ³ä¸åå¨"); |
| | | } |
| | | |
| | | Object obj = method.invoke(fmeService, entity, req); |
| | | |
| | | return null == obj ? null : obj.toString(); |
| | | } |
| | | |
| | | /*@SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢OSGBæ£æ¥") |
| | | @GetMapping(value = "/selectCheckOsgb") |
| | | public ResponseMsg<Object> selectCheckOsgb(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\OSGBæ£æ¥.zip"; |
| | | fme.imgResolution = 0.2; |
| | | |
| | | String rs = fmeService.checkOsgb(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è¡¨æ ¼æ°æ®æ£æ¥") |
| | | @GetMapping(value = "/selectCheckXls") |
| | | public ResponseMsg<Object> selectCheckXls(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\è¡¨æ ¼æ°æ®æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkXls(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç¹äºæ£æ¥") |
| | | @GetMapping(value = "/selectCheckLaz") |
| | | public ResponseMsg<Object> selectCheckLaz(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\ç¹äºæ£æ¥.zip"; |
| | | fme.lazDensity = 1; |
| | | |
| | | String rs = fmeService.checkLaz(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é«ç¨æ£æ¥") |
| | | @GetMapping(value = "/selectCheckDem") |
| | | public ResponseMsg<Object> selectCheckDem(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\é«ç¨æ£æ¥.zip"; |
| | | fme.demTolerance = 5; |
| | | fme.demChangeRate = 200; |
| | | |
| | | String rs = fmeService.checkDem(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å±æ§æ£æ¥") |
| | | @GetMapping(value = "/selectCheckAttrs") |
| | | public ResponseMsg<Object> selectCheckAttrs(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\屿§æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkAttrs(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æææ£æ¥") |
| | | @GetMapping(value = "/selectCheckTopology") |
| | | public ResponseMsg<Object> selectCheckTopology(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æææ£æ¥.zip"; |
| | | fme.polyTolerance = 0.001; |
| | | fme.lineTolerance = 0.001; |
| | | fme.pointTolerance = 0.001; |
| | | fme.gcdOffset = 20; |
| | | fme.kzdOffset = 100; |
| | | fme.rangeOffset = 200; |
| | | fme.xgMax = 0.005; |
| | | |
| | | String rs = fmeService.checkTopology(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¾é¢æ´é¥°æ£æ¥") |
| | | @GetMapping(value = "/selectCheckDecorate") |
| | | public ResponseMsg<Object> selectCheckDecorate(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\å¾é¢æ´é¥°æ£æ¥.zip"; |
| | | fme.xlsList = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æä»¶æ¸
å.xlsx"; |
| | | |
| | | String rs = fmeService.checkDecorate(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢åç¹æ£æ¥") |
| | | @GetMapping(value = "/selectCheckOrigin") |
| | | public ResponseMsg<Object> selectCheckOrigin(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\åç¹æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkOrigin(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ
æ ¼æ£æ¥") |
| | | @GetMapping(value = "/selectCheckDom") |
| | | public ResponseMsg<Object> selectCheckDom(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æ
æ ¼æ£æ¥.zip"; |
| | | fme.coordinateSystem = "CGCS2000/GK3d-93E_FME"; |
| | | fme.imgResolution = 0.2; |
| | | |
| | | String rs = fmeService.checkDom(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ°å¦åºç¡æ£æ¥") |
| | | @GetMapping(value = "/selectCheckMath") |
| | | public ResponseMsg<Object> selectCheckMath(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\æ°å¦åºç¡æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkMath(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å
æ°æ®æ£æ¥") |
| | | @GetMapping(value = "/selectCheckMeta") |
| | | public ResponseMsg<Object> selectCheckMeta(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\å
æ°æ®æ£æ¥.zip"; |
| | | |
| | | String rs = fmeService.checkMeta(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ»è´¨æ£") |
| | | @GetMapping(value = "/selectCheckMain") |
| | | public ResponseMsg<Object> selectCheckMain(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼.7z"; |
| | | fme.wbsPath = "D:\\Project\\Data\\LF\\temp\\20230107010101\\项ç®WBS导åº.xlsx"; |
| | | fme.isDiZai = "NO"; |
| | | fme.diZaiType = "NO"; |
| | | |
| | | String rs = fmeService.checkMain(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "é»è¾ä¸è´æ§æ£æ¥") |
| | | @GetMapping(value = "/checkLogical") |
| | | public ResponseMsg<Object> checkLogical(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.zipPath = "D:\\LF\\temp\\20230411\\æ°ååææ.zip"; |
| | | |
| | | String rs = fmeService.checkLogical(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å项ææå®æ´æ§æ£æ¥") |
| | | @GetMapping(value = "/checkSingleIntegrity") |
| | | public ResponseMsg<Object> checkSingleIntegrity(HttpServletRequest req) { |
| | | try { |
| | | FmeReqEntity fme = new FmeReqEntity(); |
| | | fme.xmmc = "西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116BT02ï¼"; |
| | | fme.sjzy = "æµéä¸ä¸"; |
| | | fme.sjfl = "æ°ååææ"; |
| | | fme.zipPath = "D:\\LF\\temp\\20230411\\æ°ååææ.zip"; |
| | | |
| | | String rs = fmeService.checkSingleIntegrity(fme, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("æ£æ¥å¤±è´¥"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | }*/ |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå¡æ³¨å") |
| | | @GetMapping(value = "/selectServerRegister") |
| | | public ResponseMsg<Object> selectServerRegister(HttpServletRequest req) { |
| | | try { |
| | | RegisterEntity rs = fmeService.serverRegister("西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116DT02ï¼", "http://127.0.0.1/LFData/2d/tiles/01/{z}/{x}/{y}.png", "DOM", req); |
| | | if (null == rs || StringHelper.isEmpty(rs.getSerialnum())) { |
| | | return fail("失败"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå¡ç³è¯·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "æå¡ID", dataType = "String", paramType = "query", example = "195f77eb-19dd-4e34-afc1-fcff8f758f7b"), |
| | | @ApiImplicitParam(name = "pubid", value = "åå¸ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | }) |
| | | @GetMapping(value = "/selectServerApply") |
| | | public ResponseMsg<Object> selectServerApply(String id, Integer pubid, HttpServletRequest req) { |
| | | try { |
| | | fmeService.serverApply(id, pubid, req); |
| | | |
| | | return success("OK"); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤èµæº") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "æå¡ID", dataType = "String", paramType = "query", example = "6f4b6783-4b98-4d46-a0d9-43cdb5f339dc") |
| | | }) |
| | | @GetMapping(value = "/selectDeleteRes") |
| | | public ResponseMsg<Object> selectDeleteRes(String id, HttpServletRequest req) { |
| | | try { |
| | | fmeService.deleteRes(id, req); |
| | | |
| | | return success("OK"); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data.upload; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.TabEntity; |
| | | import com.moon.server.entity.sys.DepEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.ClassHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.mapper.all.BasicMapper; |
| | | import com.moon.server.service.all.BaseQueryService; |
| | | import com.moon.server.service.data.*; |
| | | import com.moon.server.service.sys.DepService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.entity.data.*; |
| | | 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.GetMapping; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ§å¶å¨ |
| | | * @author WWW |
| | | */ |
| | | public class QueryController extends CheckController { |
| | | @Autowired |
| | | protected DepService depService; |
| | | |
| | | @Autowired |
| | | protected DirService dirService; |
| | | |
| | | @Autowired |
| | | protected VerService verService; |
| | | |
| | | @Autowired |
| | | protected MetaService metaService; |
| | | |
| | | @Autowired |
| | | protected TokenService tokenService; |
| | | |
| | | @Autowired |
| | | protected UploadService uploadService; |
| | | |
| | | @Autowired |
| | | protected BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | DictService dictService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¶IDå页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "metaid", value = "ç¶ID", dataType = "String", paramType = "query", example = "0"), |
| | | @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 = "/selectPageAndCountByPid") |
| | | public ResponseMsg<List<MetaEntity>> selectPageAndCountByPid(Integer metaid, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | if (null == metaid || metaid < 1) { |
| | | return fail("ç¶IDä¸è½ä¸ºç©ºä¸å¤§äº1", null); |
| | | } |
| | | |
| | | int count = metaService.selectCountByPid(metaid, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectPageByPid(metaid, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææåä½") |
| | | @GetMapping(value = "/selectDepAll") |
| | | public ResponseMsg<List<DepEntity>> selectDepAll() { |
| | | try { |
| | | List<DepEntity> list = depService.selectDepAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææç®å½") |
| | | @GetMapping(value = "/selectDirAll") |
| | | public ResponseMsg<List<DirEntity>> selectDirAll() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç®å½IDæ¥è¯¢çæ¬å表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectVerByDirid") |
| | | public ResponseMsg<List<VerEntity>> selectVerByDirid(Integer dirid) { |
| | | try { |
| | | if (null == dirid || dirid < 0) { |
| | | dirid = 0; |
| | | } |
| | | |
| | | List<VerEntity> list = verService.selectByDirid(dirid); |
| | | if (null == list || list.isEmpty()) { |
| | | list = verService.selectByDirid(0); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢åæ ç³»") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "zoning", value = "带å·", dataType = "String", paramType = "query", example = "6度æå¸¦å·") |
| | | }) |
| | | @GetMapping(value = "/selectCoords") |
| | | public ResponseMsg<Object> selectCoords(String zoning) { |
| | | try { |
| | | List<CoordEntity> list = uploadService.selectCoords(zoning); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢é¡¹ç®åç§°") |
| | | @GetMapping(value = "/selectProject") |
| | | public ResponseMsg<Object> selectProject() { |
| | | try { |
| | | List<DirEntity> list = uploadService.selectProject(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææè¡¨") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "ç¹"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "嫿Geomåæ®µ", dataType = "Boolean", paramType = "query", example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectTabs") |
| | | public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) { |
| | | try { |
| | | List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å段信æ¯") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "å称空é´", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "query", example = "dlg25wAanp") |
| | | }) |
| | | @GetMapping(value = "/selectFields") |
| | | public ResponseMsg<List<DictEntity>> selectFields(String ns, String tab) { |
| | | try { |
| | | if (StringHelper.isEmpty(ns) || StringHelper.isEmpty(tab)) { |
| | | return fail("å称空é´å表åä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<DictEntity> list = baseQueryService.selectFields(ns, tab); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è¡¨ä¸æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "å
æ°æ®ID", dataType = "Integer", paramType = "query", example = "115"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10") |
| | | }) |
| | | @GetMapping(value = "/selectDbData") |
| | | public ResponseMsg<Object> selectDbData(Integer id, Integer pageIndex, Integer pageSize) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | if (null == id || id < 0) { |
| | | return fail("å
æ°æ®IDä¸è½ä¸ºç©ºæå°äº0", null); |
| | | } |
| | | |
| | | MetaEntity meta = metaService.selectById(id); |
| | | if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) { |
| | | return fail("æ¾ä¸å°å
æ°æ®ä¿¡æ¯", null); |
| | | } |
| | | |
| | | String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase(); |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(entity); |
| | | if (null == baseMapper) { |
| | | return null; |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("parentid", meta.getEventid()); |
| | | |
| | | Page<Object> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.desc("gid")); |
| | | IPage<Object> paged = baseMapper.selectPage(page, wrapper); |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ä¸ä¼ æ°æ®å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @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 = "/selectByPageForUpload") |
| | | public ResponseMsg<Object> selectByPageForUpload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | int count = metaService.selectCountForUpload(name, ue.getId(), null); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> list = metaService.selectByPageForUpload(name, ue.getId(), null, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, 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 = "/selectMetaById") |
| | | public ResponseMsg<MetaEntity> selectMetaById(int id) { |
| | | try { |
| | | MetaEntity entity = metaService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.data.upload; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.ctrl.KeyValueEntity; |
| | | import com.moon.server.entity.data.DirEntity; |
| | | import com.moon.server.entity.data.MetaEntity; |
| | | import com.moon.server.entity.data.MetaFileEntity; |
| | | import com.moon.server.entity.data.VerEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.data.UploadService; |
| | | 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 javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®å
¥åº |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "æ°æ®ç®¡ç\\æ°æ®ä¸ä¼ ") |
| | | @RestController |
| | | @RequestMapping("/dataUpload") |
| | | public class UploadController extends QueryController { |
| | | @Autowired |
| | | UploadService uploadService; |
| | | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è·¯å¾") |
| | | @GetMapping(value = "/selectPath") |
| | | public ResponseMsg<String> selectPath() { |
| | | try { |
| | | String pathName = uploadService.selectPath(); |
| | | |
| | | return success(pathName); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadFiles") |
| | | public ResponseMsg<Object> uploadFiles(String path, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res); |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°ä¸ä¼ æä»¶", null); |
| | | } |
| | | |
| | | uploadService.copePath(list); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¶æ°ç»1ï¼@RequestParam(value = "ids")List<Integer> ids |
| | | * &ids=1209&ids=1180&ids=1387 |
| | | * æ¥æ¶æ°æ®2ï¼Integer[] ids |
| | | * formData.append("ids", 1209); formData.append("ids", 1180); formData.append("ids", 1387); |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ Exceléä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "ids", value = "å
æ°æ®éå", dataType = "Integer", allowMultiple = true, paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadXlsAnnex") |
| | | public ResponseMsg<Object> uploadXlsAnnex(String path, Integer[] ids, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | if (null == ids || ids.length == 0) { |
| | | return fail("æ¾ä¸å°å
æ°æ®çIDéå"); |
| | | } |
| | | |
| | | List<MetaEntity> ms = metaService.selectXlsAnnex(ids, UploadAttachService.getTabs()); |
| | | if (null == ms || ms.isEmpty()) { |
| | | return fail("æ¾ä¸å°è¦ä¸ä¼ éä»¶çå
æ°æ®"); |
| | | } |
| | | |
| | | List<MetaFileEntity> list = uploadService.uploadData(null, path, false, req, res); |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°ä¸ä¼ æä»¶", null); |
| | | } |
| | | |
| | | List<KeyValueEntity> rs = uploadAttachService.uploadXlsAnnex(ue, ms, list, path); |
| | | if (null == rs || rs.size() == 0) { |
| | | return fail("没æè¦æ´æ°çå
æ°æ®"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectFiles") |
| | | public ResponseMsg<List<MetaFileEntity>> selectFiles(String path) { |
| | | try { |
| | | List<MetaFileEntity> list = uploadService.selectFiles(path); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å 餿件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MetaEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/deleteFiles") |
| | | public ResponseMsg<Object> deleteFiles(@RequestBody List<MetaFileEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("æ²¡ææ¾å°æä»¶", null); |
| | | } |
| | | |
| | | int rows = uploadService.deleteFiles(list); |
| | | |
| | | return success("æå", rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ å°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "è·¯å¾", dataType = "String", paramType = "query", example = "20230110010101"), |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query", example = "163"), |
| | | @ApiImplicitParam(name = "verid", value = "çæ¬ID", dataType = "Integer", paramType = "query", example = "0"), |
| | | @ApiImplicitParam(name = "epsgCode", value = "åæ ç¼ç ", dataType = "String", paramType = "query", example = "EPSG:4490") |
| | | }) |
| | | @GetMapping(value = "/selectMappers") |
| | | public ResponseMsg<Object> selectMappers(String path, Integer dirid, Integer verid, String epsgCode, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(path) || StringHelper.isEmpty(epsgCode) || null == dirid || null == verid) { |
| | | return fail("è·¯å¾ãç®å½IDãçæ¬IDååæ ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (1 > uploadService.selectCount4Coord(epsgCode)) { |
| | | return fail("åæ ç¼ç " + epsgCode + "ä¸åå¨"); |
| | | } |
| | | DirEntity dir = dirService.selectDir(dirid); |
| | | if (null == dir) { |
| | | return fail("ç®å½ID=" + dirid + "ä¸åå¨"); |
| | | } |
| | | VerEntity ver = verService.selectVersion(verid); |
| | | if (null == ver) { |
| | | return fail("çæ¬ID=" + verid + "ä¸åå¨"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | List<MetaFileEntity> list = uploadService.selectMappers(ue, path, dir, ver, epsgCode); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å
æ°æ®æä»¶éå", dataType = "MetaFileEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/insertFiles") |
| | | public ResponseMsg<Object> insertFiles(@RequestBody List<MetaFileEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (null == ue) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | if (null == list || list.isEmpty()) { |
| | | return fail("å
æ°æ®æä»¶éå为空", null); |
| | | } |
| | | |
| | | uploadService.insertFiles(ue, list, req); |
| | | |
| | | return success("æå", list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å
æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteMetas") |
| | | public ResponseMsg<Integer> deleteMetas(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = metaService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.DownloadReqEntity; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.show.ApplyEntity; |
| | | import com.moon.server.entity.show.FlowEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.AesHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.show.ApplyService; |
| | | import com.moon.server.service.show.FlowService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.service.sys.UserService; |
| | | 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 javax.servlet.http.HttpServletResponse; |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\æ°æ®ç³è¯·") |
| | | @RestController |
| | | @RequestMapping("/apply") |
| | | public class ApplyController extends BaseController { |
| | | @Autowired |
| | | ApplyService applyService; |
| | | |
| | | @Autowired |
| | | FlowService flowService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥æ°æ®ç³è¯·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dr", value = "请æ±ä¸è½½å®ä½", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/insertApply") |
| | | public ResponseMsg<Object> insertApply(@RequestBody DownloadReqEntity dr, HttpServletRequest req) { |
| | | try { |
| | | if (null == dr || null == dr.getEntities() || dr.getEntities().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çå®ä½å"); |
| | | } |
| | | if (StringHelper.isEmpty(dr.getPwd())) { |
| | | return fail("å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | dr.setPwd(AesHelper.decrypt(dr.getPwd())); |
| | | if (StringHelper.isPwdInvalid(dr.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | if (!StringHelper.isEmpty(dr.getWkt())) { |
| | | dr.setWkt(AesHelper.decrypt(dr.getWkt())); |
| | | } |
| | | if (null == dr.getTabs() || dr.getTabs().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½ç表å"); |
| | | } |
| | | if (null == dr.getDepcodes() || dr.getDepcodes().isEmpty()) { |
| | | return fail("è¯·éæ©å¾
ç³è¯·çåä½ç¼ç (å¤ä¸ªä»¥éå·éå¼)"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | int rows = applyService.insertApply(ue, dr); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ç³è¯·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "å"), |
| | | @ApiImplicitParam(name = "status", value = "ç¶æ", dataType = "Integer", paramType = "query", example = "0"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-12-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-12-31 23:00:00"), |
| | | @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<Object> selectByPage(String uname, Integer status, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = applyService.selectCount(uname, status, start, end); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | List<ApplyEntity> rs = applyService.selectByPage(ue.getId(), uname, status, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¾
å®¡æ ¸æ°") |
| | | @GetMapping(value = "/selectSubmits") |
| | | public ResponseMsg<Object> selectSubmits(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | int rows = applyService.selectSubmits(ue.getId()); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æµç¨") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "applyid", value = "æ°æ®ç³è¯·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectFlows") |
| | | public ResponseMsg<Object> selectFlows(Integer applyid) { |
| | | try { |
| | | List<FlowEntity> rs = applyService.selectFlows(applyid); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "åºå¼ç³è¯·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "applyid", value = "æ°æ®ç³è¯·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/updateForDiscard") |
| | | public ResponseMsg<Object> updateForDiscard(Integer applyid, HttpServletRequest req) { |
| | | try { |
| | | ApplyEntity applyEntity = applyService.selectById(applyid); |
| | | if (null == applyEntity) { |
| | | return fail("æ¾ä¸å°æ°æ®ç³è¯·"); |
| | | } |
| | | if (!(applyEntity.getStatus() >= -1 && applyEntity.getStatus() <= StaticData.NINE)) { |
| | | return fail("è¯¥æ°æ®ç³è¯·æ æ³åºå¼"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | int rows = applyService.updateForDiscard(ue.getId(), applyid); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "éæ°æäº¤") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "applyid", value = "æ°æ®ç³è¯·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/updateForResubmit") |
| | | public ResponseMsg<Object> updateForResubmit(Integer applyid, HttpServletRequest req) { |
| | | try { |
| | | ApplyEntity applyEntity = applyService.selectById(applyid); |
| | | if (null == applyEntity) { |
| | | return fail("æ¾ä¸å°æ°æ®ç³è¯·"); |
| | | } |
| | | if (-1 != applyEntity.getStatus()) { |
| | | return fail("è¯¥æ°æ®ç³è¯·æ ééæ°æäº¤"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | int rows = applyService.updateForResubmit(ue.getId(), applyid); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æäº¤æµç¨") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "flowId", value = "ç³è¯·æµç¨ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/updateForSubmit") |
| | | public ResponseMsg<Object> updateForSubmit(Integer flowId, HttpServletRequest req) { |
| | | try { |
| | | FlowEntity flowEntity = flowService.selectById(flowId); |
| | | if (null == flowEntity) { |
| | | return fail("æ¾ä¸å°ç³è¯·æµç¨"); |
| | | } |
| | | if (flowEntity.getStatus() != 0) { |
| | | return fail("该ç³è¯·æµç¨æ éæäº¤"); |
| | | } |
| | | |
| | | ApplyEntity applyEntity = applyService.selectById(flowEntity.getApplyid()); |
| | | if (null == applyEntity) { |
| | | return fail("æ¾ä¸å°æ°æ®ç³è¯·"); |
| | | } |
| | | if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) { |
| | | return fail("è¯¥æ°æ®ç³è¯·æ éæå"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | int rows = applyService.updateForSubmit(ue.getId(), applyEntity.getId(), flowEntity.getId()); |
| | | |
| | | applyEntity = applyService.selectById(applyEntity.getId()); |
| | | if (StaticData.TEN == applyEntity.getStatus()) { |
| | | UserEntity user = userService.selectUser(applyEntity.getUserid()); |
| | | applyService.zipDbData(user, applyEntity); |
| | | } |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æåæµç¨") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "flowId", value = "ç³è¯·æµç¨ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/updateForReject") |
| | | public ResponseMsg<Object> updateForReject(Integer flowId, HttpServletRequest req) { |
| | | try { |
| | | FlowEntity flowEntity = flowService.selectById(flowId); |
| | | if (null == flowEntity) { |
| | | return fail("æ¾ä¸å°ç³è¯·æµç¨"); |
| | | } |
| | | if (flowEntity.getStatus() != 0) { |
| | | return fail("该ç³è¯·æµç¨æ éæå"); |
| | | } |
| | | |
| | | ApplyEntity applyEntity = applyService.selectById(flowEntity.getApplyid()); |
| | | if (null == applyEntity) { |
| | | return fail("æ¾ä¸å°æ°æ®ç³è¯·"); |
| | | } |
| | | if (!(applyEntity.getStatus() >= 0 && applyEntity.getStatus() <= StaticData.NINE)) { |
| | | return fail("è¯¥æ°æ®ç³è¯·æ éæå"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | Integer rows = applyService.updateForReject(ue.getId(), applyEntity.getId(), flowEntity.getId()); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @GetMapping(value = "/downloadFile") |
| | | public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | WebHelper.writeInfo(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨", res); |
| | | return; |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.DownloadReqEntity; |
| | | import com.moon.server.entity.ctrl.MarkJsonEntity; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.data.MetaFileEntity; |
| | | import com.moon.server.entity.data.PublishEntity; |
| | | import com.moon.server.entity.show.PipelineEntity; |
| | | import com.moon.server.entity.sys.AttachEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.all.BaseQueryService; |
| | | import com.moon.server.service.all.BaseUploadService; |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.data.DataQueryService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.data.PublishService; |
| | | import com.moon.server.service.show.MarkService; |
| | | import com.moon.server.service.show.PipelineService; |
| | | import com.moon.server.service.sys.AttachService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 综åå±ç¤º |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\é¦é¡µ") |
| | | @RestController |
| | | @RequestMapping("/comprehensive") |
| | | public class ComprehensiveController extends ModelController { |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | MarkService markService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | AttachService attachService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | PublishService publishService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @Autowired |
| | | PipelineService pipelineService; |
| | | |
| | | @Autowired |
| | | DataQueryService dataQueryService; |
| | | |
| | | @Autowired |
| | | BaseUploadService baseUploadService; |
| | | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢å叿¸
å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectPubById") |
| | | public ResponseMsg<PublishEntity> selectPubById(int id) { |
| | | try { |
| | | PublishEntity entity = publishService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çº¿") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "西æ°ä¸è¾"), |
| | | }) |
| | | @GetMapping(value = "/selectPipelines") |
| | | public ResponseMsg<Object> selectPipelines(String name) { |
| | | try { |
| | | List<PipelineEntity> rs = pipelineService.selectPipelines(name); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è·¯ç½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "x1", value = "X1", dataType = "Double", paramType = "query", example = "116.78999"), |
| | | @ApiImplicitParam(name = "y1", value = "Y1", dataType = "Double", paramType = "query", example = "39.9468"), |
| | | @ApiImplicitParam(name = "x2", value = "X2", dataType = "Double", paramType = "query", example = "116.80458"), |
| | | @ApiImplicitParam(name = "y2", value = "Y2", dataType = "Double", paramType = "query", example = "39.94758") |
| | | }) |
| | | @GetMapping(value = "/selectRoute") |
| | | public ResponseMsg<Object> selectRoute(double x1, double y1, double x2, double y2) { |
| | | try { |
| | | String route = baseQueryService.selectRoute(x1, y1, x2, y2); |
| | | |
| | | return success(route); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ ShapeFileæä»¶") |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadShp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Object> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<MetaFileEntity> meList = baseUploadService.uploadData(null, null, false, req, res); |
| | | if (meList == null || meList.size() < StaticData.FOUR) { |
| | | return fail("æ²¡ææ¾å°å·²ä¸ä¼ çæ°æ®æä¸å®æ´", null); |
| | | } |
| | | |
| | | List<MarkJsonEntity> list = markService.readShpForMarks(meList); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½ShapeFileæä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "æ ç»JSONå®ä½ç±»éå", dataType = "MarkJsonEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadShp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<String> downloadShp(@RequestBody List<MarkJsonEntity> list, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | if (list == null || list.isEmpty()) { |
| | | return fail("æ¾ä¸å°æ ç»æ°æ®", null); |
| | | } |
| | | |
| | | String guid = markService.downloadShp(ue, list); |
| | | if (StringHelper.isNull(guid)) { |
| | | return fail("çæShapeFileæä»¶å¤±è´¥", null); |
| | | } |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ResponseBody |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tabName", value = "表å", dataType = "String", paramType = "query", example = "lf.sys_style"), |
| | | @ApiImplicitParam(name = "eventid", value = "主é®", dataType = "String", paramType = "query", example = "fa25979a5ef8b43ba82a0be35b3fb0d4") |
| | | }) |
| | | @PostMapping(value = "/uploadFiles") |
| | | public ResponseMsg<Integer> uploadFiles(String tabName, String eventid, @RequestParam("file") MultipartFile[] files, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(tabName) || StringHelper.isEmpty(eventid)) { |
| | | return fail("åæ°ä¸è½ä¸ºç©º", null); |
| | | } |
| | | if (null == files || files.length == 0) { |
| | | return fail("æä»¶ä¸ä¼ 为空", 0); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | Integer count = dataQueryService.uploadFiles(ue, tabName, eventid, files, req); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, 0); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query") |
| | | }) |
| | | @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) |
| | | public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | WebHelper.writeStr2Page(res, WebHelper.getErrJson(HttpStatus.UNAUTHORIZED, "ç¨æ·æªç»å½")); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (de == null) { |
| | | WebHelper.writeStr2Page(res, WebHelper.getErrJson(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨")); |
| | | } |
| | | |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeStr2Page(res, WebHelper.getErrJson(HttpStatus.UNAUTHORIZED, ex.getMessage())); |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥çæä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/downloadForView") |
| | | public void downloadForView(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, true, res); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请æ±ä¸è½½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guids", value = "éä»¶Guidæ°ç»", dataType = "String", paramType = "body", allowMultiple = true, example = "e5b6ae0889b88111f13a4b6e048348db,fa4f299e901a0c46e634f8fcc8185c0c") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReqForGuids") |
| | | public ResponseMsg<Object> downloadReqForGuids(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dre || null == dre.getGuids() || dre.getGuids().isEmpty()) { |
| | | return fail("Guidæ°ç»ä¸ºç©º"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = uploadAttachService.downloadReqForGuids(ue, dre.getGuids()); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请æ±ä¸è½½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tab", value = "表å", dataType = "String", paramType = "body", example = "bd.b_borehole"), |
| | | @ApiImplicitParam(name = "guids", value = "éä»¶Guidæ°ç»", dataType = "String", paramType = "body", allowMultiple = true, example = "08e5b4ad-93b8-46f6-adaa-46a6274af4ce,6f94f4f8-6e8d-44e7-8803-3d068d34983f") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReqForTabGuids") |
| | | public ResponseMsg<Object> downloadReqForTabGuids(@RequestBody DownloadReqEntity dre, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dre || StringHelper.isEmpty(dre.getTab())) { |
| | | return fail("表å为空"); |
| | | } |
| | | if (null != dre.getGuids() && dre.getGuids().size() == 0) { |
| | | dre.setIds(null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = uploadAttachService.downloadReqForTabGuids(ue, dre.getTab(), dre.getGuids()); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "tabName", value = "表å", dataType = "String", paramType = "query", example = "lf.sys_style"), |
| | | @ApiImplicitParam(name = "eventid", value = "主é®", dataType = "String", paramType = "query", example = "fa25979a5ef8b43ba82a0be35b3fb0d4") |
| | | }) |
| | | @GetMapping(value = "/selectFiles") |
| | | public ResponseMsg<List<AttachEntity>> selectFiles(String tabName, String eventid) { |
| | | try { |
| | | if (StringHelper.isEmpty(tabName) || StringHelper.isEmpty(eventid)) { |
| | | return fail("åæ°ä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | List<AttachEntity> list = attachService.selectByTab(tabName, eventid); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å 餿件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deleteFiles(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int rows = attachService.deletes(ids); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, 0); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseQueryController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.DownloadReqEntity; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.data.MetaEntity; |
| | | import com.moon.server.entity.data.VerEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.ClassHelper; |
| | | import com.moon.server.helper.Md5Helper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.mapper.all.BasicMapper; |
| | | import com.moon.server.service.all.BaseQueryService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.data.MetaService; |
| | | import com.moon.server.service.data.VerService; |
| | | import com.moon.server.service.show.DataLibService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.helper.StringHelper; |
| | | 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 javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * èµæé¦ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\èµæé¦") |
| | | @RestController |
| | | @RequestMapping("/dataLib") |
| | | public class DataLibController extends BaseQueryController { |
| | | @Autowired |
| | | MetaService metaService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DataLibService dataLibService; |
| | | |
| | | @Autowired |
| | | BaseQueryService baseQueryService; |
| | | |
| | | @Autowired |
| | | VerService verService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç®å½IDæ¥è¯¢çæ¬å表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "ç®å½ID", dataType = "Integer", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectVerByDirid") |
| | | public ResponseMsg<List<VerEntity>> selectVerByDirid(Integer dirid) { |
| | | try { |
| | | if (null == dirid || dirid < 0) { |
| | | dirid = 0; |
| | | } |
| | | |
| | | List<VerEntity> list = verService.selectByDirid(dirid); |
| | | if (null == list || list.isEmpty()) { |
| | | list = verService.selectByDirid(0); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å
æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "dirs", value = "ç®å½ç¼ç ", dataType = "String", paramType = "query", example = "00,01"), |
| | | @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 = "/selectMetasForPage") |
| | | public ResponseMsg<Object> selectMetasForPage(String depcode, String dirs, String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | dirs = DataLibService.copeCodes(dirs, "dircode"); |
| | | |
| | | int count = metaService.selectMetasForCount(depcode, dirs, name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MetaEntity> rs = metaService.selectMetasForPage(depcode, dirs, name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è¡¨ä¸æ°æ®") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "å
æ°æ®ID", dataType = "Integer", paramType = "query", example = "115"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10") |
| | | }) |
| | | @GetMapping(value = "/selectDbData") |
| | | public ResponseMsg<Object> selectDbData(Integer id, Integer pageIndex, Integer pageSize) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | if (null == id || id < 0) { |
| | | return fail("å
æ°æ®IDä¸è½ä¸ºç©ºæå°äº0", null); |
| | | } |
| | | |
| | | MetaEntity meta = metaService.selectById(id); |
| | | if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) { |
| | | return fail("æ¾ä¸å°å
æ°æ®ä¿¡æ¯", null); |
| | | } |
| | | |
| | | String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase(); |
| | | BasicMapper baseMapper = ClassHelper.getBasicMapper(entity); |
| | | if (null == baseMapper) { |
| | | return null; |
| | | } |
| | | |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("parentid", meta.getEventid()); |
| | | |
| | | Page<Object> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.desc("gid")); |
| | | IPage<Object> paged = baseMapper.selectPage(page, wrapper); |
| | | |
| | | return success(paged.getTotal(), paged.getRecords()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请æ±å
æ°æ®ä¸è½½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dr", value = "请æ±ä¸è½½å®ä½", dataType = "DownloadReqEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReq") |
| | | public ResponseMsg<Object> downloadReq(@RequestBody DownloadReqEntity dr, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dr || StringHelper.isEmpty(dr.getPwd())) { |
| | | return fail("å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (null == dr.getIds() || dr.getIds().isEmpty()) { |
| | | return fail("è¯·éæ©è¦ä¸è½½çæä»¶ID"); |
| | | } |
| | | if (!DownloadService.decryptPwd(dr)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (StringHelper.isPwdInvalid(dr.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = metaService.downloadMeteReq(ue, dr); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "pwd", value = "å¯ç ", dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectDownloadFile") |
| | | public ResponseMsg<Boolean> selectDownloadFile(String guid, String pwd) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { |
| | | return fail("æä»¶IDåå¯ç ä¸è½ä¸ºç©º", null); |
| | | } |
| | | if (!pwd.endsWith(StaticData.EQ)) { |
| | | pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); |
| | | } |
| | | |
| | | String password = DownloadService.decryptPwd(pwd); |
| | | if (null == password) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | return fail("æä»¶ä¸åå¨", null); |
| | | } |
| | | if (!StringHelper.isNull(de.getPwd()) && !Md5Helper.validatePassword(password, de.getPwd())) { |
| | | return fail("å¯ç 䏿£ç¡®", null); |
| | | } |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | File file = new File(filePath); |
| | | |
| | | return success(file.exists()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "pwd", value = "å¯ç ", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @GetMapping(value = "/downloadFile") |
| | | @SuppressWarnings("AlibabaRemoveCommentedCode") |
| | | public void downloadFile(String guid, String pwd, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | /*if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "æä»¶IDåå¯ç ä¸è½ä¸ºç©º", res); |
| | | } |
| | | if (!pwd.endsWith(StaticData.EQ)) { |
| | | pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); |
| | | } |
| | | |
| | | String password = DownloadService.decryptPwd(pwd); |
| | | if (null == password) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "å¯ç è§£å¯å¤±è´¥", res); |
| | | }*/ |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | WebHelper.writeInfo(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨", res); |
| | | return; |
| | | } |
| | | /*if (!StringHelper.isNull(de.getPwd()) && !Md5Helper.validatePassword(password, de.getPwd())) { |
| | | WebHelper.writeInfo(HttpStatus.UNAUTHORIZED, "å¯ç 䏿£ç¡®", res); |
| | | }*/ |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.show.ExportEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.show.ExportService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.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 javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å¨çº¿å¶å¾ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\å¨çº¿å¶å¾") |
| | | @RestController |
| | | @RequestMapping("/export") |
| | | public class ExportController extends BaseController { |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | ExportService exportService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @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 = "/selectByPage") |
| | | public ResponseMsg<List<DownloadEntity>> selectPageCountForDownload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | int count = downloadService.selectCountForUser(ue.getId(), "2", name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), "2", name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ°å»ºåºå¾") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å¨çº¿å¶å¾å®ä½ç±»", dataType = "ExportEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/insertMap", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<String> insertMap(@RequestBody ExportEntity entity, HttpServletRequest req) { |
| | | try { |
| | | boolean flag = entity.getXmin() == 0 && entity.getYmin() == 0 && entity.getXmax() == 0 && entity.getYmax() == 0; |
| | | if (StringHelper.isEmpty(entity.getLayers()) || StringHelper.isEmpty(entity.getToken()) || flag) { |
| | | return fail("åæ°ä¸å®æ´"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½"); |
| | | } |
| | | |
| | | String str = exportService.post(ue, entity); |
| | | if (StringHelper.isNull(str)) { |
| | | return fail("åºå¾å¤±è´¥"); |
| | | } |
| | | |
| | | return success("åºå¾æå", str); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½åºå¾") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query") |
| | | }) |
| | | @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) |
| | | public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid)) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "æ¾ä¸å°æä»¶ID", res); |
| | | return; |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | WebHelper.writeInfo(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨", res); |
| | | return; |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseQueryController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.ctrl.DownloadTileEntity; |
| | | import com.moon.server.entity.ctrl.ShpRecordEntity; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.data.MetaFileEntity; |
| | | import com.moon.server.entity.data.PublishEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.AesHelper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.all.BaseUploadService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.data.PublishService; |
| | | import com.moon.server.service.show.InquiryService; |
| | | import com.moon.server.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.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¥è¯¢ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\æ¥è¯¢") |
| | | @RestController |
| | | @RequestMapping("/inquiry") |
| | | public class InquiryController extends BaseQueryController { |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | BaseUploadService baseUploadService; |
| | | |
| | | @Autowired |
| | | InquiryService inquiryService; |
| | | |
| | | @Resource |
| | | PublishService publishService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ Shpæä»¶è¯»åç¬¬ä¸æ¡è®°å½çWKT") |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadShp") |
| | | public ResponseMsg<ShpRecordEntity> uploadShp(HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | List<MetaFileEntity> list = baseUploadService.uploadData(null, null, false, req, res); |
| | | if (list == null || list.size() < StaticData.FOUR) { |
| | | return fail("æ²¡ææ¾å°å·²ä¸ä¼ çæ°æ®æä¸å®æ´", null); |
| | | } |
| | | |
| | | ShpRecordEntity sr = inquiryService.readShpFirstRecord(list); |
| | | if (sr != null && !StringHelper.isEmpty(sr.getWkt())) { |
| | | sr.setWkt(AesHelper.encrypt(sr.getWkt())); |
| | | } |
| | | |
| | | return success(sr); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½ç¦ç") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dt", value = "ä¸è½½ç¦çå®ä½ç±»", dataType = "DownloadTileEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadTiles") |
| | | public ResponseMsg<Object> downloadTiles(@RequestBody DownloadTileEntity dt, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (null == dt || null == dt.getPubid() || StringHelper.isEmpty(dt.getPwd())) { |
| | | return fail("åå¸IDåå¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | String err = dt.verifyCoords(); |
| | | if (null != err) { |
| | | return fail(err); |
| | | } |
| | | if (!DownloadService.decryptPwd(dt)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | |
| | | PublishEntity pub = publishService.selectById(dt.getPubid()); |
| | | if (null == pub) { |
| | | return fail("å叿°æ®ä¸åå¨"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = inquiryService.zipTiles(dt, pub, ue); |
| | | if (null == guid) { |
| | | return fail("没æç¦çéè¦æå
ä¸è½½"); |
| | | } |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @GetMapping(value = "/downloadFile") |
| | | public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | WebHelper.writeInfo(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨", res); |
| | | return; |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.show.MarkEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.BaseUploadService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.show.MarkService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * æ ç» |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\æ ç»") |
| | | @RestController |
| | | @RequestMapping("/mark") |
| | | public class MarkController extends BaseController { |
| | | @Autowired |
| | | MarkService markService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | BaseUploadService baseUploadService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @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<MarkEntity>> selectByPageAndCount(Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | int count = markService.selectCount(ue.getId()); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MarkEntity> rs = markService.selectByPage(ue.getId(), 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<MarkEntity> selectById(int id) { |
| | | try { |
| | | MarkEntity entity = markService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MarkEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody MarkEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = markService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MarkEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<MarkEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MarkEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = markService.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 { |
| | | int count = markService.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 = markService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MarkEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody MarkEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = markService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MarkEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<MarkEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MarkEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = markService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.show.ModelEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.show.ModelService; |
| | | import com.moon.server.service.sys.TokenService; |
| | | 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; |
| | | |
| | | /** |
| | | * 模å |
| | | * @author WWW |
| | | */ |
| | | public class ModelController extends BaseController { |
| | | @Autowired |
| | | ModelService modelService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢æ¨¡åå¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "layerid", 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 = "/selectModelByPageAndCount") |
| | | public ResponseMsg<List<ModelEntity>> selectModelByPageAndCount(Integer layerid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = modelService.selectCount(layerid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ModelEntity> rs = modelService.selectByPage(layerid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢æ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectModelById") |
| | | public ResponseMsg<ModelEntity> selectModelById(int id) { |
| | | try { |
| | | ModelEntity entity = modelService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®Guidæ¥è¯¢æ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "layerid", value = "å¾å±ID", dataType = "Integer", paramType = "query", example = ""), |
| | | @ApiImplicitParam(name = "modelid", value = "模åID", dataType = "String", paramType = "query", example = "") |
| | | }) |
| | | @GetMapping(value = "/selectModelByGuid") |
| | | public ResponseMsg<ModelEntity> selectModelByGuid(Integer layerid, String modelid) { |
| | | try { |
| | | if (null == layerid || StringHelper.isEmpty(modelid)) { |
| | | return fail("å¾å±ID忍¡åIDä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | ModelEntity entity = modelService.selectModelByGuid(layerid, modelid); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸ä¸ªæ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ModelEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertModel", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertModel(@RequestBody ModelEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = modelService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤ä¸ªæ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ModelEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insertModels", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertModels(@RequestBody List<ModelEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ModelEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = modelService.inserts(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤ä¸ä¸ªæ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteModel") |
| | | public ResponseMsg<Integer> deleteModel(int id) { |
| | | try { |
| | | int count = modelService.delete(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤ä¸ªæ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "Integer", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteModels") |
| | | public ResponseMsg<Integer> deleteModels(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = modelService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸ä¸ªæ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ModelEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateModel", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateModel(@RequestBody ModelEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = modelService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤ä¸ªæ¨¡å") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ModelEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateModels", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateModels(@RequestBody List<ModelEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ModelEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = modelService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.show.OneMapEntity; |
| | | import com.moon.server.service.show.OneMapService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管ç½ä¸å¼ å¾ |
| | | * aFigurePipelineNetwork |
| | | * |
| | | * @author xing |
| | | * @date 2023/02/13 |
| | | */ |
| | | |
| | | @Api(tags = "综åå±ç¤º\\管ç½ä¸å¼ å¾") |
| | | @RestController |
| | | @RequestMapping("/oneMap") |
| | | public class OneMapController extends BaseController { |
| | | |
| | | @Autowired |
| | | OneMapService aMapOfPipelineService; |
| | | |
| | | |
| | | //============[项ç®ç»è®¡ project Statistics]================== |
| | | |
| | | /** |
| | | * 项ç®ç±»å« |
| | | * Project category |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "项ç®ç±»å«") |
| | | @GetMapping("/countProjectCategory") |
| | | public ResponseMsg<Object> projectCategoryCount() { |
| | | List<String> resList = aMapOfPipelineService.projectCategoryCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * 项ç®ä½ç½®å叿¥å£ |
| | | * Project location |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "项ç®ä½ç½®å叿¥å£") |
| | | @GetMapping("/countProjectLocation") |
| | | public ResponseMsg<Object> projectLocationCount() { |
| | | List<String> resList = aMapOfPipelineService.projectLocationCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å½å®¶ç»´åº¦-æ°éç»è®¡ |
| | | * Country dimension |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å½å®¶ç»´åº¦-æ°éç»è®¡") |
| | | @GetMapping("/countCountryDimension") |
| | | public ResponseMsg<Object> countryDimensionCount() { |
| | | List<String> resList = aMapOfPipelineService.countryDimensionCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * ç维度-æ°éç»è®¡ |
| | | * Province dimension - quantity |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "ç维度-æ°éç»è®¡") |
| | | @GetMapping("/countProvinceDimension") |
| | | public ResponseMsg<Object> provinceDimensionCount() { |
| | | List<String> resList = aMapOfPipelineService.provinceDimensionCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * å
¨å½ç»´åº¦-æç
§é¡¹èªç±»åç»è®¡ä¸å项ç®ä¸ªæ° |
| | | * Count the number of different items according to their type |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å
¨å½ç»´åº¦-æç
§é¡¹èªç±»åç»è®¡ä¸å项ç®ä¸ªæ°") |
| | | @GetMapping("/countProjectTypeNumber") |
| | | public ResponseMsg<Object> countProjectTypeNumber() { |
| | | List<String> resList = aMapOfPipelineService.countProjectTypeNumber(); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | //============[æ°æ®ç»è®¡ data Statistics]================== |
| | | |
| | | /** |
| | | * æ°æ®ç»è®¡ |
| | | * æ°æ®åå¨ |
| | | * data storage |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "æ°æ®åå¨ç»è®¡") |
| | | @GetMapping("/countDataStorage") |
| | | public ResponseMsg<Object> dataStorageCount() { |
| | | List<String> resList = aMapOfPipelineService.dataStorageCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®å¤§ç±»ç»è®¡ |
| | | * Statistics of large categories of data |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "æ°æ®å¤§ç±»ç»è®¡") |
| | | @GetMapping("/countLargeCategories") |
| | | public ResponseMsg<Object> statisticalDataCategories() { |
| | | List<String> resList = aMapOfPipelineService.statisticalDataCategories(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®æå¡ç±»åç»è®¡ |
| | | * Data service type statistics |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "æ°æ®æå¡ç±»åç»è®¡") |
| | | @GetMapping("/countDataServiceType") |
| | | public ResponseMsg<Object> statisticalDataServiceType() { |
| | | List<String> resList = aMapOfPipelineService.statisticalDataServiceType(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * ç»å½æ¬¡æ°ç»è®¡ |
| | | * Number of logins |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "ç»å½æ¬¡æ°ç»è®¡") |
| | | @GetMapping("/countLoginNumber") |
| | | public ResponseMsg<Object> loginNumberStatistics() { |
| | | List<String> resList = aMapOfPipelineService.loginNumberStatistics(); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°æ®ç»è®¡ |
| | | * æä»¶æ ¼å¼ç»´åº¦-æä»¶ä¸ªæ° |
| | | * File format dimension |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "æä»¶æ ¼å¼ç»´åº¦-æä»¶ä¸ªæ°") |
| | | @GetMapping("/countFileFormat") |
| | | public ResponseMsg<Object> fileFormatCount() { |
| | | List<String> resList = aMapOfPipelineService.fileFormatCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®ç»è®¡ |
| | | * æ°æ®ç³è¯· |
| | | * Data application |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "æ°æ®ç³è¯·") |
| | | @GetMapping("/countDataApply") |
| | | public ResponseMsg<Object> dataApplyCount() { |
| | | List<String> resList = aMapOfPipelineService.dataApplyCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * æ°æ®ç»è®¡ |
| | | * è®¿é®æ¬¡æ° |
| | | * Number of visits |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "è®¿é®æ¬¡æ°") |
| | | @GetMapping("/countDataVisit") |
| | | public ResponseMsg<Object> dataVisitCount() { |
| | | List<String> resList = aMapOfPipelineService.dataVisitCount(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½éç»è®¡ |
| | | * Download statistics |
| | | * <p>typeç±»åï¼1-Shpæä»¶ï¼2-ä¸é¢å¾ï¼3-å
æ°æ®ï¼4-ä¸å¡æ°æ®ï¼5-管éåæï¼6-ç»è®¡æ¥å<p/> |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½éç»è®¡") |
| | | @GetMapping("/countDownloads") |
| | | public ResponseMsg<Object> countDownloads() { |
| | | List<String> resList = aMapOfPipelineService.countDownloads(); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 项ç®å·¥ç¨å±ç¤º |
| | | * Project engineering display |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "项ç®å·¥ç¨å±ç¤º") |
| | | @GetMapping("/countProjectDisplay") |
| | | public ResponseMsg<Object> countProjectDisplay() { |
| | | List<String> resList = aMapOfPipelineService.countProjectDisplay(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * 项ç®å·¥ç¨å·¡è§å表 |
| | | * Project inspection tour |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "项ç®å·¥ç¨å·¡è§å表") |
| | | @GetMapping("/selectProjectTour") |
| | | public ResponseMsg<Object> selectProjectTour() { |
| | | List<String> resList = aMapOfPipelineService.selectProjectTour(); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å·¥ç¨é¡¹ç®ç®å½ |
| | | * Project Catalog |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å·¥ç¨é¡¹ç®ç®å½") |
| | | @GetMapping("/selectProjectType") |
| | | public ResponseMsg<Object> selectProjectType() { |
| | | List<OneMapEntity> resList = aMapOfPipelineService.selectProjectType1(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è¡¨åæ¥è¯¢è¡¨åæ®µä¿¡æ¯ |
| | | * Query table field information according to table name |
| | | */ |
| | | @ApiOperation(value = "æ ¹æ®è¡¨åæ¥è¯¢è¡¨å段信æ¯") |
| | | @GetMapping("/selectTableInfo") |
| | | public ResponseMsg<Object> selectTableInfo(@RequestParam("tableName") String tableName) { |
| | | List<String> resList = aMapOfPipelineService.queryTableInfo(tableName); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | //============[ä¸é¢å±ç¤º Thematic presentations]================== |
| | | |
| | | /** |
| | | * å
¨ç管ç½å¾ |
| | | * Global pipe network map |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å
¨ç管ç½å¾") |
| | | @GetMapping("/countGlobalPipeMap") |
| | | public ResponseMsg<Object> countGlobalPipeMap() { |
| | | List<String> resList = aMapOfPipelineService.countGlobalPipeMap(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * å
¨å½ç®¡ç½å¾ |
| | | * National pipe network map |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å
¨å½ç®¡ç½å¾") |
| | | @GetMapping("/countNationalPipeMap") |
| | | public ResponseMsg<Object> countNationalPipeMap() { |
| | | List<String> resList = aMapOfPipelineService.countNationalPipeMap(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * å
¨å½ç®¡ç½å¾è¾éä»è´¨é¿åº¦ |
| | | * National pipe network diagram conveying medium length |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å
¨å½ç®¡ç½å¾è¾éä»è´¨é¿åº¦") |
| | | @GetMapping("/countZhPipeMapLength") |
| | | public ResponseMsg<Object> countZhPipeMapLenByMed() { |
| | | List<String> resList = aMapOfPipelineService.countZhPipeMapLenByMed(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * ç»è®¡å
¨å½ç«åºåº§æ° |
| | | * Number of station seats nationwide |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å
¨å½ç«åºåº§æ°ãé室ãç®¡éæ°ç") |
| | | @GetMapping("/countZhPipeStations") |
| | | public ResponseMsg<Object> countZhPipeStations() { |
| | | List<String> resList = aMapOfPipelineService.countZhPipeStations(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * æé¡¹ç®ç»è®¡é¡¹ç®åå¨é |
| | | * Count the amount of project storage by project |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "æé¡¹ç®ç»è®¡é¡¹ç®åå¨é") |
| | | @GetMapping("/countStorageByProject") |
| | | public ResponseMsg<Object> countStorageByProject() { |
| | | List<String> resList = aMapOfPipelineService.countStorageByProject(); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | //============[å·¥ç¨å±ç¤º Engineering Showcase]================== |
| | | |
| | | /** |
| | | * 项ç®ä¿¡æ¯æ¥è¯¢ |
| | | * Project information query |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "项ç®ä¿¡æ¯æ¥è¯¢") |
| | | @GetMapping("/selectProjectInfo") |
| | | public ResponseMsg<Object> selectProjectInfo(@RequestParam("projectCode") String projectCode) { |
| | | List<String> resList = aMapOfPipelineService.selectProjectInfo(projectCode); |
| | | return success(resList); |
| | | } |
| | | /** |
| | | * é¡¹ç®æä»¶å表æ¥è¯¢ |
| | | * Project file list query |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "é¡¹ç®æä»¶å表æ¥è¯¢") |
| | | @GetMapping("/selectProjectFileList") |
| | | public ResponseMsg<Object> selectProjectFileList() { |
| | | List<String> resList = aMapOfPipelineService.selectProjectFileList(); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * å个项ç®åå¨é |
| | | * |
| | | * @param projectCode 项ç®ä»£ç |
| | | * @return {@link ResponseMsg}<{@link Object}> |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å个项ç®åå¨é") |
| | | @GetMapping("/countProjectStorage") |
| | | public ResponseMsg<Object> countProjectStorage(@RequestParam("projectCode") String projectCode) { |
| | | List<String> resList = aMapOfPipelineService.countProjectStorage(projectCode); |
| | | return success(resList); |
| | | } |
| | | |
| | | /** |
| | | * åä¸ªé¡¹ç®æä»¶æ°é |
| | | * The number of individual project files |
| | | * |
| | | * @param projectCode 项ç®ä»£ç |
| | | * @return {@link ResponseMsg}<{@link Object}> |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "åä¸ªé¡¹ç®æä»¶ç±»åæ°é") |
| | | @GetMapping("/countProjectType") |
| | | public ResponseMsg<Object> countProjectType(@RequestParam("projectCode") String projectCode) { |
| | | List<String> resList = aMapOfPipelineService.countProjectType(projectCode); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç»è®¡é¡¹ç®ä¸ |
| | | * å个项ç®ä¸è½½é |
| | | * |
| | | * @param projectCode 项ç®ä»£ç |
| | | * @return {@link ResponseMsg}<{@link Object}> |
| | | */ |
| | | @SysLog() |
| | | @ApiOperation(value = "å个项ç®ä¸è½½é") |
| | | @GetMapping("/countProjectDown") |
| | | public ResponseMsg<Object> countProjectDown(@RequestParam("projectCode") String projectCode) { |
| | | List<String> resList = aMapOfPipelineService.countProjectDown(projectCode); |
| | | return success(resList); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.show; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.HttpStatus; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.data.DownloadEntity; |
| | | import com.moon.server.entity.show.PipelineEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.Md5Helper; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.show.PipelineService; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.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 javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.net.URLDecoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 管éåæ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\管éåæ") |
| | | @RestController |
| | | @RequestMapping("/pipeline") |
| | | public class PipelineController extends BaseController { |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @Autowired |
| | | PipelineService pipelineService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡æ®µ") |
| | | @GetMapping(value = "/selectSegNames") |
| | | public ResponseMsg<Object> selectSegNames() { |
| | | try { |
| | | List<PipelineEntity> rs = pipelineService.selectSegNames(); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çº¿åæ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pe", value = "管éåæå®ä½ç±»", dataType = "PipelineEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectPipeAnalysis") |
| | | public ResponseMsg<Object> selectPipeAnalysis(@RequestBody PipelineEntity pe) { |
| | | try { |
| | | if (null == pe.getGid() || pe.getGid() < 1) { |
| | | return fail("请è¾å
¥ç®¡æ®µID"); |
| | | } |
| | | if (null == pe.getTabs() || 0 == pe.getTabs().size()) { |
| | | return fail("请è¾å
¥è¡¨å"); |
| | | } |
| | | if (!checkTabs(pe.getTabs())) { |
| | | return fail("åå¨éæ³è¡¨å"); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(4); |
| | | for (String tab : pe.getTabs()) { |
| | | List<PipelineEntity> rs = pipelineService.selectPipeAnalysis(tab, pe.getGid()); |
| | | map.put(tab, rs); |
| | | } |
| | | |
| | | return success(map); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请æ±ç®¡éåæç»æä¸è½½") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pe", value = "管éåæå®ä½ç±»", dataType = "PipelineEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReq") |
| | | public ResponseMsg<Object> downloadReq(@RequestBody PipelineEntity pe, HttpServletRequest req) { |
| | | try { |
| | | if (null == pe || StringHelper.isEmpty(pe.getPwd())) { |
| | | return fail("å¯ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (null == pe.getTabs() || 0 == pe.getTabs().size()) { |
| | | return fail("请è¾å
¥è¡¨å"); |
| | | } |
| | | if (!checkTabs(pe.getTabs())) { |
| | | return fail("åå¨éæ³è¡¨å"); |
| | | } |
| | | if (!DownloadService.decryptPwd(pe)) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | if (StringHelper.isPwdInvalid(pe.getPwd())) { |
| | | return fail("å¯ç ä¸ç¬¦åè¦æ±"); |
| | | } |
| | | |
| | | Map<String, List<PipelineEntity>> map = new HashMap<>(4); |
| | | for (String tab : pe.getTabs()) { |
| | | List<PipelineEntity> rs = pipelineService.selectPipeAnalysis(tab, pe.getGid()); |
| | | if (null != rs && rs.size() > 0) { |
| | | map.put(tab, rs); |
| | | } |
| | | } |
| | | if (map.size() == 0) { |
| | | return fail("æ¥æ æ°æ®"); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String guid = pipelineService.createZipFile(ue, map, pe.getPwd()); |
| | | |
| | | return success(guid); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @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 = "/selectPageCountForDownload") |
| | | public ResponseMsg<List<DownloadEntity>> selectPageCountForDownload(String name, Integer pageSize, Integer pageIndex, HttpServletRequest req) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", null); |
| | | } |
| | | |
| | | int count = downloadService.selectCountForUser(ue.getId(), "5", name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<DownloadEntity> rs = downloadService.selectByPageForUser(ue.getId(), "5", name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "pwd", value = "å¯ç ", dataType = "String", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectDownloadFile") |
| | | public ResponseMsg<Boolean> selectDownloadFile(String guid, String pwd) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { |
| | | return fail("æä»¶IDåå¯ç ä¸è½ä¸ºç©º", null); |
| | | } |
| | | if (!pwd.endsWith(StaticData.EQ)) { |
| | | pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); |
| | | } |
| | | |
| | | String password = DownloadService.decryptPwd(pwd); |
| | | if (null == password) { |
| | | return fail("å¯ç è§£å¯å¤±è´¥", null); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | return fail("æä»¶ä¸åå¨", null); |
| | | } |
| | | if (!StringHelper.isNull(de.getPwd()) && !Md5Helper.validatePassword(password, de.getPwd())) { |
| | | return fail("å¯ç 䏿£ç¡®", null); |
| | | } |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | File file = new File(filePath); |
| | | |
| | | return success(file.exists()); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "æä»¶GUID", dataType = "String", paramType = "query"), |
| | | @ApiImplicitParam(name = "pwd", value = "å¯ç ", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @GetMapping(value = "/downloadFile") |
| | | public void downloadFile(String guid, String pwd, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | if (StringHelper.isEmpty(guid) || StringHelper.isEmpty(pwd)) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "æä»¶IDåå¯ç ä¸è½ä¸ºç©º", res); |
| | | } |
| | | if (!pwd.endsWith(StaticData.EQ)) { |
| | | pwd = URLDecoder.decode(pwd, StandardCharsets.UTF_8.name()); |
| | | } |
| | | |
| | | String password = DownloadService.decryptPwd(pwd); |
| | | if (null == password) { |
| | | WebHelper.writeInfo(HttpStatus.BAD_REQUEST, "å¯ç è§£å¯å¤±è´¥", res); |
| | | } |
| | | |
| | | DownloadEntity de = downloadService.selectByGuid(guid); |
| | | if (null == de) { |
| | | WebHelper.writeInfo(HttpStatus.NOT_FOUND, "æä»¶ä¸åå¨", res); |
| | | return; |
| | | } |
| | | if (!StringHelper.isNull(de.getPwd()) && !Md5Helper.validatePassword(password, de.getPwd())) { |
| | | WebHelper.writeInfo(HttpStatus.UNAUTHORIZED, "å¯ç 䏿£ç¡®", res); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | downlogService.updateInfos(ue, de, req); |
| | | |
| | | String filePath = downloadService.getDownloadFilePath(de); |
| | | WebHelper.download(filePath, de.getName(), res); |
| | | } catch (Exception ex) { |
| | | WebHelper.writeInfo(HttpStatus.ERROR, ex.getMessage(), res); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥è¡¨å |
| | | */ |
| | | private boolean checkTabs(List<String> tabs) { |
| | | for (String tab : tabs) { |
| | | if (!StaticData.PIPE_ANALYSIS_TABS.contains(tab)) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.ArgsEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.sys.ArgsService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * åæ°è®¾ç½® |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ç³»ç»é
ç½®") |
| | | @RestController |
| | | @RequestMapping("/args") |
| | | public class ArgsController extends BaseController { |
| | | @Autowired |
| | | ArgsService argsService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", required = false, example = "æææ") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name) { |
| | | try { |
| | | int count = argsService.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 = "æææ"), |
| | | @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<ArgsEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<ArgsEntity> rs = argsService.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 = "æææ"), |
| | | @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<ArgsEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = argsService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<ArgsEntity> rs = argsService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<ArgsEntity>> selectAll() { |
| | | try { |
| | | List<ArgsEntity> list = argsService.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<ArgsEntity> selectById(int id) { |
| | | try { |
| | | ArgsEntity entity = argsService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | /*@SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ArgsEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody ArgsEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = argsService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ArgsEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<ArgsEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ArgsEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = argsService.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 { |
| | | int count = argsService.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 = argsService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | }*/ |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ArgsEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody ArgsEntity entity, HttpServletRequest req) { |
| | | try { |
| | | ArgsEntity ae = argsService.selectById(entity.getId()); |
| | | if (ae == null) { |
| | | return fail("æ¾ä¸å°å¾
æ´æ°çå®ä½", -1); |
| | | } |
| | | if (entity.getCvalue() > ae.getMaxValue() || entity.getCvalue() < ae.getMinValue()) { |
| | | return fail("å¾
æ´æ°çå¼ä¸å¨ææèå´å
", -1); |
| | | } |
| | | ae.setCvalue(entity.getCvalue()); |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | ae.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = argsService.updateForValue(ae); |
| | | if (count > 0) { |
| | | argsService.updateSettingData(ae); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | /*@SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "ArgsEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<ArgsEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ArgsEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = argsService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | }*/ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.AuthEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.AuthService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * æé表 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\æé管ç") |
| | | @RestController |
| | | @RequestMapping("/auth") |
| | | public class AuthController extends BaseController { |
| | | @Autowired |
| | | AuthService authService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", required = false, example = "sys_auth") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name) { |
| | | try { |
| | | int count = authService.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_auth"), |
| | | @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<AuthEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | List<AuthEntity> rs = authService.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 = "1"), |
| | | @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<AuthEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = authService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<AuthEntity> rs = authService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®èåå页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "menuid", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForMenu") |
| | | public ResponseMsg<List<AuthEntity>> selectByPageForMenu(Integer menuid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = authService.selectCountForMenu(menuid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<AuthEntity> rs = authService.selectByPageForMenu(menuid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.AuthEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertAuth", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertAuth(@RequestBody AuthEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = authService.insertAuth(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<AuthEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertAuths", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertAuths(@RequestBody List<AuthEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (AuthEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = authService.insertAuths(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 = "/deleteAuth") |
| | | public ResponseMsg<Integer> deleteAuth(int id) { |
| | | try { |
| | | int count = authService.deleteAuth(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteAuths") |
| | | public ResponseMsg<Integer> deleteAuths(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = authService.deleteAuths(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "LoginEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateAuth", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateAuth(@RequestBody AuthEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = authService.updateAuth(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectAuth") |
| | | public ResponseMsg<AuthEntity> selectAuth(int id) { |
| | | try { |
| | | AuthEntity authEntity = authService.selectAuth(id); |
| | | |
| | | return success(authEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAuthAll") |
| | | public ResponseMsg<List<AuthEntity>> selectAuthAll() { |
| | | try { |
| | | List<AuthEntity> list = authService.selectAuthAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.BlacklistEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.sys.BlacklistService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * é»åå |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\é»åå") |
| | | @RestController |
| | | @RequestMapping("/blacklist") |
| | | public class BlacklistController extends BaseController { |
| | | @Autowired |
| | | BlacklistService blacklistService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ip", value = "IPå°å", dataType = "String", paramType = "query", required = false, example = "192."), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å«", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String ip, Integer type) { |
| | | try { |
| | | int count = blacklistService.selectCount(ip, type); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ip", value = "IPå°å", dataType = "String", paramType = "query", example = "192."), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å«", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<BlacklistEntity>> selectByPage(String ip, Integer type, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<BlacklistEntity> rs = blacklistService.selectByPage(ip, type, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ip", value = "IPå°å", dataType = "String", paramType = "query", required = false, example = "192."), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å«", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<BlacklistEntity>> selectByPageAndCount(String ip, Integer type, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = blacklistService.selectCount(ip, type); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<BlacklistEntity> rs = blacklistService.selectByPage(ip, type, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<BlacklistEntity>> selectAll() { |
| | | try { |
| | | List<BlacklistEntity> list = blacklistService.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<BlacklistEntity> selectById(int id) { |
| | | try { |
| | | BlacklistEntity entity = blacklistService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "BlacklistEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody BlacklistEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = blacklistService.insert(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "BlacklistEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<BlacklistEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (BlacklistEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = blacklistService.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 { |
| | | int count = blacklistService.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 = blacklistService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "BlacklistEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody BlacklistEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = blacklistService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "BlacklistEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<BlacklistEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (BlacklistEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = blacklistService.updates(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.ResEntity; |
| | | import com.moon.server.service.all.ScheduleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ§å¶å°æ§å¶å¨ |
| | | * @author WWW |
| | | * @date 2022-09-21 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\æ§å¶å°") |
| | | @RestController |
| | | @RequestMapping("/ctrl") |
| | | public class CtrlController extends BaseController { |
| | | @Autowired |
| | | private ScheduleService scheduleService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æå¡å¨ç¶æ") |
| | | @GetMapping(value = "/selectServerStatus") |
| | | public ResponseMsg<JSONObject> selectServerStatus() { |
| | | try { |
| | | JSONObject jsonObject = scheduleService.selectServerStatus(); |
| | | |
| | | return success(jsonObject); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢Cpuä¿¡æ¯") |
| | | @GetMapping(value = "/selectCpuInfo") |
| | | public ResponseMsg<JSONObject> selectCpuInfo() { |
| | | try { |
| | | JSONObject jsonObject = scheduleService.selectCpuInfo(); |
| | | |
| | | return success(jsonObject); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å
åä¿¡æ¯") |
| | | @GetMapping(value = "/selectMemInfo") |
| | | public ResponseMsg<JSONObject> selectMemInfo() { |
| | | try { |
| | | JSONObject jsonObject = scheduleService.selectMemInfo(); |
| | | |
| | | return success(jsonObject); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢å¨çº¿ç¨æ·") |
| | | @GetMapping(value = "/selectOnlineUsers") |
| | | public ResponseMsg<List<JSONObject>> selectOnlineUsers() { |
| | | try { |
| | | List<JSONObject> list = scheduleService.selectOnlineUsers(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æå¡èµæºç¶æ") |
| | | @GetMapping(value = "/selectResStatus") |
| | | public ResponseMsg<List<ResEntity>> selectResStatus() { |
| | | try { |
| | | List<ResEntity> list = scheduleService.selectResStatus(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.DepEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.sys.DepService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * ç»ç»æºæ |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\åä½ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/dep") |
| | | public class DepController extends BaseController { |
| | | @Autowired |
| | | DepService depService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.DepEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertDep", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertDep(@RequestBody DepEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = depService.insertDep(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "com.lf.server.entity.sys.DepEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertDes", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertDes(@RequestBody List<DepEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DepEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = depService.insertDeps(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 = "/deleteDep") |
| | | public ResponseMsg<Integer> deleteDep(int id) { |
| | | try { |
| | | int count = depService.deleteDep(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") |
| | | }) |
| | | @GetMapping(value = "/deleteDeps") |
| | | public ResponseMsg<Integer> deleteDeps(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = depService.deleteDeps(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "DepEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateDep", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateDep(@RequestBody DepEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = depService.updateDep(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "DepEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateDeps", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateDeps(@RequestBody List<DepEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (DepEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = depService.updateDeps(list); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectDep") |
| | | public ResponseMsg<DepEntity> selectDep(int id) { |
| | | try { |
| | | DepEntity de = depService.selectDep(id); |
| | | return success(de); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æææ°æ®") |
| | | @GetMapping(value = "/selectDepAll") |
| | | public ResponseMsg<List<DepEntity>> selectDepAll() { |
| | | try { |
| | | List<DepEntity> list = depService.selectDepAll(); |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "é彿¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åä½åç§°", dataType = "String", paramType = "query", required = false, example = "ä¸å½xxxå·¥ç¨æéå
¬å¸") |
| | | }) |
| | | @GetMapping(value = "/selectDepRecursive") |
| | | public ResponseMsg<List<DepEntity>> selectDepRecursive(String name) { |
| | | try { |
| | | if (StringHelper.isEmpty(name)) { |
| | | name = "ä¸å½xxxå·¥ç¨æéå
¬å¸"; |
| | | } |
| | | List<DepEntity> list = depService.selectDepRecursive(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.DownlogEntity; |
| | | import com.moon.server.service.sys.DownlogService; |
| | | import com.moon.server.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 java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä¸è½½æ¥å¿ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ä¸è½½æ¥å¿") |
| | | @RestController |
| | | @RequestMapping("/downlog") |
| | | public class DownlogController extends BaseController { |
| | | @Autowired |
| | | DownlogService downlogService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "å"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "3"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-12-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-12-25 17:00:00"), |
| | | @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<Object> selectByPageAndCount(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = downlogService.selectCount(uname, type, start, end); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<DownlogEntity> rs = downlogService.selectByPage(uname, type, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.LoginEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.sys.LoginService; |
| | | import com.moon.server.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.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç»å½æ¥å¿ |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ç»å½æ¥å¿") |
| | | @RestController |
| | | @RequestMapping("/login") |
| | | public class LoginController extends BaseController { |
| | | @Autowired |
| | | LoginService loginService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "管çå"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 17:00:00") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String uname, Integer type, Timestamp start, Timestamp end) { |
| | | try { |
| | | int count = loginService.selectCount(uname, type, start, end); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "管çå"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 17:00:00"), |
| | | @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<LoginEntity>> selectByPage(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | List<LoginEntity> rs = loginService.selectByPage(uname, type, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "管çå"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 17:00:00"), |
| | | @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<LoginEntity>> selectByPageAndCount(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = loginService.selectCount(uname, type, start, end); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<LoginEntity> rs = loginService.selectByPage(uname, type, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.LoginEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertLogin", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertLogin(@RequestBody LoginEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int count = loginService.insertLogin(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<LoginEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertLogins", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertLogins(@RequestBody List<LoginEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (LoginEntity entity : list) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = loginService.insertLogins(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 = "/deleteLogin") |
| | | public ResponseMsg<Integer> deleteLogin(int id) { |
| | | try { |
| | | int count = loginService.deleteLogin(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteLogins") |
| | | public ResponseMsg<Integer> deleteLogins(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | int count = loginService.deleteLogins(ids); |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "LoginEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateLogin", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateLogin(@RequestBody LoginEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int count = loginService.updateLogin(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectLogin") |
| | | public ResponseMsg<LoginEntity> selectLogin(int id) { |
| | | try { |
| | | LoginEntity loginEntity = loginService.selectLogin(id); |
| | | |
| | | return success(loginEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectLoginAll") |
| | | public ResponseMsg<List<LoginEntity>> selectLoginAll() { |
| | | try { |
| | | List<LoginEntity> list = loginService.selectLoginAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.MenuAuthEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.MenuAuthService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * èå-æé |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\èåæé") |
| | | @RestController |
| | | @RequestMapping("/menuAuth") |
| | | public class MenuAuthController extends BaseController { |
| | | @Autowired |
| | | MenuAuthService menuAuthService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "menuid", value = "èåID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer menuid) { |
| | | try { |
| | | int count = menuAuthService.selectCount(menuid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "menuid", 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<MenuAuthEntity>> selectByPage(Integer menuid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<MenuAuthEntity> rs = menuAuthService.selectByPage(menuid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "menuid", 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<MenuAuthEntity>> selectByPageAndCount(Integer menuid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = menuAuthService.selectCount(menuid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<MenuAuthEntity> rs = menuAuthService.selectByPage(menuid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²ID+èåIDå页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "menuid", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<MenuAuthEntity>> selectByPageForRole(Integer roleid, Integer menuid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = menuAuthService.selectCountForRole(roleid, menuid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<MenuAuthEntity> rs = menuAuthService.selectByPageForRole(roleid, menuid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<MenuAuthEntity>> selectAll() { |
| | | try { |
| | | List<MenuAuthEntity> list = menuAuthService.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<MenuAuthEntity> selectById(int id) { |
| | | try { |
| | | MenuAuthEntity entity = menuAuthService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MenuAuthEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody MenuAuthEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = menuAuthService.insert(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MenuAuthEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<MenuAuthEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MenuAuthEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = menuAuthService.inserts(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 { |
| | | int count = menuAuthService.delete(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 = menuAuthService.deletes(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MenuAuthEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody MenuAuthEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = menuAuthService.update(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MenuAuthEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<MenuAuthEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MenuAuthEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = menuAuthService.updates(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.MenuEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.MenuService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * èå |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | @Api(tags= "è¿ç»´ç®¡ç\\èå管ç") |
| | | @RestController |
| | | @RequestMapping("/menu") |
| | | public class MenuController extends BaseController { |
| | | @Autowired |
| | | MenuService menuService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.MenusEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertMenu", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertMenu(@RequestBody MenuEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = menuService.insertMenu(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "com.lf.server.entity.sys.MenusEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertMenus", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertMenus(@RequestBody List<MenuEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MenuEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = menuService.insertMenus(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 = "/deleteMenu") |
| | | public ResponseMsg<Integer> deleteMenu(int id) { |
| | | try { |
| | | int count = menuService.deleteMenu(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteMenus") |
| | | public ResponseMsg<Integer> deleteMenus(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = menuService.deleteMenus(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "MenusEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateMenu", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateMenu(@RequestBody MenuEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = menuService.updateMenu(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "MenusEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateMenus", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateMenus(@RequestBody List<MenuEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (MenuEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = menuService.updateMenus(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectMenu") |
| | | public ResponseMsg<MenuEntity> selectMenu(int id) { |
| | | try { |
| | | MenuEntity menuEntity = menuService.selectMenu(id); |
| | | |
| | | return success(menuEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectMenuAll") |
| | | public ResponseMsg<List<MenuEntity>> selectMenuAll() { |
| | | try { |
| | | List<MenuEntity> list = menuService.selectMenuAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "é彿¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "èååç§°", dataType = "String", paramType = "query", required = false, example = "管éåºç¡å¤§æ°æ®å¹³å°") |
| | | }) |
| | | @GetMapping(value = "/selectMenuRecursive") |
| | | public ResponseMsg<Object> selectMenuRecursive(String name) { |
| | | try { |
| | | if (StringHelper.isEmpty(name)) { |
| | | name = "管éåºç¡å¤§æ°æ®å¹³å°"; |
| | | } |
| | | List<MenuEntity> list = menuService.selectMenuRecursive(name); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.OperateEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.sys.OperateService; |
| | | import com.moon.server.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.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æä½æ¥å¿ |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\æä½æ¥å¿") |
| | | @RestController |
| | | @RequestMapping("/operate") |
| | | public class OperateController extends BaseController { |
| | | @Autowired |
| | | OperateService operateService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "管çå"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 17:00:00") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String uname, Integer type, Timestamp start, Timestamp end) { |
| | | try { |
| | | int count = operateService.selectCount(uname, type, start, end); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "管çå"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 17:00:00"), |
| | | @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<OperateEntity>> selectByPage(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | List<OperateEntity> rs = operateService.selectByPage(uname, type, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "管çå"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 17:00:00"), |
| | | @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<OperateEntity>> selectByPageAndCount(String uname, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = operateService.selectCount(uname, type, start, end); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<OperateEntity> rs = operateService.selectByPage(uname, type, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.OperateEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertOperate", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertOperate(@RequestBody OperateEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int count = operateService.insertOperate(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<OperateEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertOperates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertOperates(@RequestBody List<OperateEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (OperateEntity entity : list) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = operateService.insertOperates(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 = "/deleteOperate") |
| | | public ResponseMsg<Integer> deleteOperate(int id) { |
| | | try { |
| | | int count = operateService.deleteOperate(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteOperates") |
| | | public ResponseMsg<Integer> deleteOperates(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | int count = operateService.deleteOperates(ids); |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "OperateEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateOperate", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateOperate(@RequestBody OperateEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int count = operateService.updateOperate(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectOperate") |
| | | public ResponseMsg<OperateEntity> selectOperate(int id) { |
| | | try { |
| | | OperateEntity operateEntity = operateService.selectOperate(id); |
| | | |
| | | return success(operateEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectOperateAll") |
| | | public ResponseMsg<List<OperateEntity>> selectOperateAll() { |
| | | try { |
| | | List<OperateEntity> list = operateService.selectOperateAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.ReportEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.sys.ReportService; |
| | | import com.moon.server.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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¥åæ¨¡æ¿ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\模æ¿ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/report") |
| | | public class ReportController extends BaseController { |
| | | @Autowired |
| | | ReportService reportService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | private final static String TAB_NAME = "lf.sys_report"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @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<ReportEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = reportService.selectCount(name, null); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ReportEntity> rs = reportService.selectByPage(name, null, 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<ReportEntity> selectById(int id) { |
| | | try { |
| | | ReportEntity entity = reportService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ReportEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody ReportEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = reportService.insert(entity); |
| | | |
| | | 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 { |
| | | int count = reportService.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 = reportService.deletes(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ReportEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody ReportEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = reportService.update(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | return uploadAttachService.upload(ue, TAB_NAME, file, this); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, res); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.ResEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.all.UploadAttachService; |
| | | import com.moon.server.service.data.DownloadService; |
| | | import com.moon.server.service.sys.ResService; |
| | | import com.moon.server.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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * èµæºè¡¨ |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\èµæºç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/res") |
| | | public class ResController extends BaseController { |
| | | @Autowired |
| | | ResService resService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @Autowired |
| | | 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 = "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) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = resService.selectCount(name); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<ResEntity> rs = resService.selectByPage(name, pageSize, pageSize * (pageIndex - 1)); |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<ResEntity>> selectByPageForRole(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = resService.selectCountForRole(roleid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ResEntity> rs = resService.selectByPageForRole(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.ResEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertRes", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRes(@RequestBody ResEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = resService.insertRes(entity); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<ResEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertRess", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRess(@RequestBody List<ResEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ResEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = resService.insertRess(list); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | 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 = "/deleteRes") |
| | | public ResponseMsg<Integer> deleteRes(int id) { |
| | | try { |
| | | int count = resService.deleteRes(id); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteRess") |
| | | public ResponseMsg<Integer> deleteRess(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = resService.deleteRess(ids); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "ResEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateRes", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateRes(@RequestBody ResEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = resService.updateRes(entity); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRes") |
| | | public ResponseMsg<ResEntity> selectRes(int id) { |
| | | try { |
| | | ResEntity resEntity = resService.selectRes(id); |
| | | |
| | | return success(resEntity); |
| | | } 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); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | return uploadAttachService.upload(ue, TAB_NAME, file, this); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "ä¸è½½æä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, false, res); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥çæä»¶") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "éä»¶Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/downloadForView") |
| | | public void downloadForView(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, true, res); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.ResOpEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.sys.ResOpService; |
| | | import com.moon.server.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.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * èµæºæä½ |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\èµæºæä½") |
| | | @RestController |
| | | @RequestMapping("/resOp") |
| | | public class ResOpController extends BaseController { |
| | | @Autowired |
| | | ResOpService resOpService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "èµæºåç§°", dataType = "String", paramType = "query", example = "天å°å¾"), |
| | | @ApiImplicitParam(name = "type", value = "æä½ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 18:00:00"), |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name, Integer type, Timestamp start, Timestamp end) { |
| | | try { |
| | | int count = resOpService.selectCount(name, type, start, end); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "èµæºåç§°", dataType = "String", paramType = "query", example = "天å°å¾"), |
| | | @ApiImplicitParam(name = "type", value = "æä½ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 18:00:00"), |
| | | @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<ResOpEntity>> selectByPage(String name, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | List<ResOpEntity> rs = resOpService.selectByPage(name, type, start, end, 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 = "天å°å¾"), |
| | | @ApiImplicitParam(name = "type", value = "æä½ç±»å", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "start", value = "å¼å§æ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-09 09:00:00"), |
| | | @ApiImplicitParam(name = "end", value = "ç»ææ¶é´", dataType = "Timestamp", paramType = "query", example = "2022-10-10 18:00:00"), |
| | | @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<ResOpEntity>> selectByPageAndCount(String name, Integer type, Timestamp start, Timestamp end, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = resOpService.selectCount(name, type, start, end); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<ResOpEntity> rs = resOpService.selectByPage(name, type, start, end, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.ResOpEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertResOp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertResOp(@RequestBody ResOpEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int count = resOpService.insertResOp(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<ResOpEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertResOps", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertResOps(@RequestBody List<ResOpEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (ResOpEntity entity : list) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = resOpService.insertResOps(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 = "/deleteLogin") |
| | | public ResponseMsg<Integer> deleteResOp(int id) { |
| | | try { |
| | | int count = resOpService.deleteResOp(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteResOps") |
| | | public ResponseMsg<Integer> deleteResOps(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | int count = resOpService.deleteResOps(ids); |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "IDæ°ç»", dataType = "LoginEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateResOp", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateResOp(@RequestBody ResOpEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUserid(ue.getId()); |
| | | } |
| | | |
| | | int count = resOpService.updateResOp(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectResOp") |
| | | public ResponseMsg<ResOpEntity> selectResOp(int id) { |
| | | try { |
| | | ResOpEntity resOpEntity = resOpService.selectResOp(id); |
| | | |
| | | return success(resOpEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectResOpAll") |
| | | public ResponseMsg<List<ResOpEntity>> selectResOpAll() { |
| | | try { |
| | | List<ResOpEntity> list = resOpService.selectResOpAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.RoleEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.RoleService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | *è§è²è¡¨ |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\è§è²ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/role") |
| | | public class RoleController extends BaseController { |
| | | @Autowired |
| | | RoleService roleService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "Admin"), |
| | | @ApiImplicitParam(name = "depid", value = "åä½ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name, Integer depid) { |
| | | try { |
| | | int count = roleService.selectCount(name, depid); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "åç§°", dataType = "String", paramType = "query", example = "Admin"), |
| | | @ApiImplicitParam(name = "depid", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<RoleEntity>> selectByPage(String name, Integer depid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<RoleEntity> rs = roleService.selectByPage(name, depid, 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 = "Admin"), |
| | | @ApiImplicitParam(name = "depid", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<RoleEntity>> selectByPageAndCount(String name, Integer depid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = roleService.selectCount(name, depid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<RoleEntity> rs = roleService.selectByPage(name, depid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.RoleEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertRole", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRole(@RequestBody RoleEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleService.insertRole(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<RoleEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertRoles", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertRoles(@RequestBody List<RoleEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleService.insertRoles(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 = "/deleteRole") |
| | | public ResponseMsg<Integer> deleteRole(int id) { |
| | | try { |
| | | int count = roleService.deleteRole(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteAuths") |
| | | public ResponseMsg<Integer> deleteRoles(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = roleService.deleteRoles(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateRole", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateRole(@RequestBody RoleEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleService.updateRole(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRole") |
| | | public ResponseMsg<RoleEntity> selectRole(int id) { |
| | | try { |
| | | RoleEntity roleEntity = roleService.selectRole(id); |
| | | |
| | | return success(roleEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectRoleAll") |
| | | public ResponseMsg<List<RoleEntity>> selectRoleAll() { |
| | | try { |
| | | List<RoleEntity> list = roleService.selectRoleAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.RoleMenuAuthEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.RoleMenuAuthService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * è§è²-èå |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\è§è²èå") |
| | | @RestController |
| | | @RequestMapping("/roleMenuAuth") |
| | | public class RoleMenuAuthController extends BaseController { |
| | | @Autowired |
| | | RoleMenuAuthService roleMenuAuthService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer roleid) { |
| | | try { |
| | | int count = roleMenuAuthService.selectCount(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<RoleMenuAuthEntity>> selectByPage(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<RoleMenuAuthEntity> rs = roleMenuAuthService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(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<RoleMenuAuthEntity>> selectByPageAndCount(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = roleMenuAuthService.selectCount(roleid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<RoleMenuAuthEntity> rs = roleMenuAuthService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²ID+èåIDå页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "menuid", 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") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<RoleMenuAuthEntity>> selectByPageForRole(Integer roleid, Integer menuid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = roleMenuAuthService.selectCountForRole(roleid, menuid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<RoleMenuAuthEntity> rs = roleMenuAuthService.selectByPageForRole(roleid, menuid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<RoleMenuAuthEntity>> selectAll() { |
| | | try { |
| | | List<RoleMenuAuthEntity> list = roleMenuAuthService.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<RoleMenuAuthEntity> selectById(int id) { |
| | | try { |
| | | RoleMenuAuthEntity entity = roleMenuAuthService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleMenuAuthEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody RoleMenuAuthEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleMenuAuthService.insert(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleMenuAuthEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<RoleMenuAuthEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleMenuAuthEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleMenuAuthService.inserts(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 { |
| | | int count = roleMenuAuthService.delete(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 = roleMenuAuthService.deletes(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleMenuAuthEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody RoleMenuAuthEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleMenuAuthService.update(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleMenuAuthEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<RoleMenuAuthEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleMenuAuthEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleMenuAuthService.updates(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.RoleResEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.RoleResService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * è§è²-èµæº |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\è§è²èµæº") |
| | | @RestController |
| | | @RequestMapping("/roleRes") |
| | | public class RoleResController extends BaseController { |
| | | @Autowired |
| | | RoleResService roleResService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer roleid) { |
| | | try { |
| | | int count = roleResService.selectCount(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); |
| | | } 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<RoleResEntity>> selectByPageAndCount(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<RoleResEntity> selectById(int id) { |
| | | try { |
| | | RoleResEntity entity = roleResService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleResEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody RoleResEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleResService.insert(entity); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleResEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<RoleResEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleResEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleResService.inserts(list); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | 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 { |
| | | int count = roleResService.delete(id); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | 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 = roleResService.deletes(ids); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleResEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody RoleResEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleResService.update(entity); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleResEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<RoleResEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleResEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleResService.updates(list); |
| | | if (count > 0) { |
| | | permsService.clearResCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.RoleUserEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.service.all.PermsService; |
| | | import com.moon.server.service.sys.RoleUserService; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * è§è²-ç¨æ· |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ç¨æ·è§è²") |
| | | @RestController |
| | | @RequestMapping("/roleUser") |
| | | public class RoleUserController extends BaseController { |
| | | @Autowired |
| | | RoleUserService roleUserService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢è®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", required = false, example = "") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(Integer roleid) { |
| | | try { |
| | | int count = roleUserService.selectCount(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<RoleUserEntity>> selectByPage(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | List<RoleUserEntity> rs = roleUserService.selectByPage(roleid, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(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<RoleUserEntity>> selectByPageAndCount(Integer roleid, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = roleUserService.selectCount(roleid); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<RoleUserEntity> rs = roleUserService.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<RoleUserEntity>> selectAll() { |
| | | try { |
| | | List<RoleUserEntity> list = roleUserService.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<RoleUserEntity> selectById(int id) { |
| | | try { |
| | | RoleUserEntity entity = roleUserService.selectById(id); |
| | | |
| | | return success(entity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleUserEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody RoleUserEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleUserService.insert(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleUserEntity", paramType = "body") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<RoleUserEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleUserEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleUserService.inserts(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 { |
| | | int count = roleUserService.delete(id); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | 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 = roleUserService.deletes(ids); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "RoleUserEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> update(@RequestBody RoleUserEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = roleUserService.update(entity); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "RoleUserEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updates(@RequestBody List<RoleUserEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (RoleUserEntity entity : list) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = roleUserService.updates(list); |
| | | if (count > 0) { |
| | | permsService.clearPermsCache(); |
| | | } |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.TokenEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.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; |
| | | |
| | | /** |
| | | * 令ç表 |
| | | * @author sws |
| | | * @date 2022-09-28 |
| | | */ |
| | | |
| | | @Api(tags = "è¿ç»´ç®¡ç\\令ç管ç") |
| | | @RestController |
| | | @RequestMapping("/token") |
| | | public class TokenController extends BaseController { |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "令ç", dataType = "String", paramType = "query", example = "ec101de8-1403-4d8f-ad13-edab8358399b"), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataType = "Integer", paramType = "query", example = "0"), |
| | | @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<TokenEntity>> selectByPageAndCount(String name, Integer type, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = tokenService.selectCount(name,type); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | List<TokenEntity> rs = tokenService.selectByPage(name,type, pageSize, pageSize * (pageIndex - 1)); |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.sys.TokenEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertToken", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertToken(@RequestBody TokenEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = tokenService.insertToken(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<TokenEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertTokens", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertTokens(@RequestBody List<TokenEntity> list, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | for (TokenEntity entity : list) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = tokenService.insertTokens(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 = "/deleteToken") |
| | | public ResponseMsg<Integer> deleteToken(int id) { |
| | | try { |
| | | int count = tokenService.deleteToken(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteTokens") |
| | | public ResponseMsg<Integer> deleteTokens(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | int count = tokenService.deleteTokens(ids); |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "TokenEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateToken", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> updateToken(@RequestBody TokenEntity entity, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = tokenService.updateToken(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1658") |
| | | }) |
| | | @GetMapping(value = "/selectToken") |
| | | public ResponseMsg<TokenEntity> selectToken(int id) { |
| | | try { |
| | | TokenEntity tokenEntity = tokenService.selectToken(id); |
| | | |
| | | return success(tokenEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.controller.sys; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.controller.all.BaseController; |
| | | import com.moon.server.entity.all.ResponseMsg; |
| | | import com.moon.server.entity.sys.RoleEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.entity.ctrl.UserUpdateEntity; |
| | | import com.moon.server.helper.StringHelper; |
| | | import com.moon.server.service.sys.TokenService; |
| | | import com.moon.server.service.sys.UserService; |
| | | 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; |
| | | |
| | | /** |
| | | * ç¨æ·è¡¨ |
| | | * @author sws |
| | | * @date 2022-09-27 |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\ç¨æ·ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/user") |
| | | public class UserController extends BaseController { |
| | | @Autowired |
| | | UserService userService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "室"), |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @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<UserEntity>> selectByPageAndCount(String uname, String depcode, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | |
| | | int count = userService.selectCount(uname, depcode); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectByPage(uname, depcode, pageSize, pageSize * (pageIndex - 1)); |
| | | |
| | | return success(count, rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²+åä½å页æ¥è¯¢å¹¶è¿åè®°å½æ°") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uname", value = "ç¨æ·å", dataType = "String", paramType = "query", example = "室"), |
| | | @ApiImplicitParam(name = "roleid", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | @ApiImplicitParam(name = "depcode", value = "åä½ç¼ç ", dataType = "String", paramType = "query", example = "00"), |
| | | @ApiImplicitParam(name = "pageSize", value = "æ¯é¡µæ¡æ°", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "å页æ°ï¼ä»1å¼å§ï¼", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageForRole") |
| | | public ResponseMsg<List<UserEntity>> selectByPageForRole(String uname, Integer roleid, String depcode, Integer pageSize, Integer pageIndex) { |
| | | try { |
| | | if (pageSize < 1 || pageIndex < 1) { |
| | | return fail("æ¯é¡µé¡µæ°æå页æ°å°äº1", null); |
| | | } |
| | | int count = userService.selectCountForRole(uname, roleid, depcode); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectByPageForRole(uname, roleid, depcode, 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 = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectUser") |
| | | public ResponseMsg<UserEntity> selectUser(int id) { |
| | | try { |
| | | UserEntity userEntity = userService.selectUser(id); |
| | | |
| | | return success(userEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "uid", value = "ç¨æ·ID", dataType = "String", paramType = "query", example = "admin") |
| | | }) |
| | | @GetMapping(value = "/selectByUid") |
| | | public ResponseMsg<UserEntity> selectByUid(String uid) { |
| | | try { |
| | | if (StringHelper.isEmpty(uid)) { |
| | | fail("ç¨æ·IDä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | UserEntity userEntity = userService.selectByUid(uid); |
| | | |
| | | return success(userEntity); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ææ") |
| | | @GetMapping(value = "/selectUserAll") |
| | | public ResponseMsg<List<UserEntity>> selectUserAll() { |
| | | try { |
| | | List<UserEntity> list = userService.selectUserAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ¯/å¦ä¸ºç®¡çå") |
| | | @GetMapping(value = "/selectForIsAdmin") |
| | | public ResponseMsg<Boolean> selectForIsAdmin(HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·æªç»å½", false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | |
| | | return success("æå", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢æ¯/å¦ä¸ºç®¡çå") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectIsAdmin") |
| | | public ResponseMsg<Boolean> selectIsAdmin(Integer id) { |
| | | try { |
| | | UserEntity ue = userService.selectUser(id); |
| | | if (ue == null) { |
| | | return fail("ç¨æ·ä¸åå¨", false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | |
| | | return success("æå", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çåç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "管çåç±»å«", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectAdminUsers") |
| | | public ResponseMsg<Object> selectAdminUsers(Integer type) { |
| | | try { |
| | | if (null == type || type < 1) { |
| | | return fail("管çåç±»å«ä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectAdminUsers(type); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ç¨æ·ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectRoleByUserId") |
| | | public ResponseMsg<Object> selectRoleByUserId(Integer id) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return fail("ç¨æ·IDä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<RoleEntity> rs = userService.selectRoleByUserId(id); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ ¹æ®è§è²æ¥è¯¢ç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "è§è²ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectUserByRoleId") |
| | | public ResponseMsg<Object> selectUserByRoleId(Integer id) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return fail("ç¨æ·IDä¸è½ä¸ºç©ºæå°äº1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectUserByRoleId(id); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "com.lf.server.entity.data.UserEntity", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertUser", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertUser(@RequestBody UserEntity entity, HttpServletRequest req) { |
| | | try { |
| | | String str = userService.validateNewPwd(entity); |
| | | if (str != null) { |
| | | return fail(str, -1); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = userService.insertUser(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå
¥å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "å®ä½ç±»éå", dataType = "List<UserEntity>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertUsers", produces = "application/json; charset=UTF-8") |
| | | @SuppressWarnings("AlibabaRemoveCommentedCode") |
| | | public ResponseMsg<Integer> insertUsers(@RequestBody List<UserEntity> list, HttpServletRequest req) { |
| | | try { |
| | | if (list == null || list.isEmpty()) { |
| | | return fail("å®ä½ç±»éå为空", -1); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | for (UserEntity entity : list) { |
| | | /*String str = userService.validateNewPwd(entity); |
| | | if (str != null) { |
| | | return fail(str, -1); |
| | | }*/ |
| | | if (ue != null) { |
| | | entity.setCreateUser(ue.getId()); |
| | | } |
| | | } |
| | | |
| | | int count = userService.insertUsers(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 = "/deleteUser") |
| | | public ResponseMsg<Integer> deleteUser(int id) { |
| | | try { |
| | | int count = userService.deleteUser(id); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤å¤æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "IDæ°ç»", dataType = "List<Integer>", paramType = "query", example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deleteUsers") |
| | | public ResponseMsg<Integer> deleteUsers(@RequestParam List<Integer> ids) { |
| | | try { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return fail("idæ°ç»ä¸è½ä¸ºç©º", -1); |
| | | } |
| | | |
| | | int count = userService.deleteUsers(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°ä¸æ¡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "å®ä½ç±»", dataType = "UserEntity", paramType = "body", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateUser", produces = "application/json; charset=UTF-8") |
| | | @SuppressWarnings("AlibabaRemoveCommentedCode") |
| | | public ResponseMsg<Integer> updateUser(@RequestBody UserEntity entity, HttpServletRequest req) { |
| | | try { |
| | | /*String str = userService.validateOldPwd(entity); |
| | | if (str != null) { |
| | | return fail(str, -1); |
| | | }*/ |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = userService.updateUser(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ´æ°å¤ä¸ªç¨æ·å¯ç ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "adminPwd", value = "管çåå¯ç ", dataType = "String", paramType = "body", example = ""), |
| | | @ApiImplicitParam(name = "newPwd", value = "æ°å¯ç ", dataType = "String", paramType = "body", example = ""), |
| | | @ApiImplicitParam(name = "ids", value = "ç¨æ·IDéå", dataType = "List<Integer>", paramType = "body", example = "") |
| | | }) |
| | | @PostMapping(value = "/updateUsersPwd", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Boolean> updateUsersPwd(@RequestBody UserUpdateEntity uue, HttpServletRequest req) { |
| | | try { |
| | | if (uue == null || uue.getIds() == null || uue.getIds().isEmpty()) { |
| | | return fail("æ²¡ææ¾å°æ°æ®", false); |
| | | } |
| | | |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | String str = userService.validateAdminPwd(ue, uue.getAdminPwd()); |
| | | if (str != null) { |
| | | return fail(str, false); |
| | | } |
| | | |
| | | Integer rows = userService.selectForIsAdmin(ue.getId()); |
| | | if (rows < 1) { |
| | | return fail("åªå
许管çåæä½", false); |
| | | } |
| | | |
| | | str = userService.validateNewPwd(ue, uue.getNewPwd()); |
| | | if (str != null) { |
| | | return fail(str, false); |
| | | } |
| | | |
| | | rows = userService.updateUsersPwd(ue.getId(), ue.getSalt(), uue.getIds()); |
| | | |
| | | return success(rows > 0 ? "æ´æ°æå" : "æ´æ°å¤±è´¥", rows > 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex, false); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * å¯ç æ½è±¡ç±» |
| | | * @author WWW |
| | | */ |
| | | public abstract class AbstractPwdEntity { |
| | | private String pwd; |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * åºç¡å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class BaseEntity implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer gid; |
| | | |
| | | private String eventid; |
| | | |
| | | private String parentid; |
| | | |
| | | private String dirid; |
| | | |
| | | private String depid; |
| | | |
| | | private Integer verid; |
| | | |
| | | private Timestamp createtime; |
| | | |
| | | private Integer createuser; |
| | | |
| | | private Integer updateuser; |
| | | |
| | | private Timestamp updatetime; |
| | | |
| | | @TableField(value = "fn_get_fullname(dirid, 2)", updateStrategy = FieldStrategy.NEVER) |
| | | private String dirName; |
| | | |
| | | @TableField(value = "fn_get_fullname(depid, 1)", updateStrategy = FieldStrategy.NEVER) |
| | | private String depName; |
| | | |
| | | @TableField(value = "fn_ver(verid)", updateStrategy = FieldStrategy.NEVER) |
| | | private String verName; |
| | | |
| | | @TableField(value = "fn_uname(createuser)", updateStrategy = FieldStrategy.NEVER) |
| | | private String createName; |
| | | |
| | | @TableField(value = "fn_uname(updateuser)", updateStrategy = FieldStrategy.NEVER) |
| | | private String updateName; |
| | | |
| | | public BaseEntity() { |
| | | } |
| | | |
| | | public Integer getGid() { |
| | | return gid; |
| | | } |
| | | |
| | | public void setGid(Integer gid) { |
| | | this.gid = gid; |
| | | } |
| | | |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public String getParentid() { |
| | | return parentid; |
| | | } |
| | | |
| | | public void setParentid(String parentid) { |
| | | this.parentid = parentid; |
| | | } |
| | | |
| | | public String getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(String dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public String getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(String depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public Integer getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setVerid(Integer verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public Timestamp getCreatetime() { |
| | | return createtime; |
| | | } |
| | | |
| | | public void setCreatetime(Timestamp createtime) { |
| | | this.createtime = createtime; |
| | | } |
| | | |
| | | public Integer getCreateuser() { |
| | | return createuser; |
| | | } |
| | | |
| | | public void setCreateuser(Integer createuser) { |
| | | this.createuser = createuser; |
| | | } |
| | | |
| | | public Integer getUpdateuser() { |
| | | return updateuser; |
| | | } |
| | | |
| | | public void setUpdateuser(Integer updateuser) { |
| | | this.updateuser = updateuser; |
| | | } |
| | | |
| | | public Timestamp getUpdatetime() { |
| | | return updatetime; |
| | | } |
| | | |
| | | public void setUpdatetime(Timestamp updatetime) { |
| | | this.updatetime = updatetime; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getVerName() { |
| | | return verName; |
| | | } |
| | | |
| | | public void setVerName(String verName) { |
| | | this.verName = verName; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | /** |
| | | * 空é´åºç¡å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class BaseGeoEntity extends BaseEntity { |
| | | @TableField(select = false) |
| | | private String geom; |
| | | |
| | | public String getGeom() { |
| | | return geom; |
| | | } |
| | | |
| | | public void setGeom(String geom) { |
| | | this.geom = geom; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * Httpç¶æç ç±» |
| | | * @author WWW |
| | | */ |
| | | public enum HttpStatus { |
| | | /** |
| | | * è¯·æ±æå |
| | | */ |
| | | OK(200,"è¯·æ±æå"), |
| | | |
| | | /** |
| | | * è¯·æ±æ æ |
| | | */ |
| | | BAD_REQUEST(400,"è¯·æ±æ æ"), |
| | | |
| | | /** |
| | | * æªç»ææè®¿é® |
| | | */ |
| | | UNAUTHORIZED(401,"æªç»ææè®¿é®"), |
| | | |
| | | /** |
| | | * æå¡è¯·æ±æªæ¾å° |
| | | */ |
| | | NOT_FOUND(404,"æå¡è¯·æ±æªæ¾å°"), |
| | | |
| | | /** |
| | | * ç³»ç»é误 |
| | | */ |
| | | ERROR(500,"ç³»ç»é误"), |
| | | |
| | | /** |
| | | * åå¨éå¤çæ°æ® |
| | | */ |
| | | UNIQUE_ERROR(500100,"åå¨éå¤çæ°æ®"), |
| | | |
| | | /** |
| | | * åæ°æ ¡éªé误 |
| | | */ |
| | | VALIDATE_ERROR(500101,"åæ°æ ¡éªé误"), |
| | | |
| | | /** |
| | | * tokené误 |
| | | */ |
| | | TOKEN_ERROR(500102,"tokené误"), |
| | | |
| | | /** |
| | | * ç¨æ·æªç»é |
| | | */ |
| | | NO_LOGIN_ERROR(500104,"ç¨æ·æªç»é"), |
| | | |
| | | /** |
| | | * ç»é失败 |
| | | */ |
| | | LOGIN_ERROR(500105,"ç»é失败"), |
| | | |
| | | /** |
| | | * æ æéè®¿é® |
| | | */ |
| | | NO_AUTH_ERROR(500106,"æ æé访é®"), |
| | | |
| | | /** |
| | | * ç¨æ·åé误 |
| | | */ |
| | | LOGIN_USER_ERROR(500107,"ç¨æ·åé误"), |
| | | |
| | | /** |
| | | * å¯ç é误 |
| | | */ |
| | | LOGIN_PWD_ERROR(500108,"å¯ç é误"), |
| | | |
| | | /** |
| | | * ç¨æ·è¢«éå® |
| | | */ |
| | | USER_LOCK_ERROR(500109,"ç¨æ·è¢«éå®"), |
| | | |
| | | /** |
| | | * å¯ç ä¸åè§è |
| | | */ |
| | | PWD_NONSTANDARD(500111,"å¯ç ä¸åè§è"), |
| | | |
| | | /** |
| | | * å¯ç è¿æ |
| | | */ |
| | | LOGIN_PWD_EXPIRE(500116,"å¯ç è¿æ"); |
| | | |
| | | private HttpStatus(int value, String msg) { |
| | | this.value = value; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | private int value; |
| | | |
| | | private String msg; |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * èåææ |
| | | * @author WWW |
| | | */ |
| | | public class MenusAuthEntity implements Serializable { |
| | | private static final long serialVersionUID = -944664756113218L; |
| | | |
| | | private Integer id; |
| | | |
| | | private Integer pid; |
| | | |
| | | private String cnName; |
| | | |
| | | private String enName; |
| | | |
| | | private String url; |
| | | |
| | | private String perms; |
| | | |
| | | private Integer type; |
| | | |
| | | private String css; |
| | | |
| | | private String icon; |
| | | |
| | | private Integer level; |
| | | |
| | | private Integer orderNum; |
| | | |
| | | private Integer isShow; |
| | | |
| | | public MenusAuthEntity() { |
| | | |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setPid(Integer 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 String getPerms() { |
| | | return perms; |
| | | } |
| | | |
| | | public void setPerms(String perms) { |
| | | this.perms = perms; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getCss() { |
| | | return css; |
| | | } |
| | | |
| | | public void setCss(String css) { |
| | | this.css = css; |
| | | } |
| | | |
| | | public String getIcon() { |
| | | return icon; |
| | | } |
| | | |
| | | public void setIcon(String icon) { |
| | | this.icon = icon; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | | public Integer getIsShow() { |
| | | return isShow; |
| | | } |
| | | |
| | | public void setIsShow(Integer isShow) { |
| | | this.isShow = isShow; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æéææ |
| | | * @author WWW |
| | | */ |
| | | public class PermsAuthEntity implements Serializable { |
| | | private static final long serialVersionUID = -8948994757253139554L; |
| | | |
| | | private Integer id; |
| | | |
| | | private Integer pid; |
| | | |
| | | private Integer orderNum; |
| | | |
| | | private String cnName; |
| | | |
| | | private String enName; |
| | | |
| | | private String name; |
| | | |
| | | private String perms; |
| | | |
| | | private String tag; |
| | | |
| | | public PermsAuthEntity() { |
| | | |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setPid(Integer pid) { |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public Integer getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(Integer orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | 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 getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getPerms() { |
| | | return perms; |
| | | } |
| | | |
| | | public void setPerms(String perms) { |
| | | this.perms = perms; |
| | | } |
| | | |
| | | public String getTag() { |
| | | return tag; |
| | | } |
| | | |
| | | public void setTag(String tag) { |
| | | this.tag = tag; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * Redisç¼åé® |
| | | * @author WWW |
| | | */ |
| | | public class RedisCacheKey { |
| | | /** |
| | | * ç»å½ä»¤çé® |
| | | */ |
| | | public static String signTokenKey(String key) { |
| | | return "sign:token:" + key; |
| | | } |
| | | |
| | | /** |
| | | * ç»å½ç¨æ·é® |
| | | */ |
| | | public static String signUserKey(String key) { |
| | | return "sign:user:" + key; |
| | | } |
| | | |
| | | /** |
| | | * å¯ç éè¯¯é® |
| | | */ |
| | | public static String signPwdError(String key) { |
| | | return "sign:pwdError:" + key; |
| | | } |
| | | |
| | | /** |
| | | * æææ ¹é® |
| | | */ |
| | | public static String permsRootKey() { |
| | | return "perms:"; |
| | | } |
| | | |
| | | /** |
| | | * èµæºææé® |
| | | */ |
| | | public static String permsResKey(String key) { |
| | | return "perms:res:" + key; |
| | | } |
| | | |
| | | /** |
| | | * èåææé® |
| | | */ |
| | | public static String permsMenusKey(String key) { |
| | | return "perms:menus:" + key; |
| | | } |
| | | |
| | | /** |
| | | * æéææé® |
| | | */ |
| | | public static String permsPermsKey(String key) { |
| | | return "perms:perms:" + key; |
| | | } |
| | | |
| | | /** |
| | | * æéææå®ä½é® |
| | | */ |
| | | public static String permsPermsEntityKey(String key) { |
| | | return "perms:permsEntity:" + key; |
| | | } |
| | | |
| | | /** |
| | | * é»/ç½ååé® |
| | | */ |
| | | public static String blacklistKey(String key) { |
| | | return "blacklist:" + key; |
| | | } |
| | | |
| | | /** |
| | | * å ä½å¯¹è±¡ç空é´åèé® |
| | | */ |
| | | public static String sridKey(String key) { |
| | | return "geom:srid:" + key; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * èµæºææ |
| | | * @author WWW |
| | | */ |
| | | public class ResAuthEntity implements Serializable { |
| | | private static final long serialVersionUID = 7610553267313397837L; |
| | | |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | private String server; |
| | | |
| | | public ResAuthEntity() { |
| | | |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getServer() { |
| | | return server; |
| | | } |
| | | |
| | | public void setServer(String server) { |
| | | this.server = server; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * ååºæ¶æ¯ç±» |
| | | * @author www |
| | | * @param <T> æ³å |
| | | */ |
| | | public class ResponseMsg<T> { |
| | | public ResponseMsg() { |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = this.code == 200 ? "æå" : "失败"; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, String msg, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = msg; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(int code, String msg, T result, long time) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.result = result; |
| | | this.time = time; |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, long count, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = this.code == 200 ? "æå" : "失败"; |
| | | this.count = count; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(HttpStatus code, String msg, long count, T result) { |
| | | this.code = code.getValue(); |
| | | this.msg = msg; |
| | | this.count = count; |
| | | this.result = result; |
| | | this.time = System.currentTimeMillis(); |
| | | } |
| | | |
| | | public ResponseMsg(int code, String msg, long count, T result, long time) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | this.count = count; |
| | | this.result = result; |
| | | this.time = time; |
| | | } |
| | | |
| | | private int code; |
| | | |
| | | private String msg; |
| | | |
| | | private long count; |
| | | |
| | | private T result; |
| | | |
| | | private long time; |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public long getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(long count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public T getResult() { |
| | | return result; |
| | | } |
| | | |
| | | public void setResult(T result) { |
| | | this.result = result; |
| | | } |
| | | |
| | | public long getTime() { |
| | | return time; |
| | | } |
| | | |
| | | public void setTime(long time) { |
| | | this.time = time; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * è®¾ç½®æ°æ®ç±» |
| | | * @author WWW |
| | | */ |
| | | public class SettingData { |
| | | /** |
| | | * å¯ç åºéæ¬¡æ° |
| | | */ |
| | | public static int PWD_ERR_COUNT = 5; |
| | | |
| | | /** |
| | | * åºéçå¾
æ¶é´ |
| | | */ |
| | | public static int PWD_ERR_TIME = 5; |
| | | |
| | | /** |
| | | * èªå¨ç»åºæ¶é´ |
| | | */ |
| | | public static int AUTO_LOGOUT = 15; |
| | | |
| | | /** |
| | | * ä»¤çæææ |
| | | */ |
| | | public static int TOKEN_EXPIRE = 240; |
| | | |
| | | /** |
| | | * ç¼åæææ |
| | | */ |
| | | public static int CACHE_EXPIRE = 240; |
| | | |
| | | /** |
| | | * æå¤§æä»¶æ°ï¼2000 |
| | | */ |
| | | public static int MAX_FILES = 2001; |
| | | |
| | | /** |
| | | * Cookieæææï¼s |
| | | */ |
| | | public static int COOKIE_MAX_AGE = 4 * 60 * 60; |
| | | |
| | | /** |
| | | * é件大å°ï¼B |
| | | */ |
| | | public static long MAX_FILE_SIZE = 50 * 1024 * 1024; |
| | | |
| | | /** |
| | | * ç¨æ·è®¿é®é |
| | | */ |
| | | public static int MAX_USER_LOGIN; |
| | | |
| | | /** |
| | | * æå¡ä¸é |
| | | */ |
| | | public static int MAX_SERVERS; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éææ°æ®ç±» |
| | | * @author WWW |
| | | */ |
| | | public class StaticData { |
| | | /** |
| | | * æéæé¤è·¯å¾ï¼/proxyï¼è¦æ±å
¨é¨å°å |
| | | */ |
| | | public static String[] EXCLUDE_PATH = new String[]{"/sign/", "/perms/", "/fmeit/", "/crds/", "/floatserver/", "/wmts/select", "/onemap/", "/swagger", "/error"}; |
| | | |
| | | public final static int TWO = 2; |
| | | |
| | | public final static int FOUR = 4; |
| | | |
| | | public final static int NINE = 9; |
| | | |
| | | public final static int TEN = 10; |
| | | |
| | | public final static int SIXTEEN = 16; |
| | | |
| | | public final static int ONE_HUNDRED = 100; |
| | | |
| | | public final static int TWO_HUNDRED = 200; |
| | | |
| | | public final static int ONE_HUNDRED_THOUSAND = 100000; |
| | | |
| | | public static final double D1024 = 1024.0; |
| | | |
| | | public static final double D1050 = 1050.0; |
| | | |
| | | public static final int I12 = 12; |
| | | |
| | | public static final int I23 = 23; |
| | | |
| | | public static final int I24 = 24; |
| | | |
| | | public static final int I31 = 31; |
| | | |
| | | public static final int I60 = 60; |
| | | |
| | | public static final int I90 = 90; |
| | | |
| | | public static final int I90_NEG = -90; |
| | | |
| | | public static final int I180 = 180; |
| | | |
| | | public static final int I180_NEG = -180; |
| | | |
| | | public static final int I1000 = 1000; |
| | | |
| | | public static final int I2050 = 2050; |
| | | |
| | | public static final int I4490 = 4490; |
| | | |
| | | /** |
| | | * å符1 |
| | | */ |
| | | public final static String S1 = "1"; |
| | | |
| | | /** |
| | | * çå· |
| | | */ |
| | | public final static String EQ = "="; |
| | | |
| | | /** |
| | | * åç¬¦ç¹ |
| | | */ |
| | | public final static String POINT = "."; |
| | | |
| | | /** |
| | | * éå· |
| | | */ |
| | | public final static String COMMA = ","; |
| | | |
| | | /** |
| | | * åå¼å· |
| | | */ |
| | | public final static String SINGLE_QUOTES = "'"; |
| | | |
| | | public final static String BBOREHOLE = "bborehole"; |
| | | |
| | | /** |
| | | * æ£ææ |
| | | */ |
| | | public final static String SLASH = "/"; |
| | | |
| | | public final static String IN = "in"; |
| | | |
| | | public final static String ZIP = ".zip"; |
| | | |
| | | public final static String XLS = ".xls"; |
| | | |
| | | public final static String XLSX = ".xlsx"; |
| | | |
| | | public final static String MDB = ".mdb"; |
| | | |
| | | public final static String SHP = ".shp"; |
| | | |
| | | public final static String GDB = ".gdb"; |
| | | |
| | | public final static String JPG = ".jpg"; |
| | | |
| | | public final static String IMG = ".img"; |
| | | |
| | | public final static String MPT = ".mpt"; |
| | | |
| | | public final static String D3DML = ".3dml"; |
| | | |
| | | public final static String TIF = ".tif"; |
| | | |
| | | public final static String TIFF = ".tiff"; |
| | | |
| | | public final static String ADMIN = "admin"; |
| | | |
| | | public final static String SYS_META = "sysmeta"; |
| | | |
| | | /** |
| | | * çæ¬å· |
| | | */ |
| | | public final static String VERSION = "1.0.0"; |
| | | |
| | | /** |
| | | * 令çé® |
| | | */ |
| | | public final static String TOKEN_KEY = "token"; |
| | | |
| | | /** |
| | | * Cookieä¸ä»¤çé® |
| | | */ |
| | | public final static String TOKEN_COOKIE_KEY = "token"; |
| | | |
| | | /** |
| | | * ææ¬ç¼ç æ¹å¼ |
| | | */ |
| | | public final static String TEXT_ENCODER = "UTF-8"; |
| | | |
| | | /** |
| | | * æ»è´¨æ£ |
| | | */ |
| | | public final static String CHECK_MAIN = "checkMain"; |
| | | |
| | | /** |
| | | * Object对象 |
| | | */ |
| | | public final static String OBJECT = "java.lang.Object"; |
| | | |
| | | /** |
| | | * Cookieä¸druidé® |
| | | */ |
| | | public final static String DRUID_COOKIE_KEY = "JSESSIONID"; |
| | | |
| | | public final static String YES = "YES"; |
| | | |
| | | public final static String NO = "NO"; |
| | | |
| | | /** |
| | | * 线路 |
| | | */ |
| | | public final static String ROUTE = "线路"; |
| | | |
| | | /** |
| | | * ç©¿è·¨è¶ |
| | | */ |
| | | public final static String CROSSING = "ç©¿è·¨è¶"; |
| | | |
| | | public final static String LINESTRING = "LINESTRING"; |
| | | |
| | | public final static String MULTILINESTRING = "MULTILINESTRING"; |
| | | |
| | | public final static String POLYGON = "POLYGON"; |
| | | |
| | | public final static String MULTIPOLYGON = "MULTIPOLYGON"; |
| | | |
| | | public static final String NO_FILE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NOT_FOUND, "æä»¶æ¾ä¸å°")); |
| | | |
| | | /** |
| | | * 16è¿å¶ |
| | | */ |
| | | public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
| | | |
| | | /** |
| | | * å¯ç æ£åè¡¨è¾¾å¼ |
| | | */ |
| | | public final static String PWD_REG = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$"; |
| | | |
| | | /** |
| | | * MPTæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> MPT_EXT = new ArrayList<>(Arrays.asList(".midx", ".strmi", ".ei.midx", ".ei.mpt", ".ei.strmi")); |
| | | |
| | | /** |
| | | * JPGæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> JPG_EXT = new ArrayList<>(Arrays.asList(".jgw", ".jpg.aux.xml", ".jpg.xml", ".prj")); |
| | | |
| | | /** |
| | | * IMGæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> IMG_EXT = new ArrayList<>(Arrays.asList(".rrd", ".img.aux.xml", ".hdr", ".img.enp", ".img.xml")); |
| | | |
| | | /** |
| | | * TIFæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> TIF_EXT = new ArrayList<>(Arrays.asList(".prj", ".tfw", ".tif.ovr", ".tif.aux.xml", ".tif.enp", ".tif.xml")); |
| | | |
| | | /** |
| | | * TIFFæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> TIFF_EXT = new ArrayList<>(Arrays.asList(".prj", ".tfw", ".tiff.ovr", ".tiff.aux.xml", ".tiff.enp", ".tiff.xml")); |
| | | |
| | | /** |
| | | * SHPæä»¶æ©å±å |
| | | */ |
| | | public final static List<String> SHP_EXT = new ArrayList<>(Arrays.asList(".shx", ".dbf", ".prj", ".cpg")); |
| | | |
| | | /** |
| | | * Mapperæé¤æ©å±å |
| | | */ |
| | | public final static List<String> MAPPER_EXCLUDE_EXT = new ArrayList<>(Arrays.asList(".img.aux.xml", ".img.xml", ".tif.aux.xml", ".tif.xml", ".tiff.aux.xml", ".tiff.xml", ".shp.xml")); |
| | | |
| | | /** |
| | | * æææä»¶æ©å±å |
| | | */ |
| | | public final static List<String> ALL_EXTENSION = new ArrayList<>(Arrays.asList(".txt", ".xml", ".pdf", ".xls", ".xlsx", ".doc", ".docx", ".ppt", ".pptx", ".shp", ".gdb", ".mdb", ".dwg", ".las", ".laz", ".cpt", ".mpt", ".ei.mpt", ".fly", ".efb", ".g3d", ".fbx", ".obj", ".3dm", ".3dml", ".osgb", ".rvt", ".ifc", ".jpg", ".png", ".img", ".tif", ".tiff", ".dem", ".bmp", ".gif", ".rmvb", ".rm", ".mp3", ".mp4", ".avi", ".wma", ".wmv", ".7z", ".rar", ".zip")); |
| | | |
| | | /** |
| | | * æå
¥æé¤å段 |
| | | */ |
| | | public final static List<String> INSERT_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("gid", "objectid", "updateuser", "updatetime", "shape_leng", "shape_area", "serialVersionUID", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * æ´æ°æé¤å段 |
| | | */ |
| | | public final static List<String> UPDATE_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("objectid", "createuser", "createtime", "shape_leng", "shape_area", "serialVersionUID", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * 读åæé¤å段 |
| | | */ |
| | | public final static List<String> READ_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("gid", "eventid", "parentid", "objectid", "dirid", "depid", "verid", "createtime", "createuser", "updateuser", "updatetime", "shape_leng", "shape_area", "serialversionuid", "dirname", "depname", "vername", "createname", "updatename")); |
| | | |
| | | /** |
| | | * MDBæé¤å段 |
| | | */ |
| | | public final static List<String> MDB_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("Shape", "SHAPE_LENG", "Shape_Length", "Shape_Area", "OBJECTID_1")); |
| | | |
| | | /** |
| | | * æ ç»Shpæé¤å段 |
| | | */ |
| | | public final static List<String> MARK_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("wkt", "geom", "objectid", "shape_leng", "shape_area", "serialVersionUID", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * GDBæé¤å段 |
| | | */ |
| | | public final static List<String> GDB_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("geom", "objectid", "shape_leng", "shape_area", "serialVersionUID", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * 管线åæè¡¨åéå |
| | | */ |
| | | public final static List<String> PIPE_ANALYSIS_TABS = new ArrayList<>(Arrays.asList("bd.dlg_25w_hydl", "bd.dlg_25w_lrdl", "bd.dlg_25w_lrrl", "bd.dlg_25w_hyda")); |
| | | |
| | | /** |
| | | * 管线æé¤å段 |
| | | */ |
| | | public final static List<String> PIPE_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("serialVersionUID", "tabs", "pwd", "gid", "wkt")); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * ç»è®¡å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class CountEntity { |
| | | private Integer no; |
| | | |
| | | private String m1; |
| | | |
| | | private String m2; |
| | | |
| | | private String m3; |
| | | |
| | | private Long count; |
| | | |
| | | private Double sizes; |
| | | |
| | | public CountEntity() { |
| | | } |
| | | |
| | | public Integer getNo() { |
| | | return no; |
| | | } |
| | | |
| | | public void setNo(Integer no) { |
| | | this.no = no; |
| | | } |
| | | |
| | | public String getM1() { |
| | | return m1; |
| | | } |
| | | |
| | | public void setM1(String m1) { |
| | | this.m1 = m1; |
| | | } |
| | | |
| | | public String getM2() { |
| | | return m2; |
| | | } |
| | | |
| | | public void setM2(String m2) { |
| | | this.m2 = m2; |
| | | } |
| | | |
| | | public String getM3() { |
| | | return m3; |
| | | } |
| | | |
| | | public void setM3(String m3) { |
| | | this.m3 = m3; |
| | | } |
| | | |
| | | public Long getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Long count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(Double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import com.moon.server.entity.all.AbstractPwdEntity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 请æ±ä¸è½½å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class DownloadReqEntity extends AbstractPwdEntity implements Serializable { |
| | | private static final long serialVersionUID = -8624235184539814997L; |
| | | |
| | | private String guid; |
| | | |
| | | private List<String> guids; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | private String wkt; |
| | | |
| | | private List<String> entities; |
| | | |
| | | private String tab; |
| | | |
| | | private List<String> tabs; |
| | | |
| | | private String descr; |
| | | |
| | | private String filter; |
| | | |
| | | private List<String> depcodes; |
| | | |
| | | private String depcode; |
| | | |
| | | private String dirs; |
| | | |
| | | public DownloadReqEntity() { |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public List<String> getGuids() { |
| | | return guids; |
| | | } |
| | | |
| | | public void setGuids(List<String> guids) { |
| | | this.guids = guids; |
| | | } |
| | | |
| | | public List<Integer> getIds() { |
| | | return ids; |
| | | } |
| | | |
| | | public void setIds(List<Integer> ids) { |
| | | this.ids = ids; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public List<String> getTabs() { |
| | | return tabs; |
| | | } |
| | | |
| | | public void setTabs(List<String> tabs) { |
| | | this.tabs = tabs; |
| | | } |
| | | |
| | | public List<String> getEntities() { |
| | | return entities; |
| | | } |
| | | |
| | | public void setEntities(List<String> entities) { |
| | | this.entities = entities; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getFilter() { |
| | | return filter; |
| | | } |
| | | |
| | | public void setFilter(String filter) { |
| | | this.filter = filter; |
| | | } |
| | | |
| | | public List<String> getDepcodes() { |
| | | return depcodes; |
| | | } |
| | | |
| | | public void setDepcodes(List<String> depcodes) { |
| | | this.depcodes = depcodes; |
| | | } |
| | | |
| | | public String getDirs() { |
| | | return dirs; |
| | | } |
| | | |
| | | public void setDirs(String dirs) { |
| | | this.dirs = dirs; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import com.moon.server.entity.all.AbstractPwdEntity; |
| | | import com.moon.server.entity.all.StaticData; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * ä¸è½½ç¦çå®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class DownloadTileEntity extends AbstractPwdEntity implements Serializable { |
| | | private static final long serialVersionUID = -229710198271495902L; |
| | | |
| | | private Double xmin; |
| | | |
| | | private Double ymin; |
| | | |
| | | private Double xmax; |
| | | |
| | | private Double ymax; |
| | | |
| | | private Integer pubid; |
| | | |
| | | private String title; |
| | | |
| | | public DownloadTileEntity() { |
| | | } |
| | | |
| | | /** |
| | | * éªè¯åæ |
| | | */ |
| | | public String verifyCoords() { |
| | | if (null == xmin || null == ymin || null == xmax || null == ymax) { |
| | | return "åè³åæ å¼ä¸è½ä¸ºç©º"; |
| | | } |
| | | if (xmin < StaticData.I180_NEG || xmin > StaticData.I180 || xmax < StaticData.I180_NEG || xmax > StaticData.I180) { |
| | | return "Xåæ å¼ä¸æ£ç¡®"; |
| | | } |
| | | if (ymin < StaticData.I90_NEG || ymin > StaticData.I90 || ymax < StaticData.I90_NEG || ymax > StaticData.I90) { |
| | | return "Yåæ å¼ä¸æ£ç¡®"; |
| | | } |
| | | |
| | | if (xmin > xmax) { |
| | | double x = xmax; |
| | | xmin = xmax; |
| | | xmax = x; |
| | | } |
| | | if (ymin > ymax) { |
| | | double y = ymax; |
| | | ymin = ymax; |
| | | ymax = y; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | public Double getXmin() { |
| | | return xmin; |
| | | } |
| | | |
| | | public void setXmin(Double xmin) { |
| | | this.xmin = xmin; |
| | | } |
| | | |
| | | public Double getYmin() { |
| | | return ymin; |
| | | } |
| | | |
| | | public void setYmin(Double ymin) { |
| | | this.ymin = ymin; |
| | | } |
| | | |
| | | public Double getXmax() { |
| | | return xmax; |
| | | } |
| | | |
| | | public void setXmax(Double xmax) { |
| | | this.xmax = xmax; |
| | | } |
| | | |
| | | public Double getYmax() { |
| | | return ymax; |
| | | } |
| | | |
| | | public void setYmax(Double ymax) { |
| | | this.ymax = ymax; |
| | | } |
| | | |
| | | public Integer getPubid() { |
| | | return pubid; |
| | | } |
| | | |
| | | public void setPubid(Integer pubid) { |
| | | this.pubid = pubid; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æä»¶ä¿¡æ¯ |
| | | * @author WWW |
| | | */ |
| | | public class FileInfoEntity implements Serializable { |
| | | private static final long serialVersionUID = -674723262772248619L; |
| | | |
| | | private String fileName; |
| | | |
| | | private Long size; |
| | | |
| | | private String md5; |
| | | |
| | | private String path; |
| | | |
| | | public FileInfoEntity() { |
| | | } |
| | | |
| | | public FileInfoEntity(String fileName) { |
| | | this.fileName = fileName; |
| | | } |
| | | |
| | | public String getFileName() { |
| | | return fileName; |
| | | } |
| | | |
| | | public void setFileName(String fileName) { |
| | | this.fileName = fileName; |
| | | } |
| | | |
| | | public Long getSize() { |
| | | return size; |
| | | } |
| | | |
| | | public void setSize(Long size) { |
| | | this.size = size; |
| | | } |
| | | |
| | | public String getMd5() { |
| | | return md5; |
| | | } |
| | | |
| | | public void setMd5(String md5) { |
| | | this.md5 = md5; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * FME请æ±å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class FmeReqEntity { |
| | | public FmeReqEntity() { |
| | | } |
| | | |
| | | /** |
| | | * ä»»å¡åç§° |
| | | */ |
| | | public String names; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | public String xmmc; |
| | | |
| | | /** |
| | | * æ°æ®ä¸ä¸ï¼æµéä¸ä¸ | åå¯ä¸ä¸ | å°ç¾ä¸ä¸ | æ´åºä¸ä¸ | 线路ä¸ä¸ |
| | | */ |
| | | public String sjzy; |
| | | |
| | | /** |
| | | * æ°æ®åç±»ï¼æ°ååææ | æ°æ®åºææ | åå¯ä¿¡æ¯è¡¨ | è¡¨æ ¼ææ |
| | | */ |
| | | public String sjfl; |
| | | |
| | | /** |
| | | * å¾
æ£å缩å
|
| | | */ |
| | | public String zipPath; |
| | | |
| | | /** |
| | | * WBSè¡¨æ ¼ |
| | | */ |
| | | public String wbsPath; |
| | | |
| | | /** |
| | | * æ¯/å¦ä¸ºå°ç¾æ°æ®ï¼YES | NO |
| | | */ |
| | | public String isDiZai; |
| | | |
| | | /** |
| | | * å°ç¾æ°æ®ç±»åï¼ï¼å´©å¡æ²»ç | ä¸ç¨³å®æå¡æ²»ç | å°é¢å¡é·æ²»ç | é«é¡è¾¹å¡æ²»ç | æ³¥ç³æµæ²»ç | æ°´æ¯æ²»ç | æ»å¡æ²»çï¼ | NO |
| | | */ |
| | | public String diZaiType; |
| | | |
| | | /** |
| | | * åæ ç³»ï¼EPSG:4326 |
| | | */ |
| | | public String coordinateSystem; |
| | | |
| | | /** |
| | | * å½±åå辨çï¼é»è®¤0.2mï¼ |
| | | */ |
| | | public double imgResolution = 0.2; |
| | | |
| | | /** |
| | | * é¢/线/ç¹éå 容差 |
| | | */ |
| | | public double tolerance = 0.001; |
| | | |
| | | /** |
| | | * é«ç¨ç¹é´è·ä¸é |
| | | */ |
| | | public double gcdOffset = 20; |
| | | |
| | | /** |
| | | * æ§å¶ç¹é´è·ä¸é |
| | | */ |
| | | public double kzdOffset = 100; |
| | | |
| | | /** |
| | | * æµåºèå´ï¼ç±³ï¼ |
| | | */ |
| | | public double rangeOffset = 200; |
| | | |
| | | /** |
| | | * æ¬æçº¿æå¤§è·ç¦» |
| | | */ |
| | | public double xgMax = 0.005; |
| | | |
| | | /** |
| | | * é«ç¨ä¸è¯¯å·®ï¼mï¼ |
| | | */ |
| | | public double demTolerance = 5; |
| | | |
| | | /** |
| | | * é«ç¨å¼çªåç(é»è®¤å¼200) |
| | | */ |
| | | public double demChangeRate = 200; |
| | | |
| | | /** |
| | | * ç¹äºå¯åº¦ï¼é»è®¤1/m3ï¼ |
| | | */ |
| | | public double lazDensity = 1; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * ID-åç§°å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class IdNameEntity implements Serializable { |
| | | private static final long serialVersionUID = -8485687857643406110L; |
| | | |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | public IdNameEntity() { |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * é®å¼å¯¹å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class KeyValueEntity { |
| | | private String key; |
| | | |
| | | private String value; |
| | | |
| | | public KeyValueEntity() { |
| | | } |
| | | |
| | | public KeyValueEntity(String key, String value) { |
| | | this.key = key; |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æ ç»JSONå®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class MarkJsonEntity implements Serializable { |
| | | private static final long serialVersionUID = 7776629022021914001L; |
| | | |
| | | private Integer id; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String fillColor; |
| | | |
| | | private Double opacity; |
| | | |
| | | private String bak; |
| | | |
| | | private String wkt; |
| | | |
| | | public MarkJsonEntity() { |
| | | } |
| | | |
| | | public MarkJsonEntity(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getFillColor() { |
| | | return fillColor; |
| | | } |
| | | |
| | | public void setFillColor(String fillColor) { |
| | | this.fillColor = fillColor; |
| | | } |
| | | |
| | | public Double getOpacity() { |
| | | return opacity; |
| | | } |
| | | |
| | | public void setOpacity(Double opacity) { |
| | | this.opacity = opacity; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * åç§°å¼å¯¹å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class NameValueEntity { |
| | | private String name; |
| | | |
| | | private Object value; |
| | | |
| | | public NameValueEntity() { |
| | | } |
| | | |
| | | public NameValueEntity(String name, Object value) { |
| | | this.name = name; |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Object getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(Object value) { |
| | | this.value = value; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åå¸å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class PubEntity { |
| | | public PubEntity() { |
| | | } |
| | | |
| | | private String type; |
| | | |
| | | private String token; |
| | | |
| | | private String name; |
| | | |
| | | private Integer userId; |
| | | |
| | | private Integer min; |
| | | |
| | | private Integer max; |
| | | |
| | | private Integer noData; |
| | | |
| | | private String dircode; |
| | | |
| | | private String depcode; |
| | | |
| | | private List<String> ids; |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getToken() { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) { |
| | | this.token = token; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getMin() { |
| | | return min; |
| | | } |
| | | |
| | | public void setMin(Integer min) { |
| | | this.min = min; |
| | | } |
| | | |
| | | public Integer getMax() { |
| | | return max; |
| | | } |
| | | |
| | | public void setMax(Integer max) { |
| | | this.max = max; |
| | | } |
| | | |
| | | public Integer getNoData() { |
| | | return noData; |
| | | } |
| | | |
| | | public void setNoData(Integer noData) { |
| | | this.noData = noData; |
| | | } |
| | | |
| | | public String getDircode() { |
| | | return dircode; |
| | | } |
| | | |
| | | public void setDircode(String dircode) { |
| | | this.dircode = dircode; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | |
| | | public List<String> getIds() { |
| | | return ids; |
| | | } |
| | | |
| | | public void setIds(List<String> ids) { |
| | | this.ids = ids; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import com.moon.server.helper.StringHelper; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 注åç±» |
| | | * @author WWW |
| | | */ |
| | | public class RegisterEntity { |
| | | public RegisterEntity() { |
| | | } |
| | | |
| | | public RegisterEntity(String name, String uri, String type) { |
| | | tags = new ArrayList<>(); |
| | | tags.add(type); |
| | | |
| | | this.name = name; |
| | | this.address = uri; |
| | | this.detailUrl = uri; |
| | | this.type = type; |
| | | this.description = name; |
| | | this.isrequest = true; |
| | | this.hashid = StringHelper.getGuid(); |
| | | this.ispublic = false; |
| | | } |
| | | |
| | | public RegisterEntity(Integer pubid) { |
| | | this.reason = "注å"; |
| | | this.serialnum = pubid.toString(); |
| | | } |
| | | |
| | | private List<String> tags; |
| | | |
| | | private String name; |
| | | |
| | | private String address; |
| | | |
| | | private String detailUrl; |
| | | |
| | | private String type; |
| | | |
| | | private String description; |
| | | |
| | | private Boolean isrequest; |
| | | |
| | | private String hashid; |
| | | |
| | | private String reason; |
| | | |
| | | private String serialnum; |
| | | |
| | | private Boolean ispublic; |
| | | |
| | | public List<String> getTags() { |
| | | return tags; |
| | | } |
| | | |
| | | public void setTags(List<String> tags) { |
| | | this.tags = tags; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getDetailUrl() { |
| | | return detailUrl; |
| | | } |
| | | |
| | | public void setDetailUrl(String detailUrl) { |
| | | this.detailUrl = detailUrl; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public Boolean getIsrequest() { |
| | | return isrequest; |
| | | } |
| | | |
| | | public void setIsrequest(Boolean isrequest) { |
| | | this.isrequest = isrequest; |
| | | } |
| | | |
| | | public String getHashid() { |
| | | return hashid; |
| | | } |
| | | |
| | | public void setHashid(String hashid) { |
| | | this.hashid = hashid; |
| | | } |
| | | |
| | | public String getReason() { |
| | | return reason; |
| | | } |
| | | |
| | | public void setReason(String reason) { |
| | | this.reason = reason; |
| | | } |
| | | |
| | | public String getSerialnum() { |
| | | return serialnum; |
| | | } |
| | | |
| | | public void setSerialnum(String serialnum) { |
| | | this.serialnum = serialnum; |
| | | } |
| | | |
| | | public Boolean getIspublic() { |
| | | return ispublic; |
| | | } |
| | | |
| | | public void setIspublic(Boolean ispublic) { |
| | | this.ispublic = ispublic; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.moon.server.entity.all.StaticData; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * SDKè§£å¯æ°æ®ç±» |
| | | * @author WWW |
| | | */ |
| | | public class SdkDecryptDataEntity implements Serializable { |
| | | private static final long serialVersionUID = 4119527512820258035L; |
| | | |
| | | private static List<Integer> registeredModules = new ArrayList<>(); |
| | | |
| | | static { |
| | | for (int i = 1; i <= StaticData.ONE_HUNDRED; i++) { |
| | | registeredModules.add(i); |
| | | } |
| | | } |
| | | |
| | | public SdkDecryptDataEntity() { |
| | | machineId = "e7dd8a96913fb5fe62df6b5a7fd503f4"; |
| | | // registeredModules = new int[] { 1, 3, 9, 12, 13, 17, 25, 30, 33, 37 } |
| | | message = "OK"; |
| | | success = true; |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(2050, 12, 31); |
| | | expireDate = calendar.getTime(); |
| | | } |
| | | |
| | | private String machineId; |
| | | |
| | | private String message; |
| | | |
| | | private boolean success; |
| | | |
| | | @JSONField(format = "yyyy-MM-dd HH:mm:ss") |
| | | private Date expireDate; |
| | | |
| | | public String getMachineId() { |
| | | return machineId; |
| | | } |
| | | |
| | | public void setMachineId(String machineId) { |
| | | this.machineId = machineId; |
| | | } |
| | | |
| | | public List<Integer> getRegisteredModules() { |
| | | return registeredModules; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public boolean isSuccess() { |
| | | return success; |
| | | } |
| | | |
| | | public void setSuccess(boolean success) { |
| | | this.success = success; |
| | | } |
| | | |
| | | public Date getExpireDate() { |
| | | return expireDate; |
| | | } |
| | | |
| | | public void setExpireDate(Date expireDate) { |
| | | this.expireDate = expireDate; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * SDKè§£å¯ç±» |
| | | * @author WWW |
| | | */ |
| | | public class SdkDecryptEntity implements Serializable { |
| | | private static final long serialVersionUID = 853291437502721609L; |
| | | |
| | | private int code; |
| | | |
| | | private String msg; |
| | | |
| | | private SdkDecryptDataEntity data; |
| | | |
| | | public SdkDecryptEntity() { |
| | | code = 200; |
| | | msg = null; |
| | | data = new SdkDecryptDataEntity(); |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public SdkDecryptDataEntity getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(SdkDecryptDataEntity data) { |
| | | this.data = data; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * SDKå å¯ç±» |
| | | * @author WWW |
| | | */ |
| | | public class SdkSecretEntity { |
| | | private int code; |
| | | |
| | | private String msg; |
| | | |
| | | private String data; |
| | | |
| | | public SdkSecretEntity() { |
| | | code = 200; |
| | | msg = null; |
| | | data = "1052f106aed368e0c29b4eec89e03a91e352059a24624d0b4fab38e57943a47a0c81e9c843d9e3b11eaed1e7853b09ad7c603d4f854f0351fa9397fe4a06e0c161ca142d0665289510535743fd11e3c47e5648a031d1240536de3640ef94808fec77d15bfea9e6f3faca2f19d15f89b1fcfe23fa7b2b4f433ba22a7484992f63766cb68a81120288e1638a16b126139833b6f1c35876932a4d730ef68fbfecc4"; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public String getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(String data) { |
| | | this.data = data; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Shpè®°å½ |
| | | * @author WWW |
| | | */ |
| | | public class ShpRecordEntity implements Serializable { |
| | | private static final long serialVersionUID = -1366388818651675941L; |
| | | |
| | | private String wkt; |
| | | |
| | | private String csid; |
| | | |
| | | public ShpRecordEntity() { |
| | | |
| | | } |
| | | |
| | | public ShpRecordEntity(String wkt, String csid) { |
| | | this.wkt = wkt; |
| | | this.csid = csid; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | |
| | | public String getCsid() { |
| | | return csid; |
| | | } |
| | | |
| | | public void setCsid(String csid) { |
| | | this.csid = csid; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 表å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class TabEntity implements Serializable { |
| | | private static final long serialVersionUID = 2786394526795387464L; |
| | | |
| | | private String ns; |
| | | |
| | | private String tab; |
| | | |
| | | private String entity; |
| | | |
| | | private String tabDesc; |
| | | |
| | | private String tableType; |
| | | |
| | | private Integer rows; |
| | | |
| | | private String bak; |
| | | |
| | | public TabEntity() { |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getEntity() { |
| | | return entity; |
| | | } |
| | | |
| | | public void setEntity(String entity) { |
| | | this.entity = entity; |
| | | } |
| | | |
| | | public String getTabDesc() { |
| | | return tabDesc; |
| | | } |
| | | |
| | | public void setTabDesc(String tabDesc) { |
| | | this.tabDesc = tabDesc; |
| | | } |
| | | |
| | | public String getTableType() { |
| | | return tableType; |
| | | } |
| | | |
| | | public void setTableType(String tableType) { |
| | | this.tableType = tableType; |
| | | } |
| | | |
| | | public Integer getRows() { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(Integer rows) { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * 表æ å°å®ä½ç±» |
| | | * @author WWW |
| | | */ |
| | | public class TabMapperEntity { |
| | | public TabMapperEntity() { |
| | | } |
| | | |
| | | public TabMapperEntity(String fileName, String type, String tab, String subPath) { |
| | | this.fileName = fileName; |
| | | this.type = type; |
| | | this.tab = tab; |
| | | this.subPath = subPath; |
| | | } |
| | | |
| | | private String eventid; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private int verid; |
| | | |
| | | private String fileName; |
| | | |
| | | private String extName; |
| | | |
| | | private String type; |
| | | |
| | | private String subPath; |
| | | |
| | | private String tab; |
| | | |
| | | private String entity; |
| | | |
| | | private Integer rows; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·æ´æ°ç±» |
| | | * @author WWW |
| | | */ |
| | | public class UserUpdateEntity implements Serializable { |
| | | private static final long serialVersionUID = 8390219588267518254L; |
| | | |
| | | private String adminPwd; |
| | | |
| | | private String newPwd; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | public UserUpdateEntity() { |
| | | |
| | | } |
| | | |
| | | public String getAdminPwd() { |
| | | return adminPwd; |
| | | } |
| | | |
| | | public void setAdminPwd(String adminPwd) { |
| | | this.adminPwd = adminPwd; |
| | | } |
| | | |
| | | public String getNewPwd() { |
| | | return newPwd; |
| | | } |
| | | |
| | | public void setNewPwd(String newPwd) { |
| | | this.newPwd = newPwd; |
| | | } |
| | | |
| | | public List<Integer> getIds() { |
| | | return ids; |
| | | } |
| | | |
| | | public void setIds(List<Integer> ids) { |
| | | this.ids = ids; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * åæ ç³» |
| | | * @author WWW |
| | | */ |
| | | public class CoordEntity implements Serializable { |
| | | private static final long serialVersionUID = 5660360983928368364L; |
| | | |
| | | private Integer id; |
| | | |
| | | private String epsgcode; |
| | | |
| | | private String coordinate; |
| | | |
| | | private String zoning; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getEpsgcode() { |
| | | return epsgcode; |
| | | } |
| | | |
| | | public void setEpsgcode(String epsgcode) { |
| | | this.epsgcode = epsgcode; |
| | | } |
| | | |
| | | public String getCoordinate() { |
| | | return coordinate; |
| | | } |
| | | |
| | | public void setCoordinate(String coordinate) { |
| | | this.coordinate = coordinate; |
| | | } |
| | | |
| | | public String getZoning() { |
| | | return zoning; |
| | | } |
| | | |
| | | public void setZoning(String zoning) { |
| | | this.zoning = zoning; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * åå
¸ç®¡ç |
| | | * @author WWW |
| | | */ |
| | | public class DictEntity implements Serializable { |
| | | private static final long serialVersionUID = -343890141066128689L; |
| | | |
| | | private int id; |
| | | |
| | | private String ns; |
| | | |
| | | private String tab; |
| | | |
| | | private String tabDesc; |
| | | |
| | | private String field; |
| | | |
| | | private String alias; |
| | | |
| | | private String type; |
| | | |
| | | private int len; |
| | | |
| | | private int precision; |
| | | |
| | | private int orderNum; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String tabletype; |
| | | |
| | | private String unit; |
| | | |
| | | private String domainNa; |
| | | |
| | | private int showtype; |
| | | |
| | | private int editable; |
| | | |
| | | private String bak; |
| | | |
| | | private String createName; |
| | | |
| | | private String updateName; |
| | | |
| | | public DictEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getTabDesc() { |
| | | return tabDesc; |
| | | } |
| | | |
| | | public void setTabDesc(String tabDesc) { |
| | | this.tabDesc = tabDesc; |
| | | } |
| | | |
| | | public String getField() { |
| | | return field; |
| | | } |
| | | |
| | | public void setField(String field) { |
| | | this.field = field; |
| | | } |
| | | |
| | | public String getAlias() { |
| | | return alias; |
| | | } |
| | | |
| | | public void setAlias(String alias) { |
| | | this.alias = alias; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getLen() { |
| | | return len; |
| | | } |
| | | |
| | | public void setLen(int len) { |
| | | this.len = len; |
| | | } |
| | | |
| | | public int getPrecision() { |
| | | return precision; |
| | | } |
| | | |
| | | public void setPrecision(int precision) { |
| | | this.precision = precision; |
| | | } |
| | | |
| | | public int getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(int orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | 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 getTabletype() { |
| | | return tabletype; |
| | | } |
| | | |
| | | public void setTabletype(String tabletype) { |
| | | this.tabletype = tabletype; |
| | | } |
| | | |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public String getDomainNa() { |
| | | return domainNa; |
| | | } |
| | | |
| | | public void setDomainNa(String domainNa) { |
| | | this.domainNa = domainNa; |
| | | } |
| | | |
| | | public int getShowtype() { |
| | | return showtype; |
| | | } |
| | | |
| | | public void setShowtype(int showtype) { |
| | | this.showtype = showtype; |
| | | } |
| | | |
| | | public int getEditable() { |
| | | return editable; |
| | | } |
| | | |
| | | public void setEditable(int editable) { |
| | | this.editable = editable; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * ç®å½ |
| | | * @author WWW |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class DirEntity implements Serializable { |
| | | private static final long serialVersionUID = -2184993363389504088L; |
| | | |
| | | private int id; |
| | | |
| | | private int pid; |
| | | |
| | | private String name; |
| | | |
| | | private String exts; |
| | | |
| | | private String descr; |
| | | |
| | | private int level; |
| | | |
| | | private int orderNum; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String checks; |
| | | |
| | | private String bak; |
| | | |
| | | private String code; |
| | | |
| | | private String fullName; |
| | | |
| | | public DirEntity() { |
| | | } |
| | | |
| | | 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 getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getExts() { |
| | | return exts; |
| | | } |
| | | |
| | | public void setExts(String exts) { |
| | | this.exts = exts; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | 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 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 getChecks() { |
| | | return checks; |
| | | } |
| | | |
| | | public void setChecks(String checks) { |
| | | this.checks = checks; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getFullName() { |
| | | return fullName; |
| | | } |
| | | |
| | | public void setFullName(String fullName) { |
| | | this.fullName = fullName; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * å¼å |
| | | * @author WWW |
| | | */ |
| | | public class DomainEntity implements Serializable { |
| | | private static final long serialVersionUID = -334732819504445760L; |
| | | |
| | | private int id; |
| | | |
| | | private String domDesc; |
| | | |
| | | private String domName; |
| | | |
| | | private String domCode; |
| | | |
| | | private String codeDesc; |
| | | |
| | | private int level; |
| | | |
| | | private int orderid; |
| | | |
| | | private String bsm; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | public DomainEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getDomDesc() { |
| | | return domDesc; |
| | | } |
| | | |
| | | public void setDomDesc(String domDesc) { |
| | | this.domDesc = domDesc; |
| | | } |
| | | |
| | | public String getDomName() { |
| | | return domName; |
| | | } |
| | | |
| | | public void setDomName(String domName) { |
| | | this.domName = domName; |
| | | } |
| | | |
| | | public String getDomCode() { |
| | | return domCode; |
| | | } |
| | | |
| | | public void setDomCode(String domCode) { |
| | | this.domCode = domCode; |
| | | } |
| | | |
| | | public String getCodeDesc() { |
| | | return codeDesc; |
| | | } |
| | | |
| | | public void setCodeDesc(String codeDesc) { |
| | | this.codeDesc = codeDesc; |
| | | } |
| | | |
| | | public int getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(int level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public int getOrderid() { |
| | | return orderid; |
| | | } |
| | | |
| | | public void setOrderid(int orderid) { |
| | | this.orderid = orderid; |
| | | } |
| | | |
| | | public String getBsm() { |
| | | return bsm; |
| | | } |
| | | |
| | | public void setBsm(String bsm) { |
| | | this.bsm = bsm; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * ä¸è½½è®°å½ |
| | | * @author WWW |
| | | */ |
| | | public class DownloadEntity implements Serializable { |
| | | private static final long serialVersionUID = -767416271272774912L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private int type; |
| | | |
| | | private double sizes; |
| | | |
| | | private int depid; |
| | | |
| | | private int dcount; |
| | | |
| | | private String pwd; |
| | | |
| | | private String url; |
| | | |
| | | private String descr; |
| | | |
| | | private String guid; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int downloadUser; |
| | | |
| | | private Timestamp downloadTime; |
| | | |
| | | private String geom; |
| | | |
| | | private String bak; |
| | | |
| | | private String createName; |
| | | |
| | | public DownloadEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public int getDcount() { |
| | | return dcount; |
| | | } |
| | | |
| | | public void setDcount(int dcount) { |
| | | this.dcount = dcount; |
| | | } |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | 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 getDownloadUser() { |
| | | return downloadUser; |
| | | } |
| | | |
| | | public void setDownloadUser(int downloadUser) { |
| | | this.downloadUser = downloadUser; |
| | | } |
| | | |
| | | public Timestamp getDownloadTime() { |
| | | return downloadTime; |
| | | } |
| | | |
| | | public void setDownloadTime(Timestamp downloadTime) { |
| | | this.downloadTime = downloadTime; |
| | | } |
| | | |
| | | public String getGeom() { |
| | | return geom; |
| | | } |
| | | |
| | | public void setGeom(String geo) { |
| | | this.geom = geo; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getCreateName() { |
| | | return createName; |
| | | } |
| | | |
| | | public void setCreateName(String createName) { |
| | | this.createName = createName; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * FMEæ¥å¿è¡¨ |
| | | * @author WWW |
| | | */ |
| | | public class FmeLogEntity implements Serializable { |
| | | private static final long serialVersionUID = -1304153743551710249L; |
| | | |
| | | public FmeLogEntity() { |
| | | } |
| | | |
| | | private Integer id; |
| | | |
| | | private String parentid; |
| | | |
| | | private String dirpath; |
| | | |
| | | private String pgNs; |
| | | |
| | | private String tcmc; |
| | | |
| | | private String tcdm; |
| | | |
| | | private Integer count; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getParentid() { |
| | | return parentid; |
| | | } |
| | | |
| | | public void setParentid(String parentid) { |
| | | this.parentid = parentid; |
| | | } |
| | | |
| | | public String getDirpath() { |
| | | return dirpath; |
| | | } |
| | | |
| | | public void setDirpath(String dirpath) { |
| | | this.dirpath = dirpath; |
| | | } |
| | | |
| | | public String getPgNs() { |
| | | return pgNs; |
| | | } |
| | | |
| | | public void setPgNs(String pgNs) { |
| | | this.pgNs = pgNs; |
| | | } |
| | | |
| | | public String getTcmc() { |
| | | return tcmc; |
| | | } |
| | | |
| | | public void setTcmc(String tcmc) { |
| | | this.tcmc = tcmc; |
| | | } |
| | | |
| | | public String getTcdm() { |
| | | return tcdm; |
| | | } |
| | | |
| | | public void setTcdm(String tcdm) { |
| | | this.tcdm = tcdm; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Timestamp getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Timestamp createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Timestamp getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Timestamp updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * å¾å± |
| | | * @author WWW |
| | | */ |
| | | public class LayerEntity implements Serializable { |
| | | private static final long serialVersionUID = -159911666139919168L; |
| | | |
| | | private int id; |
| | | |
| | | private int pid; |
| | | |
| | | private String cnName; |
| | | |
| | | private String enName; |
| | | |
| | | private String url; |
| | | |
| | | private String testUrl; |
| | | |
| | | private int type; |
| | | |
| | | private String icon; |
| | | |
| | | private int level; |
| | | |
| | | private int orderNum; |
| | | |
| | | private int isShow; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | private String serveType; |
| | | |
| | | private String dataType; |
| | | |
| | | private double elev; |
| | | |
| | | private String ns; |
| | | |
| | | private Integer pubid; |
| | | |
| | | private Integer isProject; |
| | | |
| | | 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 String getTestUrl() { |
| | | return testUrl; |
| | | } |
| | | |
| | | public void setTestUrl(String testUrl) { |
| | | this.testUrl = testUrl; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | 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 getIsShow() { |
| | | return isShow; |
| | | } |
| | | |
| | | public void setIsShow(int isShow) { |
| | | this.isShow = isShow; |
| | | } |
| | | |
| | | 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 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; |
| | | } |
| | | |
| | | public void setElev(double elev) { |
| | | this.elev = elev; |
| | | } |
| | | |
| | | public String getNs() { |
| | | return ns; |
| | | } |
| | | |
| | | public void setNs(String ns) { |
| | | this.ns = ns; |
| | | } |
| | | |
| | | public Integer getPubid() { |
| | | return pubid; |
| | | } |
| | | |
| | | public void setPubid(Integer pubid) { |
| | | this.pubid = pubid; |
| | | } |
| | | |
| | | public Integer getIsProject() { |
| | | return isProject; |
| | | } |
| | | |
| | | public void setIsProject(Integer isProject) { |
| | | this.isProject = isProject; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * å
æ°æ® |
| | | * @author WWW |
| | | */ |
| | | public class MetaEntity implements Serializable { |
| | | private static final long serialVersionUID = -984838663593325184L; |
| | | |
| | | private int id; |
| | | |
| | | private String eventid; |
| | | |
| | | private int metaid; |
| | | |
| | | private short ismeta; |
| | | |
| | | private String dircode; |
| | | |
| | | private String depcode; |
| | | |
| | | private int verid; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String guid; |
| | | |
| | | private String path; |
| | | |
| | | private double sizes; |
| | | |
| | | private String tab; |
| | | |
| | | private String layer; |
| | | |
| | | private int rows; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | private String geom; |
| | | |
| | | private String uname; |
| | | |
| | | private String depName; |
| | | |
| | | private String verName; |
| | | |
| | | private String dirName; |
| | | |
| | | private Integer downCount; |
| | | |
| | | private String lastUser; |
| | | |
| | | private Timestamp lastTime; |
| | | |
| | | private String url; |
| | | |
| | | public MetaEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public int getMetaid() { |
| | | return metaid; |
| | | } |
| | | |
| | | public void setMetaid(int metaid) { |
| | | this.metaid = metaid; |
| | | } |
| | | |
| | | public short getIsmeta() { |
| | | return ismeta; |
| | | } |
| | | |
| | | public void setIsmeta(short ismeta) { |
| | | this.ismeta = ismeta; |
| | | } |
| | | |
| | | public String getDircode() { |
| | | return dircode; |
| | | } |
| | | |
| | | public void setDircode(String dircode) { |
| | | this.dircode = dircode; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | |
| | | public int getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setVerid(int verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getLayer() { |
| | | return layer; |
| | | } |
| | | |
| | | public void setLayer(String layer) { |
| | | this.layer = layer; |
| | | } |
| | | |
| | | public int getRows() { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(int rows) { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | 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 String getGeom() { |
| | | return geom; |
| | | } |
| | | |
| | | public void setGeom(String geom) { |
| | | this.geom = geom; |
| | | } |
| | | |
| | | public String getUname() { |
| | | return uname; |
| | | } |
| | | |
| | | public void setUname(String uname) { |
| | | this.uname = uname; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getVerName() { |
| | | return verName; |
| | | } |
| | | |
| | | public void setVerName(String verName) { |
| | | this.verName = verName; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | } |
| | | |
| | | public Integer getDownCount() { |
| | | return downCount; |
| | | } |
| | | |
| | | public void setDownCount(Integer downCount) { |
| | | this.downCount = downCount; |
| | | } |
| | | |
| | | public String getLastUser() { |
| | | return lastUser; |
| | | } |
| | | |
| | | public void setLastUser(String lastUser) { |
| | | this.lastUser = lastUser; |
| | | } |
| | | |
| | | public Timestamp getLastTime() { |
| | | return lastTime; |
| | | } |
| | | |
| | | public void setLastTime(Timestamp lastTime) { |
| | | this.lastTime = lastTime; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * å
æ°æ®æä»¶ |
| | | * @author WWW |
| | | */ |
| | | public class MetaFileEntity implements Serializable { |
| | | private static final long serialVersionUID = -3688958480700165163L; |
| | | |
| | | private String eventid; |
| | | |
| | | private String dircode; |
| | | |
| | | private String depcode; |
| | | |
| | | private int verid; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String guid; |
| | | |
| | | private String path; |
| | | |
| | | private double sizes; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private String extName; |
| | | |
| | | private String epsgCode; |
| | | |
| | | private String tab; |
| | | |
| | | private String entity; |
| | | |
| | | private int rows; |
| | | |
| | | private String msg; |
| | | |
| | | private Boolean isMeta; |
| | | |
| | | private String xlsPath; |
| | | |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public String getDircode() { |
| | | return dircode; |
| | | } |
| | | |
| | | public void setDircode(String dircode) { |
| | | this.dircode = dircode; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | |
| | | public int getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setVerid(int verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | 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 String getExtName() { |
| | | return extName; |
| | | } |
| | | |
| | | public void setExtName(String extName) { |
| | | this.extName = extName; |
| | | } |
| | | |
| | | public String getEpsgCode() { |
| | | return epsgCode; |
| | | } |
| | | |
| | | public void setEpsgCode(String epsgCode) { |
| | | this.epsgCode = epsgCode; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getEntity() { |
| | | return entity; |
| | | } |
| | | |
| | | public void setEntity(String entity) { |
| | | this.entity = entity; |
| | | } |
| | | |
| | | public int getRows() { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(int rows) { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public Boolean getIsMeta() { |
| | | return isMeta; |
| | | } |
| | | |
| | | public void setIsMeta(Boolean isMeta) { |
| | | this.isMeta = isMeta; |
| | | } |
| | | |
| | | public String getXlsPath() { |
| | | return xlsPath; |
| | | } |
| | | |
| | | public void setXlsPath(String xlsPath) { |
| | | this.xlsPath = xlsPath; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * æ°æ®åå¸ |
| | | * @author WWW |
| | | */ |
| | | public class PublishEntity implements Serializable { |
| | | private static final long serialVersionUID = -386130556178340032L; |
| | | |
| | | private int id; |
| | | |
| | | private String regid; |
| | | |
| | | private String name; |
| | | |
| | | private String url; |
| | | |
| | | private String path; |
| | | |
| | | private String type; |
| | | |
| | | private int status; |
| | | |
| | | private String dirid; |
| | | |
| | | private String depid; |
| | | |
| | | private int min; |
| | | |
| | | private int max; |
| | | |
| | | private String json; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String geom; |
| | | |
| | | private String bak; |
| | | |
| | | private String depName; |
| | | |
| | | private String dirName; |
| | | |
| | | private String createName; |
| | | |
| | | private String updateName; |
| | | |
| | | public PublishEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getRegid() { |
| | | return regid; |
| | | } |
| | | |
| | | public void setRegid(String regid) { |
| | | this.regid = regid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(String dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public String getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(String depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public int getMin() { |
| | | return min; |
| | | } |
| | | |
| | | public void setMin(int min) { |
| | | this.min = min; |
| | | } |
| | | |
| | | public int getMax() { |
| | | return max; |
| | | } |
| | | |
| | | public void setMax(int max) { |
| | | this.max = max; |
| | | } |
| | | |
| | | public String getJson() { |
| | | return json; |
| | | } |
| | | |
| | | public void setJson(String json) { |
| | | this.json = json; |
| | | } |
| | | |
| | | 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 getGeom() { |
| | | return geom; |
| | | } |
| | | |
| | | public void setGeom(String geom) { |
| | | this.geom = geom; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * æ ·å¼ç®¡ç |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | |
| | | public class StyleEntity implements Serializable { |
| | | private static final long serialVersionUID = 2421229801055033955L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private int dirid; |
| | | |
| | | private int depid; |
| | | |
| | | private String ver; |
| | | |
| | | private int status; |
| | | |
| | | private String precision; |
| | | |
| | | private String descr; |
| | | |
| | | private String fname; |
| | | |
| | | private String fileGuid; |
| | | |
| | | private String vname; |
| | | |
| | | private String viewGuid; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String depName; |
| | | |
| | | private String dirName; |
| | | |
| | | private String bak; |
| | | |
| | | private String createName; |
| | | |
| | | private String updateName; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public int getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(int dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public int getDepid() { |
| | | return depid; |
| | | } |
| | | |
| | | public void setDepid(int depid) { |
| | | this.depid = depid; |
| | | } |
| | | |
| | | public String getVer() { |
| | | return ver; |
| | | } |
| | | |
| | | public void setVer(String ver) { |
| | | this.ver = ver; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getPrecision() { |
| | | return precision; |
| | | } |
| | | |
| | | public void setPrecision(String precision) { |
| | | this.precision = precision; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getFileGuid() { |
| | | return fileGuid; |
| | | } |
| | | |
| | | public void setFileGuid(String fileGuid) { |
| | | this.fileGuid = fileGuid; |
| | | } |
| | | |
| | | public String getViewGuid() { |
| | | return viewGuid; |
| | | } |
| | | |
| | | public void setViewGuid(String viewGuid) { |
| | | this.viewGuid = viewGuid; |
| | | } |
| | | |
| | | 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 getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | } |
| | | |
| | | public String getBak() { |
| | | return bak; |
| | | } |
| | | |
| | | public void setBak(String bak) { |
| | | this.bak = bak; |
| | | } |
| | | |
| | | public String getFname() { |
| | | return fname; |
| | | } |
| | | |
| | | public void setFname(String fname) { |
| | | this.fname = fname; |
| | | } |
| | | |
| | | public String getVname() { |
| | | return vname; |
| | | } |
| | | |
| | | public void setVname(String vname) { |
| | | this.vname = vname; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * çæ¬è¡¨ |
| | | * @author sws |
| | | * @date 2022-09-29 |
| | | */ |
| | | public class VerEntity implements Serializable { |
| | | private static final long serialVersionUID = 4765222572551658531L; |
| | | |
| | | private int id; |
| | | |
| | | private int dirid; |
| | | |
| | | private String name; |
| | | |
| | | private String descr; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String depName; |
| | | |
| | | private String createName; |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getDirid() { |
| | | return dirid; |
| | | } |
| | | |
| | | public void setDirid(int dirid) { |
| | | this.dirid = dirid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | 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 getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getCreateName() { |
| | | return createName; |
| | | } |
| | | |
| | | public void setCreateName(String createName) { |
| | | this.createName = createName; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.other; |
| | | |
| | | import org.apache.commons.codec.binary.Hex; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.SecretKey; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.ObjectInputStream; |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * CheckOutLicense |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("AlibabaUndefineMagicConstant") |
| | | public class CheckOutLicense { |
| | | public static String createFloatingLicense(int n, String s, long expireDate) { |
| | | int[] registeredModules = new int[]{1, 3, 4, 9, 10, 11, 12, 13, 17, 25, 30, 33, 37}; |
| | | |
| | | long n2; |
| | | if ((n2 = System.currentTimeMillis() + 86400000L) > expireDate) { |
| | | n2 = expireDate; |
| | | } |
| | | |
| | | CheckOutLicense e = new CheckOutLicense(); |
| | | e.a(n2); |
| | | e.a(n); |
| | | e.cc(s); |
| | | e.a(registeredModules); |
| | | |
| | | return e.aaa(e); |
| | | } |
| | | |
| | | public String aaa(final CheckOutLicense b) { |
| | | final CheckOutLicense e = b; |
| | | return new String(a(e.a, e.b, e.c)) + new bb().a(new StringBuilder().append(e.ee()).toString()); |
| | | } |
| | | |
| | | private char[] a(final long n, final int[] array, final int i) { |
| | | final char[] array2 = new char[48]; |
| | | final String b = b(n); |
| | | final String value = String.valueOf(i); |
| | | |
| | | final bb b2 = new bb(); |
| | | final String a = b2.a(b); |
| | | final String a2 = b2.a(value); |
| | | |
| | | final cc c = new cc(); |
| | | for (int j = 0; j < array.length; ++j) { |
| | | c.b(array[j]); |
| | | } |
| | | |
| | | final char[] a3 = c.a(); |
| | | for (int k = 0; k < 16; ++k) { |
| | | array2[k * 3] = a3[k]; |
| | | array2[k * 3 + 1] = a.charAt(k); |
| | | array2[k * 3 + 2] = a2.charAt(k); |
| | | } |
| | | return array2; |
| | | } |
| | | |
| | | private static String b(final long timeInMillis) { |
| | | final Calendar instance; |
| | | (instance = Calendar.getInstance()).setTimeInMillis(timeInMillis); |
| | | final int value = instance.get(1); |
| | | final int value2 = instance.get(2); |
| | | final int value3 = instance.get(5); |
| | | final String substring = Integer.toString(value).substring(2, 4); |
| | | String s; |
| | | if ((s = Integer.toString(value2 + 1)).length() == 1) { |
| | | s = "0".concat(String.valueOf(s)); |
| | | } |
| | | String s2; |
| | | if ((s2 = Integer.toString(value3)).length() == 1) { |
| | | s2 = "0".concat(String.valueOf(s2)); |
| | | } |
| | | return String.valueOf(substring) + s + s2; |
| | | } |
| | | |
| | | public static CheckOutLicense a(String s) { |
| | | try { |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public final String ee() { |
| | | return this.aa; |
| | | } |
| | | |
| | | private String aa; |
| | | private long a; |
| | | private int c; |
| | | private int[] b; |
| | | |
| | | public final void a(final long a) { |
| | | this.a = a; |
| | | } |
| | | |
| | | public final void a(final int c) { |
| | | this.c = c; |
| | | } |
| | | |
| | | public final void a(final int[] b) { |
| | | this.b = b; |
| | | } |
| | | |
| | | public final long a() { |
| | | return this.a; |
| | | } |
| | | |
| | | public final int[] b() { |
| | | return this.b; |
| | | } |
| | | |
| | | public final int c() { |
| | | return this.c; |
| | | } |
| | | |
| | | private void cc(String aa) { |
| | | this.aa = aa; |
| | | } |
| | | |
| | | @SuppressWarnings("AlibabaClassNamingShouldBeCamel") |
| | | public class bb { |
| | | private SecretKey a; |
| | | |
| | | public bb() { |
| | | try { |
| | | this.a = (SecretKey) new ObjectInputStream(new ByteArrayInputStream(Hex.decodeHex("aced0005737200146a6176612e73656375726974792e4b6579526570bdf94fb3889aa5430200044c0009616c676f726974686d7400124c6a6176612f6c616e672f537472696e673b5b0007656e636f6465647400025b424c0006666f726d617471007e00014c00047479706574001b4c6a6176612f73656375726974792f4b657952657024547970653b7870740003444553757200025b42acf317f8060854e00200007870000000084f5b0e52b33dbf797400035241577e7200196a6176612e73656375726974792e4b6579526570245479706500000000000000001200007872000e6a6176612e6c616e672e456e756d00000000000000001200007870740006534543524554".toCharArray()))).readObject(); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public String a(final String s) { |
| | | try { |
| | | final Cipher instance; |
| | | (instance = Cipher.getInstance("DES/ECB/PKCS5Padding")).init(1, this.a); |
| | | return Hex.encodeHexString(instance.doFinal(s.getBytes())); |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public String b(final String s) { |
| | | try { |
| | | final Cipher instance; |
| | | (instance = Cipher.getInstance("DES/ECB/PKCS5Padding")).init(2, this.a); |
| | | return new String(instance.doFinal(Hex.decodeHex(s.toCharArray()))); |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @SuppressWarnings("AlibabaClassNamingShouldBeCamel") |
| | | public final class cc { |
| | | private int a; |
| | | private char[] b; |
| | | private int c = 63; |
| | | |
| | | public cc() { |
| | | this.a = 0; |
| | | Arrays.fill(this.b = new char[c], '0'); |
| | | this.a = new Random().nextInt(16); |
| | | String obj; |
| | | if ((obj = Integer.toBinaryString(this.a)).length() == 1) { |
| | | obj = "000".concat(String.valueOf(obj)); |
| | | } else if (obj.length() == 2) { |
| | | obj = "00".concat(String.valueOf(obj)); |
| | | } else if (obj.length() == 3) { |
| | | obj = "0".concat(String.valueOf(obj)); |
| | | } |
| | | for (int i = 0; i < 4; ++i) { |
| | | this.b[i] = obj.charAt(i); |
| | | } |
| | | } |
| | | |
| | | public cc(String binaryString) { |
| | | this.a = 0; |
| | | Arrays.fill(this.b = new char[c], '0'); |
| | | final int length; |
| | | if ((length = (binaryString = Long.toBinaryString(Long.parseUnsignedLong(binaryString, 16))).length()) <= c) { |
| | | for (int i = 0; i < length; ++i) { |
| | | this.b[c - length + i] = binaryString.charAt(i); |
| | | } |
| | | } |
| | | final char[] value = new char[4]; |
| | | System.arraycopy(this.b, 0, value, 0, 4); |
| | | binaryString = new String(value); |
| | | this.a = Integer.parseUnsignedInt(binaryString, 2); |
| | | } |
| | | |
| | | @Override |
| | | public final String toString() { |
| | | String string = ""; |
| | | for (int i = 0; i < c; ++i) { |
| | | string = String.valueOf(string) + this.b[i]; |
| | | } |
| | | return string; |
| | | } |
| | | |
| | | public final char[] a() { |
| | | final String hexString = Long.toHexString(Long.parseUnsignedLong(this.toString(), 2)); |
| | | final int n; |
| | | final char[] array; |
| | | Arrays.fill(array = new char[n = (c + 1) / 4], '0'); |
| | | for (int length = hexString.length(), i = 0; i < length; ++i) { |
| | | array[n - length + i] = hexString.charAt(i); |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | public final boolean a(int c) { |
| | | return (c = this.c(c)) < c && this.b[c] == '1' && c >= 4; |
| | | } |
| | | |
| | | private int c(int n) { |
| | | if (n >= 0 && n < 59) { |
| | | if ((n += 4 + this.a) >= 63) { |
| | | n -= 59; |
| | | } |
| | | return n; |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | public final void b(int c) { |
| | | if ((c = this.c(c)) < c && c >= 4) { |
| | | this.b[c] = '1'; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.other; |
| | | |
| | | import com.moon.server.helper.StringHelper; |
| | | |
| | | import java.util.Calendar; |
| | | |
| | | /** |
| | | * FloatServerResponse |
| | | * @author WWW |
| | | */ |
| | | public class FloatServerResponse { |
| | | private String modules; |
| | | |
| | | private String id; |
| | | |
| | | private String expireDate; |
| | | |
| | | private int processNum; |
| | | |
| | | private long time; |
| | | |
| | | private int availableNum; |
| | | |
| | | private String licenseCode; |
| | | |
| | | private String localId; |
| | | |
| | | public FloatServerResponse() { |
| | | } |
| | | |
| | | public FloatServerResponse(ReqParamFloatServer rfs) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.YEAR, 2025); |
| | | |
| | | this.id = rfs.getId(); |
| | | this.localId = rfs.getLocalId(); |
| | | this.availableNum = rfs.getAvailableNum(); |
| | | this.time = calendar.getTimeInMillis(); |
| | | this.expireDate = StringHelper.YMD_FORMAT.format(this.time); |
| | | //this.licenseCode = "78a82f0920de0f557f8177bec1e48601c4dc25e4054a00728e4314b56528d3a1632de5298edee38a65412277977a174fea5d91c452b19ef138dbc2ba089ba632"; |
| | | this.licenseCode = CheckOutLicense.createFloatingLicense(rfs.getAvailableNum(), rfs.getId(), this.time); |
| | | } |
| | | |
| | | public String getModules() { |
| | | return this.modules; |
| | | } |
| | | |
| | | public void setModules(final String modules) { |
| | | this.modules = modules; |
| | | } |
| | | |
| | | public String getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | public void setId(final String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getExpireDate() { |
| | | return this.expireDate; |
| | | } |
| | | |
| | | public void setExpireDate(final String expireDate) { |
| | | this.expireDate = expireDate; |
| | | } |
| | | |
| | | public int getProcessNum() { |
| | | return this.processNum; |
| | | } |
| | | |
| | | public void setProcessNum(final int processNum) { |
| | | this.processNum = processNum; |
| | | } |
| | | |
| | | public int getAvailableNum() { |
| | | return this.availableNum; |
| | | } |
| | | |
| | | public void setAvailableNum(final int availableNum) { |
| | | this.availableNum = availableNum; |
| | | } |
| | | |
| | | public long getTime() { |
| | | return this.time; |
| | | } |
| | | |
| | | public void setTime(final long time) { |
| | | this.time = time; |
| | | } |
| | | |
| | | public String getLicenseCode() { |
| | | return this.licenseCode; |
| | | } |
| | | |
| | | public void setLicenseCode(final String licenseCode) { |
| | | this.licenseCode = licenseCode; |
| | | } |
| | | |
| | | public String getLocalId() { |
| | | return localId; |
| | | } |
| | | |
| | | public void setLocalId(String localId) { |
| | | this.localId = localId; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.other; |
| | | |
| | | import java.net.Inet4Address; |
| | | import java.net.InetAddress; |
| | | import java.net.NetworkInterface; |
| | | import java.net.SocketException; |
| | | import java.util.Enumeration; |
| | | |
| | | /** |
| | | * ReqParamFloatServer |
| | | * @author WWW |
| | | */ |
| | | public class ReqParamFloatServer { |
| | | private String id; |
| | | |
| | | private String port; |
| | | |
| | | private String modules; |
| | | |
| | | private int availableNum; |
| | | |
| | | private long time; |
| | | |
| | | private String localId; |
| | | |
| | | private String cmdType; |
| | | |
| | | public ReqParamFloatServer() { |
| | | this.localId = a(); |
| | | } |
| | | |
| | | public ReqParamFloatServer(String id, String port) { |
| | | this.id = id; |
| | | this.port = port; |
| | | this.localId = a(); |
| | | } |
| | | |
| | | public String getPort() { |
| | | return this.port; |
| | | } |
| | | |
| | | public void setPort(final String port) { |
| | | this.port = port; |
| | | } |
| | | |
| | | public String getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | public void setId(final String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getModules() { |
| | | return this.modules; |
| | | } |
| | | |
| | | public void setModules(final String modules) { |
| | | this.modules = modules; |
| | | } |
| | | |
| | | public int getAvailableNum() { |
| | | return this.availableNum; |
| | | } |
| | | |
| | | public void setAvailableNum(final int availableNum) { |
| | | this.availableNum = availableNum; |
| | | } |
| | | |
| | | public long getTime() { |
| | | return this.time; |
| | | } |
| | | |
| | | public void setTime(final long time) { |
| | | this.time = time; |
| | | } |
| | | |
| | | public String getLocalId() { |
| | | return this.localId; |
| | | } |
| | | |
| | | public String getCmdType() { |
| | | return this.cmdType; |
| | | } |
| | | |
| | | public void setCmdType(final String cmdType) { |
| | | this.cmdType = cmdType; |
| | | } |
| | | |
| | | public static String a() { |
| | | String string = ""; |
| | | try { |
| | | final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); |
| | | while (networkInterfaces.hasMoreElements()) { |
| | | final NetworkInterface networkInterface; |
| | | if (!(networkInterface = networkInterfaces.nextElement()).isLoopback() && !networkInterface.isVirtual() && networkInterface.isUp()) { |
| | | final Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses(); |
| | | final byte[] hardwareAddress; |
| | | if ((hardwareAddress = networkInterface.getHardwareAddress()) == null || networkInterface.getName().contains("docker")) { |
| | | continue; |
| | | } |
| | | while (inetAddresses.hasMoreElements()) { |
| | | final InetAddress inetAddress; |
| | | if ((inetAddress = inetAddresses.nextElement()) != null && inetAddress instanceof Inet4Address) { |
| | | final String a = a(inetAddress); |
| | | string = String.valueOf(inetAddress.getHostAddress()) + "|" + a; |
| | | if (!a.isEmpty()) { |
| | | return string; |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (SocketException ex) { |
| | | // |
| | | } |
| | | return string; |
| | | } |
| | | |
| | | private static String a(final InetAddress addr) { |
| | | String upperCase = ""; |
| | | try { |
| | | final byte[] hardwareAddress = NetworkInterface.getByInetAddress(addr).getHardwareAddress(); |
| | | final StringBuffer sb = new StringBuffer(""); |
| | | for (int i = 0; i < hardwareAddress.length; ++i) { |
| | | if (i != 0) { |
| | | sb.append("-"); |
| | | } |
| | | final String hexString; |
| | | if ((hexString = Integer.toHexString(hardwareAddress[i] & 0xFF)).length() == 1) { |
| | | sb.append("0".concat(String.valueOf(hexString))); |
| | | } else { |
| | | sb.append(hexString); |
| | | } |
| | | } |
| | | upperCase = sb.toString().toUpperCase(); |
| | | } catch (Exception ex) { |
| | | // |
| | | } |
| | | return upperCase; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | public class ApplyEntity implements Serializable { |
| | | private static final long serialVersionUID = -849213119060365952L; |
| | | |
| | | private int id; |
| | | |
| | | private int userid; |
| | | |
| | | private String depids; |
| | | |
| | | private String tabs; |
| | | |
| | | private String entities; |
| | | |
| | | private String wkt; |
| | | |
| | | private String pwd; |
| | | |
| | | private int status; |
| | | |
| | | private int count; |
| | | |
| | | private String descr; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String uname; |
| | | |
| | | private Integer isVerify; |
| | | |
| | | private String depcode; |
| | | |
| | | private String dircodes; |
| | | |
| | | private String gids; |
| | | |
| | | private String filters; |
| | | |
| | | private String guid; |
| | | |
| | | public ApplyEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | public void setUserid(int userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | public String getDepids() { |
| | | return depids; |
| | | } |
| | | |
| | | public void setDepids(String depids) { |
| | | this.depids = depids; |
| | | } |
| | | |
| | | public String getTabs() { |
| | | return tabs; |
| | | } |
| | | |
| | | public void setTabs(String tabs) { |
| | | this.tabs = tabs; |
| | | } |
| | | |
| | | public String getEntities() { |
| | | return entities; |
| | | } |
| | | |
| | | public void setEntities(String entities) { |
| | | this.entities = entities; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(int count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | 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 getUname() { |
| | | return uname; |
| | | } |
| | | |
| | | public void setUname(String uname) { |
| | | this.uname = uname; |
| | | } |
| | | |
| | | public Integer getIsVerify() { |
| | | return isVerify; |
| | | } |
| | | |
| | | public void setIsVerify(Integer isVerify) { |
| | | this.isVerify = isVerify; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | |
| | | public String getDircodes() { |
| | | return dircodes; |
| | | } |
| | | |
| | | public void setDircodes(String dircodes) { |
| | | this.dircodes = dircodes; |
| | | } |
| | | |
| | | public String getGids() { |
| | | return gids; |
| | | } |
| | | |
| | | public void setGids(String gids) { |
| | | this.gids = gids; |
| | | } |
| | | |
| | | public String getFilters() { |
| | | return filters; |
| | | } |
| | | |
| | | public void setFilters(String filters) { |
| | | this.filters = filters; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * å¨çº¿å¶å¾ |
| | | * @author WWW |
| | | */ |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ExportEntity implements Serializable { |
| | | private static final long serialVersionUID = -2104359582441796685L; |
| | | |
| | | private String token; |
| | | |
| | | private String title; |
| | | |
| | | private String pageSize; |
| | | |
| | | private String province; |
| | | |
| | | private String scale; |
| | | |
| | | private String resolution; |
| | | |
| | | private String date; |
| | | |
| | | private String layers; |
| | | |
| | | private double rotation; |
| | | |
| | | private double xmin; |
| | | |
| | | private double ymin; |
| | | |
| | | private double ymax; |
| | | |
| | | private double xmax; |
| | | |
| | | public String getToken() { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) { |
| | | this.token = token; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getPageSize() { |
| | | return pageSize; |
| | | } |
| | | |
| | | public void setPageSize(String pageSize) { |
| | | this.pageSize = pageSize; |
| | | } |
| | | |
| | | public String getProvince() { |
| | | return province; |
| | | } |
| | | |
| | | public void setProvince(String province) { |
| | | this.province = province; |
| | | } |
| | | |
| | | public String getScale() { |
| | | return scale; |
| | | } |
| | | |
| | | public void setScale(String scale) { |
| | | this.scale = scale; |
| | | } |
| | | |
| | | public String getResolution() { |
| | | return resolution; |
| | | } |
| | | |
| | | public void setResolution(String resolution) { |
| | | this.resolution = resolution; |
| | | } |
| | | |
| | | public String getDate() { |
| | | return date; |
| | | } |
| | | |
| | | public void setDate(String date) { |
| | | this.date = date; |
| | | } |
| | | |
| | | public String getLayers() { |
| | | return layers; |
| | | } |
| | | |
| | | public void setLayers(String layers) { |
| | | this.layers = layers; |
| | | } |
| | | |
| | | public double getRotation() { |
| | | return rotation; |
| | | } |
| | | |
| | | public void setRotation(double rotation) { |
| | | this.rotation = rotation; |
| | | } |
| | | |
| | | public double getXmin() { |
| | | return xmin; |
| | | } |
| | | |
| | | public void setXmin(double xmin) { |
| | | this.xmin = xmin; |
| | | } |
| | | |
| | | public double getYmin() { |
| | | return ymin; |
| | | } |
| | | |
| | | public void setYmin(double ymin) { |
| | | this.ymin = ymin; |
| | | } |
| | | |
| | | public double getYmax() { |
| | | return ymax; |
| | | } |
| | | |
| | | public void setYmax(double ymax) { |
| | | this.ymax = ymax; |
| | | } |
| | | |
| | | public double getXmax() { |
| | | return xmax; |
| | | } |
| | | |
| | | public void setXmax(double xmax) { |
| | | this.xmax = xmax; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * ç³è¯·æµç¨ |
| | | * @author WWW |
| | | */ |
| | | public class FlowEntity implements Serializable { |
| | | private static final long serialVersionUID = -267684465864526336L; |
| | | |
| | | private int id; |
| | | |
| | | private int applyid; |
| | | |
| | | private String depcode; |
| | | |
| | | private int userid; |
| | | |
| | | private int status; |
| | | |
| | | private String descr; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String uname; |
| | | |
| | | private String depName; |
| | | |
| | | public FlowEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getApplyid() { |
| | | return applyid; |
| | | } |
| | | |
| | | public void setApplyid(int applyid) { |
| | | this.applyid = applyid; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | |
| | | public int getUserid() { |
| | | return userid; |
| | | } |
| | | |
| | | public void setUserid(int userid) { |
| | | this.userid = userid; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | 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 getUname() { |
| | | return uname; |
| | | } |
| | | |
| | | public void setUname(String uname) { |
| | | this.uname = uname; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * æ ç» |
| | | * @author WWW |
| | | */ |
| | | public class MarkEntity implements Serializable { |
| | | private static final long serialVersionUID = -865286612354818048L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private String wkt; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | public MarkEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 模å |
| | | * @author WWW |
| | | */ |
| | | public class ModelEntity implements Serializable { |
| | | private static final long serialVersionUID = -41778639909708240L; |
| | | |
| | | private int id; |
| | | |
| | | private int layerid; |
| | | |
| | | private String modelid; |
| | | |
| | | private String guid; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String info; |
| | | |
| | | private String url; |
| | | |
| | | private String icon; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | public ModelEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getLayerid() { |
| | | return layerid; |
| | | } |
| | | |
| | | public void setLayerid(int layerid) { |
| | | this.layerid = layerid; |
| | | } |
| | | |
| | | public String getModelid() { |
| | | return modelid; |
| | | } |
| | | |
| | | public void setModelid(String modelid) { |
| | | this.modelid = modelid; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public String getIcon() { |
| | | return icon; |
| | | } |
| | | |
| | | public void setIcon(String icon) { |
| | | this.icon = icon; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * å®ç½ä¸å¼ å¾å®ä½ |
| | | * |
| | | * @author xing |
| | | * @date 2023/02/20 |
| | | */ |
| | | public class OneMapEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * value |
| | | */ |
| | | @JsonIgnore |
| | | private String value; |
| | | |
| | | /** |
| | | * key |
| | | */ |
| | | @JsonIgnore |
| | | private String key; |
| | | |
| | | private int id; |
| | | |
| | | private String eventid; |
| | | |
| | | private int metaid; |
| | | |
| | | private short ismeta; |
| | | |
| | | private String dircode; |
| | | |
| | | private String depcode; |
| | | |
| | | private int verid; |
| | | |
| | | private String name; |
| | | |
| | | private String type; |
| | | |
| | | private String guid; |
| | | |
| | | private String path; |
| | | |
| | | private double sizes; |
| | | |
| | | private String tab; |
| | | |
| | | private String layer; |
| | | |
| | | private int rows; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | private String bak; |
| | | |
| | | private String geom; |
| | | |
| | | private String uname; |
| | | |
| | | private String depName; |
| | | |
| | | private String verName; |
| | | |
| | | private String dirName; |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getEventid() { |
| | | return eventid; |
| | | } |
| | | |
| | | public void setEventid(String eventid) { |
| | | this.eventid = eventid; |
| | | } |
| | | |
| | | public int getMetaid() { |
| | | return metaid; |
| | | } |
| | | |
| | | public void setMetaid(int metaid) { |
| | | this.metaid = metaid; |
| | | } |
| | | |
| | | public short getIsmeta() { |
| | | return ismeta; |
| | | } |
| | | |
| | | public void setIsmeta(short ismeta) { |
| | | this.ismeta = ismeta; |
| | | } |
| | | |
| | | public String getDircode() { |
| | | return dircode; |
| | | } |
| | | |
| | | public void setDircode(String dircode) { |
| | | this.dircode = dircode; |
| | | } |
| | | |
| | | public String getDepcode() { |
| | | return depcode; |
| | | } |
| | | |
| | | public void setDepcode(String depcode) { |
| | | this.depcode = depcode; |
| | | } |
| | | |
| | | public int getVerid() { |
| | | return verid; |
| | | } |
| | | |
| | | public void setVerid(int verid) { |
| | | this.verid = verid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getLayer() { |
| | | return layer; |
| | | } |
| | | |
| | | public void setLayer(String layer) { |
| | | this.layer = layer; |
| | | } |
| | | |
| | | public int getRows() { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(int rows) { |
| | | this.rows = rows; |
| | | } |
| | | |
| | | 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 String getGeom() { |
| | | return geom; |
| | | } |
| | | |
| | | public void setGeom(String geom) { |
| | | this.geom = geom; |
| | | } |
| | | |
| | | public String getUname() { |
| | | return uname; |
| | | } |
| | | |
| | | public void setUname(String uname) { |
| | | this.uname = uname; |
| | | } |
| | | |
| | | public String getDepName() { |
| | | return depName; |
| | | } |
| | | |
| | | public void setDepName(String depName) { |
| | | this.depName = depName; |
| | | } |
| | | |
| | | public String getVerName() { |
| | | return verName; |
| | | } |
| | | |
| | | public void setVerName(String verName) { |
| | | this.verName = verName; |
| | | } |
| | | |
| | | public String getDirName() { |
| | | return dirName; |
| | | } |
| | | |
| | | public void setDirName(String dirName) { |
| | | this.dirName = dirName; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.show; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管éåæå®ä½ç±» |
| | | * |
| | | * @author xingjinshuang@smartearth.cn |
| | | * @date 2022/12/26 |
| | | */ |
| | | public class PipelineEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 表å |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | private List<String> tabs; |
| | | |
| | | /** |
| | | * å¯ç |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | private String pwd; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | private Integer gid; |
| | | |
| | | /** |
| | | * 管线 |
| | | */ |
| | | private String pipeName; |
| | | |
| | | /** |
| | | * 管段 |
| | | */ |
| | | private String segName; |
| | | |
| | | /** |
| | | * ç©¿è¶åç§° |
| | | */ |
| | | private String acrossName; |
| | | |
| | | /** |
| | | * ç©¿è¶é¿åº¦ |
| | | */ |
| | | private double acrossLength; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * wkt |
| | | */ |
| | | private String wkt; |
| | | |
| | | public Integer getGid() { |
| | | return gid; |
| | | } |
| | | |
| | | public void setGid(Integer gid) { |
| | | this.gid = gid; |
| | | } |
| | | |
| | | public List<String> getTabs() { |
| | | return tabs; |
| | | } |
| | | |
| | | public void setTabs(List<String> tabs) { |
| | | this.tabs = tabs; |
| | | } |
| | | |
| | | public String getPwd() { |
| | | return pwd; |
| | | } |
| | | |
| | | public void setPwd(String pwd) { |
| | | this.pwd = pwd; |
| | | } |
| | | |
| | | public String getPipeName() { |
| | | return pipeName; |
| | | } |
| | | |
| | | public void setPipeName(String pipeName) { |
| | | this.pipeName = pipeName; |
| | | } |
| | | |
| | | public String getSegName() { |
| | | return segName; |
| | | } |
| | | |
| | | public void setSegName(String segName) { |
| | | this.segName = segName; |
| | | } |
| | | |
| | | public String getAcrossName() { |
| | | return acrossName; |
| | | } |
| | | |
| | | public void setAcrossName(String acrossName) { |
| | | this.acrossName = acrossName; |
| | | } |
| | | |
| | | public double getAcrossLength() { |
| | | return acrossLength; |
| | | } |
| | | |
| | | public void setAcrossLength(double acrossLength) { |
| | | this.acrossLength = acrossLength; |
| | | } |
| | | |
| | | public String getRemarks() { |
| | | return remarks; |
| | | } |
| | | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.sys; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * åæ°è®¾ç½® |
| | | * @author WWW |
| | | */ |
| | | public class ArgsEntity implements Serializable { |
| | | private static final long serialVersionUID = -832866207909836938L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private int cvalue; |
| | | |
| | | private int dvalue; |
| | | |
| | | private int minValue; |
| | | |
| | | private int maxValue; |
| | | |
| | | private int times; |
| | | |
| | | private String descr; |
| | | |
| | | private String mark; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | public ArgsEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getCvalue() { |
| | | return cvalue; |
| | | } |
| | | |
| | | public void setCvalue(int cvalue) { |
| | | this.cvalue = cvalue; |
| | | } |
| | | |
| | | public int getDvalue() { |
| | | return dvalue; |
| | | } |
| | | |
| | | public void setDvalue(int dvalue) { |
| | | this.dvalue = dvalue; |
| | | } |
| | | |
| | | public int getMinValue() { |
| | | return minValue; |
| | | } |
| | | |
| | | public void setMinValue(int minValue) { |
| | | this.minValue = minValue; |
| | | } |
| | | |
| | | public int getMaxValue() { |
| | | return maxValue; |
| | | } |
| | | |
| | | public void setMaxValue(int maxValue) { |
| | | this.maxValue = maxValue; |
| | | } |
| | | |
| | | public int getTimes() { |
| | | return times; |
| | | } |
| | | |
| | | public void setTimes(int times) { |
| | | this.times = times; |
| | | } |
| | | |
| | | public String getDescr() { |
| | | return descr; |
| | | } |
| | | |
| | | public void setDescr(String descr) { |
| | | this.descr = descr; |
| | | } |
| | | |
| | | public String getMark() { |
| | | return mark; |
| | | } |
| | | |
| | | public void setMark(String mark) { |
| | | this.mark = mark; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.moon.server.entity.sys; |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * éä»¶ |
| | | * @author WWW |
| | | */ |
| | | public class AttachEntity implements Serializable { |
| | | private static final long serialVersionUID = -106535972611296912L; |
| | | |
| | | private int id; |
| | | |
| | | private String name; |
| | | |
| | | private String tab; |
| | | |
| | | private String tabGuid; |
| | | |
| | | private String guid; |
| | | |
| | | private String path; |
| | | |
| | | private double sizes; |
| | | |
| | | private int createUser; |
| | | |
| | | private Timestamp createTime; |
| | | |
| | | private int updateUser; |
| | | |
| | | private Timestamp updateTime; |
| | | |
| | | public AttachEntity() { |
| | | } |
| | | |
| | | public int getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(int id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getTab() { |
| | | return tab; |
| | | } |
| | | |
| | | public void setTab(String tab) { |
| | | this.tab = tab; |
| | | } |
| | | |
| | | public String getTabGuid() { |
| | | return tabGuid; |
| | | } |
| | | |
| | | public void setTabGuid(String tabGuid) { |
| | | this.tabGuid = tabGuid; |
| | | } |
| | | |
| | | public String getGuid() { |
| | | return guid; |
| | | } |
| | | |
| | | public void setGuid(String guid) { |
| | | this.guid = guid; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public double getSizes() { |
| | | return sizes; |
| | | } |
| | | |
| | | public void setSizes(double sizes) { |
| | | this.sizes = sizes; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
src/main/java/com/moon/server/entity/sys/AuthEntity.java
src/main/java/com/moon/server/entity/sys/BlacklistEntity.java
src/main/java/com/moon/server/entity/sys/DepEntity.java
src/main/java/com/moon/server/entity/sys/DownlogEntity.java
src/main/java/com/moon/server/entity/sys/LoginEntity.java
src/main/java/com/moon/server/entity/sys/MenuAuthEntity.java
src/main/java/com/moon/server/entity/sys/MenuEntity.java
src/main/java/com/moon/server/entity/sys/MetaDownEntity.java
src/main/java/com/moon/server/entity/sys/OperateEntity.java
src/main/java/com/moon/server/entity/sys/ReportEntity.java
src/main/java/com/moon/server/entity/sys/ResEntity.java
src/main/java/com/moon/server/entity/sys/ResOpEntity.java
src/main/java/com/moon/server/entity/sys/RoleEntity.java
src/main/java/com/moon/server/entity/sys/RoleMenuAuthEntity.java
src/main/java/com/moon/server/entity/sys/RoleResEntity.java
src/main/java/com/moon/server/entity/sys/RoleUserEntity.java
src/main/java/com/moon/server/entity/sys/TokenEntity.java
src/main/java/com/moon/server/entity/sys/UserEntity.java
src/main/java/com/moon/server/extend/CustomizedSqlInjector.java
src/main/java/com/moon/server/extend/InsertBatchMethod.java
src/main/java/com/moon/server/extend/UpdateBatchMethod.java
src/main/java/com/moon/server/helper/AccessHelper.java
src/main/java/com/moon/server/helper/AesHelper.java
src/main/java/com/moon/server/helper/ClassHelper.java
src/main/java/com/moon/server/helper/EnumHelper.java
src/main/java/com/moon/server/helper/ExcelHelper.java
src/main/java/com/moon/server/helper/FileHelper.java
src/main/java/com/moon/server/helper/GdalHelper.java
src/main/java/com/moon/server/helper/GdbHelper.java
src/main/java/com/moon/server/helper/HttpHelper.java
src/main/java/com/moon/server/helper/JsonHelper.java
src/main/java/com/moon/server/helper/LicHelper.java
src/main/java/com/moon/server/helper/Md5Helper.java
src/main/java/com/moon/server/helper/MdbHelper.java
src/main/java/com/moon/server/helper/PathHelper.java
src/main/java/com/moon/server/helper/RestHelper.java
src/main/java/com/moon/server/helper/RsaHelper.java
src/main/java/com/moon/server/helper/ShpHelper.java
src/main/java/com/moon/server/helper/SpringContextHelper.java
src/main/java/com/moon/server/helper/StringHelper.java
src/main/java/com/moon/server/helper/WebHelper.java
src/main/java/com/moon/server/helper/WordHelper.java
src/main/java/com/moon/server/helper/Zip4jHelper.java
src/main/java/com/moon/server/helper/ZipHelper.java
src/main/java/com/moon/server/interceptor/AuthInterceptor.java
src/main/java/com/moon/server/interceptor/CrosFilter.java
src/main/java/com/moon/server/mapper/all/BaseQueryMapper.java
src/main/java/com/moon/server/mapper/all/BasicMapper.java
src/main/java/com/moon/server/mapper/all/GeomBaseMapper.java
src/main/java/com/moon/server/mapper/all/PermsMapper.java
src/main/java/com/moon/server/mapper/data/DictMapper.java
src/main/java/com/moon/server/mapper/data/DirMapper.java
src/main/java/com/moon/server/mapper/data/DomainMapper.java
src/main/java/com/moon/server/mapper/data/DownloadMapper.java
src/main/java/com/moon/server/mapper/data/LayerMapper.java
src/main/java/com/moon/server/mapper/data/MetaMapper.java
src/main/java/com/moon/server/mapper/data/PublishMapper.java
src/main/java/com/moon/server/mapper/data/StyleMapper.java
src/main/java/com/moon/server/mapper/data/UploadMapper.java
src/main/java/com/moon/server/mapper/data/VerMapper.java
src/main/java/com/moon/server/mapper/show/ApplyMapper.java
src/main/java/com/moon/server/mapper/show/FlowMapper.java
src/main/java/com/moon/server/mapper/show/MarkMapper.java
src/main/java/com/moon/server/mapper/show/ModelMapper.java
src/main/java/com/moon/server/mapper/show/OneMapMapper.java
src/main/java/com/moon/server/mapper/show/PipelineMapper.java
src/main/java/com/moon/server/mapper/sys/ArgsMapper.java
src/main/java/com/moon/server/mapper/sys/AttachMapper.java
src/main/java/com/moon/server/mapper/sys/AuthMapper.java
src/main/java/com/moon/server/mapper/sys/BlacklistMapper.java
src/main/java/com/moon/server/mapper/sys/DepMapper.java
src/main/java/com/moon/server/mapper/sys/DownlogMapper.java
src/main/java/com/moon/server/mapper/sys/LoginMapper.java
src/main/java/com/moon/server/mapper/sys/MenuAuthMapper.java
src/main/java/com/moon/server/mapper/sys/MenuMapper.java
src/main/java/com/moon/server/mapper/sys/MetaDownMapper.java
src/main/java/com/moon/server/mapper/sys/OperateMapper.java
src/main/java/com/moon/server/mapper/sys/ReportMapper.java
src/main/java/com/moon/server/mapper/sys/ResMapper.java
src/main/java/com/moon/server/mapper/sys/ResOpMapper.java
src/main/java/com/moon/server/mapper/sys/RoleMapper.java
src/main/java/com/moon/server/mapper/sys/RoleMenuAuthMapper.java
src/main/java/com/moon/server/mapper/sys/RoleResMapper.java
src/main/java/com/moon/server/mapper/sys/RoleUserMapper.java
src/main/java/com/moon/server/mapper/sys/TokenMapper.java
src/main/java/com/moon/server/mapper/sys/UserMapper.java
src/main/java/com/moon/server/service/all/BaseQueryService.java
src/main/java/com/moon/server/service/all/BaseUploadService.java
src/main/java/com/moon/server/service/all/CommonsFileuploadService.java
src/main/java/com/moon/server/service/all/PermsService.java
src/main/java/com/moon/server/service/all/RedisService.java
src/main/java/com/moon/server/service/all/ScheduleService.java
src/main/java/com/moon/server/service/all/SignService.java
src/main/java/com/moon/server/service/all/SysService.java
src/main/java/com/moon/server/service/all/TestService.java
src/main/java/com/moon/server/service/all/UploadAttachService.java
src/main/java/com/moon/server/service/all/WebSocketService.java
src/main/java/com/moon/server/service/data/DataQueryService.java
src/main/java/com/moon/server/service/data/DictService.java
src/main/java/com/moon/server/service/data/DirService.java
src/main/java/com/moon/server/service/data/DomainService.java
src/main/java/com/moon/server/service/data/DownloadService.java
src/main/java/com/moon/server/service/data/FmeService.java
src/main/java/com/moon/server/service/data/LayerService.java
src/main/java/com/moon/server/service/data/MetaService.java
src/main/java/com/moon/server/service/data/PublishService.java
src/main/java/com/moon/server/service/data/StyleService.java
src/main/java/com/moon/server/service/data/UploadService.java
src/main/java/com/moon/server/service/data/VerService.java
src/main/java/com/moon/server/service/show/ApplyService.java
src/main/java/com/moon/server/service/show/DataLibService.java
src/main/java/com/moon/server/service/show/ExportService.java
src/main/java/com/moon/server/service/show/FlowService.java
src/main/java/com/moon/server/service/show/InquiryService.java
src/main/java/com/moon/server/service/show/MarkService.java
src/main/java/com/moon/server/service/show/ModelService.java
src/main/java/com/moon/server/service/show/OneMapService.java
src/main/java/com/moon/server/service/show/PipelineService.java
src/main/java/com/moon/server/service/sys/ArgsService.java
src/main/java/com/moon/server/service/sys/AttachService.java
src/main/java/com/moon/server/service/sys/AuthService.java
src/main/java/com/moon/server/service/sys/BlacklistService.java
src/main/java/com/moon/server/service/sys/DepService.java
src/main/java/com/moon/server/service/sys/DownlogService.java
src/main/java/com/moon/server/service/sys/LoginService.java
src/main/java/com/moon/server/service/sys/MenuAuthService.java
src/main/java/com/moon/server/service/sys/MenuService.java
src/main/java/com/moon/server/service/sys/MetaDownService.java
src/main/java/com/moon/server/service/sys/OperateService.java
src/main/java/com/moon/server/service/sys/ReportService.java
src/main/java/com/moon/server/service/sys/ResOpService.java
src/main/java/com/moon/server/service/sys/ResService.java
src/main/java/com/moon/server/service/sys/RoleMenuAuthService.java
src/main/java/com/moon/server/service/sys/RoleResService.java
src/main/java/com/moon/server/service/sys/RoleService.java
src/main/java/com/moon/server/service/sys/RoleUserService.java
src/main/java/com/moon/server/service/sys/TokenService.java
src/main/java/com/moon/server/service/sys/UserService.java
src/main/resources/mapper/all/BaseQueryMapper.xml
src/main/resources/mapper/all/PermsMapper.xml
src/main/resources/mapper/data/DictMapper.xml
src/main/resources/mapper/data/DirMapper.xml
src/main/resources/mapper/data/DomainMapper.xml
src/main/resources/mapper/data/DownloadMapper.xml
src/main/resources/mapper/data/LayerMapper.xml
src/main/resources/mapper/data/MetaMapper.xml
src/main/resources/mapper/data/StyleMapper.xml
src/main/resources/mapper/data/UploadMapper.xml
src/main/resources/mapper/data/VerMapper.xml
src/main/resources/mapper/show/ApplyMapper.xml
src/main/resources/mapper/show/FlowMapper.xml
src/main/resources/mapper/show/MarkMapper.xml
src/main/resources/mapper/show/ModelMapper.xml
src/main/resources/mapper/show/OneMapMapper.xml
src/main/resources/mapper/show/PipelineMapper.xml
src/main/resources/mapper/show/PublishMapper.xml
src/main/resources/mapper/sys/ArgsMapper.xml
src/main/resources/mapper/sys/AttachMapper.xml
src/main/resources/mapper/sys/AuthMapper.xml
src/main/resources/mapper/sys/BlacklistMapper.xml
src/main/resources/mapper/sys/DepMapper.xml
src/main/resources/mapper/sys/DownlogMapper.xml
src/main/resources/mapper/sys/LoginMapper.xml
src/main/resources/mapper/sys/MenuAuthMapper.xml
src/main/resources/mapper/sys/MenuMapper.xml
src/main/resources/mapper/sys/MetaDownMapper.xml
src/main/resources/mapper/sys/OperateMapper.xml
src/main/resources/mapper/sys/ReportMapper.xml
src/main/resources/mapper/sys/ResMapper.xml
src/main/resources/mapper/sys/ResOpMapper.xml
src/main/resources/mapper/sys/RoleMapper.xml
src/main/resources/mapper/sys/RoleMenuAuthMapper.xml
src/main/resources/mapper/sys/RoleResMapper.xml
src/main/resources/mapper/sys/RoleUserMapper.xml
src/main/resources/mapper/sys/TokenMapper.xml
src/main/resources/mapper/sys/UserMapper.xml |