From ba970be4e37f5f0a587a6903ed0f78e7581f9064 Mon Sep 17 00:00:00 2001 From: gongbaoxiong Date: Mon, 8 Jul 2024 14:59:29 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E5=A2=9E=E5=8A=A0=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/common/base/RestBusinessTemplate.java | 22 +++++++++++++++++++ .../controller/EasOutInBillController.java | 2 +- .../org/nl/wms/schedule/EasBillSchedule.java | 2 +- .../resources/config/application-devLocal.yml | 2 +- .../src/main/resources/config/application.yml | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/nlsso-server/src/main/java/org/nl/common/base/RestBusinessTemplate.java b/nlsso-server/src/main/java/org/nl/common/base/RestBusinessTemplate.java index e26a2da..a4a1ec5 100644 --- a/nlsso-server/src/main/java/org/nl/common/base/RestBusinessTemplate.java +++ b/nlsso-server/src/main/java/org/nl/common/base/RestBusinessTemplate.java @@ -58,6 +58,28 @@ public class RestBusinessTemplate { return result; } + + public static CommonResult execute1(VoidCallback callback) { + CommonResult result = new CommonResult<>(); + try { + callback.execute(); + result.setCode(ResultCode.SUCCESS.getCode()); + result.setDesc("推送中,如未审核成功,请查看单据审核结果信息。"); + } catch (BadRequestException e) { + log.error("", e); + ResultCode code = e.getCode() == null ? ResultCode.FAILED : e.getCode(); + result.setCode(code.getCode()); + result.setDesc(StringUtils.isBlank(e.getMessage()) ? code.getMsg() : e.getMessage()); + + } catch (Exception e) { + log.error("execute error", e); + result.setCode(ResultCode.FAILED.getCode()); + result.setDesc(ResultCode.FAILED.getMsg()); + } + return result; + } + + /** * 执行回调 * diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java index d5496f3..d3103a3 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillController.java @@ -56,7 +56,7 @@ public class EasOutInBillController { if (ids == null || ids.isEmpty()) { return CommonResult.failed(ResultCode.FAILED); } - return RestBusinessTemplate.execute(() -> easOutInBillService.audit(ids, true)); + return RestBusinessTemplate.execute1(() -> easOutInBillService.audit(ids, true)); } diff --git a/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java b/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java index 3d1e769..fe99310 100644 --- a/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java +++ b/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java @@ -84,7 +84,7 @@ public class EasBillSchedule { @Async("taskExecutor") - @Scheduled(cron = "0/90 * * * * *") + @Scheduled(cron = "0/120 * * * * *") public void insertUsers() { List newUsers =sysUserMapper.queryUserList(); List existingUsers =sysUserMapper.selectList(new LambdaQueryWrapper().eq(SysUser::getIs_used,"1")); diff --git a/nlsso-server/src/main/resources/config/application-devLocal.yml b/nlsso-server/src/main/resources/config/application-devLocal.yml index 4996698..7e15add 100644 --- a/nlsso-server/src/main/resources/config/application-devLocal.yml +++ b/nlsso-server/src/main/resources/config/application-devLocal.yml @@ -1,5 +1,5 @@ server: - port: 8011 + port: 8019 #配置数据源 spring: autoconfigure: diff --git a/nlsso-server/src/main/resources/config/application.yml b/nlsso-server/src/main/resources/config/application.yml index 54346a4..80ab787 100644 --- a/nlsso-server/src/main/resources/config/application.yml +++ b/nlsso-server/src/main/resources/config/application.yml @@ -4,7 +4,7 @@ server: relaxed-path-chars: [ '|','{','}','[',']' ] #字符问题: https://blog.csdn.net/weixin_41996632/article/details/90715118 spring: profiles: - active: devLocal + active: prod datasource: druid: initial-size: 5 #初始化时建立物理连接的个数