fix:获取出库堆叠点sqlsharding获取数据结果异常;opt:反馈任务完成时报错信息优化
This commit is contained in:
@@ -3,27 +3,18 @@
|
|||||||
<mapper namespace="org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper">
|
<mapper namespace="org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper">
|
||||||
<select id="queryKZPoint" resultType="com.alibaba.fastjson.JSONObject">
|
<select id="queryKZPoint" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
SELECT
|
SELECT
|
||||||
point.*,
|
sch_base_point.*,sale_order_name,package_box_sn
|
||||||
box.*,
|
|
||||||
sub.sale_order_name
|
|
||||||
FROM
|
FROM
|
||||||
sch_base_point point
|
sch_base_point
|
||||||
LEFT JOIN bst_ivt_boxinfo box ON point.vehicle_code = box.box_no
|
LEFT JOIN
|
||||||
LEFT JOIN (
|
pdm_bi_subpackagerelation sub
|
||||||
SELECT
|
ON sch_base_point.vehicle_code = sub.package_box_sn
|
||||||
MAX(sale_order_name) AS sale_order_name,
|
|
||||||
package_box_sn
|
|
||||||
FROM
|
|
||||||
pdm_bi_subpackagerelation
|
|
||||||
WHERE
|
|
||||||
1 = 1
|
|
||||||
group by package_box_sn
|
|
||||||
) sub ON point.vehicle_code = sub.package_box_sn
|
|
||||||
WHERE
|
WHERE
|
||||||
point.is_used = '1'
|
sch_base_point.is_used = '1'
|
||||||
AND point.is_delete = '0'
|
AND sch_base_point.is_delete = '0'
|
||||||
AND point.region_code = 'BKZ01'
|
AND sch_base_point.region_code = 'BKZ01'
|
||||||
ORDER BY out_empty_seq
|
GROUP BY sch_base_point.point_code
|
||||||
|
ORDER BY out_empty_seq
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryLikeOrderRow" resultType="com.alibaba.fastjson.JSONObject">
|
<select id="queryLikeOrderRow" resultType="com.alibaba.fastjson.JSONObject">
|
||||||
|
|||||||
@@ -39,12 +39,6 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void statementExecuteAfter(StatementProxy statement, String sql, boolean result) {
|
protected void statementExecuteAfter(StatementProxy statement, String sql, boolean result) {
|
||||||
String database="";
|
|
||||||
try {
|
|
||||||
ConnectionImpl connection = (ConnectionImpl)statement.getConnection();
|
|
||||||
database = connection.getDatabase();
|
|
||||||
}catch (Exception ex){
|
|
||||||
}
|
|
||||||
int size = statement.getParametersSize();
|
int size = statement.getParametersSize();
|
||||||
String executeSql = sql;
|
String executeSql = sql;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@@ -61,7 +55,7 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
}
|
}
|
||||||
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
executeSql = SQLUtils.format(executeSql, JdbcUtils.MYSQL, params);
|
||||||
}
|
}
|
||||||
log.info("[----SQL----][update][数据库:{}][ SQL: {} ]",database, executeSql);
|
log.info("[----SQL----][update][ SQL: {} ]", executeSql);
|
||||||
}
|
}
|
||||||
super.statementExecuteAfter(statement, sql, result);
|
super.statementExecuteAfter(statement, sql, result);
|
||||||
}
|
}
|
||||||
@@ -70,12 +64,6 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
public ResultSetProxy statement_getResultSet(FilterChain chain, StatementProxy statement) throws SQLException {
|
public ResultSetProxy statement_getResultSet(FilterChain chain, StatementProxy statement) throws SQLException {
|
||||||
ResultSetProxy rs = super.statement_getResultSet(chain, statement);
|
ResultSetProxy rs = super.statement_getResultSet(chain, statement);
|
||||||
String executeSql = statement.getLastExecuteSql();
|
String executeSql = statement.getLastExecuteSql();
|
||||||
String database="";
|
|
||||||
try {
|
|
||||||
ConnectionImpl connection = (ConnectionImpl)statement.getConnection();
|
|
||||||
database = connection.getDatabase();
|
|
||||||
}catch (Exception ex){
|
|
||||||
}
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (rs != null) {
|
if (rs != null) {
|
||||||
ResultSetImpl rss = rs.getResultSetRaw().unwrap(ResultSetImpl.class);
|
ResultSetImpl rss = rs.getResultSetRaw().unwrap(ResultSetImpl.class);
|
||||||
@@ -94,7 +82,7 @@ public class DruidFilter extends FilterEventAdapter {
|
|||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.warn("[-SQL解析异常-][{}]", ex.getMessage());
|
log.warn("[-SQL解析异常-][{}]", ex.getMessage());
|
||||||
}
|
}
|
||||||
log.info("[----SQL----][select][执行结果:{}][数据库:{}][ SQL: {} ]", result,database, executeSql);
|
log.info("[----SQL----][select][执行结果:{}][ SQL: {} ]", result, executeSql);
|
||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,9 +208,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
|
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
}catch (BadRequestException ex){
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").update(MapOf.of("remark",DateUtil.now()+"更新"+row.getString("task_status")+"失败"),"task_id = '" + task_id + "'");
|
|
||||||
log.error(task_id+"acs更新任务失败:{}", ex);
|
log.error(task_id+"acs更新任务失败:{}", ex);
|
||||||
|
WQLObject.getWQLObject("SCH_BASE_Task").update(MapOf.of("remark",DateUtil.now()+"更新"+row.getString("task_status")+"失败:"+ex.getMessage()),"task_id = '" + task_id + "'");
|
||||||
|
throw ex;
|
||||||
|
}catch (Exception ex){
|
||||||
|
log.error(task_id+"acs更新任务失败:{}", ex);
|
||||||
|
WQLObject.getWQLObject("SCH_BASE_Task").update(MapOf.of("remark",DateUtil.now()+"更新"+row.getString("task_status")+"失败,系统异常"),"task_id = '" + task_id + "'");
|
||||||
throw ex;
|
throw ex;
|
||||||
}finally {
|
}finally {
|
||||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||||
|
|||||||
@@ -144,10 +144,10 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
} else {
|
} else {
|
||||||
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
|
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
|
||||||
}
|
}
|
||||||
}catch (Exception ex){
|
}catch (BadRequestException ex){
|
||||||
WQLObject.getWQLObject("SCH_BASE_Task").update(MapOf.of("remark",DateUtil.now()+"更新"+MapUtil.getStr(map, "method_name")+"失败"),"task_id = '" + task_id + "'");
|
|
||||||
log.error(task_id+"手动更新任务失败:{}", ex);
|
log.error(task_id+"手动更新任务失败:{}", ex);
|
||||||
throw new BadRequestException(ex.getMessage());
|
WQLObject.getWQLObject("SCH_BASE_Task").update(MapOf.of("remark",DateUtil.now()+"更新"+MapUtil.getStr(map, "method_name")+"失败:"+ex.getMessage()),"task_id = '" + task_id + "'");
|
||||||
|
throw ex;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user