From cd155b7a2533b0f844f769ca5ea76c1e6414cc5b Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Thu, 24 Apr 2025 10:04:33 +0800 Subject: [PATCH 1/8] update --- .../com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy index ededaa1db..6e2acda2c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy @@ -39,7 +39,7 @@ class AliyunSmsClient { //必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式;发送国际/港澳台消息时,接收号码格式为00+国际区号+号码,如“0085200000000” request.setPhoneNumbers(phoneNumber) //必填:短信签名-可在短信控制台中找到 - request.setSignName("房价网") + request.setSignName("上海估家") //必填:短信模板-可在短信控制台中找到 request.setTemplateCode(templateCode); //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 @@ -52,7 +52,7 @@ class AliyunSmsClient { } public static void main(String[] args) { - sendSms("15021384995", "SMS_482915107", '{"code":12345}') + sendSms("13061966193", "SMS_483925328", '{"code":5555}') } From 2522680e7206d0ebca281ede19246559906c704e Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Thu, 24 Apr 2025 10:27:30 +0800 Subject: [PATCH 2/8] add LOGGER --- .../groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy index a5f95e6e2..b29d21e54 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy @@ -316,6 +316,7 @@ class SMSOutgoingListener extends BaseBatch { if(StringUtils.isNotBlank(checkCode)){ JSONObject con = new JSONObject() con.put("code", checkCode); + println("mobile:"+mobile+" code:"+checkCode) return AliyunSmsClient.sendSms(mobile, "SMS_483345375", con.toString()) } } From 70fcc203577214a088d7eb0c098b89bef3240d98 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Thu, 24 Apr 2025 10:27:54 +0800 Subject: [PATCH 3/8] update --- .../com/fangjia/script/gj/xiamen/SeaweedDataSynch.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SeaweedDataSynch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SeaweedDataSynch.groovy index 983be0fe7..5b847f91c 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SeaweedDataSynch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/xiamen/SeaweedDataSynch.groovy @@ -157,15 +157,15 @@ class SeaweedDataSynch extends BaseBatch{ def dists = updating(c, "district") updateEs(c, dists, "district", "192.168.0.89") -// updateEs(c, dists, "district", "192.168.0.52") + updateEs(c, dists, "district", "192.168.0.52") def offices = updating(c, "office") updateEs(c, offices, "office", "192.168.0.89") -// updateEs(c, offices, "office", "192.168.0.52") + updateEs(c, offices, "office", "192.168.0.52") def shops = updating(c, "shop") updateEs(c, shops, "shop", "192.168.0.89") -// updateEs(c, shops, "shop", "192.168.0.52") + updateEs(c, shops, "shop", "192.168.0.52") println index +" "+ c + " 完成 "+new Date().toString() } From 9118b112c206b7c2e0885bcf22d8f8d669653dca Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Thu, 24 Apr 2025 13:42:32 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/jms/SMSOutgoingListener.groovy | 62 ++++++++----------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy index b29d21e54..d62834084 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy @@ -41,7 +41,7 @@ class SMSOutgoingListener extends BaseBatch { public static final int MAX_SYS_SEND_COUNT = 4000 //设置Web Service服务器,该服务器用于接收信息 public static final List TASK_QUEUE = Collections.synchronizedList(new ArrayList()) - public static final List ADMINISTRATORS = [Watcher.DuXiaoYu.mobile, Watcher.WangWenYan.mobile, "13621625626"] + public static final List ADMINISTRATORS = [ Watcher.WangWenYan.mobile, "13621625626"] /**初始化手机号白名单和黑名单*/ public static def MOBILE_LIST = [ : ] @@ -93,35 +93,38 @@ class SMSOutgoingListener extends BaseBatch { new Thread(){ @Override void run() { - while(true){ - try{ synchronized(TASK_QUEUE){ println("..........................................-->开始消费:" + new Date().format("HH:mm:ss")) Iterator iter = TASK_QUEUE.iterator(); while (iter.hasNext()){ - def msg = iter.next() - def mobile = msg.getObject().mobile - def logs = LOG_COLL.find(new BasicDBObject("mobile",mobile)).sort(new BasicDBObject("c_date", -1)).limit(1).toArray() - if(logs.size() == 0){ - consumerQueue(msg) - iter.remove() - }else{ - def lastSendTime = (Date)logs[0].get("c_date") - long interval = new Date().getTime() - lastSendTime.getTime() - if(interval > 1000 * 60 * 2){ - consumerQueue(msg) - iter.remove() - }else{ - int count = smsSendCount(mobile, 10) - if(count < 7){ + try{ + def msg = iter.next() + def mobile = msg.getObject().mobile + def logs = LOG_COLL.find(new BasicDBObject("mobile",mobile)).sort(new BasicDBObject("c_date", -1)).limit(1).toArray() + if(logs.size() == 0){ consumerQueue(msg) iter.remove() - }else { - println "$mobile 短信发送频繁 延后再发" + }else{ + def lastSendTime = (Date)logs[0].get("c_date") + long interval = new Date().getTime() - lastSendTime.getTime() + if(interval > 1000 * 60 * 2){ + consumerQueue(msg) + iter.remove() + }else{ + int count = smsSendCount(mobile, 10) + if(count < 7){ + consumerQueue(msg) + iter.remove() + }else { + println "$mobile 短信发送频繁 延后再发" + } + } } + }catch(Exception e){ + println "Error:"+e.getMessage() + iter.remove() } - } } if(TASK_QUEUE.isEmpty()){ TASK_QUEUE.wait() @@ -129,9 +132,7 @@ class SMSOutgoingListener extends BaseBatch { sleep(100) } } - }catch(Exception e){ - println "Error:"+e.getMessage() - } + println("..........................................") } @@ -273,19 +274,6 @@ class SMSOutgoingListener extends BaseBatch { } } - /** - * 监控短信使用量 - * @return - */ - def monitorUsage(){ - int amount = (int)(SingletonClient.getClient().balance * 10) - if(amount < 1000 && amount % 300 == 0 && amount != 0){//调用失败时为0 - ADMINISTRATORS.each {phone-> - jms.sendSms(phone, "短信剩余量:${amount} 请尽快充值!!".toString(), false) - } - } - println("短信剩余数量" + amount) - } /** * 是否是白名单手机号 From 7ab3c27d3ee085321e8e190405f6c8b7433cee5c Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Fri, 25 Apr 2025 09:52:15 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=A8=A1=E7=89=88code=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy index d62834084..94aa4c948 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy @@ -305,7 +305,7 @@ class SMSOutgoingListener extends BaseBatch { JSONObject con = new JSONObject() con.put("code", checkCode); println("mobile:"+mobile+" code:"+checkCode) - return AliyunSmsClient.sendSms(mobile, "SMS_483345375", con.toString()) + return AliyunSmsClient.sendSms(mobile, "SMS_483925328", con.toString()) } } int resCode = SingletonClient.getClient().sendSMS([mobile] as String[],content, 5) From e084b669a17b2c66b94c60e557fbfa65758d70d8 Mon Sep 17 00:00:00 2001 From: majintao Date: Fri, 25 Apr 2025 16:38:39 +0800 Subject: [PATCH 6/8] =?UTF-8?q?ApiInvokeStatistics=E4=BF=AE=E6=94=B9mongo?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy index d0c89f4fc..5040d77a8 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/hubingliang/ApiInvokeStatistics.groovy @@ -25,7 +25,7 @@ import com.mongodb.DBObject class ApiInvokeStatistics extends BaseBatch{ final static def mongoDomain = "mongo.db.fangjia.com" public static final DBCollection OPEN_URI_LOG = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log") - public static final DBCollection OPEN_URI_LOG_COUNT = MongoUtils.getCollectionByName("business", "api_invoke_statistical", "mongo.db.fangjia.com", 27017) + public static final DBCollection OPEN_URI_LOG_COUNT = MongoUtils.getCollectionByName("business", "api_invoke_statistical", "mongo.db.fangjia.com", 28017) static final dbFangjia = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/fangjia?autoReconnect=true&characterEncoding=utf-8&autoReconnect=true", "sa", "G00jia", "com.mysql.jdbc.Driver"); static main(args) { def s = System.currentTimeMillis() From 45efa9442e123532efe5f4b783f7b6bf3ccf257d Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Fri, 25 Apr 2025 16:53:14 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy | 4 ++-- .../com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy index 94aa4c948..32b03f995 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/SMSOutgoingListener.groovy @@ -166,7 +166,7 @@ class SMSOutgoingListener extends BaseBatch { def mobile = msg.getObject().mobile String content = msg.getObject().msgContent.trim() - content = content.replace("【房价网】", "【上海估家】") + content = content.replace("【房价网】", "【上海估家网络科技】") if(!content.startsWith("【")){ content = "【上海估家】" + content; } @@ -305,7 +305,7 @@ class SMSOutgoingListener extends BaseBatch { JSONObject con = new JSONObject() con.put("code", checkCode); println("mobile:"+mobile+" code:"+checkCode) - return AliyunSmsClient.sendSms(mobile, "SMS_483925328", con.toString()) + return AliyunSmsClient.sendSms(mobile, "SMS_485015075", con.toString()) } } int resCode = SingletonClient.getClient().sendSMS([mobile] as String[],content, 5) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy index 6e2acda2c..6c99e17d1 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/jms/aliyun/AliyunSmsClient.groovy @@ -39,7 +39,7 @@ class AliyunSmsClient { //必填:待发送手机号。支持以逗号分隔的形式进行批量调用,批量上限为1000个手机号码,批量调用相对于单条调用及时性稍有延迟,验证码类型的短信推荐使用单条调用的方式;发送国际/港澳台消息时,接收号码格式为00+国际区号+号码,如“0085200000000” request.setPhoneNumbers(phoneNumber) //必填:短信签名-可在短信控制台中找到 - request.setSignName("上海估家") + request.setSignName("上海估家网络科技") //必填:短信模板-可在短信控制台中找到 request.setTemplateCode(templateCode); //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 @@ -52,7 +52,7 @@ class AliyunSmsClient { } public static void main(String[] args) { - sendSms("13061966193", "SMS_483925328", '{"code":5555}') + sendSms("15021384995", "SMS_485015075", '{"code":6666}') } From cf10901ed6dc1cae7e54a764ed1cb1b22ec5b389 Mon Sep 17 00:00:00 2001 From: liuhongyang Date: Sun, 27 Apr 2025 09:48:06 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=95=86=E9=93=BA=E6=A0=B7=E6=9C=AC?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=B010=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fangjia/service/datastore/AiShopServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/AiShopServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/AiShopServiceImpl.java index 245dcfccd..0bf6cf150 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/AiShopServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/AiShopServiceImpl.java @@ -325,7 +325,7 @@ public class AiShopServiceImpl implements AiShopService { query.setCityDisplay(evaluation.getCity()); Pager pager = new Pager(); pager.setStartRow(0); - pager.setPageSize(5); + pager.setPageSize(10); query.setPager(pager); query.setTable("latest_seawater"); List shops = seawaterService.findSeawatersByQuery(query); @@ -378,7 +378,7 @@ public class AiShopServiceImpl implements AiShopService { query.setCityDisplay(evaluation.getCity()); Pager pager = new Pager(); pager.setStartRow(0); - pager.setPageSize(5); + pager.setPageSize(10); query.setPager(pager); query.setTable("latest_seawater"); List shops = seawaterService.findSeawatersByQuery(query);