同步代码
This commit is contained in:
parent
fc6a2821d5
commit
a0ef0eef99
|
@ -0,0 +1,6 @@
|
|||
package com.chint.application.dtos;
|
||||
|
||||
import com.chint.domain.value_object.BaseQuery;
|
||||
|
||||
public class OrderDetailQueryParam extends BaseQuery {
|
||||
}
|
|
@ -34,6 +34,7 @@ public class RouteOrderPageRes {
|
|||
private String amount;
|
||||
private String estimateAmount;
|
||||
private Integer orderStatus;
|
||||
private String approvalStatusCode;
|
||||
private String approvalStatus;
|
||||
private String orderStatusName;
|
||||
private String startTime;
|
||||
|
|
|
@ -80,6 +80,15 @@ public class OrderController {
|
|||
return Result.Success(SUCCESS);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@ApiOperation("修改行程节点")
|
||||
@PostMapping("/leg/update")
|
||||
public Result<String> updateLeg(@RequestBody AddLegData addLegData) {
|
||||
orderApplicationService.updateLegToOrder(addLegData);
|
||||
return Result.Success(SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@ApiOperation("删除行程节点")
|
||||
@PostMapping("/leg/delete")
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package com.chint.application.out;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chint.application.dtos.AuthenticationDto;
|
||||
import com.chint.application.dtos.AuthenticationSignDto;
|
||||
import com.chint.application.dtos.LocationParam;
|
||||
import com.chint.application.dtos.OrderSearchResult;
|
||||
import com.chint.application.dtos.*;
|
||||
import com.chint.application.dtos.response.LocationRes;
|
||||
import com.chint.application.dtos.response.OrderDetailRes;
|
||||
import com.chint.domain.aggregates.order.Location;
|
||||
import com.chint.domain.repository.ClientRepository;
|
||||
import com.chint.domain.repository.LocationRepository;
|
||||
|
@ -71,4 +69,11 @@ public class OrderDetailController {
|
|||
return Result.error("签名错误");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询我的订单")
|
||||
@PostMapping("/query/page")
|
||||
public Result<OrderDetailRes> query(@RequestBody OrderDetailQueryParam orderDetailQueryParam){
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.chint.application.queryies;
|
||||
|
||||
|
||||
import com.chint.application.dtos.OrderDetailQueryParam;
|
||||
import com.chint.application.dtos.response.OrderDetailRes;
|
||||
import com.chint.domain.repository.OrderDetailRepository;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class OrderDetailQuery {
|
||||
|
||||
@Autowired
|
||||
private OrderDetailRepository orderDetailRepository;
|
||||
|
||||
|
||||
public PageResult<OrderDetailRes> orderDetailPageQuery(OrderDetailQueryParam orderDetailQueryParam) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -149,4 +149,8 @@ public class OrderApplicationService {
|
|||
public void reloadOrderDetail(SyncLegData syncLegData) {
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void updateLegToOrder(AddLegData addLegData) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ public class OrderDetail {
|
|||
private CurrencyType currencyType; //货币类型
|
||||
private Long destinationId;
|
||||
private Long originId;
|
||||
private String employeeNo;
|
||||
private LocalDateTime orderDate;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
|
@ -69,7 +70,10 @@ public class OrderDetail {
|
|||
orderDetail.setUpdateTime(LocalDateTime.now());
|
||||
return orderDetail;
|
||||
}
|
||||
|
||||
public OrderDetail employeeNo(String employeeNo) {
|
||||
this.setEmployeeNo(employeeNo);
|
||||
return this;
|
||||
}
|
||||
public OrderDetail productType(Integer productType) {
|
||||
this.setProductType(productType);
|
||||
return this;
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
import com.chint.application.dtos.OrderDetailQueryParam;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface OrderDetailRepository {
|
||||
|
||||
Page<OrderDetail> pageQuery(OrderDetailQueryParam orderDetailQueryParam);
|
||||
OrderDetail findById(Long orderDetailId);
|
||||
|
||||
List<OrderDetail> findByLegId(Long legId);
|
||||
|
|
|
@ -153,7 +153,8 @@ public class LegEventHandler implements LegEventService {
|
|||
if (byOrderNo.isEmpty()) {
|
||||
//否则创建新的订单添加到routeOrder
|
||||
orderDetail = orderDetailFactory.create(data)
|
||||
.price(data.getPrice()).productType(data.getProductType());
|
||||
.price(data.getPrice()).productType(data.getProductType())
|
||||
.employeeNo(routeOrder.getUserId());
|
||||
routeOrder.addOrderDetail(orderDetail);
|
||||
routeOrder = routeRepository.save(routeOrder);
|
||||
// OrderDetail orderDetail = routeOrder
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
package com.chint.infrastructure.repository;
|
||||
|
||||
import com.chint.application.dtos.OrderDetailQueryParam;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.exceptions.NotFoundException;
|
||||
import com.chint.domain.repository.OrderDetailRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -17,6 +22,14 @@ public class OrderDetailRepositoryImpl implements OrderDetailRepository {
|
|||
@Autowired
|
||||
private JdbcOrderDetailRepository orderDetailRepository;
|
||||
|
||||
@Override
|
||||
public Page<OrderDetail> pageQuery(OrderDetailQueryParam orderDetailQueryParam) {
|
||||
PageRequest pageRequest = PageRequest
|
||||
.of(orderDetailQueryParam.getPageNum() - 1, orderDetailQueryParam.getPageSize(), Sort.by("updateTime"));
|
||||
String employeeNo = BaseContext.getCurrentUser().getEmployeeNo();
|
||||
return orderDetailRepository.findByEmployeeNo(employeeNo, pageRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderDetail findById(Long orderDetailId) {
|
||||
return orderDetailRepository.findById(orderDetailId).orElseThrow(() -> new NotFoundException(NOT_FOUND));
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
@ -12,4 +14,6 @@ public interface JdbcOrderDetailRepository extends CrudRepository<OrderDetail, L
|
|||
OrderDetail findByOrderNo(String orderNo);
|
||||
|
||||
List<OrderDetail> findByLegId(Long legId);
|
||||
|
||||
Page<OrderDetail> findByEmployeeNo(String employeeNo, Pageable pageable);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue