Commit 631837676119f166bfd2de315a9f8114f7a2a550
1 parent
57cae75a
库位比较功能提交(5)
Signed-off-by: TanYibin <5491541@qq.com>
Showing
6 changed files
with
278 additions
and
116 deletions
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocation.vue
@@ -15,11 +15,11 @@ | @@ -15,11 +15,11 @@ | ||
15 | </a-form-item> | 15 | </a-form-item> |
16 | </a-col> | 16 | </a-col> |
17 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> | 17 | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
18 | - <a-form-item label="库位状态"> | 18 | + <a-form-item label="数据一致性状态"> |
19 | <j-dict-select-tag | 19 | <j-dict-select-tag |
20 | - placeholder="请选择库位状态" | ||
21 | - v-model="queryParam.locationStatus" | ||
22 | - dictCode="location_status" | 20 | + placeholder="请选择数据一致性状态" |
21 | + v-model="queryParam.consistencyStatus" | ||
22 | + dictCode="consistency_status" | ||
23 | /> | 23 | /> |
24 | </a-form-item> | 24 | </a-form-item> |
25 | </a-col> | 25 | </a-col> |
@@ -51,9 +51,31 @@ | @@ -51,9 +51,31 @@ | ||
51 | :customRow="clickThenSelect" | 51 | :customRow="clickThenSelect" |
52 | @change="handleTableChange" | 52 | @change="handleTableChange" |
53 | > | 53 | > |
54 | + <span slot="locationStatus" slot-scope="locationStatus"> | ||
55 | + <a-tag :key="locationStatus"> | ||
56 | + {{ solutionLocationStatus(locationStatus) }} | ||
57 | + </a-tag> | ||
58 | + </span> | ||
59 | + | ||
60 | + <span slot="containerStatus" slot-scope="containerStatus"> | ||
61 | + <a-tag :key="containerStatus"> | ||
62 | + {{ solutionContainerStatus(containerStatus) }} | ||
63 | + </a-tag> | ||
64 | + </span> | ||
65 | + | ||
66 | + <span slot="wcsLocationStatus" slot-scope="wcsLocationStatus"> | ||
67 | + <a-tag :key="wcsLocationStatus"> | ||
68 | + {{ solutionWcsLocationStatus(wcsLocationStatus) }} | ||
69 | + </a-tag> | ||
70 | + </span> | ||
71 | + | ||
72 | + <span slot="consistencyStatus" slot-scope="consistencyStatus"> | ||
73 | + <a-tag :key="consistencyStatus" :color="solutionPurchaseColor(consistencyStatus)"> | ||
74 | + {{ solutionConsistencyStatus(consistencyStatus) }} | ||
75 | + </a-tag> | ||
76 | + </span> | ||
54 | </a-table> | 77 | </a-table> |
55 | </div> | 78 | </div> |
56 | - | ||
57 | <a-tabs defaultActiveKey="1"> | 79 | <a-tabs defaultActiveKey="1"> |
58 | <a-tab-pane tab="库位任务详情" key="1"> | 80 | <a-tab-pane tab="库位任务详情" key="1"> |
59 | <CompareWcsLocationTask :mainId="selectedMainId" /> | 81 | <CompareWcsLocationTask :mainId="selectedMainId" /> |
@@ -64,12 +86,11 @@ | @@ -64,12 +86,11 @@ | ||
64 | 86 | ||
65 | <script> | 87 | <script> |
66 | import '@/assets/less/TableExpand.less' | 88 | import '@/assets/less/TableExpand.less' |
67 | -import { mixinDevice } from '@/utils/mixin' | ||
68 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' | 89 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
69 | import { getAction } from '@/api/manage' | 90 | import { getAction } from '@/api/manage' |
70 | import CompareWcsLocationTask from './CompareWcsLocationTask' | 91 | import CompareWcsLocationTask from './CompareWcsLocationTask' |
71 | import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' | 92 | import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
72 | -import { compareWcsLocation } from '@/api/api' | 93 | +import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' |
73 | 94 | ||
74 | export default { | 95 | export default { |
75 | name: 'CompareWcsLocation', | 96 | name: 'CompareWcsLocation', |
@@ -81,6 +102,10 @@ export default { | @@ -81,6 +102,10 @@ export default { | ||
81 | return { | 102 | return { |
82 | description: '库位信息比较页面', | 103 | description: '库位信息比较页面', |
83 | querySource: {}, | 104 | querySource: {}, |
105 | + locationStatusList: [], | ||
106 | + containerStatusList: [], | ||
107 | + wcsLocationStatusList: [], | ||
108 | + consistencyStatusList: [], | ||
84 | // 表头 | 109 | // 表头 |
85 | columns: [ | 110 | columns: [ |
86 | { | 111 | { |
@@ -94,48 +119,52 @@ export default { | @@ -94,48 +119,52 @@ export default { | ||
94 | dataIndex: 'locationContainerCode' | 119 | dataIndex: 'locationContainerCode' |
95 | }, | 120 | }, |
96 | { | 121 | { |
97 | - title: '库位表状态', | ||
98 | - align: 'center', | ||
99 | - // dataIndex: 'locationStatus_dictText' | ||
100 | - dataIndex: 'locationStatus' | ||
101 | - }, | ||
102 | - { | ||
103 | title: '托盘表容器编码', | 122 | title: '托盘表容器编码', |
104 | align: 'center', | 123 | align: 'center', |
105 | dataIndex: 'containerContainerCode' | 124 | dataIndex: 'containerContainerCode' |
106 | }, | 125 | }, |
107 | { | 126 | { |
108 | - title: '托盘表状态', | 127 | + title: '库存表容器编码', |
109 | align: 'center', | 128 | align: 'center', |
110 | - dataIndex: 'containerStatus' | 129 | + dataIndex: 'inventoryContainerCode' |
111 | }, | 130 | }, |
112 | { | 131 | { |
113 | - title: '库存表容器编码', | 132 | + title: 'WCS库位表容器编码', |
114 | align: 'center', | 133 | align: 'center', |
115 | - dataIndex: 'inventoryContainerCode' | 134 | + dataIndex: 'wcsContainerCode' |
116 | }, | 135 | }, |
117 | { | 136 | { |
118 | - title: '库存表状态', | 137 | + title: '库位表状态', |
119 | align: 'center', | 138 | align: 'center', |
120 | - dataIndex: 'inventoryStatus' | 139 | + dataIndex: 'locationStatus', |
140 | + key: 'locationStatus', | ||
141 | + scopedSlots: { customRender: 'locationStatus' } | ||
121 | }, | 142 | }, |
122 | { | 143 | { |
123 | - title: 'WCS库位表容器编码', | 144 | + title: '托盘表状态', |
124 | align: 'center', | 145 | align: 'center', |
125 | - dataIndex: 'wcsContainerCode' | 146 | + dataIndex: 'containerStatus', |
147 | + key: 'containerStatus', | ||
148 | + scopedSlots: { customRender: 'containerStatus' } | ||
126 | }, | 149 | }, |
127 | { | 150 | { |
128 | title: 'WCS库位表状态', | 151 | title: 'WCS库位表状态', |
129 | align: 'center', | 152 | align: 'center', |
130 | - dataIndex: 'wcsLocationStatus' | 153 | + dataIndex: 'wcsLocationStatus', |
154 | + key: 'wcsLocationStatus', | ||
155 | + scopedSlots: { customRender: 'wcsLocationStatus' } | ||
156 | + }, | ||
157 | + { | ||
158 | + title: '数据一致性状态', | ||
159 | + align: 'center', | ||
160 | + dataIndex: 'consistencyStatus', | ||
161 | + key: 'consistencyStatus', | ||
162 | + scopedSlots: { customRender: 'consistencyStatus' } | ||
131 | } | 163 | } |
132 | ], | 164 | ], |
133 | url: { | 165 | url: { |
134 | list: '/config/location/compareWcsLocation' | 166 | list: '/config/location/compareWcsLocation' |
135 | }, | 167 | }, |
136 | - dictOptions: { | ||
137 | - locationStatus: [] | ||
138 | - }, | ||
139 | /* 分页参数 */ | 168 | /* 分页参数 */ |
140 | ipagination: { | 169 | ipagination: { |
141 | current: 1, | 170 | current: 1, |
@@ -153,14 +182,103 @@ export default { | @@ -153,14 +182,103 @@ export default { | ||
153 | } | 182 | } |
154 | }, | 183 | }, |
155 | created() { | 184 | created() { |
156 | - this.getSuperFieldList() | ||
157 | - }, | ||
158 | - computed: { | ||
159 | - importExcelUrl: function() { | ||
160 | - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` | ||
161 | - } | 185 | + this.initDictData() |
162 | }, | 186 | }, |
163 | methods: { | 187 | methods: { |
188 | + //优先从缓存中读取字典配置 | ||
189 | + initDictData() { | ||
190 | + // 获取 location_status | ||
191 | + if (getDictItemsFromCache('location_status')) { | ||
192 | + this.locationStatusList = getDictItemsFromCache('location_status') | ||
193 | + } else { | ||
194 | + //根据字典Code, 初始化字典数组 | ||
195 | + ajaxGetDictItems('location_status', null).then(res => { | ||
196 | + if (res.success) { | ||
197 | + this.locationStatusList = res.result | ||
198 | + } | ||
199 | + }) | ||
200 | + } | ||
201 | + // 获取 container_status | ||
202 | + if (getDictItemsFromCache('container_status')) { | ||
203 | + this.containerStatusList = getDictItemsFromCache('container_status') | ||
204 | + } else { | ||
205 | + //根据字典Code, 初始化字典数组 | ||
206 | + ajaxGetDictItems('container_status', null).then(res => { | ||
207 | + if (res.success) { | ||
208 | + this.containerStatusList = res.result | ||
209 | + } | ||
210 | + }) | ||
211 | + } | ||
212 | + // 获取 wcs_location_status | ||
213 | + if (getDictItemsFromCache('wcs_location_status')) { | ||
214 | + this.wcsLocationStatusList = getDictItemsFromCache('wcs_location_status') | ||
215 | + } else { | ||
216 | + //根据字典Code, 初始化字典数组 | ||
217 | + ajaxGetDictItems('wcs_location_status', null).then(res => { | ||
218 | + if (res.success) { | ||
219 | + this.wcsLocationStatusList = res.result | ||
220 | + } | ||
221 | + }) | ||
222 | + } | ||
223 | + // 获取 consistency_status | ||
224 | + if (getDictItemsFromCache('consistency_status')) { | ||
225 | + this.consistencyStatusList = getDictItemsFromCache('consistency_status') | ||
226 | + } else { | ||
227 | + //根据字典Code, 初始化字典数组 | ||
228 | + ajaxGetDictItems('consistency_status', null).then(res => { | ||
229 | + if (res.success) { | ||
230 | + this.consistencyStatusList = res.result | ||
231 | + } | ||
232 | + }) | ||
233 | + } | ||
234 | + }, | ||
235 | + solutionLocationStatus(value) { | ||
236 | + var actions = [] | ||
237 | + Object.keys(this.locationStatusList).some(key => { | ||
238 | + if (this.locationStatusList[key].value == '' + value) { | ||
239 | + actions.push(this.locationStatusList[key].text) | ||
240 | + return true | ||
241 | + } | ||
242 | + }) | ||
243 | + return actions.join('') | ||
244 | + }, | ||
245 | + solutionContainerStatus(value) { | ||
246 | + var actions = [] | ||
247 | + Object.keys(this.containerStatusList).some(key => { | ||
248 | + if (this.containerStatusList[key].value == '' + value) { | ||
249 | + actions.push(this.containerStatusList[key].text) | ||
250 | + return true | ||
251 | + } | ||
252 | + }) | ||
253 | + return actions.join('') | ||
254 | + }, | ||
255 | + solutionWcsLocationStatus(value) { | ||
256 | + var actions = [] | ||
257 | + Object.keys(this.wcsLocationStatusList).some(key => { | ||
258 | + if (this.wcsLocationStatusList[key].value == '' + value) { | ||
259 | + actions.push(this.wcsLocationStatusList[key].text) | ||
260 | + return true | ||
261 | + } | ||
262 | + }) | ||
263 | + return actions.join('') | ||
264 | + }, | ||
265 | + solutionConsistencyStatus(value) { | ||
266 | + var actions = [] | ||
267 | + Object.keys(this.consistencyStatusList).some(key => { | ||
268 | + if (this.consistencyStatusList[key].value == '' + value) { | ||
269 | + actions.push(this.consistencyStatusList[key].text) | ||
270 | + return true | ||
271 | + } | ||
272 | + }) | ||
273 | + return actions.join('') | ||
274 | + }, | ||
275 | + solutionPurchaseColor(value) { | ||
276 | + var color = 'blue' | ||
277 | + if (0 == value) { | ||
278 | + color = 'red' | ||
279 | + } | ||
280 | + return color | ||
281 | + }, | ||
164 | initDictConfig() {}, | 282 | initDictConfig() {}, |
165 | clickThenSelect(record) { | 283 | clickThenSelect(record) { |
166 | return { | 284 | return { |
@@ -181,19 +299,6 @@ export default { | @@ -181,19 +299,6 @@ export default { | ||
181 | this.selectedRowKeys = selectedRowKeys | 299 | this.selectedRowKeys = selectedRowKeys |
182 | this.selectionRows = selectionRows | 300 | this.selectionRows = selectionRows |
183 | }, | 301 | }, |
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) { | 302 | loadData(arg) { |
198 | if (!this.url.list) { | 303 | if (!this.url.list) { |
199 | this.$message.error('请设置url.list属性!') | 304 | this.$message.error('请设置url.list属性!') |
@@ -216,19 +321,6 @@ export default { | @@ -216,19 +321,6 @@ export default { | ||
216 | } | 321 | } |
217 | this.loading = false | 322 | this.loading = false |
218 | }) | 323 | }) |
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 | } | 324 | } |
233 | } | 325 | } |
234 | } | 326 | } |
ant-design-vue-jeecg/src/views/system/compare/CompareWcsLocationTask.vue
@@ -44,6 +44,17 @@ | @@ -44,6 +44,17 @@ | ||
44 | :loading="loading" | 44 | :loading="loading" |
45 | @change="handleTableChange" | 45 | @change="handleTableChange" |
46 | > | 46 | > |
47 | + <span slot="taskType" slot-scope="taskType"> | ||
48 | + <a-tag :key="taskType"> | ||
49 | + {{ solutionTaskType(taskType) }} | ||
50 | + </a-tag> | ||
51 | + </span> | ||
52 | + | ||
53 | + <span slot="taskStatus" slot-scope="taskStatus"> | ||
54 | + <a-tag :key="taskStatus"> | ||
55 | + {{ solutionTaskStatus(taskStatus) }} | ||
56 | + </a-tag> | ||
57 | + </span> | ||
47 | </a-table> | 58 | </a-table> |
48 | </div> | 59 | </div> |
49 | </a-card> | 60 | </a-card> |
@@ -51,6 +62,7 @@ | @@ -51,6 +62,7 @@ | ||
51 | <script> | 62 | <script> |
52 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' | 63 | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
53 | import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' | 64 | import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil' |
65 | +import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' | ||
54 | 66 | ||
55 | export default { | 67 | export default { |
56 | name: 'CompareWcsLocationTask', | 68 | name: 'CompareWcsLocationTask', |
@@ -80,6 +92,8 @@ export default { | @@ -80,6 +92,8 @@ export default { | ||
80 | return { | 92 | return { |
81 | description: '库位任务信息比较页面', | 93 | description: '库位任务信息比较页面', |
82 | disableMixinCreated: true, | 94 | disableMixinCreated: true, |
95 | + taskTypeList: [], | ||
96 | + taskStatusList: [], | ||
83 | // 表头 | 97 | // 表头 |
84 | columns: [ | 98 | columns: [ |
85 | { | 99 | { |
@@ -95,7 +109,9 @@ export default { | @@ -95,7 +109,9 @@ export default { | ||
95 | { | 109 | { |
96 | title: 'WMS任务类型', | 110 | title: 'WMS任务类型', |
97 | align: 'center', | 111 | align: 'center', |
98 | - dataIndex: 'taskType_dictText' | 112 | + dataIndex: 'taskType', |
113 | + key: 'taskType', | ||
114 | + scopedSlots: { customRender: 'taskType' } | ||
99 | }, | 115 | }, |
100 | { | 116 | { |
101 | title: '源库位', | 117 | title: '源库位', |
@@ -130,7 +146,9 @@ export default { | @@ -130,7 +146,9 @@ export default { | ||
130 | { | 146 | { |
131 | title: '任务状态', | 147 | title: '任务状态', |
132 | align: 'center', | 148 | align: 'center', |
133 | - dataIndex: 'taskStatus' | 149 | + dataIndex: 'taskStatus', |
150 | + key: 'taskStatus', | ||
151 | + scopedSlots: { customRender: 'taskStatus' } | ||
134 | }, | 152 | }, |
135 | { | 153 | { |
136 | title: 'WCS任务状态', | 154 | title: 'WCS任务状态', |
@@ -157,30 +175,62 @@ export default { | @@ -157,30 +175,62 @@ export default { | ||
157 | } | 175 | } |
158 | }, | 176 | }, |
159 | created() { | 177 | created() { |
160 | - this.getSuperFieldList() | ||
161 | - this.loadFrom() | 178 | + this.initDictData() |
162 | }, | 179 | }, |
163 | methods: { | 180 | methods: { |
181 | + initDictData() { | ||
182 | + // 获取 location_status | ||
183 | + if (getDictItemsFromCache('task_type')) { | ||
184 | + this.taskTypeList = getDictItemsFromCache('task_type') | ||
185 | + } else { | ||
186 | + //根据字典Code, 初始化字典数组 | ||
187 | + ajaxGetDictItems('task_type', null).then(res => { | ||
188 | + if (res.success) { | ||
189 | + this.taskTypeList = res.result | ||
190 | + } | ||
191 | + }) | ||
192 | + } | ||
193 | + if (getDictItemsFromCache('task_header_status')) { | ||
194 | + this.taskStatusList = getDictItemsFromCache('task_header_status') | ||
195 | + } else { | ||
196 | + //根据字典Code, 初始化字典数组 | ||
197 | + ajaxGetDictItems('task_header_status', null).then(res => { | ||
198 | + if (res.success) { | ||
199 | + this.taskStatusList = res.result | ||
200 | + } | ||
201 | + }) | ||
202 | + } | ||
203 | + }, | ||
164 | clearList() { | 204 | clearList() { |
165 | this.dataSource = [] | 205 | this.dataSource = [] |
166 | this.selectedRowKeys = [] | 206 | this.selectedRowKeys = [] |
167 | this.ipagination.current = 1 | 207 | this.ipagination.current = 1 |
168 | }, | 208 | }, |
209 | + solutionTaskType(value) { | ||
210 | + var actions = [] | ||
211 | + Object.keys(this.taskTypeList).some(key => { | ||
212 | + if (this.taskTypeList[key].value == '' + value) { | ||
213 | + actions.push(this.taskTypeList[key].text) | ||
214 | + return true | ||
215 | + } | ||
216 | + }) | ||
217 | + return actions.join('') | ||
218 | + }, | ||
219 | + solutionTaskStatus(value) { | ||
220 | + var actions = [] | ||
221 | + Object.keys(this.taskStatusList).some(key => { | ||
222 | + if (this.taskStatusList[key].value == '' + value) { | ||
223 | + actions.push(this.taskStatusList[key].text) | ||
224 | + return true | ||
225 | + } | ||
226 | + }) | ||
227 | + return actions.join('') | ||
228 | + }, | ||
169 | searchReset() { | 229 | searchReset() { |
170 | var locationCode = this.queryParam['locationCode'] | 230 | var locationCode = this.queryParam['locationCode'] |
171 | this.queryParam = {} | 231 | this.queryParam = {} |
172 | this.queryParam['locationCode'] = locationCode | 232 | this.queryParam['locationCode'] = locationCode |
173 | this.loadData(1) | 233 | 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 | } | 234 | } |
185 | } | 235 | } |
186 | } | 236 | } |
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 | - | ||
6 | import lombok.Data; | 3 | import lombok.Data; |
7 | 4 | ||
8 | /** | 5 | /** |
@@ -12,7 +9,7 @@ import lombok.Data; | @@ -12,7 +9,7 @@ import lombok.Data; | ||
12 | */ | 9 | */ |
13 | @Data | 10 | @Data |
14 | public class CompareLocationDto { | 11 | public class CompareLocationDto { |
15 | - | 12 | + |
16 | /** 仓库编码 */ | 13 | /** 仓库编码 */ |
17 | private String warehouseCode; | 14 | private String warehouseCode; |
18 | 15 | ||
@@ -21,27 +18,29 @@ public class CompareLocationDto { | @@ -21,27 +18,29 @@ public class CompareLocationDto { | ||
21 | 18 | ||
22 | /** 库位表容器编码 */ | 19 | /** 库位表容器编码 */ |
23 | private String locationContainerCode; | 20 | private String locationContainerCode; |
24 | - | 21 | + |
25 | /** 库位表状态 */ | 22 | /** 库位表状态 */ |
26 | - @Dict(dicCode = "location_status") | ||
27 | private String locationStatus; | 23 | private String locationStatus; |
28 | 24 | ||
29 | /** 托盘表容器编码 */ | 25 | /** 托盘表容器编码 */ |
30 | private String containerContainerCode; | 26 | private String containerContainerCode; |
31 | - | 27 | + |
32 | /** 托盘表状态 */ | 28 | /** 托盘表状态 */ |
33 | private String containerStatus; | 29 | private String containerStatus; |
34 | 30 | ||
35 | /** 库存表容器编码 */ | 31 | /** 库存表容器编码 */ |
36 | private String inventoryContainerCode; | 32 | private String inventoryContainerCode; |
37 | - | 33 | + |
38 | /** 库存表状态 */ | 34 | /** 库存表状态 */ |
39 | private String inventoryStatus; | 35 | private String inventoryStatus; |
40 | 36 | ||
41 | /** WCS库位容器编码 */ | 37 | /** WCS库位容器编码 */ |
42 | private String wcsContainerCode; | 38 | private String wcsContainerCode; |
43 | - | 39 | + |
44 | /** WCS库位表状态 */ | 40 | /** WCS库位表状态 */ |
45 | private String wcsLocationStatus; | 41 | private String wcsLocationStatus; |
46 | - | 42 | + |
43 | + /** 数据一致性状态 */ | ||
44 | + private Integer consistencyStatus = 1; | ||
45 | + | ||
47 | } | 46 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/QueryCompareLocationDto.java
@@ -14,8 +14,8 @@ public class QueryCompareLocationDto { | @@ -14,8 +14,8 @@ public class QueryCompareLocationDto { | ||
14 | /** 托盘编码 */ | 14 | /** 托盘编码 */ |
15 | private String containerCode; | 15 | private String containerCode; |
16 | 16 | ||
17 | - /** 库位状态 */ | ||
18 | - private String locationStatus; | 17 | + /** 数据一致性状态 */ |
18 | + private Integer consistencyStatus; | ||
19 | 19 | ||
20 | /** 页码 */ | 20 | /** 页码 */ |
21 | private Integer pageNo = 1; | 21 | private Integer pageNo = 1; |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/dto/WcsLocationDto.java
@@ -23,6 +23,18 @@ public class WcsLocationDto { | @@ -23,6 +23,18 @@ public class WcsLocationDto { | ||
23 | private Integer roadWay; | 23 | private Integer roadWay; |
24 | 24 | ||
25 | /** 库位状态 */ | 25 | /** 库位状态 */ |
26 | - private Integer status; | 26 | + private String status; |
27 | + | ||
28 | + public void setStatus(Integer status) { | ||
29 | + if (status != null && status.equals(0)) { | ||
30 | + this.status = "empty"; | ||
31 | + } | ||
32 | + if (status != null && status.equals(10)) { | ||
33 | + this.status = "lock"; | ||
34 | + } | ||
35 | + if (status != null && status.equals(30)) { | ||
36 | + this.status = "disable"; | ||
37 | + } | ||
38 | + } | ||
27 | 39 | ||
28 | } | 40 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
@@ -60,6 +60,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | @@ -60,6 +60,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
60 | 60 | ||
61 | import cn.hutool.core.date.DatePattern; | 61 | import cn.hutool.core.date.DatePattern; |
62 | import cn.hutool.core.date.DateUtil; | 62 | import cn.hutool.core.date.DateUtil; |
63 | +import cn.hutool.core.util.ObjectUtil; | ||
63 | 64 | ||
64 | /** | 65 | /** |
65 | * @Description: 库位管理 | 66 | * @Description: 库位管理 |
@@ -462,41 +463,39 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -462,41 +463,39 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
462 | locationLambdaQueryWrapper.select(Location::getWarehouseCode, Location::getCode, Location::getContainerCode, Location::getStatus) | 463 | locationLambdaQueryWrapper.select(Location::getWarehouseCode, Location::getCode, Location::getContainerCode, Location::getStatus) |
463 | .eq(Location::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) | 464 | .eq(Location::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()) |
464 | .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), Location::getCode, queryCompareLocationDto.getLocationCode()) | 465 | .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getLocationCode()), Location::getCode, queryCompareLocationDto.getLocationCode()) |
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())); | ||
471 | - } | ||
472 | - | ||
473 | - // 2.获取WMS托盘表库位信息 | ||
474 | - LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
475 | - containerLambdaQueryWrapper.select(Container::getWarehouseCode, Container::getLocationCode, Container::getCode, Container::getStatus) | ||
476 | - .eq(Container::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(Container::getLocationCode, locationCodes); | ||
477 | - List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | ||
478 | - if (!CollectionUtils.isEmpty(containerList)) { | ||
479 | - containerMap.putAll(containerList.stream().collect(Collectors.groupingBy(Container::getLocationCode))); | ||
480 | - } | ||
481 | - | ||
482 | - // 3.获取WMS库存表库位信息 | ||
483 | - LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
484 | - inventoryDetailLambdaQueryWrapper | ||
485 | - .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, InventoryDetail::getInventoryStatus) | ||
486 | - .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(InventoryDetail::getLocationCode, locationCodes); | ||
487 | - List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | ||
488 | - if (!CollectionUtils.isEmpty(inventoryDetailList)) { | ||
489 | - inventoryDetailMap.putAll(inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getLocationCode))); | ||
490 | - } | ||
491 | - | ||
492 | - // 4.获取WCS库位信息 | 466 | + .eq(StringUtils.isNotEmpty(queryCompareLocationDto.getContainerCode()), Location::getContainerCode, queryCompareLocationDto.getContainerCode()); |
467 | + List<Location> locationList = list(locationLambdaQueryWrapper); | ||
468 | + if (!CollectionUtils.isEmpty(locationList)) { | ||
469 | + locationMap.putAll(locationList.stream().collect(Collectors.toMap(Location::getCode, Function.identity(), (key1, key2) -> key2))); | ||
470 | + locationCodes.addAll(locationList.stream().map(t -> t.getCode()).collect(Collectors.toSet())); | ||
471 | + } | ||
472 | + | ||
493 | if (!CollectionUtils.isEmpty(locationCodes)) { | 473 | if (!CollectionUtils.isEmpty(locationCodes)) { |
474 | + // 2.获取WMS托盘表库位信息 | ||
475 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
476 | + containerLambdaQueryWrapper.select(Container::getWarehouseCode, Container::getLocationCode, Container::getCode, Container::getStatus) | ||
477 | + .eq(Container::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(Container::getLocationCode, locationCodes); | ||
478 | + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); | ||
479 | + if (!CollectionUtils.isEmpty(containerList)) { | ||
480 | + containerMap.putAll(containerList.stream().collect(Collectors.groupingBy(Container::getLocationCode))); | ||
481 | + } | ||
482 | + | ||
483 | + // 3.获取WMS库存表库位信息 | ||
484 | + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | ||
485 | + inventoryDetailLambdaQueryWrapper | ||
486 | + .select(InventoryDetail::getWarehouseCode, InventoryDetail::getLocationCode, InventoryDetail::getContainerCode, InventoryDetail::getInventoryStatus) | ||
487 | + .eq(InventoryDetail::getWarehouseCode, queryCompareLocationDto.getWarehouseCode()).in(InventoryDetail::getLocationCode, locationCodes); | ||
488 | + List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); | ||
489 | + if (!CollectionUtils.isEmpty(inventoryDetailList)) { | ||
490 | + inventoryDetailMap.putAll(inventoryDetailList.stream().collect(Collectors.groupingBy(InventoryDetail::getLocationCode))); | ||
491 | + } | ||
492 | + | ||
493 | + // 4.获取WCS库位信息 | ||
494 | String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_LOCATION_INFO); | 494 | String url = addressService.getUrlByParam(QuantityConstant.ADDRESS_WCS_LOCATION_INFO); |
495 | Map<String, Object> queryParamMap = new HashMap<String, Object>(); | 495 | Map<String, Object> queryParamMap = new HashMap<String, Object>(); |
496 | if (StringUtils.isNotEmpty(queryCompareLocationDto.getWarehouseCode())) { | 496 | if (StringUtils.isNotEmpty(queryCompareLocationDto.getWarehouseCode())) { |
497 | queryParamMap.put("warehouseCode", queryCompareLocationDto.getWarehouseCode()); | 497 | queryParamMap.put("warehouseCode", queryCompareLocationDto.getWarehouseCode()); |
498 | } | 498 | } |
499 | - queryParamMap.put("locations", locationCodes); | ||
500 | String jsonStringResult = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(queryParamMap)); | 499 | String jsonStringResult = OkHttpUtils.sendPostByJsonStr(url, JSON.toJSONString(queryParamMap)); |
501 | WcsResultDto<List<WcsLocationDto>> wcsResult = JSON.parseObject(jsonStringResult, new TypeReference<WcsResultDto<List<WcsLocationDto>>>() {}); | 500 | WcsResultDto<List<WcsLocationDto>> wcsResult = JSON.parseObject(jsonStringResult, new TypeReference<WcsResultDto<List<WcsLocationDto>>>() {}); |
502 | if (wcsResult.getCode() != null && wcsResult.getCode().equals(200)) { | 501 | if (wcsResult.getCode() != null && wcsResult.getCode().equals(200)) { |
@@ -544,16 +543,26 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | @@ -544,16 +543,26 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i | ||
544 | List<WcsLocationDto> wcsLocationGroupList = wcsLocationMap.get(locationCode); | 543 | List<WcsLocationDto> wcsLocationGroupList = wcsLocationMap.get(locationCode); |
545 | if (!CollectionUtils.isEmpty(wcsLocationGroupList)) { | 544 | if (!CollectionUtils.isEmpty(wcsLocationGroupList)) { |
546 | Set<String> wcsContainerCodes = wcsLocationGroupList.stream().map(t -> t.getContainerCode()).collect(Collectors.toSet()); | 545 | 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()); | 546 | + Set<String> wcsContainerStatus = wcsLocationGroupList.stream().map(t -> t.getStatus()).collect(Collectors.toSet()); |
548 | compareLocationDto.setWcsContainerCode(StringUtils.join(wcsContainerCodes, ",")); | 547 | compareLocationDto.setWcsContainerCode(StringUtils.join(wcsContainerCodes, ",")); |
549 | compareLocationDto.setWcsLocationStatus(StringUtils.join(wcsContainerStatus, ",")); | 548 | compareLocationDto.setWcsLocationStatus(StringUtils.join(wcsContainerStatus, ",")); |
550 | } | 549 | } |
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.getContainerStatus()) != 0 | ||
554 | + || ObjectUtil.compare(compareLocationDto.getLocationStatus(), compareLocationDto.getWcsLocationStatus()) != 0) { | ||
555 | + compareLocationDto.setConsistencyStatus(0); | ||
556 | + } | ||
551 | compareLocationDtoList.add(compareLocationDto); | 557 | compareLocationDtoList.add(compareLocationDto); |
552 | } | 558 | } |
559 | + if (queryCompareLocationDto.getConsistencyStatus() != null) { | ||
560 | + compareLocationDtoList = compareLocationDtoList.stream().filter(t -> queryCompareLocationDto.getConsistencyStatus().equals(t.getConsistencyStatus())) | ||
561 | + .collect(Collectors.toList()); | ||
562 | + } | ||
553 | } | 563 | } |
554 | Collections.sort(compareLocationDtoList, Comparator.comparing(CompareLocationDto::getLocationCode)); | 564 | Collections.sort(compareLocationDtoList, Comparator.comparing(CompareLocationDto::getLocationCode)); |
555 | - return PageUtil.create(compareLocationDtoList, new Long(locationPage.getCurrent()).intValue(), new Long(locationPage.getSize()).intValue(), | ||
556 | - new Long(locationPage.getTotal()).intValue()); | 565 | + return PageUtil.create(compareLocationDtoList, queryCompareLocationDto.getPageNo(), queryCompareLocationDto.getPageSize()); |
557 | } | 566 | } |
558 | 567 | ||
559 | @Override | 568 | @Override |