From 15b2a47fee6e99c681f27907524cd0b28c435a2d Mon Sep 17 00:00:00 2001 From: chengqf <584883665@139.com> Date: Sun, 16 Apr 2023 17:00:53 +0800 Subject: [PATCH] status --- .../idc/service/impl/IdcServiceImpl.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java index a0fc542..fde0f1e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java @@ -307,7 +307,7 @@ public class IdcServiceImpl implements IdcService { } else { saveIdcLog(tnames[9], "", tnames[2] + ">success(delete)", i * limit, total); } - syncAddTaskStatus(msg, isUpload ? 1 : 0, success, startTime, isUpload); + syncAddTaskStatus(msg, isUpload ? 1 : 0, true, startTime, isUpload,success); } } } @@ -426,11 +426,11 @@ public class IdcServiceImpl implements IdcService { } else { success = false; } - syncAddTaskStatus(json.getJSONObject("data"), 3, success, startTime, true); + syncAddTaskStatus(json.getJSONObject("data"), 3, true, startTime, true,success); } else { if (json.get("code") != null && json.get("data") != null) { //logger.info("res1-->"+JSON.toJSONString(json)); - syncAddTaskStatus(json.getJSONObject("data"), 0, success, startTime, true); + syncAddTaskStatus(json.getJSONObject("data"), 0, true, startTime, true,success); analyMiddle(host, json.getJSONObject("data"), files, false, false); } } @@ -518,7 +518,7 @@ public class IdcServiceImpl implements IdcService { boolean success = false; if (isLastLevel()) { success = analyMiddle("", json, files, true, true); - syncAddTaskStatus(json, 3, success, startTime, true); + syncAddTaskStatus(json, 3, true, startTime, true,success); if (!success) { return ResultVOUtils.error(9000, "解析失败"); @@ -529,11 +529,11 @@ public class IdcServiceImpl implements IdcService { String host = getNextHost(); String result = relay(request.getHeader("reqNo"), content, saveFiles, host); if (IDCUtils.isJson(result)) { - syncAddTaskStatus(json, 2, true, startTime, true); + syncAddTaskStatus(json, 2, true, startTime, true,true); BaseResponse object = JSON.parseObject(result, BaseResponse.class); return object; } else { - syncAddTaskStatus(json, 2, false, startTime, false); + syncAddTaskStatus(json, 2, true, startTime, false,false); return ResultVOUtils.error(9000, "转发失败"); } @@ -593,9 +593,6 @@ public class IdcServiceImpl implements IdcService { private void saveExportStatus(Map params) { Map map = new HashMap(); map.putAll(params); - map.put("receiveStatus", "0"); - - Map columns = getColumn("basic_export_status"); String sql = "replace basic_export_status " + DBAUtils.parseInsert(map, columns); @@ -604,7 +601,6 @@ public class IdcServiceImpl implements IdcService { private void saveDownloadStatus(Map params) { Map map = new HashMap(); - map.put("receiveStatus", "0"); map.putAll(params); Map columns = getColumn("basic_download_status"); @@ -764,7 +760,7 @@ public class IdcServiceImpl implements IdcService { } saveIdcLog(messageType, "", tableName + ">success", i * limit, total); } - syncAddTaskStatus(data, isUpload ? 1 : 0, success, startTime, isUpload); + syncAddTaskStatus(data, isUpload ? 1 : 0, true, startTime, isUpload,success); } } } @@ -776,7 +772,7 @@ public class IdcServiceImpl implements IdcService { /*增加同步任务状态*/ private void syncAddTaskStatus(Map json, int scheduleType, boolean success, Date startTime, - boolean isEnd) { + boolean isEnd,boolean isReceive) { try { String content = JSON.toJSONString(json); String datePath = DateUtil.formatDate(new Date(), "yyyy-MM-dd"); @@ -801,6 +797,7 @@ public class IdcServiceImpl implements IdcService { map.put("taskId", json.get("messageId")); map.put("cacheFilePath", fileName); map.put("status", success ? "1" : "0"); + map.put("receiveStatus", isReceive ? "1" : "0"); map.put("startTime", startTime != null ? startTime : new Date()); map.put("updateTime", new Date()); map.put("remark", json.get("messageType") + ": " + json.get("total") + "条"); @@ -1205,6 +1202,7 @@ public class IdcServiceImpl implements IdcService { map.put("filePathColumn", params.get("filePathColumn")); map.put("sendTime", new Date()); map.put("version", "1.0"); + map.put("level", 0); map.put("total", list.size()); map.put("data", list); return map;