添加高德同步代码

This commit is contained in:
lulz1 2024-04-25 13:46:59 +08:00
parent d7bb25b110
commit 0c5f571e27
12 changed files with 119 additions and 18 deletions

View File

@ -53,12 +53,28 @@ public class UserDepartmentInfo implements Serializable {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserDepartmentInfo that = (UserDepartmentInfo) o;
return Objects.equals(companyCode, that.companyCode) && Objects.equals(companyName, that.companyName) && Objects.equals(departmentCodeOne, that.departmentCodeOne) && Objects.equals(departmentNameOne, that.departmentNameOne) && Objects.equals(departmentCodeTwo, that.departmentCodeTwo) && Objects.equals(departmentNameTwo, that.departmentNameTwo) && Objects.equals(departmentCodeThree, that.departmentCodeThree) && Objects.equals(departmentNameThree, that.departmentNameThree) && Objects.equals(departmentCodeFour, that.departmentCodeFour) && Objects.equals(departmentNameFour, that.departmentNameFour) && Objects.equals(departmentCodeFive, that.departmentCodeFive) && Objects.equals(departmentNameFive, that.departmentNameFive) && Objects.equals(departmentCodeSix, that.departmentCodeSix) && Objects.equals(departmentNameSix, that.departmentNameSix) && Objects.equals(departmentCodeSeven, that.departmentCodeSeven) && Objects.equals(departmentNameSeven, that.departmentNameSeven);
return Objects.equals(companyCode, that.companyCode)
&& Objects.equals(companyName, that.companyName)
&& Objects.equals(departmentCodeOne, that.departmentCodeOne)
&& Objects.equals(departmentNameOne, that.departmentNameOne)
&& Objects.equals(departmentCodeTwo, that.departmentCodeTwo)
&& Objects.equals(departmentNameTwo, that.departmentNameTwo)
&& Objects.equals(departmentCodeThree, that.departmentCodeThree)
&& Objects.equals(departmentNameThree, that.departmentNameThree)
&& Objects.equals(departmentCodeFour, that.departmentCodeFour)
&& Objects.equals(departmentNameFour, that.departmentNameFour)
&& Objects.equals(departmentCodeFive, that.departmentCodeFive)
&& Objects.equals(departmentNameFive, that.departmentNameFive)
&& Objects.equals(departmentCodeSix, that.departmentCodeSix)
&& Objects.equals(departmentNameSix, that.departmentNameSix)
&& Objects.equals(departmentCodeSeven, that.departmentCodeSeven)
&& Objects.equals(departmentNameSeven, that.departmentNameSeven)
&& Objects.equals(ifPrimary, that.ifPrimary);
}
@Override
public int hashCode() {
return Objects.hash(companyCode, companyName, departmentCodeOne, departmentNameOne, departmentCodeTwo, departmentNameTwo, departmentCodeThree, departmentNameThree, departmentCodeFour, departmentNameFour, departmentCodeFive, departmentNameFive, departmentCodeSix, departmentNameSix, departmentCodeSeven, departmentNameSeven);
return Objects.hash(companyCode, companyName, departmentCodeOne, departmentNameOne, departmentCodeTwo, departmentNameTwo, departmentCodeThree, departmentNameThree, departmentCodeFour, departmentNameFour, departmentCodeFive, departmentNameFive, departmentCodeSix, departmentNameSix, departmentCodeSeven, departmentNameSeven,ifPrimary);
}
public Builder start(User user) {

View File

@ -21,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
@ -36,6 +35,7 @@ import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y_CN_NAME;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y_EXTENSION_NAME;
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
import static com.chint.infrastructure.util.DateTimeUtil.formatter;
@Component
public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@ -61,7 +61,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Autowired
private RouteRequestRepository routeRequestRepository;
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
@Override

View File

@ -0,0 +1,47 @@
package com.chint.domain.factoriy.order_record;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarPassengerInfo;
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord;
import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderResponse;
import org.springframework.stereotype.Component;
import static com.chint.infrastructure.constant.BelongSystemConstant.TRAVAL_SYS_TYPE_CTRIP;
@Component
public class AmapOrderRecordExtensionFactory implements OrderRecordExtensionFactory{
private OrderRecordBasic buildWithRecord(Object orderCarRecordData) {
FinishedOrderResponse.ListElement carRecordData = (FinishedOrderResponse.ListElement) orderCarRecordData;
String[] split = carRecordData.getRemark().split("-");
return null;
}
@Override
public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) {
FinishedOrderResponse.ListElement carRecordData = (FinishedOrderResponse.ListElement) orderCarRecordData;
return null;
}
@Override
public OrderTrainRecord createTrainOrderRecord(Object orderTrainRecordData) {
return null;
}
@Override
public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) {
return null;
}
@Override
public OrderHotelRecord createHotelOrderRecord(Object orderHotelRecordData) {
return null;
}
}

View File

