3 Commits

Author SHA1 Message Date
xiang
c506a850c3 feat:基金定时任务 2026-02-07 20:12:45 +08:00
xiang
e22bc012c9 fix:顶顶消息修复 2026-01-30 23:22:48 +08:00
xiang
b598d67281 fix:pom版本修改 2026-01-30 22:54:39 +08:00
21 changed files with 587 additions and 678 deletions

16
pom.xml
View File

@@ -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>

View File

@@ -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);
}
}
}

View File

@@ -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);
} }

View File

@@ -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) {

View File

@@ -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("消息发送失败");

View File

@@ -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);
}
}
}

View File

@@ -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;
} }

View File

@@ -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);
}
}
}

View File

@@ -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);
} }

View File

@@ -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("==========================[基金统计] 基金本周涨跌幅消息发送定时任务结束!==========================");
} // }
//
} //}

View File

@@ -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);
}
}

View File

@@ -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");
} // }
} // }
} // }
} //}

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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:
properties:
venue:
name: 江南体育中心通知群
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
users:
- 450841600726084717
script: script:
name: 脚本运行通知群
token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3 token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3
secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91 secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91
users: users:
- 450841600726084717 - 450841600726084717
xb: xb:
name: 股票基金变化通知群
token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437 token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437
secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730 secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730
users: users:
- 450841600726084717 - 450841600726084717
venue:
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
users:
- 450841600726084717

View File

@@ -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:
properties:
venue:
name: 江南体育中心通知群
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
users:
- 450841600726084717
script: script:
name: 脚本运行通知群
token: 4709b708d961846e0aee523c5abc3b67e8fa424ee292501d85efd4e504f15a8b token: 4709b708d961846e0aee523c5abc3b67e8fa424ee292501d85efd4e504f15a8b
secret: SEC768ed578c0fb31a9aec84b1c1db4f195f5aca203985bbb9d549e23e41c8874d1 secret: SEC768ed578c0fb31a9aec84b1c1db4f195f5aca203985bbb9d549e23e41c8874d1
users: users:
- 450841600726084717 - 450841600726084717
xb: xb:
name: 股票基金变化通知群
token: 340a9d39a5b0b6a52ba2262f9c27179cf50e3c8cfe6883ca082649d306038f41 token: 340a9d39a5b0b6a52ba2262f9c27179cf50e3c8cfe6883ca082649d306038f41
secret: SECe10ade3058880b84df5c6f46ab072c11f4ac2a5ef9f134d684705c2a3b004de2 secret: SECe10ade3058880b84df5c6f46ab072c11f4ac2a5ef9f134d684705c2a3b004de2
users: users:
- 450841600726084717 - 450841600726084717
venue:
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
users:
- 450841600726084717

View File

@@ -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,17 +50,22 @@ aliyun:
- test - test
dingtalk: dingtalk:
# 钉钉消息用户,用逗号隔开
userList: "450841600726084717"
# 钉钉消息群ID需要调用/chat/create api创建群返回
chatId: "chatd16d8daeea33b36b73588c676d508096"
robot: robot:
properties:
venue:
name: 江南体育中心通知群
token: 6a218646972c684c75832b0229ea93a234778af537d7469ce96bef290faf530e
secret: SEC9018755ba86d3e5c1ed2fbfa1d6953d84bb2a6c8ebe7ed4e318457bfed5e0465
users:
- 450841600726084717
script: script:
name: 脚本运行通知群
token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3 token: 797be7f32062e31dec1d567f8b490a5649a5366083618e236c7a1263df1f4af3
secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91 secret: SEC9aca642c0c29c9da261462869c464d34623247583d98fc82343a0a4464abbe91
users: users:
- 450841600726084717 - 450841600726084717
xb: xb:
name: 股票基金变化通知群
token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437 token: ad21ead99f0fdc63aa00d6732b7b0888c17590f7612c68297edfcb71844d1437
secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730 secret: SECc09d8aad6635f1a4cbadb7c0ab365523c46299f138438cd885e445e0f5f4d730
users: users:

View File

@@ -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