主单查询增加区域条件的筛选
This commit is contained in:
parent
c328e4f4c4
commit
3eb06f5951
|
|
@ -218,8 +218,22 @@ public class OrderMasterController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo appList(@RequestBody OrderMaster orderMaster) {
|
||||
// TableDataInfo rspData = new TableDataInfo();
|
||||
startPage();
|
||||
List<OrderListResponse> orderListResponses = new ArrayList<>();
|
||||
// 入参中的城市id存在时,查询符合条件的地址id
|
||||
if (CollectionUtils.isNotEmpty(orderMaster.getDistrictIds())
|
||||
|| CollectionUtils.isNotEmpty(orderMaster.getCityIds())
|
||||
|| CollectionUtils.isNotEmpty(orderMaster.getStreetIds())) {
|
||||
List<CustomerAddress> 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<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
|
||||
list.forEach(master -> {
|
||||
//子单
|
||||
|
|
|
|||
|
|
@ -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<Long> districtIds;
|
||||
|
||||
private List<Long> cityIds;
|
||||
|
||||
private List<Long> streetIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,18 @@
|
|||
<if test="customerId != null">
|
||||
AND customer_id = #{customerId}
|
||||
</if>
|
||||
<if test="cityIds != null and cityIds.size > 0">
|
||||
AND city_id IN
|
||||
<foreach collection="cityIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="districtIds != null and districtIds.size > 0">
|
||||
AND country_id IN
|
||||
<foreach collection="districtIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -178,4 +178,11 @@ public class OrderMaster extends BaseEntity {
|
|||
|
||||
private String lastCallTime;
|
||||
|
||||
private List<Long> cityIds;
|
||||
|
||||
private List<Long> districtIds;
|
||||
|
||||
private List<Long> streetIds;
|
||||
|
||||
private List<Long> addressIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,6 +203,12 @@
|
|||
<if test="createBy != null and createBy != ''">
|
||||
AND om.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="addressIds != null and addressIds.size > 0">
|
||||
AND om.address_id IN
|
||||
<foreach collection="addressIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by om.create_time
|
||||
<trim suffixOverrides=",">
|
||||
|
|
|
|||
|
|
@ -53,4 +53,6 @@ public class SysArea extends BaseEntity {
|
|||
|
||||
private List<SysArea> child;
|
||||
|
||||
private List<Long> areaIds;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@
|
|||
<if test="areaId != null and areaId != 0">
|
||||
AND area_id = #{areaId}
|
||||
</if>
|
||||
<if test="areaIds != null and areaIds.size > 0">
|
||||
AND area_id in
|
||||
<foreach collection="areaIds" item="areaId" open="(" separator="," close=")">
|
||||
#{areaId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
AND area_code like concat('%', #{goodsCode}, '%')
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue