|
|
@@ -12,6 +12,7 @@ import com.uas.platform.core.persistence.criteria.SimpleExpression;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
@@ -36,6 +37,9 @@ public class ErrorLogServiceImpl implements ErrorLogService {
|
|
|
*/
|
|
|
static final String UU_REGEXP = "^\\d{4,}$";
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 通过关键词分页查询B2B接口错误日志
|
|
|
@@ -49,16 +53,14 @@ public class ErrorLogServiceImpl implements ErrorLogService {
|
|
|
@Override
|
|
|
public Page<ErrorLog> findErrLogsByPageInfo(final PageInfo info, String keyword, Long fromDate, Long endDate) {
|
|
|
if (!StringUtils.isEmpty(keyword)) {
|
|
|
- SimpleExpression userName = new SimpleExpression("userName", keyword, CriterionExpression.Operator.LIKE, true);
|
|
|
SimpleExpression enName = new SimpleExpression("enName", keyword, CriterionExpression.Operator.LIKE, true);
|
|
|
if (keyword.matches(UU_REGEXP)) {
|
|
|
SimpleExpression enUU = new SimpleExpression("enUU", keyword, CriterionExpression.Operator.EQ, true);
|
|
|
- SimpleExpression userUU = new SimpleExpression("userUU", keyword, CriterionExpression.Operator.EQ, true);
|
|
|
- SimpleExpression[] expressions = new SimpleExpression[]{userName, enUU, enName, userUU};
|
|
|
+ SimpleExpression[] expressions = new SimpleExpression[]{enUU, enName};
|
|
|
LogicalExpression logical = new LogicalExpression(expressions, CriterionExpression.Operator.OR);
|
|
|
info.expression(logical);
|
|
|
} else {
|
|
|
- SimpleExpression[] expressions = new SimpleExpression[]{userName, enName};
|
|
|
+ SimpleExpression[] expressions = new SimpleExpression[]{enName};
|
|
|
LogicalExpression logical = new LogicalExpression(expressions, CriterionExpression.Operator.OR);
|
|
|
info.expression(logical);
|
|
|
}
|
|
|
@@ -77,4 +79,15 @@ public class ErrorLogServiceImpl implements ErrorLogService {
|
|
|
}
|
|
|
}, info);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过主表id查询参数详情
|
|
|
+ *
|
|
|
+ * @param id 主表id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String findParameters(Long id) {
|
|
|
+ return jdbcTemplate.queryForObject("select log_parameters from log$error$detail where log_logid = " + id, String.class);
|
|
|
+ }
|
|
|
}
|