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 #初始化时建立物理连接的个数