From ffb57c836e574bc0f696bfe018ed589245c42fb9 Mon Sep 17 00:00:00 2001 From: nixj Date: Fri, 24 May 2024 08:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E9=AB=98=E5=8E=8B?= =?UTF-8?q?=E7=B3=BB=E7=BB=9FBPM=E6=8E=A8=E9=80=81=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=A0=87=E8=AF=86=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + .../domain/service/BPMOrderDomainService.java | 14 ++++++++++++++ .../JdbcRouteCustomExtensionFieldRepository.java | 13 +++++++++++++ .../rest/bpm/dto/ExceedStandardDto.java | 2 ++ src/test/java/com/chint/ManageTest.java | 16 ++++++++++++++++ 5 files changed, 46 insertions(+) create mode 100644 src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteCustomExtensionFieldRepository.java diff --git a/README.md b/README.md index 5acee48a..c8273454 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ dao层 ### service 登录、订单、行程等service方法和实现类 +#### BPMOrderDomainService 超标推送 ### value_object 实体类,有部分只创建了个类 ## infrastructure diff --git a/src/main/java/com/chint/domain/service/BPMOrderDomainService.java b/src/main/java/com/chint/domain/service/BPMOrderDomainService.java index a0181fc4..6a4d4bc3 100644 --- a/src/main/java/com/chint/domain/service/BPMOrderDomainService.java +++ b/src/main/java/com/chint/domain/service/BPMOrderDomainService.java @@ -3,6 +3,7 @@ package com.chint.domain.service; import com.chint.application.commands.BPMAuditCommand; import com.chint.domain.aggregates.order.Leg; import com.chint.domain.aggregates.order.OrderDetail; +import com.chint.domain.aggregates.order.RouteCustomExtensionField; import com.chint.domain.aggregates.order.RouteOrder; import com.chint.domain.aggregates.system.ProcessInitiationControl; import com.chint.domain.aggregates.user.User; @@ -12,6 +13,7 @@ import com.chint.infrastructure.constant.CommonMessageConstant; import com.chint.infrastructure.repository.jdbc.JdbcLegRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository; import com.chint.infrastructure.repository.jdbc.JdbcProcessInitiationControlRepository; +import com.chint.infrastructure.repository.jdbc.JdbcRouteCustomExtensionFieldRepository; import com.chint.infrastructure.util.DelayDispatch; import com.chint.interfaces.rest.bpm.BPMParamFactory; import com.chint.interfaces.rest.bpm.BPMRequest; @@ -83,6 +85,9 @@ public class BPMOrderDomainService { @Autowired private UserRepository userRepository; + @Autowired + private JdbcRouteCustomExtensionFieldRepository jdbcRouteCustomExtensionFieldRepository; + //超标 @Transactional public void toBpmAuditETA(BPMAuditCommand command) { @@ -144,6 +149,15 @@ public class BPMOrderDomainService { if (StringUtils.isNotBlank(command.getReason())) { exceedStandardDto.setReason(command.getReason()); } + //加入高压系统标识 + String filterFieldName="S_sysCode"; + String filterFileValue="GYBPM"; + List list = jdbcRouteCustomExtensionFieldRepository.findByRouteId(routeOrder.getRouteId()) + .stream().filter(s -> s.getFieldName().equals(filterFieldName) && s.getFieldValue().equals(filterFileValue)).toList(); + if (!list.isEmpty()) { + exceedStandardDto.setFieldName(filterFieldName); + exceedStandardDto.setFieldValue(filterFileValue); + } boolean success=bpmRequest.exceedStandard(exceedStandardDto, sysCode, employeeNo, accountCompany).getSuccess(); DelayDispatch.attemptToSend(() -> success, 0); diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteCustomExtensionFieldRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteCustomExtensionFieldRepository.java new file mode 100644 index 00000000..b2c3e570 --- /dev/null +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteCustomExtensionFieldRepository.java @@ -0,0 +1,13 @@ +package com.chint.infrastructure.repository.jdbc; + +import com.chint.domain.aggregates.order.RouteCustomExtensionField; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface JdbcRouteCustomExtensionFieldRepository extends CrudRepository { + + List findByRouteId(Long routeId); +} diff --git a/src/main/java/com/chint/interfaces/rest/bpm/dto/ExceedStandardDto.java b/src/main/java/com/chint/interfaces/rest/bpm/dto/ExceedStandardDto.java index 7c829bd5..2e7a6ac3 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/dto/ExceedStandardDto.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/dto/ExceedStandardDto.java @@ -26,5 +26,7 @@ public class ExceedStandardDto { private String Occupant; //入住人 是否必填:否 当订单类型=酒店超标 时需提供 private Integer days; //入住天数 是否必填:否 当订单类型=酒店超标 时需提供 private BigDecimal ExcessAmountDay; //超标金额(元/天) 是否必填:否 当订单类型=酒店超标 时需提供 + private String fieldName; //系统名 + private String fieldValue; //系统标识 } diff --git a/src/test/java/com/chint/ManageTest.java b/src/test/java/com/chint/ManageTest.java index e6467160..1d5a4562 100644 --- a/src/test/java/com/chint/ManageTest.java +++ b/src/test/java/com/chint/ManageTest.java @@ -1,7 +1,9 @@ package com.chint; import com.chint.domain.aggregates.order.OrderDetail; +import com.chint.domain.aggregates.order.RouteCustomExtensionField; import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository; +import com.chint.infrastructure.repository.jdbc.JdbcRouteCustomExtensionFieldRepository; import com.chint.infrastructure.util.PageResult; import com.chint.manage.entity.OrderDownloadRecord; import com.chint.manage.entity.OrderExceedStandard; @@ -20,6 +22,7 @@ import org.springframework.data.domain.Page; import java.math.BigDecimal; import java.util.Date; +import java.util.List; @SpringBootTest public class ManageTest { @@ -32,6 +35,19 @@ public class ManageTest { @Autowired private JdbcConsumptionDetailRepositoryImpl jdbcConsumptionDetailRepository; + @Autowired + private JdbcRouteCustomExtensionFieldRepository jdbcRouteCustomExtensionFieldRepository; + + @Test + void route(){ + List list = jdbcRouteCustomExtensionFieldRepository.findByRouteId(11804L) + .stream().filter(s -> s.getFieldName().equals("S_sysCode") && s.getFieldValue().equals("GYBPM")).toList(); + if (!list.isEmpty()) { + System.out.println(111); + } + + } + @Test void recordAdd(){