Commit ae0dc9cad7e664c29d16587186578584959d02a1

Authored by 曾湘平
1 parent cd6fb2c5

pda查询有货托盘

huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
@@ -46,6 +46,7 @@ import lombok.extern.slf4j.Slf4j; @@ -46,6 +46,7 @@ import lombok.extern.slf4j.Slf4j;
46 @RequestMapping("/config/location") 46 @RequestMapping("/config/location")
47 @Slf4j 47 @Slf4j
48 public class LocationController extends JeecgController<Location, ILocationService> { 48 public class LocationController extends JeecgController<Location, ILocationService> {
  49 +
49 @Autowired 50 @Autowired
50 private ILocationService locationService; 51 private ILocationService locationService;
51 52
@@ -93,6 +94,16 @@ public class LocationController extends JeecgController&lt;Location, ILocationServi @@ -93,6 +94,16 @@ public class LocationController extends JeecgController&lt;Location, ILocationServi
93 return Result.OK(pageList); 94 return Result.OK(pageList);
94 } 95 }
95 96
  97 + @ApiOperation(value = "库位管理-分页查询有货的库位", notes = "分页查询有货的库位")
  98 + @GetMapping(value = "/listSomeContainerInLocation")
  99 + public Result<IPage<Location>> listSomeContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
  100 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
  101 + Page<Location> page = new Page<Location>(pageNo, pageSize);
  102 + HuahengJwtUtil.setWarehouseCode(req, location);
  103 + IPage<Location> pageList = locationService.listSomeContainerInLocation(page, location);
  104 + return Result.OK(pageList);
  105 + }
  106 +
96 /** 107 /**
97 * 添加 108 * 添加
98 * @param location 109 * @param location
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
@@ -55,6 +55,8 @@ public interface ILocationService extends IService&lt;Location&gt; { @@ -55,6 +55,8 @@ public interface ILocationService extends IService&lt;Location&gt; {
55 55
56 IPage<Location> listEmptyContainerInLocation(Page<Location> page, Location location); 56 IPage<Location> listEmptyContainerInLocation(Page<Location> page, Location location);
57 57
  58 + IPage<Location> listSomeContainerInLocation(Page<Location> page, Location location);
  59 +
58 /** 60 /**
59 * 判断系统是否已经有同样的托盘号,如果有证明数据混乱了 61 * 判断系统是否已经有同样的托盘号,如果有证明数据混乱了
60 */ 62 */
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
@@ -396,6 +396,26 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i @@ -396,6 +396,26 @@ public class LocationServiceImpl extends ServiceImpl&lt;LocationMapper, Location&gt; i
396 } 396 }
397 397
398 @Override 398 @Override
  399 + public IPage<Location> listSomeContainerInLocation(Page<Location> page, Location location) {
  400 + List<Location> locationList =
  401 + locationService.getContainerInLocation(null, QuantityConstant.STATUS_CONTAINER_FILL_SOME, null, QuantityConstant.DEFAULT_WAREHOUSE);
  402 + List<String> locationCode =
  403 + locationList.stream().filter(i -> i.getZoneCode().equals(location.getZoneCode())).map(Location::getCode).collect(Collectors.toList());
  404 + // 最多返回2000条数据
  405 + List<List<String>> partition = ListUtils.partition(locationCode, 2000);
  406 + for (List<String> strings : partition) {
  407 + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
  408 + locationLambdaQueryWrapper.eq(Location::getZoneCode, location.getZoneCode()).in(Location::getCode, strings);
  409 + Page<Location> locationPage = locationService.page(page, locationLambdaQueryWrapper);
  410 + if (CollectionUtils.isEmpty(Collections.singleton(locationPage))) {
  411 + return null;
  412 + }
  413 + return locationPage;
  414 + }
  415 + return null;
  416 + }
  417 +
  418 + @Override
399 public boolean havaContainerCodeInLocation(String containerCode, String locationCode, String warehouseCode) { 419 public boolean havaContainerCodeInLocation(String containerCode, String locationCode, String warehouseCode) {
400 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); 420 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
401 locationLambdaQueryWrapper.eq(Location::getContainerCode, containerCode).ne(Location::getCode, locationCode).eq(Location::getWarehouseCode, warehouseCode); 421 locationLambdaQueryWrapper.eq(Location::getContainerCode, containerCode).ne(Location::getCode, locationCode).eq(Location::getWarehouseCode, warehouseCode);