From 37ab01578c69843550736d3bf098359c5f0664b5 Mon Sep 17 00:00:00 2001 From: dengwc Date: Mon, 26 Feb 2024 10:19:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?BPM=E8=B6=85=E6=A0=87=E3=80=81=E6=94=B9?= =?UTF-8?q?=E7=AD=BE=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/application/in/RankController.java | 6 +++ .../repository/TravelStandardsRepository.java | 2 + .../infrastructure/constant/BPMConstant.java | 2 +- .../TravelStandardsRepositoryImpl.java | 7 ++++ .../jdbc/JdbcTravelStandardsRepository.java | 1 + .../interfaces/rest/bpm/BPMController.java | 37 +++++++++++++++++++ .../chint/interfaces/rest/bpm/BPMRequest.java | 11 ++++-- .../interfaces/rest/bpm/dot/BPMBack.java | 9 +++++ .../rest/bpm/dot/BPMBaseResponse.java | 9 +++++ src/main/resources/application-test.yml | 5 ++- src/test/java/com/chint/LYTest.java | 31 ++++++++++------ 11 files changed, 103 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/chint/interfaces/rest/bpm/BPMController.java create mode 100644 src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java create mode 100644 src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBaseResponse.java diff --git a/src/main/java/com/chint/application/in/RankController.java b/src/main/java/com/chint/application/in/RankController.java index 6c00b2aa..c9df5646 100644 --- a/src/main/java/com/chint/application/in/RankController.java +++ b/src/main/java/com/chint/application/in/RankController.java @@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("/rank") public class RankController { @@ -89,6 +91,10 @@ public class RankController { .setProductType(String.valueOf(travelStandardsData.getProductType())) .setPrice(travelStandardsData.getPrice()) .setCityTag(travelStandardsData.getCityTag()); + List travelStandardsList = travelStandardsRepository.findByTravelStandards(travelStandards); + if (travelStandardsList.isEmpty()) { + return Result.error("该差标已经存在,不可重复添加!"); + } travelStandards = travelStandardsRepository.save(travelStandards); return Result.Success(CommonMessageConstant.SUCCESS, travelStandards); } diff --git a/src/main/java/com/chint/domain/repository/TravelStandardsRepository.java b/src/main/java/com/chint/domain/repository/TravelStandardsRepository.java index e8c5be77..702b2b0c 100644 --- a/src/main/java/com/chint/domain/repository/TravelStandardsRepository.java +++ b/src/main/java/com/chint/domain/repository/TravelStandardsRepository.java @@ -12,4 +12,6 @@ public interface TravelStandardsRepository { void saveAll(List travelStandardsList); List findByStandardLevel(String standardLevel); + List findByTravelStandards(TravelStandards travelStandards); + } diff --git a/src/main/java/com/chint/infrastructure/constant/BPMConstant.java b/src/main/java/com/chint/infrastructure/constant/BPMConstant.java index 715aa5a6..66a85b92 100644 --- a/src/main/java/com/chint/infrastructure/constant/BPMConstant.java +++ b/src/main/java/com/chint/infrastructure/constant/BPMConstant.java @@ -2,7 +2,7 @@ package com.chint.infrastructure.constant; public class BPMConstant { //BPM - public static final String EXCEED_STANDARD_URL = "http://10.207.0.245:8012/Portal/Webservices/ExternalStartService.asmx?op=StartWorkflowByEntityTransJson"; + public static final String EXCEED_STANDARD_URL = "/Portal/Webservices/ExternalStartService.asmx/StartWorkflowByEntityTransJson"; public static final String EXCEED_STANDARD_TYPE_TRAIN = "火车票超标";//方法名称 public static final String EXCEED_STANDARD_TYPE_HOTEL = "酒店超标";//方法名称 public static final String EXCEED_STANDARD_TYPE_FLIGHT = "机票超标";//方法名称 diff --git a/src/main/java/com/chint/infrastructure/repository/TravelStandardsRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/TravelStandardsRepositoryImpl.java index ac14c920..12ce94fb 100644 --- a/src/main/java/com/chint/infrastructure/repository/TravelStandardsRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/TravelStandardsRepositoryImpl.java @@ -30,4 +30,11 @@ public class TravelStandardsRepositoryImpl implements TravelStandardsRepository public List findByStandardLevel(String standardLevel) { return jdbcTravelStandardsRepository.findByStandardLevel(standardLevel); } + + @Override + public List findByTravelStandards(TravelStandards travelStandards) { + return jdbcTravelStandardsRepository.findByProductTypeAndStandardLevelAndCityTag( + travelStandards.getProductType(), travelStandards.getStandardLevel(), travelStandards.getCityTag()); + } + } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcTravelStandardsRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcTravelStandardsRepository.java index 729da6b9..889aacd5 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcTravelStandardsRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcTravelStandardsRepository.java @@ -11,4 +11,5 @@ import java.util.List; public interface JdbcTravelStandardsRepository extends CrudRepository { List findByStandardLevel(String standardLevel); + List findByProductTypeAndStandardLevelAndCityTag(String productType,String standardLevel,String cityTag); } diff --git a/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java b/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java new file mode 100644 index 00000000..57a24dfe --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java @@ -0,0 +1,37 @@ +package com.chint.interfaces.rest.bpm; + +import com.chint.domain.aggregates.standards.TravelStandards; +import com.chint.domain.value_object.TravelStandardsData; +import com.chint.infrastructure.constant.CommonMessageConstant; +import com.chint.infrastructure.util.Result; +import com.chint.interfaces.rest.bpm.dot.BPMBack; +import io.swagger.annotations.ApiOperation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/public/BPM") +public class BPMController { + //超标 + @ApiOperation("BPM超标审批结果回传") + @PostMapping("/exceedStandard/back") + public Result exceedStandardBack(@RequestBody BPMBack bpmBack) { + //获取订单号和审批结果 + + return Result.Success(CommonMessageConstant.SUCCESS); + } + + //改签 + @ApiOperation("BPM改签审批结果回传") + @PostMapping("/reschedule/back") + public Result rescheduleBack(@RequestBody BPMBack bpmBack) { + //获取订单号和审批结果 + + return Result.Success(CommonMessageConstant.SUCCESS); + } +} diff --git a/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java b/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java index c3f58808..15431c78 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java @@ -3,12 +3,14 @@ package com.chint.interfaces.rest.bpm; import com.chint.domain.aggregates.user.User; import com.chint.infrastructure.util.BaseContext; import com.chint.interfaces.rest.base.PostRequest; +import com.chint.interfaces.rest.bpm.dot.*; import com.chint.interfaces.rest.bpm.dto.BPMBaseRequest; import com.chint.interfaces.rest.bpm.dto.BPMResponse; import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto; import com.chint.interfaces.rest.bpm.dto.RescheduleDto; import com.google.gson.Gson; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL; @@ -20,6 +22,9 @@ public class BPMRequest { @Autowired private PostRequest httpPostRequest; + @Value("${bpm.testUrl}") + private String bpmUrl; + //超标申请 public BPMResponse exceedStandard(ExceedStandardDto exceedStandardDto) { return submitWorkflow("JT_FI_CLCESQ", exceedStandardDto); @@ -40,8 +45,8 @@ public class BPMRequest { .setUserCode(String.valueOf(user.getEmployeeNo()))//sf号 .setFinishStart(true)//true:会自动流转到下一审批点,false:停在手工填写节点 .setEntityParamValues(entityParamValues); - BPMResponse response = httpPostRequest.post(EXCEED_STANDARD_URL, bpmRequest, BPMResponse.class); - System.out.println("response = " + response); - return response; + BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl + EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); + System.out.println("response = " + bpmBaseResponse); + return bpmBaseResponse.getD(); } } diff --git a/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java b/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java new file mode 100644 index 00000000..475ce118 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java @@ -0,0 +1,9 @@ +package com.chint.interfaces.rest.bpm.dot; + +import lombok.Data; + +@Data +public class BPMBack { + private String OrderNo;//订单号 + private String result;//审批结果 +} diff --git a/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBaseResponse.java b/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBaseResponse.java new file mode 100644 index 00000000..3c2360d5 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBaseResponse.java @@ -0,0 +1,9 @@ +package com.chint.interfaces.rest.bpm.dot; + +import com.chint.interfaces.rest.bpm.dto.BPMResponse; +import lombok.Data; + +@Data +public class BPMBaseResponse { + private BPMResponse d; +} diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 2e315c72..3b9cd313 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -36,4 +36,7 @@ cTrip: corpId: zhengtai2024 appKey: obk_zhengtai2024 appSecurity: fI3}FZX+zUdxPa2W!R6I2gYO - requestSecret: zhengtai2024_nEbmKfOo \ No newline at end of file + requestSecret: zhengtai2024_nEbmKfOo + +bpm: + testUrl: http://10.207.0.245:8012 \ No newline at end of file diff --git a/src/test/java/com/chint/LYTest.java b/src/test/java/com/chint/LYTest.java index e2ac2f46..2f24954e 100644 --- a/src/test/java/com/chint/LYTest.java +++ b/src/test/java/com/chint/LYTest.java @@ -4,20 +4,19 @@ import com.chint.domain.aggregates.user.User; import com.chint.infrastructure.constant.LYConstant; import com.chint.infrastructure.util.BaseContext; import com.chint.interfaces.rest.base.PostRequest; +import com.chint.interfaces.rest.bpm.dot.*; import com.chint.interfaces.rest.ly.LYLoginRequest; import com.chint.interfaces.rest.ly.LYPostRequest; import com.chint.interfaces.rest.ly.LYTokenRequest; import com.chint.interfaces.rest.ly.LYUserRequest; import com.chint.interfaces.rest.ly.dto.applyordersync.*; -import com.chint.interfaces.rest.bpm.dto.BPMBaseRequest; -import com.chint.interfaces.rest.bpm.dto.BPMResponse; -import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto; -import com.chint.interfaces.rest.bpm.dto.RescheduleDto; import com.chint.interfaces.rest.ly.dto.commonresult.Result; import com.chint.interfaces.rest.ly.dto.estimateprice.*; import com.chint.interfaces.rest.ly.vo.estimateprice.TrainPriceVo; import com.google.gson.Gson; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import java.math.BigDecimal; @@ -26,6 +25,8 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Map; +import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL; + @SpringBootTest public class LYTest { @@ -45,6 +46,9 @@ public class LYTest { @Autowired private PostRequest httpPostRequest; + @Value("${bpm.testUrl}") + private String bpmUrl; + public static final String L_Y_BASE_URL = "https://api.qa.dttrip.cn/openapi"; public static final String L_Y_ORDER_PATH = "/openapi/api/TravelApplyOrder/ApplyOrderSync"; @@ -64,8 +68,7 @@ public class LYTest { private final String minPriceUrl = L_Y_BASE_URL + L_Y_HOTLE_MIN_PRICE_PATH; private final String hotleListUrl = L_Y_BASE_URL + L_Y_HOTLE_LIST_PATH; - private final String ExceedStandardUrl = "http://10.207.0.245:8012/Portal/Webservices/ExternalStartService.asmx?op=StartWorkflowByEntityTransJson"; - + private final String ExceedStandardUrl = "http://10.207.0.245:8012/Portal/Webservices/ExternalStartService.asmx/StartWorkflowByEntityTransJson"; private User user = new User(1L, 230615020L, 1, "卢麟哲", "1033719135@qq.com", "15857193365"); private User hxh = new User(1L, 231116009L, 1, "黄小恒", "1628870217@qq.com", "18296007063"); @@ -282,17 +285,17 @@ public class LYTest { // @Test void loginLY() { BaseContext.setCurrentUser(user); - System.out.println(loginRequest.login(LYConstant.L_Y_ENTRANCE_HOME,null)); + System.out.println(loginRequest.login(LYConstant.L_Y_ENTRANCE_HOME, null)); } // @Test void loginLYPC() { BaseContext.setCurrentUser(user); - System.out.println(loginRequest.loginPC(LYConstant.L_Y_ENTRANCE_HOME,null)); + System.out.println(loginRequest.loginPC(LYConstant.L_Y_ENTRANCE_HOME, null)); } //超标 -// @Test + @Test void exceedStandard() { BPMBaseRequest bpmRequest = new BPMBaseRequest(); Gson gson = new Gson(); @@ -312,12 +315,14 @@ public class LYTest { .setUserCode("231116011")//sf号 .setFinishStart(true)//true:会自动流转到下一审批点,false:停在手工填写节点 .setEntityParamValues(entityParamValues); - BPMResponse response = httpPostRequest.post(ExceedStandardUrl, bpmRequest, BPMResponse.class); + BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl+EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); + System.out.println("response = " + bpmBaseResponse); + BPMResponse response = bpmBaseResponse.getD(); System.out.println("response = " + response); } //改签 -// @Test + @Test void reschedule() { BPMBaseRequest bpmRequest = new BPMBaseRequest(); Gson gson = new Gson(); @@ -338,7 +343,9 @@ public class LYTest { .setUserCode("231116011")//sf号 .setFinishStart(true)//true:会自动流转到下一审批点,false:停在手工填写节点 .setEntityParamValues(entityParamValues); - BPMResponse response = httpPostRequest.post(ExceedStandardUrl, bpmRequest, BPMResponse.class); + BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl+EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); + System.out.println("response = " + bpmBaseResponse); + BPMResponse response = bpmBaseResponse.getD(); System.out.println("response = " + response); } From 984b584dc6d51f81d1800a22a23f7813e6200092 Mon Sep 17 00:00:00 2001 From: dengwc Date: Mon, 26 Feb 2024 10:21:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?BPM=E8=B6=85=E6=A0=87=E3=80=81=E6=94=B9?= =?UTF-8?q?=E7=AD=BE=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/com/chint/LYTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/com/chint/LYTest.java b/src/test/java/com/chint/LYTest.java index 2f24954e..5846af9d 100644 --- a/src/test/java/com/chint/LYTest.java +++ b/src/test/java/com/chint/LYTest.java @@ -5,6 +5,10 @@ import com.chint.infrastructure.constant.LYConstant; import com.chint.infrastructure.util.BaseContext; import com.chint.interfaces.rest.base.PostRequest; import com.chint.interfaces.rest.bpm.dot.*; +import com.chint.interfaces.rest.bpm.dto.BPMBaseRequest; +import com.chint.interfaces.rest.bpm.dto.BPMResponse; +import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto; +import com.chint.interfaces.rest.bpm.dto.RescheduleDto; import com.chint.interfaces.rest.ly.LYLoginRequest; import com.chint.interfaces.rest.ly.LYPostRequest; import com.chint.interfaces.rest.ly.LYTokenRequest; From e4ffad832cda157ba7f3bdcc2b300a4b9091c809 Mon Sep 17 00:00:00 2001 From: dengwc Date: Mon, 26 Feb 2024 15:00:44 +0800 Subject: [PATCH 3/3] =?UTF-8?q?BPM=E8=B6=85=E6=A0=87=E5=9B=9E=E6=8E=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=91=E8=B5=B7=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infrastructure/constant/BPMConstant.java | 4 +++- .../chint/interfaces/rest/bpm/BPMController.java | 11 +++++++++-- .../com/chint/interfaces/rest/bpm/BPMRequest.java | 8 ++++---- .../chint/interfaces/rest/bpm/dot/BPMBack.java | 5 +++-- src/main/resources/application-dev.yml | 3 +++ src/main/resources/application-test.yml | 2 +- src/test/java/com/chint/LYTest.java | 15 ++++++++------- 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/chint/infrastructure/constant/BPMConstant.java b/src/main/java/com/chint/infrastructure/constant/BPMConstant.java index 66a85b92..33d0efc8 100644 --- a/src/main/java/com/chint/infrastructure/constant/BPMConstant.java +++ b/src/main/java/com/chint/infrastructure/constant/BPMConstant.java @@ -2,7 +2,9 @@ package com.chint.infrastructure.constant; public class BPMConstant { //BPM - public static final String EXCEED_STANDARD_URL = "/Portal/Webservices/ExternalStartService.asmx/StartWorkflowByEntityTransJson"; + + public static final String H3BPM = "H3BPM"; + public static final String H3BPM_EXCEED_STANDARD_URL = "/Portal/Webservices/ExternalStartService.asmx/StartWorkflowByEntityTransJson"; public static final String EXCEED_STANDARD_TYPE_TRAIN = "火车票超标";//方法名称 public static final String EXCEED_STANDARD_TYPE_HOTEL = "酒店超标";//方法名称 public static final String EXCEED_STANDARD_TYPE_FLIGHT = "机票超标";//方法名称 diff --git a/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java b/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java index 57a24dfe..8ae3319f 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/BPMController.java @@ -2,10 +2,12 @@ package com.chint.interfaces.rest.bpm; import com.chint.domain.aggregates.standards.TravelStandards; import com.chint.domain.value_object.TravelStandardsData; +import com.chint.infrastructure.constant.BPMConstant; import com.chint.infrastructure.constant.CommonMessageConstant; import com.chint.infrastructure.util.Result; import com.chint.interfaces.rest.bpm.dot.BPMBack; import io.swagger.annotations.ApiOperation; +import org.springframework.data.repository.query.Param; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -14,6 +16,8 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; +import static com.chint.infrastructure.constant.BPMConstant.H3BPM; + @RestController @RequestMapping("/public/BPM") public class BPMController { @@ -21,8 +25,11 @@ public class BPMController { @ApiOperation("BPM超标审批结果回传") @PostMapping("/exceedStandard/back") public Result exceedStandardBack(@RequestBody BPMBack bpmBack) { - //获取订单号和审批结果 - + //H3BPM平台 + if (H3BPM.equals(bpmBack.getTag())) { + System.out.println("H3BPM"); + } + System.out.println("bpmBack = " + bpmBack); return Result.Success(CommonMessageConstant.SUCCESS); } diff --git a/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java b/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java index 15431c78..61877ba8 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/BPMRequest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL; +import static com.chint.infrastructure.constant.BPMConstant.H3BPM_EXCEED_STANDARD_URL; @Service @@ -22,8 +22,8 @@ public class BPMRequest { @Autowired private PostRequest httpPostRequest; - @Value("${bpm.testUrl}") - private String bpmUrl; + @Value("${bpm.H3BPMUrl}") + private String H3BPMUrl; //超标申请 public BPMResponse exceedStandard(ExceedStandardDto exceedStandardDto) { @@ -45,7 +45,7 @@ public class BPMRequest { .setUserCode(String.valueOf(user.getEmployeeNo()))//sf号 .setFinishStart(true)//true:会自动流转到下一审批点,false:停在手工填写节点 .setEntityParamValues(entityParamValues); - BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl + EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); + BPMBaseResponse bpmBaseResponse = httpPostRequest.post(H3BPMUrl + H3BPM_EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); System.out.println("response = " + bpmBaseResponse); return bpmBaseResponse.getD(); } diff --git a/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java b/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java index 475ce118..bc9c0a62 100644 --- a/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java +++ b/src/main/java/com/chint/interfaces/rest/bpm/dot/BPMBack.java @@ -4,6 +4,7 @@ import lombok.Data; @Data public class BPMBack { - private String OrderNo;//订单号 - private String result;//审批结果 + private String tag;//BPM平台:H3BPM/其它 + private String orderNo;//订单号 + private String result;//审批结果:通过/拒绝 } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 799d13ca..4d435a38 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -24,3 +24,6 @@ cTrip: appKey: obk_zhengtai2024 appSecurity: fI3}FZX+zUdxPa2W!R6I2gYO requestSecret: zhengtai2024_nEbmKfOo + +bpm: + H3BPMUrl: http://10.207.0.245:8012 \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 3b9cd313..16f9b167 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -39,4 +39,4 @@ cTrip: requestSecret: zhengtai2024_nEbmKfOo bpm: - testUrl: http://10.207.0.245:8012 \ No newline at end of file + H3BPMUrl: http://10.207.0.245:8012 \ No newline at end of file diff --git a/src/test/java/com/chint/LYTest.java b/src/test/java/com/chint/LYTest.java index 5846af9d..2dedcd46 100644 --- a/src/test/java/com/chint/LYTest.java +++ b/src/test/java/com/chint/LYTest.java @@ -29,7 +29,8 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Map; -import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL; + +import static com.chint.infrastructure.constant.BPMConstant.H3BPM_EXCEED_STANDARD_URL; @SpringBootTest public class LYTest { @@ -50,8 +51,8 @@ public class LYTest { @Autowired private PostRequest httpPostRequest; - @Value("${bpm.testUrl}") - private String bpmUrl; + @Value("${bpm.H3BPMUrl}") + private String H3BPMUrl; public static final String L_Y_BASE_URL = "https://api.qa.dttrip.cn/openapi"; @@ -306,20 +307,20 @@ public class LYTest { ExceedStandardDto exceedStandardDto = new ExceedStandardDto(); exceedStandardDto.setOrderType("酒店超标")//内容选项:酒店超标,火车票超标,机票超标 .setOrderSource("携程商旅")//内容选项:携程商旅/同程商旅 - .setOrderNo("00002")//订单号 + .setOrderNo("001021214")//订单号 .setHotelStandard("标间")//酒店超标提供:住宿标准 .setHotelName("酒店名称")//酒店超标提供:酒店名称 .setHouseLayout("双人床")//酒店超标提供:房型 .setSeatingStandard("")//火车票超标提供:席别标准 .setCabinClass("")//:机票超标提供:舱等 - .setExcessAmount(BigDecimal.valueOf(100))//超标金额 + .setExcessAmount(BigDecimal.valueOf(1000))//超标金额 .setReason("酒店爆满订不到");//超标原因 String entityParamValues = gson.toJson(exceedStandardDto); bpmRequest.setWorkflowCode("JT_FI_CLCESQ")//流程编码 .setUserCode("231116011")//sf号 .setFinishStart(true)//true:会自动流转到下一审批点,false:停在手工填写节点 .setEntityParamValues(entityParamValues); - BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl+EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); + BPMBaseResponse bpmBaseResponse = httpPostRequest.post(H3BPMUrl + H3BPM_EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); System.out.println("response = " + bpmBaseResponse); BPMResponse response = bpmBaseResponse.getD(); System.out.println("response = " + response); @@ -347,7 +348,7 @@ public class LYTest { .setUserCode("231116011")//sf号 .setFinishStart(true)//true:会自动流转到下一审批点,false:停在手工填写节点 .setEntityParamValues(entityParamValues); - BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl+EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); + BPMBaseResponse bpmBaseResponse = httpPostRequest.post(H3BPMUrl + H3BPM_EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class); System.out.println("response = " + bpmBaseResponse); BPMResponse response = bpmBaseResponse.getD(); System.out.println("response = " + response);