Commit 98b459aeb7019b6ff534f09ef68e5fbb7676b15b
1 parent
ef367566
库位监控问题及性能优化
Signed-off-by: TanYibin <5491541@qq.com>
Showing
3 changed files
with
79 additions
and
48 deletions
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocation.vue
... | ... | @@ -129,6 +129,20 @@ export default { |
129 | 129 | dataIndex: 'locationCode' |
130 | 130 | }, |
131 | 131 | { |
132 | + title: '库位表状态', | |
133 | + align: 'center', | |
134 | + dataIndex: 'locationStatus', | |
135 | + key: 'locationStatus', | |
136 | + scopedSlots: { customRender: 'locationStatus' } | |
137 | + }, | |
138 | + { | |
139 | + title: 'WCS库位表状态', | |
140 | + align: 'center', | |
141 | + dataIndex: 'wcsLocationStatus', | |
142 | + key: 'wcsLocationStatus', | |
143 | + scopedSlots: { customRender: 'wcsLocationStatus' } | |
144 | + }, | |
145 | + { | |
132 | 146 | title: '库位表容器编码', |
133 | 147 | align: 'center', |
134 | 148 | dataIndex: 'locationContainerCode' |
... | ... | @@ -149,13 +163,6 @@ export default { |
149 | 163 | dataIndex: 'wcsContainerCode' |
150 | 164 | }, |
151 | 165 | { |
152 | - title: '库位表状态', | |
153 | - align: 'center', | |
154 | - dataIndex: 'locationStatus', | |
155 | - key: 'locationStatus', | |
156 | - scopedSlots: { customRender: 'locationStatus' } | |
157 | - }, | |
158 | - { | |
159 | 166 | title: '托盘表状态', |
160 | 167 | align: 'center', |
161 | 168 | dataIndex: 'containerStatus', |
... | ... | @@ -163,13 +170,6 @@ export default { |
163 | 170 | scopedSlots: { customRender: 'containerStatus' } |
164 | 171 | }, |
165 | 172 | { |
166 | - title: 'WCS库位表状态', | |
167 | - align: 'center', | |
168 | - dataIndex: 'wcsLocationStatus', | |
169 | - key: 'wcsLocationStatus', | |
170 | - scopedSlots: { customRender: 'wcsLocationStatus' } | |
171 | - }, | |
172 | - { | |
173 | 173 | title: '数据状态', |
174 | 174 | align: 'center', |
175 | 175 | dataIndex: 'consistencyStatus', |
... | ... |
ant-design-vue-jeecg/src/views/system/config/ContainerList.vue
... | ... | @@ -14,22 +14,22 @@ |
14 | 14 | <a-input placeholder="请输入库位编码" v-model="queryParam.locationCode"></a-input> |
15 | 15 | </a-form-item> |
16 | 16 | </a-col> |
17 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
18 | + <a-form-item label="容器类型"> | |
19 | + <a-select | |
20 | + show-search | |
21 | + placeholder="请选择容器类型" | |
22 | + option-filter-prop="children" | |
23 | + v-model="queryParam.containerTypeCode" | |
24 | + > | |
25 | + <a-select-option v-for="item in containerTypeList" :key="item.name" :value="item.code" | |
26 | + >{{ item.name }} | |
27 | + </a-select-option> | |
28 | + </a-select> | |
29 | + </a-form-item> | |
30 | + </a-col> | |
17 | 31 | <template v-if="toggleSearchStatus"> |
18 | 32 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
19 | - <a-form-item label="容器类型"> | |
20 | - <a-select | |
21 | - show-search | |
22 | - placeholder="请选择容器类型" | |
23 | - option-filter-prop="children" | |
24 | - v-model="queryParam.containerTypeCode" | |
25 | - > | |
26 | - <a-select-option v-for="item in containerTypeList" :key="item.name" :value="item.code" | |
27 | - >{{ item.name }} | |
28 | - </a-select-option> | |
29 | - </a-select> | |
30 | - </a-form-item> | |
31 | - </a-col> | |
32 | - <a-col :xl="6" :lg="7" :md="8" :sm="24"> | |
33 | 33 | <a-form-item label="容器状态"> |
34 | 34 | <j-dict-select-tag |
35 | 35 | placeholder="请选择容器状态" |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -6,7 +6,6 @@ import java.util.Collections; |
6 | 6 | import java.util.Comparator; |
7 | 7 | import java.util.Date; |
8 | 8 | import java.util.HashMap; |
9 | -import java.util.HashSet; | |
10 | 9 | import java.util.List; |
11 | 10 | import java.util.Map; |
12 | 11 | import java.util.Set; |
... | ... | @@ -94,7 +93,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
94 | 93 | |
95 | 94 | @Resource |
96 | 95 | private IInventoryDetailService inventoryDetailService; |
97 | - | |
96 | + | |
98 | 97 | @Autowired |
99 | 98 | private ILocationService locationService; |
100 | 99 | |
... | ... | @@ -471,7 +470,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
471 | 470 | locationCodes.addAll(locationList.stream().map(t -> t.getCode()).distinct().collect(Collectors.toSet())); |
472 | 471 | } |
473 | 472 | if (!CollectionUtils.isEmpty(locationCodes)) { |
474 | - List<List<String>> partitionList = ListUtils.partition(locationCodes, 200); | |
473 | + List<List<String>> partitionList = ListUtils.partition(locationCodes, 1000); | |
475 | 474 | for (List<String> list : partitionList) { |
476 | 475 | // 2.获取WMS托盘表库位信息 |
477 | 476 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
... | ... | @@ -484,8 +483,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
484 | 483 | // 3.获取WMS库存表库位信息 |
485 | 484 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
486 | 485 | inventoryDetailLambdaQueryWrapper |
487 | - .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, | |
488 | - InventoryDetail::getInventoryStatus) | |
486 | + .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode) | |
489 | 487 | .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(InventoryDetail::getLocationCode, list); |
490 | 488 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
491 | 489 | if (!CollectionUtils.isEmpty(inventoryDetailList)) { |
... | ... | @@ -536,9 +534,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
536 | 534 | List<InventoryDetail> inventoryGroupList = inventoryDetailMap.get(locationCode); |
537 | 535 | if (!CollectionUtils.isEmpty(inventoryGroupList)) { |
538 | 536 | Set<String> inventoryContainerCodes = inventoryGroupList.stream().map(t -> t.getContainerCode()).collect(Collectors.toSet()); |
539 | - Set<String> inventoryStatus = inventoryGroupList.stream().map(t -> t.getInventoryStatus()).collect(Collectors.toSet()); | |
540 | 537 | compareLocationDto.setInventoryContainerCode(StringUtils.join(inventoryContainerCodes, ",")); |
541 | - compareLocationDto.setInventoryStatus(StringUtils.join(inventoryStatus, ",")); | |
542 | 538 | } |
543 | 539 | List<WcsLocationDto> wcsLocationGroupList = wcsLocationMap.get(locationCode); |
544 | 540 | if (!CollectionUtils.isEmpty(wcsLocationGroupList)) { |
... | ... | @@ -547,15 +543,32 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
547 | 543 | compareLocationDto.setWcsContainerCode(StringUtils.join(wcsContainerCodes, ",")); |
548 | 544 | compareLocationDto.setWcsLocationStatus(StringUtils.join(wcsContainerStatus, ",")); |
549 | 545 | } |
550 | - if (ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getContainerContainerCode()) != 0 | |
551 | - || ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getInventoryContainerCode()) != 0 | |
552 | - || ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getWcsContainerCode()) != 0 | |
553 | - || ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getWcsLocationStatus()) != 0) { | |
554 | - compareLocationDto.setConsistencyStatus(0); | |
546 | + // 值不为null时 ,才比较数据是否匹配 | |
547 | + if (!StringUtils.isEmpty(compareLocationDto.getLocationContainerCode()) || !StringUtils.isEmpty(compareLocationDto.getContainerContainerCode())) { | |
548 | + if (ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getContainerContainerCode()) != 0) { | |
549 | + compareLocationDto.setConsistencyStatus(0); | |
550 | + } | |
551 | + } | |
552 | + // 库存表有库存信息时才比较库存表容器信息 | |
553 | + if (!StringUtils.isEmpty(compareLocationDto.getLocationContainerCode()) && !StringUtils.isEmpty(compareLocationDto.getInventoryContainerCode())) { | |
554 | + if (ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getInventoryContainerCode()) != 0) { | |
555 | + compareLocationDto.setConsistencyStatus(0); | |
556 | + } | |
557 | + } | |
558 | + if (!StringUtils.isEmpty(compareLocationDto.getLocationContainerCode()) || !StringUtils.isEmpty(compareLocationDto.getWcsContainerCode())) { | |
559 | + if (ObjectUtil.compare(compareLocationDto.getLocationContainerCode(), compareLocationDto.getWcsContainerCode()) != 0) { | |
560 | + compareLocationDto.setConsistencyStatus(0); | |
561 | + } | |
562 | + } | |
563 | + if (!StringUtils.isEmpty(compareLocationDto.getLocationStatus()) || !StringUtils.isEmpty(compareLocationDto.getWcsLocationStatus())) { | |
564 | + if (ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getWcsLocationStatus()) != 0) { | |
565 | + compareLocationDto.setConsistencyStatus(0); | |
566 | + } | |
555 | 567 | } |
556 | - if (!StringUtils.isEmpty(location.getContainerCode()) | |
557 | - && ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getContainerStatus()) != 0) { | |
558 | - compareLocationDto.setConsistencyStatus(0); | |
568 | + if (!StringUtils.isEmpty(location.getContainerCode())) { | |
569 | + if (ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getContainerStatus()) != 0) { | |
570 | + compareLocationDto.setConsistencyStatus(0); | |
571 | + } | |
559 | 572 | } |
560 | 573 | compareLocationDtoList.add(compareLocationDto); |
561 | 574 | } |
... | ... | @@ -650,11 +663,29 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
650 | 663 | compareLocationTaskDto.setWcsContainerCode(wcsTaskDto.getContainerCode()); |
651 | 664 | compareLocationTaskDto.setWcsTaskStatus(wcsTaskDto.getTaskStatus()); |
652 | 665 | compareLocationTaskDto.setWcsTaskCreateTime(wcsTaskDto.getCreated()); |
653 | - if (ObjectUtil.compare(compareLocationTaskDto.getFromLocationCode(), compareLocationTaskDto.getWcsFromLocationCode()) != 0 | |
654 | - || ObjectUtil.compare(compareLocationTaskDto.getToLocationCode(), compareLocationTaskDto.getWcsToLocationCode()) != 0 | |
655 | - || ObjectUtil.compare(compareLocationTaskDto.getContainerCode(), compareLocationTaskDto.getWcsContainerCode()) != 0 | |
656 | - || ObjectUtil.compare(compareLocationTaskDto.getTaskStatus(), compareLocationTaskDto.getWcsTaskStatus()) != 0) { | |
657 | - compareLocationTaskDto.setConsistencyStatus(0); | |
666 | + // 值不为null时 ,才比较数据是否匹配 | |
667 | + if (!StringUtils.isEmpty(compareLocationTaskDto.getFromLocationCode()) | |
668 | + || !StringUtils.isEmpty(compareLocationTaskDto.getWcsFromLocationCode())) { | |
669 | + if (ObjectUtil.compare(compareLocationTaskDto.getFromLocationCode(), compareLocationTaskDto.getWcsFromLocationCode()) != 0) { | |
670 | + compareLocationTaskDto.setConsistencyStatus(0); | |
671 | + } | |
672 | + } | |
673 | + if (!StringUtils.isEmpty(compareLocationTaskDto.getToLocationCode()) | |
674 | + || !StringUtils.isEmpty(compareLocationTaskDto.getWcsToLocationCode())) { | |
675 | + if (ObjectUtil.compare(compareLocationTaskDto.getToLocationCode(), compareLocationTaskDto.getWcsToLocationCode()) != 0) { | |
676 | + compareLocationTaskDto.setConsistencyStatus(0); | |
677 | + } | |
678 | + } | |
679 | + if (!StringUtils.isEmpty(compareLocationTaskDto.getContainerCode()) || !StringUtils.isEmpty(compareLocationTaskDto.getWcsContainerCode())) { | |
680 | + if (ObjectUtil.compare(compareLocationTaskDto.getContainerCode(), compareLocationTaskDto.getWcsContainerCode()) != 0) { | |
681 | + compareLocationTaskDto.setConsistencyStatus(0); | |
682 | + } | |
683 | + } | |
684 | + if (!StringUtils.isEmpty(compareLocationTaskDto.getTaskStatus() + "") | |
685 | + || !StringUtils.isEmpty(compareLocationTaskDto.getWcsTaskStatus() + "")) { | |
686 | + if (ObjectUtil.compare(compareLocationTaskDto.getTaskStatus(), compareLocationTaskDto.getWcsTaskStatus()) != 0) { | |
687 | + compareLocationTaskDto.setConsistencyStatus(0); | |
688 | + } | |
658 | 689 | } |
659 | 690 | wcsCompareLocationTaskList.add(compareLocationTaskDto); |
660 | 691 | } |
... | ... |