Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
dengwc 2024-03-01 18:15:58 +08:00
commit 9109b125e6
21 changed files with 212 additions and 77 deletions

View File

@ -1,6 +1,5 @@
package com.chint.application.commands;
import com.chint.domain.value_object.ApproveLegData;
import com.chint.infrastructure.echo_framework.command.Command;
import lombok.Data;
@ -8,17 +7,11 @@ import static com.chint.infrastructure.constant.LegConstant.LEG_EVENT_APPROVAL;
@Data
public class LegApprovalCommand extends Command {
private Integer LegEventType = LEG_EVENT_APPROVAL;
private Long LegId;
private ApproveLegData data;
private Integer legEventType = LEG_EVENT_APPROVAL;
private Long legId;
public LegApprovalCommand legId(Long LegId) {
this.setLegId(LegId);
return this;
}
public LegApprovalCommand data(ApproveLegData data) {
this.data = data;
return this;
}
}

View File

@ -0,0 +1,24 @@
package com.chint.application.commands;
import com.chint.domain.value_object.ApproveLegData;
import com.chint.infrastructure.echo_framework.command.Command;
import lombok.Data;
import static com.chint.infrastructure.constant.LegConstant.LEG_EVENT_APPROVAL;
@Data
public class RouteApprovalCommand extends Command {
private Integer LegEventType = LEG_EVENT_APPROVAL;
private Long LegId;
private ApproveLegData data;
public RouteApprovalCommand legId(Long LegId) {
this.setLegId(LegId);
return this;
}
public RouteApprovalCommand data(ApproveLegData data) {
this.data = data;
return this;
}
}

View File

