BPM超标、改签流程发起测试

This commit is contained in:
dengwc 2024-02-26 10:19:51 +08:00
parent c4885c2aa8
commit 37ab01578c
11 changed files with 103 additions and 17 deletions

View File

@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController @RestController
@RequestMapping("/rank") @RequestMapping("/rank")
public class RankController { public class RankController {
@ -89,6 +91,10 @@ public class RankController {
.setProductType(String.valueOf(travelStandardsData.getProductType())) .setProductType(String.valueOf(travelStandardsData.getProductType()))
.setPrice(travelStandardsData.getPrice()) .setPrice(travelStandardsData.getPrice())
.setCityTag(travelStandardsData.getCityTag()); .setCityTag(travelStandardsData.getCityTag());
List<TravelStandards> travelStandardsList = travelStandardsRepository.findByTravelStandards(travelStandards);
if (travelStandardsList.isEmpty()) {
return Result.error("该差标已经存在,不可重复添加!");
}
travelStandards = travelStandardsRepository.save(travelStandards); travelStandards = travelStandardsRepository.save(travelStandards);
return Result.Success(CommonMessageConstant.SUCCESS, travelStandards); return Result.Success(CommonMessageConstant.SUCCESS, travelStandards);
} }

View File

@ -12,4 +12,6 @@ public interface TravelStandardsRepository {
void saveAll(List<TravelStandards> travelStandardsList); void saveAll(List<TravelStandards> travelStandardsList);
List<TravelStandards> findByStandardLevel(String standardLevel); List<TravelStandards> findByStandardLevel(String standardLevel);
List<TravelStandards> findByTravelStandards(TravelStandards travelStandards);
} }

View File

@ -2,7 +2,7 @@ package com.chint.infrastructure.constant;
public class BPMConstant { public class BPMConstant {
//BPM //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_TRAIN = "火车票超标";//方法名称
public static final String EXCEED_STANDARD_TYPE_HOTEL = "酒店超标";//方法名称 public static final String EXCEED_STANDARD_TYPE_HOTEL = "酒店超标";//方法名称
public static final String EXCEED_STANDARD_TYPE_FLIGHT = "机票超标";//方法名称 public static final String EXCEED_STANDARD_TYPE_FLIGHT = "机票超标";//方法名称

View File

@ -30,4 +30,11 @@ public class TravelStandardsRepositoryImpl implements TravelStandardsRepository
public List<TravelStandards> findByStandardLevel(String standardLevel) { public List<TravelStandards> findByStandardLevel(String standardLevel) {
return jdbcTravelStandardsRepository.findByStandardLevel(standardLevel); return jdbcTravelStandardsRepository.findByStandardLevel(standardLevel);
} }
@Override
public List<TravelStandards> findByTravelStandards(TravelStandards travelStandards) {
return jdbcTravelStandardsRepository.findByProductTypeAndStandardLevelAndCityTag(
travelStandards.getProductType(), travelStandards.getStandardLevel(), travelStandards.getCityTag());
}
} }

View File

@ -11,4 +11,5 @@ import java.util.List;
public interface JdbcTravelStandardsRepository extends CrudRepository<TravelStandards, Integer> { public interface JdbcTravelStandardsRepository extends CrudRepository<TravelStandards, Integer> {
List<TravelStandards> findByStandardLevel(String standardLevel); List<TravelStandards> findByStandardLevel(String standardLevel);
List<TravelStandards> findByProductTypeAndStandardLevelAndCityTag(String productType,String standardLevel,String cityTag);
} }

View File

@ -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<TravelStandards> exceedStandardBack(@RequestBody BPMBack bpmBack) {
//获取订单号和审批结果
return Result.Success(CommonMessageConstant.SUCCESS);
}
//改签
@ApiOperation("BPM改签审批结果回传")
@PostMapping("/reschedule/back")
public Result<TravelStandards> rescheduleBack(@RequestBody BPMBack bpmBack) {
//获取订单号和审批结果
return Result.Success(CommonMessageConstant.SUCCESS);
}
}

View File

@ -3,12 +3,14 @@ package com.chint.interfaces.rest.bpm;
import com.chint.domain.aggregates.user.User; import com.chint.domain.aggregates.user.User;
import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.BaseContext;
import com.chint.interfaces.rest.base.PostRequest; 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.BPMBaseRequest;
import com.chint.interfaces.rest.bpm.dto.BPMResponse; import com.chint.interfaces.rest.bpm.dto.BPMResponse;
import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto; import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto;
import com.chint.interfaces.rest.bpm.dto.RescheduleDto; import com.chint.interfaces.rest.bpm.dto.RescheduleDto;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL; import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL;
@ -20,6 +22,9 @@ public class BPMRequest {
@Autowired @Autowired
private PostRequest httpPostRequest; private PostRequest httpPostRequest;
@Value("${bpm.testUrl}")
private String bpmUrl;
//超标申请 //超标申请
public BPMResponse exceedStandard(ExceedStandardDto exceedStandardDto) { public BPMResponse exceedStandard(ExceedStandardDto exceedStandardDto) {
return submitWorkflow("JT_FI_CLCESQ", exceedStandardDto); return submitWorkflow("JT_FI_CLCESQ", exceedStandardDto);
@ -40,8 +45,8 @@ public class BPMRequest {
.setUserCode(String.valueOf(user.getEmployeeNo()))//sf号 .setUserCode(String.valueOf(user.getEmployeeNo()))//sf号
.setFinishStart(true)//true会自动流转到下一审批点false:停在手工填写节点 .setFinishStart(true)//true会自动流转到下一审批点false:停在手工填写节点
.setEntityParamValues(entityParamValues); .setEntityParamValues(entityParamValues);
BPMResponse response = httpPostRequest.post(EXCEED_STANDARD_URL, bpmRequest, BPMResponse.class); BPMBaseResponse bpmBaseResponse = httpPostRequest.post(bpmUrl + EXCEED_STANDARD_URL, bpmRequest, BPMBaseResponse.class);
System.out.println("response = " + response); System.out.println("response = " + bpmBaseResponse);
return response; return bpmBaseResponse.getD();
} }
} }

