| | |
| | | <version>${tomcat.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- Springdoc webmvc 依赖配置 --> |
| | | <dependency> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-ui</artifactId> |
| | | <version>${springdoc.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- pagehelper 分页插件 --> |
| | | <dependency> |
| | | <groupId>com.github.pagehelper</groupId> |
| | |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringBoot Actuator --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>2.9.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.guava</groupId> |
| | | <artifactId>guava</artifactId> |
| | | <version>27.0-jre</version> |
| | | </dependency> |
| | | |
| | | <!--httpclient--> |
| | |
| | | <version>1.19.0</version> |
| | | </dependency> |
| | | |
| | | <!-- se-common --> |
| | | <!--dependency> |
| | | <groupId>com.terra</groupId> |
| | | <artifactId>se-common</artifactId> |
| | | <version>1.0.2</version> |
| | | <scope>compile</scope> |
| | | </dependency--> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.EnableAspectJAutoProxy; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author admin |
| | | */ |
| | | @EnableAsync |
| | | @EnableSwagger2 |
| | | @EnableAspectJAutoProxy(exposeProxy = true) |
| | | @SpringBootApplication(scanBasePackages = {"com.terra.system.*"}) |
| | | public class SeSystemApplication |
| | | { |
| | |
| | | argsService.initSettingData(); |
| | | |
| | | log.info("***************** 系统启动完毕 *****************" + "\n"); |
| | | log.info("API文档:http://localhost:" + serverPort + contextPath + "/swagger-ui.html"); |
| | | log.info("API文档:http://localhost:" + serverPort + "/swagger-ui.html"); |
| | | |
| | | String autoQuery = env.getProperty("sys.autoQuery"); |
| | | if (StaticData.S1.equals(autoQuery)) { |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("Spring Boot接口API") |
| | | .description("Spring Boot接口API查看") |
| | | .title("接口API") |
| | | .description("接口API") |
| | | .version("1.0").build(); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 跨域请求 |
| | | */ |
| | | @Override |
| | | /*@Override |
| | | protected void addCorsMappings(CorsRegistry registry) { |
| | | registry.addMapping("/**") |
| | | .allowCredentials(true) |
| | |
| | | .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
| | | .allowedHeaders("*") |
| | | .maxAge(3600); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 添加统一的拦截器 |
| | |
| | | public Integer updates(List<AttachEntity> list); |
| | | |
| | | /** |
| | | * 查询FME日志 |
| | | * |
| | | * @param tabs |
| | | * @return |
| | | */ |
| | | public List<FmeLogEntity> selectFmeLogs(String tabs); |
| | | |
| | | /** |
| | | * 更新FME日志 |
| | | * |
| | | * @param id ID |
| | | * @return |
| | | */ |
| | | public Integer updateFmeLog(Integer id); |
| | | |
| | | /** |
| | | * 根据元数据名称插入附件 |
| | | * |
| | | * @param tab |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<FmeLogEntity> selectFmeLogs(String tabs) { |
| | | return attachMapper.selectFmeLogs(tabs); |
| | | } |
| | | |
| | | /** |
| | | * 查询FME日志 |
| | | */ |
| | | public List<FmeLogEntity> selectFmeLogs() { |
| | | if (StringHelper.isEmpty(tabs)) { |
| | | tabs = UploadAttachService.getTabs().replace("'", ""); |
| | | } |
| | | |
| | | return attachMapper.selectFmeLogs(tabs); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateFmeLog(Integer id) { |
| | | return attachMapper.updateFmeLog(id); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertAttachByMeta(String tab, String tabGuid, String metaName, String dirid) { |
| | | return attachMapper.insertAttachByMeta(tab, tabGuid, metaName, dirid); |
| | | } |
| | |
| | | <select id="selectProject" resultType="com.terra.system.entity.data.DirEntity"> |
| | | select * from lf.sys_dir where pid = 0 and id > 1 order by order_num, code; |
| | | </select> |
| | | |
| | | <select id="selectFmeLog" resultType="com.terra.system.entity.data.FmeLogEntity"> |
| | | select * from lf.sys_fme_log where parentid = #{parentid}; |
| | | </select> |
| | | </mapper> |
| | |
| | | </foreach> |
| | | </update> |
| | | |
| | | <!-- where count > 0 and update_time is null and create_time > now()::timestamp + '-5 min' and position(tcdm in '${tabs}') > 0; --> |
| | | <select id="selectFmeLogs" resultType="com.terra.system.entity.data.FmeLogEntity"> |
| | | select * from lf.sys_fme_log |
| | | where count > 0 and update_time is null and position(tcdm in '${tabs}') > 0; |
| | | </select> |
| | | |
| | | <update id="updateFmeLog"> |
| | | update lf.sys_fme_log set update_time = now() where id = #{id}; |
| | | </update> |
| | | |
| | | <!-- and create_time > now()::timestamp + '-15 min' --> |
| | | <insert id="insertAttachByMeta"> |
| | | insert into lf.sys_attach (name, guid, path, sizes, create_user, tab, tab_guid) |