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