Commit a6ac5a5b96f311a408ebe4f9245f3604e22ecbcc
1 parent
4805ed0a
获取可用库位优化
Signed-off-by: TanYibin <5491541@qq.com>
Showing
6 changed files
with
65 additions
and
102 deletions
ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiEmptyContainer.vue
... | ... | @@ -27,7 +27,7 @@ export default { |
27 | 27 | }, |
28 | 28 | data() { |
29 | 29 | return { |
30 | - url: {list: '/config/location/getEmptyContainerInLocation'}, | |
30 | + url: {list: '/config/location/listEmptyContainerInLocation'}, | |
31 | 31 | columns: [ |
32 | 32 | {title: '容器编码', align: 'center', dataIndex: 'containerCode'}, |
33 | 33 | {title: '库位编码', align: 'center', width: '15%', dataIndex: 'code'}, |
... | ... |
ant-design-vue-jeecg/src/views/system/task/TaskHeaderHistoryList.vue
... | ... | @@ -80,9 +80,9 @@ |
80 | 80 | </a-form> |
81 | 81 | </div> |
82 | 82 | <!-- 查询区域-END --> |
83 | - <j-super-query :fieldList="superFieldList" v-has="'taskHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/> | |
84 | - | |
85 | - | |
83 | + <div class="table-operator"> | |
84 | + <j-super-query :fieldList="superFieldList" v-has="'taskHeader:superQuery'" @handleSuperQuery="handleSuperQuery"/> | |
85 | + </div> | |
86 | 86 | |
87 | 87 | <!-- table区域-begin --> |
88 | 88 | <div> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
... | ... | @@ -84,27 +84,49 @@ public class LocationController extends JeecgController<Location, ILocationServi |
84 | 84 | return Result.OK(pageList); |
85 | 85 | } |
86 | 86 | |
87 | - @ApiOperation(value = "库位管理-分页查询放空托的库位", notes = "分页查询放空托的库位") | |
87 | + @ApiOperation(value = "库位管理-获取有货库位", notes = "库位管理-获取有货库位") | |
88 | + @GetMapping(value = "/listSomeContainerInLocation") | |
89 | + public Result<IPage<Location>> listSomeContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
90 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
91 | + Page<Location> page = new Page<Location>(pageNo, pageSize); | |
92 | + HuahengJwtUtil.setWarehouseCode(req, location); | |
93 | + IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, | |
94 | + QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_FILL_SOME, HuahengJwtUtil.getWarehouseCodeByToken(req), | |
95 | + location.getZoneCode(), location.getContainerCode(), location.getCode(), location.getRoadWay()); | |
96 | + return Result.OK(pageList); | |
97 | + } | |
98 | + | |
99 | + /** | |
100 | + * 选取在库内的空托盘 | |
101 | + * @param location | |
102 | + * @return | |
103 | + */ | |
104 | + @ApiOperation(value = "库位管理-获取空托盘库位", notes = "库位管理-获取空托盘库位") | |
88 | 105 | @GetMapping(value = "/listEmptyContainerInLocation") |
89 | 106 | public Result<IPage<Location>> listEmptyContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
90 | 107 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
91 | 108 | Page<Location> page = new Page<Location>(pageNo, pageSize); |
92 | 109 | HuahengJwtUtil.setWarehouseCode(req, location); |
93 | 110 | IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, |
94 | - QuantityConstant.STATUS_CONTAINER_EMPTY,QuantityConstant.STATUS_CONTAINER_EMPTY,QuantityConstant.DEFAULT_WAREHOUSE, | |
95 | - location.getZoneCode(),location.getContainerCode(),location.getCode(),location.getRoadWay()); | |
111 | + QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_EMPTY, HuahengJwtUtil.getWarehouseCodeByToken(req), | |
112 | + location.getZoneCode(), location.getContainerCode(), location.getCode(), location.getRoadWay()); | |
96 | 113 | return Result.OK(pageList); |
97 | 114 | } |
98 | 115 | |
99 | - @ApiOperation(value = "库位管理-分页查询有货的库位", notes = "分页查询有货的库位") | |
100 | - @GetMapping(value = "/listSomeContainerInLocation") | |
101 | - public Result<IPage<Location>> listSomeContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
116 | + /** | |
117 | + * 选取在库内的空托盘组 | |
118 | + * @param location | |
119 | + * @return | |
120 | + */ | |
121 | + @ApiOperation(value = "库位管理-获取空托盘组库位", notes = "库位管理-获取空托盘组库位") | |
122 | + @GetMapping(value = "/getManyContainerInLocation") | |
123 | + public Result<IPage<Location>> getManyContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
102 | 124 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
103 | 125 | Page<Location> page = new Page<Location>(pageNo, pageSize); |
104 | 126 | HuahengJwtUtil.setWarehouseCode(req, location); |
105 | 127 | IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, |
106 | - QuantityConstant.STATUS_CONTAINER_EMPTY,QuantityConstant.STATUS_CONTAINER_FILL_SOME,QuantityConstant.DEFAULT_WAREHOUSE, | |
107 | - location.getZoneCode(),location.getContainerCode(),location.getCode(),location.getRoadWay()); | |
128 | + QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_FILL_MANY, HuahengJwtUtil.getWarehouseCodeByToken(req), | |
129 | + location.getZoneCode(), location.getContainerCode(), location.getCode(), location.getRoadWay()); | |
108 | 130 | return Result.OK(pageList); |
109 | 131 | } |
110 | 132 | |
... | ... | @@ -252,42 +274,6 @@ public class LocationController extends JeecgController<Location, ILocationServi |
252 | 274 | } |
253 | 275 | |
254 | 276 | /** |
255 | - * 选取在库内的空托盘 | |
256 | - * @param location | |
257 | - * @return | |
258 | - */ | |
259 | - @AutoLog(value = "选取在库内的空托盘") | |
260 | - @ApiOperation(value = "库位管理-选取在库内的空托盘", notes = "库位管理-选取在库内的空托盘") | |
261 | - @GetMapping(value = "/getEmptyContainerInLocation") | |
262 | - public Result<IPage<Location>> getEmptyContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
263 | - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
264 | - Page<Location> page = new Page<Location>(pageNo, pageSize); | |
265 | - HuahengJwtUtil.setWarehouseCode(req, location); | |
266 | - IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, | |
267 | - QuantityConstant.STATUS_CONTAINER_EMPTY,QuantityConstant.STATUS_CONTAINER_EMPTY,QuantityConstant.DEFAULT_WAREHOUSE, | |
268 | - location.getZoneCode(),location.getContainerCode(),location.getCode(),location.getRoadWay()); | |
269 | - return Result.OK(pageList); | |
270 | - } | |
271 | - | |
272 | - /** | |
273 | - * 选取在库内的空托盘组 | |
274 | - * @param location | |
275 | - * @return | |
276 | - */ | |
277 | - @AutoLog(value = "选取在库内的空托盘组") | |
278 | - @ApiOperation(value = "库位管理-选取在库内的空托盘组", notes = "库位管理-选取在库内的空托盘组") | |
279 | - @GetMapping(value = "/getManyContainerInLocation") | |
280 | - public Result<IPage<Location>> getManyContainerInLocation(Location location, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | |
281 | - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { | |
282 | - Page<Location> page = new Page<Location>(pageNo, pageSize); | |
283 | - HuahengJwtUtil.setWarehouseCode(req, location); | |
284 | - IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, | |
285 | - QuantityConstant.STATUS_CONTAINER_EMPTY,QuantityConstant.STATUS_CONTAINER_FILL_MANY,QuantityConstant.DEFAULT_WAREHOUSE, | |
286 | - location.getZoneCode(),location.getContainerCode(),location.getCode(),location.getRoadWay()); | |
287 | - return Result.OK(pageList); | |
288 | - } | |
289 | - | |
290 | - /** | |
291 | 277 | * WCS库位信息比较 |
292 | 278 | * @param location |
293 | 279 | * @return |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/mapper/xml/LocationMapper.xml
... | ... | @@ -16,35 +16,40 @@ |
16 | 16 | </select> |
17 | 17 | |
18 | 18 | <select id="getContainerInLocation" parameterType="Map" resultType="org.jeecg.modules.wms.config.location.entity.Location"> |
19 | - SELECT * | |
20 | - FROM location t | |
21 | - <where> | |
22 | - t.warehouse_code = #{map.warehouseCode} | |
23 | - AND t.container_code != '' | |
24 | - AND t.container_code is not NULL | |
25 | - AND t.code IN (SELECT cc.location_code FROM container cc WHERE 1 = 1 | |
26 | - <if test="map.containerCodeStatus != null and map.containerCodeStatus !=''"> | |
27 | - AND cc.status = #{map.containerCodeStatus} | |
28 | - </if> | |
29 | - <if test="map.containerCodeFillStatus != null and map.containerCodeFillStatus !=''"> | |
30 | - AND cc.fill_status = #{map.containerCodeFillStatus} | |
31 | - </if> | |
32 | - AND cc.warehouse_code = #{map.warehouseCode}) | |
33 | - <if test="map.locationStatus != null and map.locationStatus !=''"> | |
34 | - and t.status = #{map.locationStatus} | |
19 | + SELECT * | |
20 | + FROM location t | |
21 | + WHERE t.warehouse_code = #{map.warehouseCode} | |
22 | + AND t.container_code != '' | |
23 | + AND t.container_code is not NULL | |
24 | + AND t.code IN (SELECT cc.location_code FROM container cc WHERE 1 = 1 | |
25 | + <if test="map.containerStatus != null and map.containerStatus !=''"> | |
26 | + AND cc.status = #{map.containerStatus} | |
35 | 27 | </if> |
36 | - <if test="map.zoneCode != null and map.zoneCode !=''"> | |
37 | - and t.zone_code = #{map.zoneCode} | |
28 | + <if test="map.containerFillStatus != null and map.containerFillStatus !=''"> | |
29 | + AND cc.fill_status = #{map.containerFillStatus} | |
38 | 30 | </if> |
39 | 31 | <if test="map.containerCode != null and map.containerCode !=''"> |
40 | - and t.container_code = #{map.containerCode} | |
32 | + AND cc.code = #{map.containerCode} | |
41 | 33 | </if> |
42 | 34 | <if test="map.locationCode != null and map.locationCode !=''"> |
43 | - and t.code = #{map.locationCode} | |
44 | - </if> | |
45 | - <if test="map.roadWay != null and map.roadWay !=''"> | |
46 | - and t.road_way = #{map.roadWay} | |
35 | + AND t.location_code = #{map.locationCode} | |
47 | 36 | </if> |
37 | + AND cc.warehouse_code = #{map.warehouseCode}) | |
38 | + <if test="map.locationStatus != null and map.locationStatus !=''"> | |
39 | + AND t.status = #{map.locationStatus} | |
40 | + </if> | |
41 | + <if test="map.zoneCode != null and map.zoneCode !=''"> | |
42 | + AND t.zone_code = #{map.zoneCode} | |
43 | + </if> | |
44 | + <if test="map.containerCode != null and map.containerCode !=''"> | |
45 | + AND t.container_code = #{map.containerCode} | |
46 | + </if> | |
47 | + <if test="map.locationCode != null and map.locationCode !=''"> | |
48 | + AND t.code = #{map.locationCode} | |
49 | + </if> | |
50 | + <if test="map.roadWay != null and map.roadWay !=''"> | |
51 | + AND t.road_way = #{map.roadWay} | |
52 | + </if> | |
48 | 53 | </where> |
49 | 54 | </select> |
50 | 55 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
... | ... | @@ -60,9 +60,6 @@ public interface ILocationService extends IService<Location> { |
60 | 60 | * 判断系统是否已经有同样的托盘号,如果有证明数据混乱了 |
61 | 61 | */ |
62 | 62 | boolean havaContainerCodeInLocation(String containerCode, String locationCode, String warehouseCode); |
63 | - | |
64 | - List<Location> getContainerInLocation(String containerCode, String containerFillStatus, String locationCode, String warehouseCode); | |
65 | - | |
66 | 63 | PageUtil<CompareLocationDto> compareWcsLocation(QueryCompareLocationDto queryCompareLocationDto); |
67 | 64 | |
68 | 65 | PageUtil<CompareLocationTaskDto> compareWcsLocationTask(QueryCompareLocationTaskDto queryCompareLocationTaskDto); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -396,12 +396,12 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
396 | 396 | } |
397 | 397 | |
398 | 398 | @Override |
399 | - public IPage<Location> getContainerInLocation(Page<Location> page, String locationStatus, String containerCodeStatus, String containerCodeFillStatus, | |
399 | + public IPage<Location> getContainerInLocation(Page<Location> page, String locationStatus, String containerStatus, String containerFillStatus, | |
400 | 400 | String warehouseCode, String zoneCode, String containerCode, String locationCode, Integer roadWay) { |
401 | 401 | Map<Object, Object> map = new HashMap<>(); |
402 | 402 | map.put("locationStatus", locationStatus); |
403 | - map.put("containerCodeStatus", containerCodeStatus); | |
404 | - map.put("containerCodeFillStatus", containerCodeFillStatus); | |
403 | + map.put("containerStatus", containerStatus); | |
404 | + map.put("containerFillStatus", containerFillStatus); | |
405 | 405 | map.put("warehouseCode", warehouseCode); |
406 | 406 | map.put("zoneCode", zoneCode); |
407 | 407 | map.put("containerCode", containerCode); |
... | ... | @@ -421,31 +421,6 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
421 | 421 | return true; |
422 | 422 | } |
423 | 423 | |
424 | - @Override | |
425 | - public List<Location> getContainerInLocation(String containerCode, String containerFillStatus, String locationCode, String warehouseCode) { | |
426 | - LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
427 | - locationLambdaQueryWrapper.eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY).ne(Location::getContainerCode, QuantityConstant.EMPTY_STRING) | |
428 | - .eq(StringUtils.isNotEmpty(containerCode), Location::getContainerCode, containerCode) | |
429 | - .eq(StringUtils.isNotEmpty(locationCode), Location::getCode, locationCode).eq(Location::getWarehouseCode, warehouseCode); | |
430 | - List<Location> locationList = list(locationLambdaQueryWrapper); | |
431 | - List<Location> removeLocationList = new ArrayList<>(); | |
432 | - if (locationList.size() != 0) { | |
433 | - List<String> containerCodeList = locationList.stream().map(Location::getContainerCode).collect(Collectors.toList()); | |
434 | - List<Container> containerList = containerService.getContainerListByCodeList(containerCodeList, warehouseCode); | |
435 | - for (Location location : locationList) { | |
436 | - for (Container container : containerList) { | |
437 | - if (location.getContainerCode().equals(container.getCode())) { | |
438 | - if (!container.getFillStatus().equals(containerFillStatus)) { | |
439 | - removeLocationList.add(location); | |
440 | - } | |
441 | - } | |
442 | - } | |
443 | - } | |
444 | - } | |
445 | - locationList.removeAll(removeLocationList); | |
446 | - return locationList; | |
447 | - } | |
448 | - | |
449 | 424 | private boolean getOutSideCanMove(Location location) { |
450 | 425 | Location locaiton2 = getInsideNear(location); |
451 | 426 | if (locaiton2.getStatus().equals(QuantityConstant.STATUS_LOCATION_LOCK)) { |
... | ... |