新能云枢超标、改签、变更流程代码调整

This commit is contained in:
dengwc 2024-03-02 10:23:58 +08:00
parent 6b3813fdef
commit dbf5d8b2d4
5 changed files with 39 additions and 25 deletions

View File

@ -20,4 +20,9 @@ public class BPMLegChangeCommand extends Command {
this.newleg = leg;
return this;
}
public BPMLegChangeCommand changeType(Integer changeType) {
this.changeType = changeType;
return this;
}
}

View File

@ -1,5 +1,6 @@
package com.chint.application.services;
import cn.hutool.core.bean.BeanUtil;
import com.chint.application.commands.*;
import com.chint.application.dtos.AddLegData;
import com.chint.application.dtos.DeleteLegData;
@ -82,6 +83,10 @@ public class OrderApplicationService {
if (order.getOrderStatus() >= ORDER_STATUS_APPROVAL) {
Command.of(LegApprovalCommand.class).legId(leg.getLegId()).sendToQueue();
}
if (order.getOrderStatus().equals(ORDER_STATUS_PREPARE)) {
Command.of(BPMLegChangeCommand.class).newleg(leg).changeType(0).sendToQueue();
}
});
@ -101,18 +106,22 @@ public class OrderApplicationService {
public void changeLeg(AddLegData addLegData) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
LegData legData = addLegData.getLegData();
Leg byLegId = Optional.ofNullable(
Leg leg = Optional.ofNullable(
legRepository.findByLegId(legData.getLegId())
).orElseThrow(() -> new NotFoundException(CommonMessageConstant.NOT_FOUND));
byLegId.setStartTime(LocalDateTime.parse(legData.getStartTime(), formatter));
byLegId.setEndTime(LocalDateTime.parse(legData.getEndTime(), formatter));
byLegId.setOriginId(legData.getOriginId());
byLegId.setDestinationId(legData.getDestinationId());
legRepository.save(byLegId);
Leg oldLeg = BeanUtil.copyProperties(leg, Leg.class);
leg.setStartTime(LocalDateTime.parse(legData.getStartTime(), formatter));
leg.setEndTime(LocalDateTime.parse(legData.getEndTime(), formatter));
leg.setOriginId(legData.getOriginId());
leg.setDestinationId(legData.getDestinationId());
legRepository.save(leg);
Command.of(BPMLegChangeCommand.class).oldLeg(oldLeg).newleg(leg).changeType(1).sendToQueue();
//异步操作-如果是当前的状态已经进行过匹配那么就要订单同步到供应商一次
CompletableFuture.runAsync(() -> {
Long routeId = byLegId.getRouteId();
Long routeId = leg.getRouteId();
RouteOrder order = Optional.ofNullable(routeRepository.queryById(routeId))
.orElseThrow(() -> new NotFoundException(CommonMessageConstant.NOT_FOUND)).reloadStatus();
if (order.getOrderStatus() >= ORDER_STATUS_NOT_ORDERED) {

View File

@ -42,7 +42,7 @@ public class BPMController {
//携程商旅
if (SUPPLIER_C_TRIP_BPM_NAME.equals(bpmBack.getOrderSource())) {
Integer orderType = getCTripOrderType(orderTypeValue); // 调用方法获取订单类型
if ("通过".equals(result)) {
if ("通过".equals(result)||"同意".equals(result)) {
cTripAuditRequest.auditSuccess(bpmBack.getOrderNo(), orderType);
} else {
cTripAuditRequest.auditFail(bpmBack.getOrderNo(), orderType);
@ -51,7 +51,7 @@ public class BPMController {
//同程商旅
if (SUPPLIER_L_Y_BPM_NAME.equals(bpmBack.getOrderSource())) {
Integer orderType = getLYOrderType(orderTypeValue); // 调用方法获取订单类型
if ("通过".equals(result)) {
if ("通过".equals(result)||"同意".equals(result)) {
cTripAuditRequest.auditSuccess(bpmBack.getOrderNo(), orderType);
} else {
cTripAuditRequest.auditFail(bpmBack.getOrderNo(), orderType);
@ -71,13 +71,13 @@ public class BPMController {
}
//差旅更变审批
@ApiOperation("BPM改签审批结果回传")
/*@ApiOperation("BPM改签审批结果回传")
@PostMapping("/change/back")
public Result<TravelStandards> changeBack(@RequestBody BPMBack bpmBack) {
//获取订单号和审批结果
System.out.println("bpmBack = " + bpmBack);
return Result.Success(CommonMessageConstant.SUCCESS);
}
}*/
//类型映射

View File

@ -373,8 +373,8 @@ public class LYTest {
Gson gson = new Gson();
JTH3ChangeDto changeDto = new JTH3ChangeDto();
//新增行程
ArrayList<JTH3ChangeDto.NewTrip> newTrips = new ArrayList<>();
JTH3ChangeDto.NewTrip newTrip = new JTH3ChangeDto.NewTrip();
ArrayList<LegNewTrip> newTrips = new ArrayList<>();
LegNewTrip newTrip = new LegNewTrip();
newTrip.setAllowProductTypes("飞机")
.setDepartCitiesName("温州")
.setArriveCitiesName("北京")
@ -383,8 +383,8 @@ public class LYTest {
.setReason("出差帮扶");
newTrips.add(newTrip);
//原行程
ArrayList<JTH3ChangeDto.OldTrip> oldTrips = new ArrayList<>();
JTH3ChangeDto.OldTrip oldTrip = new JTH3ChangeDto.OldTrip();
ArrayList<LegOldTrip> oldTrips = new ArrayList<>();
LegOldTrip oldTrip = new LegOldTrip();
oldTrip.setAllowProductTypes("火车")
.setDepartCitiesName("温州")
.setArriveCitiesName("杭州")
@ -392,8 +392,8 @@ public class LYTest {
.setEdDate("2024-03-01");
oldTrips.add(oldTrip);
//变更行程
ArrayList<JTH3ChangeDto.ChangeTrip> changeTrips = new ArrayList<>();
JTH3ChangeDto.ChangeTrip changeTrip = new JTH3ChangeDto.ChangeTrip();
ArrayList<LegChangeTrip> changeTrips = new ArrayList<>();
LegChangeTrip changeTrip = new LegChangeTrip();
changeTrip.setAllowProductTypes("火车")
.setDepartCitiesName("乐清")
.setArriveCitiesName("杭州")
@ -520,8 +520,8 @@ public class LYTest {
Gson gson = new Gson();
XNChangeDto changeDto = new XNChangeDto();
//新增行程
ArrayList<JTH3ChangeDto.NewTrip> newTrips = new ArrayList<>();
JTH3ChangeDto.NewTrip newTrip = new JTH3ChangeDto.NewTrip();
ArrayList<LegNewTrip> newTrips = new ArrayList<>();
LegNewTrip newTrip = new LegNewTrip();
newTrip.setAllowProductTypes("飞机")
.setDepartCitiesName("温州")
.setArriveCitiesName("北京")
@ -530,8 +530,8 @@ public class LYTest {
.setReason("出差帮扶");
newTrips.add(newTrip);
//原行程
ArrayList<JTH3ChangeDto.OldTrip> oldTrips = new ArrayList<>();
JTH3ChangeDto.OldTrip oldTrip = new JTH3ChangeDto.OldTrip();
ArrayList<LegOldTrip> oldTrips = new ArrayList<>();
LegOldTrip oldTrip = new LegOldTrip();
oldTrip.setAllowProductTypes("火车")
.setDepartCitiesName("温州")
.setArriveCitiesName("杭州")
@ -539,8 +539,8 @@ public class LYTest {
.setEdDate("2024-03-01");
oldTrips.add(oldTrip);
//变更行程
ArrayList<JTH3ChangeDto.ChangeTrip> changeTrips = new ArrayList<>();
JTH3ChangeDto.ChangeTrip changeTrip = new JTH3ChangeDto.ChangeTrip();
ArrayList<LegChangeTrip> changeTrips = new ArrayList<>();
LegChangeTrip changeTrip = new LegChangeTrip();
changeTrip.setAllowProductTypes("火车")
.setDepartCitiesName("乐清")
.setArriveCitiesName("杭州")

View File

@ -144,9 +144,9 @@ class RouteApplicationTests {
}
@Test
void loginSign() {
String sfno = "090223001";
String sfno = "230615020";
String syscode = "FSSC";
String billcode = "CLSQ240226000004";
String billcode = "CLSQ240301009999";
String companycode = "正泰集团股份有限公司";
String sec = "Superdandan";
String timespan = "1708908662738";