View File

@ -0,0 +1,9 @@
package com.chint.interfaces.rest.bpm.dot;
import lombok.Data;
@Data
public class BPMBack {
private String OrderNo;//订单号
private String result;//审批结果
}

View File

@ -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;
}

View File

@ -37,3 +37,6 @@ cTrip:
appKey: obk_zhengtai2024 appKey: obk_zhengtai2024
appSecurity: fI3}FZX+zUdxPa2W!R6I2gYO appSecurity: fI3}FZX+zUdxPa2W!R6I2gYO
requestSecret: zhengtai2024_nEbmKfOo requestSecret: zhengtai2024_nEbmKfOo
bpm:
testUrl: http://10.207.0.245:8012

View File

@ -4,20 +4,19 @@ import com.chint.domain.aggregates.user.User;
import com.chint.infrastructure.constant.LYConstant; import com.chint.infrastructure.constant.LYConstant;
import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.BaseContext;
import com.chint.interfaces.rest.base.PostRequest; 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.LYLoginRequest;
import com.chint.interfaces.rest.ly.LYPostRequest; import com.chint.interfaces.rest.ly.LYPostRequest;
import com.chint.interfaces.rest.ly.LYTokenRequest; import com.chint.interfaces.rest.ly.LYTokenRequest;
import com.chint.interfaces.rest.ly.LYUserRequest; import com.chint.interfaces.rest.ly.LYUserRequest;
import com.chint.interfaces.rest.ly.dto.applyordersync.*; 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.commonresult.Result;
import com.chint.interfaces.rest.ly.dto.estimateprice.*; import com.chint.interfaces.rest.ly.dto.estimateprice.*;
import com.chint.interfaces.rest.ly.vo.estimateprice.TrainPriceVo; import com.chint.interfaces.rest.ly.vo.estimateprice.TrainPriceVo;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -26,6 +25,8 @@ import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import static com.chint.infrastructure.constant.BPMConstant.EXCEED_STANDARD_URL;
@SpringBootTest @SpringBootTest
public class LYTest { public class LYTest {
@ -45,6 +46,9 @@ public class LYTest {
@Autowired @Autowired
private PostRequest httpPostRequest; 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_BASE_URL = "https://api.qa.dttrip.cn/openapi";
public static final String L_Y_ORDER_PATH = "/openapi/api/TravelApplyOrder/ApplyOrderSync"; 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 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 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 user = new User(1L, 230615020L, 1, "卢麟哲", "1033719135@qq.com", "15857193365");
private User hxh = new User(1L, 231116009L, 1, "黄小恒", "1628870217@qq.com", "18296007063"); private User hxh = new User(1L, 231116009L, 1, "黄小恒", "1628870217@qq.com", "18296007063");
@ -292,7 +295,7 @@ public class LYTest {
} }
//超标 //超标
// @Test @Test
void exceedStandard() { void exceedStandard() {
BPMBaseRequest bpmRequest = new BPMBaseRequest(); BPMBaseRequest bpmRequest = new BPMBaseRequest();
Gson gson = new Gson(); Gson gson = new Gson();
@ -312,12 +315,14 @@ public class LYTest {
.setUserCode("231116011")//sf号 .setUserCode("231116011")//sf号
.setFinishStart(true)//true会自动流转到下一审批点false:停在手工填写节点 .setFinishStart(true)//true会自动流转到下一审批点false:停在手工填写节点
.setEntityParamValues(entityParamValues); .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); System.out.println("response = " + response);
} }
//改签 //改签
// @Test @Test
void reschedule() { void reschedule() {
BPMBaseRequest bpmRequest = new BPMBaseRequest(); BPMBaseRequest bpmRequest = new BPMBaseRequest();
Gson gson = new Gson(); Gson gson = new Gson();
@ -338,7 +343,9 @@ public class LYTest {
.setUserCode("231116011")//sf号 .setUserCode("231116011")//sf号
.setFinishStart(true)//true会自动流转到下一审批点false:停在手工填写节点 .setFinishStart(true)//true会自动流转到下一审批点false:停在手工填写节点
.setEntityParamValues(entityParamValues); .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); System.out.println("response = " + response);
} }