From b06a0be9a3194dccd2ee7a125bba7d70585a30c3 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Wed, 24 Sep 2025 21:32:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E6=89=B9=E9=87=8F=E5=8F=91?= =?UTF-8?q?=E9=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warning/ScheduledCheckWarning.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/ScheduledCheckWarning.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/ScheduledCheckWarning.java index 4de4f4db..22fd7394 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/ScheduledCheckWarning.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warning/ScheduledCheckWarning.java @@ -70,7 +70,7 @@ public class ScheduledCheckWarning { */ private String getCronFromDatabase() { // 这里假设从数据库中获取 cron 表达式 - //return "0 */1 * * * ?"; +// return "0 0/1 * * * ?"; return "0 0 9 ? * WED,FRI"; } @@ -98,23 +98,26 @@ public class ScheduledCheckWarning { String content = "截止当天" + bean.getProjectName() +","+ bean.getTypeName() +"共" +bean.getWarnNum() + "件工器具已临检检验有效期30天,请尽快退回机具(物流)分公司复检,明细请登录机具管理系统查看"; // 省公司短信发送 - List mobileList = new ArrayList(); + List mobileList = new ArrayList<>(); List userList = mapper.getUserList(bean); if(userList !=null && userList.size()>0){ for (UseMaintenanceWarningBean item : userList){ UseMaintenanceWarningBean item1 = mapper.getUserPhoneById(item); - if(item1.getClzPhone() != null){ - mobileList.add(item1.getClzPhone()); + if(StringUtils.isNotBlank(item1.getClzPhone())){ + mobileList.add(new SmsParam(item1.getClzPhone(), content)); } } } - - mobileList.add(leaderPhone); - mobileList.add(engPhone); + if(StringUtils.isNotBlank(leaderPhone)){ + mobileList.add(new SmsParam(leaderPhone, content)); + } + if(StringUtils.isNotBlank(engPhone)){ + mobileList.add(new SmsParam(engPhone, content)); + } System.out.println("短信发送成功: " + mobileList); if (CollectionUtils.isNotEmpty(mobileList)){ - JSONObject sendResult = SmsTool.sendSms(new BatchSmsByContentParam(mobileList, content), BmConfigItems.ANHUI_COMPANY_SMS_KEY); + JSONObject sendResult = SmsTool.sendSms(mobileList, BmConfigItems.ANHUI_COMPANY_SMS_KEY); if (sendResult != null && !sendResult.isEmpty()) { log.info("短信发送成功: {}", sendResult); System.out.println("短信发送成功: " + sendResult); @@ -138,20 +141,20 @@ public class ScheduledCheckWarning { String content2 = "截止当天" + bean2.getProjectName() +","+ bean2.getTypeName() +"共"+ bean2.getWarnNum() + "件工器具已临检检验有效期15天,请尽快退回机具(物流)分公司复检,明细请登录机具管理系统查看"; // 省公司短信发送 - List mobileList2 = new ArrayList(); + List mobileList2 = new ArrayList<>(); List userManger = mapper.getUserManger(bean2); if(userManger !=null && userManger.size()>0){ for (UseMaintenanceWarningBean item : userManger){ UseMaintenanceWarningBean item1 = mapper.getUserPhoneById(item); if(item1.getClzPhone() != null){ - mobileList2.add(item1.getClzPhone()); + mobileList2.add(new SmsParam(item1.getClzPhone(), content2)); } } } System.out.println("短信发送成功: " + mobileList2); if (CollectionUtils.isNotEmpty(mobileList2)){ - JSONObject sendResult = SmsTool.sendSms(new BatchSmsByContentParam(mobileList2, content2), BmConfigItems.ANHUI_COMPANY_SMS_KEY); + JSONObject sendResult = SmsTool.sendSms(mobileList2, BmConfigItems.ANHUI_COMPANY_SMS_KEY); if (sendResult != null && !sendResult.isEmpty()) { log.info("短信发送成功: {}", sendResult); System.out.println("短信发送成功: " + sendResult);