Compare commits
7 Commits
1ab0e94cfa
...
perf/fund_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c506a850c3 | ||
|
|
e22bc012c9 | ||
|
|
b598d67281 | ||
|
|
d4c3cf4870 | ||
|
|
bc4b0c9753 | ||
|
|
26474073e5 | ||
|
|
3d50ec5985 |
16
pom.xml
16
pom.xml
@@ -112,24 +112,24 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-mysql-starter</artifactId>
|
<artifactId>xmc-mysql-starter</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-cache-starter</artifactId>
|
<artifactId>xmc-cache-starter</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-common</artifactId>
|
<artifactId>xmc-common</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
<artifactId>xmc-message-starter</artifactId>
|
<artifactId>xmc-message-starter</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xiang.starter</groupId>
|
<groupId>com.xiang.starter</groupId>
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
package com.xiang.xservice.application.generator.config;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONReader;
|
|
||||||
import com.alibaba.fastjson2.JSONWriter;
|
|
||||||
import com.alibaba.fastjson2.support.config.FastJsonConfig;
|
|
||||||
import com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.converter.HttpMessageConverter;
|
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
/**
|
|
||||||
* 2019-2-11 liutf WebMvcConfig 整合 cors 和 SpringMvc MessageConverter
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class WebMvcConfig implements WebMvcConfigurer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
||||||
registry.addResourceHandler("/statics/**").addResourceLocations("classpath:/statics/");
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* FASTJSON2升级 by https://zhengkai.blog.csdn.net/
|
|
||||||
* https://blog.csdn.net/moshowgame/article/details/138013669
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
|
||||||
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
|
|
||||||
//自定义配置...
|
|
||||||
FastJsonConfig config = new FastJsonConfig();
|
|
||||||
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
|
|
||||||
// 添加更多解析特性以提高容错性
|
|
||||||
config.setReaderFeatures(
|
|
||||||
JSONReader.Feature.FieldBased,
|
|
||||||
JSONReader.Feature.SupportArrayToBean,
|
|
||||||
JSONReader.Feature.InitStringFieldAsEmpty
|
|
||||||
);
|
|
||||||
|
|
||||||
config.setWriterFeatures(
|
|
||||||
JSONWriter.Feature.WriteMapNullValue,
|
|
||||||
JSONWriter.Feature.PrettyFormat
|
|
||||||
);
|
|
||||||
|
|
||||||
converter.setFastJsonConfig(config);
|
|
||||||
converter.setDefaultCharset(StandardCharsets.UTF_8);
|
|
||||||
converter.setSupportedMediaTypes(Collections.singletonList(MediaType.APPLICATION_JSON));
|
|
||||||
converters.add(0, converter);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.xiang.xservice.application.generator.controller;
|
package com.xiang.xservice.application.generator.controller;
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
import com.xiang.xservice.application.generator.service.CodeGenService;
|
import com.xiang.xservice.application.generator.service.CodeGenService;
|
||||||
import com.xiang.xservice.basic.common.resp.Result;
|
import com.xiang.xservice.basic.common.resp.Result;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.xiang.xservice.application.generator.controller;
|
package com.xiang.xservice.application.generator.controller;
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.TemplateList;
|
import com.xiang.xservice.application.generator.entity.domain.TemplateList;
|
||||||
import com.xiang.xservice.application.generator.service.TemplateService;
|
import com.xiang.xservice.application.generator.service.TemplateService;
|
||||||
import com.xiang.xservice.basic.common.resp.Result;
|
import com.xiang.xservice.basic.common.resp.Result;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import lombok.AllArgsConstructor;
|
|||||||
* <p>
|
* <p>
|
||||||
* 忽略大小写
|
* 忽略大小写
|
||||||
**考虑增加这个类是, 如果在 StringUtils 中加工具方法, 使用起来代码非常冗长且不方便
|
**考虑增加这个类是, 如果在 StringUtils 中加工具方法, 使用起来代码非常冗长且不方便
|
||||||
* @author Nisus
|
|
||||||
* @see String
|
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class NonCaseString implements CharSequence {
|
public class NonCaseString implements CharSequence {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.dto;
|
package com.xiang.xservice.application.generator.entity.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 类信息
|
* 类信息
|
||||||
*
|
*
|
||||||
* @author zhengkai.blog.csdn.net
|
* @author xiang
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ClassInfo {
|
public class ClassInfo {
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.dto;
|
package com.xiang.xservice.application.generator.entity.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字段信息
|
* 字段信息
|
||||||
*
|
*
|
||||||
* @author zhengkai.blog.csdn.net
|
* @author xiang
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class FieldInfo {
|
public class FieldInfo {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.dto;
|
package com.xiang.xservice.application.generator.entity.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 请求参数信息
|
* 请求参数信息
|
||||||
*
|
*
|
||||||
* @author zhengkai.blog.csdn.net
|
* @author xiang
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ParamInfo {
|
public class ParamInfo {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.dto;
|
package com.xiang.xservice.application.generator.entity.domain;
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.dto;
|
package com.xiang.xservice.application.generator.entity.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统一返回结果VO
|
|
||||||
*
|
|
||||||
* @author zhengkai.blog.csdn.net
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ResultVo extends HashMap<String, Object> {
|
|
||||||
|
|
||||||
public ResultVo() {
|
|
||||||
put("code", 200);
|
|
||||||
put("msg", "success");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResultVo ok() {
|
|
||||||
return new ResultVo();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResultVo ok(Object data) {
|
|
||||||
ResultVo resultVo = new ResultVo();
|
|
||||||
resultVo.put("data", data);
|
|
||||||
return resultVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResultVo error(String msg) {
|
|
||||||
ResultVo resultVo = new ResultVo();
|
|
||||||
resultVo.put("code", 500);
|
|
||||||
resultVo.put("msg", msg);
|
|
||||||
return resultVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResultVo error(int code, String msg) {
|
|
||||||
ResultVo resultVo = new ResultVo();
|
|
||||||
resultVo.put("code", code);
|
|
||||||
resultVo.put("msg", msg);
|
|
||||||
return resultVo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResultVo put(String key, Object value) {
|
|
||||||
super.put(key, value);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.xiang.xservice.application.generator.entity.enums;
|
package com.xiang.xservice.application.generator.enums;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.xiang.xservice.application.generator.service;
|
package com.xiang.xservice.application.generator.service;
|
||||||
|
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
import com.xiang.xservice.basic.common.resp.Result;
|
import com.xiang.xservice.basic.common.resp.Result;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.xiang.xservice.application.generator.service;
|
package com.xiang.xservice.application.generator.service;
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.TemplateList;
|
import com.xiang.xservice.application.generator.entity.domain.TemplateList;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.xiang.xservice.application.generator.service.impl;
|
package com.xiang.xservice.application.generator.service.impl;
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ClassInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ClassInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.TemplateList;
|
import com.xiang.xservice.application.generator.entity.domain.TemplateList;
|
||||||
import com.xiang.xservice.application.generator.entity.enums.ParserTypeEnum;
|
import com.xiang.xservice.application.generator.enums.ParserTypeEnum;
|
||||||
import com.xiang.xservice.application.generator.service.CodeGenService;
|
import com.xiang.xservice.application.generator.service.CodeGenService;
|
||||||
import com.xiang.xservice.application.generator.service.TemplateService;
|
import com.xiang.xservice.application.generator.service.TemplateService;
|
||||||
import com.xiang.xservice.application.generator.service.parser.JsonParserService;
|
import com.xiang.xservice.application.generator.service.parser.JsonParserService;
|
||||||
@@ -50,7 +50,6 @@ public class CodeGenServiceImpl implements CodeGenService {
|
|||||||
// 3. generate the code by freemarker templates with parameters .
|
// 3. generate the code by freemarker templates with parameters .
|
||||||
// Freemarker根据参数和模板生成代码
|
// Freemarker根据参数和模板生成代码
|
||||||
Map<String, String> result = getResultByParams(paramInfo.getOptions());
|
Map<String, String> result = getResultByParams(paramInfo.getOptions());
|
||||||
log.info("table:{} - time:{} ", MapUtil.getString(result, "tableName"), System.currentTimeMillis());
|
|
||||||
return Result.success(result);
|
return Result.success(result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("代码生成失败", e);
|
log.error("代码生成失败", e);
|
||||||
@@ -67,10 +66,10 @@ public class CodeGenServiceImpl implements CodeGenService {
|
|||||||
// 解析模板配置并生成代码
|
// 解析模板配置并生成代码
|
||||||
List<TemplateList> parentTemplates = templateService.getAllTemplates();
|
List<TemplateList> parentTemplates = templateService.getAllTemplates();
|
||||||
for (TemplateList parentTemplateObj : parentTemplates) {
|
for (TemplateList parentTemplateObj : parentTemplates) {
|
||||||
List<com.xiang.xservice.application.generator.entity.dto.Template> childTemplates = parentTemplateObj.getTemplates();
|
List<com.xiang.xservice.application.generator.entity.domain.Template> childTemplates = parentTemplateObj.getTemplates();
|
||||||
if (childTemplates != null) {
|
if (childTemplates != null) {
|
||||||
for (int x = 0; x < childTemplates.size(); x++) {
|
for (int x = 0; x < childTemplates.size(); x++) {
|
||||||
com.xiang.xservice.application.generator.entity.dto.Template childTemplate = childTemplates.get(x);
|
com.xiang.xservice.application.generator.entity.domain.Template childTemplate = childTemplates.get(x);
|
||||||
String templatePath = parentTemplateObj.getGroup() + "/" + childTemplate.getName() + ".ftl";
|
String templatePath = parentTemplateObj.getGroup() + "/" + childTemplate.getName() + ".ftl";
|
||||||
String generatedCode = FreemarkerUtil.processString(templatePath, params);
|
String generatedCode = FreemarkerUtil.processString(templatePath, params);
|
||||||
result.put(childTemplate.getName(), generatedCode);
|
result.put(childTemplate.getName(), generatedCode);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.xiang.xservice.application.generator.service.impl;
|
package com.xiang.xservice.application.generator.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.TemplateList;
|
import com.xiang.xservice.application.generator.entity.domain.TemplateList;
|
||||||
import com.xiang.xservice.application.generator.service.TemplateService;
|
import com.xiang.xservice.application.generator.service.TemplateService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package com.xiang.xservice.application.generator.service.impl.parser;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ClassInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ClassInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.FieldInfo;
|
import com.xiang.xservice.application.generator.entity.domain.FieldInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
import com.xiang.xservice.application.generator.service.parser.JsonParserService;
|
import com.xiang.xservice.application.generator.service.parser.JsonParserService;
|
||||||
import com.xiang.xservice.basic.exception.BusinessException;
|
import com.xiang.xservice.basic.exception.BusinessException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.xiang.xservice.application.generator.service.impl.parser;
|
package com.xiang.xservice.application.generator.service.impl.parser;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ClassInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ClassInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.FieldInfo;
|
import com.xiang.xservice.application.generator.entity.domain.FieldInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
import com.xiang.xservice.application.generator.service.parser.SqlParserService;
|
import com.xiang.xservice.application.generator.service.parser.SqlParserService;
|
||||||
import com.xiang.xservice.application.generator.util.MapUtil;
|
import com.xiang.xservice.application.generator.util.MapUtil;
|
||||||
import com.xiang.xservice.application.generator.util.StringUtilsPlus;
|
import com.xiang.xservice.application.generator.util.StringUtilsPlus;
|
||||||
import com.xiang.xservice.application.generator.util.mysqlJavaTypeUtil;
|
import com.xiang.xservice.application.generator.util.Mysql2JavaTypeUtil;
|
||||||
import com.xiang.xservice.basic.exception.BusinessException;
|
import com.xiang.xservice.basic.exception.BusinessException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.jsqlparser.parser.CCJSqlParserManager;
|
import net.sf.jsqlparser.parser.CCJSqlParserManager;
|
||||||
@@ -219,7 +219,7 @@ public class SqlParserServiceImpl implements SqlParserService {
|
|||||||
}
|
}
|
||||||
String originTableName = tableName;
|
String originTableName = tableName;
|
||||||
//ignore prefix
|
//ignore prefix
|
||||||
if(tableName!=null && StringUtilsPlus.isNotNull(MapUtil.getString(paramInfo.getOptions(),"ignorePrefix"))){
|
if(tableName!=null && StringUtils.isNotBlank(MapUtil.getString(paramInfo.getOptions(),"ignorePrefix"))){
|
||||||
tableName = tableName.replaceAll(MapUtil.getString(paramInfo.getOptions(),"ignorePrefix"),"");
|
tableName = tableName.replaceAll(MapUtil.getString(paramInfo.getOptions(),"ignorePrefix"),"");
|
||||||
}
|
}
|
||||||
// class Name
|
// class Name
|
||||||
@@ -361,8 +361,8 @@ public class SqlParserServiceImpl implements SqlParserService {
|
|||||||
}
|
}
|
||||||
//swagger class
|
//swagger class
|
||||||
String swaggerClass = "string" ;
|
String swaggerClass = "string" ;
|
||||||
if(mysqlJavaTypeUtil.getMysqlSwaggerTypeMap().containsKey(mysqlType)){
|
if(Mysql2JavaTypeUtil.getMysqlSwaggerTypeMap().containsKey(mysqlType)){
|
||||||
swaggerClass = mysqlJavaTypeUtil.getMysqlSwaggerTypeMap().get(mysqlType);
|
swaggerClass = Mysql2JavaTypeUtil.getMysqlSwaggerTypeMap().get(mysqlType);
|
||||||
}
|
}
|
||||||
// field class
|
// field class
|
||||||
// int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
// int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||||
@@ -371,8 +371,8 @@ public class SqlParserServiceImpl implements SqlParserService {
|
|||||||
//2018-11-22 lshz0088 处理字段类型的时候,不严谨columnLine.contains(" int") 类似这种的,可在前后适当加一些空格之类的加以区分,否则当我的字段包含这些字符的时候,产生类型判断问题。
|
//2018-11-22 lshz0088 处理字段类型的时候,不严谨columnLine.contains(" int") 类似这种的,可在前后适当加一些空格之类的加以区分,否则当我的字段包含这些字符的时候,产生类型判断问题。
|
||||||
//2020-05-03 MOSHOW.K.ZHENG 优化对所有类型的处理
|
//2020-05-03 MOSHOW.K.ZHENG 优化对所有类型的处理
|
||||||
//2020-10-20 zhengkai 新增包装类型的转换选择
|
//2020-10-20 zhengkai 新增包装类型的转换选择
|
||||||
if(mysqlJavaTypeUtil.getMysqlJavaTypeMap().containsKey(mysqlType)){
|
if(Mysql2JavaTypeUtil.getMysqlJavaTypeMap().containsKey(mysqlType)){
|
||||||
fieldClass = mysqlJavaTypeUtil.getMysqlJavaTypeMap().get(mysqlType);
|
fieldClass = Mysql2JavaTypeUtil.getMysqlJavaTypeMap().get(mysqlType);
|
||||||
}
|
}
|
||||||
// field comment,MySQL的一般位于field行,而pgsql和oralce多位于后面。
|
// field comment,MySQL的一般位于field行,而pgsql和oralce多位于后面。
|
||||||
String fieldComment = null;
|
String fieldComment = null;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.xiang.xservice.application.generator.service.parser;
|
package com.xiang.xservice.application.generator.service.parser;
|
||||||
|
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ClassInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ClassInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON解析服务接口
|
* JSON解析服务接口
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.xiang.xservice.application.generator.service.parser;
|
package com.xiang.xservice.application.generator.service.parser;
|
||||||
|
|
||||||
|
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ClassInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ClassInfo;
|
||||||
import com.xiang.xservice.application.generator.entity.dto.ParamInfo;
|
import com.xiang.xservice.application.generator.entity.domain.ParamInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SQL解析服务接口
|
* SQL解析服务接口
|
||||||
|
|||||||
@@ -1,45 +1,19 @@
|
|||||||
|
|
||||||
package com.xiang.xservice.application.generator.util;
|
package com.xiang.xservice.application.generator.util;
|
||||||
|
|
||||||
|
import joptsimple.internal.Strings;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class MapUtil {
|
public class MapUtil {
|
||||||
public static String getString(Map map, String key) {
|
public static String getString(Map<String, Object> map, String key) {
|
||||||
if (map != null && map.containsKey(key)) {
|
if (map != null && map.containsKey(key)) {
|
||||||
try {
|
try {
|
||||||
return map.get(key).toString();
|
return map.get(key).toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
return Strings.EMPTY;
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Integer getInteger(Map map, String key) {
|
|
||||||
if (map != null && map.containsKey(key)) {
|
|
||||||
try {
|
|
||||||
return Integer.valueOf(map.get(key).toString());
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Boolean getBoolean(Map map, String key) {
|
|
||||||
if (map != null && map.containsKey(key)) {
|
|
||||||
try {
|
|
||||||
return Boolean.parseBoolean(map.get(key).toString()) || "true".equals(map.get(key).toString());
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return Strings.EMPTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.xiang.xservice.application.generator.util;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public final class mysqlJavaTypeUtil {
|
public final class Mysql2JavaTypeUtil {
|
||||||
public static final HashMap<String, String> mysqlJavaTypeMap = new HashMap<String, String>();
|
public static final HashMap<String, String> mysqlJavaTypeMap = new HashMap<String, String>();
|
||||||
public static final HashMap<String, String> mysqlSwaggerTypeMap = new HashMap<String, String>();
|
public static final HashMap<String, String> mysqlSwaggerTypeMap = new HashMap<String, String>();
|
||||||
|
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
package com.xiang.xservice.application.generator.util;
|
package com.xiang.xservice.application.generator.util;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
public class StringUtilsPlus {
|
public class StringUtilsPlus {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首字母大写
|
* 首字母大写
|
||||||
*
|
*
|
||||||
* @param str
|
* @param str 字符串
|
||||||
*
|
*
|
||||||
* @return
|
* @return 首字母大写
|
||||||
*/
|
*/
|
||||||
public static String upperCaseFirst(String str) {
|
public static String upperCaseFirst(String str) {
|
||||||
if (str == null || str.trim().isEmpty()) {
|
if (str == null || str.trim().isEmpty()) {
|
||||||
@@ -19,25 +21,24 @@ public class StringUtilsPlus {
|
|||||||
/**
|
/**
|
||||||
* 首字母小写
|
* 首字母小写
|
||||||
*
|
*
|
||||||
* @param str
|
* @param str 字符串
|
||||||
*
|
*
|
||||||
* @return
|
* @return 首字母小写
|
||||||
*/
|
*/
|
||||||
public static String lowerCaseFirst(String str) {
|
public static String lowerCaseFirst(String str) {
|
||||||
//2019-2-10 解决StringUtils.lowerCaseFirst潜在的NPE异常@liutf
|
|
||||||
return (str != null && str.length() > 1) ? str.substring(0, 1).toLowerCase() + str.substring(1) : "";
|
return (str != null && str.length() > 1) ? str.substring(0, 1).toLowerCase() + str.substring(1) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下划线,转换为驼峰式
|
* 下划线,转换为驼峰式
|
||||||
*
|
*
|
||||||
* @param underscoreName
|
* @param underscoreName 下划线字符串
|
||||||
*
|
*
|
||||||
* @return
|
* @return 驼峰式
|
||||||
*/
|
*/
|
||||||
public static String underlineToCamelCase(String underscoreName) {
|
public static String underlineToCamelCase(String underscoreName) {
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
if (underscoreName != null && underscoreName.trim().length() > 0) {
|
if (StringUtils.isNotBlank(underscoreName)) {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
for (int i = 0; i < underscoreName.length(); i++) {
|
for (int i = 0; i < underscoreName.length(); i++) {
|
||||||
char ch = underscoreName.charAt(i);
|
char ch = underscoreName.charAt(i);
|
||||||
@@ -58,8 +59,6 @@ public class StringUtilsPlus {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 转 user_name 风格
|
* 转 user_name 风格
|
||||||
* <p>
|
|
||||||
* 不管原始是什么风格
|
|
||||||
*/
|
*/
|
||||||
public static String toUnderline(String str, boolean upperCase) {
|
public static String toUnderline(String str, boolean upperCase) {
|
||||||
if (str == null || str.trim().isEmpty()) {
|
if (str == null || str.trim().isEmpty()) {
|
||||||
@@ -91,7 +90,8 @@ public class StringUtilsPlus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* any str ==> lowerCamel
|
* 任何字符串 转驼峰
|
||||||
|
* @param str 任何字符串
|
||||||
*/
|
*/
|
||||||
public static String toLowerCamel(String str) {
|
public static String toLowerCamel(String str) {
|
||||||
if (str == null || str.trim().isEmpty()) {
|
if (str == null || str.trim().isEmpty()) {
|
||||||
@@ -122,9 +122,4 @@ public class StringUtilsPlus {
|
|||||||
|
|
||||||
return lowerCaseFirst(result.toString());
|
return lowerCaseFirst(result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNotNull(String str) {
|
|
||||||
return org.apache.commons.lang3.StringUtils.isNotEmpty(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.xiang.xservice.application.script.domain.service;
|
|
||||||
|
|
||||||
import com.xiang.xmc.service.message.dingTalk.service.DingTalkService;
|
|
||||||
import com.xiang.xservice.config.DingTalkRobotScriptConfig;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: xiang
|
|
||||||
* @Date: 2025-08-07 10:30
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DingTalkScriptDomainService {
|
|
||||||
|
|
||||||
private final DingTalkService dingTalkService;
|
|
||||||
private final DingTalkRobotScriptConfig dingTalkRobotScriptConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送脚本消息
|
|
||||||
* @param msg 消息
|
|
||||||
*/
|
|
||||||
public void sendScriptMsg(String msg) {
|
|
||||||
try {
|
|
||||||
dingTalkService.sendRobotMessage(dingTalkRobotScriptConfig.getSecret(), dingTalkRobotScriptConfig.getToken(),
|
|
||||||
dingTalkRobotScriptConfig.getUsers(), msg);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("信息发送异常, 信息:{}", msg, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,6 +9,7 @@ import com.aliyun.alidns20150109.models.DescribeSubDomainRecordsResponseBody;
|
|||||||
import com.aliyun.alidns20150109.models.UpdateDomainRecordRequest;
|
import com.aliyun.alidns20150109.models.UpdateDomainRecordRequest;
|
||||||
import com.aliyun.teaopenapi.models.Config;
|
import com.aliyun.teaopenapi.models.Config;
|
||||||
import com.xiang.xservice.application.script.domain.config.AliyunDnsPropertyConfig;
|
import com.xiang.xservice.application.script.domain.config.AliyunDnsPropertyConfig;
|
||||||
|
import com.xiang.xservice.common.service.dingTalk.ScriptDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -36,7 +37,7 @@ public class IDomainServiceImpl implements IDomainService {
|
|||||||
private final AliyunDnsPropertyConfig aliyunDnsPropertyConfig;
|
private final AliyunDnsPropertyConfig aliyunDnsPropertyConfig;
|
||||||
private static final String TYPE = "A";
|
private static final String TYPE = "A";
|
||||||
|
|
||||||
private final DingTalkScriptDomainService dingTalkService;
|
private final ScriptDingTalkFactory dingTalkService;
|
||||||
@Override
|
@Override
|
||||||
public void dynamicDomainAnalysis(String publicIp) throws Exception {
|
public void dynamicDomainAnalysis(String publicIp) throws Exception {
|
||||||
Client client = createClient();
|
Client client = createClient();
|
||||||
@@ -53,14 +54,14 @@ public class IDomainServiceImpl implements IDomainService {
|
|||||||
if (records.isEmpty()) {
|
if (records.isEmpty()) {
|
||||||
log.info("未找到记录,添加记录..., ip:{}", publicIp);
|
log.info("未找到记录,添加记录..., ip:{}", publicIp);
|
||||||
addDnsRecord(client, publicIp, rr);
|
addDnsRecord(client, publicIp, rr);
|
||||||
dingTalkService.sendScriptMsg("动态解析公网ip成功,域名:" + rr + "." + DOMAIN_NAME + ", 新ip:" + publicIp);
|
dingTalkService.sendMsg("动态解析公网ip成功,域名:" + rr + "." + DOMAIN_NAME + ", 新ip:" + publicIp);
|
||||||
} else {
|
} else {
|
||||||
String recordId = records.get(0).getRecordId();
|
String recordId = records.get(0).getRecordId();
|
||||||
String currentValue = records.get(0).getValue();
|
String currentValue = records.get(0).getValue();
|
||||||
if (!publicIp.equals(currentValue)) {
|
if (!publicIp.equals(currentValue)) {
|
||||||
log.info("IP变更,更新记录...,ip:{}", publicIp);
|
log.info("IP变更,更新记录...,ip:{}", publicIp);
|
||||||
updateDnsRecord(client, recordId, publicIp, rr);
|
updateDnsRecord(client, recordId, publicIp, rr);
|
||||||
dingTalkService.sendScriptMsg("动态解析公网ip成功,域名:" + rr + "." + DOMAIN_NAME + ", 新ip:" + publicIp);
|
dingTalkService.sendMsg("动态解析公网ip成功,域名:" + rr + "." + DOMAIN_NAME + ", 新ip:" + publicIp);
|
||||||
} else {
|
} else {
|
||||||
log.info("ip未变更,无需修改,ip:{}", publicIp);
|
log.info("ip未变更,无需修改,ip:{}", publicIp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import com.xiang.xservice.application.script.fwd.mapper.FwdAudienceConfigMapper;
|
|||||||
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformConfigMapper;
|
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformConfigMapper;
|
||||||
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformProjectInfoMapper;
|
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformProjectInfoMapper;
|
||||||
import com.xiang.xservice.application.script.fwd.mapper.FwdUserConfigMapper;
|
import com.xiang.xservice.application.script.fwd.mapper.FwdUserConfigMapper;
|
||||||
import com.xiang.xservice.application.script.fwd.service.DingTalkScriptFWDService;
|
|
||||||
import com.xiang.xservice.application.script.fwd.service.IPerformService;
|
import com.xiang.xservice.application.script.fwd.service.IPerformService;
|
||||||
import com.xiang.xservice.application.script.fwd.service.IPerformServiceHttp;
|
import com.xiang.xservice.application.script.fwd.service.IPerformServiceHttp;
|
||||||
import com.xiang.xservice.application.script.fwd.utils.TimeSyncUtils;
|
import com.xiang.xservice.application.script.fwd.utils.TimeSyncUtils;
|
||||||
@@ -31,6 +30,7 @@ import com.xiang.xservice.basic.utils.DateUtils;
|
|||||||
import com.xiang.xservice.basic.utils.PrimaryKeyUtils;
|
import com.xiang.xservice.basic.utils.PrimaryKeyUtils;
|
||||||
import com.xiang.xservice.common.entity.SysConfigDO;
|
import com.xiang.xservice.common.entity.SysConfigDO;
|
||||||
import com.xiang.xservice.common.mapper.SysConfigMapper;
|
import com.xiang.xservice.common.mapper.SysConfigMapper;
|
||||||
|
import com.xiang.xservice.common.service.dingTalk.ScriptDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -66,7 +66,7 @@ public class FwdImportantMsgJob {
|
|||||||
private final FwdPerformProjectInfoMapper performProjectInfoMapper;
|
private final FwdPerformProjectInfoMapper performProjectInfoMapper;
|
||||||
private final FwdPerformConfigMapper performConfigMapper;
|
private final FwdPerformConfigMapper performConfigMapper;
|
||||||
private final DynamicTaskScheduler dynamicTaskScheduler;
|
private final DynamicTaskScheduler dynamicTaskScheduler;
|
||||||
private final DingTalkScriptFWDService dingTalkScriptFWDService;
|
private final ScriptDingTalkFactory dingTalkScriptFWDService;
|
||||||
private final FwdUserConfigMapper fwdUserConfigMapper;
|
private final FwdUserConfigMapper fwdUserConfigMapper;
|
||||||
private final FwdAudienceConfigMapper fwdAudienceConfigMapper;
|
private final FwdAudienceConfigMapper fwdAudienceConfigMapper;
|
||||||
private final IPerformService iPerformService;
|
private final IPerformService iPerformService;
|
||||||
@@ -149,7 +149,7 @@ public class FwdImportantMsgJob {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg.append("请注意进行数据库配置的更改!");
|
msg.append("请注意进行数据库配置的更改!");
|
||||||
dingTalkScriptFWDService.sendScriptMsg(msg.toString());
|
dingTalkScriptFWDService.sendMsg(msg.toString());
|
||||||
log.info("【芬玩岛】演唱会预售定时任务结束!time:{}", System.currentTimeMillis());
|
log.info("【芬玩岛】演唱会预售定时任务结束!time:{}", System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ public class FwdImportantMsgJob {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dingTalkScriptFWDService.sendScriptMsg(msg.toString());
|
dingTalkScriptFWDService.sendMsg(msg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void savaTask(FPerformProjectInfo data, long taskId, Map<String, Object> params) {
|
private void savaTask(FPerformProjectInfo data, long taskId, Map<String, Object> params) {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.xiang.xservice.application.script.fwd.server;
|
package com.xiang.xservice.application.script.fwd.server;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.xiang.xservice.basic.common.resp.Result;
|
|
||||||
import com.xiang.xservice.application.script.fwd.service.DingTalkScriptFWDService;
|
|
||||||
import com.xiang.xservice.application.script.fwd.service.IPerformService;
|
import com.xiang.xservice.application.script.fwd.service.IPerformService;
|
||||||
|
import com.xiang.xservice.basic.common.resp.Result;
|
||||||
|
import com.xiang.xservice.common.service.dingTalk.ScriptDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -24,7 +24,7 @@ import java.util.Map;
|
|||||||
public class FwdUserController {
|
public class FwdUserController {
|
||||||
|
|
||||||
private final IPerformService performService;
|
private final IPerformService performService;
|
||||||
private final DingTalkScriptFWDService dingTalkService;
|
private final ScriptDingTalkFactory dingTalkService;
|
||||||
|
|
||||||
@GetMapping("/token")
|
@GetMapping("/token")
|
||||||
public Result<Void> updateUserTokenFromHttpProxy(@RequestParam Map<String, String> params) {
|
public Result<Void> updateUserTokenFromHttpProxy(@RequestParam Map<String, String> params) {
|
||||||
@@ -35,7 +35,7 @@ public class FwdUserController {
|
|||||||
if (b) {
|
if (b) {
|
||||||
String msg = "用户:" + name + "的token更新成功!";
|
String msg = "用户:" + name + "的token更新成功!";
|
||||||
try {
|
try {
|
||||||
dingTalkService.sendScriptMsg(msg);
|
dingTalkService.sendMsg(msg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("消息发送失败", e);
|
log.error("消息发送失败", e);
|
||||||
return Result.error("消息发送失败");
|
return Result.error("消息发送失败");
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
package com.xiang.xservice.application.script.fwd.service;
|
|
||||||
|
|
||||||
import com.xiang.xmc.service.message.dingTalk.service.DingTalkService;
|
|
||||||
import com.xiang.xservice.config.DingTalkRobotScriptConfig;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: xiang
|
|
||||||
* @Date: 2025-08-07 10:30
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DingTalkScriptFWDService {
|
|
||||||
|
|
||||||
private final DingTalkService dingTalkService;
|
|
||||||
private final DingTalkRobotScriptConfig dingTalkRobotConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送脚本消息
|
|
||||||
* @param msg 消息
|
|
||||||
*/
|
|
||||||
public void sendScriptMsg(String msg) {
|
|
||||||
try {
|
|
||||||
dingTalkService.sendRobotMessage(dingTalkRobotConfig.getSecret(), dingTalkRobotConfig.getToken(), dingTalkRobotConfig.getUsers(), msg);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("信息发送异常, 信息:{}", msg, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,10 +13,10 @@ import com.xiang.xservice.application.script.fwd.mapper.FwdPerformConfigMapper;
|
|||||||
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformProjectInfoMapper;
|
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformProjectInfoMapper;
|
||||||
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformSeatInfoMapper;
|
import com.xiang.xservice.application.script.fwd.mapper.FwdPerformSeatInfoMapper;
|
||||||
import com.xiang.xservice.application.script.fwd.mapper.FwdUserConfigMapper;
|
import com.xiang.xservice.application.script.fwd.mapper.FwdUserConfigMapper;
|
||||||
import com.xiang.xservice.application.script.fwd.service.DingTalkScriptFWDService;
|
|
||||||
import com.xiang.xservice.application.script.fwd.service.IPerformService;
|
import com.xiang.xservice.application.script.fwd.service.IPerformService;
|
||||||
import com.xiang.xservice.application.script.fwd.service.IPerformServiceHttp;
|
import com.xiang.xservice.application.script.fwd.service.IPerformServiceHttp;
|
||||||
import com.xiang.xservice.basic.config.MyThreadFactory;
|
import com.xiang.xservice.basic.config.MyThreadFactory;
|
||||||
|
import com.xiang.xservice.common.service.dingTalk.ScriptDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@@ -51,7 +51,7 @@ public class PerformServiceImpl implements IPerformService {
|
|||||||
private final FwdPerformProjectInfoMapper fwdPerformProjectInfoMapper;
|
private final FwdPerformProjectInfoMapper fwdPerformProjectInfoMapper;
|
||||||
private final FwdPerformConfigMapper fwdPerformConfigMapper;
|
private final FwdPerformConfigMapper fwdPerformConfigMapper;
|
||||||
private final IPerformServiceHttp performServiceHttp;
|
private final IPerformServiceHttp performServiceHttp;
|
||||||
private final DingTalkScriptFWDService dingTalkService;
|
private final ScriptDingTalkFactory dingTalkService;
|
||||||
private final FwdUserConfigMapper fwdUserConfigMapper;
|
private final FwdUserConfigMapper fwdUserConfigMapper;
|
||||||
private final HttpRequestHelper httpRequestHelper;
|
private final HttpRequestHelper httpRequestHelper;
|
||||||
private final ExecutorService es =
|
private final ExecutorService es =
|
||||||
@@ -121,12 +121,12 @@ public class PerformServiceImpl implements IPerformService {
|
|||||||
if (Objects.nonNull(projectOrder)) {
|
if (Objects.nonNull(projectOrder)) {
|
||||||
log.info("下单成功,订单信息:{}", JSONObject.toJSONString(projectOrder));
|
log.info("下单成功,订单信息:{}", JSONObject.toJSONString(projectOrder));
|
||||||
String msg = "【芬玩岛】下单成功✅✅✅,演出名称:" + performByProjectId.getProjectName() + ",请在5分钟内完成付款!订单号:" + projectOrder.getOrderNo();
|
String msg = "【芬玩岛】下单成功✅✅✅,演出名称:" + performByProjectId.getProjectName() + ",请在5分钟内完成付款!订单号:" + projectOrder.getOrderNo();
|
||||||
dingTalkService.sendScriptMsg(msg);
|
dingTalkService.sendMsg(msg);
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dingTalkService.sendScriptMsg("【芬玩岛】下单失败❌❌❌,演出名称:" + performByProjectId.getProjectName());
|
dingTalkService.sendMsg("【芬玩岛】下单失败❌❌❌,演出名称:" + performByProjectId.getProjectName());
|
||||||
return Boolean.FALSE;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.xiang.xservice.application.script.glados.service;
|
|
||||||
|
|
||||||
import com.xiang.xmc.service.message.dingTalk.service.DingTalkService;
|
|
||||||
import com.xiang.xservice.config.DingTalkRobotScriptConfig;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: xiang
|
|
||||||
* @Date: 2025-08-07 10:30
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class DingTalkScriptGladosService {
|
|
||||||
|
|
||||||
private final DingTalkService dingTalkService;
|
|
||||||
private final DingTalkRobotScriptConfig dingTalkRobotScriptConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送脚本消息
|
|
||||||
* @param msg 消息
|
|
||||||
*/
|
|
||||||
public void sendScriptMsg(String msg) {
|
|
||||||
try {
|
|
||||||
dingTalkService.sendRobotMessage(dingTalkRobotScriptConfig.getSecret(), dingTalkRobotScriptConfig.getToken(),
|
|
||||||
dingTalkRobotScriptConfig.getUsers(), msg);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("信息发送异常, 信息:{}", msg, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,6 +13,7 @@ import com.xiang.xservice.application.script.glados.entity.resp.GLaDOSResponse;
|
|||||||
import com.xiang.xservice.application.script.glados.repository.GladosMapper;
|
import com.xiang.xservice.application.script.glados.repository.GladosMapper;
|
||||||
import com.xiang.xservice.application.script.xb.entity.pojo.User;
|
import com.xiang.xservice.application.script.xb.entity.pojo.User;
|
||||||
import com.xiang.xservice.basic.utils.HttpUtils;
|
import com.xiang.xservice.basic.utils.HttpUtils;
|
||||||
|
import com.xiang.xservice.common.service.dingTalk.ScriptDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -35,7 +36,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
|
|
||||||
private final GladosMapper gladosMapper;
|
private final GladosMapper gladosMapper;
|
||||||
|
|
||||||
private final DingTalkScriptGladosService dingTalkService;
|
private final ScriptDingTalkFactory dingTalkService;
|
||||||
|
|
||||||
private final BaseHttpHelp httpHelp = HttpHelperFactory.createSimpleHttp();
|
private final BaseHttpHelp httpHelp = HttpHelperFactory.createSimpleHttp();
|
||||||
|
|
||||||
@@ -119,7 +120,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
// 成功请求
|
// 成功请求
|
||||||
if (Objects.nonNull(gLaDOSResponse.getPoints()) && 0 != gLaDOSResponse.getPoints()) {
|
if (Objects.nonNull(gLaDOSResponse.getPoints()) && 0 != gLaDOSResponse.getPoints()) {
|
||||||
// 签到成功
|
// 签到成功
|
||||||
dingTalkService.sendScriptMsg("[时间:" + LocalDateTime.now() + "] 用户: " +
|
dingTalkService.sendMsg("[时间:" + LocalDateTime.now() + "] 用户: " +
|
||||||
user.getEmail() + "签到成功,获得积分:" + gLaDOSResponse.getPoints());
|
user.getEmail() + "签到成功,获得积分:" + gLaDOSResponse.getPoints());
|
||||||
GladosRunLog build = GladosRunLog.builder().time(LocalDateTime.now()).status(1).code(Integer.valueOf(gLaDOSResponse.getCode().toString())).response(response).user(user.getEmail()).userId(user.getId()).build();
|
GladosRunLog build = GladosRunLog.builder().time(LocalDateTime.now()).status(1).code(Integer.valueOf(gLaDOSResponse.getCode().toString())).response(response).user(user.getEmail()).userId(user.getId()).build();
|
||||||
gladosMapper.insertScriptRunLog(build);
|
gladosMapper.insertScriptRunLog(build);
|
||||||
@@ -129,7 +130,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
|
|
||||||
if (gLaDOSResponse.getMessage().contains("Repeats")) {
|
if (gLaDOSResponse.getMessage().contains("Repeats")) {
|
||||||
if (!CollectionUtils.isEmpty(gLaDOSResponse.getList())) {
|
if (!CollectionUtils.isEmpty(gLaDOSResponse.getList())) {
|
||||||
dingTalkService.sendScriptMsg("用户:" + user.getEmail() + "当前已签到。结果:" + gLaDOSResponse.getList().get(0));
|
dingTalkService.sendMsg("用户:" + user.getEmail() + "当前已签到。结果:" + gLaDOSResponse.getList().get(0));
|
||||||
GladosRunLog build = GladosRunLog.builder().time(LocalDateTime.now()).status(1).code(Integer.valueOf(gLaDOSResponse.getCode().toString())).response(response).user(user.getEmail()).userId(user.getId()).build();
|
GladosRunLog build = GladosRunLog.builder().time(LocalDateTime.now()).status(1).code(Integer.valueOf(gLaDOSResponse.getCode().toString())).response(response).user(user.getEmail()).userId(user.getId()).build();
|
||||||
gladosMapper.insertScriptRunLog(build);
|
gladosMapper.insertScriptRunLog(build);
|
||||||
return true;
|
return true;
|
||||||
@@ -140,7 +141,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
log.warn("签到失败,用户:{}, cookie过期:{}", user.getEmail(), gLaDOSResponse.getMessage());
|
log.warn("签到失败,用户:{}, cookie过期:{}", user.getEmail(), gLaDOSResponse.getMessage());
|
||||||
String message = "[时间:" + LocalDateTime.now() + "] 用户: " + user.getEmail() + ",签到消息: " + gLaDOSResponse.getMessage() + "手动请求:http://general.xiangtech.xyz:30026/system/glados/checkIn";
|
String message = "[时间:" + LocalDateTime.now() + "] 用户: " + user.getEmail() + ",签到消息: " + gLaDOSResponse.getMessage() + "手动请求:http://general.xiangtech.xyz:30026/system/glados/checkIn";
|
||||||
try {
|
try {
|
||||||
dingTalkService.sendScriptMsg(message);
|
dingTalkService.sendMsg(message);
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("发送钉钉消息失败", e);
|
log.error("发送钉钉消息失败", e);
|
||||||
@@ -148,7 +149,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 请求异常
|
// 请求异常
|
||||||
dingTalkService.sendScriptMsg("用户:" + user.getEmail() + "请求异常,响应结果:" + gLaDOSResponse.getMessage());
|
dingTalkService.sendMsg("用户:" + user.getEmail() + "请求异常,响应结果:" + gLaDOSResponse.getMessage());
|
||||||
GladosRunLog build = GladosRunLog.builder().time(LocalDateTime.now()).status(0).code(Integer.valueOf(gLaDOSResponse.getCode().toString())).response(response).user(user.getEmail()).userId(user.getId()).build();
|
GladosRunLog build = GladosRunLog.builder().time(LocalDateTime.now()).status(0).code(Integer.valueOf(gLaDOSResponse.getCode().toString())).response(response).user(user.getEmail()).userId(user.getId()).build();
|
||||||
gladosMapper.insertScriptRunLog(build);
|
gladosMapper.insertScriptRunLog(build);
|
||||||
return false;
|
return false;
|
||||||
@@ -179,7 +180,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
log.info("签到成功, 签到积分:{}, 签到消息:{}", gLaDOSResponse.getPoints(), gLaDOSResponse.getMessage());
|
log.info("签到成功, 签到积分:{}, 签到消息:{}", gLaDOSResponse.getPoints(), gLaDOSResponse.getMessage());
|
||||||
sb.append(user.getEmail()).append("签到成功,获得积分:").append(gLaDOSResponse.getPoints()).append("\n");
|
sb.append(user.getEmail()).append("签到成功,获得积分:").append(gLaDOSResponse.getPoints()).append("\n");
|
||||||
try {
|
try {
|
||||||
dingTalkService.sendScriptMsg("[时间:" + LocalDateTime.now() + "] 用户: " +
|
dingTalkService.sendMsg("[时间:" + LocalDateTime.now() + "] 用户: " +
|
||||||
user.getEmail() + "签到成功,获得积分:" + gLaDOSResponse.getPoints());
|
user.getEmail() + "签到成功,获得积分:" + gLaDOSResponse.getPoints());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("发送钉钉消息失败", e);
|
log.error("发送钉钉消息失败", e);
|
||||||
@@ -201,7 +202,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
log.warn("签到失败,重复签到,用户:{}, 签到消息:{}", user.getEmail(), gLaDOSResponse.getMessage());
|
log.warn("签到失败,重复签到,用户:{}, 签到消息:{}", user.getEmail(), gLaDOSResponse.getMessage());
|
||||||
sb.append(user).append("签到失败,重复签到,用户:").append(user).append(",签到消息:").append(gLaDOSResponse.getMessage());
|
sb.append(user).append("签到失败,重复签到,用户:").append(user).append(",签到消息:").append(gLaDOSResponse.getMessage());
|
||||||
try {
|
try {
|
||||||
dingTalkService.sendScriptMsg("[时间:" + LocalDateTime.now() + "] 用户: " +
|
dingTalkService.sendMsg("[时间:" + LocalDateTime.now() + "] 用户: " +
|
||||||
user.getEmail() + "当天已经签到成功!获得积分" + gLaDOSResponse.getList().get(0));
|
user.getEmail() + "当天已经签到成功!获得积分" + gLaDOSResponse.getList().get(0));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("发送钉钉消息失败", e);
|
log.error("发送钉钉消息失败", e);
|
||||||
@@ -216,7 +217,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
log.warn("签到失败,用户:{}, cookie过期:{}", user.getEmail(), gLaDOSResponse.getMessage());
|
log.warn("签到失败,用户:{}, cookie过期:{}", user.getEmail(), gLaDOSResponse.getMessage());
|
||||||
String message = "[时间:" + LocalDateTime.now() + "] 用户: " + user.getEmail() + ",签到消息: " + gLaDOSResponse.getMessage();
|
String message = "[时间:" + LocalDateTime.now() + "] 用户: " + user.getEmail() + ",签到消息: " + gLaDOSResponse.getMessage();
|
||||||
try {
|
try {
|
||||||
dingTalkService.sendScriptMsg(message);
|
dingTalkService.sendMsg(message);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("发送钉钉消息失败", e);
|
log.error("发送钉钉消息失败", e);
|
||||||
}
|
}
|
||||||
@@ -233,7 +234,7 @@ public class GLaDOSServiceImpl implements GLaDOSService{
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
String mes = "[时间:" + LocalDateTime.now() + "] 用户: " + user.getEmail() + ",签到异常,请求结果为空。";
|
String mes = "[时间:" + LocalDateTime.now() + "] 用户: " + user.getEmail() + ",签到异常,请求结果为空。";
|
||||||
dingTalkService.sendScriptMsg(mes);
|
dingTalkService.sendMsg(mes);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("发送钉钉消息失败", e);
|
log.error("发送钉钉消息失败", e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,105 +1,105 @@
|
|||||||
package com.xiang.xservice.application.script.xb.schedule.xb;
|
//package com.xiang.xservice.application.script.xb.schedule.xb;
|
||||||
|
//
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
//import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.Lists;
|
//import com.google.common.collect.Lists;
|
||||||
import com.xiang.xservice.basic.utils.DateUtils;
|
//import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundCount;
|
||||||
import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundCount;
|
//import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList;
|
||||||
import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList;
|
//import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundList;
|
||||||
import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundList;
|
//import com.xiang.xservice.application.script.xb.service.FundService;
|
||||||
import com.xiang.xservice.application.script.xb.service.DingTalkRobotService;
|
//import com.xiang.xservice.basic.utils.DateUtils;
|
||||||
import com.xiang.xservice.application.script.xb.service.FundService;
|
//import com.xiang.xservice.common.service.dingTalk.StockDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
//import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
//import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
//import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
//import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
//import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
|
//
|
||||||
import java.math.BigDecimal;
|
//import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
//import java.math.RoundingMode;
|
||||||
import java.time.DayOfWeek;
|
//import java.time.DayOfWeek;
|
||||||
import java.time.LocalDate;
|
//import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
//import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
//import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Collections;
|
//import java.util.Collections;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
import java.util.Map;
|
//import java.util.Map;
|
||||||
import java.util.Objects;
|
//import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
//import java.util.stream.Collectors;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @Author: xiang
|
// * @Author: xiang
|
||||||
* @Date: 2025-05-21 13:59
|
// * @Date: 2025-05-21 13:59
|
||||||
*/
|
// */
|
||||||
@Component
|
//@Component
|
||||||
@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
@RestController
|
//@RestController
|
||||||
public class FundCountJob {
|
//public class FundCountJob {
|
||||||
|
//
|
||||||
private final FundService fundService;
|
// private final FundService fundService;
|
||||||
private final DingTalkRobotService dingTalkService;
|
// private final StockDingTalkFactory dingTalkService;
|
||||||
@Scheduled(cron = "0 0 22 * * ?")
|
// @Scheduled(cron = "0 0 22 * * ?")
|
||||||
public void countFundJob() {
|
// public void countFundJob() {
|
||||||
// 周六周日过滤
|
// // 周六周日过滤
|
||||||
if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
// if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
||||||
Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
// Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
log.info("==========================[基金统计] 基金统计定时任务启动!==========================");
|
// log.info("==========================[基金统计] 基金统计定时任务启动!==========================");
|
||||||
List<XbFundList> lists = fundService.queryFundList();
|
// List<XbFundList> lists = fundService.queryFundList();
|
||||||
if (CollectionUtils.isEmpty(lists)) {
|
// if (CollectionUtils.isEmpty(lists)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
List<XbFundCount> counts = Lists.newCopyOnWriteArrayList();
|
// List<XbFundCount> counts = Lists.newCopyOnWriteArrayList();
|
||||||
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
// String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
lists.parallelStream().forEach(xbFundList -> {
|
// lists.parallelStream().forEach(xbFundList -> {
|
||||||
List<FundList> fund = fundService.queryTodayList(date, "2", Boolean.TRUE, Collections.singletonList(xbFundList.getCode()));
|
// List<FundList> fund = fundService.queryTodayList(date, "2", Boolean.TRUE, Collections.singletonList(xbFundList.getCode()));
|
||||||
if (CollectionUtils.isNotEmpty(fund)) {
|
// if (CollectionUtils.isNotEmpty(fund)) {
|
||||||
XbFundCount xbFundCount = new XbFundCount();
|
// XbFundCount xbFundCount = new XbFundCount();
|
||||||
xbFundCount.setLId(xbFundList.getId());
|
// xbFundCount.setLId(xbFundList.getId());
|
||||||
xbFundCount.setCode(xbFundList.getCode());
|
// xbFundCount.setCode(xbFundList.getCode());
|
||||||
xbFundCount.setName(xbFundList.getName());
|
// xbFundCount.setName(xbFundList.getName());
|
||||||
xbFundCount.setChange(fund.get(0).getChange().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
|
// xbFundCount.setChange(fund.get(0).getChange().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
|
||||||
xbFundCount.setUpdateTime(LocalDateTime.now());
|
// xbFundCount.setUpdateTime(LocalDateTime.now());
|
||||||
counts.add(xbFundCount);
|
// counts.add(xbFundCount);
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
if (CollectionUtils.isNotEmpty(counts)) {
|
// if (CollectionUtils.isNotEmpty(counts)) {
|
||||||
log.info("[基金统计] 基金统计记录,需要插入的数据:{}", JSONObject.toJSONString(counts));
|
// log.info("[基金统计] 基金统计记录,需要插入的数据:{}", JSONObject.toJSONString(counts));
|
||||||
fundService.addCounts(counts);
|
// fundService.addCounts(counts);
|
||||||
}
|
// }
|
||||||
log.info("==========================[基金统计] 基金统计定时任务结束!==========================");
|
// log.info("==========================[基金统计] 基金统计定时任务结束!==========================");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Scheduled(cron = "0 40 14 * * ? ")
|
// @Scheduled(cron = "0 40 14 * * ? ")
|
||||||
public void countFundInWeek() throws Exception {
|
// public void countFundInWeek() throws Exception {
|
||||||
if (DateUtils.validWeekTime()) return;
|
// if (DateUtils.validWeekTime()) return;
|
||||||
log.info("==========================[基金统计] 基金本周涨跌幅消息发送定时任务启动!==========================");
|
// log.info("==========================[基金统计] 基金本周涨跌幅消息发送定时任务启动!==========================");
|
||||||
List<XbFundCount> xbFundCounts = fundService.queryFundCountInWeek();
|
// List<XbFundCount> xbFundCounts = fundService.queryFundCountInWeek();
|
||||||
if (CollectionUtils.isEmpty(xbFundCounts)) {
|
// if (CollectionUtils.isEmpty(xbFundCounts)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
Map<String, List<XbFundCount>> map = xbFundCounts.stream().collect(Collectors.groupingBy(XbFundCount::getCode));
|
// Map<String, List<XbFundCount>> map = xbFundCounts.stream().collect(Collectors.groupingBy(XbFundCount::getCode));
|
||||||
map.forEach((k, v) -> {
|
// map.forEach((k, v) -> {
|
||||||
List<XbFundCount> fundCounts = map.get(k);
|
// List<XbFundCount> fundCounts = map.get(k);
|
||||||
if (CollectionUtils.isEmpty(fundCounts)) {
|
// if (CollectionUtils.isEmpty(fundCounts)) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
List<BigDecimal> decimals = fundCounts.stream().map(XbFundCount::getChange).collect(Collectors.toList());
|
// List<BigDecimal> decimals = fundCounts.stream().map(XbFundCount::getChange).collect(Collectors.toList());
|
||||||
BigDecimal sum = BigDecimal.ZERO;
|
// BigDecimal sum = BigDecimal.ZERO;
|
||||||
for (BigDecimal decimal : decimals) {
|
// for (BigDecimal decimal : decimals) {
|
||||||
sum = sum.add(decimal);
|
// sum = sum.add(decimal);
|
||||||
}
|
// }
|
||||||
BigDecimal avg = sum.divide(BigDecimal.valueOf(decimals.size()), 2, RoundingMode.HALF_UP);
|
// BigDecimal avg = sum.divide(BigDecimal.valueOf(decimals.size()), 2, RoundingMode.HALF_UP);
|
||||||
sb.append("【").append(fundCounts.get(0).getName()).append("】本周平均涨跌幅为:").append(avg).append("\n");
|
// sb.append("【").append(fundCounts.get(0).getName()).append("】本周平均涨跌幅为:").append(avg).append("\n");
|
||||||
});
|
// });
|
||||||
if (StringUtils.isNotBlank(sb)) {
|
// if (StringUtils.isNotBlank(sb)) {
|
||||||
dingTalkService.sendXbMsg(sb.toString());
|
// dingTalkService.sendMsg(sb.toString());
|
||||||
}
|
// }
|
||||||
log.info("==========================[基金统计] 基金本周涨跌幅消息发送定时任务结束!==========================");
|
// log.info("==========================[基金统计] 基金本周涨跌幅消息发送定时任务结束!==========================");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -1,180 +1,134 @@
|
|||||||
package com.xiang.xservice.application.script.xb.schedule.xb;
|
//package com.xiang.xservice.application.script.xb.schedule.xb;
|
||||||
|
//
|
||||||
import com.alibaba.fastjson.JSON;
|
//import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
//import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Lists;
|
//import com.xiang.xservice.application.script.xb.entity.pojo.xb.FundMessage;
|
||||||
import com.xiang.xmc.service.cache.service.IRedisService;
|
//import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList;
|
||||||
import com.xiang.xmc.service.message.dingTalk.service.DingTalkService;
|
//import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundInfo;
|
||||||
import com.xiang.xservice.application.script.xb.entity.pojo.xb.FundMessage;
|
//import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundList;
|
||||||
import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList;
|
//import com.xiang.xservice.application.script.xb.repository.XBFundMapper;
|
||||||
import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundInfo;
|
//import com.xiang.xservice.application.script.xb.service.FundService;
|
||||||
import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundList;
|
//import com.xiang.xservice.basic.config.MyThreadFactory;
|
||||||
import com.xiang.xservice.application.script.xb.repository.XBFundMapper;
|
//import lombok.RequiredArgsConstructor;
|
||||||
import com.xiang.xservice.application.script.xb.service.FundService;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import com.xiang.xservice.basic.config.MyThreadFactory;
|
//import org.apache.commons.collections4.CollectionUtils;
|
||||||
import com.xiang.xservice.basic.utils.DateUtils;
|
//import org.springframework.beans.factory.annotation.Value;
|
||||||
import com.xiang.xservice.common.entity.DayResult;
|
//import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import com.xiang.xservice.common.enums.RedisConstant;
|
//import org.springframework.stereotype.Component;
|
||||||
import lombok.RequiredArgsConstructor;
|
//
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import java.math.BigDecimal;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
//import java.math.RoundingMode;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
//import java.time.DayOfWeek;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
//import java.time.LocalDate;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
//import java.time.LocalDateTime;
|
||||||
import org.springframework.stereotype.Component;
|
//import java.time.format.DateTimeFormatter;
|
||||||
|
//import java.util.Arrays;
|
||||||
import java.math.BigDecimal;
|
//import java.util.List;
|
||||||
import java.math.RoundingMode;
|
//import java.util.Objects;
|
||||||
import java.time.DayOfWeek;
|
//import java.util.concurrent.CompletableFuture;
|
||||||
import java.time.LocalDate;
|
//import java.util.concurrent.ExecutorService;
|
||||||
import java.time.LocalDateTime;
|
//import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.time.format.DateTimeFormatter;
|
//import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.Arrays;
|
//import java.util.concurrent.TimeUnit;
|
||||||
import java.util.List;
|
//import java.util.stream.Collectors;
|
||||||
import java.util.Map;
|
//
|
||||||
import java.util.Objects;
|
///**
|
||||||
import java.util.concurrent.CompletableFuture;
|
// * @Author: xiang
|
||||||
import java.util.concurrent.ExecutorService;
|
// * @Date: 2025-05-14 17:15
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
// */
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
//@Component
|
||||||
import java.util.concurrent.TimeUnit;
|
//@RequiredArgsConstructor
|
||||||
import java.util.stream.Collectors;
|
//@Slf4j
|
||||||
|
//public class FundInfoQueryJob {
|
||||||
/**
|
//
|
||||||
* @Author: xiang
|
// private final FundService fundService;
|
||||||
* @Date: 2025-05-14 17:15
|
// private final XBFundMapper xbFundMapper;
|
||||||
*/
|
// private final ExecutorService es =
|
||||||
@Component
|
// new ThreadPoolExecutor(
|
||||||
@RequiredArgsConstructor
|
// 10,
|
||||||
@Slf4j
|
// 20,
|
||||||
public class FundInfoQueryJob {
|
// 1000,
|
||||||
|
// TimeUnit.MILLISECONDS,
|
||||||
private final FundService fundService;
|
// new LinkedBlockingQueue<>(),
|
||||||
private final DingTalkService dingTalkService;
|
// new MyThreadFactory("xb-query-thread", Boolean.TRUE),
|
||||||
private final XBFundMapper xbFundMapper;
|
// new ThreadPoolExecutor.AbortPolicy());
|
||||||
private final IRedisService redisService;
|
// @Value("${xiaobei.codeArr}")
|
||||||
private final ExecutorService es =
|
// private String codeArr;
|
||||||
new ThreadPoolExecutor(
|
//
|
||||||
10,
|
//
|
||||||
20,
|
// /**
|
||||||
1000,
|
// * 基金每分钟涨幅记录
|
||||||
TimeUnit.MILLISECONDS,
|
// */
|
||||||
new LinkedBlockingQueue<>(),
|
// @Scheduled(cron = "0 0/1 9,10,11,13,14 * * ?")
|
||||||
new MyThreadFactory("xb-query-thread", Boolean.TRUE),
|
// public void queryFundInfoInMinJob() {
|
||||||
new ThreadPoolExecutor.AbortPolicy());
|
// // 周六周日过滤
|
||||||
@Value("${xiaobei.codeArr}")
|
// if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
||||||
private String codeArr;
|
// Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
||||||
@Value("${dingtalk.chatId}")
|
// return;
|
||||||
private String chatId;
|
// }
|
||||||
|
// List<FundMessage> fundMessageList = queryFund(null);
|
||||||
/**
|
// if (CollectionUtils.isEmpty(fundMessageList)) {
|
||||||
* 基金涨跌幅5分钟超过2%重点通知
|
// return;
|
||||||
*/
|
// }
|
||||||
@Scheduled(cron = "0 0/5 9,10,11,13,14,15 * * ? ")
|
// List<CompletableFuture> futures = Lists.newArrayList();
|
||||||
public void queryFundEmergencyJob() throws Exception {
|
// List<com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo> fundInfoList = Lists.newCopyOnWriteArrayList();
|
||||||
// 周六周日过滤
|
// fundMessageList.parallelStream().forEach(fundMessage -> {
|
||||||
if (DateUtils.validWeekTime()) return;
|
// CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
||||||
LocalDate now = LocalDate.now();
|
// FundInfo fundInfo = fundService.queryFundInfo(fundMessage.getCode());
|
||||||
com.alibaba.fastjson.JSONObject dayResult = (com.alibaba.fastjson.JSONObject) redisService.hGet(RedisConstant.DAY_INFO_PREFIX_KEY + RedisConstant.getDate4Key(), DateUtils.getDateFromDate(now));
|
//
|
||||||
com.xiang.xservice.common.utils.DateUtils dateUtils = new com.xiang.xservice.common.utils.DateUtils(redisService);
|
// com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo info = com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo.builder()
|
||||||
if (dateUtils.validHoliday(JSON.toJavaObject(dayResult, DayResult.class))) return;
|
// .code(fundMessage.getCode())
|
||||||
|
// .name(fundInfo.getName())
|
||||||
List<com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo> fundInfos = xbFundMapper.queryListIn2Min();
|
// .change(fundMessage.getChange().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP).toString())
|
||||||
if (CollectionUtils.isEmpty(fundInfos)) {
|
// .updateTime(getTimeFromStr(fundMessage.getDate(), fundMessage.getUpdate()))
|
||||||
return;
|
// .build();
|
||||||
}
|
// fundInfoList.add(info);
|
||||||
Map<String, List<com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo>> map = fundInfos.stream().collect(Collectors.groupingBy(com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo::getCode));
|
// }, es);
|
||||||
StringBuffer sb = new StringBuffer();
|
// futures.add(future);
|
||||||
map.entrySet().parallelStream().forEach(entry -> {
|
// });
|
||||||
List<com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo> infos = entry.getValue();
|
//
|
||||||
BigDecimal sum = new BigDecimal("0");
|
// CompletableFuture[] futureArr = futures
|
||||||
for (int i = 0; i < infos.size() - 1; i++) {
|
// .toArray(futures.toArray(new CompletableFuture[0]));
|
||||||
BigDecimal subtract = new BigDecimal(infos.get(i + 1).getChange()).subtract(new BigDecimal(infos.get(i).getChange()));
|
// CompletableFuture.allOf(futureArr).join();
|
||||||
sum = sum.add(subtract);
|
//
|
||||||
}
|
// if (CollectionUtils.isNotEmpty(fundInfoList)) {
|
||||||
BigDecimal avg = sum.divide(new BigDecimal(String.valueOf(infos.size())), 2, RoundingMode.HALF_UP);
|
// log.info("[基金查询] 每分钟基金涨跌幅查询记录,需要插入的数据:{}", JSONObject.toJSONString(fundInfoList));
|
||||||
if (avg.abs().compareTo(new BigDecimal("2")) > 0) {
|
// xbFundMapper.batchSave(fundInfoList);
|
||||||
sb.append("基金").append(entry.getValue().get(0).getName()).append("5分钟的平均涨跌幅超过2%,涨跌幅达到").append(avg).append("\n");
|
// }
|
||||||
}
|
// }
|
||||||
});
|
//
|
||||||
if (StringUtils.isNotBlank(sb)) {
|
// private List<FundMessage> queryFund(Integer type) {
|
||||||
dingTalkService.sendChatMessage(chatId, sb.toString());
|
// String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
}
|
// List<String> code = Lists.newArrayList();
|
||||||
}
|
// List<XbFundList> lists = xbFundMapper.queryFundList(type);
|
||||||
|
// if (CollectionUtils.isEmpty(lists)) {
|
||||||
/**
|
// if (Objects.equals(type, 1)) {
|
||||||
* 基金每分钟涨幅记录
|
// code = Arrays.stream(codeArr.split(", ")).collect(Collectors.toList());
|
||||||
*/
|
// }
|
||||||
@Scheduled(cron = "0 0/1 9,10,11,13,14 * * ?")
|
// return Lists.newArrayList();
|
||||||
public void queryFundInfoInMinJob() {
|
// } else {
|
||||||
// 周六周日过滤
|
// code = lists.stream().map(XbFundList::getCode).collect(Collectors.toList());
|
||||||
if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
// }
|
||||||
Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
// List<FundList> fundLists = fundService.queryTodayList(date, "2", Boolean.TRUE, code);
|
||||||
return;
|
// if (CollectionUtils.isEmpty(fundLists)) {
|
||||||
}
|
// return Lists.newArrayList();
|
||||||
List<FundMessage> fundMessageList = queryFund(null);
|
// }
|
||||||
if (CollectionUtils.isEmpty(fundMessageList)) {
|
// List<FundMessage> result = Lists.newCopyOnWriteArrayList();
|
||||||
return;
|
// fundLists.parallelStream().forEach(fundList -> {
|
||||||
}
|
// FundInfo fundInfo = fundService.queryFundInfo(fundList.getCode());
|
||||||
List<CompletableFuture> futures = Lists.newArrayList();
|
// if (Objects.nonNull(fundInfo)) {
|
||||||
List<com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo> fundInfoList = Lists.newCopyOnWriteArrayList();
|
// FundMessage fund = FundMessage.builder().name(fundInfo.getName()).date(fundList.getDate())
|
||||||
fundMessageList.parallelStream().forEach(fundMessage -> {
|
// .code(fundList.getCode()).change(fundList.getChange()).update(fundList.getUpdate()).build();
|
||||||
CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
// result.add(fund);
|
||||||
FundInfo fundInfo = fundService.queryFundInfo(fundMessage.getCode());
|
// }
|
||||||
|
// });
|
||||||
com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo info = com.xiang.xservice.application.script.xb.entity.pojo.xb.FundInfo.builder()
|
// return result;
|
||||||
.code(fundMessage.getCode())
|
// }
|
||||||
.name(fundInfo.getName())
|
//
|
||||||
.change(fundMessage.getChange().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP).toString())
|
// private LocalDateTime getTimeFromStr(String date, String time) {
|
||||||
.updateTime(getTimeFromStr(fundMessage.getDate(), fundMessage.getUpdate()))
|
// String dateTimeStr = date + " " + time;
|
||||||
.build();
|
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
fundInfoList.add(info);
|
// return LocalDateTime.parse(dateTimeStr, formatter);
|
||||||
}, es);
|
// }
|
||||||
futures.add(future);
|
//
|
||||||
});
|
//}
|
||||||
|
|
||||||
CompletableFuture[] futureArr = futures
|
|
||||||
.toArray(futures.toArray(new CompletableFuture[0]));
|
|
||||||
CompletableFuture.allOf(futureArr).join();
|
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(fundInfoList)) {
|
|
||||||
log.info("[基金查询] 每分钟基金涨跌幅查询记录,需要插入的数据:{}", JSONObject.toJSONString(fundInfoList));
|
|
||||||
xbFundMapper.batchSave(fundInfoList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<FundMessage> queryFund(Integer type) {
|
|
||||||
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
||||||
List<String> code = Lists.newArrayList();
|
|
||||||
List<XbFundList> lists = xbFundMapper.queryFundList(type);
|
|
||||||
if (CollectionUtils.isEmpty(lists)) {
|
|
||||||
if (Objects.equals(type, 1)) {
|
|
||||||
code = Arrays.stream(codeArr.split(", ")).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
return Lists.newArrayList();
|
|
||||||
} else {
|
|
||||||
code = lists.stream().map(XbFundList::getCode).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
List<FundList> fundLists = fundService.queryTodayList(date, "2", Boolean.TRUE, code);
|
|
||||||
if (CollectionUtils.isEmpty(fundLists)) {
|
|
||||||
return Lists.newArrayList();
|
|
||||||
}
|
|
||||||
List<FundMessage> result = Lists.newCopyOnWriteArrayList();
|
|
||||||
fundLists.parallelStream().forEach(fundList -> {
|
|
||||||
FundInfo fundInfo = fundService.queryFundInfo(fundList.getCode());
|
|
||||||
if (Objects.nonNull(fundInfo)) {
|
|
||||||
FundMessage fund = FundMessage.builder().name(fundInfo.getName()).date(fundList.getDate())
|
|
||||||
.code(fundList.getCode()).change(fundList.getChange()).update(fundList.getUpdate()).build();
|
|
||||||
result.add(fund);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private LocalDateTime getTimeFromStr(String date, String time) {
|
|
||||||
String dateTimeStr = date + " " + time;
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
||||||
return LocalDateTime.parse(dateTimeStr, formatter);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,144 +1,144 @@
|
|||||||
package com.xiang.xservice.application.script.xb.schedule.xb;
|
//package com.xiang.xservice.application.script.xb.schedule.xb;
|
||||||
|
//
|
||||||
import com.alibaba.fastjson.JSON;
|
//import com.alibaba.fastjson.JSON;
|
||||||
import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList;
|
//import com.xiang.xservice.application.script.xb.entity.pojo.xb.XbFundList;
|
||||||
import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundList;
|
//import com.xiang.xservice.application.script.xb.entity.response.xbyj.fund.FundList;
|
||||||
import com.xiang.xservice.application.script.xb.service.DingTalkRobotService;
|
//import com.xiang.xservice.application.script.xb.service.FundService;
|
||||||
import com.xiang.xservice.application.script.xb.service.FundService;
|
//import com.xiang.xservice.common.service.dingTalk.StockDingTalkFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
//import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
//import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
//import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
//import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
//import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
|
//
|
||||||
import java.math.BigDecimal;
|
//import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
//import java.math.RoundingMode;
|
||||||
import java.time.DayOfWeek;
|
//import java.time.DayOfWeek;
|
||||||
import java.time.LocalDate;
|
//import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
//import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
//import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
//import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
//import java.util.Comparator;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
import java.util.Map;
|
//import java.util.Map;
|
||||||
import java.util.Objects;
|
//import java.util.Objects;
|
||||||
import java.util.function.Function;
|
//import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
//import java.util.stream.Collectors;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @Author: xiang
|
// * @Author: xiang
|
||||||
* @Date: 2025-07-31 18:10
|
// * @Date: 2025-07-31 18:10
|
||||||
*/
|
// */
|
||||||
@Component
|
//@Component
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
@RestController
|
//@RestController
|
||||||
@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
public class FundMsgReportJob {
|
//public class FundMsgReportJob {
|
||||||
|
//
|
||||||
private final FundService fundService;
|
// private final FundService fundService;
|
||||||
private final DingTalkRobotService dingTalkService;
|
// private final StockDingTalkFactory dingTalkService;
|
||||||
private static final Integer TYPE_A = 1;
|
// private static final Integer TYPE_A = 1;
|
||||||
private static final Integer TYPE_M = 3;
|
// private static final Integer TYPE_M = 3;
|
||||||
private static final Integer TYPE_G = 2;
|
// private static final Integer TYPE_G = 2;
|
||||||
|
//
|
||||||
@Scheduled(cron = "0 1,31 9,10,11,13,14 * * ?")
|
// @Scheduled(cron = "0 1,31 9,10,11,13,14 * * ?")
|
||||||
@PostMapping("/asdasda")
|
// @PostMapping("/asdasda")
|
||||||
public void fundReport4A() {
|
// public void fundReport4A() {
|
||||||
log.info("===========A股基金变化通知!===========");
|
// log.info("===========A股基金变化通知!===========");
|
||||||
// 周六周日过滤
|
// // 周六周日过滤
|
||||||
if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
// if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
||||||
Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
// Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
||||||
log.info("当前时间为:{}", LocalDateTime.now());
|
// log.info("当前时间为:{}", LocalDateTime.now());
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
List<XbFundList> fundLists = fundService.queryFundList(TYPE_A);
|
// List<XbFundList> fundLists = fundService.queryFundList(TYPE_A);
|
||||||
if (CollectionUtils.isEmpty(fundLists)) {
|
// if (CollectionUtils.isEmpty(fundLists)) {
|
||||||
log.info("查询配置的A股信息为空");
|
// log.info("查询配置的A股信息为空");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
Map<String, XbFundList> fundMap = fundLists.stream().collect(Collectors.toMap(XbFundList::getCode, Function.identity(), (a, b) -> a));
|
// Map<String, XbFundList> fundMap = fundLists.stream().collect(Collectors.toMap(XbFundList::getCode, Function.identity(), (a, b) -> a));
|
||||||
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
// String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
List<FundList> funds = fundService.queryTodayList(date, "2", Boolean.TRUE, new ArrayList<>(fundMap.keySet()));
|
// List<FundList> funds = fundService.queryTodayList(date, "2", Boolean.TRUE, new ArrayList<>(fundMap.keySet()));
|
||||||
if (CollectionUtils.isEmpty(funds)) {
|
// if (CollectionUtils.isEmpty(funds)) {
|
||||||
log.info("http请求查询基金信息为空");
|
// log.info("http请求查询基金信息为空");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
log.info("http查询基金信息:{}", JSON.toJSONString(funds));
|
// log.info("http查询基金信息:{}", JSON.toJSONString(funds));
|
||||||
StringBuilder msg = new StringBuilder(date).append("===》A股基金变化通知:\n");
|
// StringBuilder msg = new StringBuilder(date).append("===》A股基金变化通知:\n");
|
||||||
buildMsg(funds, fundMap, msg);
|
// buildMsg(funds, fundMap, msg);
|
||||||
dingTalkService.sendXbMsg(msg.toString());
|
// dingTalkService.sendMsg(msg.toString());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Scheduled(cron = "0 1,31 9,10,11,13,14,15 * * ?")
|
// @Scheduled(cron = "0 1,31 9,10,11,13,14,15 * * ?")
|
||||||
public void fundReport4G() {
|
// public void fundReport4G() {
|
||||||
log.info("===========港股基金变化通知!===========");
|
// log.info("===========港股基金变化通知!===========");
|
||||||
// 周六周日过滤
|
// // 周六周日过滤
|
||||||
if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
// if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
||||||
Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
// Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
||||||
log.info("当前时间为:{}", LocalDateTime.now());
|
// log.info("当前时间为:{}", LocalDateTime.now());
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
List<XbFundList> fundLists = fundService.queryFundList(TYPE_G);
|
// List<XbFundList> fundLists = fundService.queryFundList(TYPE_G);
|
||||||
if (CollectionUtils.isEmpty(fundLists)) {
|
// if (CollectionUtils.isEmpty(fundLists)) {
|
||||||
log.info("查询配置的港股信息为空");
|
// log.info("查询配置的港股信息为空");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
Map<String, XbFundList> fundMap = fundLists.stream().collect(Collectors.toMap(XbFundList::getCode, Function.identity(), (a, b) -> a));
|
// Map<String, XbFundList> fundMap = fundLists.stream().collect(Collectors.toMap(XbFundList::getCode, Function.identity(), (a, b) -> a));
|
||||||
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
// String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
List<FundList> funds = fundService.queryTodayList(date, "2", Boolean.TRUE, new ArrayList<>(fundMap.keySet()));
|
// List<FundList> funds = fundService.queryTodayList(date, "2", Boolean.TRUE, new ArrayList<>(fundMap.keySet()));
|
||||||
if (CollectionUtils.isEmpty(funds)) {
|
// if (CollectionUtils.isEmpty(funds)) {
|
||||||
log.info("http请求查询基金信息为空");
|
// log.info("http请求查询基金信息为空");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
log.info("http查询港股基金信息:{}", JSON.toJSONString(funds));
|
// log.info("http查询港股基金信息:{}", JSON.toJSONString(funds));
|
||||||
StringBuilder msg = new StringBuilder(date).append("===》港股基金变化通知:\n");
|
// StringBuilder msg = new StringBuilder(date).append("===》港股基金变化通知:\n");
|
||||||
buildMsg(funds, fundMap, msg);
|
// buildMsg(funds, fundMap, msg);
|
||||||
dingTalkService.sendXbMsg(msg.toString());
|
// dingTalkService.sendMsg(msg.toString());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Scheduled(cron = "0 0 9 * * ?")
|
// @Scheduled(cron = "0 0 9 * * ?")
|
||||||
public void fundReport4M() {
|
// public void fundReport4M() {
|
||||||
log.info("===========美股基金变化通知!===========");
|
// log.info("===========美股基金变化通知!===========");
|
||||||
// 周六周日过滤
|
// // 周六周日过滤
|
||||||
if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
// if (Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SATURDAY) ||
|
||||||
Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
// Objects.equals(LocalDateTime.now().getDayOfWeek(), DayOfWeek.SUNDAY)) {
|
||||||
log.info("当前时间为:{}", LocalDateTime.now());
|
// log.info("当前时间为:{}", LocalDateTime.now());
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
List<XbFundList> fundLists = fundService.queryFundList(TYPE_M);
|
// List<XbFundList> fundLists = fundService.queryFundList(TYPE_M);
|
||||||
if (CollectionUtils.isEmpty(fundLists)) {
|
// if (CollectionUtils.isEmpty(fundLists)) {
|
||||||
log.info("查询配置的美股信息为空");
|
// log.info("查询配置的美股信息为空");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
Map<String, XbFundList> fundMap = fundLists.stream().collect(Collectors.toMap(XbFundList::getCode, Function.identity(), (a, b) -> a));
|
// Map<String, XbFundList> fundMap = fundLists.stream().collect(Collectors.toMap(XbFundList::getCode, Function.identity(), (a, b) -> a));
|
||||||
String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
// String date = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
List<FundList> funds = fundService.queryTodayList(date, "2", Boolean.TRUE, new ArrayList<>(fundMap.keySet()));
|
// List<FundList> funds = fundService.queryTodayList(date, "2", Boolean.TRUE, new ArrayList<>(fundMap.keySet()));
|
||||||
if (CollectionUtils.isEmpty(funds)) {
|
// if (CollectionUtils.isEmpty(funds)) {
|
||||||
log.info("http请求查询基金信息为空");
|
// log.info("http请求查询基金信息为空");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
log.info("http查询美股基金信息:{}", JSON.toJSONString(funds));
|
// log.info("http查询美股基金信息:{}", JSON.toJSONString(funds));
|
||||||
StringBuilder msg = new StringBuilder(date).append("===》美股基金变化通知:\n");
|
// StringBuilder msg = new StringBuilder(date).append("===》美股基金变化通知:\n");
|
||||||
buildMsg(funds, fundMap, msg);
|
// buildMsg(funds, fundMap, msg);
|
||||||
dingTalkService.sendXbMsg(msg.toString());
|
// dingTalkService.sendMsg(msg.toString());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private static void buildMsg(List<FundList> funds, Map<String, XbFundList> fundMap, StringBuilder msg) {
|
// private static void buildMsg(List<FundList> funds, Map<String, XbFundList> fundMap, StringBuilder msg) {
|
||||||
funds = funds.stream().sorted(Comparator.comparing(FundList::getChange).reversed())
|
// funds = funds.stream().sorted(Comparator.comparing(FundList::getChange).reversed())
|
||||||
.collect(Collectors.toList());
|
// .collect(Collectors.toList());
|
||||||
for (FundList fund : funds) {
|
// for (FundList fund : funds) {
|
||||||
if (fundMap.containsKey(fund.getCode())) {
|
// if (fundMap.containsKey(fund.getCode())) {
|
||||||
XbFundList fundList = fundMap.get(fund.getCode());
|
// XbFundList fundList = fundMap.get(fund.getCode());
|
||||||
msg.append("基金名称:")
|
// msg.append("基金名称:")
|
||||||
.append(fundList.getName())
|
// .append(fundList.getName())
|
||||||
.append("涨跌幅:")
|
// .append("涨跌幅:")
|
||||||
.append(fund.getChange()
|
// .append(fund.getChange()
|
||||||
.multiply(new BigDecimal("100"))
|
// .multiply(new BigDecimal("100"))
|
||||||
.setScale(2, RoundingMode.HALF_UP))
|
// .setScale(2, RoundingMode.HALF_UP))
|
||||||
.append("\n");
|
// .append("\n");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.xiang.xservice.application.script.xb.service;
|
|
||||||
|
|
||||||
import com.xiang.xmc.service.message.dingTalk.service.DingTalkService;
|
|
||||||
import com.xiang.xservice.config.DingTalkRobotXbConfig;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: xiang
|
|
||||||
* @Date: 2025-08-07 11:02
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class DingTalkRobotService {
|
|
||||||
private final DingTalkService dingTalkService;
|
|
||||||
private final DingTalkRobotXbConfig dingTalkRobotConfig;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送脚本消息
|
|
||||||
* @param msg 消息
|
|
||||||
*/
|
|
||||||
public void sendXbMsg(String msg) {
|
|
||||||
try {
|
|
||||||
dingTalkService.sendRobotMessage(dingTalkRobotConfig.getSecret(), dingTalkRobotConfig.getToken(), dingTalkRobotConfig.getUsers(), msg);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("信息发送异常, 信息:{}", msg, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.xiang.xservice.common.enums;
|
||||||
|
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.enums.BaseDingTalkBizType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-01-04 16:13
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum DingTalkBizTypeEnum implements BaseDingTalkBizType {
|
||||||
|
|
||||||
|
JT("venue", "江南体育中心"),
|
||||||
|
XB("xb", "股票基金变化通知"),
|
||||||
|
SCRIPT("script", "脚本运行通知群")
|
||||||
|
;
|
||||||
|
private final String bizName;
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.xiang.xservice.common.service.dingTalk;
|
||||||
|
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.config.DingTalkRobotProperties;
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.service.AbstractDingTalkFactory;
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.service.DingTalkSender;
|
||||||
|
import com.xiang.xservice.common.enums.DingTalkBizTypeEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-01-04 16:19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class JtDingTalkFactory extends AbstractDingTalkFactory {
|
||||||
|
public JtDingTalkFactory(DingTalkRobotProperties dingTalkRobotProperties, DingTalkSender dingTalkSender) {
|
||||||
|
super(dingTalkRobotProperties, dingTalkSender);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendMsg(String msg) {
|
||||||
|
getClient(DingTalkBizTypeEnum.JT).sendDingTalkMsg(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.xiang.xservice.common.service.dingTalk;
|
||||||
|
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.config.DingTalkRobotProperties;
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.service.AbstractDingTalkFactory;
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.service.DingTalkSender;
|
||||||
|
import com.xiang.xservice.common.enums.DingTalkBizTypeEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ScriptDingTalkFactory extends AbstractDingTalkFactory {
|
||||||
|
public ScriptDingTalkFactory(DingTalkRobotProperties dingTalkRobotProperties, DingTalkSender dingTalkSender) {
|
||||||
|
super(dingTalkRobotProperties, dingTalkSender);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendMsg(String msg) {
|
||||||
|
getClient(DingTalkBizTypeEnum.SCRIPT).sendDingTalkMsg(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.xiang.xservice.common.service.dingTalk;
|
||||||
|
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.config.DingTalkRobotProperties;
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.service.AbstractDingTalkFactory;
|
||||||
|
import com.xiang.xmc.service.message.dingTalk.service.DingTalkSender;
|
||||||
|
import com.xiang.xservice.common.enums.DingTalkBizTypeEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class StockDingTalkFactory extends AbstractDingTalkFactory {
|
||||||
|
public StockDingTalkFactory(DingTalkRobotProperties dingTalkRobotProperties, DingTalkSender dingTalkSender) {
|
||||||
|
super(dingTalkRobotProperties, dingTalkSender);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendMsg(String msg) {
|
||||||
|
getClient(DingTalkBizTypeEnum.XB).sendDingTalkMsg(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.xiang.xservice.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebMvcConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
registry.addResourceHandler("/statics/**").addResourceLocations("classpath:/statics/");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,43 +43,7 @@ spring:
|
|||||||
settings:
|
settings:
|
||||||
number_format: 0.##
|
number_format: 0.##
|
||||||
default_encoding: UTF-8
|
default_encoding: UTF-8
|
||||||
autoconfigure:
|
|
||||||
exclude:
|
|
||||||
- com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration
|
|
||||||
server:
|
|
||||||
#tomcat:
|
|
||||||
# remote-ip-header: x-forward-for
|
|
||||||
# uri-encoding: UTF-8
|
|
||||||
# max-threads: 10
|
|
||||||
# background-processor-delay: 30
|
|
||||||
# basedir: ${user.home}/tomcat/
|
|
||||||
undertow:
|
|
||||||
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
|
|
||||||
# 不要设置过大,如果过大,启动项目会报错:打开文件数过多
|
|
||||||
io-threads: 4
|
|
||||||
# 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程
|
|
||||||
# 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数*8
|
|
||||||
worker-threads: 64
|
|
||||||
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
|
|
||||||
# 每块buffer的空间大小,越小的空间被利用越充分,不要设置太大,以免影响其他应用,合适即可
|
|
||||||
buffer-size: 1024
|
|
||||||
# 是否分配的直接内存(NIO直接分配的堆外内存)
|
|
||||||
direct-buffers: true
|
|
||||||
|
|
||||||
OEM:
|
|
||||||
version: 2025 September
|
|
||||||
header: SQL转Java JPA、MYBATIS实现类代码生成平台
|
|
||||||
keywords: sql转实体类,sql转DAO,SQL转service,SQL转JPA实现,SQL转MYBATIS实现
|
|
||||||
title: 大狼狗代码生成器
|
|
||||||
slogan: 👐 Free your hands from boring CRUD—let the code write itself! ⚡
|
|
||||||
description: <p>💻 SpringBootCodeGenerator,又名 `大狼狗代码生成器`🐺🐶,支持 SQL 一键转 JAVA/JPA/Mybatis/MybatisPlus 等多种模板,轻松搞定 CRUD,彻底解放双手 ✋!只需提供 DDL、SELECT SQL 或简单 JSON 👉 即可生成 生成JPA/JdbcTemplate/Mybatis/MybatisPlus/BeetlSQL/CommonMapper 等代码模板。</p><p>🔥🔥🔥 全新 JSqlParser 引擎上线,强力支持 DDL CREATE SQL与 SELECT SQL 解析!欢迎体验 & 反馈 💬!</p><p>👨💻 面向开发者的高效利器,已服务数万工程师,欢迎 Star ⭐、Fork 🍴、提 Issue 💬,一起打造更强大的代码生成平台!</p>
|
|
||||||
author: zhengkai.blog.csdn.net
|
|
||||||
packageName: com.software.system
|
|
||||||
copyright: ✨ Powered by <a href="https://zhengkai.blog.csdn.net" target="_blank">Moshow郑锴</a> — may the holy light guide your code, your coffee, and your commits! ⚡🧙♂️💻
|
|
||||||
returnUtilSuccess: ResponseUtil.success
|
|
||||||
returnUtilFailure: ResponseUtil.error
|
|
||||||
outputStr: http://zhengkai.blog.csdn.net
|
|
||||||
mode: local
|
|
||||||
|
|
||||||
aliyun:
|
aliyun:
|
||||||
dns:
|
dns:
|
||||||
@@ -87,23 +51,23 @@ aliyun:
|
|||||||
- local
|
- local
|
||||||
|
|
||||||
dingtalk:
|
dingtalk:
|
||||||
# 钉钉消息用户,用逗号隔开
|
|
||||||
userList: "450841600726084717"
|
|
||||||
# 钉钉消息群ID,需要调用/chat/create api创建群返回
|
|
||||||
chatId: "chatd16d8daeea33b36b73588c676d508096"
|
|
||||||
robot:
|
robot:
|
||||||
script:
|
properties:
|
||||||
token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3
|
venue:
|
||||||
secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91
|
name: 江南体育中心通知群
|
||||||
users:
|
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
||||||
- 450841600726084717
|
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
||||||
xb:
|
users:
|
||||||
token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437
|
- 450841600726084717
|
||||||
secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730
|
script:
|
||||||
users:
|
name: 脚本运行通知群
|
||||||
- 450841600726084717
|
token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3
|
||||||
venue:
|
secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91
|
||||||
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
users:
|
||||||
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
- 450841600726084717
|
||||||
users:
|
xb:
|
||||||
- 450841600726084717
|
name: 股票基金变化通知群
|
||||||
|
token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437
|
||||||
|
secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730
|
||||||
|
users:
|
||||||
|
- 450841600726084717
|
||||||
@@ -29,6 +29,20 @@ spring:
|
|||||||
max-idle: 8
|
max-idle: 8
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
max-wait: 1000
|
max-wait: 1000
|
||||||
|
freemarker:
|
||||||
|
request-context-attribute: request
|
||||||
|
suffix: .html
|
||||||
|
content-type: text/html
|
||||||
|
enabled: true
|
||||||
|
cache: false
|
||||||
|
charset: UTF-8
|
||||||
|
allow-request-override: false
|
||||||
|
expose-request-attributes: true
|
||||||
|
expose-session-attributes: true
|
||||||
|
expose-spring-macro-helpers: true
|
||||||
|
settings:
|
||||||
|
number_format: 0.##
|
||||||
|
default_encoding: UTF-8
|
||||||
|
|
||||||
aliyun:
|
aliyun:
|
||||||
dns:
|
dns:
|
||||||
@@ -38,23 +52,23 @@ aliyun:
|
|||||||
- nexus
|
- nexus
|
||||||
|
|
||||||
dingtalk:
|
dingtalk:
|
||||||
# 钉钉消息用户,用逗号隔开
|
|
||||||
userList: "450841600726084717"
|
|
||||||
# 钉钉消息群ID,需要调用/chat/create api创建群返回
|
|
||||||
chatId: "chatd16d8daeea33b36b73588c676d508096"
|
|
||||||
robot:
|
robot:
|
||||||
script:
|
properties:
|
||||||
token: 4709b708d961846e0aee523c5abc3b67e8fa424ee292501d85efd4e504f15a8b
|
venue:
|
||||||
secret: SEC768ed578c0fb31a9aec84b1c1db4f195f5aca203985bbb9d549e23e41c8874d1
|
name: 江南体育中心通知群
|
||||||
users:
|
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
||||||
- 450841600726084717
|
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
||||||
xb:
|
users:
|
||||||
token: 340a9d39a5b0b6a52ba2262f9c27179cf50e3c8cfe6883ca082649d306038f41
|
- 450841600726084717
|
||||||
secret: SECe10ade3058880b84df5c6f46ab072c11f4ac2a5ef9f134d684705c2a3b004de2
|
script:
|
||||||
users:
|
name: 脚本运行通知群
|
||||||
- 450841600726084717
|
token: 4709b708d961846e0aee523c5abc3b67e8fa424ee292501d85efd4e504f15a8b
|
||||||
venue:
|
secret: SEC768ed578c0fb31a9aec84b1c1db4f195f5aca203985bbb9d549e23e41c8874d1
|
||||||
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
users:
|
||||||
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
- 450841600726084717
|
||||||
users:
|
xb:
|
||||||
- 450841600726084717
|
name: 股票基金变化通知群
|
||||||
|
token: 340a9d39a5b0b6a52ba2262f9c27179cf50e3c8cfe6883ca082649d306038f41
|
||||||
|
secret: SECe10ade3058880b84df5c6f46ab072c11f4ac2a5ef9f134d684705c2a3b004de2
|
||||||
|
users:
|
||||||
|
- 450841600726084717
|
||||||
@@ -29,6 +29,20 @@ spring:
|
|||||||
max-idle: 8
|
max-idle: 8
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
max-wait: 1000
|
max-wait: 1000
|
||||||
|
freemarker:
|
||||||
|
request-context-attribute: request
|
||||||
|
suffix: .html
|
||||||
|
content-type: text/html
|
||||||
|
enabled: true
|
||||||
|
cache: false
|
||||||
|
charset: UTF-8
|
||||||
|
allow-request-override: false
|
||||||
|
expose-request-attributes: true
|
||||||
|
expose-session-attributes: true
|
||||||
|
expose-spring-macro-helpers: true
|
||||||
|
settings:
|
||||||
|
number_format: 0.##
|
||||||
|
default_encoding: UTF-8
|
||||||
|
|
||||||
aliyun:
|
aliyun:
|
||||||
dns:
|
dns:
|
||||||
@@ -36,18 +50,23 @@ aliyun:
|
|||||||
- test
|
- test
|
||||||
|
|
||||||
dingtalk:
|
dingtalk:
|
||||||
# 钉钉消息用户,用逗号隔开
|
|
||||||
userList: "450841600726084717"
|
|
||||||
# 钉钉消息群ID,需要调用/chat/create api创建群返回
|
|
||||||
chatId: "chatd16d8daeea33b36b73588c676d508096"
|
|
||||||
robot:
|
robot:
|
||||||
script:
|
properties:
|
||||||
token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3
|
venue:
|
||||||
secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91
|
name: 江南体育中心通知群
|
||||||
users:
|
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
|
||||||
- 450841600726084717
|
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
|
||||||
xb:
|
users:
|
||||||
token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437
|
- 450841600726084717
|
||||||
secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730
|
script:
|
||||||
users:
|
name: 脚本运行通知群
|
||||||
- 450841600726084717
|
token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3
|
||||||
|
secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91
|
||||||
|
users:
|
||||||
|
- 450841600726084717
|
||||||
|
xb:
|
||||||
|
name: 股票基金变化通知群
|
||||||
|
token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437
|
||||||
|
secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730
|
||||||
|
users:
|
||||||
|
- 450841600726084717
|
||||||
@@ -21,6 +21,9 @@ spring:
|
|||||||
name: xservice-script-center
|
name: xservice-script-center
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
autoconfigure:
|
||||||
|
exclude:
|
||||||
|
- com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration
|
||||||
|
|
||||||
http:
|
http:
|
||||||
maxAttempts: 10
|
maxAttempts: 10
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ const vm = new Vue({
|
|||||||
options: {
|
options: {
|
||||||
dataType: "sql",
|
dataType: "sql",
|
||||||
|
|
||||||
authorName: "${(value.author)!!}",
|
authorName: "Xiang",
|
||||||
packageName: "${(value.packageName)!!}",
|
packageName: "com.xiang",
|
||||||
returnUtilSuccess: "${(value.returnUtilSuccess)!!}",
|
returnUtilSuccess: "Result.success",
|
||||||
returnUtilFailure: "${(value.returnUtilFailure)!!}",
|
returnUtilFailure: "Result.error",
|
||||||
|
|
||||||
isPackageType: true,
|
isPackageType: true,
|
||||||
isSwagger: false,
|
isSwagger: false,
|
||||||
@@ -62,7 +62,7 @@ const vm = new Vue({
|
|||||||
templates: [{}],
|
templates: [{}],
|
||||||
historicalData: [],
|
historicalData: [],
|
||||||
currentSelect: 'plusentity',
|
currentSelect: 'plusentity',
|
||||||
outputStr: "${(value.outputStr)!!}",
|
outputStr: "",
|
||||||
outputJson: {}
|
outputJson: {}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user