From 49b8b52ae6dfb28e3e9a741bb277c231bd13418d Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 04 七月 2025 15:51:45 +0800
Subject: [PATCH] 库存明细出库
---
zy-asrs-admin/src/views/out/flat/index.vue | 361 ++++++++++++-------------
zy-asrs-admin/src/views/loc/loc/index.vue | 1
/dev/null | 36 --
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/StockOutParam.java | 30 ++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/OutController.java | 12
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/PickSheet.java | 19 +
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/dto/OrderOutMergeDto.java | 4
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/PickSheetServiceImpl.java | 2
zy-asrs-admin/src/views/loc/locDetl/index.vue | 102 ++++--
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java | 217 ++++++++++++++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/OrderOutMergeParam.java | 15 +
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/PickSheetController.java | 2
12 files changed, 529 insertions(+), 272 deletions(-)
diff --git a/zy-asrs-admin/src/views/loc/loc/index.vue b/zy-asrs-admin/src/views/loc/loc/index.vue
index 058517e..846097f 100644
--- a/zy-asrs-admin/src/views/loc/loc/index.vue
+++ b/zy-asrs-admin/src/views/loc/loc/index.vue
@@ -138,7 +138,6 @@
ellipsis: true,
...getColumnSearchProps('memo'),
},
-
{
title: formatMessage('common.operation', '鎿嶄綔'),
name: 'oper',
diff --git a/zy-asrs-admin/src/views/loc/locDetl/index.vue b/zy-asrs-admin/src/views/loc/locDetl/index.vue
index 4fa6446..3e15f21 100644
--- a/zy-asrs-admin/src/views/loc/locDetl/index.vue
+++ b/zy-asrs-admin/src/views/loc/locDetl/index.vue
@@ -97,13 +97,6 @@
ellipsis: true,
...getColumnSearchProps('model'),
},
- // {
- // title: formatMessage('db.man_loc_detl.model', '鍝佺被'),
- // dataIndex: 'tagId$',
- // width: 140,
- // ellipsis: true,
- // ...getColumnSearchProps('tagId$'),
- // },
{
title: formatMessage('db.man_loc_detl.dewell', '鍏ュ簱鏃堕棿'),
dataIndex: 'dewell$',
@@ -132,12 +125,19 @@
ellipsis: true,
...getColumnSearchProps('anfme'),
},
- {
- title: formatMessage('db.man_loc_detl.freeze', '鏄惁鍐荤粨'),
- dataIndex: 'freeze$',
+ // {
+ // title: formatMessage('db.man_loc_detl.freeze', '鏄惁鍐荤粨'),
+ // dataIndex: 'freeze$',
+ // width: 140,
+ // ellipsis: true,
+ // ...getColumnSearchProps('freeze$'),
+ // },
+ {
+ title: formatMessage('db.man_loc_detl.type', '绫诲瀷'),
+ dataIndex: 'type',
width: 140,
ellipsis: true,
- ...getColumnSearchProps('freeze$'),
+ ...getColumnSearchProps('type'),
},
{
title: formatMessage('db.man_loc_detl.status', '鐘舵��'),
@@ -146,20 +146,6 @@
ellipsis: true,
...getColumnSearchProps('status$'),
},
- // {
- // title: formatMessage('db.man_loc_detl.create_time', '娣诲姞鏃堕棿'),
- // dataIndex: 'createTime$',
- // width: 140,
- // ellipsis: true,
- // ...getColumnSearchProps('createTime$'),
- // },
- // {
- // title: formatMessage('db.man_loc_detl.create_by', '娣诲姞浜哄憳'),
- // dataIndex: 'createBy$',
- // width: 140,
- // ellipsis: true,
- // ...getColumnSearchProps('createBy$'),
- // },
{
title: formatMessage('db.man_loc_detl.update_time', '淇敼鏃堕棿'),
dataIndex: 'updateTime$',
@@ -180,6 +166,14 @@
width: 140,
ellipsis: true,
...getColumnSearchProps('memo'),
+ },
+ {
+ title: formatMessage('common.operation', '鎿嶄綔'),
+ name: 'oper',
+ dataIndex: 'oper',
+ key: 'oper',
+ width: 140,
+ fixed: 'right',
},
];
@@ -236,9 +230,43 @@
}
const handleEdit = (item) => {
- editChild.value.open = true;
- editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item));
- editChild.value.isSave = item == null;
+ let content = "鏄惁纭鐢熸垚-->鍑哄簱浠诲姟锛侊紒"
+ let type = 2
+ if (item?.locNo.indexOf("B") >= 0 || item?.locNo.indexOf("C") >= 0) {
+ content = "鏄惁纭鐢熸垚-->鎷h揣鍗曪紒锛�"
+ type = 1
+ }
+ Modal.confirm({
+ title: formatMessage('page.delete', '鍑哄簱'),
+ content: formatMessage('page.delete.confirm', content),
+ maskClosable: true,
+ onOk: async () => {
+ const hide = message.loading(formatMessage('common.loading', '璇锋眰涓�'));
+ try {
+ let params = {
+ outType: type,
+ locDetls: [item]
+ }
+ post('/api/out/locs/stock', params).then(resp => {
+ let result = resp.data;
+ if (result.code === 200) {
+ console.log(result);
+ message.success(result.msg);
+ } else {
+ message.error(result.msg);
+ }
+ getPage()
+ hide()
+ })
+ } catch (error) {
+ message.error(formatMessage('common.fail', '璇锋眰澶辫触'));
+ }
+ },
+ });
+
+ // editChild.value.open = true;
+ // editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item));
+ // editChild.value.isSave = item == null;
}
const handleDel = (rows) => {
@@ -316,12 +344,13 @@
style="width: 140px;margin-right: 10px;" />
<a-input v-model:value="searchParam.batch" :placeholder="formatMessage('page.locDetl.batch.input', '璇疯緭鍏ユ壒鍙�')"
style="width: 140px;margin-right: 10px;" />
- <a-select v-model:value="searchParam.tagId" :placeholder="formatMessage('page.locDetl.orderNo.input', '璇烽�夋嫨鍝佺被')" :options="[
- { label: '榛樿鍒嗙被', value: 10 },{ label: '鏈烘补', value: 11 }, { label: '鍙橀�熺娌�', value: 17 }, { label: '鐏姳濉�', value: 18 },
- { label: '鍏绘姢鍝�', value: 25 },{ label: '娌规紗鑰楁潗', value: 26 }, { label: '鐞冨ご鎽嗚噦', value: 27 }, { label: '鐮傜焊绫�', value: 31 },
- { label: '鑿滅摐甯�', value: 32 }, { label: '閬斀绫�', value: 33 }, { label: '鎶涘厜绫�', value: 34 }, { label: '闄ゅ皹绫�', value: 35 },
- { label: '婕忔枟绫�', value: 36 }, { label: '闃叉姢绫�', value: 37 }, { label: '鐑ゆ埧淇濆吇绫�', value: 38 }, { label: '璋冩紗缃�', value: 39 },
- { label: '鍠锋灙', value: 40 }, { label: '璐规柉鎵樼郴鍒�', value: 41 },]" style="width: 140px;margin-right: 10px;">
+ <a-select v-model:value="searchParam.tagId" :placeholder="formatMessage('page.locDetl.orderNo.input', '璇烽�夋嫨鍝佺被')"
+ :options="[
+ { label: '榛樿鍒嗙被', value: 10 }, { label: '鏈烘补', value: 11 }, { label: '鍙橀�熺娌�', value: 17 }, { label: '鐏姳濉�', value: 18 },
+ { label: '鍏绘姢鍝�', value: 25 }, { label: '娌规紗鑰楁潗', value: 26 }, { label: '鐞冨ご鎽嗚噦', value: 27 }, { label: '鐮傜焊绫�', value: 31 },
+ { label: '鑿滅摐甯�', value: 32 }, { label: '閬斀绫�', value: 33 }, { label: '鎶涘厜绫�', value: 34 }, { label: '闄ゅ皹绫�', value: 35 },
+ { label: '婕忔枟绫�', value: 36 }, { label: '闃叉姢绫�', value: 37 }, { label: '鐑ゆ埧淇濆吇绫�', value: 38 }, { label: '璋冩紗缃�', value: 39 },
+ { label: '鍠锋灙', value: 40 }, { label: '璐规柉鎵樼郴鍒�', value: 41 },]" style="width: 140px;margin-right: 10px;">
</a-select>
<a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
style="width: 200px;" @search="onSearch" />
@@ -339,9 +368,8 @@
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'oper'">
<div style="display: flex;justify-content: space-evenly;">
- <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '缂栬緫') }}</a-button>
- <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '鍒犻櫎')
- }}</a-button>
+ <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '鎵嬪姩鍑哄簱') }}</a-button>
+ <!-- <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '鍒犻櫎')}}</a-button> -->
</div>
</template>
</template>
diff --git a/zy-asrs-admin/src/views/out/flat/index.vue b/zy-asrs-admin/src/views/out/flat/index.vue
index d556efe..dc7f0fc 100644
--- a/zy-asrs-admin/src/views/out/flat/index.vue
+++ b/zy-asrs-admin/src/views/out/flat/index.vue
@@ -2,24 +2,18 @@
<div class="table-header">
<div style="display: flex;padding: 10px;">
<div style="margin-right: 10px;">
- <a-input v-model:value="searchParam.pickNo"
- placeholder="璇疯緭鎷h揣鍗曠紪鍙�"
- style="width: 200px;margin-right: 10px;"/>
- <a-input v-model:value="searchParam.waveNo" placeholder="璇疯緭鍏ユ尝娆″彿"
- style="width: 200px;" />
+ <a-input v-model:value="searchParam.pickNo" placeholder="璇疯緭鎷h揣鍗曠紪鍙�"
+ style="width: 200px;margin-right: 10px;" />
+ <a-input v-model:value="searchParam.waveNo" placeholder="璇疯緭鍏ユ尝娆″彿" style="width: 200px;" />
<a-button @click="queryPickSheets" type="primary" style="margin-left: 35px">鏌ヨ</a-button>
</div>
</div>
</div>
- <a-table :columns="columns"
- :data-source="datasource" bordered
- :defaultExpandAllRows="false"
- :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
- :scroll="{y: columns.length * 140}"
- style="margin: 5px"
- >
- <template #bodyCell="{column, record, index}">
+ <a-table :columns="columns" :data-source="datasource" bordered :defaultExpandAllRows="false"
+ :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
+ :scroll="{ y: columns.length * 140 }" style="margin: 5px">
+ <template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'number'">
{{ index + 1 }}
</template>
@@ -38,7 +32,7 @@
</template>
</a-table>
<a-modal ref="sheetDetl" v-model:open="show" :width="'80%'" title="鎷h揣鍗曟槑缁�" @ok="handleOk" @cancel="cancel"
- :okText="isPrint ? '鎵撳嵃' : '纭'" cancel-text="鍏抽棴">
+ :okText="isPrint ? '鎵撳嵃' : '纭'" cancel-text="鍏抽棴">
<div id="pcik-detl">
<div class="component-header">
<div>
@@ -50,15 +44,11 @@
</h3>
</div>
<div class="qrcode">
- <a-qrcode :value="selectDetl.pickNo" :size="100" :bordered="false"/>
+ <a-qrcode :value="selectDetl.pickNo" :size="100" :bordered="false" />
</div>
</div>
- <a-table :columns="childNodes"
- :data-source="childList"
- bordered
- :pagination="{hideOnSinglePage: true}"
- >
- <template #bodyCell="{column, record, index}">
+ <a-table :columns="childNodes" :data-source="childList" bordered :pagination="{ hideOnSinglePage: true }">
+ <template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'number'">
{{ index + 1 }}
</template>
@@ -74,183 +64,184 @@
</template>
<script>
- import {post, get} from "@/utils/request.js";
- import {message, Modal} from "ant-design-vue";
- import {createVNode} from 'vue';
- import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
- import printJS from 'print-js'
+import { post, get } from "@/utils/request.js";
+import { message, Modal } from "ant-design-vue";
+import { createVNode } from 'vue';
+import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
+import printJS from 'print-js'
- export default {
- name: "out-stock-flat",
- data() {
- return {
- searchParam: {
- pickNo: '',
- waveNo:''
- },
- state: {
- selectedRowKeys: []
- },
- searchInput: '',
- columns: [
- {key: 'number', title: '搴忓彿', dataIndex: 'number', align: 'center', width: '65px'},
- {key: 'pickNo', title: '鍗曞彿', dataIndex: 'pickNo', align: 'center', width: '205px'},
- {key: 'waveNo', title: '娉㈡鍙�', dataIndex: 'waveNo', align: 'center', width: '155px'},
- {key: 'anfme', title: '鏁伴噺', dataIndex: 'anfme', align: 'center', width: '85px'},
- {key: 'status', title: '鍗曟嵁鐘舵��', dataIndex: 'status', align: 'center', width: '105px'},
- {key: 'createdTime', title: '鍒涘缓鏃堕棿', dataIndex: 'createdTime', align: 'center', width: '185px'},
- {key: 'updatedTime', title: '淇敼鏃堕棿', dataIndex: 'updatedTime', align: 'center', width: '185px'},
- {key: 'memo', title: '澶囨敞', dataIndex: '', align: 'center'},
- {
- key: 'operate',
- title: '鎿嶄綔',
- dataIndex: 'operate',
- fixed: 'right',
- align: 'center',
- width: '155px'
- }
- ],
- childNodes: [
- {key: 'number', title: '搴忓彿', dataIndex: 'number'},
- {key: 'maktx', title: '鐗╂枡鍚嶇О', dataIndex: 'maktx'},
- {key: 'matnr', title: '鐗╂枡缂栫爜', dataIndex: 'matnr'},
- {key: 'batch', title: '鎵瑰彿', dataIndex: 'batch'},
- {key: 'locNo', title: '搴撲綅', dataIndex: 'locNo'},
- {key: 'barcode', title: '鎷栫洏鐮�', dataIndex: 'barcode'},
- {key: 'anfme', title: '鏁伴噺', dataIndex: 'anfme'},
- {key: 'memo', title: '澶囨敞', dataIndex: ''},
- {key: 'status', title: '鍗曟嵁鐘舵��', dataIndex: 'status'},
- // {key: 'operate', title: '鎿嶄綔', dataIndex: 'operate'}
- ],
- datasource: [],
- childList: [],
- show: false,
- isPrint: false,
- selectDetl: {},
+export default {
+ name: "out-stock-flat",
+ data() {
+ return {
+ searchParam: {
+ pickNo: '',
+ waveNo: ''
+ },
+ state: {
+ selectedRowKeys: []
+ },
+ searchInput: '',
+ columns: [
+ { key: 'number', title: '搴忓彿', dataIndex: 'number', align: 'center', width: '65px' },
+ { key: 'pickNo', title: '鍗曞彿', dataIndex: 'pickNo', align: 'center', width: '205px' },
+ { key: 'waveNo', title: '娉㈡鍙�', dataIndex: 'waveNo', align: 'center', width: '205px' },
+ { key: 'type$', title: '绫诲瀷', dataIndex: 'type$', align: 'center', width: '155px' },
+ { key: 'anfme', title: '鏁伴噺', dataIndex: 'anfme', align: 'center', width: '85px' },
+ { key: 'status', title: '鍗曟嵁鐘舵��', dataIndex: 'status', align: 'center', width: '105px' },
+ { key: 'createdTime', title: '鍒涘缓鏃堕棿', dataIndex: 'createdTime', align: 'center', width: '185px' },
+ { key: 'updatedTime', title: '淇敼鏃堕棿', dataIndex: 'updatedTime', align: 'center', width: '185px' },
+ { key: 'memo', title: '澶囨敞', dataIndex: '', align: 'center' },
+ {
+ key: 'operate',
+ title: '鎿嶄綔',
+ dataIndex: 'operate',
+ fixed: 'right',
+ align: 'center',
+ width: '155px'
+ }
+ ],
+ childNodes: [
+ { key: 'number', title: '搴忓彿', dataIndex: 'number' },
+ { key: 'maktx', title: '鐗╂枡鍚嶇О', dataIndex: 'maktx' },
+ { key: 'matnr', title: '鐗╂枡缂栫爜', dataIndex: 'matnr' },
+ { key: 'batch', title: '鎵瑰彿', dataIndex: 'batch' },
+ { key: 'locNo', title: '搴撲綅', dataIndex: 'locNo' },
+ { key: 'barcode', title: '鎷栫洏鐮�', dataIndex: 'barcode' },
+ { key: 'anfme', title: '鏁伴噺', dataIndex: 'anfme' },
+ { key: 'memo', title: '澶囨敞', dataIndex: '' },
+ { key: 'status', title: '鍗曟嵁鐘舵��', dataIndex: 'status' },
+ // {key: 'operate', title: '鎿嶄綔', dataIndex: 'operate'}
+ ],
+ datasource: [],
+ childList: [],
+ show: false,
+ isPrint: false,
+ selectDetl: {},
+ }
+ },
+ mounted() {
+ //鑾峰彇鎷h揣鍗曟暟鎹簮
+ this.getOutFlatSheet();
+ },
+
+ methods: {
+ queryPickSheets() {
+ this.getOutFlatSheet()
+ },
+
+ handleOk() {
+ if (this.isPrint) {
+ printJS('pcik-detl', 'html')
}
},
- mounted() {
- //鑾峰彇鎷h揣鍗曟暟鎹簮
- this.getOutFlatSheet();
+
+ cancel() {
+ this.isPrint = false
+ },
+ onSelectChange(selectedRowKeys) {
+ state.selectedRowKeys = selectedRowKeys;
+
+ },
+ /**
+ * 鎵撳嵃
+ */
+ handlePrint(column, record) {
+ this.show = true
+ this.isPrint = true
+ this.selectDetl = record
+ this.getSheetDetl(record)
+ },
+ /**
+ * 鎼滅储
+ */
+ onSearch() {
+ console.log(this)
},
- methods: {
- queryPickSheets() {
- this.getOutFlatSheet()
- },
+ showDeleteConfirm(record) {
+ let that = this
+ Modal.confirm({
+ title: '鏄惁纭鍒犻櫎褰撳墠鎷h揣鍗�',
+ icon: createVNode(ExclamationCircleOutlined),
+ content: '杩炲悓鏄庣粏涓�璧峰垹闄�',
+ okText: '纭',
+ okType: 'danger',
+ cancelText: '鍙栨秷',
+ onOk() {
+ that.removeRow(record)
+ },
+ onCancel() {
+ console.log('Cancel');
+ },
+ });
+ },
- handleOk() {
- if (this.isPrint) {
- printJS('pcik-detl', 'html')
+ //鍒犻櫎褰撳墠琛�
+ removeRow(record) {
+ let that = this
+ get('/api/pick/flat/remove/' + record.id).then((resp) => {
+ let result = resp.data;
+ if (result.code == 200) {
+ that.getOutFlatSheet()
+ message.success(formatMessage('page.delete.success', '鍒犻櫎鎴愬姛'));
+ } else {
+ message.error(result.msg);
}
- },
-
- cancel() {
- this.isPrint = false
- },
- onSelectChange(selectedRowKeys) {
- state.selectedRowKeys = selectedRowKeys;
-
- },
- /**
- * 鎵撳嵃
- */
- handlePrint(column, record) {
- this.show = true
- this.isPrint = true
- this.selectDetl = record
- this.getSheetDetl(record)
- },
- /**
- * 鎼滅储
- */
- onSearch() {
- console.log(this)
- },
-
- showDeleteConfirm(record) {
- let that = this
- Modal.confirm({
- title: '鏄惁纭鍒犻櫎褰撳墠鎷h揣鍗�',
- icon: createVNode(ExclamationCircleOutlined),
- content: '杩炲悓鏄庣粏涓�璧峰垹闄�',
- okText: '纭',
- okType: 'danger',
- cancelText: '鍙栨秷',
- onOk() {
- that.removeRow(record)
- },
- onCancel() {
- console.log('Cancel');
- },
- });
- },
-
- //鍒犻櫎褰撳墠琛�
- removeRow(record) {
- let that = this
- get('/api/pick/flat/remove/' + record.id).then((resp) => {
- let result = resp.data;
- if (result.code == 200) {
- that.getOutFlatSheet()
- message.success(formatMessage('page.delete.success', '鍒犻櫎鎴愬姛'));
- } else {
- message.error(result.msg);
- }
- })
- },
- //鏌ョ湅鏄庣粏
- viewDetail(column, record) {
- this.show = !this.show
- this.isPrint = false
- this.selectDetl = record
- this.getSheetDetl(record)
- },
- getOutFlatSheet() {
- let that = this
- post('/api/pick/flat/page', {page: {currnt: 1, size: 10}, params: {pickNo: this.searchParam.pickNo, waveNo: this.searchParam.waveNo}}).then((resp) => {
- let result = resp.data;
- if (result.code == 200) {
- // message.success(formatMessage('page.add.success', '鎴愬姛'));
- that.datasource = result.data
- } else {
- message.error(result.msg);
- }
- })
- },
- getSheetDetl(record) {
- let that = this
- post('/api/pick/flat/detl/page', {
- page: {currnt: 1, size: 10},
- params: {pickId: record.id}
- }).then((resp) => {
- let result = resp.data;
- if (result.code == 200) {
- // message.success(formatMessage('page.add.success', '鎴愬姛'));
- that.childList = result.data
- } else {
- message.error(result.msg);
- }
- })
- },
- }
+ })
+ },
+ //鏌ョ湅鏄庣粏
+ viewDetail(column, record) {
+ this.show = !this.show
+ this.isPrint = false
+ this.selectDetl = record
+ this.getSheetDetl(record)
+ },
+ getOutFlatSheet() {
+ let that = this
+ post('/api/pick/flat/page', { page: { currnt: 1, size: 10 }, params: { pickNo: this.searchParam.pickNo, waveNo: this.searchParam.waveNo } }).then((resp) => {
+ let result = resp.data;
+ if (result.code == 200) {
+ // message.success(formatMessage('page.add.success', '鎴愬姛'));
+ that.datasource = result.data
+ } else {
+ message.error(result.msg);
+ }
+ })
+ },
+ getSheetDetl(record) {
+ let that = this
+ post('/api/pick/flat/detl/page', {
+ page: { currnt: 1, size: 10 },
+ params: { pickId: record.id }
+ }).then((resp) => {
+ let result = resp.data;
+ if (result.code == 200) {
+ // message.success(formatMessage('page.add.success', '鎴愬姛'));
+ that.childList = result.data
+ } else {
+ message.error(result.msg);
+ }
+ })
+ },
}
+}
</script>
<style scoped>
- .component-header {
- display: flex;
- }
+.component-header {
+ display: flex;
+}
- .component-header > div {
- flex: 1;
- }
+.component-header>div {
+ flex: 1;
+}
- .qrcode {
- display: flex;
- justify-content: flex-end;
- margin-right: 30px;
- }
+.qrcode {
+ display: flex;
+ justify-content: flex-end;
+ margin-right: 30px;
+}
</style>
\ No newline at end of file
diff --git a/zy-asrs-common/src/main/java/com/zy/asrs/common/domain/param/StockOutParam.java b/zy-asrs-common/src/main/java/com/zy/asrs/common/domain/param/StockOutParam.java
deleted file mode 100644
index 7ca0cc5..0000000
--- a/zy-asrs-common/src/main/java/com/zy/asrs/common/domain/param/StockOutParam.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.zy.asrs.common.domain.param;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * Created by vincent on 2020/6/13
- */
-@Data
-public class StockOutParam {
-
- // 鍑虹珯鍙�
- private Integer outSite;
-
- // 鐗╂枡缂栧彿闆嗗悎
- private List<LocDetl> locDetls;
-
- @Data
- public static class LocDetl {
-
- // 搴撲綅鍙�
- private String locNo;
-
- // 鍟嗗搧缂栧彿
- private String matnr;
-
- // 搴忓垪鐮�
- private String batch;
-
- // 鏁伴噺
- private Double count;
-
- }
-
-}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/OutController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/OutController.java
index 8921f91..3c19a34 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/OutController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/OutController.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.zy.asrs.wms.asrs.entity.param.StockOutParam;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.Order;
@@ -24,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
@RestController
@@ -130,6 +132,16 @@
return R.ok();
}
+ @PostMapping("/out/locs/stock")
+ @OperationLog("鎵嬪姩鍑哄簱")
+ public R stockOut(@RequestBody StockOutParam param) {
+ if (Objects.isNull(param)) {
+ throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ outManage.outLocStock(param);
+ return R.ok();
+ }
+
@PostMapping("/out/wave/generate")
@OperationLog("鐢熸垚娉㈡")
@Transactional
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/PickSheetController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/PickSheetController.java
index 66012e8..beb6d84 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/PickSheetController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/PickSheetController.java
@@ -24,7 +24,7 @@
@PostMapping("/pick/flat/page")
public R getOutFlatSheet(@RequestBody PageRequest params) {
IPage page = pickSheetService.getOutFlatSheet(params);
- return R.ok(page.getRecords());
+ return R.ok().add(page.getRecords());
}
/**
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/PickSheet.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/PickSheet.java
index d48e3b6..52fcbeb 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/PickSheet.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/PickSheet.java
@@ -3,10 +3,14 @@
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
+import java.util.Objects;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.wms.asrs.service.PickSheetService;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
@@ -28,6 +32,9 @@
* 鍗曟嵁缂栧彿
*/
private String pickNo;
+
+ @ApiModelProperty("鎷h揣鍗曠被鍨� {1. 娉㈡鍗曪紝 2. 搴撳瓨鍑哄簱}")
+ private Integer type;
/**
* 娉㈡鏍囪瘑
@@ -86,4 +93,16 @@
private Integer deleted;
private static final long serialVersionUID = 1L;
+
+
+ public String getType$() {
+ if (Objects.isNull(type)) {
+ return "娉㈡鍗曟嵁";
+ }
+ if (type == 2) {
+ return "鎵嬪姩鍑哄簱";
+ } else {
+ return "娉㈡鍗�";
+ }
+ }
}
\ No newline at end of file
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/dto/OrderOutMergeDto.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/dto/OrderOutMergeDto.java
index 8cd3cd8..fcd604d 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/dto/OrderOutMergeDto.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/dto/OrderOutMergeDto.java
@@ -3,10 +3,12 @@
import com.zy.asrs.common.utils.Synchro;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import lombok.Data;
+import lombok.experimental.Accessors;
import java.util.List;
@Data
+@Accessors(chain = true)
public class OrderOutMergeDto {
private Long locId;
@@ -23,6 +25,8 @@
private Double anfme;
+ private String portSite;
+
private Long operationPort;
private List<FieldParam> fieldParams;
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/OrderOutMergeParam.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/OrderOutMergeParam.java
index 3ff754f..dabe13b 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/OrderOutMergeParam.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/OrderOutMergeParam.java
@@ -1,30 +1,45 @@
package com.zy.asrs.wms.asrs.entity.param;
import com.mysql.cj.log.Log;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.List;
@Data
+@Accessors(chain = true)
+@ApiModel(value = "OrderOutMergeParam", description = "鍑哄簱鍚堝苟鍙傛暟")
public class OrderOutMergeParam implements Serializable {
+ @ApiModelProperty("搴撲綅ID")
private Long locId;
+ @ApiModelProperty("搴撲綅鍙�")
private String locNo;
+ @ApiModelProperty("搴撲綅鏄庣粏ID")
private Long locDetlId;
+ @ApiModelProperty("鐗╂枡鐮�")
private String matnr;
+ @ApiModelProperty("鎵规")
private String batch;
+ @ApiModelProperty("鎵ц鏁伴噺")
private Long workQty;
+ @ApiModelProperty("搴撲綅绫诲瀷")
private Long typeId;
+ @ApiModelProperty("鏁伴噺")
private Double anfme;
+ @ApiModelProperty("绔欑偣")
private Long operationPort;
private List<FieldParam> fieldParams;
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/StockOutParam.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/StockOutParam.java
new file mode 100644
index 0000000..196aa8b
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/StockOutParam.java
@@ -0,0 +1,30 @@
+package com.zy.asrs.wms.asrs.entity.param;
+
+import com.zy.asrs.wms.asrs.entity.LocDetl;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+/**
+ * Created by vincent on 2020/6/13
+ */
+@Data
+@Accessors(chain = true)
+@ApiModel(value = "StockOutParam", description = "鎵嬪姩鍑哄簱鍙傛暟")
+public class StockOutParam {
+
+ // 鍑虹珯鍙�
+ @ApiModelProperty("鍑虹珯鍙�")
+ private Integer outSite;
+
+ @ApiModelProperty("鍑哄簱绫诲瀷锛� 1.鎷h揣鍗曪紝 2. 浠诲姟妗� ")
+ private Integer outType;
+
+ // 鐗╂枡缂栧彿闆嗗悎
+ @ApiModelProperty("搴撲綅鏄庣粏闆嗗悎")
+ private List<LocDetl> locDetls;
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java
index 26e4738..71af48e 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java
@@ -1,8 +1,10 @@
package com.zy.asrs.wms.asrs.manage;
import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mysql.cj.util.StringUtils;
+import com.zy.asrs.wms.asrs.entity.param.StockOutParam;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.entity.dto.*;
@@ -1051,7 +1053,7 @@
}
if (!tucOrders.isEmpty()) {
//CTU鍑哄簱
- outStockByTUC(tucOrders, wave);
+ outStockByCTU(tucOrders, wave);
}
}
@@ -1061,7 +1063,7 @@
* @param tucOrders
* @param wave
*/
- private void outStockByTUC(List<OrderOutMergeParam> tucOrders, Wave wave) {
+ private void outStockByCTU(List<OrderOutMergeParam> tucOrders, Wave wave) {
Map<Long, List<OrderOutMergeDto>> map = checkLoc(tucOrders, wave);
for (Map.Entry<Long, List<OrderOutMergeDto>> entry : map.entrySet()) {
@@ -1152,7 +1154,7 @@
}
List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
- .eq(CacheSite::getSiteStatus, CacheSiteStatusType.O.id).eq(CacheSite::getChannel,task.getTargetSite()));
+ .eq(CacheSite::getSiteStatus, CacheSiteStatusType.O.id).eq(CacheSite::getChannel, task.getTargetSite()));
if (cacheSites.isEmpty()) {
throw new CoolException("缂撳瓨绔欑┖闂翠笉瓒筹紝璇风◢鍚庡啀璇�");
@@ -1217,6 +1219,18 @@
//鏍规嵁搴撲綅ID鍒嗙粍
Map<Long, List<OrderOutMergeParam>> listMap = flatOrders.stream().collect(Collectors.groupingBy(OrderOutMergeParam::getLocId));
+
+ genPickSheet(listMap, pickSheet);
+ }
+
+ /**
+ * @author Ryan
+ * @date 2025/7/4
+ * @description: 鐢熼潰鎷h揣鏄庣粏
+ * @version 1.0
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void genPickSheet(Map<Long, List<OrderOutMergeParam>> listMap, PickSheet pickSheet) {
//鐢熸垚鎷h揣鏄庣粏
listMap.keySet().forEach(key -> {
Loc curLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getId, key));
@@ -1246,11 +1260,14 @@
if (!locDetlService.updateById(locDetl)) {
throw new CoolException("搴撳瓨鍔犻攣澶辫触锛侊紒");
}
-
});
- });
+ curLoc.setLocStsId(LocStsType.R.val());
+ if (!locService.updateById(curLoc)) {
+ throw new CoolException("搴撲綅鐘舵�佷慨鏀瑰け璐ワ紒锛�");
+ }
+ });
}
/**
@@ -1270,24 +1287,19 @@
if (param == null) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖");
}
-
List<String> channels = param.getChannels();
if (channels == null) {
throw new CoolException("閫氶亾鍙傛暟涓嶈兘涓虹┖");
}
-
if (channels.isEmpty()) {
throw new CoolException("閫氶亾鍙傛暟涓嶈兘涓虹┖");
}
-
// for (String channel : channels) {
// long count = cacheSiteService.count(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getChannel, channel).ne(CacheSite::getSiteStatus, 0));
// if (count > 0) {
// throw new CoolException(channel + "閫氶亾宸茬粡鍒嗛厤娉㈡");
// }
// }
-
-
List<Long> orderIds = param.getOrderIds();
if (orderIds == null) {
throw new CoolException("璁㈠崟鍙傛暟涓嶈兘涓虹┖");
@@ -1448,7 +1460,190 @@
waveService.removeById(wave.getId());
}
-
}
+ /**
+ * @author Ryan
+ * @date 2025/7/3
+ * @description: 搴撳瓨鍑哄簱淇℃伅
+ * @version 1.0
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void outLocStock(StockOutParam param) {
+ System.out.println(JSONObject.toJSONString(param));
+ if (param.getOutType().equals(1)) {
+ //鎷h揣鍗�
+ outFlatStock(param);
+ } else {
+ //鐢熸垚浠诲姟妗�
+ generateTask(param);
+ }
+ }
+
+ /**
+ * @author Ryan
+ * @param: []
+ * @return: void
+ * @date: 2025/7/4
+ * @description: 鎵嬪姩鍑哄簱鐢熸垚浠诲姟
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void generateTask(StockOutParam outParam) {
+ for (LocDetl outLocDetl : outParam.getLocDetls()) {
+ List<OrderOutMergeDto> orders = new ArrayList<>();
+ LocDetl detl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getId, outLocDetl.getId()));
+ if (Objects.isNull(detl)) {
+ continue;
+ }
+ OrderOutMergeDto outMergeParam = new OrderOutMergeDto();
+ outMergeParam.setAnfme(outLocDetl.getAnfme())
+ .setLocNo(outLocDetl.getLocNo())
+ .setLocDetlId(detl.getId())
+ .setLocId(detl.getLocId())
+ .setMatnr(outLocDetl.getMatnr())
+ .setBatch(detl.getBatch());
+ orders.add(outMergeParam);
+
+ //鏍规嵁搴撲綅ID鍒嗙粍
+ Map<Long, List<OrderOutMergeDto>> listMap = orders.stream().collect(Collectors.groupingBy(OrderOutMergeDto::getLocId));
+ //鐢熸垚鎷h揣鍗曟槑缁�
+ for (Map.Entry<Long, List<OrderOutMergeDto>> entry : listMap.entrySet()) {
+ Long locId = entry.getKey();
+ List<OrderOutMergeDto> list = entry.getValue();
+ //鍒ゆ柇鏄惁鍏ㄤ粨鍑哄簱
+ Boolean all = outUtils.isAllForMerge(locId, list);
+ OrderOutMergeDto param = list.stream().findFirst().get();
+
+ List<CacheSite> sites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
+ .isNotNull(CacheSite::getOrderId));
+ if (!sites.isEmpty()) {
+ Map<String, Long> longMap = sites.stream().collect(Collectors.groupingBy(CacheSite::getChannel, Collectors.counting()));
+ Map.Entry<String, Long> entry1 = longMap.entrySet().stream().min(Map.Entry.comparingByValue()).get();
+ param.setPortSite(entry1.getKey());
+ } else {
+ CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>().last("limit 1"));
+ param.setPortSite(cacheSite.getChannel());
+ }
+ Loc loc = locService.getById(locId);
+ if (loc == null) {
+ throw new CoolException("搴撲綅涓嶅瓨鍦�");
+ }
+
+ if (!loc.getLocStsId().equals(LocStsType.F.val())) {
+ throw new CoolException(loc.getLocNo() + "搴撲綅鐘舵�佸紓甯�");
+ }
+
+ OperationPort operationPort = operationPortService
+ .getOne(new LambdaQueryWrapper<OperationPort>()
+ .eq(OperationPort::getFlag, param.getPortSite()));
+ if (Objects.isNull(operationPort)) {
+ throw new CoolException("浣滀笟鍙d笉瀛樺湪");
+ }
+ //101 鍏ㄦ嫋鍑哄簱 103 鎷h揣鍑哄簱
+ long taskType = all ? 101L : 103L;
+
+ Task task = new Task();
+ task.setTaskNo(workService.generateTaskNo(taskType));
+ task.setTaskSts(TaskStsType.GENERATE_OUT.id);
+ task.setTaskType(taskType);
+ task.setIoPri(workService.generateIoPri(taskType));
+ task.setOriginLoc(loc.getLocNo());
+ task.setTargetSite(operationPort.getFlag());
+ task.setBarcode(loc.getBarcode());
+ boolean res = taskService.save(task);
+ if (!res) {
+ throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
+ }
+
+ for (OrderOutMergeDto merge : list) {
+ LocDetl locDetl = locDetlService.getById(merge.getLocDetlId());
+ if (locDetl == null) {
+ throw new CoolException("鏄庣粏涓嶅瓨鍦�");
+ }
+
+ TaskDetl taskDetl = new TaskDetl();
+ taskDetl.sync(locDetl);
+ taskDetl.setId(null);
+ taskDetl.setTaskId(task.getId());
+ taskDetl.setTaskNo(task.getTaskNo());
+ taskDetl.setAnfme(merge.getAnfme());
+ taskDetl.setStock(locDetl.getAnfme());
+ taskDetl.setOrderId(null);
+ taskDetl.setOrderNo(null);
+ if (!taskDetlService.save(taskDetl)) {
+ throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
+ }
+
+ List<LocDetlField> locDetlFields = locDetlFieldService
+ .list(new LambdaQueryWrapper<LocDetlField>()
+ .eq(LocDetlField::getDetlId, locDetl.getId()));
+ for (LocDetlField locDetlField : locDetlFields) {
+ TaskDetlField taskDetlField = new TaskDetlField();
+ taskDetlField.sync(locDetlField);
+ taskDetlField.setId(null);
+ taskDetlField.setDetlId(taskDetl.getId());
+ boolean taskDetlFieldSave = taskDetlFieldService.save(taskDetlField);
+ if (!taskDetlFieldSave) {
+ throw new CoolException("鏄庣粏鎵╁睍鐢熸垚澶辫触");
+ }
+ }
+ }
+
+ //搴撲綅F => R
+ loc.setLocStsId(LocStsType.R.val());
+ loc.setUpdateTime(new Date());
+ boolean locUpdate = locService.updateById(loc);
+ if (!locUpdate) {
+ throw new CoolException("搴撲綅鐘舵�佹洿鏂板け璐�");
+ }
+ }
+ }
+ }
+
+
+ /**
+ * @author Ryan
+ * @date 2025/7/4
+ * @description: 骞冲簱搴撳瓨鍑哄簱
+ * @version 1.0
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void outFlatStock(StockOutParam param) {
+ //鐢熸垚鎷h揣鍗�
+ PickSheet pickSheet = new PickSheet();
+ //娉㈡鏁伴噺姹囨��
+ Double sum = param.getLocDetls().stream().mapToDouble(LocDetl::getAnfme).sum();
+ //鐢熸垚鎷h揣鍗曞彿
+ String pickNo = generatePickNO();
+ pickSheet.setId(null)
+ .setPickNo(pickNo)
+ .setMemo("搴撳瓨鍑哄簱")
+ .setAnfme(sum)
+ .setType(2);
+
+ if (!pickSheetService.save(pickSheet)) {
+ throw new CoolException("鎷h揣鍗曞啓鍏ュけ璐ワ紒锛�");
+ }
+
+ for (LocDetl locDetl : param.getLocDetls()) {
+ List<OrderOutMergeParam> orders = new ArrayList<>();
+ LocDetl detl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocNo, locDetl.getLocNo()));
+ if (Objects.isNull(detl)) {
+ continue;
+ }
+ OrderOutMergeParam outMergeParam = new OrderOutMergeParam();
+ outMergeParam.setAnfme(locDetl.getAnfme())
+ .setLocNo(locDetl.getLocNo())
+ .setLocId(detl.getLocId())
+ .setLocDetlId(detl.getId())
+ .setMatnr(locDetl.getMatnr())
+ .setBatch(detl.getBatch());
+ orders.add(outMergeParam);
+
+ //鏍规嵁搴撲綅ID鍒嗙粍
+ Map<Long, List<OrderOutMergeParam>> listMap = orders.stream().collect(Collectors.groupingBy(OrderOutMergeParam::getLocId));
+ //鐢熸垚鎷h揣鍗曟槑缁�
+ genPickSheet(listMap, pickSheet);
+ }
+ }
}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/PickSheetServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/PickSheetServiceImpl.java
index 23e4614..ae78fea 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/PickSheetServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/PickSheetServiceImpl.java
@@ -38,7 +38,7 @@
lambdaQueryWrapper.eq(!StringUtils.isNullOrEmpty(param.get("pickNo").toString()),PickSheet::getPickNo, param.get("pickNo"))
.eq(!StringUtils.isNullOrEmpty(param.get("waveNo").toString()), PickSheet::getWaveNo, param.get("waveNo"));
}
- return this.baseMapper.selectMapsPage(params.getPage(), lambdaQueryWrapper);
+ return this.baseMapper.selectPage(params.getPage(), lambdaQueryWrapper);
}
/**
--
Gitblit v1.9.1