Commit c2fb6ece5d9f0334fc63247dd9859e2e14d6765f
1 parent
97ca1364
合并单据功能完成30%
Signed-off-by: TanYibin <5491541@qq.com>
Showing
9 changed files
with
94 additions
and
41 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -195,6 +195,8 @@ export const combination = (params) => postAction('/shipment/shipmentCombination |
195 | 195 | export const backErpReceipt = (params) => postAction('/receipt/receiptHeader/backErpReceipt', params); |
196 | 196 | //回传出库单 |
197 | 197 | export const backErpShipment = (params) => postAction('/shipment/shipmentHeader/backErpShipment', params); |
198 | +//合并出库单 | |
199 | +export const mergeShipment = (params) => postAction('/shipment/shipmentHeader/mergeShipment', params); | |
198 | 200 | //首页取值 |
199 | 201 | export const deliveringAmount = (params) => postAction("/sys/home/deliveringAmount", params); |
200 | 202 | export const inventoryUtilization = (params) => postAction("/sys/home/inventoryUtilization", params); |
... | ... |
ant-design-vue-jeecg/src/views/system/config/BomHeaderList.vue
... | ... | @@ -107,7 +107,7 @@ |
107 | 107 | </div> |
108 | 108 | |
109 | 109 | <a-tabs defaultActiveKey="1"> |
110 | - <a-tab-pane tab="bom子表" key="1"> | |
110 | + <a-tab-pane tab="BOM详情" key="1"> | |
111 | 111 | <BomDetailList :mainId="selectedMainId"/> |
112 | 112 | </a-tab-pane> |
113 | 113 | </a-tabs> |
... | ... | @@ -136,7 +136,7 @@ export default { |
136 | 136 | data() { |
137 | 137 | return { |
138 | 138 | companyList: [], |
139 | - description: 'bom主表管理页面', | |
139 | + description: 'BOM主表管理页面', | |
140 | 140 | // 表头 |
141 | 141 | columns: [ |
142 | 142 | { |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... | ... | @@ -347,39 +347,38 @@ export default { |
347 | 347 | }, |
348 | 348 | createBatchTask() { |
349 | 349 | if (this.selectedRowKeys.length <= 1) { |
350 | - this.$message.warning('至少选择两条记录!') | |
350 | + this.$message.warning('请选择两条记录!') | |
351 | 351 | return |
352 | - } else { | |
353 | - var receiptContainerHeaderList = [] | |
354 | - var receiptContainerHeader = null | |
355 | - for (var a = 0; a < this.selectedRowKeys.length; a++) { | |
356 | - if (this.selectionRows[a] != null && this.selectionRows[a].status == 0) { | |
357 | - if (receiptContainerHeader == null) { | |
358 | - receiptContainerHeader = this.selectionRows[a] | |
359 | - } | |
360 | - if (receiptContainerHeader.taskType == this.selectionRows[a].taskType) { | |
361 | - receiptContainerHeaderList.push(this.selectionRows[a]) | |
362 | - } | |
352 | + } | |
353 | + var receiptContainerHeaderList = [] | |
354 | + var receiptContainerHeader = null | |
355 | + for (var a = 0; a < this.selectedRowKeys.length; a++) { | |
356 | + if (this.selectionRows[a] != null && this.selectionRows[a].status == 0) { | |
357 | + if (receiptContainerHeader == null) { | |
358 | + receiptContainerHeader = this.selectionRows[a] | |
363 | 359 | } |
364 | - } | |
365 | - if (receiptContainerHeaderList.length > 1) { | |
366 | - if (receiptContainerHeader.taskType == 100) { | |
367 | - createReceiptBatchTask(receiptContainerHeaderList).then(res => { | |
368 | - this.loading = false | |
369 | - if (res.success) { | |
370 | - this.$message.success(res.message) | |
371 | - } else { | |
372 | - this.$message.error(res.message) | |
373 | - } | |
374 | - this.searchQuery() | |
375 | - }) | |
376 | - } else { | |
377 | - this.$refs.modalForm2.batchEdit(receiptContainerHeaderList) | |
378 | - this.$refs.modalForm2.title = '选择出库口' | |
360 | + if (receiptContainerHeader.taskType == this.selectionRows[a].taskType) { | |
361 | + receiptContainerHeaderList.push(this.selectionRows[a]) | |
379 | 362 | } |
363 | + } | |
364 | + } | |
365 | + if (receiptContainerHeaderList.length > 1) { | |
366 | + if (receiptContainerHeader.taskType == 100) { | |
367 | + createReceiptBatchTask(receiptContainerHeaderList).then(res => { | |
368 | + this.loading = false | |
369 | + if (res.success) { | |
370 | + this.$message.success(res.message) | |
371 | + } else { | |
372 | + this.$message.error(res.message) | |
373 | + } | |
374 | + this.searchQuery() | |
375 | + }) | |
380 | 376 | } else { |
381 | - this.$message.error("至少选择两条符合条件的记录!") | |
377 | + this.$refs.modalForm2.batchEdit(receiptContainerHeaderList) | |
378 | + this.$refs.modalForm2.title = '选择出库口' | |
382 | 379 | } |
380 | + } else { | |
381 | + this.$message.error("请选择两条符合条件的记录!") | |
383 | 382 | } |
384 | 383 | }, |
385 | 384 | cancelBatchTask() { |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue
... | ... | @@ -298,7 +298,7 @@ export default { |
298 | 298 | }, |
299 | 299 | createBatchTask() { |
300 | 300 | if (this.selectedRowKeys.length <= 1) { |
301 | - this.$message.warning('至少选择两条记录!') | |
301 | + this.$message.warning('请选择两条记录!') | |
302 | 302 | return |
303 | 303 | } |
304 | 304 | var shipmentContainerHeaderList = [] |
... | ... | @@ -317,7 +317,7 @@ export default { |
317 | 317 | this.$refs.modalForm2.batchEdit(shipmentContainerHeaderList) |
318 | 318 | this.$refs.modalForm2.title = '选择出库口' |
319 | 319 | } else { |
320 | - this.$message.error("至少选择两条符合条件的记录!") | |
320 | + this.$message.error("请选择两条符合条件的记录!") | |
321 | 321 | } |
322 | 322 | }, |
323 | 323 | cancelBatchTask() { |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue
... | ... | @@ -105,7 +105,7 @@ |
105 | 105 | <!-- 操作按钮区域 --> |
106 | 106 | <div class="table-operator"> |
107 | 107 | <a-button v-has="'shipmentHeader:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> |
108 | - <a-button @click="mergeShipment" type="primary" v-has="'shipmentHeader:autoShipmentCombine'">合并单据</a-button> | |
108 | + <a-button v-has="'shipmentHeader:mergeShipment'" @click="mergeShipment" type="primary">合并单据</a-button> | |
109 | 109 | <a-button v-has="'shipmentHeader:export'" type="primary" icon="download" @click="handleExportXls('出库单')">导出</a-button> |
110 | 110 | <a-upload v-has="'shipmentHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
111 | 111 | <a-button type="primary" icon="import">导入</a-button> |
... | ... | @@ -241,7 +241,7 @@ import {getCompanyList, backErpShipment} from '@/api/api' |
241 | 241 | import {getShipmentTypeList} from '@/api/api' |
242 | 242 | import {getCustomerList} from '@/api/api' |
243 | 243 | import {autoCombination} from '@/api/api' |
244 | -import {createShipmentAuditFlow,getDocumentAduitFlow} from '@/api/api' | |
244 | +import {createShipmentAuditFlow, getDocumentAduitFlow, mergeShipment} from '@/api/api' | |
245 | 245 | import store from '@/store' |
246 | 246 | import ShipmentAuditModal from "./modules/ShipmentAuditModal"; |
247 | 247 | import FlowProcess from "../flow/FlowProcess"; |
... | ... | @@ -401,9 +401,8 @@ export default { |
401 | 401 | }, |
402 | 402 | methods: { |
403 | 403 | mergeShipment() { |
404 | - debugger | |
405 | 404 | if (this.selectedRowKeys.length <= 1) { |
406 | - this.$message.warning('至少选择两条记录!') | |
405 | + this.$message.warning('请选择两条记录!') | |
407 | 406 | return |
408 | 407 | } |
409 | 408 | var shipmentHeaderList = [] |
... | ... | @@ -413,10 +412,17 @@ export default { |
413 | 412 | } |
414 | 413 | } |
415 | 414 | if (shipmentHeaderList.length > 0) { |
416 | - this.$refs.modalForm2.batchEdit(shipmentHeaderList) | |
417 | - this.$refs.modalForm2.title = '选择出库口' | |
415 | + mergeShipment(shipmentHeaderList).then(res => { | |
416 | + this.loading = false | |
417 | + if (res.success) { | |
418 | + this.$message.success(res.message) | |
419 | + this.searchQuery() | |
420 | + } else { | |
421 | + this.$message.error(res.message) | |
422 | + } | |
423 | + }) | |
418 | 424 | } else { |
419 | - this.$message.error("至少选择两条符合条件的记录!") | |
425 | + this.$message.error("请选择两条符合条件的记录!") | |
420 | 426 | } |
421 | 427 | }, |
422 | 428 | getDocumentAduitFlowStaus(){ |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -77,10 +77,13 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
77 | 77 | |
78 | 78 | @Autowired |
79 | 79 | private IShipmentDetailService shipmentDetailService; |
80 | + | |
80 | 81 | @Resource |
81 | 82 | private IErpService erpService; |
83 | + | |
82 | 84 | @Resource |
83 | 85 | private IInventoryDetailService inventoryDetailService; |
86 | + | |
84 | 87 | @Resource |
85 | 88 | private IHuahengMultiHandlerService huahengMultiHandlerService; |
86 | 89 | |
... | ... | @@ -120,6 +123,14 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
120 | 123 | return shipmentHeaderService.saveShipmentHeader(shipmentHeader); |
121 | 124 | } |
122 | 125 | |
126 | + @AutoLog(value = "出库单-单据合并") | |
127 | + @ApiOperation(value = "出库单-单据合并", notes = "出库单-单据合并") | |
128 | + @PostMapping(value = "/mergeShipment") | |
129 | + @RequiresPermissions("shipmentHeader:mergeShipment") | |
130 | + public Result<?> mergeShipment(@RequestBody List<ShipmentHeader> shipmentHeaderList, HttpServletRequest req) { | |
131 | + return shipmentHeaderService.mergeShipment(shipmentHeaderList); | |
132 | + } | |
133 | + | |
123 | 134 | /** |
124 | 135 | * 编辑 |
125 | 136 | * @param shipmentHeader |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/IShipmentHeaderService.java
... | ... | @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.shipment.shipmentHeader.service; |
2 | 2 | |
3 | 3 | import java.io.Serializable; |
4 | 4 | import java.util.Collection; |
5 | +import java.util.List; | |
5 | 6 | |
6 | 7 | import org.jeecg.common.api.vo.Result; |
7 | 8 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; |
... | ... | @@ -39,4 +40,6 @@ public interface IShipmentHeaderService extends IService<ShipmentHeader> { |
39 | 40 | public ShipmentHeader getShipmentHeaderByReferCode(String referCode, String warehouseCode); |
40 | 41 | |
41 | 42 | boolean updateFirstStatusAndLastStatusById(Integer firstStatus, Integer lastStatus, int id); |
43 | + | |
44 | + public Result<Object> mergeShipment(List<ShipmentHeader> shipmentHeaderList); | |
42 | 45 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -6,6 +6,7 @@ import java.text.SimpleDateFormat; |
6 | 6 | import java.util.Collection; |
7 | 7 | import java.util.Date; |
8 | 8 | import java.util.List; |
9 | +import java.util.stream.Collectors; | |
9 | 10 | |
10 | 11 | import javax.annotation.Resource; |
11 | 12 | |
... | ... | @@ -50,26 +51,37 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
50 | 51 | |
51 | 52 | @Autowired |
52 | 53 | private ShipmentHeaderMapper shipmentHeaderMapper; |
54 | + | |
53 | 55 | @Autowired |
54 | 56 | private ShipmentDetailMapper shipmentDetailMapper; |
57 | + | |
55 | 58 | @Resource |
56 | 59 | private IShipmentTypeService shipmentTypeService; |
60 | + | |
57 | 61 | @Resource |
58 | 62 | private IShipmentHeaderService shipmentHeaderService; |
63 | + | |
59 | 64 | @Resource |
60 | 65 | private IShipmentDetailService shipmentDetailService; |
66 | + | |
61 | 67 | @Resource |
62 | 68 | private IShipmentContainerDetailService shipmentContainerDetailService; |
69 | + | |
63 | 70 | @Resource |
64 | 71 | private ILocationService locationService; |
72 | + | |
65 | 73 | @Resource |
66 | 74 | private IContainerService containerService; |
75 | + | |
67 | 76 | @Resource |
68 | 77 | private ITaskHeaderService taskHeaderService; |
78 | + | |
69 | 79 | @Resource |
70 | 80 | private IInventoryDetailService inventoryDetailService; |
81 | + | |
71 | 82 | @Resource |
72 | 83 | private IParameterConfigurationService parameterConfigurationService; |
84 | + | |
73 | 85 | @Resource |
74 | 86 | private IShipmentHeaderHistoryService shipmentHeaderHistoryService; |
75 | 87 | |
... | ... | @@ -245,4 +257,24 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
245 | 257 | return success; |
246 | 258 | } |
247 | 259 | |
260 | + @Override | |
261 | + public Result<Object> mergeShipment(List<ShipmentHeader> shipmentHeaderList) { | |
262 | + LambdaQueryWrapper<ShipmentHeader> shipmentHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
263 | + shipmentHeaderLambdaQueryWrapper.in(ShipmentHeader::getCode, shipmentHeaderList.stream().map(ShipmentHeader::getCode).collect(Collectors.toList())); | |
264 | + List<ShipmentHeader> mergeShipmentList = shipmentHeaderService.list(shipmentHeaderLambdaQueryWrapper); | |
265 | + if (shipmentHeaderList.size() != mergeShipmentList.size()) { | |
266 | + return Result.error("未知错误"); | |
267 | + } | |
268 | + if (mergeShipmentList.stream().map(ShipmentHeader::getCompanyCode).distinct().count() > 1) { | |
269 | + return Result.error("货主信息不一致"); | |
270 | + } | |
271 | + if (mergeShipmentList.stream().map(ShipmentHeader::getType).distinct().count() > 1) { | |
272 | + return Result.error("出库单类型信息不一致"); | |
273 | + } | |
274 | + if (mergeShipmentList.stream().map(ShipmentHeader::getCustomerCode).distinct().count() > 1) { | |
275 | + return Result.error("客户信息不一致"); | |
276 | + } | |
277 | + | |
278 | + return Result.OK("合并成功"); | |
279 | + } | |
248 | 280 | } |
... | ... |
huaheng-wms-core/src/main/resources/logback-spring.xml
... | ... | @@ -58,11 +58,11 @@ |
58 | 58 | <appender-ref ref="STDOUT" /> |
59 | 59 | <appender-ref ref="FILE" /> |
60 | 60 | </logger> |
61 | - <logger name="jdbc.sqlonly" additivity="false" level="info"> | |
61 | + <logger name="jdbc.sqlonly" additivity="false" level="off"> | |
62 | 62 | <appender-ref ref="STDOUT" /> |
63 | 63 | <appender-ref ref="FILE" /> |
64 | 64 | </logger> |
65 | - <logger name="jdbc.sqltiming" additivity="false" level="off"> | |
65 | + <logger name="jdbc.sqltiming" additivity="false" level="info"> | |
66 | 66 | <appender-ref ref="STDOUT" /> |
67 | 67 | <appender-ref ref="FILE" /> |
68 | 68 | </logger> |
... | ... |