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

订单查询参数重构

parent c323c4d1
...@@ -646,12 +646,12 @@ public interface OrderMapper extends AbstractMapper<OrderDO> { ...@@ -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> 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 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); List<OrderExcelVO> exportOrderExcelList(@Param("start")int start, @Param("size") int size,@Param("query") OrderQueryVO query);
......
...@@ -61,7 +61,7 @@ public class ContainerNumberOrderExcelExportListener { ...@@ -61,7 +61,7 @@ public class ContainerNumberOrderExcelExportListener {
PageVO page = new PageVO(); PageVO page = new PageVO();
page.setRows(10000); page.setRows(10000);
page.setPage(1); page.setPage(1);
OrderQueryDTO query = JSONObject.parseObject(event.getRequestParams(), OrderQueryDTO.class); OrderQueryVO query = JSONObject.parseObject(event.getRequestParams(), OrderQueryVO.class);
query.setLang(event.getLang()); query.setLang(event.getLang());
PageResult<OrderBackPageVO> orderPage = orderQueryService.myOrderPage(query, page); PageResult<OrderBackPageVO> orderPage = orderQueryService.myOrderPage(query, page);
if (CollectionUtil.isNotEmpty(orderPage.getList())) { if (CollectionUtil.isNotEmpty(orderPage.getList())) {
......
...@@ -154,7 +154,7 @@ public interface OrderQueryService { ...@@ -154,7 +154,7 @@ public interface OrderQueryService {
PageResult<OrderBackPageVO> orderPage(OrderQueryVO query, PageVO page); 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); long orderCount(OrderQueryVO query);
......
...@@ -966,18 +966,17 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -966,18 +966,17 @@ public class OrderQueryServiceImpl implements OrderQueryService {
} }
@Override @Override
public PageResult<OrderBackPageVO> myOrderPage(OrderQueryDTO query, PageVO page) { public PageResult<OrderBackPageVO> myOrderPage(OrderQueryVO query, PageVO page) {
if (Objects.isNull(query.getLang())) { if (Objects.isNull(query.getLang())) {
query.setLang(I18nMessage.getLang()); query.setLang(I18nMessage.getLang());
} }
caseStatus(query.getStatus(), query); // caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page); IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.myOrderCount(query);
log.warn(I18nMessage.getLang().toString()); log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows(); int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows(); int size = page.getRows();
List<OrderBackPageVO> list = orderMapper.myOrderPageList(start, size, query); 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()); return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
} }
...@@ -1005,8 +1004,6 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1005,8 +1004,6 @@ public class OrderQueryServiceImpl implements OrderQueryService {
private void combinedState(Integer asStatus, OrderQueryDTO query, List<Integer> statusList) { private void combinedState(Integer asStatus, OrderQueryDTO query, List<Integer> statusList) {
switch (asStatus) { switch (asStatus) {
case 12325: case 12325:
//this.status = 12; //this.status = 12;
...@@ -1158,7 +1155,7 @@ public class OrderQueryServiceImpl implements OrderQueryService { ...@@ -1158,7 +1155,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override @Override
public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) { public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) {
query.setLang(I18nMessage.getLang()); query.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(), query); // caseStatus(query.getStatus(), query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page); IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.deptOrderCount1(query); long total = orderMapper.deptOrderCount1(query);
log.warn(I18nMessage.getLang().toString()); log.warn(I18nMessage.getLang().toString());
......
package cn.iocoder.yudao.module.order.vo.order; package cn.iocoder.yudao.module.order.vo.order;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*; import lombok.*;
...@@ -524,6 +525,50 @@ public class OrderQueryVO { ...@@ -524,6 +525,50 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否在公海") @ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea; 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 是") @ApiModelProperty(value = "是否预警控货订单: 1 是")
private Integer warningOrder; private Integer warningOrder;
...@@ -536,11 +581,25 @@ public class OrderQueryVO { ...@@ -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) { public void setTransportId(Integer transportId) {
this.transportId = transportId; this.transportId = transportId;
if (Objects.nonNull(transportId) && Objects.nonNull(this.asStatus)) { if (Objects.nonNull(transportId) && Objects.nonNull(this.asStatus)) {
combinedState(this.asStatus, this.transportId); 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) { private void combinedState(Integer asStatus, Integer transportId) {
...@@ -609,6 +668,139 @@ public class OrderQueryVO { ...@@ -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) { public void setShipmentState(Integer shipmentState) {
if (Objects.nonNull(shipmentState)) { if (Objects.nonNull(shipmentState)) {
......
...@@ -318,7 +318,7 @@ public class OrderController { ...@@ -318,7 +318,7 @@ public class OrderController {
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得订单分页") @ApiOperation("获得订单分页")
// @PreAuthorize("@ss.hasPermission('ecw:order:query')") // @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()); query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page); PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
return success(pageResult); return success(pageResult);
...@@ -336,7 +336,7 @@ public class OrderController { ...@@ -336,7 +336,7 @@ public class OrderController {
@GetMapping("/my/page") @GetMapping("/my/page")
@ApiOperation("获得我的订单分页") @ApiOperation("获得我的订单分页")
public CommonResult<PageResult<OrderBackPageVO>> myOrderPage(OrderQueryDTO query, PageVO page) { public CommonResult<PageResult<OrderBackPageVO>> myOrderPage(OrderQueryVO query, PageVO page) {
Long salesmanId = SecurityFrameworkUtils.getLoginUserId(); // 获取当前登录用户ID Long salesmanId = SecurityFrameworkUtils.getLoginUserId(); // 获取当前登录用户ID
query.setUserType(UserTypeEnum.ADMIN.getValue()); query.setUserType(UserTypeEnum.ADMIN.getValue());
// query.setSalesmanId(salesmanId); // query.setSalesmanId(salesmanId);
...@@ -350,11 +350,11 @@ public class OrderController { ...@@ -350,11 +350,11 @@ public class OrderController {
@GetMapping("/dept-order-page") @GetMapping("/dept-order-page")
@ApiOperation("部门订单分页") @ApiOperation("部门订单分页")
// @PreAuthorize("@ss.hasPermission('ecw:order:query')") // @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(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
query.setUserType(UserTypeEnum.ADMIN.getValue()); query.setUserType(UserTypeEnum.ADMIN.getValue());
query.setDeptId(Objects.isNull(loginUser) ? 0L : loginUser.getDeptId()); 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); 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