Browse Source

fix(api): 修复IFS调用错误日志服务中的请求数据处理逻辑

- 移除从错误日志中重新构建请求参数的冗余代码
- 直接使用保存的请求数据避免潜在的数据不一致问题
- 简化请求处理流程提高代码可读性

refactor(sql): 修改wcs集成查询排序字段

- 将运输任务明细查询的排序字段由start_time改为task_no
- 提高查询结果的稳定性和预期性
master
常熟吴彦祖 4 weeks ago
parent
commit
a1bd94370b
  1. 28
      src/main/java/com/gaotao/modules/api/service/impl/IfsCallErrorLogServiceImpl.java
  2. 2
      src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

28
src/main/java/com/gaotao/modules/api/service/impl/IfsCallErrorLogServiceImpl.java

@ -283,34 +283,8 @@ public class IfsCallErrorLogServiceImpl extends ServiceImpl<IfsCallErrorLogMappe
String ifsResponse = null;
try {
// 1. 从错误日志中恢复请求参数 - rqrq
// if (errorLog.getRequestData() == null || errorLog.getRequestData().isEmpty()) {
// 如果没有保存请求数据重新构建 - rqrq
Map<String, Object> params = new HashMap<>();
params.put("ifsDBName", ifsDBName);
params.put("domainUserID", domainUserID);
params.put("ifsSiteID", errorLog.getSite());
params.put("partNo", errorLog.getPartNo());
params.put("qtyToIssue", errorLog.getQty());
params.put("locationNo", errorLog.getSourceLocation());
params.put("destLocationNo", errorLog.getDestLocation());
params.put("lotBatchNo", errorLog.getLotBatchNo());
if (errorLog.getExpiredDate() != null) {
params.put("expiryDate", new SimpleDateFormat("yyyy-MM-dd").format(errorLog.getExpiredDate()));
} else {
params.put("expiryDate", null);
}
ObjectMapper objectMapper = new ObjectMapper();
jsonBody = objectMapper.writeValueAsString(params);
// } else {
// // 使用保存的请求数据 - rqrq
// jsonBody = errorLog.getRequestData();
// }
//
System.out.println("请求数据: " + jsonBody);
jsonBody = errorLog.getRequestData();
System.out.println("请求数据: " + jsonBody);
// 2. 调用IFS接口 - rqrq
ifsResponse = HttpUtils.doPost(ifsUrl + errorLog.getInterfaceName(), jsonBody, null);

2
src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

@ -1914,7 +1914,7 @@
FROM wms_transport_task_detail WITH (NOLOCK)
WHERE action_type = '等待通道机复核'
AND status = '等待中'
ORDER BY start_time DESC
ORDER BY task_no DESC
</select>
<!-- rqrq - 更新任务明细的RFID复核结果 -->

Loading…
Cancel
Save