Commit fbc267e0 authored by Quxl's avatar Quxl

x

parent e2fd00ce
...@@ -34,17 +34,19 @@ public class QiyeWxMsgTask { ...@@ -34,17 +34,19 @@ public class QiyeWxMsgTask {
@Scheduled(cron="${qiyewx.msg.timer}") @Scheduled(cron="${qiyewx.msg.timer}")
public void execute() { public void execute() {
List<Map<String, Object>> list = jdbcTemplate.queryForList("select nID, sSMS from tSMS where sSendType = '2' and sChannelID = 'qywx' and sSendGroup = '6'"); List<Map<String, Object>> list = jdbcTemplate.queryForList("select nID, sSMS from tSMS where sSendType = '2' and sChannelID = 'qywx' and sSendGroup = '6'");
List<String> ids = list.stream().map(o -> (String)o.get("sSMS")).collect(Collectors.toList()); if(list.size() > 0) {
List<Map<String, Object>> subOrderList = jdbcTemplate.queryForList("select * from tSalesOrderSub where sSubOrderID in (" + StringUtil.join("', '", "'", "'", "''", ids) + ")"); List<String> ids = list.stream().map(o -> (String)o.get("sSMS")).collect(Collectors.toList());
Map<String, Map<String, Object>> mm = Util.listToMM(list, "sSMS"); List<Map<String, Object>> subOrderList = jdbcTemplate.queryForList("select * from tSalesOrderSub where sSubOrderID in (" + StringUtil.join("', '", "'", "'", "''", ids) + ")");
for(Map<String, Object> subOrderMap : subOrderList) { Map<String, Map<String, Object>> mm = Util.listToMM(list, "sSMS");
Map<String, Object> msg = mm.get(subOrderMap.get("sSubOrderID")); for(Map<String, Object> subOrderMap : subOrderList) {
Number msgId = (Number)msg.get("nId"); Map<String, Object> msg = mm.get(subOrderMap.get("sSubOrderID"));
try { Number msgId = (Number)msg.get("nId");
this.sendMessage(subOrderMap); try {
jdbcTemplate.executeUpdate("update tSMS set "); this.sendMessage(subOrderMap);
} catch (Exception e) { jdbcTemplate.executeUpdate("update tSMS set ");
jdbcTemplate.update("update tSMS set sSendErrorLog = ?, nRetry = isnull(nRetry,0) + 1 where nID = ?", ThrowableUtil.stackTraceToString(e), msgId.intValue()); } catch (Exception e) {
jdbcTemplate.update("update tSMS set sSendErrorLog = ?, nRetry = isnull(nRetry,0) + 1 where nID = ?", ThrowableUtil.stackTraceToString(e), msgId.intValue());
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment