From 70b2ab5eaca87cd21c93298b1f91b84a22363efd Mon Sep 17 00:00:00 2001 From: zpl Date: Mon, 18 Oct 2021 11:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=8F=91=E6=97=B6=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=8E=A5=E5=8F=A3=E6=97=A5=E5=BF=97=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IntegrationLogController.java | 16 ++++++++++--- .../service/IntegrationLogService.java | 4 +++- .../impl/IntegrationLogServiceImpl.java | 23 +++++++++++++------ 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java b/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java index 37f3e2cf..ba7a3345 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/controller/IntegrationLogController.java @@ -22,11 +22,21 @@ public class IntegrationLogController { @ResponseBody @PostMapping("redoSend") public R shopOrderRelease(@RequestBody List integrationLogs) { - + StringBuffer stringBuffer = new StringBuffer(""); for (IntegrationLog integrationLog: integrationLogs) { - integrationLogService.redoSend(integrationLog.getHandle()); + try { + String str = integrationLogService.redoSend(integrationLog.getHandle()); + if (str != null){ + stringBuffer.append("ERP接口错误:" + str + ";"); + } + }catch (Exception e){ + return R.failed("重发失败:" + e.getMessage()); + } + } + if (stringBuffer.toString().equals("")){ + return R.ok(); } - return R.ok(); + return R.failed(stringBuffer); } } \ No newline at end of file diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java index d077611b..7a3cf16a 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/IntegrationLogService.java @@ -15,6 +15,8 @@ public interface IntegrationLogService extends IService { void saveIntegrationLog(IntegrationLog integrationLog); - void redoSend(String handle); + void updateIntegrationLog(IntegrationLog integrationLog); + + String redoSend(String handle); } \ No newline at end of file diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java index 0aa978a1..b4a9704b 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/IntegrationLogServiceImpl.java @@ -12,6 +12,7 @@ import com.foreverwin.mesnac.integration.mapper.IntegrationLogMapper; import com.foreverwin.mesnac.integration.model.IntegrationLog; import com.foreverwin.mesnac.integration.service.IntegrationLogService; import com.foreverwin.modular.core.exception.BaseException; +import com.foreverwin.modular.core.exception.BusinessException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; @@ -43,7 +44,13 @@ public class IntegrationLogServiceImpl extends ServiceImpl