Commit 57cae75a38beea4fe254b4c2829c470920edd6c2
1 parent
7053918b
库位比较功能提交(4)
Signed-off-by: TanYibin <5491541@qq.com>
Showing
13 changed files
with
576 additions
and
138 deletions
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocation.vue
0 → 100644
1 | +<template> | ||
2 | + <a-card :bordered="false"> | ||
3 | + <!-- 查询区域 --> | ||
4 | + <div class="table-page-search-wrapper"> | ||
5 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | ||
6 | + <a-row :gutter="24"> | ||
7 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
8 | + <a-form-item label="库位编码"> | ||
9 | + <a-input placeholder="请输入库位编码" v-model="queryParam.locationCode"></a-input> | ||
10 | + </a-form-item> | ||
11 | + </a-col> | ||
12 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
13 | + <a-form-item label="库位表容器编码"> | ||
14 | + <a-input placeholder="请输入库位表容器编码" v-model="queryParam.containerCode"></a-input> | ||
15 | + </a-form-item> | ||
16 | + </a-col> | ||
17 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
18 | + <a-form-item label="库位状态"> | ||
19 | + <j-dict-select-tag | ||
20 | + placeholder="请选择库位状态" | ||
21 | + v-model="queryParam.locationStatus" | ||
22 | + dictCode="location_status" | ||
23 | + /> | ||
24 | + </a-form-item> | ||
25 | + </a-col> | ||
26 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
27 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | ||
28 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | ||
29 | + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | ||
30 | + </span> | ||
31 | + </a-col> | ||
32 | + </a-row> | ||
33 | + </a-form> | ||
34 | + </div> | ||
35 | + <!-- 查询区域-END --> | ||
36 | + | ||
37 | + <!-- table区域-begin --> | ||
38 | + <div> | ||
39 | + <a-table | ||
40 | + ref="table" | ||
41 | + size="middle" | ||
42 | + :scroll="{ x: true }" | ||
43 | + bordered | ||
44 | + rowKey="locationCode" | ||
45 | + class="j-table-force-nowrap" | ||
46 | + :columns="columns" | ||
47 | + :dataSource="dataSource" | ||
48 | + :pagination="ipagination" | ||
49 | + :loading="loading" | ||
50 | + :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'radio' }" | ||
51 | + :customRow="clickThenSelect" | ||
52 | + @change="handleTableChange" | ||
53 | + > | ||
54 | + </a-table> | ||
55 | + </div> | ||
56 | + | ||
57 | + <a-tabs defaultActiveKey="1"> | ||
58 | + <a-tab-pane tab="库位任务详情" key="1"> | ||
59 | + <CompareWcsLocationTask :mainId="selectedMainId" /> | ||
60 | + </a-tab-pane> | ||
61 | + </a-tabs> | ||
62 | + </a-card> | ||
63 | +</template> | ||
64 | + | ||
65 | +<script> | ||
66 | +import '@/assets/less/TableExpand.less' | ||
67 | +import { mixinDevice } from '@/utils/mixin' | ||
68 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
69 | +import { getAction } from '@/api/manage' | ||
70 | +import CompareWcsLocationTask from './CompareWcsLocationTask' | ||
71 | +import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' | ||
72 | +import { compareWcsLocation } from '@/api/api' | ||
73 | + | ||
74 | +export default { | ||
75 | + name: 'CompareWcsLocation', | ||
76 | + mixins: [JeecgListMixin], | ||
77 | + components: { | ||
78 | + CompareWcsLocationTask | ||
79 | + }, | ||
80 | + data() { | ||
81 | + return { | ||
82 | + description: '库位信息比较页面', | ||
83 | + querySource: {}, | ||
84 | + // 表头 | ||
85 | + columns: [ | ||
86 | + { | ||
87 | + title: '库位编码', | ||
88 | + align: 'center', | ||
89 | + dataIndex: 'locationCode' | ||
90 | + }, | ||
91 | + { | ||
92 | + title: '库位表容器编码', | ||
93 | + align: 'center', | ||
94 | + dataIndex: 'locationContainerCode' | ||
95 | + }, | ||
96 | + { | ||
97 | + title: '库位表状态', | ||
98 | + align: 'center', | ||
99 | + // dataIndex: 'locationStatus_dictText' | ||
100 | + dataIndex: 'locationStatus' | ||
101 | + }, | ||
102 | + { | ||
103 | + title: '托盘表容器编码', | ||
104 | + align: 'center', | ||
105 | + dataIndex: 'containerContainerCode' | ||
106 | + }, | ||
107 | + { | ||
108 | + title: '托盘表状态', | ||
109 | + align: 'center', | ||
110 | + dataIndex: 'containerStatus' | ||
111 | + }, | ||
112 | + { | ||
113 | + title: '库存表容器编码', | ||
114 | + align: 'center', | ||
115 | + dataIndex: 'inventoryContainerCode' | ||
116 | + }, | ||
117 | + { | ||
118 | + title: '库存表状态', | ||
119 | + align: 'center', | ||
120 | + dataIndex: 'inventoryStatus' | ||
121 | + }, | ||
122 | + { | ||
123 | + title: 'WCS库位表容器编码', | ||
124 | + align: 'center', | ||
125 | + dataIndex: 'wcsContainerCode' | ||
126 | + }, | ||
127 | + { | ||
128 | + title: 'WCS库位表状态', | ||
129 | + align: 'center', | ||
130 | + dataIndex: 'wcsLocationStatus' | ||
131 | + } | ||
132 | + ], | ||
133 | + url: { | ||
134 | + list: '/config/location/compareWcsLocation' | ||
135 | + }, | ||
136 | + dictOptions: { | ||
137 | + locationStatus: [] | ||
138 | + }, | ||
139 | + /* 分页参数 */ | ||
140 | + ipagination: { | ||
141 | + current: 1, | ||
142 | + pageSize: 5, | ||
143 | + pageSizeOptions: ['5', '10', '50'], | ||
144 | + showTotal: (total, range) => { | ||
145 | + return range[0] + '-' + range[1] + ' 共' + total + '条' | ||
146 | + }, | ||
147 | + showQuickJumper: true, | ||
148 | + showSizeChanger: true, | ||
149 | + total: 0 | ||
150 | + }, | ||
151 | + selectedMainId: '', | ||
152 | + superFieldList: [] | ||
153 | + } | ||
154 | + }, | ||
155 | + created() { | ||
156 | + this.getSuperFieldList() | ||
157 | + }, | ||
158 | + computed: { | ||
159 | + importExcelUrl: function() { | ||
160 | + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` | ||
161 | + } | ||
162 | + }, | ||
163 | + methods: { | ||
164 | + initDictConfig() {}, | ||
165 | + clickThenSelect(record) { | ||
166 | + return { | ||
167 | + on: { | ||
168 | + click: () => { | ||
169 | + this.onSelectChange(record.locationCode.toString().split(','), [record]) | ||
170 | + } | ||
171 | + } | ||
172 | + } | ||
173 | + }, | ||
174 | + onClearSelected() { | ||
175 | + this.selectedRowKeys = [] | ||
176 | + this.selectionRows = [] | ||
177 | + this.selectedMainId = '' | ||
178 | + }, | ||
179 | + onSelectChange(selectedRowKeys, selectionRows) { | ||
180 | + this.selectedMainId = selectedRowKeys[0].toString() | ||
181 | + this.selectedRowKeys = selectedRowKeys | ||
182 | + this.selectionRows = selectionRows | ||
183 | + }, | ||
184 | + createTask(record) { | ||
185 | + this.loading = true | ||
186 | + this.model = Object.assign({}, record) | ||
187 | + createReceiptTask(this.model).then(res => { | ||
188 | + this.loading = false | ||
189 | + if (res.success) { | ||
190 | + this.$message.success(res.message) | ||
191 | + } else { | ||
192 | + this.$message.error(res.message) | ||
193 | + } | ||
194 | + this.searchQuery() | ||
195 | + }) | ||
196 | + }, | ||
197 | + loadData(arg) { | ||
198 | + if (!this.url.list) { | ||
199 | + this.$message.error('请设置url.list属性!') | ||
200 | + return | ||
201 | + } | ||
202 | + //加载数据 若传入参数1则加载第一页的内容 | ||
203 | + if (arg === 1) { | ||
204 | + this.ipagination.current = 1 | ||
205 | + } | ||
206 | + this.onClearSelected() | ||
207 | + var params = this.getQueryParams() //查询条件 | ||
208 | + this.loading = true | ||
209 | + getAction(this.url.list, params).then(res => { | ||
210 | + if (res.success) { | ||
211 | + this.dataSource = res.result.records | ||
212 | + this.ipagination.total = res.result.total | ||
213 | + } | ||
214 | + if (res.code === 510) { | ||
215 | + this.$message.warning(res.message) | ||
216 | + } | ||
217 | + this.loading = false | ||
218 | + }) | ||
219 | + }, | ||
220 | + getSuperFieldList() { | ||
221 | + let fieldList = [] | ||
222 | + fieldList.push({ type: 'string', value: 'locationCode', text: '库位编码', dictCode: '' }) | ||
223 | + fieldList.push({ type: 'string', value: 'locationContainerCode', text: '库位表容器编码', dictCode: '' }) | ||
224 | + fieldList.push({ type: 'string', value: 'locationStatus', text: '库位表状态', dictCode: 'location_status' }) | ||
225 | + fieldList.push({ type: 'string', value: 'containerContainerCode', text: '托盘表容器编码', dictCode: '' }) | ||
226 | + fieldList.push({ type: 'string', value: 'containerStatus', text: '托盘表状态', dictCode: '' }) | ||
227 | + fieldList.push({ type: 'string', value: 'inventoryContainerCode', text: '库存表容器编码', dictCode: '' }) | ||
228 | + fieldList.push({ type: 'string', value: 'inventoryStatus', text: '库存表状态', dictCode: '' }) | ||
229 | + fieldList.push({ type: 'string', value: 'wcsContainerCode', text: 'WCS库位容器编码' }) | ||
230 | + fieldList.push({ type: 'string', value: 'wcsLocationStatus', text: 'WCS库位表状态', dictCode: '' }) | ||
231 | + this.superFieldList = fieldList | ||
232 | + } | ||
233 | + } | ||
234 | +} | ||
235 | +</script> | ||
236 | +<style scoped> | ||
237 | +@import '~@assets/less/common.less'; | ||
238 | +</style> | ||
0 | \ No newline at end of file | 239 | \ No newline at end of file |
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue
0 → 100644
1 | +<template> | ||
2 | + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> | ||
3 | + <!-- 查询区域 --> | ||
4 | + <div class="table-page-search-wrapper"> | ||
5 | + <a-form layout="inline" @keyup.enter.native="searchQuery"> | ||
6 | + <a-row :gutter="24"> | ||
7 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
8 | + <a-form-item label="WMS任务ID"> | ||
9 | + <a-input placeholder="请输入WMS任务ID" v-model="queryParam.wmsId"></a-input> | ||
10 | + </a-form-item> | ||
11 | + </a-col> | ||
12 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
13 | + <a-form-item label="WCS任务ID"> | ||
14 | + <a-input placeholder="请输入WMS任务ID" v-model="queryParam.wcsId"></a-input> | ||
15 | + </a-form-item> | ||
16 | + </a-col> | ||
17 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
18 | + <a-form-item label="WMS任务类型"> | ||
19 | + <j-dict-select-tag placeholder="请选择WMS任务类型" v-model="queryParam.taskType" dictCode="task_type" /> | ||
20 | + </a-form-item> | ||
21 | + </a-col> | ||
22 | + <a-col :xl="6" :lg="7" :md="8" :sm="24"> | ||
23 | + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | ||
24 | + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | ||
25 | + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | ||
26 | + </span> | ||
27 | + </a-col> | ||
28 | + </a-row> | ||
29 | + </a-form> | ||
30 | + </div> | ||
31 | + <!-- 查询区域-END --> | ||
32 | + | ||
33 | + <!-- table区域-begin --> | ||
34 | + <div> | ||
35 | + <a-table | ||
36 | + ref="table" | ||
37 | + size="middle" | ||
38 | + bordered | ||
39 | + rowKey="wmsId" | ||
40 | + :scroll="{ x: true }" | ||
41 | + :columns="columns" | ||
42 | + :dataSource="dataSource" | ||
43 | + :pagination="ipagination" | ||
44 | + :loading="loading" | ||
45 | + @change="handleTableChange" | ||
46 | + > | ||
47 | + </a-table> | ||
48 | + </div> | ||
49 | + </a-card> | ||
50 | +</template> | ||
51 | +<script> | ||
52 | +import { JeecgListMixin } from '@/mixins/JeecgListMixin' | ||
53 | +import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' | ||
54 | + | ||
55 | +export default { | ||
56 | + name: 'CompareWcsLocationTask', | ||
57 | + mixins: [JeecgListMixin], | ||
58 | + components: {}, | ||
59 | + props: { | ||
60 | + mainId: { | ||
61 | + type: String, | ||
62 | + default: '', | ||
63 | + required: false | ||
64 | + } | ||
65 | + }, | ||
66 | + watch: { | ||
67 | + mainId: { | ||
68 | + immediate: true, | ||
69 | + handler(val) { | ||
70 | + if (!this.mainId) { | ||
71 | + this.clearList() | ||
72 | + } else { | ||
73 | + this.queryParam['locationCode'] = val | ||
74 | + this.loadData(1) | ||
75 | + } | ||
76 | + } | ||
77 | + } | ||
78 | + }, | ||
79 | + data() { | ||
80 | + return { | ||
81 | + description: '库位任务信息比较页面', | ||
82 | + disableMixinCreated: true, | ||
83 | + // 表头 | ||
84 | + columns: [ | ||
85 | + { | ||
86 | + title: 'WMS任务ID', | ||
87 | + align: 'center', | ||
88 | + dataIndex: 'wmsId' | ||
89 | + }, | ||
90 | + { | ||
91 | + title: 'WCS任务ID', | ||
92 | + align: 'center', | ||
93 | + dataIndex: 'wcsId' | ||
94 | + }, | ||
95 | + { | ||
96 | + title: 'WMS任务类型', | ||
97 | + align: 'center', | ||
98 | + dataIndex: 'taskType_dictText' | ||
99 | + }, | ||
100 | + { | ||
101 | + title: '源库位', | ||
102 | + align: 'center', | ||
103 | + dataIndex: 'fromLocationCode' | ||
104 | + }, | ||
105 | + { | ||
106 | + title: 'WCS源库位', | ||
107 | + align: 'center', | ||
108 | + dataIndex: 'wcsFromLocationCode' | ||
109 | + }, | ||
110 | + { | ||
111 | + title: '目标库位', | ||
112 | + align: 'center', | ||
113 | + dataIndex: 'toLocationCode' | ||
114 | + }, | ||
115 | + { | ||
116 | + title: 'WCS目标库位', | ||
117 | + align: 'center', | ||
118 | + dataIndex: 'wcsToLocationCode' | ||
119 | + }, | ||
120 | + { | ||
121 | + title: '托盘编码', | ||
122 | + align: 'center', | ||
123 | + dataIndex: 'containerCode' | ||
124 | + }, | ||
125 | + { | ||
126 | + title: 'WCS托盘编码', | ||
127 | + align: 'center', | ||
128 | + dataIndex: 'wcsContainerCode' | ||
129 | + }, | ||
130 | + { | ||
131 | + title: '任务状态', | ||
132 | + align: 'center', | ||
133 | + dataIndex: 'taskStatus' | ||
134 | + }, | ||
135 | + { | ||
136 | + title: 'WCS任务状态', | ||
137 | + align: 'center', | ||
138 | + dataIndex: 'wcsTaskStatus' | ||
139 | + }, | ||
140 | + { | ||
141 | + title: '任务创建时间', | ||
142 | + align: 'center', | ||
143 | + dataIndex: 'taskCreateTime' | ||
144 | + }, | ||
145 | + { | ||
146 | + title: 'WCS任务创建时间', | ||
147 | + align: 'center', | ||
148 | + dataIndex: 'wcsTaskCreateTime' | ||
149 | + } | ||
150 | + ], | ||
151 | + url: { | ||
152 | + list: '/config/location/compareWcsLocationTask' | ||
153 | + }, | ||
154 | + dictOptions: { | ||
155 | + taskType: [] | ||
156 | + } | ||
157 | + } | ||
158 | + }, | ||
159 | + created() { | ||
160 | + this.getSuperFieldList() | ||
161 | + this.loadFrom() | ||
162 | + }, | ||
163 | + methods: { | ||
164 | + clearList() { | ||
165 | + this.dataSource = [] | ||
166 | + this.selectedRowKeys = [] | ||
167 | + this.ipagination.current = 1 | ||
168 | + }, | ||
169 | + searchReset() { | ||
170 | + var locationCode = this.queryParam['locationCode'] | ||
171 | + this.queryParam = {} | ||
172 | + this.queryParam['locationCode'] = locationCode | ||
173 | + this.loadData(1) | ||
174 | + }, | ||
175 | + loadFrom() {}, | ||
176 | + solutionCompany(value) { | ||
177 | + var actions = [] | ||
178 | + return actions.join('') | ||
179 | + }, | ||
180 | + getSuperFieldList() { | ||
181 | + let fieldList = [] | ||
182 | + fieldList.push({ type: 'int', value: 'taskType', text: 'WMS任务类型', dictCode: 'task_type' }) | ||
183 | + this.superFieldList = fieldList | ||
184 | + } | ||
185 | + } | ||
186 | +} | ||
187 | +</script> | ||
188 | +<style scoped> | ||
189 | +@import '~@assets/less/common.less'; | ||
190 | +</style> |
ant-design-vue-jeecg/src/views/system/config/LocationList.vue
@@ -227,7 +227,7 @@ export default { | @@ -227,7 +227,7 @@ export default { | ||
227 | }, | 227 | }, |
228 | data() { | 228 | data() { |
229 | return { | 229 | return { |
230 | - description: '库位管理管理页面', | 230 | + description: '库位管理页面', |
231 | zoneList: [], | 231 | zoneList: [], |
232 | locationTypeList: [], | 232 | locationTypeList: [], |
233 | // 表头 | 233 | // 表头 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/address/service/IAddressService.java
@@ -11,7 +11,7 @@ import org.jeecg.modules.wms.config.address.entity.Address; | @@ -11,7 +11,7 @@ import org.jeecg.modules.wms.config.address.entity.Address; | ||
11 | */ | 11 | */ |
12 | public interface IAddressService extends IService<Address> { | 12 | public interface IAddressService extends IService<Address> { |
13 | 13 | ||
14 | - Address getAddressByUrl(String url, String warehouseCode); | 14 | + Address getAddressByUrl(String url); |
15 | 15 | ||
16 | String getUrlByParam(String param, String warehouseCode, String zoneCode); | 16 | String getUrlByParam(String param, String warehouseCode, String zoneCode); |
17 | 17 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/address/service/impl/AddressServiceImpl.java
@@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | @@ -21,10 +21,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
21 | public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService { | 21 | public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService { |
22 | 22 | ||
23 | @Override | 23 | @Override |
24 | - @Cacheable(cacheNames = "getAddressByUrl#300", key = "#root.methodName + '_' + #url + '_' + #warehouseCode") | ||
25 | - public Address getAddressByUrl(String url, String warehouseCode) { | 24 | + @Cacheable(cacheNames = "getAddressByUrl#300", key = "#root.methodName") |
25 | + public Address getAddressByUrl(String url) { | ||
26 | LambdaQueryWrapper<Address> addressLambdaQueryWrapper = Wrappers.lambdaQuery(); | 26 | LambdaQueryWrapper<Address> addressLambdaQueryWrapper = Wrappers.lambdaQuery(); |
27 | - addressLambdaQueryWrapper.eq(Address::getUrl, url).eq(Address::getWarehouseCode, warehouseCode).last(" limit 1"); | 27 | + addressLambdaQueryWrapper.eq(Address::getUrl, url).last(" limit 1"); |
28 | Address address = getOne(addressLambdaQueryWrapper); | 28 | Address address = getOne(addressLambdaQueryWrapper); |
29 | return address; | 29 | return address; |
30 | } | 30 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
@@ -279,8 +279,8 @@ public class LocationController extends JeecgController<Location, ILocationServi | @@ -279,8 +279,8 @@ public class LocationController extends JeecgController<Location, ILocationServi | ||
279 | */ | 279 | */ |
280 | @AutoLog(value = "WCS库位信息比较") | 280 | @AutoLog(value = "WCS库位信息比较") |
281 | @ApiOperation(value = "库位管理-WCS库位信息比较", notes = "库位管理-WCS库位信息比较") | 281 | @ApiOperation(value = "库位管理-WCS库位信息比较", notes = "库位管理-WCS库位信息比较") |
282 | - @PostMapping(value = "/compareWcsLocation") | ||
283 | - public Result compareWcsLocation(@RequestBody @Validated QueryCompareLocationDto queryCompareLocationDto, HttpServletRequest request) { | 282 | + @GetMapping(value = "/compareWcsLocation") |
283 | + public Result compareWcsLocation(@Validated QueryCompareLocationDto queryCompareLocationDto, HttpServletRequest request) { | ||
284 | HuahengJwtUtil.setWarehouseCode(request, queryCompareLocationDto); | 284 | HuahengJwtUtil.setWarehouseCode(request, queryCompareLocationDto); |
285 | PageUtil<CompareLocationDto> compareLocationDtoPage = locationService.compareWcsLocation(queryCompareLocationDto); | 285 | PageUtil<CompareLocationDto> compareLocationDtoPage = locationService.compareWcsLocation(queryCompareLocationDto); |
286 | return Result.OK(compareLocationDtoPage); | 286 | return Result.OK(compareLocationDtoPage); |
@@ -292,8 +292,8 @@ public class LocationController extends JeecgController<Location, ILocationServi | @@ -292,8 +292,8 @@ public class LocationController extends JeecgController<Location, ILocationServi | ||
292 | * @return | 292 | * @return |
293 | */ | 293 | */ |
294 | @ApiOperation(value = "库位管理-WCS库位任务信息比较", notes = "库位管理-WCS库位任务信息比较") | 294 | @ApiOperation(value = "库位管理-WCS库位任务信息比较", notes = "库位管理-WCS库位任务信息比较") |
295 | - @PostMapping(value = "/compareWcsLocationTask") | ||
296 | - public Result compareWcsLocationTask(@RequestBody @Validated QueryCompareLocationTaskDto queryCompareLocationTaskDto, HttpServletRequest request) { | 295 | + @GetMapping(value = "/compareWcsLocationTask") |
296 | + public Result compareWcsLocationTask(@Validated QueryCompareLocationTaskDto queryCompareLocationTaskDto, HttpServletRequest request) { | ||
297 | HuahengJwtUtil.setWarehouseCode(request, queryCompareLocationTaskDto); | 297 | HuahengJwtUtil.setWarehouseCode(request, queryCompareLocationTaskDto); |
298 | PageUtil<CompareLocationTaskDto> compareLocationTaskDtoPage = locationService.compareWcsLocationTask(queryCompareLocationTaskDto); | 298 | PageUtil<CompareLocationTaskDto> compareLocationTaskDtoPage = locationService.compareWcsLocationTask(queryCompareLocationTaskDto); |
299 | return Result.OK(compareLocationTaskDtoPage); | 299 | return Result.OK(compareLocationTaskDtoPage); |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/CompareLocationDto.java
1 | package org.jeecg.modules.wms.config.location.dto; | 1 | package org.jeecg.modules.wms.config.location.dto; |
2 | 2 | ||
3 | +import org.jeecg.common.aspect.annotation.Dict; | ||
4 | +import org.jeecgframework.poi.excel.annotation.Excel; | ||
5 | + | ||
3 | import lombok.Data; | 6 | import lombok.Data; |
4 | 7 | ||
5 | /** | 8 | /** |
@@ -9,35 +12,36 @@ import lombok.Data; | @@ -9,35 +12,36 @@ import lombok.Data; | ||
9 | */ | 12 | */ |
10 | @Data | 13 | @Data |
11 | public class CompareLocationDto { | 14 | public class CompareLocationDto { |
12 | - | 15 | + |
13 | /** 仓库编码 */ | 16 | /** 仓库编码 */ |
14 | private String warehouseCode; | 17 | private String warehouseCode; |
15 | 18 | ||
16 | /** 库位编码 */ | 19 | /** 库位编码 */ |
17 | private String locationCode; | 20 | private String locationCode; |
18 | 21 | ||
19 | - /** 库位表托盘编码 */ | 22 | + /** 库位表容器编码 */ |
20 | private String locationContainerCode; | 23 | private String locationContainerCode; |
24 | + | ||
25 | + /** 库位表状态 */ | ||
26 | + @Dict(dicCode = "location_status") | ||
27 | + private String locationStatus; | ||
21 | 28 | ||
22 | - /** 托盘表托盘编码 */ | 29 | + /** 托盘表容器编码 */ |
23 | private String containerContainerCode; | 30 | private String containerContainerCode; |
31 | + | ||
32 | + /** 托盘表状态 */ | ||
33 | + private String containerStatus; | ||
24 | 34 | ||
25 | - /** 库存表托盘编码 */ | 35 | + /** 库存表容器编码 */ |
26 | private String inventoryContainerCode; | 36 | private String inventoryContainerCode; |
27 | - | ||
28 | - /** WCS库位托盘编码 */ | ||
29 | - private String wcsContainerCode; | ||
30 | - | ||
31 | - /** 库位状态 */ | ||
32 | - private String locationStatus; | ||
33 | - | ||
34 | - /** 托盘状态 */ | ||
35 | - private String containerStatus; | ||
36 | 37 | ||
37 | - /** 库存状态 */ | 38 | + /** 库存表状态 */ |
38 | private String inventoryStatus; | 39 | private String inventoryStatus; |
39 | 40 | ||
40 | - /** WCS库位状态 */ | 41 | + /** WCS库位容器编码 */ |
42 | + private String wcsContainerCode; | ||
43 | + | ||
44 | + /** WCS库位表状态 */ | ||
41 | private String wcsLocationStatus; | 45 | private String wcsLocationStatus; |
42 | 46 | ||
43 | } | 47 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/CompareLocationTaskDto.java
@@ -2,6 +2,8 @@ package org.jeecg.modules.wms.config.location.dto; | @@ -2,6 +2,8 @@ package org.jeecg.modules.wms.config.location.dto; | ||
2 | 2 | ||
3 | import javax.validation.constraints.NotNull; | 3 | import javax.validation.constraints.NotNull; |
4 | 4 | ||
5 | +import org.jeecg.common.aspect.annotation.Dict; | ||
6 | + | ||
5 | import lombok.Data; | 7 | import lombok.Data; |
6 | 8 | ||
7 | /** | 9 | /** |
@@ -15,7 +17,7 @@ public class CompareLocationTaskDto { | @@ -15,7 +17,7 @@ public class CompareLocationTaskDto { | ||
15 | /** 仓库编码 */ | 17 | /** 仓库编码 */ |
16 | private String warehouseCode; | 18 | private String warehouseCode; |
17 | 19 | ||
18 | - /** 任务ID */ | 20 | + /** WMS任务ID */ |
19 | private Integer wmsId; | 21 | private Integer wmsId; |
20 | 22 | ||
21 | /** WCS任务ID */ | 23 | /** WCS任务ID */ |
@@ -25,6 +27,7 @@ public class CompareLocationTaskDto { | @@ -25,6 +27,7 @@ public class CompareLocationTaskDto { | ||
25 | private String wcsIdString; | 27 | private String wcsIdString; |
26 | 28 | ||
27 | /** 任务类型 */ | 29 | /** 任务类型 */ |
30 | + @Dict(dicCode = "task_type") | ||
28 | private Integer taskType; | 31 | private Integer taskType; |
29 | 32 | ||
30 | /** 源库位 */ | 33 | /** 源库位 */ |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/QueryCompareLocationDto.java
1 | package org.jeecg.modules.wms.config.location.dto; | 1 | package org.jeecg.modules.wms.config.location.dto; |
2 | 2 | ||
3 | -import org.springframework.web.bind.annotation.RequestParam; | ||
4 | - | ||
5 | import lombok.Data; | 3 | import lombok.Data; |
6 | 4 | ||
7 | @Data | 5 | @Data |
@@ -19,15 +17,6 @@ public class QueryCompareLocationDto { | @@ -19,15 +17,6 @@ public class QueryCompareLocationDto { | ||
19 | /** 库位状态 */ | 17 | /** 库位状态 */ |
20 | private String locationStatus; | 18 | private String locationStatus; |
21 | 19 | ||
22 | - /** 托盘状态 */ | ||
23 | - private String containerStatus; | ||
24 | - | ||
25 | - /** 库存状态 */ | ||
26 | - private String inventoryStatus; | ||
27 | - | ||
28 | - /** WCS库位状态 */ | ||
29 | - private String wcsLocationStatus; | ||
30 | - | ||
31 | /** 页码 */ | 20 | /** 页码 */ |
32 | private Integer pageNo = 1; | 21 | private Integer pageNo = 1; |
33 | 22 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/QueryCompareLocationTaskDto.java
1 | package org.jeecg.modules.wms.config.location.dto; | 1 | package org.jeecg.modules.wms.config.location.dto; |
2 | 2 | ||
3 | -import javax.validation.constraints.NotNull; | ||
4 | - | ||
5 | import lombok.Data; | 3 | import lombok.Data; |
6 | 4 | ||
7 | /** | 5 | /** |
@@ -16,14 +14,16 @@ public class QueryCompareLocationTaskDto { | @@ -16,14 +14,16 @@ public class QueryCompareLocationTaskDto { | ||
16 | private String warehouseCode; | 14 | private String warehouseCode; |
17 | 15 | ||
18 | /** 库位编码 */ | 16 | /** 库位编码 */ |
19 | - @NotNull(message = "locationCode is empty") | ||
20 | private String locationCode; | 17 | private String locationCode; |
21 | - | ||
22 | - /** 任务状态 */ | ||
23 | - private Integer taskStatus; | ||
24 | - | ||
25 | - /** WCS任务状态 */ | ||
26 | - private String wcsTaskStatus; | 18 | + |
19 | + /** WMS任务ID */ | ||
20 | + private Integer wmsId; | ||
21 | + | ||
22 | + /** WCS任务ID */ | ||
23 | + private Integer wcsId; | ||
24 | + | ||
25 | + /** 任务类型 */ | ||
26 | + private Integer taskType; | ||
27 | 27 | ||
28 | /** 页码 */ | 28 | /** 页码 */ |
29 | private Integer pageNo = 1; | 29 | private Integer pageNo = 1; |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
@@ -15,6 +15,7 @@ import java.util.stream.Collectors; | @@ -15,6 +15,7 @@ import java.util.stream.Collectors; | ||
15 | 15 | ||
16 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
17 | 17 | ||
18 | +import org.apache.shiro.util.CollectionUtils; | ||
18 | import org.jeecg.common.api.vo.Result; | 19 | import org.jeecg.common.api.vo.Result; |
19 | import org.jeecg.common.exception.JeecgBootException; | 20 | import org.jeecg.common.exception.JeecgBootException; |
20 | import org.jeecg.modules.wms.config.address.service.IAddressService; | 21 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
@@ -451,74 +452,68 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -451,74 +452,68 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
451 | // 初始化数据 | 452 | // 初始化数据 |
452 | Set<String> locationCodes = new HashSet<String>(); | 453 | Set<String> locationCodes = new HashSet<String>(); |
453 | Map<String, Location> locationMap = new HashMap<String, Location>(); | 454 | Map<String, Location> locationMap = new HashMap<String, Location>(); |
454 | - Map<String, Container> containerMap = new HashMap<String, Container>(); | 455 | + Map<String, List<Container>> containerMap = new HashMap<String, List<Container>>(); |
455 | Map<String, List<InventoryDetail>> inventoryDetailMap = new HashMap<String, List<InventoryDetail>>(); | 456 | Map<String, List<InventoryDetail>> inventoryDetailMap = new HashMap<String, List<InventoryDetail>>(); |
456 | - Map<String, WcsLocationDto> wcsLocationMap = new HashMap<String, WcsLocationDto>(); | 457 | + Map<String, List<WcsLocationDto>> wcsLocationMap = new HashMap<String, List<WcsLocationDto>>(); |
457 | 458 | ||
458 | // 1.获取WMS库位表库位信息 | 459 | // 1.获取WMS库位表库位信息 |
460 | + Page<Location> page = new Page<Location>(queryCompareLocationDto.getPageNo(), queryCompareLocationDto.getPageSize()); | ||
459 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | 461 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
460 | locationLambdaQueryWrapper.select(Location::getWarehouseCode, Location::getCode, Location::getContainerCode, Location::getStatus) | 462 | locationLambdaQueryWrapper.select(Location::getWarehouseCode, Location::getCode, Location::getContainerCode, Location::getStatus) |
461 | .eq(Location::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) | 463 | .eq(Location::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) |
462 | .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), Location::getCode, queryCompareLocationDto.getLocationCode()) | 464 | .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), Location::getCode, queryCompareLocationDto.getLocationCode()) |
463 | - .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode()), Location::getContainerCode, queryCompareLocationDto.getContainerCode()); | ||
464 | - List<Location> locationList = list(locationLambdaQueryWrapper); | ||
465 | - if (locationList != null && locationList.size() > 0) { | ||
466 | - locationMap.putAll(locationList.stream().collect(Collectors.toMap(Location::getCode, Function.identity(), (key1, key2) -> key2))); | ||
467 | - locationCodes.addAll(locationList.stream().map(t -> t.getCode()).collect(Collectors.toSet())); | 465 | + .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode()), Location::getContainerCode, queryCompareLocationDto.getContainerCode()) |
466 | + .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationStatus()), Location::getStatus, queryCompareLocationDto.getLocationStatus()); | ||
467 | + Page<Location> locationPage = page(page, locationLambdaQueryWrapper); | ||
468 | + if (!CollectionUtils.isEmpty(locationPage.getRecords())) { | ||
469 | + locationMap.putAll(locationPage.getRecords().stream().collect(Collectors.toMap(Location::getCode, Function.identity(), (key1, key2) -> key2))); | ||
470 | + locationCodes.addAll(locationPage.getRecords().stream().map(t -> t.getCode()).collect(Collectors.toSet())); | ||
468 | } | 471 | } |
469 | 472 | ||
470 | // 2.获取WMS托盘表库位信息 | 473 | // 2.获取WMS托盘表库位信息 |
471 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | 474 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
472 | containerLambdaQueryWrapper.select(Container::getWarehouseCode, Container::getLocationCode, Container::getCode, Container::getStatus) | 475 | containerLambdaQueryWrapper.select(Container::getWarehouseCode, Container::getLocationCode, Container::getCode, Container::getStatus) |
473 | - .eq(Container::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) | ||
474 | - .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), Container::getLocationCode, queryCompareLocationDto.getLocationCode()) | ||
475 | - .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode()), Container::getCode, queryCompareLocationDto.getContainerCode()); | 476 | + .eq(Container::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(Container::getLocationCode, locationCodes); |
476 | List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | 477 | List<Container> containerList = containerService.list(containerLambdaQueryWrapper); |
477 | - if (containerList != null && containerList.size() > 0) { | ||
478 | - containerMap.putAll(containerList.stream().collect(Collectors.toMap(Container::getLocationCode, Function.identity(), (key1, key2) -> key2))); | ||
479 | - locationCodes.addAll(containerList.stream().map(t -> t.getLocationCode()).collect(Collectors.toSet())); | 478 | + if (!CollectionUtils.isEmpty(containerList)) { |
479 | + containerMap.putAll(containerList.stream().collect(Collectors.groupingBy(Container::getLocationCode))); | ||
480 | } | 480 | } |
481 | 481 | ||
482 | // 3.获取WMS库存表库位信息 | 482 | // 3.获取WMS库存表库位信息 |
483 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | 483 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
484 | inventoryDetailLambdaQueryWrapper | 484 | inventoryDetailLambdaQueryWrapper |
485 | .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, InventoryDetail::getInventoryStatus) | 485 | .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, InventoryDetail::getInventoryStatus) |
486 | - .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) | ||
487 | - .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), InventoryDetail::getLocationCode, queryCompareLocationDto.getLocationCode()) | ||
488 | - .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode()), InventoryDetail::getContainerCode, queryCompareLocationDto.getContainerCode()); | 486 | + .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(InventoryDetail::getLocationCode, locationCodes); |
489 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | 487 | List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); |
490 | - if (inventoryDetailList != null && inventoryDetailList.size() > 0) { | 488 | + if (!CollectionUtils.isEmpty(inventoryDetailList)) { |
491 | inventoryDetailMap.putAll(inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getLocationCode))); | 489 | inventoryDetailMap.putAll(inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getLocationCode))); |
492 | - locationCodes.addAll(inventoryDetailList.stream().map(t -> t.getLocationCode()).collect(Collectors.toSet())); | ||
493 | } | 490 | } |
494 | - | 491 | + |
495 | // 4.获取WCS库位信息 | 492 | // 4.获取WCS库位信息 |
496 | - String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_LOCATION_INFO); | ||
497 | - Map<String, Object> queryParamMap = new HashMap<String, Object>(); | ||
498 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getWarehouseCode())) { | ||
499 | - queryParamMap.put("warehouseCode", queryCompareLocationDto.getWarehouseCode()); | ||
500 | - } | ||
501 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode())) { | ||
502 | - queryParamMap.put("locations", Collections.singletonList(queryCompareLocationDto.getLocationCode())); | ||
503 | - } | ||
504 | - String jsonStringResult = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(queryParamMap)); | ||
505 | - WcsResultDto<List<WcsLocationDto>> wcsResult = JSON.parseObject(jsonStringResult, new TypeReference<WcsResultDto<List<WcsLocationDto>>>() {}); | ||
506 | - if (wcsResult.getCode() != null && wcsResult.getCode().equals(200)) { | ||
507 | - List<WcsLocationDto> wcsLocationList = wcsResult.getData(); | ||
508 | - if (wcsLocationList != null && wcsLocationList.size() > 0) { | ||
509 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode())) { | ||
510 | - wcsLocationList = | ||
511 | - wcsLocationList.stream().filter(t -> queryCompareLocationDto.getContainerCode().equals(t.getContainerCode())).collect(Collectors.toList()); | 493 | + if (!CollectionUtils.isEmpty(locationCodes)) { |
494 | + String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_LOCATION_INFO); | ||
495 | + Map<String, Object> queryParamMap = new HashMap<String, Object>(); | ||
496 | + if (StringUtils.isNotEmpty(queryCompareLocationDto.getWarehouseCode())) { | ||
497 | + queryParamMap.put("warehouseCode", queryCompareLocationDto.getWarehouseCode()); | ||
498 | + } | ||
499 | + queryParamMap.put("locations", locationCodes); | ||
500 | + String jsonStringResult = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(queryParamMap)); | ||
501 | + WcsResultDto<List<WcsLocationDto>> wcsResult = JSON.parseObject(jsonStringResult, new TypeReference<WcsResultDto<List<WcsLocationDto>>>() {}); | ||
502 | + if (wcsResult.getCode() != null && wcsResult.getCode().equals(200)) { | ||
503 | + List<WcsLocationDto> wcsLocationList = wcsResult.getData(); | ||
504 | + if (!CollectionUtils.isEmpty(wcsLocationList)) { | ||
505 | + if (StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode())) { | ||
506 | + wcsLocationList = wcsLocationList.stream().filter(t -> queryCompareLocationDto.getContainerCode().equals(t.getContainerCode())) | ||
507 | + .collect(Collectors.toList()); | ||
508 | + } | ||
509 | + wcsLocationMap.putAll(wcsLocationList.stream().collect(Collectors.groupingBy(WcsLocationDto::getLocationCode))); | ||
512 | } | 510 | } |
513 | - wcsLocationMap | ||
514 | - .putAll(wcsLocationList.stream().collect(Collectors.toMap(WcsLocationDto::getLocationCode, Function.identity(), (key1, key2) -> key2))); | ||
515 | - locationCodes.addAll(wcsLocationList.stream().map(t -> t.getLocationCode()).collect(Collectors.toSet())); | ||
516 | } | 511 | } |
517 | } | 512 | } |
518 | 513 | ||
519 | // 对返回数据进行组装 | 514 | // 对返回数据进行组装 |
520 | List<CompareLocationDto> compareLocationDtoList = new ArrayList<CompareLocationDto>(); | 515 | List<CompareLocationDto> compareLocationDtoList = new ArrayList<CompareLocationDto>(); |
521 | - if (locationCodes.size() > 0) { | 516 | + if (!CollectionUtils.isEmpty(locationCodes)) { |
522 | for (String locationCode : locationCodes) { | 517 | for (String locationCode : locationCodes) { |
523 | if (StringUtils.isEmpty(locationCode)) { | 518 | if (StringUtils.isEmpty(locationCode)) { |
524 | continue; | 519 | continue; |
@@ -531,56 +526,46 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -531,56 +526,46 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
531 | compareLocationDto.setLocationContainerCode(location.getContainerCode()); | 526 | compareLocationDto.setLocationContainerCode(location.getContainerCode()); |
532 | compareLocationDto.setLocationStatus(location.getStatus()); | 527 | compareLocationDto.setLocationStatus(location.getStatus()); |
533 | } | 528 | } |
534 | - Container container = containerMap.get(locationCode); | ||
535 | - if (container != null) { | ||
536 | - compareLocationDto.setContainerContainerCode(container.getCode()); | ||
537 | - compareLocationDto.setContainerStatus(container.getStatus()); | 529 | + List<Container> containerGroupList = containerMap.get(locationCode); |
530 | + if (!CollectionUtils.isEmpty(containerGroupList)) { | ||
531 | + Set<String> containerCodes = containerGroupList.stream().map(t -> t.getCode()).collect(Collectors.toSet()); | ||
532 | + Set<String> containerStatus = containerGroupList.stream().map(t -> t.getStatus()).collect(Collectors.toSet()); | ||
533 | + | ||
534 | + compareLocationDto.setContainerContainerCode(StringUtils.join(containerCodes, ",")); | ||
535 | + compareLocationDto.setContainerStatus(StringUtils.join(containerStatus, ",")); | ||
538 | } | 536 | } |
539 | - List<InventoryDetail> detailList = inventoryDetailMap.get(locationCode); | ||
540 | - if (detailList != null && detailList.size() > 0) { | ||
541 | - Set<String> containerCodes = detailList.stream().map(t -> t.getContainerCode()).collect(Collectors.toSet()); | ||
542 | - Set<String> inventoryStatus = detailList.stream().map(t -> t.getInventoryStatus()).collect(Collectors.toSet()); | ||
543 | - compareLocationDto.setInventoryContainerCode(StringUtils.join(containerCodes, ",")); | 537 | + List<InventoryDetail> inventoryGroupList = inventoryDetailMap.get(locationCode); |
538 | + if (!CollectionUtils.isEmpty(inventoryGroupList)) { | ||
539 | + Set<String> inventoryContainerCodes = inventoryGroupList.stream().map(t -> t.getContainerCode()).collect(Collectors.toSet()); | ||
540 | + Set<String> inventoryStatus = inventoryGroupList.stream().map(t -> t.getInventoryStatus()).collect(Collectors.toSet()); | ||
541 | + compareLocationDto.setInventoryContainerCode(StringUtils.join(inventoryContainerCodes, ",")); | ||
544 | compareLocationDto.setInventoryStatus(StringUtils.join(inventoryStatus, ",")); | 542 | compareLocationDto.setInventoryStatus(StringUtils.join(inventoryStatus, ",")); |
545 | } | 543 | } |
546 | - WcsLocationDto wcsLocationDto = wcsLocationMap.get(locationCode); | ||
547 | - if (wcsLocationDto != null) { | ||
548 | - compareLocationDto.setWarehouseCode(wcsLocationDto.getWarehouseCode()); | ||
549 | - compareLocationDto.setLocationCode(wcsLocationDto.getLocationCode()); | ||
550 | - compareLocationDto.setWcsContainerCode(wcsLocationDto.getContainerCode()); | ||
551 | - compareLocationDto.setWcsLocationStatus(wcsLocationDto.getStatus() + ""); | 544 | + List<WcsLocationDto> wcsLocationGroupList = wcsLocationMap.get(locationCode); |
545 | + if (!CollectionUtils.isEmpty(wcsLocationGroupList)) { | ||
546 | + Set<String> wcsContainerCodes = wcsLocationGroupList.stream().map(t -> t.getContainerCode()).collect(Collectors.toSet()); | ||
547 | + Set<Integer> wcsContainerStatus = wcsLocationGroupList.stream().map(t -> t.getStatus()).collect(Collectors.toSet()); | ||
548 | + compareLocationDto.setWcsContainerCode(StringUtils.join(wcsContainerCodes, ",")); | ||
549 | + compareLocationDto.setWcsLocationStatus(StringUtils.join(wcsContainerStatus, ",")); | ||
552 | } | 550 | } |
553 | compareLocationDtoList.add(compareLocationDto); | 551 | compareLocationDtoList.add(compareLocationDto); |
554 | } | 552 | } |
555 | } | 553 | } |
556 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getLocationStatus())) { | ||
557 | - compareLocationDtoList = | ||
558 | - compareLocationDtoList.stream().filter(t -> queryCompareLocationDto.getLocationStatus().equals(t.getLocationStatus())).collect(Collectors.toList()); | ||
559 | - } | ||
560 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getContainerStatus())) { | ||
561 | - compareLocationDtoList = compareLocationDtoList.stream().filter(t -> queryCompareLocationDto.getContainerStatus().equals(t.getContainerStatus())) | ||
562 | - .collect(Collectors.toList()); | ||
563 | - } | ||
564 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getInventoryStatus())) { | ||
565 | - compareLocationDtoList = compareLocationDtoList.stream().filter(t -> queryCompareLocationDto.getInventoryStatus().equals(t.getInventoryStatus())) | ||
566 | - .collect(Collectors.toList()); | ||
567 | - } | ||
568 | - if (StringUtils.isNotEmpty(queryCompareLocationDto.getWcsLocationStatus())) { | ||
569 | - compareLocationDtoList = compareLocationDtoList.stream().filter(t -> queryCompareLocationDto.getWcsLocationStatus().equals(t.getWcsLocationStatus())) | ||
570 | - .collect(Collectors.toList()); | ||
571 | - } | ||
572 | Collections.sort(compareLocationDtoList, Comparator.comparing(CompareLocationDto::getLocationCode)); | 554 | Collections.sort(compareLocationDtoList, Comparator.comparing(CompareLocationDto::getLocationCode)); |
573 | - return PageUtil.create(compareLocationDtoList, queryCompareLocationDto.getPageNo(), queryCompareLocationDto.getPageSize()); | 555 | + return PageUtil.create(compareLocationDtoList, new Long(locationPage.getCurrent()).intValue(), new Long(locationPage.getSize()).intValue(), |
556 | + new Long(locationPage.getTotal()).intValue()); | ||
574 | } | 557 | } |
575 | 558 | ||
576 | @Override | 559 | @Override |
577 | public PageUtil<CompareLocationTaskDto> compareWcsLocationTask(QueryCompareLocationTaskDto queryCompareLocationTaskDto) { | 560 | public PageUtil<CompareLocationTaskDto> compareWcsLocationTask(QueryCompareLocationTaskDto queryCompareLocationTaskDto) { |
561 | + List<CompareLocationTaskDto> finalCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); | ||
562 | + if (queryCompareLocationTaskDto.getLocationCode() == null) { | ||
563 | + return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | ||
564 | + } | ||
565 | + String queryCreateTime = DateUtil.format(DateUtil.offsetDay(new Date(), -31), DatePattern.NORM_DATE_PATTERN); | ||
578 | // 1.获取WMS任务信息 | 566 | // 1.获取WMS任务信息 |
579 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | 567 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
580 | - | ||
581 | // 只查询近一个月的数据 | 568 | // 只查询近一个月的数据 |
582 | - String queryCreateTime = DateUtil.format(DateUtil.offsetDay(new Date(), -31), DatePattern.NORM_DATE_PATTERN); | ||
583 | - | ||
584 | taskHeaderLambdaQueryWrapper | 569 | taskHeaderLambdaQueryWrapper |
585 | .select(TaskHeader::getId, TaskHeader::getWarehouseCode, TaskHeader::getTaskType, TaskHeader::getFromLocationCode, TaskHeader::getToLocationCode, | 570 | .select(TaskHeader::getId, TaskHeader::getWarehouseCode, TaskHeader::getTaskType, TaskHeader::getFromLocationCode, TaskHeader::getToLocationCode, |
586 | TaskHeader::getContainerCode, TaskHeader::getStatus, TaskHeader::getCreateTime) | 571 | TaskHeader::getContainerCode, TaskHeader::getStatus, TaskHeader::getCreateTime) |
@@ -615,11 +600,10 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -615,11 +600,10 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
615 | 600 | ||
616 | // 对返回数据进行组装 | 601 | // 对返回数据进行组装 |
617 | List<CompareLocationTaskDto> wcsCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); | 602 | List<CompareLocationTaskDto> wcsCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); |
618 | - List<CompareLocationTaskDto> finalCompareLocationTaskList = new ArrayList<CompareLocationTaskDto>(); | ||
619 | - if (taskHeaderList != null && taskHeaderList.size() > 0) { | 603 | + if (!CollectionUtils.isEmpty(taskHeaderList)) { |
620 | for (TaskHeader taskHeader : taskHeaderList) { | 604 | for (TaskHeader taskHeader : taskHeaderList) { |
621 | List<WcsTaskDto> wcsTaskDtoList = wcsTaskMap.get(taskHeader.getId()); | 605 | List<WcsTaskDto> wcsTaskDtoList = wcsTaskMap.get(taskHeader.getId()); |
622 | - if (wcsTaskDtoList != null && wcsTaskDtoList.size() > 0) { | 606 | + if (!CollectionUtils.isEmpty(wcsTaskDtoList)) { |
623 | CompareLocationTaskDto compareLocationTaskDto = new CompareLocationTaskDto(); | 607 | CompareLocationTaskDto compareLocationTaskDto = new CompareLocationTaskDto(); |
624 | // 组装WMS数据 | 608 | // 组装WMS数据 |
625 | compareLocationTaskDto.setWmsId(taskHeader.getId()); | 609 | compareLocationTaskDto.setWmsId(taskHeader.getId()); |
@@ -660,7 +644,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -660,7 +644,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
660 | } | 644 | } |
661 | // 组装wcs自己的任务 | 645 | // 组装wcs自己的任务 |
662 | List<WcsTaskDto> wcsTaskDtoList = wcsTaskMap.get(0); | 646 | List<WcsTaskDto> wcsTaskDtoList = wcsTaskMap.get(0); |
663 | - if (wcsTaskDtoList != null && wcsTaskDtoList.size() > 0) { | 647 | + if (!CollectionUtils.isEmpty(wcsTaskDtoList)) { |
664 | for (WcsTaskDto wcsTaskDto : wcsTaskDtoList) { | 648 | for (WcsTaskDto wcsTaskDto : wcsTaskDtoList) { |
665 | CompareLocationTaskDto compareLocationTaskDto = new CompareLocationTaskDto(); | 649 | CompareLocationTaskDto compareLocationTaskDto = new CompareLocationTaskDto(); |
666 | // 组装WCS数据 | 650 | // 组装WCS数据 |
@@ -674,13 +658,25 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -674,13 +658,25 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
674 | wcsCompareLocationTaskList.add(compareLocationTaskDto); | 658 | wcsCompareLocationTaskList.add(compareLocationTaskDto); |
675 | } | 659 | } |
676 | } | 660 | } |
677 | - if (finalCompareLocationTaskList.size() > 0) { | 661 | + if (!CollectionUtils.isEmpty(finalCompareLocationTaskList)) { |
678 | Collections.sort(finalCompareLocationTaskList, Comparator.comparing(CompareLocationTaskDto::getWmsId).reversed()); | 662 | Collections.sort(finalCompareLocationTaskList, Comparator.comparing(CompareLocationTaskDto::getWmsId).reversed()); |
679 | } | 663 | } |
680 | - if (wcsCompareLocationTaskList.size() > 0) { | 664 | + if (!CollectionUtils.isEmpty(wcsCompareLocationTaskList)) { |
681 | Collections.sort(wcsCompareLocationTaskList, Comparator.comparing(CompareLocationTaskDto::getWcsId).reversed()); | 665 | Collections.sort(wcsCompareLocationTaskList, Comparator.comparing(CompareLocationTaskDto::getWcsId).reversed()); |
682 | } | 666 | } |
683 | finalCompareLocationTaskList.addAll(wcsCompareLocationTaskList); | 667 | finalCompareLocationTaskList.addAll(wcsCompareLocationTaskList); |
668 | + if (queryCompareLocationTaskDto.getWmsId() != null) { | ||
669 | + finalCompareLocationTaskList = | ||
670 | + finalCompareLocationTaskList.stream().filter(t -> queryCompareLocationTaskDto.getWmsId().equals(t.getWmsId())).collect(Collectors.toList()); | ||
671 | + } | ||
672 | + if (queryCompareLocationTaskDto.getWcsId() != null) { | ||
673 | + finalCompareLocationTaskList = | ||
674 | + finalCompareLocationTaskList.stream().filter(t -> queryCompareLocationTaskDto.getWcsId().equals(t.getWcsId())).collect(Collectors.toList()); | ||
675 | + } | ||
676 | + if (queryCompareLocationTaskDto.getTaskType() != null) { | ||
677 | + finalCompareLocationTaskList = | ||
678 | + finalCompareLocationTaskList.stream().filter(t -> queryCompareLocationTaskDto.getTaskType().equals(t.getTaskType())).collect(Collectors.toList()); | ||
679 | + } | ||
684 | return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); | 680 | return PageUtil.create(finalCompareLocationTaskList, queryCompareLocationTaskDto.getPageNo(), queryCompareLocationTaskDto.getPageSize()); |
685 | } | 681 | } |
686 | 682 |
huaheng-wms-core/src/main/java/org/jeecg/utils/PageUtil.java
@@ -19,25 +19,37 @@ public class PageUtil<T> { | @@ -19,25 +19,37 @@ public class PageUtil<T> { | ||
19 | private int total; | 19 | private int total; |
20 | 20 | ||
21 | /** 集合 */ | 21 | /** 集合 */ |
22 | - private List<T> data; | 22 | + private List<T> records; |
23 | 23 | ||
24 | - private PageUtil(List<T> data, int current, int size) { | ||
25 | - if (data == null || data.isEmpty()) { | ||
26 | - throw new IllegalArgumentException("data is empty"); | ||
27 | - } | 24 | + private PageUtil(List<T> records, int current, int size) { |
28 | this.current = current; | 25 | this.current = current; |
29 | this.size = size; | 26 | this.size = size; |
30 | - this.total = data.size(); | 27 | + if (records == null || records.isEmpty()) { |
28 | + this.records = Collections.emptyList(); | ||
29 | + return; | ||
30 | + } | ||
31 | + this.total = records.size(); | ||
31 | int fromIndex = (current - 1) * size; | 32 | int fromIndex = (current - 1) * size; |
32 | - if (fromIndex >= data.size()) { | ||
33 | - this.data = Collections.emptyList(); | 33 | + if (fromIndex >= records.size()) { |
34 | + this.records = Collections.emptyList(); | ||
34 | return; | 35 | return; |
35 | } | 36 | } |
36 | int toIndex = current * size; | 37 | int toIndex = current * size; |
37 | - if (toIndex >= data.size()) { | ||
38 | - toIndex = data.size(); | 38 | + if (toIndex >= records.size()) { |
39 | + toIndex = records.size(); | ||
39 | } | 40 | } |
40 | - this.data = data.subList(fromIndex, toIndex); | 41 | + this.records = records.subList(fromIndex, toIndex); |
42 | + } | ||
43 | + | ||
44 | + private PageUtil(List<T> records, int current, int size, int total) { | ||
45 | + this.current = current; | ||
46 | + this.size = size; | ||
47 | + this.total = total; | ||
48 | + if (records == null || records.isEmpty()) { | ||
49 | + this.records = Collections.emptyList(); | ||
50 | + return; | ||
51 | + } | ||
52 | + this.records = records; | ||
41 | } | 53 | } |
42 | 54 | ||
43 | /** | 55 | /** |
@@ -50,4 +62,8 @@ public class PageUtil<T> { | @@ -50,4 +62,8 @@ public class PageUtil<T> { | ||
50 | public static <T> PageUtil<T> create(List<T> data, int current, int size) { | 62 | public static <T> PageUtil<T> create(List<T> data, int current, int size) { |
51 | return new PageUtil<T>(data, current, size); | 63 | return new PageUtil<T>(data, current, size); |
52 | } | 64 | } |
65 | + | ||
66 | + public static <T> PageUtil<T> create(List<T> data, int current, int size, int total) { | ||
67 | + return new PageUtil<T>(data, current, size, total); | ||
68 | + } | ||
53 | } | 69 | } |
huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java
@@ -22,6 +22,7 @@ import org.aspectj.lang.annotation.Pointcut; | @@ -22,6 +22,7 @@ import org.aspectj.lang.annotation.Pointcut; | ||
22 | import org.aspectj.lang.reflect.MethodSignature; | 22 | import org.aspectj.lang.reflect.MethodSignature; |
23 | import org.jeecg.JeecgSystemApplication; | 23 | import org.jeecg.JeecgSystemApplication; |
24 | import org.jeecg.common.api.vo.Result; | 24 | import org.jeecg.common.api.vo.Result; |
25 | +import org.jeecg.modules.wms.config.address.entity.Address; | ||
25 | import org.jeecg.modules.wms.config.address.service.IAddressService; | 26 | import org.jeecg.modules.wms.config.address.service.IAddressService; |
26 | import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; | 27 | import org.jeecg.modules.wms.monitor.apiLog.entity.ApiLog; |
27 | import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService; | 28 | import org.jeecg.modules.wms.monitor.apiLog.service.IApiLogService; |
@@ -29,6 +30,7 @@ import org.jeecg.utils.ServletUtils; | @@ -29,6 +30,7 @@ import org.jeecg.utils.ServletUtils; | ||
29 | import org.jeecg.utils.SpringUtils; | 30 | import org.jeecg.utils.SpringUtils; |
30 | import org.jeecg.utils.StringUtils; | 31 | import org.jeecg.utils.StringUtils; |
31 | import org.jeecg.utils.config.ApplicationConfig; | 32 | import org.jeecg.utils.config.ApplicationConfig; |
33 | +import org.jeecg.utils.constant.QuantityConstant; | ||
32 | import org.jeecg.utils.support.ApiLogger; | 34 | import org.jeecg.utils.support.ApiLogger; |
33 | import org.springframework.beans.factory.annotation.Autowired; | 35 | import org.springframework.beans.factory.annotation.Autowired; |
34 | import org.springframework.scheduling.annotation.Async; | 36 | import org.springframework.scheduling.annotation.Async; |
@@ -300,8 +302,8 @@ public class ApiLoggerAspect { | @@ -300,8 +302,8 @@ public class ApiLoggerAspect { | ||
300 | apiLog.setApiName(apiName); | 302 | apiLog.setApiName(apiName); |
301 | apiLog.setRequestFrom(HUAHENG_SYSTEM_NAME); | 303 | apiLog.setRequestFrom(HUAHENG_SYSTEM_NAME); |
302 | apiLog.setIp(ip); | 304 | apiLog.setIp(ip); |
303 | -// Address address = addressService.getAddressByUrl(url.toString(), QuantityConstant.DEFAULT_WAREHOUSE); | ||
304 | -// apiLog.setResponseBy(address.getParam().toUpperCase()); | 305 | + Address address = addressService.getAddressByUrl(url.toString()); |
306 | + apiLog.setResponseBy(address.getParam().toUpperCase()); | ||
305 | } catch (Exception e) { | 307 | } catch (Exception e) { |
306 | e.printStackTrace(); | 308 | e.printStackTrace(); |
307 | } | 309 | } |