Commit c17dcbf09d287a0a6d2bdbe443ec2630c3934370
1 parent
56acbc37
库位比较功能支持比较所有库位任务
Signed-off-by: TanYibin <5491541@qq.com>
Showing
3 changed files
with
47 additions
and
17 deletions
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue
... | ... | @@ -23,6 +23,25 @@ |
23 | 23 | /> |
24 | 24 | </a-form-item> |
25 | 25 | </a-col> |
26 | + <a-col :xl="12" :lg="14" :md="16" :sm="24"> | |
27 | + <a-form-item label="任务创建时间"> | |
28 | + <j-date | |
29 | + :show-time="true" | |
30 | + date-format="YYYY-MM-DD HH:mm:ss" | |
31 | + placeholder="请选择开始时间" | |
32 | + class="query-group-cust" | |
33 | + v-model="queryParam.taskCreateTimeBegin" | |
34 | + ></j-date> | |
35 | + <span class="query-group-split-cust"></span> | |
36 | + <j-date | |
37 | + :show-time="true" | |
38 | + date-format="YYYY-MM-DD HH:mm:ss" | |
39 | + placeholder="请选择结束时间" | |
40 | + class="query-group-cust" | |
41 | + v-model="queryParam.taskCreateTimeEnd" | |
42 | + ></j-date> | |
43 | + </a-form-item> | |
44 | + </a-col> | |
26 | 45 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
27 | 46 | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
28 | 47 | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
... | ... | @@ -94,12 +113,8 @@ export default { |
94 | 113 | mainId: { |
95 | 114 | immediate: true, |
96 | 115 | handler(val) { |
97 | - if (!this.mainId) { | |
98 | - this.clearList() | |
99 | - } else { | |
100 | - this.queryParam['locationCode'] = val | |
101 | - this.loadData(1) | |
102 | - } | |
116 | + this.queryParam['locationCode'] = val | |
117 | + this.loadData(1) | |
103 | 118 | } |
104 | 119 | } |
105 | 120 | }, |
... | ... | @@ -202,6 +217,9 @@ export default { |
202 | 217 | }, |
203 | 218 | created() { |
204 | 219 | this.initDictData() |
220 | + var nowDate = new Date() | |
221 | + this.queryParam['taskCreateTimeBegin'] = new Date(nowDate.getTime() - 90 * 24 * 60 * 60 * 1000) | |
222 | + this.queryParam['taskCreateTimeEnd'] = nowDate | |
205 | 223 | }, |
206 | 224 | methods: { |
207 | 225 | initDictData() { |
... | ... | @@ -227,7 +245,6 @@ export default { |
227 | 245 | } |
228 | 246 | }) |
229 | 247 | } |
230 | - | |
231 | 248 | // 获取 wcs_task_status |
232 | 249 | if (getDictItemsFromCache('wcs_task_status')) { |
233 | 250 | this.wcsTaskStatusList = getDictItemsFromCache('wcs_task_status') |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/QueryCompareLocationTaskDto.java
... | ... | @@ -25,6 +25,12 @@ public class QueryCompareLocationTaskDto { |
25 | 25 | /** 数据状态 */ |
26 | 26 | private Integer consistencyStatus; |
27 | 27 | |
28 | + /** 任务创建时间开始区间 */ | |
29 | + private String taskCreateTimeBegin; | |
30 | + | |
31 | + /** 任务创建时间结束区间 */ | |
32 | + private String taskCreateTimeEnd; | |
33 | + | |
28 | 34 | /** 页码 */ |
29 | 35 | private Integer pageNo = 1; |
30 | 36 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
... | ... | @@ -458,7 +458,6 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
458 | 458 | Map<String, List<WcsLocationDto>> wcsLocationMap = new HashMap<String, List<WcsLocationDto>>(); |
459 | 459 | |
460 | 460 | // 1.获取WMS库位表库位信息 |
461 | - Page<Location> page = new Page<Location>(queryCompareLocationDto.getPageNo(), queryCompareLocationDto.getPageSize()); | |
462 | 461 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
463 | 462 | locationLambdaQueryWrapper.select(Location::getWarehouseCode, Location::getCode, Location::getContainerCode, Location::getStatus) |
464 | 463 | .eq(Location::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) |
... | ... | @@ -568,9 +567,9 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
568 | 567 | @Override |
569 | 568 | public PageUtil<CompareLocationTaskDto> compareWcsLocationTask(QueryCompareLocationTaskDto queryCompareLocationTaskDto) { |
570 | 569 | List<CompareLocationTaskDto> finalCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); |
571 | - if (queryCompareLocationTaskDto.getLocationCode() == null) { | |
572 | - return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | |
573 | - } | |
570 | +// if (queryCompareLocationTaskDto.getLocationCode() == null) { | |
571 | +// return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | |
572 | +// } | |
574 | 573 | // 只查询近90天的数据 |
575 | 574 | // String queryCreateTime = DateUtil.format(DateUtil.offsetDay(new Date(), -90), DatePattern.NORM_DATE_PATTERN); |
576 | 575 | // 1.获取WMS任务信息 |
... | ... | @@ -579,12 +578,14 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
579 | 578 | .select(TaskHeader::getId, TaskHeader::getWarehouseCode, TaskHeader::getTaskType, TaskHeader::getFromLocationCode, TaskHeader::getToLocationCode, |
580 | 579 | TaskHeader::getContainerCode, TaskHeader::getStatus, TaskHeader::getCreateTime) |
581 | 580 | .eq(TaskHeader::getWarehouseCode, queryCompareLocationTaskDto.getWarehouseCode()) |
581 | + .gt(StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeBegin()), TaskHeader::getCreateTime, queryCompareLocationTaskDto.getTaskCreateTimeBegin()) | |
582 | + .lt(StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeEnd()),TaskHeader::getCreateTime, queryCompareLocationTaskDto.getTaskCreateTimeEnd()); | |
582 | 583 | // .ge(TaskHeader::getCreateTime, queryCreateTime) |
583 | - .and(t -> t.eq(StringUtils.isNotEmpty(queryCompareLocationTaskDto.getLocationCode()), TaskHeader::getFromLocationCode, | |
584 | - queryCompareLocationTaskDto.getLocationCode()).or().eq(StringUtils.isNotEmpty(queryCompareLocationTaskDto.getLocationCode()), | |
585 | - TaskHeader::getToLocationCode, queryCompareLocationTaskDto.getLocationCode())); | |
584 | + if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getLocationCode())) { | |
585 | + taskHeaderLambdaQueryWrapper.and(t -> t.eq(TaskHeader::getFromLocationCode, queryCompareLocationTaskDto.getLocationCode()).or() | |
586 | + .eq(TaskHeader::getToLocationCode, queryCompareLocationTaskDto.getLocationCode())); | |
587 | + } | |
586 | 588 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
587 | - | |
588 | 589 | // 2.获取WCS任务信息 |
589 | 590 | String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_TAKS_INFOS); |
590 | 591 | Map<String, Object> queryParamMap = new HashMap<String, Object>(); |
... | ... | @@ -594,6 +595,12 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
594 | 595 | if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getLocationCode())) { |
595 | 596 | queryParamMap.put("location", queryCompareLocationTaskDto.getLocationCode()); |
596 | 597 | } |
598 | + if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeBegin())) { | |
599 | + queryParamMap.put("begin", queryCompareLocationTaskDto.getTaskCreateTimeBegin()); | |
600 | + } | |
601 | + if (StringUtils.isNotEmpty(queryCompareLocationTaskDto.getTaskCreateTimeEnd())) { | |
602 | + queryParamMap.put("end", queryCompareLocationTaskDto.getTaskCreateTimeEnd()); | |
603 | + } | |
597 | 604 | // queryParamMap.put("begin", queryCreateTime); |
598 | 605 | String jsonStringResult = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(queryParamMap)); |
599 | 606 | WcsResultDto<List<WcsTaskDto>> wcsResult = JSON.parseObject(jsonStringResult, new TypeReference<WcsResultDto<List<WcsTaskDto>>>() {}); |
... | ... | @@ -686,8 +693,8 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
686 | 693 | finalCompareLocationTaskList.stream().filter(t -> queryCompareLocationTaskDto.getWcsId().equals(t.getWcsId())).collect(Collectors.toList()); |
687 | 694 | } |
688 | 695 | if (queryCompareLocationTaskDto.getConsistencyStatus() != null) { |
689 | - finalCompareLocationTaskList = finalCompareLocationTaskList.stream().filter(t -> queryCompareLocationTaskDto.getConsistencyStatus().equals(t.getConsistencyStatus())) | |
690 | - .collect(Collectors.toList()); | |
696 | + finalCompareLocationTaskList = finalCompareLocationTaskList.stream() | |
697 | + .filter(t -> queryCompareLocationTaskDto.getConsistencyStatus().equals(t.getConsistencyStatus())).collect(Collectors.toList()); | |
691 | 698 | } |
692 | 699 | return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); |
693 | 700 | } |
... | ... |