diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java index d8b7fa02..1b7e8562 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java @@ -218,8 +218,22 @@ public class OrderMasterController extends BaseController { @ResponseBody public TableDataInfo appList(@RequestBody OrderMaster orderMaster) { // TableDataInfo rspData = new TableDataInfo(); - startPage(); List orderListResponses = new ArrayList<>(); + // 入参中的城市id存在时,查询符合条件的地址id + if (CollectionUtils.isNotEmpty(orderMaster.getDistrictIds()) + || CollectionUtils.isNotEmpty(orderMaster.getCityIds()) + || CollectionUtils.isNotEmpty(orderMaster.getStreetIds())) { + List addressList = addressService.getCustomerAddressList(new CustomerAddress(){{ + setDistrictIds(orderMaster.getDistrictIds()); + setCityIds(orderMaster.getCityIds()); + setStreetIds(orderMaster.getStreetIds()); + }}); + orderMaster.setAddressIds(addressList.stream().map(CustomerAddress::getCustomerAddressId).collect(Collectors.toList())); + if (CollectionUtils.isEmpty(orderMaster.getAddressIds())) { + return voDataTable(orderListResponses, new ArrayList<>()); + } + } + startPage(); List list = orderMasterService.selectOrderMasterList(orderMaster); list.forEach(master -> { //子单 diff --git a/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java b/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java index 78812212..e038ff92 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java +++ b/ghy-custom/src/main/java/com/ghy/customer/domain/CustomerAddress.java @@ -4,6 +4,8 @@ import com.ghy.common.annotation.Excel; import com.ghy.common.core.domain.BaseEntity; import lombok.Data; +import java.util.List; + /** * @author clunt * 消费者地址 @@ -47,4 +49,9 @@ public class CustomerAddress extends BaseEntity { @Excel(name = "是否有效,0.有效, 1.无效", cellType = Excel.ColumnType.STRING) private Integer status; + private List districtIds; + + private List cityIds; + + private List streetIds; } diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml index e4c81373..50ece2be 100644 --- a/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml @@ -33,6 +33,18 @@ AND customer_id = #{customerId} + + AND city_id IN + + #{id} + + + + AND country_id IN + + #{id} + + diff --git a/ghy-order/src/main/java/com/ghy/order/domain/OrderMaster.java b/ghy-order/src/main/java/com/ghy/order/domain/OrderMaster.java index 6847e793..cba1d689 100644 --- a/ghy-order/src/main/java/com/ghy/order/domain/OrderMaster.java +++ b/ghy-order/src/main/java/com/ghy/order/domain/OrderMaster.java @@ -178,4 +178,11 @@ public class OrderMaster extends BaseEntity { private String lastCallTime; + private List cityIds; + + private List districtIds; + + private List streetIds; + + private List addressIds; } diff --git a/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml b/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml index 6406f471..f5b71bd5 100644 --- a/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml +++ b/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml @@ -203,6 +203,12 @@ AND om.create_by = #{createBy} + + AND om.address_id IN + + #{id} + + order by om.create_time diff --git a/ghy-system/src/main/java/com/ghy/system/domain/SysArea.java b/ghy-system/src/main/java/com/ghy/system/domain/SysArea.java index 21c37784..92bba741 100644 --- a/ghy-system/src/main/java/com/ghy/system/domain/SysArea.java +++ b/ghy-system/src/main/java/com/ghy/system/domain/SysArea.java @@ -53,4 +53,6 @@ public class SysArea extends BaseEntity { private List child; + private List areaIds; + } diff --git a/ghy-system/src/main/resources/mapper/system/SysAreaMapper.xml b/ghy-system/src/main/resources/mapper/system/SysAreaMapper.xml index 0592a40e..238ac6a3 100644 --- a/ghy-system/src/main/resources/mapper/system/SysAreaMapper.xml +++ b/ghy-system/src/main/resources/mapper/system/SysAreaMapper.xml @@ -35,6 +35,12 @@ AND area_id = #{areaId} + + AND area_id in + + #{areaId} + + AND area_code like concat('%', #{goodsCode}, '%')