Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e3cce310ee
|
@ -5,12 +5,13 @@ import com.chint.application.dtos.response.*;
|
|||
import com.chint.application.dtos.trip.*;
|
||||
import com.chint.application.queryies.estimate.EstimatePrice;
|
||||
import com.chint.domain.aggregates.location.CityEntity;
|
||||
import com.chint.domain.aggregates.location.basedata.CountryLevelInfoEntity;
|
||||
import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
|
||||
import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity;
|
||||
import com.chint.domain.aggregates.order.*;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.exceptions.NotFoundException;
|
||||
import com.chint.domain.repository.CityRepository;
|
||||
import com.chint.domain.repository.RouteRepository;
|
||||
import com.chint.domain.repository.UserRepository;
|
||||
import com.chint.domain.repository.*;
|
||||
import com.chint.domain.service.LegDomainService;
|
||||
import com.chint.domain.service.OrderDomainService;
|
||||
import com.chint.domain.service.amount_estimate.EstimateAdapter;
|
||||
|
@ -39,6 +40,8 @@ import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
|||
import static com.chint.infrastructure.constant.FSSCConstant.*;
|
||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_HOTEL;
|
||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_OTHER;
|
||||
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_CITY;
|
||||
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_COUNTY;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL_NAME;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_PREPARE_NAME;
|
||||
import static com.chint.infrastructure.constant.RouteConstant.*;
|
||||
|
@ -73,6 +76,17 @@ public class OrderQuery {
|
|||
@Autowired
|
||||
private RouteCacheService routeCacheService;
|
||||
|
||||
@Autowired
|
||||
private DistrictInfoRepository districtInfoRepository;
|
||||
|
||||
@Autowired
|
||||
private CountryLevelInfoRepository countryLevelInfoRepository;
|
||||
|
||||
@Autowired
|
||||
private PrefectureLevelRepository prefectureLevelRepository;
|
||||
|
||||
@Autowired
|
||||
private LocationRepository locationRepository;
|
||||
|
||||
public RouteOrder queryByOrderId(OrderQueryData queryData) {
|
||||
return routeRepository.queryById(queryData.getRouteId()).reloadStatus();
|
||||
|
@ -360,13 +374,31 @@ public class OrderQuery {
|
|||
.type(FSSCConstant.TRIP_CALLBACK_TYPE_APPROVE);
|
||||
|
||||
List<Location> locationListAfterNotNull = locationList.stream().filter(Objects::nonNull).toList();
|
||||
|
||||
List<CityEntity> cityEntities = new ArrayList<>();
|
||||
for (Location location : locationListAfterNotNull) {
|
||||
// if (location.getLocationEnName() == null) {
|
||||
// //这里的代码来补充地理位置的英文名
|
||||
// Integer level = location.getLevel();
|
||||
// if (level.equals(LOCATION_TYPE_CITY)) {
|
||||
// PrefectureLevelCityInfoEntity cityInfo = prefectureLevelRepository.findByCityId(location.getCityId());
|
||||
// location.setLocationEnName(cityInfo.getCityEnName());
|
||||
// } else if (level.equals(LOCATION_TYPE_COUNTY) && location.getLocationShortName().contains("D")) {
|
||||
// DistrictPOIInfoEntity byCityId = districtInfoRepository.findByCityId(location.getCityId());
|
||||
// location.setLocationEnName(byCityId.getDistrictEnName());
|
||||
// } else if (level.equals(LOCATION_TYPE_COUNTY)) {
|
||||
// CountryLevelInfoEntity byCityId = countryLevelInfoRepository.findByCityId(location.getCityId());
|
||||
// location.setLocationEnName(byCityId.getCountyEnName());
|
||||
// } else {
|
||||
// location.setLocationEnName("unknown");
|
||||
// }
|
||||
// }
|
||||
|
||||
CityEntity city = cityRepository.findByCityName(location.getLocationName());
|
||||
cityEntities.add(city);
|
||||
callbackDataBuilder.cityList()
|
||||
.cityName(city.getCityName())
|
||||
.cityEnName(city.getCityename())
|
||||
.cityName(location.getLocationName())
|
||||
.cityEnName(location.getLocationEnName())
|
||||
.done();
|
||||
}
|
||||
|
||||
|
|
|
@ -253,6 +253,12 @@ public class CTripEstimatePrice implements EstimatePrice {
|
|||
if (success) {
|
||||
HotelValuationResult hotelValuationResult = estimate.getData().getHotelValuationResult();
|
||||
String price = hotelValuationResult.getMaxPrice().toString();
|
||||
|
||||
if(Double.parseDouble(price) == 0){
|
||||
hotelPriceData.setSuccess(false);
|
||||
return hotelPriceData;
|
||||
}
|
||||
|
||||
String arriveData = priceQueryData.getArriveDate();
|
||||
String departDate = priceQueryData.getDepartDate();
|
||||
if (arriveData != null) {
|
||||
|
|
|
@ -123,6 +123,13 @@ public class OrderApplicationService {
|
|||
public void changeLeg(AddLegData addLegData) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LegData legData = addLegData.getLegData();
|
||||
|
||||
//如果被修改的行程类型是火车或者飞机, 就不需要结束时间 , 时间设置为开始时间当天的24小时
|
||||
String endTime = legData.getEndTime();
|
||||
if (legData.legType.equals(LEG_TYPE_TRAIN) || legData.legType.equals(LEG_TYPE_AIRPLANE)) {
|
||||
endTime = null;
|
||||
}
|
||||
|
||||
Leg leg = Optional.ofNullable(
|
||||
legRepository.findByLegId(Long.valueOf(legData.getLegId()))
|
||||
).orElseThrow(() -> new NotFoundException(CommonMessageConstant.NOT_FOUND)).reloadStatus();
|
||||
|
@ -134,8 +141,8 @@ public class OrderApplicationService {
|
|||
|
||||
//变更内容代码
|
||||
leg.setStartTime(LocalDateTime.parse(legData.getStartTime(), formatter));
|
||||
if (legData.getEndTime() != null) {
|
||||
leg.setEndTime(LocalDateTime.parse(legData.getEndTime(), formatter));
|
||||
if (endTime != null) {
|
||||
leg.setEndTime(LocalDateTime.parse(endTime, formatter));
|
||||
} else {
|
||||
leg.setEndTime(LocalDateTime.parse(legData.getStartTime(), formatter).plusHours(23).plusMinutes(59).plusSeconds(59));
|
||||
}
|
||||
|
@ -213,10 +220,10 @@ public class OrderApplicationService {
|
|||
@Transactional
|
||||
public void syncCancel(SyncLegData syncLegData) {
|
||||
Long routeId = syncLegData.getRouteId();
|
||||
if(routeId != null){
|
||||
if (routeId != null) {
|
||||
RouteOrder routeOrder = routeRepository.queryById(routeId);
|
||||
String supplierName = routeOrder.getSupplierName();
|
||||
if(supplierName != null){
|
||||
if (supplierName != null) {
|
||||
syncAdapter.of(supplierName).cancelSyncSupplierOrder(routeOrder);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,12 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.relational.core.mapping.Column;
|
||||
import org.springframework.data.relational.core.mapping.MappedCollection;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -25,6 +24,7 @@ public class Location implements Serializable {
|
|||
private String locationPath;
|
||||
private String locationPathName;
|
||||
private String locationName;
|
||||
private String locationEnName;
|
||||
private String locationShortName;
|
||||
private String firstPinYin;
|
||||
private Long parentLocationId;
|
||||
|
@ -33,6 +33,4 @@ public class Location implements Serializable {
|
|||
private Integer level;
|
||||
private Long cityId;
|
||||
private Integer isHaveAirport;
|
||||
|
||||
|
||||
}
|
|
@ -110,6 +110,11 @@ public class User implements Serializable {
|
|||
this.addFsscSystemToList(fsscSystem);
|
||||
return this;
|
||||
}
|
||||
public User addJTFssc(String companyName,String loadUrl, PostRequest postRequest) {
|
||||
FsscSystem fsscSystem = new FsscSystem(companyName, FSSC, postRequest.getReDirectUrl(loadUrl + generateFsscUrlPath()));
|
||||
this.addFsscSystemToList(fsscSystem);
|
||||
return this;
|
||||
}
|
||||
|
||||
public static User withEmployeeNo(String employeeNo) {
|
||||
return new User(employeeNo);
|
||||
|
|
|
@ -62,7 +62,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
if (first.get().getCarOrderDetail() == null) {
|
||||
carOrderDetail = new CarOrderDetail();
|
||||
} else {
|
||||
return first.get().getCarOrderDetail();
|
||||
carOrderDetail = first.get().getCarOrderDetail();
|
||||
}
|
||||
} else {
|
||||
carOrderDetail = new CarOrderDetail();
|
||||
|
@ -266,7 +266,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// flightOrderDetail.setSupplier(SUPPLIER_C_TRIP_EXTENSION_NAME);
|
||||
|
||||
flightOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
||||
|
|
|
@ -11,5 +11,7 @@ public interface CountryLevelInfoRepository {
|
|||
|
||||
List<CountryLevelInfoEntity> findByCityName(String cityName);
|
||||
|
||||
CountryLevelInfoEntity findByCityId(Long cityId);
|
||||
|
||||
|
||||
}
|
|
@ -8,5 +8,7 @@ public interface DistrictInfoRepository {
|
|||
|
||||
List<DistrictPOIInfoEntity> findAll();
|
||||
|
||||
DistrictPOIInfoEntity findByCityId(Long cityId);
|
||||
|
||||
DistrictPOIInfoEntity save(DistrictPOIInfoEntity districtPOIInfoEntity);
|
||||
}
|
||||
|
|
|
@ -6,4 +6,6 @@ import java.util.List;
|
|||
|
||||
public interface JTCompanyRepository {
|
||||
List<JTCompany> findAll();
|
||||
|
||||
JTCompany findByCompanyCode(String companyCode);
|
||||
}
|
||||
|
|
|
@ -10,12 +10,15 @@ import java.util.List;
|
|||
public interface LocationRepository {
|
||||
// List<Location> findByHot(List<LocationHot> locationHots);
|
||||
Location findByLocationId(Long locationId);
|
||||
Location save(Location location);
|
||||
|
||||
PageResult<Location> pageQuery(LocationParam locationParam);
|
||||
|
||||
List<Location> findAll();
|
||||
|
||||
Location findByCityId(Long cityId,String shortName);
|
||||
|
||||
List<Location> findAllLevelThreeAndFour();
|
||||
List<Location> findAllLeverThreeAndIsInternal();
|
||||
|
||||
Location findById(Long id);
|
||||
|
|
|
@ -73,7 +73,6 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync {
|
|||
private ApprovalRequest getApprovalRequestParam(RouteOrder order) {
|
||||
|
||||
ApproveOrderNo approveOrderNo = order.getApproveOrderNo();
|
||||
|
||||
RankInfo rankInfo = RankInfo.of(order.getStandardLevel());
|
||||
String employeeNo = String.valueOf(order.getUserId());
|
||||
ApprovalRequest approvalRequestParam = ApprovalRequest
|
||||
|
|
|
@ -18,6 +18,7 @@ public class CommonMessageConstant {
|
|||
public static final String REDIRECT_NOT_EXIST = "暂无跳转地址";
|
||||
public static final String LEG_CHANGE_MAX_ERROR = "最多支持变更两次";
|
||||
public static final String NO_PRICE_ERROR = "无估算价格";
|
||||
public static final String HOTEL_MAX_PRICE = "无估算价格";
|
||||
|
||||
public static final String RESULT_SUCCESS_CODE = "1";
|
||||
public static final String RESULT_ERROR_CODE = "0";
|
||||
|
|
|
@ -47,6 +47,7 @@ public class CityRepositoryImpl implements CityRepository {
|
|||
} else {
|
||||
throw new NotFoundException(NOT_FOUND);
|
||||
}
|
||||
}return byCityName;}
|
||||
|
||||
}
|
||||
return byCityName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,11 @@ public class CountryLevelRepositoryImpl implements CountryLevelInfoRepository {
|
|||
jdbcCountryLevelRepository.findByCountyName(cityName);
|
||||
return prefectureLevelCityInfoEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CountryLevelInfoEntity findByCityId(Long cityId) {
|
||||
return jdbcCountryLevelRepository.findByCountyId(cityId);
|
||||
}
|
||||
// public Location findByLocationId(Long locationId) {
|
||||
// return jdbcLocationRepository.findByLocationId(locationId);
|
||||
// }
|
||||
|
|
|
@ -23,6 +23,11 @@ public class DistrictInfoRepositoryImpl implements DistrictInfoRepository {
|
|||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DistrictPOIInfoEntity findByCityId(Long cityId) {
|
||||
return jdbcDistrictInfoRepository.findByDistrictId(cityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DistrictPOIInfoEntity save(DistrictPOIInfoEntity districtPOIInfoEntity) {
|
||||
return jdbcDistrictInfoRepository.save(districtPOIInfoEntity);
|
||||
|
|
|
@ -22,4 +22,9 @@ public class JTCompanyRepositoryImpl implements JTCompanyRepository {
|
|||
);
|
||||
return all;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JTCompany findByCompanyCode(String companyCode) {
|
||||
return jdbcJTCompanyRepository.findByCompanyCode(companyCode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@ public class LocationRepositoryImpl implements LocationRepository {
|
|||
return jdbcLocationRepository.findByLocationId(locationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location save(Location location) {
|
||||
return jdbcLocationRepository.save(location);
|
||||
}
|
||||
|
||||
@Cacheable(value = "Location-pageQuery", key = "#locationParam")
|
||||
@Override
|
||||
|
@ -60,13 +64,18 @@ public class LocationRepositoryImpl implements LocationRepository {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Location findByCityId(Long cityId,String shortName) {
|
||||
return jdbcLocationRepository.findByCityIdAndLocationShortName(cityId,shortName);
|
||||
public Location findByCityId(Long cityId, String shortName) {
|
||||
return jdbcLocationRepository.findByCityIdAndLocationShortName(cityId, shortName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> findAllLevelThreeAndFour() {
|
||||
return jdbcLocationRepository.findByLevelOrLevel(3, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> findAllLeverThreeAndIsInternal() {
|
||||
return jdbcLocationRepository.findByLevelAndIsInternal(3,1);
|
||||
return jdbcLocationRepository.findByLevelAndIsInternal(3, 1);
|
||||
}
|
||||
|
||||
@Cacheable(value = "Location-findById", key = "#id")
|
||||
|
|
|
@ -15,5 +15,5 @@ public interface JdbcCountryLevelRepository extends CrudRepository<CountryLevelI
|
|||
|
||||
List<CountryLevelInfoEntity> findByCountyName(String countyName);
|
||||
|
||||
|
||||
CountryLevelInfoEntity findByCountyId(Long countyId);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.springframework.data.repository.CrudRepository;
|
|||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface JdbcDistrictInfoRepository extends CrudRepository<DistrictPOIInfoEntity,Long> {
|
||||
|
||||
public interface JdbcDistrictInfoRepository extends CrudRepository<DistrictPOIInfoEntity, Long> {
|
||||
|
||||
DistrictPOIInfoEntity findByDistrictId(Long districtId);
|
||||
}
|
||||
|
|
|
@ -6,5 +6,7 @@ import org.springframework.data.repository.CrudRepository;
|
|||
|
||||
public interface JdbcJTCompanyRepositoryImpl extends CrudRepository<JTCompany, Long> {
|
||||
CompanyBlackList findByCompanyName(String companyName);
|
||||
|
||||
JTCompany findByCompanyCode(String companyCode);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ public interface JdbcLocationRepository extends CrudRepository<Location, Long> {
|
|||
|
||||
Location findByLocationShortName(String locationShortName);
|
||||
|
||||
List<Location> findByLevelOrLevel(Integer level, Integer level2);
|
||||
|
||||
Page<Location> findAllByLocationPathContaining(String locationPath, Pageable pageable);
|
||||
|
||||
Page<Location> findAllByParentLocationId(Long parentLocationId, Pageable pageable);
|
||||
|
|
|
@ -5,7 +5,7 @@ import lombok.Data;
|
|||
|
||||
@Data
|
||||
public class ANBPMBack {
|
||||
private String data;
|
||||
private Object data;
|
||||
private String message;
|
||||
private String messageType;
|
||||
private Boolean success;
|
||||
|
|
|
@ -93,7 +93,7 @@ public class CTripUserSaveRequest {
|
|||
AuthenticationEntity authenticationEntity = new AuthenticationEntity();
|
||||
authenticationEntity.setName(user.getName());
|
||||
authenticationEntity.setEmployeeID(user.getEmployeeNo().toString());
|
||||
// authenticationEntity.setRankName(user.getRankCode());
|
||||
// authenticationEntity.setRankName(user.getStandardLevel());
|
||||
authenticationEntity.setValid(user.getWorkStatus());
|
||||
authenticationEntity.setSubAccountName(subAccountName);
|
||||
return authenticationEntity;
|
||||
|
|
|
@ -119,7 +119,9 @@ public class LYCallBackDataHandler {
|
|||
.outStatus(outStatus)
|
||||
.eventType(ORDER_EVENT_ETA)
|
||||
.sendToQueue();
|
||||
|
||||
} else if (isRuleViolate.equals(L_Y_IS_RULE_VIOLATE)) {
|
||||
//已经推送过的超标
|
||||
return new LYNoteResponse("100", "OK");
|
||||
} else {
|
||||
Command.of(OrderStatusChangeCommand.class)
|
||||
.orderDetail(orderDetail)
|
||||
|
|
|
@ -3,7 +3,9 @@ package com.chint.interfaces.rest.user;
|
|||
|
||||
import com.chint.domain.aggregates.standards.Ranks;
|
||||
import com.chint.domain.aggregates.standards.StaffRank;
|
||||
import com.chint.domain.aggregates.system.JTCompany;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.JTCompanyRepository;
|
||||
import com.chint.domain.repository.StaffRankRepository;
|
||||
import com.chint.domain.service.JTCompanyDomainService;
|
||||
import com.chint.domain.service.RankDomainService;
|
||||
|
@ -54,6 +56,9 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
|||
@Autowired
|
||||
private UserSFRequest userSFRequest;
|
||||
|
||||
@Autowired
|
||||
private JTCompanyRepository jtCompanyRepository;
|
||||
|
||||
|
||||
@Value("${sf.systemId}")
|
||||
private String systemId;
|
||||
|
@ -68,10 +73,10 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
|||
String rankName = null;
|
||||
//默认先查找职级表里的内容
|
||||
Optional<List<StaffRank>> staffRank = staffRankRepository
|
||||
.findRankNameByEmployNoAndJTCompany(user.getEmployeeNo(),user.getCompanyCode());
|
||||
.findRankNameByEmployNoAndJTCompany(user.getEmployeeNo(), user.getCompanyCode());
|
||||
if (staffRank.isPresent() && !staffRank.get().isEmpty()) {
|
||||
rankName = staffRank.get().get(0).getEmployeeLevel();
|
||||
} else {
|
||||
} else {
|
||||
//如果表里没有维护他的职级 , 那么取是sf号的职级
|
||||
if (user.getManaLevel() != null) {
|
||||
rankName = user.getManaLevel();
|
||||
|
@ -120,7 +125,7 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
|||
}
|
||||
//如果用户的公司编码属于集团 ,那么加入集团财务共享跳转地址
|
||||
if (jtCompanyDomainService.ifCompanyInJT(null, userData.getCompany())) {
|
||||
user.addJTFssc(FSSC_LOAD_URL, postRequest);
|
||||
user.addJTFssc(userData.getCompany_cn(), FSSC_LOAD_URL, postRequest);
|
||||
}
|
||||
|
||||
return user;
|
||||
|
@ -163,12 +168,18 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
|||
.map(UserDataDTO::getCompany)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
boolean isInJTCompany = companyCodes.stream()
|
||||
.anyMatch(code -> jtCompanyDomainService.ifCompanyInJT(null, code));
|
||||
|
||||
if (isInJTCompany) {
|
||||
user.addJTFssc(FSSC_LOAD_URL, postRequest);
|
||||
List<String> inJtCompanyCodes = companyCodes
|
||||
.stream()
|
||||
.filter(code -> jtCompanyDomainService.ifCompanyInJT(null, code))
|
||||
.toList();
|
||||
|
||||
for (String inJtCompanyCode : inJtCompanyCodes) {
|
||||
JTCompany byCompanyCode = jtCompanyRepository.findByCompanyCode(inJtCompanyCode);
|
||||
user.addJTFssc(byCompanyCode.getCompanyName(), FSSC_LOAD_URL, postRequest);
|
||||
}
|
||||
|
||||
|
||||
if (companyCodes.contains(XN_COMPANY_CODE)) {
|
||||
user.addXNFssc(FSSC_LOAD_URL, postRequest);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ bpm:
|
|||
#集团H3
|
||||
H3BPMUrl: https://bpm10.chint.com
|
||||
#电源
|
||||
DYBPMUrl: https://bpm10ps.chint.com #测试地址
|
||||
DYBPMUrl: https://bpm10ps.chint.com
|
||||
#新能
|
||||
XNBPMUrl: https://bpm.astronergy.com.cn
|
||||
xn-client-id: xclient
|
||||
|
|
Loading…
Reference in New Issue