|
|
|
@ -66,9 +66,9 @@ public class IfsInspectionHistoryServiceImpl implements IfsInspectionHistoryServ |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<IfsInspectionHistoryDto> getIfsInspectionHistory() { |
|
|
|
public List<IfsInspectionHistoryDto> getIfsInspectionHistory(String site) { |
|
|
|
SysParam ifsSiteIdParam = new SysParam(); |
|
|
|
ifsSiteIdParam.setSite("55"); |
|
|
|
ifsSiteIdParam.setSite(site); |
|
|
|
ifsSiteIdParam.setGroupCode("IFS"); |
|
|
|
ifsSiteIdParam.setCode("ifsTransactionID"); |
|
|
|
String ifsTransId = baseMapper.getSysParamValue(ifsSiteIdParam); |
|
|
|
@ -78,7 +78,7 @@ public class IfsInspectionHistoryServiceImpl implements IfsInspectionHistoryServ |
|
|
|
Map<String, Object> params = Map.of( |
|
|
|
"ifsDBName", ifsDBName, |
|
|
|
"domainUserID", getCurrentDomainUserID(), |
|
|
|
"ifsSiteID", "55", |
|
|
|
"ifsSiteID", site, |
|
|
|
"ifsTransactionID", ifsTransId |
|
|
|
); |
|
|
|
|
|
|
|
@ -104,41 +104,6 @@ public class IfsInspectionHistoryServiceImpl implements IfsInspectionHistoryServ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<IfsInspectionHistoryDto> getIfsInspectionHistory(String ifsTransactionID) { |
|
|
|
try { |
|
|
|
log.info("开始调用IFS检验历史接口,事务ID: {}", ifsTransactionID); |
|
|
|
|
|
|
|
// 构建请求参数 |
|
|
|
Map<String, Object> params = Map.of( |
|
|
|
"ifsDBName", ifsDBName, |
|
|
|
"domainUserID", getCurrentDomainUserID(), |
|
|
|
"ifsSiteID", "55", |
|
|
|
"ifsTransactionID", ifsTransactionID != null ? ifsTransactionID : "100063053" |
|
|
|
); |
|
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
|
|
|
|
// 调用IFS接口 |
|
|
|
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "POInspectionHistory", jsonBody, null); |
|
|
|
|
|
|
|
// 解析响应数据 |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
List<IfsInspectionHistoryDto> historyList = mapper.readValue( |
|
|
|
ifsResponse, |
|
|
|
new TypeReference<List<IfsInspectionHistoryDto>>() {} |
|
|
|
); |
|
|
|
|
|
|
|
log.info("成功获取IFS检验历史数据,共{}条记录", historyList != null ? historyList.size() : 0); |
|
|
|
return historyList; |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("调用IFS检验历史接口失败: {}", e.getMessage(), e); |
|
|
|
throw new RuntimeException("获取IFS检验历史数据失败: " + e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void processInspectionHistory(List<IfsInspectionHistoryDto> historyList) { |
|
|
|
if (historyList == null || historyList.isEmpty()) { |
|
|
|
@ -305,10 +270,10 @@ public class IfsInspectionHistoryServiceImpl implements IfsInspectionHistoryServ |
|
|
|
log.info("开始执行IFS检验历史同步任务"); |
|
|
|
|
|
|
|
// 获取IFS检验历史数据 |
|
|
|
List<IfsInspectionHistoryDto> historyList = getIfsInspectionHistory(); |
|
|
|
/*List<IfsInspectionHistoryDto> historyList = getIfsInspectionHistory(); |
|
|
|
|
|
|
|
// 处理数据并更新本地记录 |
|
|
|
processInspectionHistory(historyList); |
|
|
|
processInspectionHistory(historyList);*/ |
|
|
|
|
|
|
|
log.info("IFS检验历史同步任务执行完成"); |
|
|
|
} catch (Exception e) { |
|
|
|
|