@ -7,6 +7,7 @@ import com.chint.domain.aggregates.order.LegExtensionField;
import com.chint.domain.aggregates.order.Location;
import com.chint.domain.aggregates.order.OrderDetail;
import com.chint.domain.value_object.enums.CurrencyType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
@ -30,11 +31,21 @@ public class LegRes {
private String amount;
private String legTypeName;
private String legTypeEnName;
@ApiModelProperty("其他费用类型")
private Integer amountType;
@ApiModelProperty("其他费用类型名称")
private String amountTypeName;
@ApiModelProperty("其他费用类型英文名称")
private String amountTypeEnName;
@ApiModelProperty("费用说明")
private String expenseExplanation;
@ApiModelProperty("初始地详细")
private String originDescription;
@ApiModelProperty("目的地详细")
private String destinationDescription;
private Integer legStatus;
private String legStatusName;
private CurrencyType currencyType;
@ -54,7 +65,9 @@ public class LegRes {
legRes.setAmountType(legExtensionField.getAmountType());
legRes.setAmountTypeName(legExtensionField.getAmountTypeName());
legRes.setAmountTypeEnName(legExtensionField.getAmountTypeEnName());
legRes.setExpenseExplanation(legExtensionField.getExpenseExplanation());
legRes.setOriginDescription(legExtensionField.getOriginDescription());
legRes.setDestinationDescription(legExtensionField.getDestinationDescription());
if (legExtensionField.getLocationIds() != null) {
List<LocationRes> locationResList = new ArrayList<>();
List<Location> locationList = legExtensionField.getLocationList();
@ -66,7 +79,6 @@ public class LegRes {
}
legRes.setOriginLocation(LocationRes.copyFrom(leg.getOriginLocation()));
legRes.setDestinationLocation(LocationRes.copyFrom(leg.getDestinationLocation()));
return legRes;
}
}

View File

@ -156,6 +156,7 @@ public class OrderQuery {
.flatMap(leg -> Stream.of(leg.getOriginLocation(), leg.getDestinationLocation()))
.map(LocationRes::copyFrom)
.distinct()
.filter(Objects::nonNull)
.toList();
res.setLocationResList(locationRes);
res.setUserName(currentUser.getName());

View File

@ -89,8 +89,12 @@ public class CTripEstimatePrice implements EstimatePrice {
.max(Comparator.comparing(BigDecimal::new));//获取最大值
if (optional.isPresent()) {
String maxPrice = optional.get();
if (priceQueryData.getIfRound() != null && priceQueryData.getIfRound().equals(1)) {
trainPriceData.setMaxPrice(String.valueOf(Integer.parseInt(maxPrice) * 2));
} else {
trainPriceData.setMaxPrice(maxPrice);
}
}
return trainPriceData;
}
@ -124,7 +128,11 @@ public class CTripEstimatePrice implements EstimatePrice {
estimate.getData().getFlightValuationResult().getTotalPrice()
).ifPresentOrElse(price -> {
flightPriceData.setSuccess(true);
if (priceQueryData.getIfRound() != null && priceQueryData.getIfRound().equals(1)) {
flightPriceData.setMaxPrice(String.valueOf(price.multiply(BigDecimal.valueOf(2))));
} else {
flightPriceData.setMaxPrice(String.valueOf(price));
}
}, () -> {
flightPriceData.setSuccess(false);
flightPriceData.setMaxPrice("无估算价格");

View File

@ -28,8 +28,7 @@ import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import static com.chint.infrastructure.constant.RouteConstant.ORDER_STATUS_NOT_ORDERED;
import static com.chint.infrastructure.constant.RouteConstant.ORDER_STATUS_PREPARE;
import static com.chint.infrastructure.constant.RouteConstant.*;
@Service
public class OrderApplicationService {
@ -77,7 +76,14 @@ public class OrderApplicationService {
List<Leg> legs = processLegData(addLegData.getLegData(), order);
RouteOrder routeOrder = orderDomainService.saveOrder(order);
legs.forEach(leg -> Command.of(LegPrepareCommand.class).legId(leg.getLegId()).sendToQueue());
legs.forEach(leg -> {
Command.of(LegPrepareCommand.class).legId(leg.getLegId()).sendToQueue();
//如果订单状态已经处于审批中 那么为这个新增的leg也提交审批状态
if (order.getOrderStatus() >= ORDER_STATUS_APPROVAL) {
Command.of(LegApprovalCommand.class).legId(leg.getLegId()).sendToQueue();
}
});
//异步操作-如果是当前的状态已经进行过匹配那么就要订单同步到供应商一次
if (order.getOrderStatus() >= ORDER_STATUS_NOT_ORDERED) {
@ -142,7 +148,7 @@ public class OrderApplicationService {
@Transactional
public void approve(ApproveLegData approveLegData) {
Command.of(LegApprovalCommand.class).data(approveLegData).sendToQueue();
Command.of(RouteApprovalCommand.class).data(approveLegData).sendToQueue();
}
@Transactional

View File

@ -43,6 +43,10 @@ public class HotCityTag {
internationalCitys.add("欧洲_挪威_奥斯陆市_奥斯陆_");
internationalCitys.add("北美洲_美国_加利福尼亚州_旧金山_");
internationalCitys.add("亚洲_新加坡_新加坡_新加坡_");
internationalCitys.add("亚洲_中国_香港_香港_");
internationalCitys.add("亚洲_中国_澳门_澳门_");
internationalCitys.add("亚洲_中国_台湾_台北_");
}

View File

@ -72,7 +72,7 @@ public class LegEventHandler implements LegEventService {
@Transactional
@Override
public void approveLeg(LegApprovalCommand command) {
public void approveRoute(RouteApprovalCommand command) {
ApproveLegData data = command.getData();
RouteOrder routeOrder = routeRepository.findByFakeOrderNoAndSysCode(data.getFakeOrderNo(), data.getSysCode()).reloadStatus();
if (routeOrder.getLegItems().isEmpty()) {
@ -135,6 +135,13 @@ public class LegEventHandler implements LegEventService {
}
}
@Override
public void approveLeg(LegApprovalCommand command) {
Leg leg = legRepository.findByLegId(command.getLegId());
leg.addEvent(legEventFactory.creatLegEvent(command.getLegEventType()));
legRepository.save(leg);
}
@Transactional
@Override
public ResultContainer routeUpdateOrder(RouteUpdateOrderCommand command) {

View File

@ -8,10 +8,12 @@ public interface LegEventService {
void prepareLeg(LegPrepareCommand command);
//审批事件要从bpm或其他平台接收到一个真实订单
void approveLeg(LegApprovalCommand command);
void approveRoute(RouteApprovalCommand command);
void syncLeg(LegSyncCommand command);
void approveLeg(LegApprovalCommand command);
//下单事件
ResultContainer orderLeg(LegOrderedCommand command);

View File

@ -23,10 +23,10 @@ public class LegEventServiceImpl implements LegEventService {
//因为审批是针对整个订单的因此所有订单下属的行程节点触发审批事件
//出发审批提交事件 需要生成 差旅单 将差旅但提交到供应商
//根据command里面选择的数据来讲差旅但提交到不同的实现类当中
@ListenTo(command = "LegApprovalCommand", order = 0)
@ListenTo(command = "RouteApprovalCommand", order = 0)
@Override
public void approveLeg(LegApprovalCommand command) {
legEventHandler.approveLeg(command);
public void approveRoute(RouteApprovalCommand command) {
legEventHandler.approveRoute(command);
}
//这里需要获取同步类价格routeOrder同步到供应商
@ -36,6 +36,13 @@ public class LegEventServiceImpl implements LegEventService {
legEventHandler.syncLeg(command);
}
@ListenTo(command = "LegApprovalCommand", order = 0)
@Override
public void approveLeg(LegApprovalCommand command) {
legEventHandler.approveLeg(command);
}
//下单时间要求回传需要付款的金额以及生成对于的行程订单号如果没有行程订单号根据地点和时间进行匹配
@ListenTo(command = "LegOrderedCommand", order = 0)
@Override

View File

@ -1,7 +1,10 @@
package com.chint.domain.service.supplier;
import com.chint.domain.aggregates.order.Location;
import com.chint.domain.repository.LocationRepository;
import com.chint.domain.value_object.OrderLegData;
import com.chint.domain.value_object.SupplierCallbackData;
import com.chint.infrastructure.constant.OrderConstant;
import com.chint.interfaces.rest.ly.dto.ResultBackHotel;
import com.chint.interfaces.rest.ly.dto.carorderdatapushback.CarDetailResult;
import com.chint.interfaces.rest.ly.dto.flydatapushback.FlyDetailResult;
@ -11,6 +14,7 @@ import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderDetail
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
import com.chint.interfaces.rest.ly.dto.trainorderdatapushback.TrainDetailResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Optional;
@ -20,6 +24,10 @@ import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_
@Component
public class LYOrderDataAdapter implements OrderDataAdapter {
@Autowired
private LocationRepository locationRepository;
@Override
public Optional<OrderLegData> adapt(SupplierCallbackData supplierData) {
return switch (supplierData.getProductType()) {
@ -54,6 +62,9 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
private Optional<OrderLegData> hotelDateProcess(HotelDetailResult hotelDetailResult) {
HotelDetailResponse.Data data = hotelDetailResult.getHotelDetailResponse().getData();
ResultBackHotel.DataObject dataObject = hotelDetailResult.getDataObject();
String cityName = data.getHotelInfo().getCityName();
long cityId = data.getHotelInfo().getCityId();
return Optional.of(
OrderLegData.builder()
.productType(LEG_TYPE_HOTEL)
@ -62,12 +73,30 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
.selfOrderNo(dataObject.getTravelData().getTravelApplyNo())
.actualOrderNo(data.getOrderInfo().getOrderSerialNo())
.hotelOrderDetailData(hotelDetailResult)
// .orderStatus()
// .originOrderStatus()
.orderTime(data.getOrderInfo().getCreateTime())
.startTime(data.getOrderInfo().getOriginalCheckInDate())
.endTime(data.getOrderInfo().getOriginalCheckOutDate())
.orderStatus(hotelState(data.getOrderInfo().getOrderStatusDesc()))
.originOrderStatus(data.getOrderInfo().getOrderStatusDesc())
.originId(cityId)
.originName(cityName)
.destinationId(cityId)
.destinationName(cityName)
.supplierName(SUPPLIER_L_Y)
.build()
);
}
public Integer hotelState(String subNotifyType) {
return switch (subNotifyType) {
case "确认中" -> OrderConstant.ORDER_EVENT_PAYED;//确认中
case "待入住" -> OrderConstant.ORDER_EVENT_ORDERED;//已下单,
case "已退房","已入住" -> OrderConstant.ORDER_EVENT_FINISH;//已完成
case "已取消" -> OrderConstant.ORDER_EVENT_CANCEL;//取消
case "待提交" -> OrderConstant.ORDER_EVENT_PREPARE;//未下单
case "待支付" -> OrderConstant.ORDER_EVENT_ORDERED;//已下单
default -> -99;
};
}
private Optional<OrderLegData> carDateProcess(CarDetailResult carDetailResult) {
CarDetailResponse.Data data = carDetailResult.getCarDetailResponse().getData();

View File

@ -84,6 +84,7 @@ public class OrderLegData {
private Object flightOrderDetailData;
private Object otherOrderDetailData;
public Builder() {
}
@ -92,6 +93,21 @@ public class OrderLegData {
return this;
}
public Builder originName(String originName) {
this.originName = originName;
return this;
}
public Builder destinationName(String destinationName) {
this.destinationName = destinationName;
return this;
}
public void setDestinationName(String destinationName) {
this.destinationName = destinationName;
}
public Builder trainOrderDetailData(Object trainOrderDetailData) {
this.trainOrderDetailData = trainOrderDetailData;
return this;
@ -132,6 +148,7 @@ public class OrderLegData {
return this;
}
public Builder originId(Long originId) {
this.originId = originId;
return this;

View File

@ -8,4 +8,5 @@ public class PriceQueryData {
private String arriveCity;
private String departDate;
private String arriveDate;
private Integer ifRound;
}

View File

@ -12,10 +12,12 @@ public class LegConstant {
public static final String LEG_STATUS_ORDERED_NAME = "已下单";
public static final int LEG_STATUS_PAYED = 5;
public static final String LEG_STATUS_PAYED_NAME = "已付款";
public static final int LEG_STATUS_FINISH = -2;
public static final int LEG_STATUS_FINISH = 9;
public static final String LEG_STATUS_FINISH_NAME = "已结束";
public static final int LEG_STATUS_REJECT = -1;
public static final String LEG_STATUS_REJECT_NAME = "审批未通过";
// 规划节点运输方式
public static final int LEG_TYPE_TRAIN = 0;
public static final String LEG_TYPE_TRAIN_NAME = "火车";
@ -58,7 +60,7 @@ public class LegConstant {
public static final String LEG_EVENT_ORDERED_NAME = "下单事件";
public static final int LEG_EVENT_PAYED = 5;
public static final String LEG_EVENT_PAYED_NAME = "付款事件";
public static final int LEG_EVENT_FINISH = -2;
public static final int LEG_EVENT_FINISH = 9;
public static final String LEG_EVENT_FINISH_NAME = "结束事件";
public static final int LEG_EVENT_REJECT = -1;
public static final String LEG_EVENT_REJECT_NAME = "拒绝事件";

View File

@ -12,7 +12,7 @@ public class RouteConstant {
public static final String ORDER_STATUS_ORDERED_NAME = "已下单";
public static final int ORDER_STATUS_PAYED = 4;
public static final String ORDER_STATUS_PAYED_NAME = "已付款";
public static final int ORDER_STATUS_FINISH = 5;
public static final int ORDER_STATUS_FINISH = 9;
public static final String ORDER_STATUS_FINISH_NAME = "已结束";
public static final int ORDER_STATUS_REJECT = -1;
public static final String ORDER_STATUS_REJECT_NAME = "审批拒绝";

View File

@ -94,6 +94,8 @@ public class LocationRepositoryImpl implements LocationRepository {
List<Location> hotCities =
jdbcLocationRepository.findByLocationPathNameInAndLevel(locationNames,3);
return hotCities;
}

View File

@ -53,7 +53,7 @@ public class RouteRepositoryImpl implements RouteRepository {
String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString();
return jdbcRouteRepository
.findByUserIdAndRouteOrderNoContainingOrApproveOrderNo_CreatorAndRouteOrderNoContaining(
Long.valueOf(employeeNo),
employeeNo,
orderQueryData.getOrderNo(),
employeeNo,
orderQueryData.getOrderNo(),
@ -66,7 +66,7 @@ public class RouteRepositoryImpl implements RouteRepository {
.of(orderQueryData.getPageNum() - 1, orderQueryData.getPageSize(), Sort.by("updateTime"));
String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString();
return jdbcRouteRepository.findByUserIdAndApproveOrderNo_InstructionsContainingOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContaining(
Long.valueOf(employeeNo),
employeeNo,
orderQueryData.getInstructions(),
employeeNo,
orderQueryData.getInstructions(),
@ -84,7 +84,7 @@ public class RouteRepositoryImpl implements RouteRepository {
.of(orderQueryData.getPageNum() - 1, orderQueryData.getPageSize(), Sort.by("updateTime"));
String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString();
Page<RouteOrder> byUserId = jdbcRouteRepository
.findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long.valueOf(employeeNo), employeeNo, sort);
.findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(employeeNo, employeeNo, sort);
List<RouteOrder> orders = byUserId.toList();
orders.forEach(RouteOrder::reloadStatus);
return new PageResult<>(byUserId.getTotalElements(), orders);
@ -93,6 +93,6 @@ public class RouteRepositoryImpl implements RouteRepository {
@Override
public List<RouteOrder> findByActualOrderNoNotNull(OrderQueryData orderQueryData) {
String employeeNo = BaseContext.getCurrentUser().getEmployeeNo().toString();
return jdbcRouteRepository.findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long.valueOf(employeeNo), employeeNo);
return jdbcRouteRepository.findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(employeeNo, employeeNo);
}
}

View File

@ -23,17 +23,17 @@ public interface JdbcRouteRepository extends CrudRepository<RouteOrder, Long> {
RouteOrder findByRouteOrderNo(String routeOrderNo);
Page<RouteOrder> findByUserIdAndRouteOrderNoContainingOrApproveOrderNo_CreatorAndRouteOrderNoContaining(Long userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable);
Page<RouteOrder> findByUserIdAndRouteOrderNoContainingOrApproveOrderNo_CreatorAndRouteOrderNoContaining(String userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable);
Page<RouteOrder> findByUserIdAndApproveOrderNo_InstructionsContainingOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContaining(Long userId, String approveOrderNo_instructions, String approveOrderNo_creator, String approveOrderNo_instructions2, Pageable pageable);
Page<RouteOrder> findByUserIdAndApproveOrderNo_InstructionsContainingOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContaining(String userId, String approveOrderNo_instructions, String approveOrderNo_creator, String approveOrderNo_instructions2, Pageable pageable);
Page<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long userId, String approveOrderNo_creator, Pageable pageable);
Page<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator, Pageable pageable);
List<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(Long userId, String approveOrderNo_creator);
List<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator);
}

View File

@ -29,40 +29,40 @@ public class ResultBackHotel {
@Data
public static class OrderInfo {
private int orderType;
private Integer orderType;
private String orderSerialNo;
private String outEnterpriseId;
private int protocolType;
private double saveTotalPrice;
private double totalStandardPrice;
private Integer protocolType;
private Double saveTotalPrice;
private Double totalStandardPrice;
private String outEmployeeId;
private String employeeId;
private String employeeCode;
private String changeOrderSerialNo;
private boolean isChangeOrder;
private int orderStatus;
private Boolean isChangeOrder;
private Integer orderStatus;
private String orderStatusDesc;
private String createTime;
private int payType;
private int paymentType;
private double totalPrice;
private double diffPrice;
private double personalDiffPrice;
private double companyDiffPrice;
private double roomTotalPrice;
private double servicePrice;
private double afterSettlementServicePrice;
private Integer payType;
private Integer paymentType;
private Double totalPrice;
private Double diffPrice;
private Double personalDiffPrice;
private Double companyDiffPrice;
private Double roomTotalPrice;
private Double servicePrice;
private Double afterSettlementServicePrice;
private String contactName;
private String contactPhone;
private String contactEmail;
private String refundRule;
private String refundIntro;
private String refundIntegerro;
private String servicePhone;
private boolean canRefund;
private double companyPrice;
private double personalPrice;
private Boolean canRefund;
private Double companyPrice;
private Double personalPrice;
private String supplierOrderCreateTime;
private boolean ruleViolate;
private Boolean ruleViolate;
private RuleViolateDetail ruleViolateDetail;
private String foulReason;
private String foulReasonCode;
@ -71,10 +71,10 @@ public class ResultBackHotel {
private String cancelReasons;
private String customerOrderNo;
private String customerRefundOrderNo;
private int customerInvoiceCode;
private Integer customerInvoiceCode;
private String customerInvoiceDesc;
private int halfDayRoom;
private double businessAmount;
private Integer halfDayRoom;
private Double businessAmount;
}
@Data
@ -92,23 +92,23 @@ public class ResultBackHotel {
private String checkInDate;
private String checkOutDate;
private String hotelTel;
private int checkInTime;
private Integer checkIntegerime;
private String roomName;
private String bedType;
private String breakfast;
private int roomNum;
private int nightNum;
private double bdLon;
private double bdLat;
private Integer roomNum;
private Integer nightNum;
private Double bdLon;
private Double bdLat;
}
@Data
public static class DayPrice {
private String date;
private String dateStr;
private double price;
private double marketPrice;
private double savePrice;
private Double price;
private Double marketPrice;
private Double savePrice;
private String breakfast;
}
@ -146,16 +146,16 @@ public class ResultBackHotel {
private String checkInDate;
private String checkOutDate;
private String confirmNo;
private int orderStatus;
private Integer orderStatus;
private String orderStatusDesc;
private double salesPrice;
private double costPrice;
private double marketPrice;
private double savePrice;
private double standardPrice;
private Double salesPrice;
private Double costPrice;
private Double marketPrice;
private Double savePrice;
private Double standardPrice;
private String dayStandardPrice;
private double servicePrice;
private double afterSettlementServicePrice;
private Double servicePrice;
private Double afterSettlementServicePrice;
}

View File

@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static com.chint.infrastructure.constant.Constant.*;
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
/**
* 酒店订单数据回推控制层
@ -61,6 +62,14 @@ public class HotelBackController {
//状态映射
command.eventType(mapHotelState(notification.getSubNotifyType()));
command.sendToQueue();
if (dataObject.getOrderInfo().getRuleViolate()){
OrderStatusChangeCommand command2 = Command.of(OrderStatusChangeCommand.class)
.orderNo(serialNo)
.outStatus(String.valueOf(notification.getSubNotifyType()));
//状态映射
command.eventType(ORDER_EVENT_ETA);
command.sendToQueue();
}
return new LYNoteResponse("100", "成功收到消息");
}
return new LYNoteResponse("200", "未收到消息");

View File

@ -4,8 +4,10 @@ import cn.hutool.extra.pinyin.PinyinUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chint.application.services.login.strategy.PailaLoginStrategy;
import com.chint.domain.aggregates.order.Leg;
import com.chint.domain.aggregates.order.Location;
import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.LegRepository;
import com.chint.domain.repository.LocationRepository;
import com.chint.domain.repository.OrderDetailRepository;
import com.chint.domain.repository.RouteRepository;
@ -53,6 +55,9 @@ class RouteApplicationTests {
@Autowired
private PailaLoginStrategy pailaLoginStrategy;
@Autowired
private LegRepository legRepository;
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365");
@ -139,9 +144,9 @@ class RouteApplicationTests {
}
@Test
void loginSign() {
String sfno = "230615020";
String sfno = "090223001";
String syscode = "FSSC";
String billcode = "CLSQ20240228";
String billcode = "CLSQ240226000004";
String companycode = "正泰集团股份有限公司";
String sec = "Superdandan";
String timespan = "1708908662738";
@ -202,6 +207,12 @@ class RouteApplicationTests {
orderDetailRepository.deleteById(31L);
orderDetailRepository.deleteById(33L);
}
@Test
void deleteLeg(){
legRepository.deleteById(Leg.of(506L));
legRepository.deleteById(Leg.of(507L));
}
// @Test
void ssoLogin(){