Merge branch 'master' of http://1.14.125.6:3000/mianbin/ops-pro
This commit is contained in:
commit
9118a68c7b
@ -82,4 +82,6 @@ public class ReportResp {
|
|||||||
private Integer fail;
|
private Integer fail;
|
||||||
private Integer success;
|
private Integer success;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -140,8 +140,12 @@ public class ApplicationWorker extends HttpWorker {
|
|||||||
req.setScaTaskId(scaTaskId);
|
req.setScaTaskId(scaTaskId);
|
||||||
ReportResp reportResp = reportService.assetReportTask(req);
|
ReportResp reportResp = reportService.assetReportTask(req);
|
||||||
if (!ObjectUtils.isEmpty(reportResp)){
|
if (!ObjectUtils.isEmpty(reportResp)){
|
||||||
applicationConfigInfo.put("reportId",reportResp.getId());
|
if (reportResp.getMessage().equals("success")){
|
||||||
applicationConfigInfo.put("reportName",reportResp.getName());
|
append(context,"回调报告生成接口成功");
|
||||||
|
applicationConfigInfo.put("reportId",reportResp.getId());
|
||||||
|
}else {
|
||||||
|
append(context,"回调报告生成接口失败,scaTaskId = " + scaTaskId + "=====错误原因=====" + reportResp.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新scaTaskId数据到task表
|
//更新scaTaskId数据到task表
|
||||||
@ -165,8 +169,6 @@ public class ApplicationWorker extends HttpWorker {
|
|||||||
append(context,message);
|
append(context,message);
|
||||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-应用包审查分析节点执行失败");
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-应用包审查分析节点执行失败");
|
||||||
}
|
}
|
||||||
// Thread.currentThread().interrupt();
|
|
||||||
toBadEnding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> applicationConfigInfo, File file) {
|
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> applicationConfigInfo, File file) {
|
||||||
|
@ -116,8 +116,12 @@ public class CodingWorker extends HttpWorker {
|
|||||||
req.setScaTaskId(scaTaskId);
|
req.setScaTaskId(scaTaskId);
|
||||||
ReportResp reportResp = reportService.assetReportTask(req);
|
ReportResp reportResp = reportService.assetReportTask(req);
|
||||||
if (!ObjectUtils.isEmpty(reportResp)){
|
if (!ObjectUtils.isEmpty(reportResp)){
|
||||||
codingConfigInfo.put("reportId",reportResp.getId());
|
if (reportResp.getMessage().equals("success")){
|
||||||
codingConfigInfo.put("reportName",reportResp.getName());
|
append(context,"回调报告生成接口成功");
|
||||||
|
codingConfigInfo.put("reportId",reportResp.getId());
|
||||||
|
}else {
|
||||||
|
append(context,"回调报告生成接口失败,scaTaskId = " + scaTaskId + "=====错误原因=====" + reportResp.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新scaTaskId数据到task表
|
//更新scaTaskId数据到task表
|
||||||
|
@ -148,8 +148,12 @@ public class ScaBinaryWorker extends HttpWorker {
|
|||||||
req.setScaTaskId(scaTaskId);
|
req.setScaTaskId(scaTaskId);
|
||||||
ReportResp reportResp = reportService.assetReportTask(req);
|
ReportResp reportResp = reportService.assetReportTask(req);
|
||||||
if (!ObjectUtils.isEmpty(reportResp)){
|
if (!ObjectUtils.isEmpty(reportResp)){
|
||||||
scaBinaryConfigInfo.put("reportId",reportResp.getId());
|
if (reportResp.getMessage().equals("success")){
|
||||||
scaBinaryConfigInfo.put("reportName",reportResp.getName());
|
append(context,"回调报告生成接口成功");
|
||||||
|
scaBinaryConfigInfo.put("reportId",reportResp.getId());
|
||||||
|
}else {
|
||||||
|
append(context,"回调报告生成接口失败,scaTaskId = " + scaTaskId + "=====错误原因=====" + reportResp.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新scaTaskId数据到task表
|
//更新scaTaskId数据到task表
|
||||||
@ -174,8 +178,6 @@ public class ScaBinaryWorker extends HttpWorker {
|
|||||||
append(context,message);
|
append(context,message);
|
||||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
||||||
}
|
}
|
||||||
// Thread.currentThread().interrupt();
|
|
||||||
toBadEnding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaBinaryConfigInfo, File file) {
|
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaBinaryConfigInfo, File file) {
|
||||||
|
@ -145,8 +145,12 @@ public class ScaMirrorWorker extends HttpWorker {
|
|||||||
req.setScaTaskId(scaTaskId);
|
req.setScaTaskId(scaTaskId);
|
||||||
ReportResp reportResp = reportService.assetReportTask(req);
|
ReportResp reportResp = reportService.assetReportTask(req);
|
||||||
if (!ObjectUtils.isEmpty(reportResp)){
|
if (!ObjectUtils.isEmpty(reportResp)){
|
||||||
scaMirrorConfigInfo.put("reportId",reportResp.getId());
|
if (reportResp.getMessage().equals("success")){
|
||||||
scaMirrorConfigInfo.put("reportName",reportResp.getName());
|
append(context,"回调报告生成接口成功");
|
||||||
|
scaMirrorConfigInfo.put("reportId",reportResp.getId());
|
||||||
|
}else {
|
||||||
|
append(context,"回调报告生成接口失败,scaTaskId = " + scaTaskId + "=====错误原因=====" + reportResp.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新scaTaskId数据到task表
|
//更新scaTaskId数据到task表
|
||||||
@ -171,8 +175,6 @@ public class ScaMirrorWorker extends HttpWorker {
|
|||||||
append(context,message);
|
append(context,message);
|
||||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
||||||
}
|
}
|
||||||
// Thread.currentThread().interrupt();
|
|
||||||
toBadEnding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaMirrorConfigInfo, File file) {
|
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaMirrorConfigInfo, File file) {
|
||||||
|
@ -142,8 +142,12 @@ public class ScaSbomWorker extends HttpWorker {
|
|||||||
req.setScaTaskId(scaTaskId);
|
req.setScaTaskId(scaTaskId);
|
||||||
ReportResp reportResp = reportService.assetReportTask(req);
|
ReportResp reportResp = reportService.assetReportTask(req);
|
||||||
if (!ObjectUtils.isEmpty(reportResp)){
|
if (!ObjectUtils.isEmpty(reportResp)){
|
||||||
scaSbomConfigInfo.put("reportId",reportResp.getId());
|
if (reportResp.getMessage().equals("success")){
|
||||||
scaSbomConfigInfo.put("reportName",reportResp.getName());
|
append(context,"回调报告生成接口成功");
|
||||||
|
scaSbomConfigInfo.put("reportId",reportResp.getId());
|
||||||
|
}else {
|
||||||
|
append(context,"回调报告生成接口失败,scaTaskId = " + scaTaskId + "=====错误原因=====" + reportResp.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新scaTaskId数据到task表
|
//更新scaTaskId数据到task表
|
||||||
@ -157,7 +161,7 @@ public class ScaSbomWorker extends HttpWorker {
|
|||||||
Integer oldScaTaskId = (Integer) scaSbomConfigInfo.get("scaTaskId");
|
Integer oldScaTaskId = (Integer) scaSbomConfigInfo.get("scaTaskId");
|
||||||
Integer oldApplicationId = (Integer) scaSbomConfigInfo.get("applicationId");
|
Integer oldApplicationId = (Integer) scaSbomConfigInfo.get("applicationId");
|
||||||
append(context,"跳过上传步骤,获取scaTaskId:"+oldScaTaskId);
|
append(context,"跳过上传步骤,获取scaTaskId:"+oldScaTaskId);
|
||||||
append(context,"重新运行上一次的,scaTaskId:"+oldScaTaskId);
|
append(context,"重新运行上一次的,applicationId:"+oldApplicationId);
|
||||||
int restartResult = reStartTask(restTemplate, oldApplicationId,context);
|
int restartResult = reStartTask(restTemplate, oldApplicationId,context);
|
||||||
if (restartResult != 0) {
|
if (restartResult != 0) {
|
||||||
return;
|
return;
|
||||||
@ -168,8 +172,7 @@ public class ScaSbomWorker extends HttpWorker {
|
|||||||
append(context,message);
|
append(context,message);
|
||||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
||||||
}
|
}
|
||||||
// Thread.currentThread().interrupt();
|
|
||||||
toBadEnding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaSbomConfigInfo, File file) {
|
private MultiValueMap<String, Object> buildRequestBody(Map<String, Object> scaSbomConfigInfo, File file) {
|
||||||
|
@ -151,16 +151,17 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
log.info("根据任务ID列表生成检测报告:" + reportDeleteUrl);
|
log.info("根据任务ID列表生成检测报告:" + reportDeleteUrl);
|
||||||
JSONObject response = restTemplate.postForObject(reportDeleteUrl, requestEntity, JSONObject.class);
|
JSONObject response = restTemplate.postForObject(reportDeleteUrl, requestEntity, JSONObject.class);
|
||||||
String message = response.getString("message");
|
String message = response.getString("message");
|
||||||
|
ReportResp reportResp = new ReportResp();
|
||||||
if (message.equals("success")) {
|
if (message.equals("success")) {
|
||||||
ReportResp reportResp = new ReportResp();
|
|
||||||
log.info("===============根据任务ID列表生成检测报告成功=================");
|
log.info("===============根据任务ID列表生成检测报告成功=================");
|
||||||
setReportAssetResp(response.getString("xmTraceId"),reportResp);
|
setReportAssetResp(response.getString("xmTraceId"),response.getInteger("data"),reportResp);
|
||||||
|
|
||||||
return reportResp;
|
return reportResp;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
reportResp.setMessage(message);
|
||||||
log.error("===============根据任务ID列表生成检测报告失败=================");
|
log.error("===============根据任务ID列表生成检测报告失败=================");
|
||||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"根据任务ID列表生成检测报告失败");
|
return reportResp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,8 +295,10 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
reportResp.setXmTraceId(xmTraceId);
|
reportResp.setXmTraceId(xmTraceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setReportAssetResp(String xmTraceId, ReportResp reportResp) {
|
private void setReportAssetResp(String xmTraceId, Integer data, ReportResp reportResp) {
|
||||||
reportResp.setXmTraceId(xmTraceId);
|
reportResp.setXmTraceId(xmTraceId);
|
||||||
|
reportResp.setMessage("success");
|
||||||
|
reportResp.setId(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user