记得上下班打卡 | git大法好,push需谨慎

Commit 3445f062 authored by 张国柄's avatar 张国柄

fix:mq.consumer;

parent 8d90fd70
......@@ -15,6 +15,9 @@ public class LiquidnetServiceException extends RuntimeException {
private String message;
private Object data;
public LiquidnetServiceException() {
}
public LiquidnetServiceException(String code, String message) {
super(message);
this.code = code;
......
package com.liquidnet.service.consumer.service.impl;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.consumer.service.IBaseDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
......@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.LinkedList;
import java.util.List;
@Service
public class BaseDao implements IBaseDao {
......@@ -37,7 +36,7 @@ public class BaseDao implements IBaseDao {
@Override
public Boolean doInTransaction(final TransactionStatus transactionStatus) {
if (values.size() > 0) {
jdbcTemplate.batchUpdate(sql, values);
int[] ints = jdbcTemplate.batchUpdate(sql, values);
}
return true;
}
......@@ -63,7 +62,13 @@ public class BaseDao implements IBaseDao {
break;
}
if (!o.isEmpty()) {
jdbcTemplate.batchUpdate(sql.get(i), o);
int[] ints = jdbcTemplate.batchUpdate(sql.get(i), o);
for (int c : ints) {
if (c <= 0) {
throw new LiquidnetServiceException();
}
}
}
i++;
}
......
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