Commit cdf954ed5b49d66c80be963b6de0f353c3239023
1 parent
0e71c0b9
库位监控问题及性能优化
Signed-off-by: TanYibin <5491541@qq.com>
Showing
5 changed files
with
97 additions
and
63 deletions
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocation.vue
... | ... | @@ -5,15 +5,29 @@ |
5 | 5 | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
6 | 6 | <a-row :gutter="24"> |
7 | 7 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
8 | + <a-form-item label="库区"> | |
9 | + <a-select | |
10 | + show-search | |
11 | + placeholder="请选择库区" | |
12 | + option-filter-prop="children" | |
13 | + v-model="queryParam.zoneCode" | |
14 | + > | |
15 | + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code"> | |
16 | + {{ item.name }} | |
17 | + </a-select-option> | |
18 | + </a-select> | |
19 | + </a-form-item> | |
20 | + </a-col> | |
21 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
8 | 22 | <a-form-item label="库位编码"> |
9 | 23 | <a-input placeholder="请输入库位编码" v-model="queryParam.locationCode"></a-input> |
10 | 24 | </a-form-item> |
11 | 25 | </a-col> |
12 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
26 | + <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
13 | 27 | <a-form-item label="库位表容器编码"> |
14 | 28 | <a-input placeholder="请输入库位表容器编码" v-model="queryParam.containerCode"></a-input> |
15 | 29 | </a-form-item> |
16 | - </a-col> | |
30 | + </a-col> --> | |
17 | 31 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
18 | 32 | <a-form-item label="数据状态"> |
19 | 33 | <j-dict-select-tag |
... | ... | @@ -90,7 +104,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
90 | 104 | import { getAction } from '@/api/manage' |
91 | 105 | import CompareWcsLocationTask from './CompareWcsLocationTask' |
92 | 106 | import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
93 | -import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' | |
107 | +import { getZoneList, ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' | |
94 | 108 | |
95 | 109 | export default { |
96 | 110 | name: 'CompareWcsLocation', |
... | ... | @@ -106,6 +120,7 @@ export default { |
106 | 120 | containerStatusList: [], |
107 | 121 | wcsLocationStatusList: [], |
108 | 122 | consistencyStatusList: [], |
123 | + zoneList:[], | |
109 | 124 | // 表头 |
110 | 125 | columns: [ |
111 | 126 | { |
... | ... | @@ -182,6 +197,7 @@ export default { |
182 | 197 | } |
183 | 198 | }, |
184 | 199 | created() { |
200 | + this.loadFrom() | |
185 | 201 | this.initDictData() |
186 | 202 | }, |
187 | 203 | methods: { |
... | ... | @@ -280,6 +296,13 @@ export default { |
280 | 296 | return color |
281 | 297 | }, |
282 | 298 | initDictConfig() {}, |
299 | + loadFrom() { | |
300 | + getZoneList().then(res => { | |
301 | + if (res.success) { | |
302 | + this.zoneList = res.result | |
303 | + } | |
304 | + }) | |
305 | + }, | |
283 | 306 | clickThenSelect(record) { |
284 | 307 | return { |
285 | 308 | on: { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/address/service/impl/AddressServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.config.address.service.impl; |
2 | 2 | |
3 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
4 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
5 | -import org.apache.commons.math3.analysis.function.Add; | |
6 | 3 | import org.jeecg.modules.wms.config.address.entity.Address; |
7 | 4 | import org.jeecg.modules.wms.config.address.mapper.AddressMapper; |
8 | 5 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
9 | 6 | import org.springframework.cache.annotation.Cacheable; |
10 | 7 | import org.springframework.stereotype.Service; |
11 | 8 | |
9 | +import com.aliyuncs.utils.StringUtils; | |
10 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
11 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
12 | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | 13 | |
14 | 14 | /** |
... | ... | @@ -21,30 +21,28 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
21 | 21 | public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService { |
22 | 22 | |
23 | 23 | @Override |
24 | - @Cacheable(cacheNames = "getAddressByUrl#300", key = "#root.methodName") | |
24 | + @Cacheable(cacheNames = "getAddressByUrl#1", key = "#root.methodName + '_' + #url", unless = "#result == null ") | |
25 | 25 | public Address getAddressByUrl(String url) { |
26 | 26 | LambdaQueryWrapper<Address> addressLambdaQueryWrapper = Wrappers.lambdaQuery(); |
27 | - addressLambdaQueryWrapper.eq(Address::getUrl, url).last(" limit 1"); | |
28 | - Address address = getOne(addressLambdaQueryWrapper); | |
29 | - return address; | |
27 | + addressLambdaQueryWrapper.eq(Address::getUrl, url); | |
28 | + return getOne(addressLambdaQueryWrapper); | |
30 | 29 | } |
31 | 30 | |
32 | 31 | @Override |
33 | - @Cacheable(cacheNames = "getUrlByParam#300", key = "#root.methodName + '_' + #param + '_' + #warehouseCode + '_' + #zoneCode") | |
32 | + @Cacheable(cacheNames = "getUrlByParam#1", key = "#root.methodName + '_' + #param + '_' + #warehouseCode + '_' + #zoneCode", unless = "#result == null ") | |
34 | 33 | public String getUrlByParam(String param, String warehouseCode, String zoneCode) { |
35 | 34 | LambdaQueryWrapper<Address> addressLambdaQueryWrapper = Wrappers.lambdaQuery(); |
36 | - addressLambdaQueryWrapper.eq(Address::getParam, param).eq(Address::getWarehouseCode, warehouseCode).eq(Address::getZoneCode, zoneCode); | |
35 | + addressLambdaQueryWrapper.eq(Address::getParam, param).eq(!StringUtils.isEmpty(warehouseCode), Address::getWarehouseCode, warehouseCode) | |
36 | + .eq(!StringUtils.isEmpty(zoneCode), Address::getZoneCode, zoneCode); | |
37 | 37 | Address address = getOne(addressLambdaQueryWrapper); |
38 | 38 | if (address == null) { |
39 | 39 | return null; |
40 | 40 | } |
41 | - String url = address.getUrl(); | |
42 | - return url; | |
41 | + return address.getUrl(); | |
43 | 42 | } |
44 | 43 | |
45 | - /** #300 缓存300秒 */ | |
46 | 44 | @Override |
47 | - @Cacheable(cacheNames = "getUrlByParam#300", key = "#root.methodName + '_' + #param") | |
45 | + @Cacheable(cacheNames = "getUrlByParam#1", key = "#root.methodName + '_' + #param", unless = "#result == null ") | |
48 | 46 | public String getUrlByParam(String param) { |
49 | 47 | LambdaQueryWrapper<Address> addressLambdaQueryWrapper = Wrappers.lambdaQuery(); |
50 | 48 | addressLambdaQueryWrapper.eq(Address::getParam, param); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/CompareLocationDto.java
... | ... | @@ -17,28 +17,28 @@ public class CompareLocationDto { |
17 | 17 | private String locationCode; |
18 | 18 | |
19 | 19 | /** 库位表容器编码 */ |
20 | - private String locationContainerCode; | |
20 | + private String locationContainerCode = ""; | |
21 | 21 | |
22 | 22 | /** 库位表状态 */ |
23 | - private String locationStatus; | |
23 | + private String locationStatus = ""; | |
24 | 24 | |
25 | 25 | /** 托盘表容器编码 */ |
26 | - private String containerContainerCode; | |
26 | + private String containerContainerCode = ""; | |
27 | 27 | |
28 | 28 | /** 托盘表状态 */ |
29 | - private String containerStatus; | |
29 | + private String containerStatus = ""; | |
30 | 30 | |
31 | 31 | /** 库存表容器编码 */ |
32 | - private String inventoryContainerCode; | |
32 | + private String inventoryContainerCode = ""; | |
33 | 33 | |
34 | 34 | /** 库存表状态 */ |
35 | - private String inventoryStatus; | |
35 | + private String inventoryStatus = ""; | |
36 | 36 | |
37 | 37 | /** WCS库位容器编码 */ |
38 | - private String wcsContainerCode; | |
38 | + private String wcsContainerCode = ""; | |
39 | 39 | |
40 | 40 | /** WCS库位表状态 */ |
41 | - private String wcsLocationStatus; | |
41 | + private String wcsLocationStatus = ""; | |
42 | 42 | |
43 | 43 | /** 数据状态 */ |
44 | 44 | private Integer consistencyStatus = 1; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/QueryCompareLocationDto.java
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -4,6 +4,7 @@ import java.text.MessageFormat; |
4 | 4 | import java.util.ArrayList; |
5 | 5 | import java.util.Collections; |
6 | 6 | import java.util.Comparator; |
7 | +import java.util.Date; | |
7 | 8 | import java.util.HashMap; |
8 | 9 | import java.util.HashSet; |
9 | 10 | import java.util.List; |
... | ... | @@ -14,6 +15,7 @@ import java.util.stream.Collectors; |
14 | 15 | |
15 | 16 | import javax.annotation.Resource; |
16 | 17 | |
18 | +import org.apache.commons.collections4.ListUtils; | |
17 | 19 | import org.apache.shiro.util.CollectionUtils; |
18 | 20 | import org.jeecg.common.api.vo.Result; |
19 | 21 | import org.jeecg.common.exception.JeecgBootException; |
... | ... | @@ -446,47 +448,53 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
446 | 448 | |
447 | 449 | @Override |
448 | 450 | public PageUtil<CompareLocationDto> compareWcsLocation(QueryCompareLocationDto queryCompareLocationDto) { |
451 | + List<CompareLocationDto> compareLocationDtoList = new ArrayList<CompareLocationDto>(); | |
452 | + if (StringUtils.isEmpty(queryCompareLocationDto.getZoneCode())) { | |
453 | + return PageUtil.create(compareLocationDtoList, queryCompareLocationDto.getPageNo(), queryCompareLocationDto.getPageSize()); | |
454 | + } | |
449 | 455 | // 初始化数据 |
450 | - Set<String> locationCodes = new HashSet<String>(); | |
456 | + List<String> locationCodes = new ArrayList<String>(); | |
451 | 457 | Map<String, Location> locationMap = new HashMap<String, Location>(); |
452 | 458 | Map<String, List<Container>> containerMap = new HashMap<String, List<Container>>(); |
453 | 459 | Map<String, List<InventoryDetail>> inventoryDetailMap = new HashMap<String, List<InventoryDetail>>(); |
454 | 460 | Map<String, List<WcsLocationDto>> wcsLocationMap = new HashMap<String, List<WcsLocationDto>>(); |
455 | - | |
456 | 461 | // 1.获取WMS库位表库位信息 |
457 | 462 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
458 | 463 | locationLambdaQueryWrapper.select(Location::getWarehouseCode, Location::getCode, Location::getContainerCode, Location::getStatus) |
459 | 464 | .eq(Location::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) |
465 | + .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getZoneCode()), Location::getZoneCode, queryCompareLocationDto.getZoneCode()) | |
460 | 466 | .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), Location::getCode, queryCompareLocationDto.getLocationCode()) |
461 | 467 | .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode()), Location::getContainerCode, queryCompareLocationDto.getContainerCode()); |
462 | 468 | List<Location> locationList = list(locationLambdaQueryWrapper); |
463 | 469 | if (!CollectionUtils.isEmpty(locationList)) { |
464 | 470 | locationMap.putAll(locationList.stream().collect(Collectors.toMap(Location::getCode, Function.identity(), (key1, key2) -> key2))); |
465 | - locationCodes.addAll(locationList.stream().map(t -> t.getCode()).collect(Collectors.toSet())); | |
471 | + locationCodes.addAll(locationList.stream().map(t -> t.getCode()).distinct().collect(Collectors.toSet())); | |
466 | 472 | } |
467 | - | |
468 | 473 | if (!CollectionUtils.isEmpty(locationCodes)) { |
469 | - // 2.获取WMS托盘表库位信息 | |
470 | - LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
471 | - containerLambdaQueryWrapper.select(Container::getWarehouseCode, Container::getLocationCode, Container::getCode, Container::getStatus) | |
472 | - .eq(Container::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(Container::getLocationCode, locationCodes); | |
473 | - List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | |
474 | - if (!CollectionUtils.isEmpty(containerList)) { | |
475 | - containerMap.putAll(containerList.stream().collect(Collectors.groupingBy(Container::getLocationCode))); | |
476 | - } | |
477 | - | |
478 | - // 3.获取WMS库存表库位信息 | |
479 | - LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
480 | - inventoryDetailLambdaQueryWrapper | |
481 | - .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, InventoryDetail::getInventoryStatus) | |
482 | - .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(InventoryDetail::getLocationCode, locationCodes); | |
483 | - List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | |
484 | - if (!CollectionUtils.isEmpty(inventoryDetailList)) { | |
485 | - inventoryDetailMap.putAll(inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getLocationCode))); | |
474 | + List<List<String>> partitionList = ListUtils.partition(locationCodes, 200); | |
475 | + for (List<String> list : partitionList) { | |
476 | + // 2.获取WMS托盘表库位信息 | |
477 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
478 | + containerLambdaQueryWrapper.select(Container::getWarehouseCode, Container::getLocationCode, Container::getCode, Container::getStatus) | |
479 | + .eq(Container::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(Container::getLocationCode, list); | |
480 | + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | |
481 | + if (!CollectionUtils.isEmpty(containerList)) { | |
482 | + containerMap.putAll(containerList.stream().collect(Collectors.groupingBy(Container::getLocationCode))); | |
483 | + } | |
484 | + // 3.获取WMS库存表库位信息 | |
485 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
486 | + inventoryDetailLambdaQueryWrapper | |
487 | + .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, | |
488 | + InventoryDetail::getInventoryStatus) | |
489 | + .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(InventoryDetail::getLocationCode, list); | |
490 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | |
491 | + if (!CollectionUtils.isEmpty(inventoryDetailList)) { | |
492 | + inventoryDetailMap.putAll(inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getLocationCode))); | |
493 | + } | |
486 | 494 | } |
487 | - | |
488 | 495 | // 4.获取WCS库位信息 |
489 | - String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_LOCATION_INFO); | |
496 | + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_LOCATION_INFO, queryCompareLocationDto.getWarehouseCode(), | |
497 | + queryCompareLocationDto.getZoneCode()); | |
490 | 498 | Map<String, Object> queryParamMap = new HashMap<String, Object>(); |
491 | 499 | if (StringUtils.isNotEmpty(queryCompareLocationDto.getWarehouseCode())) { |
492 | 500 | queryParamMap.put("warehouseCode", queryCompareLocationDto.getWarehouseCode()); |
... | ... | @@ -504,9 +512,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
504 | 512 | } |
505 | 513 | } |
506 | 514 | } |
507 | - | |
508 | 515 | // 对返回数据进行组装 |
509 | - List<CompareLocationDto> compareLocationDtoList = new ArrayList<CompareLocationDto>(); | |
510 | 516 | if (!CollectionUtils.isEmpty(locationCodes)) { |
511 | 517 | for (String locationCode : locationCodes) { |
512 | 518 | if (StringUtils.isEmpty(locationCode)) { |
... | ... | @@ -524,7 +530,6 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
524 | 530 | if (!CollectionUtils.isEmpty(containerGroupList)) { |
525 | 531 | Set<String> containerCodes = containerGroupList.stream().map(t -> t.getCode()).collect(Collectors.toSet()); |
526 | 532 | Set<String> containerStatus = containerGroupList.stream().map(t -> t.getStatus()).collect(Collectors.toSet()); |
527 | - | |
528 | 533 | compareLocationDto.setContainerContainerCode(StringUtils.join(containerCodes, ",")); |
529 | 534 | compareLocationDto.setContainerStatus(StringUtils.join(containerStatus, ",")); |
530 | 535 | } |
... | ... | @@ -545,10 +550,13 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
545 | 550 | if (ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getContainerContainerCode()) != 0 |
546 | 551 | || ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getInventoryContainerCode()) != 0 |
547 | 552 | || ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getWcsContainerCode()) != 0 |
548 | - || ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getContainerStatus()) != 0 | |
549 | 553 | || ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getWcsLocationStatus()) != 0) { |
550 | 554 | compareLocationDto.setConsistencyStatus(0); |
551 | 555 | } |
556 | + if (!StringUtils.isEmpty(location.getContainerCode()) | |
557 | + && ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getContainerStatus()) != 0) { | |
558 | + compareLocationDto.setConsistencyStatus(0); | |
559 | + } | |
552 | 560 | compareLocationDtoList.add(compareLocationDto); |
553 | 561 | } |
554 | 562 | if (queryCompareLocationDto.getConsistencyStatus() != null) { |
... | ... | @@ -563,11 +571,11 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
563 | 571 | @Override |
564 | 572 | public PageUtil<CompareLocationTaskDto> compareWcsLocationTask(QueryCompareLocationTaskDto queryCompareLocationTaskDto) { |
565 | 573 | List<CompareLocationTaskDto> finalCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); |
566 | -// if (queryCompareLocationTaskDto.getLocationCode() == null) { | |
567 | -// return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | |
568 | -// } | |
569 | - // 只查询近90天的数据 | |
570 | -// String queryCreateTime = DateUtil.format(DateUtil.offsetDay(new Date(), -90), DatePattern.NORM_DATE_PATTERN); | |
574 | + if (StringUtils.isEmpty(queryCompareLocationTaskDto.getLocationCode())) { | |
575 | + return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | |
576 | + } | |
577 | + // 只查询近180天的数据 | |
578 | + String queryCreateTime = DateUtil.format(DateUtil.offsetDay(new Date(), -180), DatePattern.NORM_DATE_PATTERN); | |
571 | 579 | // 1.获取WMS任务信息 |
572 | 580 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
573 | 581 | taskHeaderLambdaQueryWrapper |
... | ... | @@ -577,15 +585,20 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
577 | 585 | .gt(StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeBegin()), TaskHeader::getCreateTime, |
578 | 586 | queryCompareLocationTaskDto.getTaskCreateTimeBegin()) |
579 | 587 | .lt(StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeEnd()), TaskHeader::getCreateTime, |
580 | - queryCompareLocationTaskDto.getTaskCreateTimeEnd()); | |
581 | -// .ge(TaskHeader::getCreateTime, queryCreateTime) | |
588 | + queryCompareLocationTaskDto.getTaskCreateTimeEnd()) | |
589 | + .ge(TaskHeader::getCreateTime, queryCreateTime); | |
582 | 590 | if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getLocationCode())) { |
583 | 591 | taskHeaderLambdaQueryWrapper.and(t -> t.eq(TaskHeader::getFromLocationCode, queryCompareLocationTaskDto.getLocationCode()).or() |
584 | 592 | .eq(TaskHeader::getToLocationCode, queryCompareLocationTaskDto.getLocationCode())); |
585 | 593 | } |
586 | 594 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
595 | + if (CollectionUtils.isEmpty(taskHeaderList)) { | |
596 | + return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | |
597 | + } | |
587 | 598 | // 2.获取WCS任务信息 |
588 | - String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_TAKS_INFOS); | |
599 | + Map<Integer, List<WcsTaskDto>> wcsTaskMap = new HashMap<Integer, List<WcsTaskDto>>(); | |
600 | + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_TAKS_INFOS, queryCompareLocationTaskDto.getWarehouseCode(), | |
601 | + taskHeaderList.get(0).getZoneCode()); | |
589 | 602 | Map<String, Object> queryParamMap = new HashMap<String, Object>(); |
590 | 603 | if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getWarehouseCode())) { |
591 | 604 | queryParamMap.put("warehouseCode", queryCompareLocationTaskDto.getWarehouseCode()); |
... | ... | @@ -599,18 +612,15 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
599 | 612 | if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeEnd())) { |
600 | 613 | queryParamMap.put("end", queryCompareLocationTaskDto.getTaskCreateTimeEnd()); |
601 | 614 | } |
602 | -// queryParamMap.put("begin", queryCreateTime); | |
615 | + queryParamMap.put("begin", queryCreateTime); | |
603 | 616 | String jsonStringResult = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(queryParamMap)); |
604 | 617 | WcsResultDto<List<WcsTaskDto>> wcsResult = JSON.parseObject(jsonStringResult, new TypeReference<WcsResultDto<List<WcsTaskDto>>>() {}); |
605 | - | |
606 | - Map<Integer, List<WcsTaskDto>> wcsTaskMap = new HashMap<Integer, List<WcsTaskDto>>(); | |
607 | 618 | if (wcsResult.getCode() != null && wcsResult.getCode().equals(200)) { |
608 | 619 | List<WcsTaskDto> wcsTaskList = wcsResult.getData(); |
609 | 620 | if (wcsTaskList != null && wcsTaskList.size() > 0) { |
610 | 621 | wcsTaskMap.putAll(wcsTaskList.stream().collect(Collectors.groupingBy(WcsTaskDto::getTaskNo))); |
611 | 622 | } |
612 | 623 | } |
613 | - | |
614 | 624 | // 对返回数据进行组装 |
615 | 625 | List<CompareLocationTaskDto> wcsCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); |
616 | 626 | if (!CollectionUtils.isEmpty(taskHeaderList)) { |
... | ... |