Commit fbc267e0 authored by Quxl's avatar Quxl

x

parent e2fd00ce
......@@ -34,17 +34,19 @@ public class QiyeWxMsgTask {
@Scheduled(cron="${qiyewx.msg.timer}")
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<String> ids = list.stream().map(o -> (String)o.get("sSMS")).collect(Collectors.toList());
List<Map<String, Object>> subOrderList = jdbcTemplate.queryForList("select * from tSalesOrderSub where sSubOrderID in (" + StringUtil.join("', '", "'", "'", "''", ids) + ")");
Map<String, Map<String, Object>> mm = Util.listToMM(list, "sSMS");
for(Map<String, Object> subOrderMap : subOrderList) {
Map<String, Object> msg = mm.get(subOrderMap.get("sSubOrderID"));
Number msgId = (Number)msg.get("nId");
try {
this.sendMessage(subOrderMap);
jdbcTemplate.executeUpdate("update tSMS set ");
} catch (Exception e) {
jdbcTemplate.update("update tSMS set sSendErrorLog = ?, nRetry = isnull(nRetry,0) + 1 where nID = ?", ThrowableUtil.stackTraceToString(e), msgId.intValue());
if(list.size() > 0) {
List<String> ids = list.stream().map(o -> (String)o.get("sSMS")).collect(Collectors.toList());
List<Map<String, Object>> subOrderList = jdbcTemplate.queryForList("select * from tSalesOrderSub where sSubOrderID in (" + StringUtil.join("', '", "'", "'", "''", ids) + ")");
Map<String, Map<String, Object>> mm = Util.listToMM(list, "sSMS");
for(Map<String, Object> subOrderMap : subOrderList) {
Map<String, Object> msg = mm.get(subOrderMap.get("sSubOrderID"));
Number msgId = (Number)msg.get("nId");
try {
this.sendMessage(subOrderMap);
jdbcTemplate.executeUpdate("update tSMS set ");
} 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