Commit 48c7f5ff authored by zhengyi's avatar zhengyi

提供刷新全部到仓订单数据接口

parent f3d601b3
...@@ -50,4 +50,9 @@ public interface OrderWarehouseCheckService extends IService<OrderWarehouseCheck ...@@ -50,4 +50,9 @@ public interface OrderWarehouseCheckService extends IService<OrderWarehouseCheck
* @param updates 更新详情 * @param updates 更新详情
*/ */
void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO); void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO);
/**
* 所有符合条件的订单全部强制到仓
*/
void allForce();
} }
...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService; import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaDO; import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaDO;
import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaPositionDO; import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaPositionDO;
...@@ -13,12 +14,15 @@ import cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseAreaPosit ...@@ -13,12 +14,15 @@ import cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseAreaPosit
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.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseIn.OrderWarehouseInDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseIn.OrderWarehouseInDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.OrderMapper;
import cn.iocoder.yudao.module.order.dal.mysql.orderWarehouseCheck.OrderWarehouseCheckMapper; import cn.iocoder.yudao.module.order.dal.mysql.orderWarehouseCheck.OrderWarehouseCheckMapper;
import cn.iocoder.yudao.module.order.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.order.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.order.service.order.OrderBusinessService; import cn.iocoder.yudao.module.order.service.order.OrderBusinessService;
import cn.iocoder.yudao.module.order.service.order.OrderItemService; import cn.iocoder.yudao.module.order.service.order.OrderItemService;
import cn.iocoder.yudao.module.order.service.order.OrderLocationService; import cn.iocoder.yudao.module.order.service.order.OrderLocationService;
import cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService; import cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService;
import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.order.WarehouseCheckInfoVO; import cn.iocoder.yudao.module.order.vo.order.WarehouseCheckInfoVO;
import cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO; import cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO;
import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemCheckWarehouseVO; import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemCheckWarehouseVO;
...@@ -29,7 +33,9 @@ import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckU ...@@ -29,7 +33,9 @@ import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckU
import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO; import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
...@@ -54,6 +60,9 @@ public class OrderWarehouseCheckServiceImpl ...@@ -54,6 +60,9 @@ public class OrderWarehouseCheckServiceImpl
@Autowired @Autowired
private OrderBusinessService orderBusinessService; private OrderBusinessService orderBusinessService;
@Autowired
private OrderMapper orderMapper;
@Autowired @Autowired
private OrderWarehouseInService orderWarehouseInService; private OrderWarehouseInService orderWarehouseInService;
@Autowired @Autowired
...@@ -167,6 +176,22 @@ public class OrderWarehouseCheckServiceImpl ...@@ -167,6 +176,22 @@ public class OrderWarehouseCheckServiceImpl
check(orderId); check(orderId);
} }
@Override
public void allForce() {
OrderQueryVO queryVO = new OrderQueryVO();
queryVO.setInWarehouseState(218);
long allCount = orderMapper.orderCount(queryVO);
int size = 1000;
int start = 0;
while (start <= allCount) {
List<OrderBackPageVO> list = orderMapper.orderList(start, size, queryVO);
if(CollectionUtil.isNotEmpty(list)) {
list.stream().map(OrderBackPageVO::getOrderId).forEach(this::check);
}
start += size;
}
}
@Override @Override
public void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO) { public void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO) {
Map<Long, OrderWarehouseCheckDO> mappings = listByOrderItemId(checkUpdateReqVO.getOrderItemId()).stream() Map<Long, OrderWarehouseCheckDO> mappings = listByOrderItemId(checkUpdateReqVO.getOrderItemId()).stream()
......
package cn.iocoder.yudao.module.order.controller.admin.orderWarehouseCheck; package cn.iocoder.yudao.module.order.controller.admin.orderWarehouseCheck;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO;
import cn.iocoder.yudao.module.order.service.order.OrderQueryService;
import cn.iocoder.yudao.module.order.service.orderWarehouseCheck.OrderWarehouseCheckService; import cn.iocoder.yudao.module.order.service.orderWarehouseCheck.OrderWarehouseCheckService;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO; import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -25,6 +28,8 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; ...@@ -25,6 +28,8 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
public class OrderWarehouseCheckController { public class OrderWarehouseCheckController {
@Autowired @Autowired
private OrderWarehouseCheckService service; private OrderWarehouseCheckService service;
@Autowired
private OrderQueryService orderQueryService;
@GetMapping("/query") @GetMapping("/query")
@ApiOperation("到仓查询") @ApiOperation("到仓查询")
...@@ -55,4 +60,12 @@ public class OrderWarehouseCheckController { ...@@ -55,4 +60,12 @@ public class OrderWarehouseCheckController {
service.update(req); service.update(req);
return success(true); return success(true);
} }
@PutMapping("/all/force")
@ApiOperation("全部强制到仓(紧刷新数据处理)")
public CommonResult<Boolean> allForce() {
service.allForce();
return success(true);
}
} }
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