| | |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * Excel头注解类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Target(ElementType.TYPE) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface ExcelHead { |
| | | /** |
| | | * Excel头行数 |
| | | * |
| | | * @return 头行数 |
| | | */ |
| | | int headRows() default 1; |
| | | |
| | | /** |
| | | * 排除的Sheet名称(多个用逗号隔开) |
| | | * |
| | | * @return |
| | | */ |
| | | String excludeSheets() default ""; |
| | | } |
| | |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * 系统日志注解类 |
| | | * @author WWW |
| | | */ |
| | | @Target(ElementType.METHOD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Documented |
| | | @SuppressWarnings("ALL") |
| | | public @interface SysLog { |
| | | String value() default ""; |
| | | } |
| | |
| | | import java.lang.reflect.Method; |
| | | import java.util.TimerTask; |
| | | |
| | | /** |
| | | * 日志切面类 |
| | | * @author WWW |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | @SuppressWarnings("ALL") |
| | | public class LogAspect { |
| | | @Autowired |
| | | private TokenService tokenService; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 环绕通知 @Around,也可以使用 @Before (前置通知) 或 @After (后置通知) |
| | | * @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(); |
| | |
| | | oe.setUrl(url); |
| | | oe.setExec(time); |
| | | |
| | | // 设置模块 |
| | | Api api = clazz.getAnnotation(Api.class); |
| | | if (api != null) { |
| | | String[] strs = api.tags()[0].split(StaticData.BACKSLASH); |
| | |
| | | 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()); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取操作类型 |
| | | */ |
| | | private static int getType(String methodName) { |
| | | if (methodName.contains(SELECT)) { |
| | | return 1; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 初始化完成配置类 |
| | | * @author WWW |
| | | */ |
| | | @Component |
| | | @SuppressWarnings("ALL") |
| | | public class InitConfig implements ApplicationRunner { |
| | | private final static Log log = LogFactory.getLog(InitConfig.class); |
| | | |
| | |
| | | import org.springframework.web.multipart.MultipartResolver; |
| | | import org.springframework.web.multipart.support.StandardServletMultipartResolver; |
| | | |
| | | /** |
| | | * 多文件上传配置 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | public class MultipartFileUploadConfig { |
| | | @Bean |
| | | public MultipartResolver multipartResolver() { |
| | |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * Mybatis-Plus分页配置 |
| | | * @author WWW |
| | | */ |
| | | @EnableTransactionManagement |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | @MapperScan("com.moon.server.mapper") |
| | | public class MybatisPlusConfig { |
| | | /** |
| | | * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 |
| | | * MybatisConfiguration#useDeprecatedExecutor = false |
| | | * 避免缓存出现问题(该属性会在旧插件移除后一同移除) |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * 属性配置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("AlibabaCommentsMustBeJavadocFormat") |
| | | @SuppressWarnings("ALL") |
| | | public class PropertiesConfig { |
| | | @Value("${sys.path.download}") |
| | | private String downloadPath; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Redis配置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | @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(); |
| | |
| | | |
| | | template.setValueSerializer(serializer); |
| | | |
| | | //使用StringRedisSerializer来序列化和反序列化redis的key值 |
| | | template.setKeySerializer(new StringRedisSerializer()); |
| | | template.setHashKeySerializer(new StringRedisSerializer()); |
| | | template.setHashValueSerializer(serializer); |
| | |
| | | @Bean |
| | | @Override |
| | | public CacheErrorHandler errorHandler() { |
| | | // 异常处理,当Redis发生异常时,打印日志,但是程序正常走 |
| | | return new CacheErrorHandler() { |
| | | @Override |
| | | public void handleCacheGetError(RuntimeException e, Cache cache, Object key) { |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Rest模板配置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | @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,-1为不限制 |
| | | */ |
| | | @Value("${remote.connectTimeout:5000}") |
| | | private int connectTimeout; |
| | | |
| | | /** |
| | | * 读取超时默认30s,-1为不限制 |
| | | */ |
| | | @Value("${remote.readTimeout:30000}") |
| | | private int readTimeout; |
| | | |
| | | /** |
| | | * 创建HTTP客户端工厂 |
| | | * |
| | | * @return 客户端工厂 |
| | | */ |
| | | private ClientHttpRequestFactory createFactory() { |
| | | if (this.maxTotalConnect <= 0) { |
| | | SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); |
| | |
| | | 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()) { |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 日程配置类 |
| | | * @author WWW |
| | | */ |
| | | @Component |
| | | @EnableScheduling |
| | | @SuppressWarnings("ALL") |
| | | public class ScheduleConfig { |
| | | @Autowired |
| | | AttachService attachService; |
| | |
| | | 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); |
| | |
| | | try { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | // 查询服务资源状态 |
| | | jsonObject.put("resInfo", scheduleService.selectResStatus()); |
| | | |
| | | String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | |
| | | 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); |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Swagger配置类 |
| | | * @author www |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | @SuppressWarnings("ALL") |
| | | public class SwaggerConfig { |
| | | private List<ApiKey> securitySchemes() { |
| | | List<ApiKey> apiKeys = new ArrayList<ApiKey>(); |
| | |
| | | import java.util.concurrent.ScheduledThreadPoolExecutor; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | |
| | | /** |
| | | * 线程池配置类 |
| | | * @author WWW |
| | | * @date 2023-07-10 |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | public class ThreadPoolConfig { |
| | | /** |
| | | * 核心线程池大小 |
| | | */ |
| | | private final static int CORE_POOL_SIZE = 50; |
| | | |
| | | /** |
| | | * 最大可创建的线程数 |
| | | */ |
| | | private final static int MAX_POOL_SIZE = 200; |
| | | |
| | | /** |
| | | * 队列最大长度 |
| | | */ |
| | | private final static int QUEUE_CAPACITY = 1000; |
| | | |
| | | /** |
| | | * 线程池维护线程所允许的空闲时间 |
| | | */ |
| | | private final static int KEEP_ALIVE_SECONDS = 300; |
| | | |
| | | @Bean(name = "threadPoolTaskExecutor") |
| | |
| | | executor.setCorePoolSize(CORE_POOL_SIZE); |
| | | executor.setQueueCapacity(QUEUE_CAPACITY); |
| | | executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS); |
| | | // 线程池对拒绝任务(无线程可用)的处理策略 |
| | | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | |
| | | return executor; |
| | | } |
| | | |
| | | /** |
| | | * 执行周期性或定时任务 |
| | | */ |
| | | @Bean(name = "scheduledExecutorService") |
| | | protected ScheduledExecutorService scheduledExecutorService() { |
| | | return new ScheduledThreadPoolExecutor(CORE_POOL_SIZE, |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Web配置类 |
| | | * @author WWW |
| | | */ |
| | | @Configuration |
| | | @SuppressWarnings("ALL") |
| | | 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/"); |
| | |
| | | super.addResourceHandlers(registry); |
| | | } |
| | | |
| | | /** |
| | | * 忽略url地址大小写 |
| | | */ |
| | | @Override |
| | | protected void configurePathMatch(PathMatchConfigurer configurer) { |
| | | AntPathMatcher matcher = new AntPathMatcher(); |
| | |
| | | configurer.setPathMatcher(matcher); |
| | | } |
| | | |
| | | /** |
| | | * 跨域请求 |
| | | */ |
| | | @Override |
| | | protected void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |
| | |
| | | .maxAge(3600); |
| | | } |
| | | |
| | | /** |
| | | * 添加统一的拦截器 |
| | | */ |
| | | @Override |
| | | protected void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(getAuthBean()) |
| | |
| | | super.addInterceptors(registry); |
| | | } |
| | | |
| | | /** |
| | | * 处理json格式,值null的转换为"" |
| | | */ |
| | | @Override |
| | | public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { |
| | | FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); |
| | |
| | | //SerializerFeature.WriteNullStringAsEmpty, |
| | | SerializerFeature.WriteNullNumberAsZero, |
| | | SerializerFeature.WriteNullBooleanAsFalse); |
| | | // 结果是否格式化,默认为false |
| | | //SerializerFeature.PrettyFormat); |
| | | |
| | | converter.setFastJsonConfig(config); |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
| | | |
| | | /** |
| | | * WebSocket配置类 |
| | | * @author WWW |
| | | */ |
| | | @Component |
| | | @SuppressWarnings("ALL") |
| | | public class WebSocketConfig { |
| | | /** |
| | | * 自动注册使用@ServerEndpoint |
| | | */ |
| | | @Bean |
| | | public ServerEndpointExporter serverEndpointExporter() { |
| | | return new ServerEndpointExporter(); |
| | |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | |
| | | /** |
| | | * Controller基类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class BaseController { |
| | | public Log log = LogFactory.getLog(getClass()); |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 父查询控制器 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class BaseQueryController extends BaseController { |
| | | @Autowired |
| | | AttachService attachService; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 处理WKT |
| | | */ |
| | | private void copeWkt(List<?> list) { |
| | | for (int i = 0, c = list.size(); i < c; i++) { |
| | | Object obj = list.get(i); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置WKT加密 |
| | | */ |
| | | private void setWktEncrypt(Object obj) { |
| | | if (obj instanceof BaseGeoEntity) { |
| | | BaseGeoEntity entity = (BaseGeoEntity) obj; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取类别过滤条件 |
| | | */ |
| | | private String getTypesFilter(String types) { |
| | | if (StringHelper.isEmpty(types)) { |
| | | return null; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * FloatServer |
| | | * @author WWW |
| | | */ |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/floatserver") |
| | | public class FloatServerController extends BaseController { |
| | | private static LicHelper licHelper; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 授权控制器 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "运维管理\\授权管理") |
| | | @RestController |
| | | @RequestMapping("/perms") |
| | | @SuppressWarnings("ALL") |
| | | public class PermsController extends BaseController { |
| | | @Autowired |
| | | PermsService permsService; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 签名控制器 |
| | | * @author WWW |
| | | * @date 2022-09-21 |
| | | */ |
| | | @Api(tags = "运维管理\\签名管理") |
| | | @RestController |
| | | @RequestMapping("/sign") |
| | | @SuppressWarnings("ALL") |
| | | public class SignController extends BaseController { |
| | | @Autowired |
| | | UserService userService; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 颜色 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\颜色表管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/colortab") |
| | | public class ColortabController extends BaseController { |
| | | @Resource |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据统计 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\数据统计") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dataCount") |
| | | public class DataCountController extends BaseController { |
| | | @Autowired |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 数据检索 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\数据查询") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dataQuery") |
| | | public class DataQueryController extends BaseQueryController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 字典管理 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\字典管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dict") |
| | | public class DictController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 目录管理 |
| | | * @author sws |
| | | * @date 2022-09-22 |
| | | */ |
| | | @Api(tags = "数据管理\\目录管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dir") |
| | | public class DirController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 值域 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\值域") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/domain") |
| | | public class DomainController extends BaseController { |
| | | @Autowired |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 元数据 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\信息管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/meta") |
| | | public class MetaController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据发布 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\发布管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/publish") |
| | | public class PublishController extends BaseController { |
| | | @Resource |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取类型 |
| | | */ |
| | | private String getType(String type) throws Exception { |
| | | switch (type) { |
| | | case "DOM": |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取发布类型 |
| | | */ |
| | | private String getPubType(String type) throws Exception { |
| | | if (StringHelper.isEmpty(type)) { |
| | | return null; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 栅格分析 |
| | | * @author WWW |
| | | * @date 2023-08-23 |
| | | */ |
| | | @Api(tags = "数据管理\\栅格分析") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/rasterAnalysis") |
| | | public class RasterAnalysisController extends BaseController { |
| | | @Resource |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 样式管理 |
| | | * @author sws |
| | | * @date 2022-09.26 |
| | | */ |
| | | @Api(tags = "数据管理\\样式管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/style") |
| | | public class StyleController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 版本表 |
| | | * @author SWS |
| | | * @date 2022-09.29 |
| | | */ |
| | | @Api(tags = "数据管理\\版本管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/ver") |
| | | public class VerController extends BaseController { |
| | | @Autowired |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 检查控制器 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class CheckController extends BaseController { |
| | | @Autowired |
| | | protected PathHelper pathHelper; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取文件路径 |
| | | */ |
| | | 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; |
| | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * 是/否为Excel文件 |
| | | */ |
| | | private boolean isXlsFile(String filePath) { |
| | | if (null == filePath) { |
| | | return false; |
| | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * 方法调用 |
| | | */ |
| | | private String invoke(String name, FmeReqEntity entity, HttpServletRequest req) throws Exception { |
| | | Method method; |
| | | try { |
| | |
| | | |
| | | 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 = "服务注册") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询控制器 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class QueryController extends CheckController { |
| | | @Autowired |
| | | protected DepService depService; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据入库 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\数据上传") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dataUpload") |
| | | public class UploadController extends QueryController { |
| | | @Autowired |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 接收数组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({ |
| | |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据申请 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综合展示\\数据申请") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/apply") |
| | | public class ApplyController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 综合展示 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综合展示\\首页") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/comprehensive") |
| | | public class ComprehensiveController extends ModelController { |
| | | @Autowired |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 资料馆 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综合展示\\资料馆") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dataLib") |
| | | public class DataLibController extends BaseQueryController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 在线制图 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综合展示\\在线制图") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/export") |
| | | public class ExportController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综合展示\\查询") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/inquiry") |
| | | public class InquiryController extends BaseQueryController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 标绘 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综合展示\\标绘") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/mark") |
| | | public class MarkController extends BaseController { |
| | | @Resource |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 模型 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ModelController extends BaseController { |
| | | @Autowired |
| | | ModelService modelService; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 参数设置 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "运维管理\\系统配置") |
| | | @RestController |
| | | @RequestMapping("/args") |
| | | @SuppressWarnings("ALL") |
| | | public class ArgsController extends BaseController { |
| | | @Autowired |
| | | ArgsService argsService; |
| | |
| | | } |
| | | } |
| | | |
| | | /*@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({ |
| | |
| | | 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); |
| | | } |
| | | }*/ |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 权限表 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "运维管理\\权限管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/auth") |
| | | public class AuthController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 黑名单 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "运维管理\\黑名单") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/blacklist") |
| | | public class BlacklistController extends BaseController { |
| | | @Autowired |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 控制台控制器 |
| | | * @author WWW |
| | | * @date 2022-09-21 |
| | | */ |
| | | @Api(tags = "运维管理\\控制台") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/ctrl") |
| | | public class CtrlController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 组织机构 |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | @Api(tags = "运维管理\\单位管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/dep") |
| | | public class DepController extends BaseController { |
| | | @Autowired |
| | |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 下载日志 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "运维管理\\下载日志") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/downlog") |
| | | public class DownlogController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 图层 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "运维管理\\图层管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/layer") |
| | | public class LayerController extends BaseController { |
| | | @Autowired |
| | |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 登录日志 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @Api(tags = "运维管理\\登录日志") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/login") |
| | | public class LoginController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 菜单-权限 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "运维管理\\菜单权限") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/menuAuth") |
| | | public class MenuAuthController extends BaseController { |
| | | @Autowired |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 菜单 |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | @Api(tags= "运维管理\\菜单管理") |
| | | @RestController |
| | | @SuppressWarnings("ALL") |
| | | @RequestMapping("/menu") |
| | | public class MenuController extends BaseController { |
| | | @Autowired |
| | |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\操作日志") |
| | | @RestController |
| | | @RequestMapping("/operate") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * 代理服务 |
| | | * @author WWW |
| | | * @date 2023-07-11 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\代理服务") |
| | | @RestController |
| | | @RequestMapping("/proxy") |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 报告模板 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\模板管理") |
| | | @RestController |
| | | @RequestMapping("/report") |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 资源管理 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\资源管理") |
| | | @RestController |
| | | @RequestMapping("/res") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 资源日志 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\资源日志") |
| | | @RestController |
| | | @RequestMapping("/resLog") |
| | |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 资源操作 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\资源操作") |
| | | @RestController |
| | | @RequestMapping("/resOp") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | *角色表 |
| | | * @author SWS |
| | | * @date 2022-09.28 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\角色管理") |
| | | @RestController |
| | | @RequestMapping("/role") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色-图层 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\角色图层") |
| | | @RestController |
| | | @RequestMapping("/roleLayer") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色-菜单 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\角色菜单") |
| | | @RestController |
| | | @RequestMapping("/roleMenuAuth") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色-资源 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\角色资源") |
| | | @RestController |
| | | @RequestMapping("/roleRes") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 角色-用户 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\用户角色") |
| | | @RestController |
| | | @RequestMapping("/roleUser") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 令牌表 |
| | | * @author WWW |
| | | * @date 2022-09-28 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\令牌管理") |
| | | @RestController |
| | | @RequestMapping("/token") |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户表 |
| | | * @author sws |
| | | * @date 2022-09-27 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Api(tags = "运维管理\\用户管理") |
| | | @RestController |
| | | @RequestMapping("/user") |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * 密码抽象类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public abstract class AbstractPwdEntity { |
| | | private String pwd; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 基础实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class BaseEntity implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer gid; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | /** |
| | | * 空间基础实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class BaseGeoEntity extends BaseEntity { |
| | | @TableField(select = false) |
| | | private String geom; |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * Http状态码类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | 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) { |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 菜单授权 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class MenusAuthEntity implements Serializable { |
| | | private static final long serialVersionUID = -944664756113218L; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 权限授权 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class PermsAuthEntity implements Serializable { |
| | | private static final long serialVersionUID = -8948994757253139554L; |
| | | |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * Redis缓存键 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | | * GeoServer的图层名键 |
| | | */ |
| | | public static String permsGeoTabKey(String key) { |
| | | return "perms:geo:tab:" + key; |
| | | } |
| | | |
| | | /** |
| | | * 图层授权键 |
| | | */ |
| | | public static String permsLayerKey(String key) { |
| | | return "perms:layer:" + key; |
| | | } |
| | | |
| | | /** |
| | | * 投影图层授权键 |
| | | */ |
| | | public static String permsProjectLayerKey(String key) { |
| | | return "perms:projectLayer:" + 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 permsProxy(String key) { |
| | | return "perms:proxy:" + 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; |
| | | |
| | | /** |
| | | * 响应消息类 |
| | | * @author www |
| | | * @param <T> 泛型 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ResponseMsg<T> { |
| | | public ResponseMsg() { |
| | | this.time = System.currentTimeMillis(); |
| | |
| | | package com.moon.server.entity.all; |
| | | |
| | | /** |
| | | * 设置数据类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | 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 = 1000; |
| | | |
| | | /** |
| | | * 服务上限 |
| | | */ |
| | | public static int MAX_SERVERS = 100000; |
| | | } |
| | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 静态数据类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class StaticData { |
| | | /** |
| | | * 权限排除路径:/proxy,要求全部小写 |
| | | */ |
| | | public static String[] EXCLUDE_PATH = new String[]{"/sign/", "/perms/", "/floatserver/", "/proxy/", "/swagger", "/error"}; |
| | | |
| | | public final static int I0 = 0; |
| | |
| | | |
| | | public static final String NO_FILE = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NOT_FOUND, "文件找不到")); |
| | | |
| | | /** |
| | | * 月球2000坐标系的WKT |
| | | */ |
| | | public static final String MOON_2000_WKT = "GEOGCS[\"GCS_Moon_2000\",\r\n" + |
| | | " DATUM[\"D_Moon_2000\",\r\n" + |
| | | " SPHEROID[\"Moon_2000_IAU_IAG\",1737400,0,\r\n" + |
| | |
| | | |
| | | public final static List<Integer> DEFAULT_EPSG = new ArrayList<>(Arrays.asList(0, 104903, 900914)); |
| | | |
| | | /** |
| | | * 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 DIGIT_REG = "\\d+"; |
| | | |
| | | /** |
| | | * 密码正则表达式 |
| | | */ |
| | | 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}$"; |
| | | |
| | | /** |
| | | * 栅格数据扩展名 |
| | | */ |
| | | public final static List<String> RASTER_EXT = new ArrayList<>(Arrays.asList(".img", ".tif", ".tiff", ".jpg", ".jp2")); |
| | | |
| | | /** |
| | | * 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(".jpg.aux.xml", ".jpg.ovr", ".jpg.xml", ".jgw", ".prj")); |
| | | |
| | | /** |
| | | * JP2文件扩展名 |
| | | */ |
| | | public final static List<String> JP2_EXT = new ArrayList<>(Arrays.asList(".jp2.aux.xml", ".jp2.ovr", ".jp2.xml", ".jgw", ".prj", ".jp2.html", ".jp2.txt")); |
| | | |
| | | /** |
| | | * 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", ".aux", ".tif.ovr", ".tif.aux.xml", ".tif.xml")); |
| | | |
| | | /** |
| | | * TIFF文件扩展名 |
| | | */ |
| | | public final static List<String> TIFF_EXT = new ArrayList<>(Arrays.asList(".prj", ".tfw", ".aux", ".tiff.ovr", ".tiff.aux.xml", ".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(".jpg.aux.xml", ".jpg.xml", ".jp2.aux.xml", ".jp2.xml", ".jp2.html", ".jp2.txt", ".img.aux.xml", ".img.xml", ".tif.aux.xml", ".tif.xml", ".tiff.aux.xml", ".tiff.xml", ".shp.xml", ".ecw.xml", "ecw.aux.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", ".jp2", ".png", ".img", ".tif", ".tiff", ".dem", ".bmp", ".gif", ".rmvb", ".rm", ".mp3", ".mp4", ".avi", ".wma", ".wmv", ".7z", ".rar", ".zip", ".csv")); |
| | | |
| | | /** |
| | | * 插入排除字段 |
| | | */ |
| | | 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 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class CountEntity { |
| | | private Integer no; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 请求下载实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class DownloadReqEntity extends AbstractPwdEntity implements Serializable { |
| | | private static final long serialVersionUID = -8624235184539814997L; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 下载瓦片实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class DownloadTileEntity extends AbstractPwdEntity implements Serializable { |
| | | private static final long serialVersionUID = -229710198271495902L; |
| | | |
| | |
| | | public DownloadTileEntity() { |
| | | } |
| | | |
| | | /** |
| | | * 验证坐标 |
| | | */ |
| | | public String verifyCoords() { |
| | | if (null == xmin || null == ymin || null == xmax || null == ymax) { |
| | | return "四至坐标值不能为空"; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 文件信息 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class FileInfoEntity implements Serializable { |
| | | private static final long serialVersionUID = -674723262772248619L; |
| | | |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * FME请求实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | 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; |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * ID-名称实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class IdNameEntity implements Serializable { |
| | | private static final long serialVersionUID = -8485687857643406110L; |
| | | |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * 键值对实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class KeyValueEntity { |
| | | private String key; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 标绘JSON实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class MarkJsonEntity implements Serializable { |
| | | private static final long serialVersionUID = 7776629022021914001L; |
| | | |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * 名称值对实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class NameValueEntity { |
| | | private String name; |
| | | |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 发布实体类 |
| | | * @author WWW |
| | | * @date 2023-09-02 |
| | | */ |
| | | @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming") |
| | | @SuppressWarnings("ALL") |
| | | public class PubEntity implements Serializable { |
| | | private static final long serialVersionUID = 1393159573706054735L; |
| | | |
| | |
| | | time = StringHelper.YMDHMS2_FORMAT.format(new Date()); |
| | | } |
| | | |
| | | /** |
| | | * 设置默认值 |
| | | */ |
| | | public void setDefault() { |
| | | if (null == min) { |
| | | min = 0; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 发布ID |
| | | */ |
| | | private Integer pubid; |
| | | |
| | | /** |
| | | * 图层ID |
| | | */ |
| | | private Integer layerId; |
| | | |
| | | /** |
| | | * 唯一键 |
| | | */ |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 类型:DOM,DEM,Vector,Model |
| | | * DOM,DEM,Vector,Model |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * 服务名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 最小级别 |
| | | */ |
| | | private Integer min; |
| | | |
| | | /** |
| | | * 最大级别 |
| | | */ |
| | | private Integer max; |
| | | |
| | | /** |
| | | * EPSG编码 |
| | | */ |
| | | private Integer epsg; |
| | | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private Integer userId; |
| | | |
| | | /** |
| | | * 目录编码 |
| | | */ |
| | | private String dircode; |
| | | |
| | | /** |
| | | * 单位编码 |
| | | */ |
| | | private String depcode; |
| | | |
| | | /** |
| | | * NoData |
| | | */ |
| | | private Integer nodata; |
| | | |
| | | /** |
| | | * 拉伸方式 0:不拉伸,1 线性拉伸,2 直方图均衡,3 标准差拉伸,4 伽马拉伸 |
| | | * 0:不拉伸,1 线性拉伸,2 直方图均衡,3 标准差拉伸,4 伽马拉伸 |
| | | */ |
| | | private Integer enhanceType; |
| | | |
| | | /** |
| | | * 拉伸因子,配合 enhance_factor使用 |
| | | */ |
| | | private Double enhanceFactor; |
| | | |
| | | /** |
| | | * 输出波段,默认:"1,2,3",或为"3,2,1" |
| | | * 默认:"1,2,3",或为"3,2,1" |
| | | */ |
| | | private String tile_rgb; |
| | | |
| | | /** |
| | | * 元数据ID集合 |
| | | */ |
| | | private List<Integer> ids; |
| | | |
| | | /** |
| | | * 颜色表ID |
| | | */ |
| | | private int colorTableId; |
| | | |
| | | /** |
| | | * 颜色表 |
| | | */ |
| | | private List<ColorTableEntity> colorTable; |
| | | |
| | | /** |
| | | * 渐变颜色表 |
| | | */ |
| | | private List<GradientColorTableEntity> gradientColorTable; |
| | | |
| | | /** |
| | | * 时间戳 |
| | | */ |
| | | private String time; |
| | | |
| | | public Integer getPubid() { |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 注册类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class RegisterEntity { |
| | | public RegisterEntity() { |
| | | } |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * SDK解密数据类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class SdkDecryptDataEntity implements Serializable { |
| | | private static final long serialVersionUID = 4119527512820258035L; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * SDK解密类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class SdkDecryptEntity implements Serializable { |
| | | private static final long serialVersionUID = 853291437502721609L; |
| | | |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * SDK加密类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class SdkSecretEntity { |
| | | private int code; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Shp记录 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ShpRecordEntity implements Serializable { |
| | | private static final long serialVersionUID = -1366388818651675941L; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 表实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class TabEntity implements Serializable { |
| | | private static final long serialVersionUID = 2786394526795387464L; |
| | | |
| | |
| | | package com.moon.server.entity.ctrl; |
| | | |
| | | /** |
| | | * 表映射实体类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class TabMapperEntity { |
| | | public TabMapperEntity() { |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户更新类 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class UserUpdateEntity implements Serializable { |
| | | private static final long serialVersionUID = 8390219588267518254L; |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 分析结果 |
| | | * @author WWW |
| | | * @date 2023-09-11 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class AnalysisResultEntity implements Serializable { |
| | | private static final long serialVersionUID = -1237623414044281355L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 颜色 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ColortabEntity implements Serializable { |
| | | private static final long serialVersionUID = -861662216885789312L; |
| | | |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 坐标系 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class CoordEntity implements Serializable { |
| | | private static final long serialVersionUID = 5660360983928368364L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 字典管理 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class DictEntity implements Serializable { |
| | | private static final long serialVersionUID = -343890141066128689L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 目录 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class DirEntity implements Serializable { |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 值域 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class DomainEntity implements Serializable { |
| | | private static final long serialVersionUID = -334732819504445760L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 下载记录 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class DownloadEntity implements Serializable { |
| | | private static final long serialVersionUID = -767416271272774912L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * FME日志表 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class FmeLogEntity implements Serializable { |
| | | private static final long serialVersionUID = -1304153743551710249L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 元数据 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class MetaEntity implements Serializable { |
| | | private static final long serialVersionUID = -984838663593325184L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 元数据文件 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class MetaFileEntity implements Serializable { |
| | | private static final long serialVersionUID = -3688958480700165163L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 元数据发布类 |
| | | * @author WWW |
| | | * @date 2023-09-03 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class MetaPubEntity implements Serializable { |
| | | private static final long serialVersionUID = 161951681197440703L; |
| | | |
| | |
| | | |
| | | import com.moon.server.helper.WebHelper; |
| | | |
| | | /** |
| | | * 点实体类 |
| | | * @author WWW |
| | | * @date 2023-11-16 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class PointEntity { |
| | | private double x; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 数据发布 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class PublishEntity implements Serializable { |
| | | private static final long serialVersionUID = -386130556178340032L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 样式管理 |
| | | * @author sws |
| | | * @date 2022-09-26 |
| | | */ |
| | | |
| | | @SuppressWarnings("ALL") |
| | | public class StyleEntity implements Serializable { |
| | | private static final long serialVersionUID = 2421229801055033955L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 版本表 |
| | | * @author sws |
| | | * @date 2022-09-29 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class VerEntity implements Serializable { |
| | | private static final long serialVersionUID = 4765222572551658531L; |
| | | |
| | |
| | | import java.util.Calendar; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * CheckOutLicense |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("AlibabaUndefineMagicConstant") |
| | | @SuppressWarnings("ALL") |
| | | 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}; |
| | |
| | | |
| | | import java.util.Calendar; |
| | | |
| | | /** |
| | | * FloatServerResponse |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class FloatServerResponse { |
| | | private String modules; |
| | | |
| | |
| | | import java.net.SocketException; |
| | | import java.util.Enumeration; |
| | | |
| | | /** |
| | | * ReqParamFloatServer |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ReqParamFloatServer { |
| | | private String id; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 数据申请 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ApplyEntity implements Serializable { |
| | | private static final long serialVersionUID = -849213119060365952L; |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 在线制图 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @AllArgsConstructor |
| | | public class ExportEntity implements Serializable { |
| | | private static final long serialVersionUID = -2104359582441796685L; |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 申请流程 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class FlowEntity implements Serializable { |
| | | private static final long serialVersionUID = -267684465864526336L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 标绘 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class MarkEntity implements Serializable { |
| | | private static final long serialVersionUID = -865286612354818048L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 模型 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class ModelEntity implements Serializable { |
| | | private static final long serialVersionUID = -41778639909708240L; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | /** |
| | | * 官网一张图实体 |
| | | * |
| | | * @author xing |
| | | * @date 2023/02/20 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class OneMapEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * value |
| | | */ |
| | | @JsonIgnore |
| | | private String value; |
| | | |
| | | /** |
| | | * key |
| | | */ |
| | | @JsonIgnore |
| | | private String key; |
| | | |
| | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管道分析实体类 |
| | | * |
| | | * @author xingjinshuang@smartearth.cn |
| | | * @date 2022/12/26 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | 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() { |
| | |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 数简.颜色表实体类 |
| | | * |
| | | * @author WWW |
| | | * @date 2023-08-31 |
| | | */ |
| | | @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming") |
| | | @SuppressWarnings("ALL") |
| | | public class ColorTableEntity implements Serializable { |
| | | private static final long serialVersionUID = -7178280280689493423L; |
| | | |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 自定义方法SQL注入器 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class CustomizedSqlInjector extends DefaultSqlInjector { |
| | | /** |
| | | * 如果只需增加方法,保留mybatis plus自带方法, |
| | | * 可以先获取super.getMethodList(),再添加add |
| | | */ |
| | | @Override |
| | | public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) { |
| | | List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo); |
| | |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.SqlSource; |
| | | |
| | | /** |
| | | * 批量插入方法 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class InsertBatchMethod extends AbstractMethod { |
| | | /** |
| | | * insert into user(id, name, age) values (1, "a", 17), (2, "b", 18); |
| | | * <script> |
| | | * insert into user(id, name, age) values |
| | | * <foreach collection="list" item="item" index="index" open="(" separator="),(" close=")"> |
| | | * #{item.id}, #{item.name}, #{item.age} |
| | | * </foreach> |
| | | * </script> |
| | | */ |
| | | @Override |
| | | public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) { |
| | | final String sql = "<script>insert into %s %s values %s</script>"; |
| | |
| | | |
| | | SqlSource sqlSource = languageDriver.createSqlSource(configuration, sqlResult, modelClass); |
| | | |
| | | // 第三个参数必须和RootMapper的自定义方法名一致 |
| | | return this.addInsertMappedStatement(mapperClass, modelClass, "insertBatch", sqlSource, new NoKeyGenerator(), null, null); |
| | | } |
| | | |
| | |
| | | import org.apache.ibatis.mapping.MappedStatement; |
| | | import org.apache.ibatis.mapping.SqlSource; |
| | | |
| | | /** |
| | | * 批量更新方法 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class UpdateBatchMethod extends AbstractMethod { |
| | | /** |
| | | * update user set name = "a", age = 17 where id = 1; |
| | | * update user set name = "b", age = 18 where id = 2; |
| | | * <script> |
| | | * <foreach collection="list" item="item" separator=";"> |
| | | * update user |
| | | * <set> |
| | | * <if test="item.name != null and item.name != ''"> |
| | | * name = #{item.name,jdbcType=VARCHAR}, |
| | | * </if> |
| | | * <if test="item.age != null"> |
| | | * age = #{item.age,jdbcType=INTEGER}, |
| | | * </if> |
| | | * </set> |
| | | * where id = #{item.id,jdbcType=INTEGER} |
| | | * </foreach> |
| | | * </script> |
| | | */ |
| | | @Override |
| | | public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) { |
| | | String sql = "<script>\n<foreach collection=\"list\" item=\"item\" separator=\";\">\nupdate %s %s where %s=#{%s} %s\n</foreach>\n</script>"; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 身份认证拦截器 |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Configuration |
| | | public class AuthInterceptor implements HandlerInterceptor { |
| | | private final SysService sysService; |
| | |
| | | this.sysService = sysService; |
| | | } |
| | | |
| | | /** |
| | | * Controller执行之前执行,如果返回值是true则代表放行,返回false则拦截 |
| | | */ |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | try { |
| | | // 1.非方法 或 无需授权,无需拦截 |
| | | if (!(handler instanceof HandlerMethod) || noNeedAuth(request)) { |
| | | return true; |
| | | } |
| | | |
| | | // 2.获取令牌 |
| | | String token = WebHelper.getToken(request); |
| | | if (StringHelper.isNull(token)) { |
| | | return WebHelper.writeStr2Page(response, NO_TOKEN); |
| | | } |
| | | |
| | | // 3.获取用户 |
| | | UserEntity ue = sysService.tokenService.getUserByToken(token); |
| | | if (ue == null) { |
| | | return WebHelper.writeStr2Page(response, NO_LOGIN); |
| | | } |
| | | |
| | | // 4.获取IP |
| | | String ip = WebHelper.getIpAddress(request); |
| | | if (StringHelper.isEmpty(ip)) { |
| | | return WebHelper.writeStr2Page(response, IP_NULL); |
| | | } |
| | | |
| | | // 5.检查黑名单 |
| | | if (!checkBlackList(ip, request)) { |
| | | return WebHelper.writeStr2Page(response, BLACK_LIST); |
| | | } |
| | | |
| | | // 6.admin跳过权限检测 |
| | | if (StaticData.ADMIN.equals(ue.getUid())) { |
| | | return true; |
| | | } |
| | | |
| | | // 7.检查白名单和IP一致性 |
| | | if (!checkWhiteList(ip, request)) { |
| | | if (!checkIpSource(ip, token)) { |
| | | return WebHelper.writeStr2Page(response, ILLEGAL_TOKEN); |
| | | } |
| | | } |
| | | |
| | | // 8.检查用户ID是否禁用 |
| | | if (sysService.tokenService.isUidDisable(ue)) { |
| | | return WebHelper.writeStr2Page(response, USER_LOCK); |
| | | } |
| | | |
| | | // 9.权限校验 |
| | | if (!checkPerms(ue, request)) { |
| | | System.out.println("无权限访问:" + request.getRequestURI().toLowerCase()); |
| | | return WebHelper.writeStr2Page(response, NO_AUTH); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 无需授权 |
| | | */ |
| | | private static boolean noNeedAuth(HttpServletRequest request) { |
| | | String uri = request.getRequestURI().toLowerCase(); |
| | | for (String page : StaticData.EXCLUDE_PATH) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 检查权限 |
| | | */ |
| | | private boolean checkPerms(UserEntity ue, HttpServletRequest request) { |
| | | List<String> list = sysService.permsService.selectPerms(ue.getUid()); |
| | | if (list == null || list.size() == 0) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 检查黑名单 |
| | | */ |
| | | private boolean checkBlackList(String ip, HttpServletRequest request) { |
| | | List<String> blackList = sysService.blacklistService.selectIpList(1); |
| | | if (blackList == null || blackList.isEmpty()) { |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 检查白名单 |
| | | */ |
| | | private boolean checkWhiteList(String ip, HttpServletRequest request) { |
| | | List<String> whiteList = sysService.blacklistService.selectIpList(2); |
| | | if (whiteList == null || whiteList.isEmpty()) { |
| | |
| | | return whiteList.contains(ip); |
| | | } |
| | | |
| | | /** |
| | | * 检查IP一致性:固定令牌不检查 |
| | | */ |
| | | private boolean checkIpSource(String ip, String token) { |
| | | TokenEntity te = sysService.tokenService.getEntityByToken(token); |
| | | |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * 跨域过滤器 |
| | | * @author WWW |
| | | * @date 2022-09-27 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class CrosFilter implements Filter { |
| | | private static final String OPTIONS = "OPTIONS"; |
| | | |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 父查询Mapper |
| | | * @author WWW |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | @Mapper |
| | | @Repository |
| | | public interface BaseQueryMapper { |
| | | /** |
| | | * 模糊搜索用户 |
| | | * |
| | | * @param name 用户名 |
| | | * @return 实体类集合 |
| | | */ |
| | | public List<IdNameEntity> selectUserFuzzy(String name); |
| | | |
| | | /** |
| | | * 模糊搜索单位 |
| | | * |
| | | * @param name 单位名 |
| | | * @return 实体类集合 |
| | | */ |
| | | public List<IdNameEntity> selectDepFuzzy(String name); |
| | | |
| | | /** |
| | | * 根据表名查询记录数 |
| | | * |
| | | * @param tab 表名 |
| | | * @param typesFilter 类别 |
| | | * @param field 字段 |
| | | * @return |
| | | */ |
| | | public Integer selectTabsForCount(String tab, String typesFilter, String field); |
| | | |
| | | /** |
| | | * 根据表名分页查询 |
| | | * |
| | | * @param tab 表名 |
| | | * @param typesFilter 类别 |
| | | * @param field 字段 |
| | | * @param filters 过滤条件 |
| | | * @param limit 记录数 |
| | | * @param offset 偏移量 |
| | | * @return |
| | | */ |
| | | public List<TabEntity> selectTabsByPage(String tab, String typesFilter, String field, String filters, Integer limit, Integer offset); |
| | | |
| | | /** |
| | | * 查询字段信息 |
| | | * |
| | | * @param ns 名称空间 |
| | | * @param tab 表名 |
| | | * @return 实体类集合 |
| | | */ |
| | | public List<DictEntity> selectFields(String ns, String tab); |
| | | |
| | | /** |
| | | * 查询值域信息 |
| | | * |
| | | * @param ns 名称空间 |
| | | * @param tab 表名 |
| | | * @return 实体类集合 |
| | | */ |
| | | public List<DomainEntity> selectDomains(String ns, String tab); |
| | | |
| | | /** |
| | | * 查询路网 |
| | | * |
| | | * @param x1 X1 |
| | | * @param y1 Y1 |
| | | * @param x2 X2 |
| | | * @param y2 Y2 |
| | | * @return 多线 |
| | | */ |
| | | public String selectRoute(double x1, double y1, double x2, double y2); |
| | | |
| | | /** |
| | | * 查询位置 |
| | | * |
| | | * @param wkt WKT字符串 |
| | | * @return 位置 |
| | | */ |
| | | public List<KeyValueEntity> selectLocation(String wkt); |
| | | |
| | | /** |
| | | * 查询目录类别 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | | public List<KeyValueEntity> selectDirTypes(String name); |
| | | |
| | | /** |
| | | * 根据表名查询附件 |
| | | * |
| | | * @param tab 表名 |
| | | * @param gids Gid字符串 |
| | | * @return 附件 |
| | | */ |
| | | public List<AttachEntity> selectAnnexByTab(String tab, String gids); |
| | | } |