diff --git a/ant-design-vue-jeecg/src/api/api.js b/ant-design-vue-jeecg/src/api/api.js index 87dfc9e..c5f12b1 100644 --- a/ant-design-vue-jeecg/src/api/api.js +++ b/ant-design-vue-jeecg/src/api/api.js @@ -129,6 +129,8 @@ export const searchMaterialByCode = (params) => postAction('/config/material/sea export const listReceiveByReceiptId = (params) => postAction('/receipt/receiveHeader/listReceiveByReceiptId', params); //创建入库任务 export const createReceiptTask = (params) => postAction('/receipt/receiptContainerHeader/createReceiptTask', params); +//批量创建入库任务 +export const createReceiptBatchTask = (params) => postAction('/receipt/receiptContainerHeader/createReceiptBatchTask', params); //完成WMS任务 export const completeTaskByWMS = (params) => postAction('/task/taskHeader/completeTaskByWMS', params); //下发任务给WCS @@ -139,6 +141,8 @@ export const cancelTask = (params) => postAction('/task/taskHeader/cancelTask?id export const autoCombination = (params) => postAction('/shipment/shipmentCombination/autoCombination', params); //创建出库任务 export const createShipmentTask = (params) => postAction('/shipment/shipmentCombination/createShipmentTask', params); +//批量创建出库任务 +export const createShipmentBatchTask = (params) => postAction('/shipment/shipmentCombination/createShipmentBatchTask', params); //选择出库分拣口 export const selectSortingPort = (params) => postAction('/shipment/shipmentCombination/selectSortingPort', params); //选择入库分拣口 @@ -223,6 +227,10 @@ export const auditReceipt = (params) => getAction("/audit/audit/auditReceipt", p //查询审核流程进度 export const searchAuditFlow = (params) => getAction("/audit/audit/searchAuditFlow", params); +//批量快速出整托 +export const shipmentInventoryHeader = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryHeader', params); +//批量快速出库存详情 +export const shipmentInventoryDetail = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryDetail', params); // 中转HTTP请求 export const transitRESTful = { get: (url, parameter) => getAction(getTransitURL(url), parameter), diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue index c6268b3..4016cd0 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue @@ -37,9 +37,15 @@ </a-tag> </span> - <span slot="controller_dictText" slot-scope="controller_dictText"> - <a-tag :key="controller_dictText" :color="getStatusColor(controller_dictText)"> - {{ controller_dictText }} + <span slot="containerStatus_dictText" slot-scope="containerStatus_dictText"> + <a-tag :key="containerStatus_dictText" :color="getStatusColor(containerStatus_dictText)"> + {{ containerStatus_dictText }} + </a-tag> + </span> + + <span slot="enable_dictText" slot-scope="enable_dictText"> + <a-tag :key="enable_dictText" :color="getStatusColor(enable_dictText)"> + {{ enable_dictText }} </a-tag> </span> @@ -199,10 +205,10 @@ export default { scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { - title: '受控状态', + title: '可用状态', align: 'center', - dataIndex: 'controller_dictText', - scopedSlots: {customRender: 'controller_dictText'} + dataIndex: 'enable_dictText', + scopedSlots: {customRender: 'enable_dictText'} }, { title: '批次', diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue index 0318551..a5a71b5 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue @@ -63,6 +63,7 @@ @change="handleImportExcel"> <a-button type="primary" icon="import">导入</a-button> </a-upload> + <a-button v-has="'inventoryHeader:quickShipmentInventoryHeader'" @click="quickShipment()" type="primary">快速出库</a-button> </div> <!-- table区域-begin --> @@ -84,7 +85,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" :customRow="clickThenSelect" @change="handleTableChange"> @@ -145,6 +146,7 @@ </a-tabs> <inventoryHeader-modal ref="modalForm" @ok="modalFormOk"></inventoryHeader-modal> + <QuickShipmentModel ref='quickShipmentModel' @ok='quickShipmentModalFormOk'></QuickShipmentModel> </a-card> </template> @@ -157,11 +159,13 @@ import InventoryDetailList from './InventoryDetailList' import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil' import '@/assets/less/TableExpand.less' import { getZoneList } from '@api/api' +import QuickShipmentModel from "@views/system/shipment/modules/QuickShipmentModal"; export default { name: "InventoryHeaderList", mixins: [JeecgListMixin], components: { + QuickShipmentModel, InventoryDetailList, InventoryHeaderModal }, @@ -265,6 +269,7 @@ export default { }, selectedMainId: '', superFieldList: [], + selectRecord:[], } }, created() { @@ -320,6 +325,7 @@ export default { this.selectedMainId = selectedRowKeys[0].toString(); this.selectedRowKeys = selectedRowKeys; this.selectionRows = selectionRows; + this.selectRecord = selectionRows; }, loadData(arg) { if (!this.url.list) { @@ -359,6 +365,19 @@ export default { } }); }, + quickShipment() { + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!'); + } else { + let zoneCodes = this.selectRecord.map(row => row.zoneCode); + if (new Set(zoneCodes).size !== 1) { + this.$message.warning('所选数据非同库区'); + return; + } + this.$refs.quickShipmentModel.edit(this.selectRecord); + this.$refs.quickShipmentModel.title = '选择出库口'; + } + }, getSuperFieldList() { let fieldList = []; fieldList.push({type: 'string', value: 'companyCode', text: '货主', dictCode: ''}) diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue index b2773b1..a2ca599 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue @@ -299,9 +299,14 @@ export default { scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { - title: '数量', + title: '入库数量', align: "center", - dataIndex: 'qty' + dataIndex: 'receiptQty' + }, + { + title: '出库数量', + align: "center", + dataIndex: 'shipmentQty' }, { title: '库存数量', diff --git a/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue b/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue index 7bfa17c..06b8675 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue @@ -49,11 +49,11 @@ </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="受控状态"> + <a-form-item label="可用状态"> <j-dict-select-tag - placeholder="请选择受控状态" + placeholder="请选择可用状态" v-model="queryParam.controller" - dictCode="inventory_controller" + dictCode="inventory_enable" /> </a-form-item> </a-col> @@ -136,8 +136,9 @@ > <a-button type="primary" icon="import">导入</a-button> </a-upload> - <a-button v-has="'inventoryDetail:controller'" @click='controller()' type='primary'>受控</a-button> - <a-button v-has="'inventoryDetail:releaseController'" @click='releaseController()' type='primary'>释放受控</a-button> + <a-button v-has="'inventoryDetail:controller'" @click='controller()' type='primary'>冻结</a-button> + <a-button v-has="'inventoryDetail:releaseController'" @click='releaseController()' type='primary'>释放冻结</a-button> + <a-button v-has="'inventoryHeader:quickShipmentInventoryHeader'" @click='quickShipment()' type='primary'>快速出库</a-button> <!-- 高级查询区域 --> <j-super-query :fieldList="superFieldList" @@ -174,9 +175,9 @@ class="j-table-force-nowrap" @change="handleTableChange" > - <span slot="controller_dictText" slot-scope="controller_dictText"> - <a-tag :key="controller_dictText" :color="getStatusColor(controller_dictText)"> - {{ controller_dictText }} + <span slot="enable_dictText" slot-scope="enable_dictText"> + <a-tag :key="enable_dictText" :color="getStatusColor(enable_dictText)"> + {{ enable_dictText }} </a-tag> </span> @@ -225,6 +226,7 @@ </div> <simple-inventory-detail-modal ref="modalForm" @ok="modalFormOk"></simple-inventory-detail-modal> + <QuickShipmentDetailModel ref='quickShipmentModel' @ok='quickShipmentModalFormOk'></QuickShipmentDetailModel> </a-card> </template> @@ -236,11 +238,13 @@ import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {getCompanyList, getZoneList, } from "@api/api"; import {postAction} from '@/api/manage' +import QuickShipmentDetailModel from "@views/system/shipment/modules/QuickShipmentDetailModal"; export default { name: 'InventoryDetailList', mixins: [JeecgListMixin, mixinDevice], components: { + QuickShipmentDetailModel, SimpleInventoryDetailModal }, data() { @@ -327,10 +331,10 @@ export default { scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { - title: '受控状态', + title: '可用状态', align: 'center', - dataIndex: 'controller_dictText', - scopedSlots: {customRender: 'controller_dictText'} + dataIndex: 'enable_dictText', + scopedSlots: {customRender: 'enable_dictText'} }, { title: '批次', @@ -392,7 +396,8 @@ export default { releaseController: 'inventory/inventoryHeader/releaseController', }, dictOptions: {}, - superFieldList: [] + superFieldList: [], + selectRecord:[], } }, created() { @@ -441,8 +446,8 @@ export default { } else { let that = this; this.$confirm({ - title: '确认受控', - content: '是否受控选中数据?', + title: '确认冻结', + content: '是否冻结选中数据?', onOk: function() { that.loading = true; postAction(that.url.controller, that.selectedRowKeys).then((res) => { @@ -469,8 +474,8 @@ export default { } else { let that = this; this.$confirm({ - title: '释放受控', - content: '释放受控选中数据?', + title: '释放冻结', + content: '释放冻结选中数据?', onOk: function() { that.loading = true; postAction(that.url.releaseController, that.selectedRowKeys).then((res) => { @@ -491,22 +496,22 @@ export default { }) } }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedMainId = selectedRowKeys[0].toString(); + this.selectedRowKeys = selectedRowKeys; + this.selectRecord = selectionRows; + }, quickShipment() { if (this.selectedRowKeys.length <= 0) { this.$message.warning('请选择一条记录!'); } else { - let zoneCodes = this.selectRecord.map(row => row.zoneCode) + let zoneCodes = this.selectRecord.map(row => row.zoneCode); if (new Set(zoneCodes).size !== 1) { this.$message.warning('所选数据非同库区'); return; } - if ('D' !== this.selectRecord[0].zoneCode){ - this.$refs.quickShipmentModel.model.containerCode = this.selectRecord[0].containerCode; - this.$refs.quickShipmentModel.edit(); - this.$refs.quickShipmentModel.title = '选择出库口'; - }else { - this.quickShipmentModalFormOk(null) - } + this.$refs.quickShipmentModel.edit(this.selectRecord); + this.$refs.quickShipmentModel.title = '选择出库口'; } }, solutionCompany(value) { @@ -544,7 +549,7 @@ export default { fieldList.push({type: 'BigDecimal', value: 'qty', text: '数量', dictCode: ''}) fieldList.push({type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: ''}) fieldList.push({type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status'}) - fieldList.push({type: 'int', value: 'controller', text: '受控状态', dictCode: 'inventory_controller'}) + fieldList.push({type: 'int', value: 'enable', text: '可用状态', dictCode: 'inventory_enable'}) fieldList.push({type: 'string', value: 'batch', text: '批次', dictCode: ''}) // fieldList.push({type:'string',value:'sn',text:'序列号',dictCode:''}) fieldList.push({type: 'datetime', value: 'receiptDate', text: '入库日期'}) diff --git a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue index 3f065c0..dc6a964 100644 --- a/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue +++ b/ant-design-vue-jeecg/src/views/system/monitor/ApiLogList.vue @@ -55,7 +55,7 @@ </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="业务响应码"> - <j-input placeholder="请输入业务响应码" v-model="queryParam.retCode"></j-input> + <a-input placeholder="请输入业务响应码" v-model="queryParam.retCode"></a-input> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> @@ -103,24 +103,22 @@ <template :slot="expandedRowRender" slot-scope="record"> <div style="margin: 0"> <div> - <a-badge status="default" style="vertical-align: text-bottom;" /> <a-button @click="copyToClipboard(record.requestHeader)" type="link" icon="copy" style="vertical-align: revert;"></a-button> - <span style="vertical-align: text-bottom; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">请求头:{{ record.requestHeader }}</span> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">请求头:</span> + <a-button @click="record.expandHeader = !record.expandHeader" type="link" icon="down-circle" style="vertical-align: revert;"></a-button> + <span v-if="record.expandHeader" style="padding:0 0 0 32px;display: block; vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#b3b3b3;">{{ record.requestHeader }}</span> </div> <div> - <a-badge status="success" style="vertical-align: text-bottom;" /> <a-button @click="copyToClipboard(record.requestBody)" type="link" icon="copy" style="vertical-align: revert;"></a-button> - <span style="vertical-align: text-bottom; word-break:break-all; white-space:pre-wrap; overflow:hidden; color: saddlebrown;">请求内容:{{ record.requestBody }}</span> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color: saddlebrown;">请求内容:{{ record.requestBody }}</span> </div> <div> - <a-badge status="processing" style="vertical-align: text-bottom;" /> <a-button @click="copyToClipboard(record.responseBody)" type="link" icon="copy" style="vertical-align: revert;"></a-button> - <span style="vertical-align: text-bottom; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#0066CC;">响应内容:{{ record.responseBody }}</span> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:#0066CC;">响应内容:{{ record.responseBody }}</span> </div> <div v-if="record.exception" > - <a-badge status="error" style="vertical-align: text-bottom;" /> <a-button @click="copyToClipboard(record.exception)" type="link" icon="copy" style="vertical-align: revert;"></a-button> - <span style="vertical-align: text-bottom; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:red">异常堆栈信息:{{ record.exception }}</span> + <span style="vertical-align: initial; word-break:break-all; white-space:pre-wrap; overflow:hidden; color:red">异常堆栈信息:{{ record.exception }}</span> </div> </div> </template> diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue index 7a14894..52bc748 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue @@ -72,6 +72,8 @@ <a-upload v-has="'receiptContainerHeader:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-button type="primary" icon="import">导入</a-button> </a-upload> + <a-button v-has="'receiptContainerHeader:createTask'" @click="createBatchTask" type="primary" >批量生成任务</a-button> + <a-button v-has="'receiptContainerHeader:delete'" @click="cancelBatchTask" type="primary" >批量取消组盘</a-button> </div> <!-- table区域-begin --> @@ -87,7 +89,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" :customRow="clickThenSelect" @change="handleTableChange"> @@ -115,15 +117,16 @@ size="small" @click="downloadFile(text)">下载 </a-button> - </template> + </template>selectPort <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 0 && record.taskType == 200" @click="selectFillPort(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a> - <a v-else-if="record.status == 0" @click="selectContainerStatus(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a> -<!-- <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)" v-has="'receiptContainerHeader:createTask'">生成任务<a-divider type="vertical"/></a>--> -<!-- <a v-else-if="record.status == 0" @click="createTask(record)" v-has="'receiptContainerHeader:createTask'">生成任务<a-divider type="vertical"/></a>--> +<!-- <a v-if="record.status == 0 && record.taskType == 200" @click="selectFillPort(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a>--> +<!-- <a v-else-if="record.status == 0" @click="selectContainerStatus(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a>--> + <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)" v-has="'receiptContainerHeader:createTask'">生成任务<a-divider type="vertical"/></a> + <a v-else-if="record.status == 0" @click="createTask(record)" v-has="'receiptContainerHeader:createTask'">生成任务<a-divider type="vertical"/></a> <a-popconfirm v-if="record.status == 0" v-has="'receiptContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> <a><a-button type="danger">取消配盘</a-button> <a-divider type="vertical"/></a> </a-popconfirm> + <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-button type="default">编辑</a-button></a> </span> </a-table> @@ -146,11 +149,11 @@ import {JeecgListMixin} from '@/mixins/JeecgListMixin' import ReceiptContainerHeaderModal from './modules/ReceiptContainerHeaderModal' -import {getAction} from '@/api/manage' +import {deleteAction, getAction} from '@/api/manage' import ReceiptContainerDetailList from './ReceiptContainerDetailList' import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil' import '@/assets/less/TableExpand.less' -import {createReceiptTask} from '@/api/api' +import {createReceiptTask, createReceiptBatchTask} from '@/api/api' import ReceiptContainerSelectModal from "./modules/ReceiptContainerSelectModal"; import ReceiptContainerFillSelectModal from "./modules/ReceiptContainerFillSelectModal"; import ReceiptContainerStatusSelectModal from "./modules/ReceiptContainerStatusSelectModal"; @@ -322,17 +325,92 @@ export default { selectPort(record) { this.$refs.modalForm2.edit(record); this.$refs.modalForm2.title = "选择分拣入库口"; - console.log("selectPort"); }, selectFillPort(record) { this.$refs.modalForm3.edit(record); this.$refs.modalForm3.title = "选择分拣入库口"; - console.log("selectFillPort"); }, selectContainerStatus(record) { this.$refs.modalForm4.edit(record); this.$refs.modalForm4.title = "选择容器状态"; - console.log("selectContainerStatus"); + }, + createBatchTask(){ + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!') + return + }else{ + console.log("createBatchTask"); + var receiptContainerHeaderList =[]; + var receiptContainerHeader= null; + for (var a = 0; a < this.selectedRowKeys.length; a++) { + if (this.selectionRows[a].status == 0) { + if (receiptContainerHeader == null) + { + receiptContainerHeader = this.selectionRows[a]; + } + if (receiptContainerHeader.taskType == this.selectionRows[a].taskType) + { + receiptContainerHeaderList.push(this.selectionRows[a]); + } + } + } + if(receiptContainerHeader.taskType == 100) { + createReceiptBatchTask(receiptContainerHeaderList).then((res) => { + this.loading = false; + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + this.searchQuery(); + }); + } else { + this.$refs.modalForm2.batchEdit(receiptContainerHeaderList); + this.$refs.modalForm2.title = "选择出库口"; + } + } + }, + cancelBatchTask() { + if (!this.url.deleteBatch) { + this.$message.error("请设置url.deleteBatch属性!") + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!'); + return; + } else { + var ids = ""; + for (var a = 0; a < this.selectedRowKeys.length; a++) { + if (this.selectionRows[a].status == 0) { + ids += this.selectedRowKeys[a] + ","; + } + } + if(ids == "") { + this.$message.warning("没有符合取消条件的组盘"); + return; + } + var that = this; + this.$confirm({ + title: "确认删除", + content: "是否删除选中数据?", + onOk: function () { + that.loading = true; + deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { + if (res.success) { + //重新计算分页问题 + that.reCalculatePage(that.selectedRowKeys.length) + that.$message.success(res.message); + that.loadData(); + that.onClearSelected(); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.loading = false; + }); + } + }); + } }, loadData(arg) { if (!this.url.list) { diff --git a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerSelectModal.vue b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerSelectModal.vue index a17dd0f..2cb4279 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerSelectModal.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerSelectModal.vue @@ -37,7 +37,7 @@ import {httpAction} from '@/api/manage' import {validateDuplicateValue} from '@/utils/util' -import {createReceiptTask} from '@/api/api' +import {createReceiptTask, createReceiptBatchTask} from '@/api/api' import {selectSupplePort} from '@/api/api' export default { @@ -54,6 +54,8 @@ export default { return { title: "操作", portList: [], + flag:'0', + receiptContainerHeaderList:[], width: 500, visible: false, model: {}, @@ -83,8 +85,15 @@ export default { }, edit(record) { console.log("edit"); + this.flag='0'; this.getPortList(record); }, + batchEdit(record) { + this.visible = true; + this.flag = '1'; + this.getPortList(record[0]); + this.receiptContainerHeaderList=record; + }, close() { this.$emit('close'); this.visible = false; @@ -93,24 +102,48 @@ export default { handleOk() { const that = this; // 触发表单验证 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - createReceiptTask(this.model).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.$emit('ok'); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }); - } else { - return false - } - }) + if (this.flag=='1'){ + this.$refs.form.validate(valid => { + if (valid) { + this.receiptContainerHeaderList.forEach(x=>{ + x["toPort"]=that.model.toPort; + }) + that.confirmLoading = true; + createReceiptBatchTask(this.receiptContainerHeaderList).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }); + } else { + return false + } + }); + } else { + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + createReceiptTask(this.model).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }); + } else { + return false + } + }); + } }, handleCancel() { this.close() diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerDetailList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerDetailList.vue index 49921cb..678d273 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerDetailList.vue @@ -185,14 +185,9 @@ export default { // 表头 columns: [ { - title: '#', - dataIndex: '', - key: 'rowIndex', - width: 60, + title: '组盘详情ID', align: "center", - customRender: function (t, r, index) { - return parseInt(index) + 1; - } + dataIndex: 'id' }, { title: '货主', diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue index ad5e740..4cd8117 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue @@ -5,8 +5,8 @@ <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="容器编码"> - <a-input placeholder="请输入容器编码" v-model="queryParam.containerCode"></a-input> + <a-form-item label="容器号"> + <a-input placeholder="请输入容器号" v-model="queryParam.containerCode"></a-input> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> @@ -14,33 +14,33 @@ <j-dict-select-tag placeholder="请选择任务类型" v-model="queryParam.taskType" dictCode="shipment_task_type"/> </a-form-item> </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="状态"> - <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" - dictCode="shipment_container_status"/> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="起始库位"> - <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="目标库位"> - <a-input placeholder="请输入目标库位" v-model="queryParam.toLocationCode"></a-input> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="目标出入口"> - <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input> - </a-form-item> - </a-col> - <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="创建人"> - <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> - </a-form-item> - </a-col> <template v-if="toggleSearchStatus"> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="状态"> + <j-dict-select-tag placeholder="请选择状态" v-model="queryParam.status" + dictCode="shipment_container_status"/> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="起始库位"> + <a-input placeholder="请输入起始库位" v-model="queryParam.fromLocationCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="目标库位"> + <a-input placeholder="请输入目标库位" v-model="queryParam.toLocationCode"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="目标出入口"> + <a-input placeholder="请输入目标出入口" v-model="queryParam.toPort"></a-input> + </a-form-item> + </a-col> + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="创建人"> + <a-input placeholder="请输入创建人" v-model="queryParam.createBy"></a-input> + </a-form-item> + </a-col> <a-col :xl="12" :lg="14" :md="16" :sm="24"> <a-form-item label="创建日期"> <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" @@ -74,6 +74,8 @@ @change="handleImportExcel"> <a-button type="primary" icon="import">导入</a-button> </a-upload> + <a-button @click="createBatchTask" type="primary" >批量生成任务</a-button> + <a-button @click="cancelBatchTask" type="primary" >批量取消配盘</a-button> </div> <!-- table区域-begin --> @@ -95,16 +97,10 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" :customRow="clickThenSelect" @change="handleTableChange"> - <span slot="status_dictText" slot-scope="status_dictText"> - <a-tag :key="status_dictText" :color="getStatusColor(status_dictText)"> - {{ status_dictText }} - </a-tag> - </span> - <template slot="htmlSlot" slot-scope="text"> <div v-html="text"></div> </template> @@ -126,11 +122,11 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 0" @click="selectPort(record)"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a> + <a v-if="record.status == 0" @click="selectPort(record)">生成任务<a-divider type="vertical"/></a> <a-popconfirm v-if="record.status == 0" v-has="'shipmentContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> - <a><a-button type="danger">取消配盘</a-button><a-divider type="vertical"/></a> + <a>取消配盘<a-divider type="vertical"/></a> </a-popconfirm> - <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-button type="default">编辑</a-button></a> + <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)">编辑</a> </span> </a-table> </div> @@ -150,7 +146,7 @@ import {JeecgListMixin} from '@/mixins/JeecgListMixin' import ShipmentContainerHeaderModal from './modules/ShipmentContainerHeaderModal' -import {getAction} from '@/api/manage' +import {deleteAction, getAction} from '@/api/manage' import ShipmentContainerDetailList from './ShipmentContainerDetailList' import {initDictOptions, filterMultiDictText} from '@/components/dict/JDictSelectUtil' import '@/assets/less/TableExpand.less' @@ -171,10 +167,11 @@ export default { description: '出库组盘管理页面', querySource: {}, portList: [], + hh:'123', // 表头 columns: [ { - title: '容器编码', + title: '容器号', align: "center", dataIndex: 'containerCode' }, @@ -187,7 +184,6 @@ export default { title: '状态', align: "center", dataIndex: 'status_dictText', - scopedSlots: {customRender: 'status_dictText'} }, { title: '起始库位', @@ -269,15 +265,6 @@ export default { } }, methods: { - getStatusColor(status) { - const colors = { - '新建': 'green', - '生成任务': 'blue', - '下架完成': 'gray', - default: 'blue' - }; - return colors[status] || colors.default; - }, initDictConfig() { }, clickThenSelect(record) { @@ -303,6 +290,72 @@ export default { this.$refs.modalForm2.edit(record); this.$refs.modalForm2.title = "选择出库口"; }, + createBatchTask(){ + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!') + return + }else{ + console.log("createBatchTask"); + var shipmentContainerHeaderList =[]; + var shipmentContainerHeader= null; + for (var a = 0; a < this.selectedRowKeys.length; a++) { + if (this.selectionRows[a].status == 0) { + if (shipmentContainerHeader == null) + { + shipmentContainerHeader = this.selectionRows[a]; + } + if (shipmentContainerHeader.taskType == this.selectionRows[a].taskType) + { + shipmentContainerHeaderList.push(this.selectionRows[a]); + } + } + } + this.$refs.modalForm2.batchEdit(shipmentContainerHeaderList); + this.$refs.modalForm2.title = "选择出库口"; + } + }, + cancelBatchTask() { + if (!this.url.deleteBatch) { + this.$message.error("请设置url.deleteBatch属性!") + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!'); + return; + } else { + var ids = ""; + for (var a = 0; a < this.selectedRowKeys.length; a++) { + if (this.selectionRows[a].status == 0) { + ids += this.selectedRowKeys[a] + ","; + } + } + if(ids == "") { + this.$message.warning("没有符合取消条件的组盘"); + return; + } + var that = this; + this.$confirm({ + title: "确认删除", + content: "是否删除选中数据?", + onOk: function () { + that.loading = true; + deleteAction(that.url.deleteBatch, {ids: ids}).then((res) => { + if (res.success) { + //重新计算分页问题 + that.reCalculatePage(that.selectedRowKeys.length) + that.$message.success(res.message); + that.loadData(); + that.onClearSelected(); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.loading = false; + }); + } + }); + } + }, loadData(arg) { if (!this.url.list) { this.$message.error("请设置url.list属性!") @@ -328,7 +381,7 @@ export default { }, getSuperFieldList() { let fieldList = []; - fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''}) + fieldList.push({type: 'string', value: 'containerCode', text: '容器号', dictCode: ''}) fieldList.push({type: 'int', value: 'taskType', text: '任务类型', dictCode: 'shipment_task_type'}) fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: 'shipment_container_status'}) fieldList.push({type: 'string', value: 'fromLocationCode', text: '起始库位', dictCode: ''}) diff --git a/ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentDetailModal.vue b/ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentDetailModal.vue new file mode 100644 index 0000000..410dcce --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentDetailModal.vue @@ -0,0 +1,111 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="关闭" + > + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="出库口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outPortCode"> + <a-select show-search placeholder="请选择出库口" option-filter-prop="children" v-model="model.outPortCode"> + <a-select-option v-for="item in portList" :key="item.name" :value="item.code"> + {{ item.name }} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import {getZoneList, selectOutPort, shipmentInventoryDetail} from '@/api/api' + +export default { + name: 'QuickShipmentDetailModel', + components: { }, + data() { + return { + title: '操作', + width: 400, + portList: [], + inventoryDetailList: [], + querySource: {}, + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + // 选择用户查询条件配置 + selectUserQueryConfig: [], + confirmLoading: false, + validatorRules: { + outPortCode: [{ required: true, message: '请选择出库口!' }] + } + } + }, + created() { + //备份model原始值 + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add() { + this.edit(this.modelDefault) + }, + edit(record) { + this.visible = true; + this.model.containerCode = record[0].containerCode; + this.inventoryDetailList = record; + this.getPortList(); + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + getPortList() { + this.querySource.containerCode = this.model.containerCode + selectOutPort(this.querySource).then(res => { + if (res.success) { + this.portList = res.result; + this.visible = true; + } + }) + }, + handleOk() { + if (this.model.outPortCode === ''){ + this.$message.warning('请选择出库口'); + } + this.inventoryDetailList.forEach(x=>{ + x["toPortCode"]=this.model.outPortCode; + }) + shipmentInventoryDetail(this.inventoryDetailList).then((res) => { + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + }); + this.$emit("ok", this.model.outPortCode); + this.close() + }, + handleCancel() { + this.close() + } + } +} +</script> \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentModal.vue b/ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentModal.vue new file mode 100644 index 0000000..aee83bf --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/shipment/modules/QuickShipmentModal.vue @@ -0,0 +1,111 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="关闭" + > + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules"> + <a-row> + <a-col :span="24"> + <a-form-model-item label="出库口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outPortCode"> + <a-select show-search placeholder="请选择出库口" option-filter-prop="children" v-model="model.outPortCode"> + <a-select-option v-for="item in portList" :key="item.name" :value="item.code"> + {{ item.name }} + </a-select-option> + </a-select> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </j-modal> +</template> + +<script> +import {getZoneList, selectOutPort, shipmentInventoryHeader} from '@/api/api' + +export default { + name: 'QuickShipmentModel', + components: { }, + data() { + return { + title: '操作', + width: 400, + portList: [], + inventoryHeaderList: [], + querySource: {}, + visible: false, + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + }, + // 选择用户查询条件配置 + selectUserQueryConfig: [], + confirmLoading: false, + validatorRules: { + outPortCode: [{ required: true, message: '请选择出库口!' }] + } + } + }, + created() { + //备份model原始值 + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add() { + this.edit(this.modelDefault) + }, + edit(record) { + this.visible = true; + this.model.containerCode = record[0].containerCode; + this.inventoryHeaderList = record; + this.getPortList(); + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + getPortList() { + this.querySource.containerCode = this.model.containerCode + selectOutPort(this.querySource).then(res => { + if (res.success) { + this.portList = res.result; + this.visible = true; + } + }) + }, + handleOk() { + if (this.model.outPortCode === ''){ + this.$message.warning('请选择出库口'); + } + this.inventoryHeaderList.forEach(x=>{ + x["toPortCode"]=this.model.outPortCode; + }) + shipmentInventoryHeader(this.inventoryHeaderList).then((res) => { + if (res.success) { + this.$message.success(res.message); + } else { + this.$message.error(res.message); + } + }); + this.$emit("ok", this.model.outPortCode); + this.close() + }, + handleCancel() { + this.close() + } + } +} +</script> \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerSelectModal.vue b/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerSelectModal.vue index 19bcc38..34d4d56 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerSelectModal.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentContainerSelectModal.vue @@ -35,7 +35,7 @@ import {httpAction} from '@/api/manage' import {validateDuplicateValue} from '@/utils/util' -import {createShipmentTask} from '@/api/api' +import {createShipmentTask,createShipmentBatchTask} from '@/api/api' import {selectSortingPort} from '@/api/api' export default { @@ -51,6 +51,8 @@ export default { data() { return { portList: [], + flag:'0', + shipmentContainerHeaderList:[], title: "操作", width: 500, visible: false, @@ -81,8 +83,15 @@ export default { this.edit(this.modelDefault); }, edit(record) { + this.flag='0'; this.getPortList(record); }, + batchEdit(record) { + this.visible = true; + this.flag='1'; + this.getPortList(record[0]) + this.shipmentContainerHeaderList=record; + }, close() { this.$emit('close'); this.visible = false; @@ -90,25 +99,51 @@ export default { }, handleOk() { const that = this; - // 触发表单验证 - this.$refs.form.validate(valid => { - if (valid) { - that.confirmLoading = true; - createShipmentTask(this.model).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.$emit('ok'); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }); - } else { - return false - } - }) + if (this.flag=='1'){ + this.$refs.form.validate(valid => { + if (valid) { + this.shipmentContainerHeaderList.forEach(x=>{ + x["toPort"]=that.model.toPort; + }) + createShipmentBatchTask(this.shipmentContainerHeaderList).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }); + }else { + return false + } + }) + + }else{ + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + createShipmentTask(this.model).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }); + } else { + return false + } + }) + } + + }, handleCancel() { this.close() diff --git a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue index a1713fa..010904f 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue @@ -202,7 +202,7 @@ export default { zoneOptions:[], isorter: { column: 'status', - order: 'asc', + order: 'asc' }, // 表头 columns: [ diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java index e143c01..cd44a88 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java @@ -71,9 +71,9 @@ public class LocationController extends JeecgController<Location, ILocationServi QueryWrapper<Location> queryWrapper = QueryGenerator.initQueryWrapper(location, null); LambdaQueryWrapper<Location> locationLambdaQueryWrapper = queryWrapper.lambda(); if (haveContainer != null) { - if (haveContainer == QuantityConstant.STATUS_NOT_CONTAINER) { + if (haveContainer == QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE) { locationLambdaQueryWrapper.eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING); - } else if (haveContainer == QuantityConstant.STATUS_HAVE_CONTAINER) { + } else if (haveContainer == QuantityConstant.INVENTORY_DETAIL_STATUS_CONTAINER) { locationLambdaQueryWrapper.ne(Location::getContainerCode, QuantityConstant.EMPTY_STRING); } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java index e58c100..4f38a43 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java @@ -153,9 +153,9 @@ public class Location implements Serializable { public Integer getHaveContainer() { if (StringUtils.isNotEmpty(containerCode)) { - return QuantityConstant.STATUS_HAVE_CONTAINER; + return QuantityConstant.INVENTORY_DETAIL_STATUS_CONTAINER; } else { - return QuantityConstant.STATUS_NOT_CONTAINER; + return QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE; } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java index 4c57907..4f5f02e 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/IHuahengMultiHandlerService.java @@ -24,8 +24,16 @@ public interface IHuahengMultiHandlerService { Result combination(CombinationParam combinationParam); + /** + * 取消配盘 + */ Result cancelCombine(Integer id); + /** + * 取消组盘 + */ + Result cancelReceiving(Integer id); + Result autoCombination(String shipmentCode, String warehouseCode); Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java index 2824275..e97ac9b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java @@ -27,7 +27,6 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailServ import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; /** * @author 游杰 @@ -128,6 +127,18 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem } @Override + public Result cancelReceiving(Integer id) { + Result result = handleMultiProcess("cancelReceiving", new MultiProcessListener() { + @Override + public Result<?> doProcess() { + Result result = receiptContainerHeaderService.cancelReceiving(id); + return result; + } + }); + return result; + } + + @Override public Result autoCombination(String shipmentCode, String warehouseCode) { Result result = handleMultiProcess("combination", new MultiProcessListener() { @Override diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java index ec9ade2..0026e22 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java @@ -90,6 +90,7 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, String inventoryHeaderZoneCode = inventoryHeader.getZoneCode(); LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); QueryWrapper<InventoryHeader> queryWrapper = QueryGenerator.initQueryWrapper(inventoryHeader, req.getParameterMap()); + queryWrapper.orderByDesc("id"); Page<InventoryHeader> page = new Page<InventoryHeader>(pageNo, pageSize); IPage<InventoryHeader> pageList = inventoryHeaderService.page(page, queryWrapper); if (StringUtils.isEmpty(inventoryHeaderZoneCode)) { @@ -346,7 +347,6 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, @AutoLog("库存详情-释放受控") @ApiOperation(value = "释放受控", notes = "释放受控") - @ApiLogger(apiName = "释放受控") @PostMapping(value = "/releaseController") @ResponseBody public Result releaseController(@RequestBody List<Integer> ids, HttpServletRequest req) { @@ -358,7 +358,6 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, @AutoLog("库存详情-批量受控") @ApiOperation(value = "批量受控", notes = "批量受控") - @ApiLogger(apiName = "批量受控") @PostMapping("/controller") @ResponseBody public Result controller(@RequestBody List<Integer> ids) { @@ -367,4 +366,30 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, } return inventoryDetailService.controller(ids); } + + @AutoLog("库存头-批量出整托库存") + @ApiOperation(value = "批量出整托库存", notes = "批量出整托库存") + @ApiLogger(apiName = "批量出整托库存") + @PostMapping("/shipmentInventoryHeader") + @ResponseBody + public Result shipmentInventoryHeader(@RequestBody List<InventoryHeader> inventoryHeaderList, HttpServletRequest req) { + if (StringUtils.isEmpty(inventoryHeaderList)) { + return Result.error("库存头为空"); + } + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); + return inventoryHeaderService.shipmentInventoryHeader(inventoryHeaderList, warehouseCode); + } + + @AutoLog("库存头-批量出库存详情") + @ApiOperation(value = "批量出库存详情", notes = "批量出库存详情") + @ApiLogger(apiName = "批量出库存详情") + @PostMapping("/shipmentInventoryDetail") + @ResponseBody + public Result shipmentInventoryDetail(@RequestBody List<InventoryDetail> inventoryDetailList, HttpServletRequest req) { + if (StringUtils.isEmpty(inventoryDetailList)) { + return Result.error("库存明细为空"); + } + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); + return inventoryHeaderService.shipmentInventoryDetail(inventoryDetailList, warehouseCode); + } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java index f1bb1fa..b8d55a5 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryDetail.java @@ -125,11 +125,11 @@ public class InventoryDetail implements Serializable { @Excel(name = "库龄(天)", width = 15) @ApiModelProperty(value = "库龄(天)") private Integer inventoryAge; - /** 受控 */ - @Excel(name = "受控", width = 15) - @Dict(dicCode = "inventory_controller") - @ApiModelProperty(value = "受控") - private Integer controller; + /** 是否可用 */ + @Excel(name = "是否可用", width = 15) + @Dict(dicCode = "inventory_enable") + @ApiModelProperty(value = "是否可用") + private Integer enable; /** 备用字段1 */ @Excel(name = "备用字段1", width = 15) @ApiModelProperty(value = "备用字段1") @@ -154,6 +154,8 @@ public class InventoryDetail implements Serializable { /** 更新日期 */ @ApiModelProperty(value = "更新日期") private Date updateTime; + @TableField(exist = false) + private String toPortCode; public void setQty(BigDecimal qty) { if (qty.compareTo(BigDecimal.ZERO) < 0) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryHeader.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryHeader.java index 612d925..799015e 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryHeader.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/entity/InventoryHeader.java @@ -9,6 +9,7 @@ import org.jeecg.common.exception.JeecgBootException; import org.jeecgframework.poi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -97,6 +98,8 @@ public class InventoryHeader implements Serializable { /** 更新日期 */ @ApiModelProperty(value = "更新日期") private Date updateTime; + @TableField(exist = false) + private String toPortCode; public void setTotalQty(BigDecimal totalQty) { if (totalQty.compareTo(BigDecimal.ZERO) < 0) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java index d315926..e851d8b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java @@ -23,9 +23,14 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { List<InventoryDetail> getInventoryDetailListByInventoryHeaderId(Integer inventoryHeaderId); + List<InventoryDetail> getInventoryDetailListByInventoryHeaderIds(List<Integer> inventoryHeaderIds); + List<InventoryDetail> getInventoryDetailListByContainerCode(String containerCode, String warehouseCode); - // 求一种物料的库存之和 + // 求一种物料的库存之和(总数) + BigDecimal getInventorySumQty(InventoryDetail inventoryDetail); + + // 求一种物料的库存之和(扣除了配盘数量) BigDecimal getSumQty(InventoryDetail inventoryDetail); // 求一种物料的可出库存之和 diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryHeaderService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryHeaderService.java index 28e9f1e..ccd31f7 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryHeaderService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryHeaderService.java @@ -2,7 +2,10 @@ package org.jeecg.modules.wms.inventory.inventoryHeader.service; import java.io.Serializable; import java.util.Collection; +import java.util.List; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; import com.baomidou.mybatisplus.extension.service.IService; @@ -36,4 +39,8 @@ public interface IInventoryHeaderService extends IService<InventoryHeader> { boolean updateContainerStatusAndLocationCode(String containerStatus, String locationCode, Integer id); boolean updateLocationCodeById(String locationCode, Integer id); + + Result shipmentInventoryHeader(List<InventoryHeader> inventoryHeaderList, String warehouseCode); + + Result shipmentInventoryDetail(List<InventoryDetail> inventoryDetailList, String warehouseCode); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java index 50e6fbf..e183b14 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java @@ -17,7 +17,6 @@ import org.jeecg.modules.wms.config.container.service.IContainerService; import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; import org.jeecg.modules.wms.config.containerCapacity.service.IContainerCapacityService; import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; -import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryDetailMapper; import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; @@ -65,7 +64,17 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe @Override public List<InventoryDetail> getInventoryDetailListByInventoryHeaderId(Integer inventoryHeaderId) { LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); - inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId, inventoryHeaderId); + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId, inventoryHeaderId).eq(InventoryDetail::getEnable, + QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE); + List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); + return inventoryDetailList; + } + + @Override + public List<InventoryDetail> getInventoryDetailListByInventoryHeaderIds(List<Integer> inventoryHeaderIds) { + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); + inventoryDetailLambdaQueryWrapper.in(InventoryDetail::getInventoryHeaderId, inventoryHeaderIds).eq(InventoryDetail::getEnable, + QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE); List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); return inventoryDetailList; } @@ -73,12 +82,30 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe @Override public List<InventoryDetail> getInventoryDetailListByContainerCode(String containerCode, String warehouseCode) { LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); - inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, containerCode).eq(InventoryDetail::getWarehouseCode, warehouseCode); + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getContainerCode, containerCode).eq(InventoryDetail::getWarehouseCode, warehouseCode) + .eq(InventoryDetail::getEnable, QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE); List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); return inventoryDetailList; } @Override + public BigDecimal getInventorySumQty(InventoryDetail inventoryDetail) { + LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); + inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryStatus, inventoryDetail.getInventoryStatus()) + .eq(InventoryDetail::getMaterialCode, inventoryDetail.getMaterialCode()).eq(InventoryDetail::getWarehouseCode, inventoryDetail.getWarehouseCode()) + .eq(StringUtils.isNotEmpty(inventoryDetail.getBatch()), InventoryDetail::getBatch, inventoryDetail.getBatch()) + .eq(StringUtils.isNotEmpty(inventoryDetail.getLot()), InventoryDetail::getLot, inventoryDetail.getLot()) + .eq(StringUtils.isNotEmpty(inventoryDetail.getProject()), InventoryDetail::getProject, inventoryDetail.getLot()) + .eq(InventoryDetail::getCompanyCode, inventoryDetail.getCompanyCode()); + List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); + if (inventoryDetailList.size() == 0) { + return BigDecimal.ZERO; + } + BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); + return totalQty; + } + + @Override public BigDecimal getSumQty(InventoryDetail inventoryDetail) { LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryStatus, inventoryDetail.getInventoryStatus()) @@ -105,15 +132,16 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe .eq(StringUtils.isNotEmpty(inventoryDetail.getBatch()), InventoryDetail::getBatch, inventoryDetail.getBatch()) .eq(StringUtils.isNotEmpty(inventoryDetail.getLot()), InventoryDetail::getLot, inventoryDetail.getLot()) .eq(StringUtils.isNotEmpty(inventoryDetail.getProject()), InventoryDetail::getProject, inventoryDetail.getLot()) - .eq(InventoryDetail::getController, QuantityConstant.CONTROLLER_NOT_ENABLE) - .eq(InventoryDetail::getContainerStatus, QuantityConstant.STATUS_CONTAINER_EMPTY).eq(InventoryDetail::getTaskQty, BigDecimal.ZERO) - .eq(InventoryDetail::getCompanyCode, inventoryDetail.getCompanyCode()); + .eq(InventoryDetail::getEnable, QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE) + .eq(InventoryDetail::getContainerStatus, QuantityConstant.STATUS_CONTAINER_EMPTY).eq(InventoryDetail::getCompanyCode, inventoryDetail.getCompanyCode()); List<InventoryDetail> inventoryDetailList = list(inventoryDetailLambdaQueryWrapper); if (inventoryDetailList.size() == 0) { return BigDecimal.ZERO; } BigDecimal totalQty = inventoryDetailList.stream().map(InventoryDetail::getQty).reduce(BigDecimal.ZERO, BigDecimal::add); - return totalQty; + BigDecimal totalTaskQty = inventoryDetailList.stream().map(InventoryDetail::getTaskQty).reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal sumQty = totalQty.subtract(totalTaskQty); + return sumQty; } @Override @@ -209,11 +237,11 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe } List<InventoryDetail> inventoryDetailUpdateList = new ArrayList<>(); List<Integer> inventoryHeaderIdList = inventoryDetailList.stream().map(InventoryDetail::getInventoryHeaderId).distinct().collect(Collectors.toList()); - List<InventoryHeader> inventoryHeaderList = inventoryHeaderService.listByIds(inventoryHeaderIdList); +// List<InventoryHeader> inventoryHeaderList = inventoryHeaderService.listByIds(inventoryHeaderIdList); for (InventoryDetail inventoryDetail : inventoryDetailList) { InventoryDetail inventoryDetail1 = new InventoryDetail(); inventoryDetail1.setId(inventoryDetail.getId()); - inventoryDetail1.setController(QuantityConstant.CONTROLLER_ENABLE); + inventoryDetail1.setEnable(QuantityConstant.INVENTORY_DETAIL_STATUS_CONTAINER); inventoryDetailUpdateList.add(inventoryDetail1); } boolean success = updateBatchById(inventoryDetailUpdateList); @@ -233,7 +261,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe for (InventoryDetail inventoryDetail : inventoryDetailList) { InventoryDetail inventoryDetail1 = new InventoryDetail(); inventoryDetail1.setId(inventoryDetail.getId()); - inventoryDetail1.setController(QuantityConstant.CONTROLLER_NOT_ENABLE); + inventoryDetail1.setEnable(QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE); inventoryDetailUpdateList.add(inventoryDetail1); } boolean success = updateBatchById(inventoryDetailUpdateList); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java index e23251f..bd117a6 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryHeaderServiceImpl.java @@ -4,18 +4,33 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; import javax.annotation.Resource; +import org.jeecg.common.api.vo.Result; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.modules.wms.config.container.entity.Container; import org.jeecg.modules.wms.config.container.service.IContainerService; +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryDetailMapper; import org.jeecg.modules.wms.inventory.inventoryHeader.mapper.InventoryHeaderMapper; import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; +import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; +import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentHeader; +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; +import org.jeecg.utils.StringUtils; +import org.jeecg.utils.constant.QuantityConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +58,18 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe private IInventoryHeaderService inventoryHeaderService; @Resource private IInventoryDetailService inventoryDetailService; + @Resource + private IShipmentHeaderService shipmentHeaderService; + @Resource + private IShipmentDetailService shipmentDetailService; + @Resource + private IShipmentContainerHeaderService shipmentContainerHeaderService; + @Resource + private IShipmentCombinationService shipmentCombinationService; + @Resource + private IShipmentContainerDetailService shipmentContainerDetailService; + @Resource + private IHuahengMultiHandlerService huahengMultiHandlerService; @Override @Transactional @@ -98,7 +125,6 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe } @Override - @Transactional public boolean updateInventoryLocationAndZoneById(String locationCode, String zoneCode, Integer id) { InventoryHeader inventoryHeader = new InventoryHeader(); inventoryHeader.setId(id); @@ -108,7 +134,6 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe } @Override - @Transactional public boolean updateContainerStatusById(String containerStatus, Integer id) { InventoryHeader inventoryHeader = new InventoryHeader(); inventoryHeader.setId(id); @@ -117,7 +142,6 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe } @Override - @Transactional public boolean updateContainerStatusAndLocationCode(String containerStatus, String locationCode, Integer id) { InventoryHeader inventoryHeader = new InventoryHeader(); inventoryHeader.setId(id); @@ -127,7 +151,6 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe } @Override - @Transactional public boolean updateLocationCodeById(String locationCode, Integer id) { InventoryHeader inventoryHeader = new InventoryHeader(); inventoryHeader.setId(id); @@ -135,4 +158,181 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe return inventoryHeaderService.updateById(inventoryHeader); } + @Override + @Transactional(rollbackFor = JeecgBootException.class) + public Result shipmentInventoryHeader(List<InventoryHeader> inventoryHeaderList, String warehouseCode) { + if (StringUtils.isEmpty(inventoryHeaderList)) { + return Result.error("批量快速出库,所选库存头为空"); + } + String toPortCode = inventoryHeaderList.get(0).getToPortCode(); + if (StringUtils.isEmpty(toPortCode)) { + return Result.error("批量快速出库,出库站台编码为空"); + } + String companyCode = inventoryHeaderList.get(0).getCompanyCode(); + List<InventoryHeader> shipmentInventoryHeaderList = + inventoryHeaderList.stream().filter((item) -> item.getContainerStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)).collect(Collectors.toList()); + if (StringUtils.isEmpty(shipmentInventoryHeaderList)) { + return Result.error("批量快速出库, 排除锁定库存后没有可出库存头"); + } + List<Integer> inventoryHeaderIds = shipmentInventoryHeaderList.stream().map(InventoryHeader::getId).collect(Collectors.toList()); + List<InventoryDetail> inventoryDetails = inventoryDetailService.getInventoryDetailListByInventoryHeaderIds(inventoryHeaderIds); + if (StringUtils.isEmpty(inventoryDetails)) { + return Result.error("批量快速出库, 排除锁定库存后没有可出库存详情"); + } + ShipmentHeader shipmentHeader = new ShipmentHeader(); + shipmentHeader.setWarehouseCode(warehouseCode); + shipmentHeader.setCompanyCode(companyCode); + shipmentHeader.setType(QuantityConstant.SHIPMENT_BILL_TYPE_QTC); + shipmentHeader.setRemark("快速出库"); + Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader); + if (!result.isSuccess()) { + throw new JeecgBootException("批量快速出库,创建出库单失败:".concat(result.getMessage())); + } + + List<ShipmentDetail> shipmentDetailList = new ArrayList<>(); + for (InventoryDetail inventoryDetail : inventoryDetails) { + ShipmentDetail shipmentDetail = new ShipmentDetail(); + shipmentDetail.setShipmentId(shipmentHeader.getId()); + shipmentDetail.setMaterialCode(inventoryDetail.getMaterialCode()); + shipmentDetail.setInventoryStatus(inventoryDetail.getInventoryStatus()); + shipmentDetail.setQty(inventoryDetail.getQty()); + shipmentDetail.setBatch(inventoryDetail.getBatch()); + result = shipmentDetailService.saveShipmentDetail(shipmentDetail); + if (!result.isSuccess()) { + throw new JeecgBootException("批量快速出库,创建出库详情失败:".concat(result.getMessage())); + } + shipmentDetail = shipmentDetailService.getById(shipmentDetail.getId()); + shipmentDetailList.add(shipmentDetail); + } + + for (int i = 0; i < inventoryDetails.size(); i++) { + InventoryDetail inventoryDetail = inventoryDetails.get(i); + ShipmentDetail shipmentDetail = shipmentDetailList.get(i); + CombinationModel combinationModel = new CombinationModel(); + combinationModel.setInventoryDetail(inventoryDetail); + combinationModel.setShipmentDetail(shipmentDetail); + combinationModel.setShipQty(inventoryDetail.getQty()); + result = shipmentCombinationService.combination(combinationModel); + if (!result.isSuccess()) { + throw new JeecgBootException("批量快速出库,配盘失败:".concat(result.getMessage())); + } + } + + List<ShipmentContainerDetail> shipmentContainerDetailList = + shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentHeader.getCode()); + if (StringUtils.isEmpty(shipmentContainerDetailList)) { + throw new JeecgBootException("批量快速出库,根据出库单没有找到配盘详情"); + } + + List<Integer> shipmentContainerHeaderIdList = + shipmentContainerDetailList.stream().map(ShipmentContainerDetail::getShipmentContainerId).collect(Collectors.toList()); + long shipmentOrder = System.currentTimeMillis(); + int sequenceNumber = shipmentContainerHeaderIdList.size(); + int sequence = 0; + for (int shipmentContainerId : shipmentContainerHeaderIdList) { + sequence++; + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerId); + if (shipmentContainerHeader == null) { + throw new JeecgBootException("批量快速出库,没有找到出库表头:" + shipmentContainerId); + } + shipmentContainerHeader.setToPort(toPortCode); + boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); + if (!success) { + throw new JeecgBootException("批量快速出库,更新出库组盘头失败"); + } + result = shipmentCombinationService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber); + if (!result.isSuccess()) { + throw new JeecgBootException(result.getMessage()); + } + } + + return Result.OK("批量快速出库成功"); + } + + @Override + @Transactional(rollbackFor = JeecgBootException.class) + public Result shipmentInventoryDetail(List<InventoryDetail> inventoryDetailList, String warehouseCode) { + if (StringUtils.isEmpty(inventoryDetailList)) { + return Result.error("批量快速出库,所选库存详情为空"); + } + String toPortCode = inventoryDetailList.get(0).getToPortCode(); + if (StringUtils.isEmpty(toPortCode)) { + return Result.error("批量快速出库,出库站台编码为空"); + } + inventoryDetailList = + inventoryDetailList.stream().filter((item) -> item.getContainerStatus().equals(QuantityConstant.STATUS_CONTAINER_EMPTY)).collect(Collectors.toList()); + if (StringUtils.isEmpty(inventoryDetailList)) { + return Result.error("批量快速出库, 排除锁定库存后没有可出库存详情"); + } + String companyCode = inventoryDetailList.get(0).getCompanyCode(); + ShipmentHeader shipmentHeader = new ShipmentHeader(); + shipmentHeader.setWarehouseCode(warehouseCode); + shipmentHeader.setCompanyCode(companyCode); + shipmentHeader.setType(QuantityConstant.SHIPMENT_BILL_TYPE_QTC); + shipmentHeader.setRemark("快速出库"); + Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader); + if (!result.isSuccess()) { + throw new JeecgBootException("批量快速出库,创建出库单失败:".concat(result.getMessage())); + } + + List<ShipmentDetail> shipmentDetailList = new ArrayList<>(); + for (InventoryDetail inventoryDetail : inventoryDetailList) { + ShipmentDetail shipmentDetail = new ShipmentDetail(); + shipmentDetail.setShipmentId(shipmentHeader.getId()); + shipmentDetail.setMaterialCode(inventoryDetail.getMaterialCode()); + shipmentDetail.setInventoryStatus(inventoryDetail.getInventoryStatus()); + shipmentDetail.setQty(inventoryDetail.getQty()); + shipmentDetail.setBatch(inventoryDetail.getBatch()); + result = shipmentDetailService.saveShipmentDetail(shipmentDetail); + if (!result.isSuccess()) { + throw new JeecgBootException("批量快速出库,创建出库详情失败:".concat(result.getMessage())); + } + shipmentDetail = shipmentDetailService.getById(shipmentDetail.getId()); + shipmentDetailList.add(shipmentDetail); + } + + for (int i = 0; i < inventoryDetailList.size(); i++) { + InventoryDetail inventoryDetail = inventoryDetailList.get(i); + ShipmentDetail shipmentDetail = shipmentDetailList.get(i); + CombinationModel combinationModel = new CombinationModel(); + combinationModel.setInventoryDetail(inventoryDetail); + combinationModel.setShipmentDetail(shipmentDetail); + combinationModel.setShipQty(inventoryDetail.getQty()); + result = shipmentCombinationService.combination(combinationModel); + if (!result.isSuccess()) { + throw new JeecgBootException("批量快速出库,配盘失败:".concat(result.getMessage())); + } + } + + List<ShipmentContainerDetail> shipmentContainerDetailList = + shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentHeader.getCode()); + if (StringUtils.isEmpty(shipmentContainerDetailList)) { + throw new JeecgBootException("批量快速出库,根据出库单没有找到配盘详情"); + } + + List<Integer> shipmentContainerHeaderIdList = + shipmentContainerDetailList.stream().map(ShipmentContainerDetail::getShipmentContainerId).collect(Collectors.toList()); + long shipmentOrder = System.currentTimeMillis(); + int sequenceNumber = shipmentContainerHeaderIdList.size(); + int sequence = 0; + for (int shipmentContainerId : shipmentContainerHeaderIdList) { + sequence++; + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerId); + if (shipmentContainerHeader == null) { + throw new JeecgBootException("批量快速出库,没有找到出库表头:" + shipmentContainerId); + } + shipmentContainerHeader.setToPort(toPortCode); + boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); + if (!success) { + throw new JeecgBootException("批量快速出库,更新出库组盘头失败"); + } + result = shipmentCombinationService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber); + if (!result.isSuccess()) { + throw new JeecgBootException(result.getMessage()); + } + } + + return Result.OK("批量快速出库成功"); + } + } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/entity/ApiLog.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/entity/ApiLog.java index 215a2d2..9e7df8e 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/entity/ApiLog.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/apiLog/entity/ApiLog.java @@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -105,4 +106,7 @@ public class ApiLog implements Serializable { /** 创建日期 */ @ApiModelProperty(value = "创建日期") private Date createTime; + + @TableField(exist = false) + private boolean expandHeader = false; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java index c9fd333..6d215a3 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java @@ -98,6 +98,7 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon HttpServletRequest req) { HuahengJwtUtil.setWarehouseCode(req, receiptContainerHeader); QueryWrapper<ReceiptContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(receiptContainerHeader, req.getParameterMap()); + queryWrapper.orderByDesc("id"); Page<ReceiptContainerHeader> page = new Page<ReceiptContainerHeader>(pageNo, pageSize); IPage<ReceiptContainerHeader> pageList = receiptContainerHeaderService.page(page, queryWrapper); return Result.OK(pageList); @@ -142,7 +143,7 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon @DeleteMapping(value = "/delete") @RequiresPermissions("receiptContainerHeader:delete") public Result<?> delete(@RequestParam(name = "id", required = true) String id) { - return receiptContainerHeaderService.cancelReceiving(Integer.parseInt(id)); + return huahengMultiHandlerService.cancelReceiving(Integer.parseInt(id)); } /** @@ -153,11 +154,18 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon @AutoLog(value = "入库组盘-批量删除") @ApiOperation(value = "入库组盘-批量删除", notes = "入库组盘-批量删除") @DeleteMapping(value = "/deleteBatch") - @RequiresPermissions("receiptContainerHeader:deleteBatch") + @RequiresPermissions("receiptContainerHeader:delete") public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { List<String> idList = Arrays.asList(ids.split(",")); List<Integer> idInterList = idList.stream().map(Integer::parseInt).collect(Collectors.toList()); - return receiptContainerHeaderService.cancelReceiving(idInterList); + Result result = null; + for (Integer id : idInterList) { + result = huahengMultiHandlerService.cancelReceiving(id); + if (!result.isSuccess()) { + return result; + } + } + return result; } /** @@ -341,6 +349,24 @@ public class ReceiptContainerHeaderController extends JeecgController<ReceiptCon } /** + * 创建任务 + * @return + */ + @ApiOperation(value = "入库组盘-创建任务", notes = "入库组盘-创建任务") + @PostMapping("/createReceiptBatchTask") + @ResponseBody + public Result createReceiptBatchTask(@RequestBody List<ReceiptContainerHeader> receiptContainerHeaderList, HttpServletRequest req) { + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); + for (ReceiptContainerHeader receiptContainerHeader : receiptContainerHeaderList) { + Result result = huahengMultiHandlerService.createReceiptTask(receiptContainerHeader, warehouseCode); + if (!result.isSuccess()) { + return result; + } + } + return Result.OK("批量创建入库任务成功"); + } + + /** * 选择分拣口 * @return */ diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java index f6fc148..122495c 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java @@ -184,6 +184,9 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl if (qty == null || taskQty == null) { throw new JeecgBootException("入库组盘,物料编码:" + receive.getMaterialCode() + " 收货数量或可收数量为空"); } + if (taskQty.compareTo(BigDecimal.ZERO) < 0) { + throw new JeecgBootException("入库组盘,物料编码:" + receive.getMaterialCode() + " 收货数量不能小于0,收货数量:" + taskQty + "可收数量:" + qty); + } if (taskQty.compareTo(qty) > 0) { throw new JeecgBootException("入库组盘,物料编码:" + receive.getMaterialCode() + " 收货数量不能大于可收数量,收货数量:" + taskQty + "可收数量:" + qty); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java index 7ad163c..17dc79a 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java @@ -117,6 +117,24 @@ public class ShipmentCombinationController { } /** + * 批量创建出库任务 + * @return + */ + @ApiOperation(value = "出库组盘-批量创建出库任务", notes = "出库组盘-批量创建出库任务") + @PostMapping("/createShipmentBatchTask") + @ResponseBody + public Result createShipmentBatchTask(@RequestBody List<ShipmentContainerHeader> shipmentContainerHeaderLiat, HttpServletRequest req) { + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); + for (ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderLiat) { + Result result = huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, 0, 0, 0); + if (!result.isSuccess()) { + return result; + } + } + return Result.OK("批量创建出库任务成功"); + } + + /** * 选择分拣口 * @return */ diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java index f77a57c..f79b896 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java @@ -118,7 +118,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getWarehouseCode, warehouseCode).eq(InventoryDetail::getCompanyCode, companyCode) .eq(InventoryDetail::getMaterialCode, materialCode).eq(InventoryDetail::getInventoryStatus, inventoryStatus) - .eq(InventoryDetail::getController, QuantityConstant.CONTROLLER_NOT_ENABLE) + .eq(InventoryDetail::getEnable, QuantityConstant.INVENTORY_DETAIL_STATUS_ENABLE) .eq(InventoryDetail::getContainerStatus, QuantityConstant.STATUS_CONTAINER_EMPTY); List<InventoryDetail> inventoryDetailList = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper); return inventoryDetailList; @@ -194,12 +194,12 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi continue; } } - for (ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList) { - if (shipmentContainerHeader.getContainerCode().equals(containerCode)) { - removeInventoryList.add(inventoryDetail); - continue; - } - } +// for (ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList) { +// if (shipmentContainerHeader.getContainerCode().equals(containerCode)) { +// removeInventoryList.add(inventoryDetail); +// continue; +// } +// } } inventoryList.removeAll(removeInventoryList); if (inventoryList.size() < 1) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java index 3e5c69f..815a3f4 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java @@ -82,6 +82,7 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC HttpServletRequest req) { HuahengJwtUtil.setWarehouseCode(req, shipmentContainerHeader); QueryWrapper<ShipmentContainerHeader> queryWrapper = QueryGenerator.initQueryWrapper(shipmentContainerHeader, req.getParameterMap()); + queryWrapper.orderByDesc("id"); Page<ShipmentContainerHeader> page = new Page<ShipmentContainerHeader>(pageNo, pageSize); IPage<ShipmentContainerHeader> pageList = shipmentContainerHeaderService.page(page, queryWrapper); return Result.OK(pageList); @@ -136,7 +137,7 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC */ @AutoLog(value = "出库组盘-批量删除") @ApiOperation(value = "出库组盘-批量删除", notes = "出库组盘-批量删除") - @RequiresPermissions("shipmentContainerHeader:deleteBatch") + @RequiresPermissions("shipmentContainerHeader:delete") @DeleteMapping(value = "/deleteBatch") public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { List<String> idList = Arrays.asList(ids.split(",")); @@ -144,9 +145,11 @@ public class ShipmentContainerHeaderController extends JeecgController<ShipmentC Result result = null; for (Integer id : idInterList) { result = huahengMultiHandlerService.cancelCombine(id); + if (!result.isSuccess()) { + return result; + } } return result; -// return shipmentContainerHeaderService.cancelCombine(idInterList); } /** diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java index 8b4403a..315de77 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentDetailServiceImpl.java @@ -19,6 +19,7 @@ import org.jeecg.utils.StringUtils; import org.jeecg.utils.constant.QuantityConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -52,6 +53,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, } @Override + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "''", bizType = "'出库单追踪'", tag = "'详情添加'", extra = "#extraJsonString", msg = "''", recordReturnValue = true) public Result saveShipmentDetail(ShipmentDetail shipmentDetail) { ShipmentHeader shipmentHeader = shipmentHeaderService.getById(shipmentDetail.getShipmentId()); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java index 818041b..84c1262 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java @@ -99,7 +99,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, } @Override - @Transactional + @Transactional(rollbackFor = JeecgBootException.class) @OperationLog(bizId = "#shipmentHeader.getCode()", bizType = "'出库单追踪'", tag = "'出库单新增'", msg = "'上游单号:'+ #shipmentHeader.getReferCode() + ',仓库编码:' + #shipmentHeader.getWarehouseCode()", recordReturnValue = true) public Result saveShipmentHeader(ShipmentHeader shipmentHeader) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java index 6f16107..d1de508 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/agvTask/controller/AgvTaskController.java @@ -52,6 +52,7 @@ public class AgvTaskController extends JeecgController<AgvTask, IAgvTaskService> @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { HuahengJwtUtil.setWarehouseCode(req, agvTask); QueryWrapper<AgvTask> queryWrapper = QueryGenerator.initQueryWrapper(agvTask, req.getParameterMap()); + queryWrapper.orderByDesc("id"); Page<AgvTask> page = new Page<AgvTask>(pageNo, pageSize); IPage<AgvTask> pageList = agvTaskService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java index f39c5c9..e472289 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java @@ -102,6 +102,7 @@ public class TaskHeaderController extends HuahengBaseController { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { HuahengJwtUtil.setWarehouseCode(req, taskHeader); QueryWrapper<TaskHeader> queryWrapper = QueryGenerator.initQueryWrapper(taskHeader, req.getParameterMap()); + queryWrapper.orderByDesc("id"); Page<TaskHeader> page = new Page<TaskHeader>(pageNo, pageSize); IPage<TaskHeader> pageList = taskHeaderService.page(page, queryWrapper); return Result.OK(pageList); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index 013f8cc..ae015b9 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -1142,7 +1142,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryTransaction.setQty(receiptQty); inventoryTransaction.setReceiptQty(receiptQty); // 获得库存数量 - BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); + BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); inventoryQty = inventoryQty.add(receiptQty); inventoryTransaction.setInventoryQty(inventoryQty); inventoryTransactionList.add(inventoryTransaction); @@ -1317,6 +1317,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryTransaction.setContainerCode(containerCode); inventoryTransaction.setZoneCode(zoneCode); inventoryTransaction.setFromLocationCode(fromLocationCode); + inventoryTransaction.setToLocationCode(toLocationCode); inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec()); @@ -1332,7 +1333,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryTransaction.setProject(inventoryDetail.getProject()); inventoryTransaction.setQty(taskDetail.getQty()); inventoryTransaction.setShipmentQty(taskDetail.getQty()); - BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); + BigDecimal inventoryQty = inventoryDetailService.getInventorySumQty(inventoryDetail); inventoryTransaction.setInventoryQty(inventoryQty); inventoryTransactionList.add(inventoryTransaction); shipmentIdList.add(taskDetail.getShipmentId()); @@ -1353,6 +1354,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (!success) { throw new JeecgBootException("完成出库任务,更新库存头失败"); } + List<InventoryDetail> updateInventoryDetailList = new ArrayList<>(); + for (InventoryDetail inventoryDetail : inventoryDetailList) { + InventoryDetail inventoryDetail1 = new InventoryDetail(); + inventoryDetail1.setId(inventoryDetail.getId()); + inventoryDetail1.setLocationCode(toLocationCode); + updateInventoryDetailList.add(inventoryDetail1); + } + success = inventoryDetailService.updateBatchLocationCodeById(updateInventoryDetailList); + if (!success) { + throw new JeecgBootException("完成出库任务,更新库存详情失败"); + } } success = inventoryTransactionService.saveBatch(inventoryTransactionList); if (!success) { diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java index 9609298..a44124d 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java @@ -577,10 +577,10 @@ public class QuantityConstant { /* 不可用 */ public static final int STATUS_DISABLE = 0; - /* 库内有托盘 */ - public static final int STATUS_HAVE_CONTAINER = 1; - /* 库内没有托盘 */ - public static final int STATUS_NOT_CONTAINER = 0; + /* 可用 */ + public static final int INVENTORY_DETAIL_STATUS_ENABLE = 0; + /* 受控 */ + public static final int INVENTORY_DETAIL_STATUS_CONTAINER = 1; public static final int HTTP_OK = 200;