This commit is contained in:
Leo
2025-03-01 23:39:55 +08:00
parent a394f7f268
commit 41fae55b3f
5 changed files with 87 additions and 53 deletions

View File

@@ -303,16 +303,21 @@ public class JDUtil {
@Scheduled(cron = "0 0 */4 * * ?")
public void fetchHistoricalOrders3090() {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
try {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
}
fetchHistoricalOrders3090Do(appKey, secretKey);
}
fetchHistoricalOrders3090Do(appKey, secretKey);
} catch (Exception e) {
logger.error("拉取历史订单3090异常", e);
}
}
private int fetchHistoricalOrders3090Do(String appKey, String secretKey) {
@@ -369,16 +374,21 @@ public class JDUtil {
*/
@Scheduled(cron = "0 0 * * * ?")
public void fetchHistoricalOrders1430() {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
try {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
}
fetchHistoricalOrders1430Do(appKey, secretKey);
}
fetchHistoricalOrders1430Do(appKey, secretKey);
}catch (Exception e){
logger.error("拉取历史订单1430异常", e);
}
}
private int fetchHistoricalOrders1430Do(String appKey, String secretKey) {
@@ -433,16 +443,21 @@ public class JDUtil {
*/
@Scheduled(cron = "0 0 * * * ?")
public void fetchHistoricalOrders0714() {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
try {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
}
fetchHistoricalOrders0714Do(appKey, secretKey);
}
fetchHistoricalOrders0714Do(appKey, secretKey);
}catch (Exception e){
logger.error("拉取历史订单0714异常", e);
}
}
private int fetchHistoricalOrders0714Do(String appKey, String secretKey) {
@@ -493,16 +508,21 @@ public class JDUtil {
@Scheduled(cron = "0 */5 * * * ?")
public void fetchHistoricalOrders0007() {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
try {
for (Map.Entry<String, WXUtil.SuperAdmin> entry : super_admins.entrySet()) {
//String wxid = entry.getKey();
WXUtil.SuperAdmin admin = entry.getValue();
String appKey = admin.getAppKey();
String secretKey = admin.getSecretKey();
if (Util.isAnyEmpty(appKey, secretKey)) {
continue;
}
fetchHistoricalOrders0007Do(appKey, secretKey);
}
fetchHistoricalOrders0007Do(appKey, secretKey);
}catch (Exception e){
logger.error("拉取历史订单0007异常", e);
}
}
private int fetchHistoricalOrders0007Do(String appKey, String secretKey) {
@@ -1197,11 +1217,11 @@ public void sendOrderToWxByOrderDefault(String order, String fromWxid) {
switch (state.getCurrentState()) {
case "INIT":
if ("消毒柜".equals(message)) {
if ("订单".equals(message)) {
//1查询消毒柜订单2输入新的订单3修改订单
String sb = """
请选择您要执行的操作:
1查询消毒柜订单
1查询订单
2输入新的订单
3修改订单""";
wxUtil.sendTextMessage(fromWxid, sb, 1, fromWxid);
@@ -1216,6 +1236,7 @@ public void sendOrderToWxByOrderDefault(String order, String fromWxid) {
String sb = "";
wxUtil.sendTextMessage(fromWxid, sb, 1, fromWxid);
state.setCurrentState("INIT");
logger.debug("User {} queried disinfectant cabinet orders", fromWxid);

View File

@@ -255,7 +255,7 @@ private void handlePrivateMessage(WxMessage wxMessage) throws Exception {
logger.info("消息内容为空,不处理");
return;
} else {
logger.info("消息内容:" + innerData.getMsg());
logger.info("消息内容:{}", innerData.getMsg());
}
String fromWxid = innerData.getFromWxid();