@ -52,16 +52,16 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
private String getBeLongSysType(String sysCode) {
String res = null;
if (sysCode != null) {
if (sysCode.contains(BELONG_SYS_CODE_FSSC) || sysCode.contains(BELONG_SYS_TYPE_FSSC)) {
if (sysCode.equals(BELONG_SYS_CODE_FSSC) || sysCode.contains(BELONG_SYS_TYPE_FSSC)) {
res = BELONG_SYS_TYPE_FSSC;
}
if (sysCode.contains(BELONG_SYS_CODE_H3BPM) || sysCode.contains(BELONG_SYS_TYPE_H3BPM)) {
if (sysCode.equals(BELONG_SYS_CODE_H3BPM) || sysCode.contains(BELONG_SYS_TYPE_H3BPM)) {
res = BELONG_SYS_TYPE_H3BPM;
}
if (sysCode.contains(BELONG_SYS_CODE_XNFSSC) || sysCode.contains(BELONG_SYS_TYPE_XNFSSC)) {
if (sysCode.equals(BELONG_SYS_CODE_XNFSSC) || sysCode.contains(BELONG_SYS_TYPE_XNFSSC)) {
res = BELONG_SYS_TYPE_XNFSSC;
}
if (sysCode.contains(BELONG_SYS_CODE_ANFSSC) || sysCode.contains(BELONG_SYS_TYPE_ANFSSC)) {
if (sysCode.equals(BELONG_SYS_CODE_ANFSSC) || sysCode.contains(BELONG_SYS_TYPE_ANFSSC)) {
res = BELONG_SYS_TYPE_ANFSSC;
}
} else {

View File

@ -3,8 +3,7 @@ package com.chint.domain.factoriy.order_record;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y;
import static com.chint.infrastructure.constant.SupplierNameConstant.*;
@Component
public class OrderRecordFactorySelector {
@ -14,10 +13,14 @@ public class OrderRecordFactorySelector {
@Autowired
private LyOrderRecordExtensionFactory lyOrderRecordExtensionFactory;
@Autowired
private AmapOrderRecordExtensionFactory aMapOrderRecordExtensionFactory;
public OrderRecordExtensionFactory extensionFactoryOfSupplierName(String supplierName) {
return switch (supplierName) {
case SUPPLIER_C_TRIP -> cTripOrderRecordExtensionFactory;
case SUPPLIER_L_Y -> lyOrderRecordExtensionFactory;
case SUPPLIER_AMAP -> aMapOrderRecordExtensionFactory;
default -> null;
};
}

View File

@ -0,0 +1,31 @@
package com.chint.domain.service.order_record;
import com.chint.application.commands.OrderRecordGenerateCommand;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import java.util.List;
public class AmapOrderRecordDomainService implements OrderRecordDomainService{
@Override
public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) {
return List.of();
}
@Override
public List<OrderTrainRecord> generateTrainRecord(OrderRecordGenerateCommand command) {
return List.of();
}
@Override
public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) {
return List.of();
}
@Override
public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) {
return List.of();
}
}

View File

@ -22,4 +22,5 @@ public interface JdbcOrderDetailRepository extends CrudRepository<OrderDetail, L
Page<OrderDetail> findByEmployeeNo(String employeeNo, Pageable pageable);
List<OrderDetail> findByCreateTimeBetween(LocalDateTime createTime, LocalDateTime createTime2);
List<OrderDetail> findByUpdateTimeBetween(LocalDateTime createTime, LocalDateTime createTime2);
}

View File

@ -5,6 +5,7 @@ import com.chint.interfaces.rest.amap.dto.location.LocationResponse;
import com.chint.interfaces.rest.amap.request.AmapRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.Optional;
@ -20,12 +21,13 @@ public class AmapLocationRequest {
@Value("${amap.baseUrl}")
private String BaseUrl;
@Cacheable(value = "AmapLocation" , key = "#keyWords")
public LocationResponse locationQuery(String keyWords) {
LocationRequestParam param = LocationRequestParam.of(keyWords);
return amapRequest.post(BaseUrl + AMAP_LOCATION_PATH, param, LocationResponse.class);
}
public String getACodeByLocationName(String locationName) {
LocationResponse locationQuery = locationQuery(locationName);
Optional<LocationResponse.AmapCityInfo> amapCityInfo = Optional.ofNullable(locationQuery.getData())

View File

@ -115,7 +115,5 @@ public class FinishedOrderResponse extends BaseResponse {
private String entStaffExtInfo;//企业员工拓展信息
private String tokenExtInfo;//该信息为提交token时userInfo里的extInfo值需申请开通权限
private Integer carPool;//是否拼车1:拼成 0未拼成
}
}

View File

@ -67,6 +67,7 @@ public class UserHttpRequestImpl implements UserHttpRequest {
@Override
public User loadUserInfo(User user) {
//这个方法 逻辑进行修改 首先通过查询 表的方式 如果部分数据为空 那么就要查询 sf信息获取
user = loadSFInfo(user);
if (user == null) {
return null;
@ -232,7 +233,6 @@ public class UserHttpRequestImpl implements UserHttpRequest {
}
private void processSpecialCompanies(List<UserDataDTO> userDataDTOS, User user) {
List<UserDataDTO> list = userDataDTOS.stream()
.filter(it -> jtCompanyDomainService.ifCompanyInJT(null, it.getCompany()))
.toList();

View File

@ -822,17 +822,17 @@ public class LYTest {
System.out.println(json);
}
@Test
// @Test
void searchTrain() {
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail("DT24033168626574219");
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail("DT24042571594139716");
Gson gson = new Gson();
String json = gson.toJson(trainOrderDetail);
System.out.println(json);
}
// @Test
@Test
void searchHotel() {
HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail("HO20240325155100629867");
HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail("HO20240401145300516689");
Gson gson = new Gson();
String json = gson.toJson(hotelOrderDetail);
System.out.println(json);

View File

@ -49,14 +49,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import static com.chint.infrastructure.constant.LocationConstant.*;
import static com.chint.infrastructure.constant.RankConstant.DEFAULT_RANK_NAME;
import static com.chint.infrastructure.util.DateTimeUtil.formatter;
import static com.chint.infrastructure.util.DateTimeUtil.lastMonthStr;
@Slf4j