feat:高德用车制度逻辑更改
This commit is contained in:
parent
a9de1b0439
commit
863cecabd3
|
@ -123,10 +123,10 @@ public class OrderDetailController {
|
|||
|
||||
@ApiOperation("根据行程规划单查询消费明细-BPM")
|
||||
@PostMapping("/public/query/detail/bpm")
|
||||
public Result<OrderDetailBPMVO> queryOrderDetail(@RequestBody OrderDetailQueryParamBPM param) {
|
||||
public OrderDetailBPMVO queryOrderDetail(@RequestBody OrderDetailQueryParamBPM param) {
|
||||
RouteOrder routeOrder = routeRepository
|
||||
.findByActualOrderNoAndSysCode(param.getSequenceNo(), H3_BPM);
|
||||
return Result.Success(SUCCESS, routeOrderMapper.mapToOrderDetailVOBPM(routeOrder));
|
||||
return routeOrderMapper.mapToOrderDetailVOBPM(routeOrder);
|
||||
}
|
||||
|
||||
@ApiOperation("订单明细导出接口")
|
||||
|
|
|
@ -2,8 +2,10 @@ package com.chint.domain.repository;
|
|||
|
||||
import com.chint.domain.aggregates.supplier.AmapPolicy;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface AmapPolicyRepository {
|
||||
Optional<AmapPolicy> findByDefault();
|
||||
Optional<AmapPolicy> findByStandardLevel(String standardLevel);
|
||||
}
|
||||
|
|
|
@ -59,8 +59,7 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
|||
@Override
|
||||
public boolean syncRouteRequest(RouteRequest routeRequest) {
|
||||
TravelApplicationDto dto = new TravelApplicationDto();
|
||||
RouteRequestFields routeRequestFields = routeRequest.getRouteRequestFields();
|
||||
TravelApplicationDto travelApplicationDto = generateTravelApplicationInfo(dto, routeRequest, routeRequestFields);
|
||||
TravelApplicationDto travelApplicationDto = generateTravelApplicationInfo(dto, routeRequest);
|
||||
|
||||
Optional<AmapRouteRelationship> byOutApplyRecordId = amapRouteRelationshipRepository
|
||||
.findByOutApplyRecordId(routeRequest.getRouteRequestNo());
|
||||
|
@ -87,7 +86,8 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
|||
return response.getCode().equals(1);
|
||||
}
|
||||
|
||||
private TravelApplicationDto generateTravelApplicationInfo(TravelApplicationDto dto, RouteRequest routeRequest, RouteRequestFields routeRequestFields) {
|
||||
private TravelApplicationDto generateTravelApplicationInfo(TravelApplicationDto dto, RouteRequest routeRequest) {
|
||||
RouteRequestFields routeRequestFields = routeRequest.getRouteRequestFields();
|
||||
dto.setOutApplyRecordId(routeRequest.getRouteRequestNo());
|
||||
//公司信息写入备注
|
||||
dto.setRemark(routeRequestFields.getAccountCompanyName() + "-"
|
||||
|
@ -135,13 +135,11 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
|||
areaCodes.add(amapLocationRequest.getACodeByLocationName(location.getLocationName()));
|
||||
}
|
||||
processContent.setValidCityList(areaCodes);
|
||||
// processContent.setAmountLimited(1);
|
||||
// processContent.setAllowCrossCity(1);
|
||||
|
||||
dto.setProcessContent(gson.toJson(processContent));
|
||||
dto.setStatus("1");
|
||||
|
||||
amapPolicyRepository.findByDefault()
|
||||
amapPolicyRepository.findByStandardLevel(routeRequestFields.getStandardLevel())
|
||||
.ifPresent(policy -> dto.setRegulationId(policy.getAmapPolicyCode()));
|
||||
|
||||
return dto;
|
||||
|
@ -155,8 +153,7 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
|||
@Override
|
||||
public boolean cancelRouteRequest(RouteRequest routeRequest) {
|
||||
TravelApplicationDto dto = new TravelApplicationDto();
|
||||
RouteRequestFields routeRequestFields = routeRequest.getRouteRequestFields();
|
||||
TravelApplicationDto travelApplicationDto = generateTravelApplicationInfo(dto, routeRequest, routeRequestFields);
|
||||
TravelApplicationDto travelApplicationDto = generateTravelApplicationInfo(dto, routeRequest);
|
||||
travelApplicationDto.setStatus("0");
|
||||
//查询关联表
|
||||
AmapRouteRelationship amapRouteRelationship = amapRouteRelationshipRepository
|
||||
|
|
|
@ -17,4 +17,10 @@ public class AmapPolicyRepositoryImpl implements AmapPolicyRepository {
|
|||
public Optional<AmapPolicy> findByDefault() {
|
||||
return jdbcAmapPolicyRepository.findByIfDefault(1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Optional<AmapPolicy> findByStandardLevel(String standardLevel) {
|
||||
return jdbcAmapPolicyRepository.queryByStandardLevel(standardLevel).stream().findFirst();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.supplier.AmapPolicy;
|
||||
import org.springframework.data.jdbc.repository.query.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface JdbcAmapPolicyRepository extends CrudRepository<AmapPolicy, Long> {
|
||||
Optional<AmapPolicy> findByIfDefault(Integer ifDefault);
|
||||
|
||||
@Query("""
|
||||
select a.* from amap_policy a left join amap_policy_rank ar on a.id = ar.amap_policy_id
|
||||
left join ranks r on ar.rank_id = r.rank_id where r.standard_level = :standardLevel
|
||||
""")
|
||||
List<AmapPolicy> queryByStandardLevel(@Param("standardLevel") String standardLevel);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.chint;
|
||||
|
||||
import com.chint.domain.aggregates.supplier.AmapPolicy;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.AmapPolicyRepository;
|
||||
import com.chint.domain.service.supplier.SupplierService;
|
||||
import com.chint.domain.value_object.SupplierCallbackData;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
|
@ -25,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_AMAP;
|
||||
|
||||
|
@ -43,6 +46,9 @@ public class AmapTest {
|
|||
@Autowired
|
||||
private AmapOrderDetailRequest orderDetailRequest;
|
||||
|
||||
@Autowired
|
||||
private AmapPolicyRepository amapPolicyRepository;
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
private User user = new User(1L, "230615020", 1, "卢麟哲", "lulz1@chint.com", "15857193365", "A30000001");
|
||||
|
@ -65,6 +71,12 @@ public class AmapTest {
|
|||
@Autowired
|
||||
private SupplierService supplierService;
|
||||
|
||||
@Test
|
||||
void testRank(){
|
||||
Optional<AmapPolicy> amapPolicies = amapPolicyRepository.findByStandardLevel("JT_STANDARD_LEVEL_FOUR");
|
||||
System.out.println(amapPolicies);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理订单
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue