fix:修复高度差旅申请单地点信息同步bug,订单详情深拷贝方法bug,以及其他问题
This commit is contained in:
parent
833f0875c3
commit
a25cb67e7b
|
@ -230,34 +230,48 @@ public class OrderDetail implements Serializable {
|
||||||
copyOrderDetail.setOtherOrderDetail(copiedOtherOrderDetail);
|
copyOrderDetail.setOtherOrderDetail(copiedOtherOrderDetail);
|
||||||
|
|
||||||
// 深拷贝 orderEventList
|
// 深拷贝 orderEventList
|
||||||
List<OrderEvent> copiedOrderEventList = this.orderEventList.stream()
|
if(this.orderEventList != null && !this.orderEventList.isEmpty()) {
|
||||||
.map(event -> BeanUtil.copyProperties(event, OrderEvent.class))
|
List<OrderEvent> copiedOrderEventList = this.orderEventList.stream()
|
||||||
.collect(Collectors.toList());
|
.map(event -> BeanUtil.copyProperties(event, OrderEvent.class))
|
||||||
copyOrderDetail.setOrderEventList(copiedOrderEventList);
|
.collect(Collectors.toList());
|
||||||
|
copyOrderDetail.setOrderEventList(copiedOrderEventList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 深拷贝 orderCarRecordList
|
// 深拷贝 orderCarRecordList
|
||||||
List<OrderCarRecord> copiedOrderCarRecordList = this.orderCarRecordList.stream()
|
if (this.orderCarRecordList != null && !this.orderCarRecordList.isEmpty()) {
|
||||||
.map(record -> BeanUtil.copyProperties(record, OrderCarRecord.class))
|
List<OrderCarRecord> copiedOrderCarRecordList = this.orderCarRecordList.stream()
|
||||||
.collect(Collectors.toList());
|
.map(record -> BeanUtil.copyProperties(record, OrderCarRecord.class))
|
||||||
copyOrderDetail.setOrderCarRecordList(copiedOrderCarRecordList);
|
.collect(Collectors.toList());
|
||||||
|
copyOrderDetail.setOrderCarRecordList(copiedOrderCarRecordList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 深拷贝 orderFlightRecordList
|
// 深拷贝 orderFlightRecordList
|
||||||
List<OrderFlightRecord> copiedOrderFlightRecordList = this.orderFlightRecordList.stream()
|
if (this.orderFlightRecordList != null && !this.orderFlightRecordList.isEmpty()) {
|
||||||
.map(record -> BeanUtil.copyProperties(record, OrderFlightRecord.class))
|
List<OrderFlightRecord> copiedOrderFlightRecordList = this.orderFlightRecordList.stream()
|
||||||
.collect(Collectors.toList());
|
.map(record -> BeanUtil.copyProperties(record, OrderFlightRecord.class))
|
||||||
copyOrderDetail.setOrderFlightRecordList(copiedOrderFlightRecordList);
|
.collect(Collectors.toList());
|
||||||
|
copyOrderDetail.setOrderFlightRecordList(copiedOrderFlightRecordList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 深拷贝 orderHotelRecordList
|
// 深拷贝 orderHotelRecordList
|
||||||
List<OrderHotelRecord> copiedOrderHotelRecordList = this.orderHotelRecordList.stream()
|
if (this.orderHotelRecordList != null && !this.orderHotelRecordList.isEmpty()) {
|
||||||
.map(record -> BeanUtil.copyProperties(record, OrderHotelRecord.class))
|
List<OrderHotelRecord> copiedOrderHotelRecordList = this.orderHotelRecordList.stream()
|
||||||
.collect(Collectors.toList());
|
.map(record -> BeanUtil.copyProperties(record, OrderHotelRecord.class))
|
||||||
copyOrderDetail.setOrderHotelRecordList(copiedOrderHotelRecordList);
|
.collect(Collectors.toList());
|
||||||
|
copyOrderDetail.setOrderHotelRecordList(copiedOrderHotelRecordList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 深拷贝 orderTrainRecordList
|
// 深拷贝 orderTrainRecordList
|
||||||
List<OrderTrainRecord> copiedOrderTrainRecordList = this.orderTrainRecordList.stream()
|
if (this.orderTrainRecordList != null && !this.orderTrainRecordList.isEmpty()) {
|
||||||
.map(record -> BeanUtil.copyProperties(record, OrderTrainRecord.class))
|
List<OrderTrainRecord> copiedOrderTrainRecordList = this.orderTrainRecordList.stream()
|
||||||
.collect(Collectors.toList());
|
.map(record -> BeanUtil.copyProperties(record, OrderTrainRecord.class))
|
||||||
copyOrderDetail.setOrderTrainRecordList(copiedOrderTrainRecordList);
|
.collect(Collectors.toList());
|
||||||
|
copyOrderDetail.setOrderTrainRecordList(copiedOrderTrainRecordList);
|
||||||
|
}
|
||||||
return copyOrderDetail;
|
return copyOrderDetail;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,8 +31,7 @@ import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TAXI;
|
import static com.chint.infrastructure.constant.LegConstant.*;
|
||||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TRAIN;
|
|
||||||
import static com.chint.infrastructure.constant.RouteConstant.*;
|
import static com.chint.infrastructure.constant.RouteConstant.*;
|
||||||
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
|
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
|
||||||
import static com.chint.infrastructure.constant.UtilConstant.RESULT_ORDER_DETAIL;
|
import static com.chint.infrastructure.constant.UtilConstant.RESULT_ORDER_DETAIL;
|
||||||
|
@ -541,7 +540,7 @@ public class RouteOrder implements Serializable {
|
||||||
List<Leg> potentialMatches = this.legItems.stream()
|
List<Leg> potentialMatches = this.legItems.stream()
|
||||||
.filter(leg -> {
|
.filter(leg -> {
|
||||||
// Skip taxi legs already handled
|
// Skip taxi legs already handled
|
||||||
if (leg.getLegType().equals(LEG_TYPE_TAXI)) {
|
if (leg.getLegType().equals(LEG_TYPE_TAXI) || leg.getLegType().equals(LEG_TYPE_OTHER)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ public class RouteRequestEvent extends BaseEvent implements Serializable {
|
||||||
|
|
||||||
private Long routeRequestId;
|
private Long routeRequestId;
|
||||||
|
|
||||||
private Long routeRequestKey;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<Integer, String> getStatusMappings() {
|
protected Map<Integer, String> getStatusMappings() {
|
||||||
|
|
|
@ -90,6 +90,9 @@ public class LegDomainService {
|
||||||
|
|
||||||
public void deleteByLegNo(String legNo) {
|
public void deleteByLegNo(String legNo) {
|
||||||
Leg byLegNo = legRepository.findByLegNo(legNo);
|
Leg byLegNo = legRepository.findByLegNo(legNo);
|
||||||
|
if(byLegNo == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
RouteOrder routeOrder = routeRepository.queryById(byLegNo.getRouteId()).reloadStatus();
|
RouteOrder routeOrder = routeRepository.queryById(byLegNo.getRouteId()).reloadStatus();
|
||||||
if (routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)) {
|
if (routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)) {
|
||||||
legRepository.deleteById(byLegNo);
|
legRepository.deleteById(byLegNo);
|
||||||
|
|
|
@ -7,10 +7,7 @@ import com.chint.domain.aggregates.supplier.SupplierProductStandardLevel;
|
||||||
import com.chint.domain.aggregates.user.User;
|
import com.chint.domain.aggregates.user.User;
|
||||||
import com.chint.domain.exceptions.AuthException;
|
import com.chint.domain.exceptions.AuthException;
|
||||||
import com.chint.domain.exceptions.CommandException;
|
import com.chint.domain.exceptions.CommandException;
|
||||||
import com.chint.domain.repository.AmapPolicyRepository;
|
import com.chint.domain.repository.*;
|
||||||
import com.chint.domain.repository.AmapRouteRelationshipRepository;
|
|
||||||
import com.chint.domain.repository.SupplierRepository;
|
|
||||||
import com.chint.domain.repository.UserRepository;
|
|
||||||
import com.chint.domain.service.LegDomainService;
|
import com.chint.domain.service.LegDomainService;
|
||||||
import com.chint.infrastructure.util.DateTimeUtil;
|
import com.chint.infrastructure.util.DateTimeUtil;
|
||||||
import com.chint.interfaces.rest.amap.AmapLocationRequest;
|
import com.chint.interfaces.rest.amap.AmapLocationRequest;
|
||||||
|
@ -30,6 +27,7 @@ import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TAXI;
|
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TAXI;
|
||||||
|
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_CITY;
|
||||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_AMAP;
|
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_AMAP;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -57,6 +55,7 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SupplierRepository supplierRepository;
|
private SupplierRepository supplierRepository;
|
||||||
|
|
||||||
|
|
||||||
private Gson gson = new Gson();
|
private Gson gson = new Gson();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -142,7 +141,13 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
||||||
}
|
}
|
||||||
List<String> areaCodes = new ArrayList<>();
|
List<String> areaCodes = new ArrayList<>();
|
||||||
for (Location location : locationList) {
|
for (Location location : locationList) {
|
||||||
areaCodes.add(amapLocationRequest.getACodeByLocationName(location.getLocationName()));
|
if(location.getLocationType() != LOCATION_TYPE_CITY){
|
||||||
|
//如果类型不是地级市,那么就从地区路径获取地级市信息
|
||||||
|
String[] split = location.getLocationPathName().split("_");
|
||||||
|
areaCodes.add(amapLocationRequest.getACodeByLocationName(split[3]));
|
||||||
|
} else {
|
||||||
|
areaCodes.add(amapLocationRequest.getACodeByLocationName(location.getLocationName()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
processContent.setValidCityList(areaCodes);
|
processContent.setValidCityList(areaCodes);
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void loginSign() {
|
void loginSign() {
|
||||||
String sfno = "230615020";
|
String sfno = "230207110";
|
||||||
String syscode = "FSSC";
|
String syscode = "FSSC";
|
||||||
String billcode = "CLSQ240225000099";
|
String billcode = "CLSQ240225000099";
|
||||||
String companycode = "正泰集团股份有限公司";
|
String companycode = "正泰集团股份有限公司";
|
||||||
|
@ -359,7 +359,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void deleteOrderDetail() {
|
void deleteOrderDetail() {
|
||||||
orderDetailRepository.deleteById(3128L);
|
orderDetailRepository.deleteById(3157L);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
|
|
Loading…
Reference in New Issue