diff --git a/src/main/java/com/chint/application/in/OrderController.java b/src/main/java/com/chint/application/in/OrderController.java index 5ee193d9..3944499c 100644 --- a/src/main/java/com/chint/application/in/OrderController.java +++ b/src/main/java/com/chint/application/in/OrderController.java @@ -42,7 +42,7 @@ public class OrderController { @Autowired private RouteRequestDomainService routeRequestDomainService; - @Transactional + @ApiOperation("保存行程规划单") @PostMapping("/save") public Result creatOrder(@RequestBody OrderSaveData orderCreateData) { @@ -51,7 +51,7 @@ public class OrderController { } - @Transactional + @ApiOperation("同步行程规划单到供应商") @PostMapping("/sync") public Result syncOrder(@RequestBody SyncLegData syncLegData) { @@ -59,7 +59,7 @@ public class OrderController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("取消已同步的行程规划单") @PostMapping("/sync/cancel") public Result syncOrderCancel(@RequestBody SyncLegData syncLegData) { @@ -67,7 +67,7 @@ public class OrderController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("批量同步行程规划单到供应商") @PostMapping("/sync/batch") public Result syncOrderBatch(@RequestBody SyncLegData syncLegData) { @@ -80,7 +80,7 @@ public class OrderController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("修改规划节点关联的订单") @PostMapping("/leg/update") public Result updateLegOrder(@RequestBody UpdateLegData updateLegData) { @@ -88,7 +88,7 @@ public class OrderController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("添加行程节点") @PostMapping("/leg/add") public Result addLeg(@RequestBody AddLegData addLegData) { @@ -105,7 +105,7 @@ public class OrderController { } - @Transactional + @ApiOperation("删除行程节点") @PostMapping("/leg/delete") public Result deleteLeg(@RequestBody DeleteLegData deleteLegData) { diff --git a/src/main/java/com/chint/application/in/OrderPublicController.java b/src/main/java/com/chint/application/in/OrderPublicController.java index 14c89193..2195c3af 100644 --- a/src/main/java/com/chint/application/in/OrderPublicController.java +++ b/src/main/java/com/chint/application/in/OrderPublicController.java @@ -38,7 +38,7 @@ public class OrderPublicController { @Autowired private OrderDomainService orderDomainService; - @Transactional + @ApiOperation("提交审批行程规划单") @PostMapping("/approve") public Result approveOrder(@RequestBody ApproveRouteData approveRouteData) { @@ -48,7 +48,7 @@ public class OrderPublicController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("审批拒绝行程规划单") @PostMapping("/reject") public Result rejectOrder(@RequestBody ApproveRouteData approveRouteData) { @@ -56,7 +56,7 @@ public class OrderPublicController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("回复未同步行程规划单") @PostMapping("/recover") public Result recoverOrder(@RequestBody ApproveRouteData approvalLegData) { @@ -64,7 +64,7 @@ public class OrderPublicController { return Result.Success(SUCCESS); } - @Transactional + @ApiOperation("审批通过行程规划单") @PostMapping("/success") public Result approvalOrder(@RequestBody ApproveRouteData approvalLegData) { @@ -73,7 +73,6 @@ public class OrderPublicController { } - @Transactional @ApiOperation("根据行程节点号删除") @PostMapping("/leg/delete/legNo") public Result deleteLeg(@RequestBody DeleteLegData deleteLegData) { diff --git a/src/main/java/com/chint/application/services/OrderApplicationService.java b/src/main/java/com/chint/application/services/OrderApplicationService.java index 6e2ab60a..c8c2af82 100644 --- a/src/main/java/com/chint/application/services/OrderApplicationService.java +++ b/src/main/java/com/chint/application/services/OrderApplicationService.java @@ -199,7 +199,7 @@ public class OrderApplicationService { return legs; } - @Transactional + public RouteOrder deleteLegToOrder(DeleteLegData deleteLegData) { RouteOrder order = Optional.ofNullable(routeRepository.queryById(deleteLegData.getRouteId())) .orElseThrow(() -> new NotFoundException(CommonMessageConstant.NOT_FOUND)).reloadStatus(); diff --git a/src/main/java/com/chint/domain/service/RouteRequestDomainService.java b/src/main/java/com/chint/domain/service/RouteRequestDomainService.java index 80893dbe..f9176510 100644 --- a/src/main/java/com/chint/domain/service/RouteRequestDomainService.java +++ b/src/main/java/com/chint/domain/service/RouteRequestDomainService.java @@ -99,11 +99,11 @@ public class RouteRequestDomainService { legs.forEach(it -> it.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_NOT_ORDERED))); //这里执行同步 - syncAdapter.of(syncLegData.getSupplierName()).syncRouteRequest(routeRequest); - routeRequest.addEvent(RouteRequestEvent.sync(syncLegData.getSupplierName())); - - //通过保存聚合根来保存差旅申请单 - routeRepository.save(routeOrder); + if (syncAdapter.of(syncLegData.getSupplierName()).syncRouteRequest(routeRequest)) { + routeRequest.addEvent(RouteRequestEvent.sync(syncLegData.getSupplierName())); + //通过保存聚合根来保存差旅申请单 + routeRepository.save(routeOrder); + } return routeRequest; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 6ff5c8c9..a8247b5e 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -6,6 +6,14 @@ spring: url: jdbc:mysql://${chint.datasource.host}:${chint.datasource.port}/${chint.datasource.database}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: ${chint.datasource.username} password: ${chint.datasource.password} + hikari: + minimum-idle: 10 + maximum-pool-size: 30 # 连接池最大连接数 + idle-timeout: 300000 # 空闲连接超时时间(毫秒) + max-lifetime: 1800000 # 连接的最长生命周期(毫秒) + connection-timeout: 60000 # 连接超时时间(毫秒) + pool-name: 'SpringBootHikariCP' # 连接池名字 + leak-detection-threshold: 30000 # 连接泄露检测阈值(毫秒) data: redis: host: ${chint.redis.host}