Commit ddb8bdfd authored by 332784038@qq.com's avatar 332784038@qq.com

订单查询参数重构

parent c323c4d1
......@@ -646,12 +646,12 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
List<OrderBackPageVO> orderList(@Param("start") int start, @Param("size") int size, @Param("query") OrderQueryVO query);
List<OrderBackPageVO> myOrderPageList(@Param("start") int start, @Param("size") int size, @Param("query") OrderQueryDTO query);
List<OrderBackPageVO> myOrderPageList(@Param("start") int start, @Param("size") int size, @Param("query") OrderQueryVO query);
long orderCount(@Param("query") OrderQueryVO query);
long myOrderCount(@Param("query") OrderQueryDTO query);
long myOrderCount(@Param("query") OrderQueryVO query);
List<OrderExcelVO> exportOrderExcelList(@Param("start")int start, @Param("size") int size,@Param("query") OrderQueryVO query);
......
......@@ -61,7 +61,7 @@ public class ContainerNumberOrderExcelExportListener {
PageVO page = new PageVO();
page.setRows(10000);
page.setPage(1);
OrderQueryDTO query = JSONObject.parseObject(event.getRequestParams(), OrderQueryDTO.class);
OrderQueryVO query = JSONObject.parseObject(event.getRequestParams(), OrderQueryVO.class);
query.setLang(event.getLang());
PageResult<OrderBackPageVO> orderPage = orderQueryService.myOrderPage(query, page);
if (CollectionUtil.isNotEmpty(orderPage.getList())) {
......
......@@ -154,7 +154,7 @@ public interface OrderQueryService {
PageResult<OrderBackPageVO> orderPage(OrderQueryVO query, PageVO page);
PageResult<OrderBackPageVO> myOrderPage(OrderQueryDTO query, PageVO page);
PageResult<OrderBackPageVO> myOrderPage(OrderQueryVO query, PageVO page);
long orderCount(OrderQueryVO query);
......
......@@ -966,18 +966,17 @@ public class OrderQueryServiceImpl implements OrderQueryService {
}
@Override
public PageResult<OrderBackPageVO> myOrderPage(OrderQueryDTO query, PageVO page) {
public PageResult<OrderBackPageVO> myOrderPage(OrderQueryVO query, PageVO page) {
if (Objects.isNull(query.getLang())) {
query.setLang(I18nMessage.getLang());
}
caseStatus(query.getStatus(), query);
// caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.myOrderCount(query);
log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<OrderBackPageVO> list = orderMapper.myOrderPageList(start, size, query);
long total = orderMapper.myOrderCount(query);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
......@@ -1005,8 +1004,6 @@ public class OrderQueryServiceImpl implements OrderQueryService {
private void combinedState(Integer asStatus, OrderQueryDTO query, List<Integer> statusList) {
switch (asStatus) {
case 12325:
//this.status = 12;
......@@ -1158,7 +1155,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override
public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) {
query.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(), query);
// caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.deptOrderCount1(query);
log.warn(I18nMessage.getLang().toString());
......
package cn.iocoder.yudao.module.order.vo.order;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
......@@ -524,6 +525,50 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
@ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)")
private List<Integer> abnormalStates;
@ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)")
private List<Long> objectiveIds;
@ApiModelProperty(value = "始发仓IDs")
private List<Long> startWarehouseIds;
@ApiModelProperty(value = "目的仓IDs")
private List<Long> destWarehouseIds;
@ApiModelProperty(value = "目的国ids")
private List<Long> destCountryIds ;
@ApiModelProperty(value = "入仓类型")
private List<Integer> warehouseTypes;
@ApiModelProperty(value = "报关类别:我司全代:1,自单代报:2,混合报关:3")
private List<Integer> customsTypes;
@ApiModelProperty(value = "审核类型(字典 order_approval_type) 0 为正常")
private List<Integer> auditTypeList;
@ApiModelProperty(value = "订单状态详情见字典:order_status")
private List<Integer> statusList;
@ApiModelProperty(value = "订单异常状态(字典 order_abnormal_state)")
private List<Integer> abnormalStateList;
@ApiModelProperty(value = "订单入仓状态(字典 order_warehouse_in_status)")
private List<Integer> inWarehouseStateList;
@ApiModelProperty(value = "订单出货状态(字典 order_shipment_state)")
private List<Integer> shipmentStateList;
@ApiModelProperty(value = "空运可出货状态:0 默认值 1 待出 2 可出 3 备货中 4 已备货 10 可出、备货中、已备货 11 待出、可出、备货中、已备货 12 可出、备货中")
private List<Integer> airShipmentList;
@ApiModelProperty(value = "内部转换状态字段")
private List<Integer> asStatusList;
@ApiModelProperty(value = "是否预警控货订单: 1 是")
private Integer warningOrder;
......@@ -536,11 +581,25 @@ public class OrderQueryVO {
}
}
public void setAsStatusList(List<Integer> asStatusList) {
this.asStatusList = asStatusList;
if (CollectionUtil.isNotEmpty(this.asStatusList)) {
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
}
}
public void setTransportId(Integer transportId) {
this.transportId = transportId;
if (Objects.nonNull(transportId) && Objects.nonNull(this.asStatus)) {
combinedState(this.asStatus, this.transportId);
}
if (Objects.nonNull(transportId) && CollectionUtil.isNotEmpty(this.asStatusList)) {
for (Integer asStatus : asStatusList) {
combinedStateList(asStatus, this.transportId);
}
}
}
private void combinedState(Integer asStatus, Integer transportId) {
......@@ -609,6 +668,139 @@ public class OrderQueryVO {
}
}
private void combinedStateList(Integer asStatus, Integer transportId) {
switch (asStatus) {
case 12325:
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(12);
this.shipmentStateList.add(325);
break;
case 10501:
// 空运待出
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
if (Objects.isNull(this.auditTypeList)){
this.auditTypeList = new ArrayList<>();
}
if (Objects.isNull(this.abnormalStateList)){
this.abnormalStateList = new ArrayList<>();
}
this.statusList.add(5);
this.airShipmentList.add(1);
this.auditTypeList.add(0);
this.abnormalStateList.add(0);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 10502:
// 空运可出
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
this.statusList.add(5);
this.airShipmentList.add(12);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 10503:
// 空运已备货
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
this.statusList.add(5);
this.airShipmentList.add(4);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 10504:
// 待排单
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.airShipmentList)){
this.airShipmentList = new ArrayList<>();
}
if (Objects.isNull(this.auditTypeList)){
this.auditTypeList = new ArrayList<>();
}
if (Objects.isNull(this.abnormalStateList)){
this.abnormalStateList = new ArrayList<>();
}
this.statusList.add(5);
this.auditTypeList.add(0);
this.abnormalStateList.add(0);
if (Objects.nonNull(transportId) && transportId == 3) {
// 空运无需判断备货状态 可出、备货中、已备货
this.airShipmentList.add(10);
}else {
// 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批
this.airShipmentList.add(20);
}
break;
case 132411:
// 空运已出货
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(411);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 132412:
// 空运已出仓
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(412);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 132409:
// 空运已理货
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(409);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
case 118428:
// 空运已到港
if (Objects.isNull(this.statusList)){
this.statusList = new ArrayList<>();
}
if (Objects.isNull(this.shipmentStateList)){
this.shipmentStateList = new ArrayList<>();
}
this.statusList.add(32);
this.shipmentStateList.add(428);
this.transportId = 3; // 空运待出查询,只查空运的订单
break;
}
}
public void setShipmentState(Integer shipmentState) {
if (Objects.nonNull(shipmentState)) {
......
......@@ -347,6 +347,81 @@
<if test="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>0">
<if test="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">
AND o.`warehouse_type` =
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' >
#{warehouseType}
</foreach>
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>1 ">
AND o.`warehouse_type` in
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' open='(' separator=',' close=')'>
#{warehouseType}
</foreach>
</if>
</if>
<if test="query.objectiveId != null and query.objectiveId.size() != 0">
<if test="query.objectiveIds != null and query.objectiveIds.size()==1 ">
AND ob.`objective_id` =
<foreach item='objectiveId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
<if test="query.objectiveIds != null and query.objectiveIds.size()>1 ">
AND ob.`objective_id` in
<foreach item='objectiveId' index='index' collection='query.objectiveIds' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
</if>
<if test="query.destCountryIds != null and query.objectiveIds.size()>0 ">
AND ob.`objective_country_id` in
<foreach item='destCountryId' index='index' collection='query.destCountryIds' open='(' separator=',' close=')'>
#{destCountryId}
</foreach>
</if>
<if test="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
and whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.startWarehouseId !=null and query.startWarehouseIds.size() > 0 and (query.destWarehouseId==null or query.destWarehouseIds.size() == 0) ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
))
</if>
<if test="(query.startWarehouseIds ==null or query.startWarehouseIds.size() == 0) and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
......@@ -539,18 +614,18 @@
<!-- <if test="query.productRecord != null">-->
<!-- AND o.`product_record` = #{query.productRecord}-->
<!-- </if>-->
<if test="query.customsType != null and query.customsType.size()>0">
<if test="query.customsTypes != null and query.customsTypes.size()>0">
<if test="query.customsType != null and query.customsType != '' and query.customsType.size()==1 ">
<if test="query.customsTypes != null and query.customsTypes.size()==1 ">
AND o.`customs_type` =
<foreach item='customsType' index="index" collection='query.customsType' >
<foreach item='customsType' index="index" collection='query.customsTypes' >
#{customsType}
</foreach>
</if>
<if test="query.customsType != null and query.customsType != '' and query.customsType.size()>1 ">
<if test="query.customsTypes != null and query.customsTypes.size()>1 ">
AND o.`customs_type` in
<foreach item='customsType' index="index" collection='query.customsType' open='(' separator=',' close=')'>
<foreach item='customsType' index="index" collection='query.customsTypes' open='(' separator=',' close=')'>
#{customsType}
</foreach>
</if>
......@@ -578,26 +653,84 @@
<if test="query.transportId != null">
AND o.`transport_id` = #{query.transportId}
</if>
<!-- <if test="query.warehouseType != null">-->
<!-- AND o.`warehouse_type` = #{query.warehouseType}-->
<!-- </if>-->
<if test="query.warehouseType != null and query.warehouseType.size()>0">
<if test="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<!-- <if test="query.warehouseTypes != null and query.warehouseTypes.size()>0">-->
<if test="query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()==1 ">
AND o.`warehouse_type` =
<foreach item='warehouseType' index="index" collection='query.warehouseType' >
#{warehouseType}
</foreach>
</if>
<!-- <if test="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">-->
<!-- AND o.`warehouse_type` =-->
<!-- <foreach item='warehouseType' index="index" collection='query.warehouseTypes' >-->
<!-- #{warehouseType}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()>1 ">
AND o.`warehouse_type` in
<foreach item='warehouseType' index="index" collection='query.warehouseType' open='(' separator=',' close=')'>
#{warehouseType}
</foreach>
</if>
<!-- <if test="query.warehouseTypes != null and query.warehouseTypes.size()>1 ">-->
<!-- AND o.`warehouse_type` in-->
<!-- <foreach item='warehouseType' index="index" collection='query.warehouseTypes' open='(' separator=',' close=')'>-->
<!-- #{warehouseType}-->
<!-- </foreach>-->
<!-- </if>-->
</if>
<!-- </if>-->
<!-- <if test="query.objectiveId != null and query.objectiveId.size() != 0">-->
<!-- <if test="query.objectiveIds != null and query.objectiveIds.size()==1 ">-->
<!-- AND ob.`objective_id` =-->
<!-- <foreach item='objectiveId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>-->
<!-- #{objectiveId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="query.objectiveIds != null and query.objectiveIds.size()>1 ">-->
<!-- AND ob.`objective_id` in-->
<!-- <foreach item='objectiveId' index='index' collection='query.objectiveIds' open='(' separator=',' close=')'>-->
<!-- #{objectiveId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- </if>-->
<!-- <if test="query.destCountryIds != null and query.objectiveIds.size()>0 ">-->
<!-- AND ob.`objective_country_id` in-->
<!-- <foreach item='destCountryId' index='index' collection='query.destCountryIds' open='(' separator=',' close=')'>-->
<!-- #{destCountryId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">-->
<!-- and (o.line_id in(-->
<!-- select whl.id-->
<!-- from ecw_warehouse_line whl-->
<!-- where whl.start_warehouse_id in-->
<!-- <foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>-->
<!-- #{warehouseId}-->
<!-- </foreach>-->
<!-- and whl.dest_warehouse_id in-->
<!-- <foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>-->
<!-- #{destWarehouseId}-->
<!-- </foreach>-->
<!-- ))-->
<!-- </if>-->
<!-- <if test="query.startWarehouseId !=null and query.startWarehouseIds.size() > 0 and (query.destWarehouseId==null or query.destWarehouseIds.size() == 0) ">-->
<!-- and (o.line_id in(-->
<!-- select whl.id-->
<!-- from ecw_warehouse_line whl-->
<!-- where whl.start_warehouse_id in-->
<!-- <foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>-->
<!-- #{warehouseId}-->
<!-- </foreach>-->
<!-- ))-->
<!-- </if>-->
<!-- <if test="(query.startWarehouseIds ==null or query.startWarehouseIds.size() == 0) and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">-->
<!-- and (o.line_id in(-->
<!-- select whl.id-->
<!-- from ecw_warehouse_line whl-->
<!-- where whl.dest_warehouse_id in-->
<!-- <foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>-->
<!-- #{destWarehouseId}-->
<!-- </foreach>-->
<!-- ))-->
<!-- </if>-->
<if test="query.packageType != null and query.packageType != '' ">
AND CONCAT(',',o.package_type,',') REGEXP CONCAT(',',REPLACE(#{query.packageType},',',',|,'), ',')
</if>
......@@ -752,53 +885,53 @@
or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})
))
</if>
<if test="query.objectiveId != null and query.objectiveId.size() != 0">
AND ob.`objective_id` in
<foreach item='orderId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>
#{orderId}
</foreach>
<!-- <if test="query.objectiveId != null and query.objectiveId.size() != 0">-->
<!-- AND ob.`objective_id` in-->
<!-- <foreach item='orderId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>-->
<!-- #{orderId}-->
<!-- </foreach>-->
</if>
<if test="query.destCountryId != null ">
AND ob.`objective_country_id` in
<foreach item='destCountryId' index='index' collection='query.destCountryId' open='(' separator=',' close=')'>
#{destCountryId}
</foreach>
</if>
<if test = "query.startWarehouseId != null and query.destWarehouseId != null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='startWarehouseId' index='index' collection='query.startWarehouseId' open='(' separator=',' close=')'>
#{startWarehouseId}
</foreach>
and whl.dest_warehouse_id in
<foreach item='destWarehouseId' index='index' collection='query.destWarehouseId' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test = "query.startWarehouseId != null and query.destWarehouseId == null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='startWarehouseId' index='index' collection='query.startWarehouseId' open='(' separator=',' close=')'>
#{startWarehouseId}
</foreach>
))
</if>
<if test = "query.startWarehouseId == null and query.destWarehouseId != null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id in
<foreach item='destWarehouseId' index='index' collection='query.destWarehouseId' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<!-- </if>-->
<!-- <if test="query.destCountryId != null ">-->
<!-- AND ob.`objective_country_id` in-->
<!-- <foreach item='destCountryId' index='index' collection='query.destCountryId' open='(' separator=',' close=')'>-->
<!-- #{destCountryId}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test = "query.startWarehouseId != null and query.destWarehouseId != null ">-->
<!-- and (o.line_id in(-->
<!-- select whl.id-->
<!-- from ecw_warehouse_line whl-->
<!-- where whl.start_warehouse_id in-->
<!-- <foreach item='startWarehouseId' index='index' collection='query.startWarehouseId' open='(' separator=',' close=')'>-->
<!-- #{startWarehouseId}-->
<!-- </foreach>-->
<!-- and whl.dest_warehouse_id in-->
<!-- <foreach item='destWarehouseId' index='index' collection='query.destWarehouseId' open='(' separator=',' close=')'>-->
<!-- #{destWarehouseId}-->
<!-- </foreach>-->
<!-- ))-->
<!-- </if>-->
<!-- <if test = "query.startWarehouseId != null and query.destWarehouseId == null ">-->
<!-- and (o.line_id in(-->
<!-- select whl.id-->
<!-- from ecw_warehouse_line whl-->
<!-- where whl.start_warehouse_id in-->
<!-- <foreach item='startWarehouseId' index='index' collection='query.startWarehouseId' open='(' separator=',' close=')'>-->
<!-- #{startWarehouseId}-->
<!-- </foreach>-->
<!-- ))-->
<!-- </if>-->
<!-- <if test = "query.startWarehouseId == null and query.destWarehouseId != null ">-->
<!-- and (o.line_id in(-->
<!-- select whl.id-->
<!-- from ecw_warehouse_line whl-->
<!-- where whl.dest_warehouse_id in-->
<!-- <foreach item='destWarehouseId' index='index' collection='query.destWarehouseId' open='(' separator=',' close=')'>-->
<!-- #{destWarehouseId}-->
<!-- </foreach>-->
<!-- ))-->
<!-- </if>-->
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
......@@ -1308,6 +1441,9 @@
</if>
</if>
<if test="query.status != null">
AND o.`status` = #{query.status}
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()==1 ">
......@@ -1325,55 +1461,29 @@
</if>
</if>
<!-- <if test="query.status != null">-->
<!-- AND o.`status` = #{query.status}-->
<!-- </if>-->
<!-- <if test="query.abnormalState != null">-->
<!-- <choose>-->
<!-- <when test="query.abnormalState != 0">-->
<!-- <choose>-->
<!-- <when test="query.abnormalState != -1">-->
<!-- AND o.`abnormal_state` = #{query.abnormalState}-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- AND o.`abnormal_state` != 0-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- AND o.`abnormal_state` = 0-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<if test="query.abnormalState != null and query.abnormalState.size()>0">
<if test="query.abnormalState != null and query.abnormalState != '' and query.abnormalState.size()==1 ">
<foreach item='abnormalState' index="index" collection='query.abnormalState' >
<choose>
<when test="abnormalState != '0'">
<choose>
<when test="abnormalState != '-1'">
AND o.`abnormal_state` = #{abnormalState}
</when>
<otherwise>
AND o.`abnormal_state` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
<if test="query.abnormalStateList != null and query.abnormalStateList.size()>0">
<if test="query.abnormalStateList != null and query.abnormalStateList.size()==1 ">
<foreach item='abnormalState' index="index" collection='query.abnormalStateList' >
<choose>
<when test="abnormalState != '0'">
<choose>
<when test="abnormalState != '-1'">
AND o.`abnormal_state` = #{abnormalState}
</when>
<otherwise>
AND o.`abnormal_state` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
</foreach>
</if>
<if test="query.abnormalState != null and query.abnormalState != '' and query.abnormalState.size()>1 ">
AND (1!=1
<foreach item='abnormalState' index="index" collection='query.abnormalState'>
<if test="query.abnormalStateList != null and query.abnormalStateList.size()>1 ">
AND (1!=1
<foreach item='abnormalState' index="index" collection='query.abnormalStateList'>
<choose>
<when test="abnormalState != '0'">
<choose>
......@@ -1390,40 +1500,70 @@
</otherwise>
</choose>
</foreach>
)
</if>
</if>
<if test="query.abnormalState != null">
<choose>
<when test="query.abnormalState != 0">
<choose>
<when test="query.abnormalState != -1">
AND o.`abnormal_state` = #{query.abnormalState}
</when>
<otherwise>
AND o.`abnormal_state` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
</if>
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>0">
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()==1 ">
AND o.`in_warehouse_state` =
<foreach item='inWarehouseState' index="index" collection='query.inWarehouseStateList' >
#{inWarehouseState}
</foreach>
</if>
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>1 ">
AND o.`in_warehouse_state` in
<foreach item='inWarehouseState' index="index" collection='query.inWarehouseStateList' open='(' separator=',' close=')'>
#{inWarehouseState}
</foreach>
</if>
</if>
<if test="query.inWarehouseState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>0">
<if test="query.shipmentStateList != null and query.shipmentStateList.size()==1 ">
AND o.`shipment_State` =
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' >
#{shipmentState}
</foreach>
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>1 ">
AND o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' open='(' separator=',' close=')'>
#{shipmentState}
</foreach>
</if>
</if>
<if test="query.shipmentState != null">
AND o.`shipment_State` = #{query.shipmentState}
</if>
<!-- <if test="query.auditType != null">-->
<!-- <choose>-->
<!-- <when test="query.auditType != 0">-->
<!-- <choose>-->
<!-- <when test="query.auditType != -1">-->
<!-- AND o.`audit_type` = #{query.auditType}-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- AND o.`audit_type` != 0-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- AND o.`audit_type` = 0-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </if>-->
<if test="query.auditType != null and query.auditType.size()>0">
<if test="query.auditTypeList != null and query.auditTypeList.size()>0">
<if test="query.auditType != null and query.auditType != '' and query.auditType.size()==1 ">
<if test="query.auditTypeList != null and query.auditTypeList.size()==1 ">
<foreach item='auditType' index="index" collection='query.auditType' >
<foreach item='auditType' index="index" collection='query.auditTypeList' >
<choose>
<when test="auditType != 0">
......@@ -1442,9 +1582,47 @@
</choose>
</foreach>
</if>
<if test="query.auditTypeList != null and query.auditTypeList.size()>1 ">
AND (1!=1
<foreach item='auditType' index="index" collection='query.auditTypeList'>
<choose>
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
or o.`audit_type` = #{auditType}
</when>
<otherwise>
or o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
or o.`audit_type` = 0
</otherwise>
</choose>
</foreach>
)
</if>
</if>
<if test="query.salesmanId != null ">
<if test="query.auditType != null">
<choose>
<when test="query.auditType != 0">
<choose>
<when test="query.auditType != -1">
AND o.`audit_type` = #{query.auditType}
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</if>
<if test="query.salesmanId != null ">
AND (o.`salesman_id` = #{query.salesmanId} or
o.`customer_id` in(
select cus.id from ecw_customer cus
......@@ -1496,23 +1674,7 @@
<if test="query.channelId != null">
AND o.`channel_id` = #{query.channelId}
</if>
<if test="query.warehouseType != null and query.warehouseType.size()>0">
<if test="query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()==1 ">
AND o.`warehouse_type` =
<foreach item='warehouseType' index="index" collection='query.warehouseType' >
#{warehouseType}
</foreach>
</if>
<if test="query.warehouseType != null and query.warehouseType != '' and query.warehouseType.size()>1 ">
AND o.`warehouse_type` in
<foreach item='warehouseType' index="index" collection='query.warehouseType' open='(' separator=',' close=')'>
#{warehouseType}
</foreach>
</if>
</if>
<if test="query.number != null and query.number != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi
......@@ -1537,19 +1699,81 @@
<if test="query.departureId != null ">
AND de.`departure_id` = #{query.departureId}
</if>
<if test="query.objectiveId != null and query.objectiveId.size() != 0">
AND ob.`objective_id` in
<foreach item='orderId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>
#{orderId}
</foreach>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>0">
<if test="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">
AND o.`warehouse_type` =
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' >
#{warehouseType}
</foreach>
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>1 ">
AND o.`warehouse_type` in
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' open='(' separator=',' close=')'>
#{warehouseType}
</foreach>
</if>
</if>
<if test="query.destCountryId != null ">
<if test="query.objectiveId != null and query.objectiveId.size() != 0">
<if test="query.objectiveIds != null and query.objectiveIds.size()==1 ">
AND ob.`objective_id` =
<foreach item='objectiveId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
<if test="query.objectiveIds != null and query.objectiveIds.size()>1 ">
AND ob.`objective_id` in
<foreach item='objectiveId' index='index' collection='query.objectiveIds' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
</if>
<if test="query.destCountryIds != null and query.objectiveIds.size()>0 ">
AND ob.`objective_country_id` in
<foreach item='destCountryId' index='index' collection='query.destCountryId' open='(' separator=',' close=')'>
<foreach item='destCountryId' index='index' collection='query.destCountryIds' open='(' separator=',' close=')'>
#{destCountryId}
</foreach>
</if>
<if test="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
and whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.startWarehouseId !=null and query.startWarehouseIds.size() > 0 and (query.destWarehouseId==null or query.destWarehouseIds.size() == 0) ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
))
</if>
<if test="(query.startWarehouseIds ==null or query.startWarehouseIds.size() == 0) and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.consignorId != null ">
AND nor.`customer_id` = #{query.consignorId}
</if>
......@@ -1762,47 +1986,74 @@
or pb.`title_zh` = #{query.notEqProdKey} or pb.`title_en` = #{query.notEqProdKey})
))
</if>
<if test="query.startWarehouseId !=null and query.destWarehouseId !=null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseId' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
and whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseId' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.startWarehouseId !=null and query.destWarehouseId==null">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseId' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
))
</if>
<if test="query.startWarehouseId ==null and query.destWarehouseId !=null ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseId' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 0">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
</if>
<if test="query.airShipmentList.size() > 1">
(1!=1
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
or o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
or o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
or o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
or o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
or o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
or o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
or o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
)
</if>
</if>
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
......@@ -1895,12 +2146,89 @@
</otherwise>
</choose>
</if>
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>0">
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()==1 ">
AND o.`in_warehouse_state` =
<foreach item='inWarehouseState' index="index" collection='query.inWarehouseStateList' >
#{inWarehouseState}
</foreach>
</if>
<if test="query.inWarehouseStateList != null and query.inWarehouseStateList.size()>1 ">
AND o.`in_warehouse_state` in
<foreach item='inWarehouseState' index="index" collection='query.inWarehouseStateList' open='(' separator=',' close=')'>
#{inWarehouseState}
</foreach>
</if>
</if>
<if test="query.inWarehouseState != null">
AND o.`in_warehouse_state` = #{query.inWarehouseState}
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>0">
<if test="query.shipmentStateList != null and query.shipmentStateList.size()==1 ">
AND o.`shipment_State` =
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' >
#{shipmentState}
</foreach>
</if>
<if test="query.shipmentStateList != null and query.shipmentStateList.size()>1 ">
AND o.`shipment_State` in
<foreach item='shipmentState' index="index" collection='query.shipmentStateList' open='(' separator=',' close=')'>
#{shipmentState}
</foreach>
</if>
</if>
<if test="query.shipmentState != null">
AND o.`shipment_State` = #{query.shipmentState}
</if>
<if test="query.auditTypeList != null and query.auditTypeList.size()>0">
<if test="query.auditTypeList != null and query.auditTypeList.size()==1 ">
<foreach item='auditType' index="index" collection='query.auditTypeList' >
<choose>
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
AND o.`audit_type` = #{auditType}
</when>
<otherwise>
AND o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`audit_type` = 0
</otherwise>
</choose>
</foreach>
</if>
<if test="query.auditTypeList != null and query.auditTypeList.size()>1 ">
AND (1!=1
<foreach item='auditType' index="index" collection='query.auditTypeList'>
<choose>
<when test="auditType != 0">
<choose>
<when test="auditType != -1">
or o.`audit_type` = #{auditType}
</when>
<otherwise>
or o.`audit_type` != 0
</otherwise>
</choose>
</when>
<otherwise>
or o.`audit_type` = 0
</otherwise>
</choose>
</foreach>
)
</if>
</if>
<if test="query.auditType != null">
<choose>
<when test="query.auditType != 0">
......@@ -1936,6 +2264,79 @@
<if test="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>0">
<if test="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">
AND o.`warehouse_type` =
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' >
#{warehouseType}
</foreach>
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>1 ">
AND o.`warehouse_type` in
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' open='(' separator=',' close=')'>
#{warehouseType}
</foreach>
</if>
</if>
<if test="query.objectiveId != null and query.objectiveId.size() != 0">
<if test="query.objectiveIds != null and query.objectiveIds.size()==1 ">
AND ob.`objective_id` =
<foreach item='objectiveId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
<if test="query.objectiveIds != null and query.objectiveIds.size()>1 ">
AND ob.`objective_id` in
<foreach item='objectiveId' index='index' collection='query.objectiveIds' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
</if>
<if test="query.destCountryIds != null and query.objectiveIds.size()>0 ">
AND ob.`objective_country_id` in
<foreach item='destCountryId' index='index' collection='query.destCountryIds' open='(' separator=',' close=')'>
#{destCountryId}
</foreach>
</if>
<if test="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
and whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.startWarehouseId !=null and query.startWarehouseIds.size() > 0 and (query.destWarehouseId==null or query.destWarehouseIds.size() == 0) ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
))
</if>
<if test="(query.startWarehouseIds ==null or query.startWarehouseIds.size() == 0) and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.number != null and query.number != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi
......@@ -2202,6 +2603,70 @@
<if test="query.isNeat == false ">
AND o.sum_num <![CDATA[ < ]]> o.cost->>'$.totalNum'
</if>
<if test="query.airShipmentList != null and query.airShipmentList.size() > 0">
<if test="query.airShipmentList.size() == 0">
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
AND o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
AND o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
AND o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
AND o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
AND o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
AND o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
AND o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
</if>
<if test="query.airShipmentList.size() > 1">
(1!=1
<foreach item='airShipment' index="index" collection='query.airShipmentList'>
<choose>
<when test="airShipment == 1">
or o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 2">
or o.`status` = 5 AND o.air_shipment = 2
</when>
<when test="airShipment == 3">
or o.`status` = 5 AND o.air_shipment = 3
</when>
<when test="airShipment == 4">
or o.`status` = 5 AND o.air_shipment = 4
</when>
<when test="airShipment == 10">
or o.`status` = 5 AND o.air_shipment in(2,3,4)
</when>
<when test="airShipment == 11">
or o.`status` = 5 AND o.air_shipment in(1,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 12">
or o.`status` = 5 AND o.air_shipment in(2,3) and abnormal_state = 0 and audit_type = 0
</when>
<when test="airShipment == 20">
or o.`status` = 5 AND o.air_shipment in(0,2,3,4) and abnormal_state = 0 and audit_type = 0
</when>
</choose>
</foreach>
)
</if>
</if>
<if test="query.airShipment != null and query.airShipment == 1">
AND o.`status` = 5 AND o.air_shipment = 1 and abnormal_state = 0 and audit_type = 0
</if>
......@@ -2260,6 +2725,66 @@
<if test="query.status != null">
AND o.`status` = #{query.status}
</if>
<if test="query.statusList != null and query.statusList.size()>0">
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
</foreach>
</if>
</if>
<if test="query.abnormalStateList != null and query.abnormalStateList.size()>0">
<if test="query.abnormalStateList != null and query.abnormalStateList.size()==1 ">
<foreach item='abnormalState' index="index" collection='query.abnormalStateList' >
<choose>
<when test="abnormalState != '0'">
<choose>
<when test="abnormalState != '-1'">
AND o.`abnormal_state` = #{abnormalState}
</when>
<otherwise>
AND o.`abnormal_state` != 0
</otherwise>
</choose>
</when>
<otherwise>
AND o.`abnormal_state` = 0
</otherwise>
</choose>
</foreach>
</if>
<if test="query.abnormalStateList != null and query.abnormalStateList.size()>1 ">
AND (1!=1
<foreach item='abnormalState' index="index" collection='query.abnormalStateList'>
<choose>
<when test="abnormalState != '0'">
<choose>
<when test="abnormalState != '-1'">
OR o.`abnormal_state` = #{abnormalState}
</when>
<otherwise>
OR o.`abnormal_state` != 0
</otherwise>
</choose>
</when>
<otherwise>
OR o.`abnormal_state` = 0
</otherwise>
</choose>
</foreach>
)
</if>
</if>
<if test="query.abnormalState != null">
<choose>
<when test="query.abnormalState != 0">
......@@ -2318,6 +2843,81 @@
<if test="query.warehouseType != null">
AND o.`warehouse_type` = #{query.warehouseType}
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>0">
<if test="query.warehouseTypes != null and query.warehouseTypes.size()==1 ">
AND o.`warehouse_type` =
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' >
#{warehouseType}
</foreach>
</if>
<if test="query.warehouseTypes != null and query.warehouseTypes.size()>1 ">
AND o.`warehouse_type` in
<foreach item='warehouseType' index="index" collection='query.warehouseTypes' open='(' separator=',' close=')'>
#{warehouseType}
</foreach>
</if>
</if>
<if test="query.objectiveId != null and query.objectiveId.size() != 0">
<if test="query.objectiveIds != null and query.objectiveIds.size()==1 ">
AND ob.`objective_id` =
<foreach item='objectiveId' index='index' collection='query.objectiveId' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
<if test="query.objectiveIds != null and query.objectiveIds.size()>1 ">
AND ob.`objective_id` in
<foreach item='objectiveId' index='index' collection='query.objectiveIds' open='(' separator=',' close=')'>
#{objectiveId}
</foreach>
</if>
</if>
<if test="query.destCountryIds != null and query.objectiveIds.size()>0 ">
AND ob.`objective_country_id` in
<foreach item='destCountryId' index='index' collection='query.destCountryIds' open='(' separator=',' close=')'>
#{destCountryId}
</foreach>
</if>
<if test="query.startWarehouseIds !=null and query.startWarehouseIds.size() > 0 and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
and whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.startWarehouseId !=null and query.startWarehouseIds.size() > 0 and (query.destWarehouseId==null or query.destWarehouseIds.size() == 0) ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.start_warehouse_id in
<foreach item='warehouseId' collection='query.startWarehouseIds' open='(' separator=',' close=')'>
#{warehouseId}
</foreach>
))
</if>
<if test="(query.startWarehouseIds ==null or query.startWarehouseIds.size() == 0) and query.destWarehouseIds !=null and query.destWarehouseIds.size() > 0 ">
and (o.line_id in(
select whl.id
from ecw_warehouse_line whl
where whl.dest_warehouse_id in
<foreach item='destWarehouseId' collection='query.destWarehouseIds' open='(' separator=',' close=')'>
#{destWarehouseId}
</foreach>
))
</if>
<if test="query.number != null and query.number != '' ">
AND (o.`number` like concat("%",concat(#{query.number},"%")) or o.order_id in( select distinct oi.order_id
from ecw_order_item oi
......
......@@ -318,7 +318,7 @@ public class OrderController {
@GetMapping("/page")
@ApiOperation("获得订单分页")
// @PreAuthorize("@ss.hasPermission('ecw:order:query')")
public CommonResult<PageResult<OrderBackPageVO>> getOrderPage(OrderQueryDTO query, PageVO page) {
public CommonResult<PageResult<OrderBackPageVO>> getOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
return success(pageResult);
......@@ -336,7 +336,7 @@ public class OrderController {
@GetMapping("/my/page")
@ApiOperation("获得我的订单分页")
public CommonResult<PageResult<OrderBackPageVO>> myOrderPage(OrderQueryDTO query, PageVO page) {
public CommonResult<PageResult<OrderBackPageVO>> myOrderPage(OrderQueryVO query, PageVO page) {
Long salesmanId = SecurityFrameworkUtils.getLoginUserId(); // 获取当前登录用户ID
query.setUserType(UserTypeEnum.ADMIN.getValue());
// query.setSalesmanId(salesmanId);
......@@ -350,11 +350,11 @@ public class OrderController {
@GetMapping("/dept-order-page")
@ApiOperation("部门订单分页")
// @PreAuthorize("@ss.hasPermission('ecw:order:query')")
public CommonResult<PageResult<OrderBackPageVO>> getDeptOrderPage(OrderQueryDTO query, PageVO page) {
public CommonResult<PageResult<OrderBackPageVO>> getDeptOrderPage(OrderQueryVO query, PageVO page) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
query.setUserType(UserTypeEnum.ADMIN.getValue());
query.setDeptId(Objects.isNull(loginUser) ? 0L : loginUser.getDeptId());
PageResult<OrderBackPageVO> pageResult = orderQueryService.deptOrderPage1(query, page);
PageResult<OrderBackPageVO> pageResult = orderQueryService.deptOrderPage(query, page);
return success(pageResult);
}
......
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