Commit 3bde7cb7 authored by chenjiuping's avatar chenjiuping

异常订单查询

parent 01c23c6f
...@@ -35,13 +35,11 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi; ...@@ -35,13 +35,11 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO;
import cn.iocoder.yudao.module.order.convert.orderException.OrderExceptionConvert; import cn.iocoder.yudao.module.order.convert.orderException.OrderExceptionConvert;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderException.OrderExceptionDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderException.OrderExceptionDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderExceptionChannelPrice.OrderExceptionChannelPriceDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderExceptionChannelPrice.OrderExceptionChannelPriceDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderExceptionResult.OrderExceptionResultDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderExceptionResult.OrderExceptionResultDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.dal.mysql.orderException.OrderExceptionMapper; import cn.iocoder.yudao.module.order.dal.mysql.orderException.OrderExceptionMapper;
import cn.iocoder.yudao.module.order.enums.OrderAbnormalStateEnum; import cn.iocoder.yudao.module.order.enums.OrderAbnormalStateEnum;
import cn.iocoder.yudao.module.order.enums.OrderExceptionEnum; import cn.iocoder.yudao.module.order.enums.OrderExceptionEnum;
...@@ -417,13 +415,20 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -417,13 +415,20 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.eqIfPresent("o.is_external_warehouse", reqVo.getIsExternalWarehouse()); queryWrapper.eqIfPresent("o.is_external_warehouse", reqVo.getIsExternalWarehouse());
queryWrapper.eqIfPresent("o.is_cargo_control", reqVo.getIsCargoControl()); queryWrapper.eqIfPresent("o.is_cargo_control", reqVo.getIsCargoControl());
queryWrapper.eqIfPresent("o.transport_id", reqVo.getTransportId()); queryWrapper.eqIfPresent("o.transport_id", reqVo.getTransportId());
if (StringUtils.isNotBlank(reqVo.getOriginId())) { if (null != reqVo.getOriginId() && reqVo.getOriginId().size() > 0) {
queryWrapper.eqIfPresent("wl.start_warehouse_id", reqVo.getOriginId()); queryWrapper.inIfPresent("wl.start_warehouse_id", reqVo.getOriginId());
} }
if (null != reqVo.getDestinationId() && reqVo.getDestinationId().size() > 0) { if (null != reqVo.getDestinationId() && reqVo.getDestinationId().size() > 0) {
queryWrapper.inIfPresent("wl.dest_warehouse_id", reqVo.getDestinationId()); queryWrapper.inIfPresent("wl.dest_warehouse_id", reqVo.getDestinationId());
} }
if (null != reqVo.getDestCityId() && reqVo.getDestCityId().size() > 0) {
queryWrapper.inIfPresent("eo.objective_id", reqVo.getDestCityId());
}
if (null != reqVo.getDestCountryId() && reqVo.getDestCountryId().size() > 0) {
queryWrapper.inIfPresent("eo.objective_country_id", reqVo.getDestCountryId());
}
if (null != reqVo.getOrderExceptionType() && reqVo.getOrderExceptionType().size() > 0) { if (null != reqVo.getOrderExceptionType() && reqVo.getOrderExceptionType().size() > 0) {
queryWrapper.inIfPresent("e.order_exception_type", reqVo.getOrderExceptionType()); queryWrapper.inIfPresent("e.order_exception_type", reqVo.getOrderExceptionType());
} }
...@@ -477,7 +482,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -477,7 +482,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("o.package_type", reqVo.getPackageType().split(",")); queryWrapper.inIfPresent("o.package_type", reqVo.getPackageType().split(","));
} }
queryWrapper.eq(null != reqVo.getChannelId(), "o.channel_id", reqVo.getChannelId()); //queryWrapper.eq(null != reqVo.getChannelId(), "o.channel_id", reqVo.getChannelId());
queryWrapper.in(null != reqVo.getChannelIdList(), "o.channel_id", reqVo.getChannelIdList());
//跟进客服
queryWrapper.in(null != reqVo.getCustomerServiceIdList(), "su.customer_service_id", reqVo.getCustomerServiceIdList());
queryWrapper.orderByDesc("e.id"); queryWrapper.orderByDesc("e.id");
...@@ -2504,13 +2514,20 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -2504,13 +2514,20 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.eqIfPresent("a.is_cargo_control", queryWrapper.eqIfPresent("a.is_cargo_control",
reqVo.getIsCargoControl()); reqVo.getIsCargoControl());
queryWrapper.eqIfPresent("a.transport_id", reqVo.getTransportId()); queryWrapper.eqIfPresent("a.transport_id", reqVo.getTransportId());
if (StringUtils.isNotBlank(reqVo.getOriginId())) { if (null != reqVo.getOriginId() && reqVo.getOriginId().size() > 0) {
queryWrapper.eqIfPresent("wl.start_warehouse_id", reqVo.getOriginId()); queryWrapper.inIfPresent("wl.start_warehouse_id", reqVo.getOriginId());
} }
if (null != reqVo.getDestinationId() && reqVo.getDestinationId().size() > 0) { if (null != reqVo.getDestinationId() && reqVo.getDestinationId().size() > 0) {
queryWrapper.inIfPresent("wl.dest_warehouse_id", reqVo.getDestinationId()); queryWrapper.inIfPresent("wl.dest_warehouse_id", reqVo.getDestinationId());
} }
if (null != reqVo.getDestCityId() && reqVo.getDestCityId().size() > 0) {
queryWrapper.inIfPresent("eo.objective_id", reqVo.getDestCityId());
}
if (null != reqVo.getDestCountryId() && reqVo.getDestCountryId().size() > 0) {
queryWrapper.inIfPresent("eo.objective_country_id", reqVo.getDestCountryId());
}
queryWrapper.eqIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatus()); queryWrapper.eqIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatus());
if (StringUtils.isNotBlank(reqVo.getConsignor())) { if (StringUtils.isNotBlank(reqVo.getConsignor())) {
queryWrapper.eq("oc.customer_id", reqVo.getConsignor()); queryWrapper.eq("oc.customer_id", reqVo.getConsignor());
...@@ -2570,7 +2587,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -2570,7 +2587,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("a.package_type", reqVo.getPackageType().split(",")); queryWrapper.inIfPresent("a.package_type", reqVo.getPackageType().split(","));
} }
queryWrapper.eq(null != reqVo.getChannelId(), "a.channel_id", reqVo.getChannelId()); //渠道支持多选queryWrapper.eq(null != reqVo.getChannelId(), "a.channel_id", reqVo.getChannelId());
queryWrapper.in(null != reqVo.getChannelIdList(), "a.channel_id", reqVo.getChannelIdList());
//跟进客服
queryWrapper.in(null != reqVo.getCustomerServiceIdList(), "su.customer_service_id", reqVo.getCustomerServiceIdList());
queryWrapper.orderByDesc("b.id"); queryWrapper.orderByDesc("b.id");
...@@ -2620,12 +2642,18 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -2620,12 +2642,18 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.eqIfPresent("a.is_external_warehouse", reqVo.getIsExternalWarehouse()); queryWrapper.eqIfPresent("a.is_external_warehouse", reqVo.getIsExternalWarehouse());
queryWrapper.eqIfPresent("a.is_cargo_control", reqVo.getIsCargoControl()); queryWrapper.eqIfPresent("a.is_cargo_control", reqVo.getIsCargoControl());
queryWrapper.eqIfPresent("a.transport_id", reqVo.getTransportId()); queryWrapper.eqIfPresent("a.transport_id", reqVo.getTransportId());
if (StringUtils.isNotBlank(reqVo.getOriginId())) { if (null != reqVo.getOriginId() && reqVo.getOriginId().size() > 0) {
queryWrapper.eqIfPresent("wl.start_warehouse_id", reqVo.getOriginId()); queryWrapper.inIfPresent("wl.start_warehouse_id", reqVo.getOriginId());
} }
if (null != reqVo.getDestinationId() && reqVo.getDestinationId().size() > 0) { if (null != reqVo.getDestinationId() && reqVo.getDestinationId().size() > 0) {
queryWrapper.inIfPresent("wl.dest_warehouse_id", reqVo.getDestinationId()); queryWrapper.inIfPresent("wl.dest_warehouse_id", reqVo.getDestinationId());
} }
if (null != reqVo.getDestCityId() && reqVo.getDestCityId().size() > 0) {
queryWrapper.inIfPresent("eo.objective_id", reqVo.getDestCityId());
}
if (null != reqVo.getDestCountryId() && reqVo.getDestCountryId().size() > 0) {
queryWrapper.inIfPresent("eo.objective_country_id", reqVo.getDestCountryId());
}
queryWrapper.eqIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatus()); queryWrapper.eqIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatus());
if (StringUtils.isNotBlank(reqVo.getConsignor())) { if (StringUtils.isNotBlank(reqVo.getConsignor())) {
...@@ -2677,7 +2705,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -2677,7 +2705,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("a.package_type", reqVo.getPackageType().split(",")); queryWrapper.inIfPresent("a.package_type", reqVo.getPackageType().split(","));
} }
queryWrapper.eq(null != reqVo.getChannelId(), "a.channel_id", reqVo.getChannelId()); //queryWrapper.eq(null != reqVo.getChannelId(), "a.channel_id", reqVo.getChannelId());
queryWrapper.in(null != reqVo.getChannelIdList(), "a.channel_id", reqVo.getChannelIdList());
//跟进客服
queryWrapper.in(null != reqVo.getCustomerServiceIdList(), "su.customer_service_id", reqVo.getCustomerServiceIdList());
StatisticsOrderVO vo = orderExceptionMapper.statisticsExceptionOrder(queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime); StatisticsOrderVO vo = orderExceptionMapper.statisticsExceptionOrder(queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
if (Objects.nonNull(vo)) { if (Objects.nonNull(vo)) {
......
...@@ -18,10 +18,10 @@ public class OrderExceptionQueryVO { ...@@ -18,10 +18,10 @@ public class OrderExceptionQueryVO {
@ApiModelProperty(value = "运输方式id") @ApiModelProperty(value = "运输方式id")
private Integer transportId; private Integer transportId;
@ApiModelProperty(value = "始发") @ApiModelProperty(value = "始发")
private String originId; private List<String> originId;
@ApiModelProperty(value = "目的") @ApiModelProperty(value = "目的")
private List<String> destinationId; private List<String> destinationId;
@ApiModelProperty(value = "订单id") @ApiModelProperty(value = "订单id")
...@@ -101,7 +101,15 @@ public class OrderExceptionQueryVO { ...@@ -101,7 +101,15 @@ public class OrderExceptionQueryVO {
@ApiModelProperty(value = "特需") @ApiModelProperty(value = "特需")
private String packageType; private String packageType;
@ApiModelProperty(value = "渠道") @ApiModelProperty(value = "渠道集合")
private Long channelId; private List<Long> channelIdList;
@ApiModelProperty(value = "跟进客服")
private List<Long> customerServiceIdList;
@ApiModelProperty(value = "目的国")
private List<Long> destCountryId;
@ApiModelProperty(value = "目的城市")
private List<Long> destCityId;
} }
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
LEFT JOIN ecw_order_consignee oe ON oe.order_id = a.order_id LEFT JOIN ecw_order_consignee oe ON oe.order_id = a.order_id
LEFT JOIN ecw_warehouse_line wl on a.line_id = wl.id LEFT JOIN ecw_warehouse_line wl on a.line_id = wl.id
LEFT JOIN ecw_warehouse dest_warehouse on wl.dest_warehouse_id = dest_warehouse.id LEFT JOIN ecw_warehouse dest_warehouse on wl.dest_warehouse_id = dest_warehouse.id
left join ecw_order_objective eo on a.order_id = eo.order_id
LEFT JOIN system_user su on a.salesman_id = su.id
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
...@@ -207,6 +209,7 @@ ...@@ -207,6 +209,7 @@
LEFT JOIN ecw_order_consignee oe ON oe.order_id = a.order_id LEFT JOIN ecw_order_consignee oe ON oe.order_id = a.order_id
LEFT JOIN ecw_warehouse_line wl on a.line_id = wl.id LEFT JOIN ecw_warehouse_line wl on a.line_id = wl.id
LEFT JOIN ecw_warehouse dest_warehouse on wl.dest_warehouse_id = dest_warehouse.id LEFT JOIN ecw_warehouse dest_warehouse on wl.dest_warehouse_id = dest_warehouse.id
left join ecw_order_objective eo on a.order_id = eo.order_id
left join (select it.order_id AS order_id, left join (select it.order_id AS order_id,
SUM( SUM(
IFNULL( IFNULL(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment