From a19133219811f9286fa71a0fb8c1deb628cf74a3 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 28 十一月 2024 16:51:08 +0800
Subject: [PATCH] #

---
 license.lic                                                                         |    0 
 zy-asrs-admin/src/views/loc/stockAdjust/index.vue                                   |  379 +++++++++++++++++++++++
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java          |    2 
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/WorkController.java       |   87 +++++
 zy-asrs-admin/src/views/out/manual/index.vue                                        |    2 
 zy-asrs-admin/src/views/loc/locDetl/index.vue                                       |   14 
 zy-asrs-admin/src/components/mat/matQuery/index.vue                                 |  395 ++++++++++++++++++++++++
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/LocAdjustParam.java     |   15 
 zy-asrs-wms/src/main/resources/license.lic                                          |    0 
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocController.java        |   25 +
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java             |    1 
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java |   16 +
 12 files changed, 922 insertions(+), 14 deletions(-)

diff --git a/license.lic b/license.lic
index f447708..7112c07 100644
--- a/license.lic
+++ b/license.lic
Binary files differ
diff --git a/zy-asrs-admin/src/components/mat/matQuery/index.vue b/zy-asrs-admin/src/components/mat/matQuery/index.vue
new file mode 100644
index 0000000..e6147d4
--- /dev/null
+++ b/zy-asrs-admin/src/components/mat/matQuery/index.vue
@@ -0,0 +1,395 @@
+<script setup>
+import { getCurrentInstance, ref, watch, reactive } from 'vue';
+import { useRouter } from "vue-router";
+import { get, post, postForm } from '@/utils/request.js'
+import { message, Modal } from 'ant-design-vue';
+import { logout } from '@/config.js';
+import { formatMessage } from '@/utils/localeUtils.js';
+import useTableSearch from '@/utils/tableUtils.jsx';
+const context = getCurrentInstance()?.appContext.config.globalProperties;
+
+const router = useRouter();
+
+const emit = defineEmits(['handleOk'])
+
+const TABLE_KEY = 'table-mat';
+let currentPage = 1;
+let pageSize = 10;
+let tableData = ref([]);
+let selectedData = ref([]);
+const open = ref(false);
+const reload = ref(false);
+const searchInput = ref("")
+
+const showWidth = ref("60%")
+
+const {
+    getColumnSearchProps,
+} = useTableSearch();
+
+const state = reactive({
+    selectedRowKeys: [],
+    loading: false,
+    columns: [],
+});
+const onSelectChange = (selectedRowKeys, selectedRows) => {
+    // console.log('selectedRowKeys changed: ', selectedRowKeys);
+    state.selectedRowKeys = selectedRowKeys;
+    selectedData.value = selectedRows;
+};
+
+getColumns();
+getPage();
+
+state.columns = [
+    {
+        title: formatMessage('db.man_mat.tag_id', '鎵�灞炲綊绫�'),
+        dataIndex: 'tagId$',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('tagId$'),
+    },
+    {
+        title: formatMessage('db.man_mat.matnr', '鍟嗗搧缂栧彿'),
+        dataIndex: 'matnr',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('matnr'),
+    },
+    {
+        title: formatMessage('db.man_mat.maktx', '鍟嗗搧鍚嶇О'),
+        dataIndex: 'maktx',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('maktx'),
+    },
+    {
+        title: formatMessage('db.man_mat.name', '鍒悕'),
+        dataIndex: 'name',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('name'),
+    },
+    {
+        title: formatMessage('db.man_mat.specs', '瑙勬牸'),
+        dataIndex: 'specs',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('specs'),
+    },
+    {
+        title: formatMessage('db.man_mat.model', '鍨嬪彿'),
+        dataIndex: 'model',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('model'),
+    },
+    {
+        title: formatMessage('db.man_mat.color', '棰滆壊'),
+        dataIndex: 'color',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('color'),
+    },
+    {
+        title: formatMessage('db.man_mat.brand', '鍝佺墝'),
+        dataIndex: 'brand',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('brand'),
+    },
+    {
+        title: formatMessage('db.man_mat.unit', '鍗曚綅'),
+        dataIndex: 'unit',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('unit'),
+    },
+    {
+        title: formatMessage('db.man_mat.price', '鍗曚环'),
+        dataIndex: 'price',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('price'),
+    },
+    {
+        title: formatMessage('db.man_mat.sku', 'sku'),
+        dataIndex: 'sku',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('sku'),
+    },
+    {
+        title: formatMessage('db.man_mat.units', '鍗曚綅閲�'),
+        dataIndex: 'units',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('units'),
+    },
+    {
+        title: formatMessage('db.man_mat.barcode', '鏉$爜'),
+        dataIndex: 'barcode',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('barcode'),
+    },
+    {
+        title: formatMessage('db.man_mat.origin', '浜у湴'),
+        dataIndex: 'origin',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('origin'),
+    },
+    {
+        title: formatMessage('db.man_mat.manu', '鍘傚'),
+        dataIndex: 'manu',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('manu'),
+    },
+    {
+        title: formatMessage('db.man_mat.manu_date', '鐢熶骇鏃ユ湡'),
+        dataIndex: 'manuDate',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('manuDate'),
+    },
+    {
+        title: formatMessage('db.man_mat.item_num', '鍝侀」鏁�'),
+        dataIndex: 'itemNum',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('itemNum'),
+    },
+    {
+        title: formatMessage('db.man_mat.weight', '閲嶉噺'),
+        dataIndex: 'weight',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('weight'),
+    },
+    {
+        title: formatMessage('db.man_mat.length', '闀垮害'),
+        dataIndex: 'length',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('length'),
+    },
+    {
+        title: formatMessage('db.man_mat.volume', '浣撶Н'),
+        dataIndex: 'volume',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('volume'),
+    },
+    {
+        title: formatMessage('db.man_mat.three_code', '涓夋柟缂栫爜'),
+        dataIndex: 'threeCode',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('threeCode'),
+    },
+    {
+        title: formatMessage('db.man_mat.supp', '渚涘簲鍟�'),
+        dataIndex: 'supp',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('supp'),
+    },
+    {
+        title: formatMessage('db.man_mat.supp_code', '渚涘簲鍟嗙紪鐮�'),
+        dataIndex: 'suppCode',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('suppCode'),
+    },
+    {
+        title: formatMessage('db.man_mat.dead_time', '淇濊川鏈�'),
+        dataIndex: 'deadTime',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('deadTime'),
+    },
+    {
+        title: formatMessage('db.man_mat.safeStockLimit', '瀹夊叏搴撳瓨涓婇檺'),
+        dataIndex: 'safeStockLimit',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('safeStockLimit'),
+    },
+    {
+        title: formatMessage('db.man_mat.safeStockMinimum', '瀹夊叏搴撳瓨涓嬮檺'),
+        dataIndex: 'safeStockMinimum',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('safeStockMinimum'),
+    },
+    {
+        title: formatMessage('db.man_mat.validity', '鏈夋晥鏈�'),
+        dataIndex: 'validity',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('validity'),
+    },
+
+    {
+        title: formatMessage('db.man_mat.uuid', '缂栧彿'),
+        dataIndex: 'uuid',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('uuid'),
+    },
+    {
+        title: formatMessage('db.man_mat.flag', '鏍囪瘑'),
+        dataIndex: 'flag',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('flag'),
+    },
+    {
+        title: formatMessage('db.man_mat.sort', '鎺掑簭'),
+        dataIndex: 'sort',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('sort'),
+    },
+    {
+        title: formatMessage('db.man_mat.status', '鐘舵��'),
+        dataIndex: 'status$',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('status$'),
+    },
+    {
+        title: formatMessage('db.man_mat.memo', '澶囨敞'),
+        dataIndex: 'memo',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('memo'),
+    },
+
+];
+
+//鍔犺浇鎵╁睍瀛楁
+async function getColumns() {
+    let fieldResp = await post('/api/matField/list', {
+        fieldType: 0
+    })
+    let fieldResult = fieldResp.data;
+    let tmp = state.columns;
+    if (fieldResult.code == 200) {
+        let data = fieldResult.data;
+
+        data.forEach((item) => {
+            tmp.push({
+                title: formatMessage(item.language, item.describe),
+                name: item.name,
+                dataIndex: item.name,
+                key: item.name,
+                width: 140,
+                editable: true,
+            })
+        })
+
+        state.columns = tmp;
+    } else if (result.code === 401) {
+        message.error(result.msg);
+        logout()
+    } else {
+        message.error(result.msg);
+    }
+}
+
+function getPage() {
+    state.loading = true;
+
+    post('/api/mat/page', {
+        current: currentPage,
+        pageSize: pageSize,
+        condition: searchInput.value
+    }).then((resp) => {
+        let result = resp.data;
+        if (result.code == 200) {
+            let data = result.data;
+            tableData.value = data;
+
+            state.loading = false;
+        } else if (result.code === 401) {
+            message.error(result.msg);
+            logout()
+        } else {
+            message.error(result.msg);
+        }
+    })
+}
+
+const handleOk = () => {
+    open.value = false;
+    emit('handleOk', selectedData.value)
+
+    state.selectedRowKeys = []
+    selectedData.value = []
+}
+
+const handleCancel = () => {
+    open.value = false;
+}
+
+const onSearch = () => {
+    getPage()
+}
+
+const onPageChange = (page, size) => {
+    currentPage = page;
+    pageSize = size;
+    getPage();
+}
+
+const showTotalPage = (total, range) => {
+    return formatMessage('page.total.head', '鎬昏') + total + formatMessage('page.total.footer', '鏉�')
+}
+
+const reloadPage = () => {
+    currentPage = 1;
+    searchInput.value = "";
+    getPage()
+}
+
+watch(reload, (newVal, oldVal) => {
+    if (reload.value) {
+        reloadPage()
+    }
+})
+
+defineExpose({
+    tableData,
+    open,
+    showWidth,
+    reload
+})
+
+</script>
+
+<script>
+export default {
+    name: 'matQueryComponent'
+}
+</script>
+
+<template>
+    <div>
+        <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel">
+            <div class="table-header">
+                <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
+                    style="width: 200px;" @search="onSearch" />
+            </div>
+            <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
+                :pagination="{ total: tableData.total, showTotal: showTotalPage, onChange: onPageChange }"
+                :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
+                :scroll="{ y: 768 }" :columns="state.columns" :loading="state.loading">
+            </a-table>
+        </a-modal>
+    </div>
+</template>
+
+<style></style>
diff --git a/zy-asrs-admin/src/views/loc/locDetl/index.vue b/zy-asrs-admin/src/views/loc/locDetl/index.vue
index 9bf8fba..7eb6382 100644
--- a/zy-asrs-admin/src/views/loc/locDetl/index.vue
+++ b/zy-asrs-admin/src/views/loc/locDetl/index.vue
@@ -175,13 +175,13 @@
       })
     })
 
-    tmp.push({
-      title: formatMessage('common.operation', '鎿嶄綔'),
-      name: 'oper',
-      dataIndex: 'oper',
-      key: 'oper',
-      width: 140,
-    })
+    // tmp.push({
+    //   title: formatMessage('common.operation', '鎿嶄綔'),
+    //   name: 'oper',
+    //   dataIndex: 'oper',
+    //   key: 'oper',
+    //   width: 140,
+    // })
 
     state.columns = tmp;
   } else if (result.code === 401) {
diff --git a/zy-asrs-admin/src/views/loc/stockAdjust/index.vue b/zy-asrs-admin/src/views/loc/stockAdjust/index.vue
new file mode 100644
index 0000000..a3825d3
--- /dev/null
+++ b/zy-asrs-admin/src/views/loc/stockAdjust/index.vue
@@ -0,0 +1,379 @@
+<script setup>
+import { ref, reactive } from 'vue';
+import { useRouter } from "vue-router";
+import { get, post, postForm } from '@/utils/request.js'
+import { message, Modal } from 'ant-design-vue';
+import { logout } from '@/config.js';
+import { formatMessage } from '@/utils/localeUtils.js';
+import useTableSearch from '@/utils/tableUtils.jsx';
+import MatQueryView from '@/components/mat/matQuery/index.vue'
+
+const router = useRouter();
+
+const TABLE_KEY = 'table-locDetl';
+const matQueryChild = ref(null)
+const searchInput = ref(null)
+
+let tableData = ref([]);
+getColumns();
+
+const {
+    getColumnSearchProps,
+    handleResizeColumn,
+} = useTableSearch();
+
+const state = reactive({
+    selectedRowKeys: [],
+    loading: false,
+    columns: [],
+});
+const onSelectChange = selectedRowKeys => {
+    // console.log('selectedRowKeys changed: ', selectedRowKeys);
+    state.selectedRowKeys = selectedRowKeys;
+};
+
+state.columns = [
+    {
+        title: formatMessage('db.man_loc_detl.qty', '瀹為檯鏁伴噺'),
+        dataIndex: 'qty',
+        width: 140,
+        ellipsis: true,
+    },
+    {
+        title: formatMessage('db.man_loc_detl.anfme', '搴撳瓨鏁伴噺'),
+        dataIndex: 'anfme',
+        width: 140,
+        ellipsis: true,
+    },
+    {
+        title: formatMessage('db.man_loc_detl.matnr', '鍟嗗搧缂栧彿'),
+        dataIndex: 'matnr',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('matnr'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.batch', '鎵瑰彿'),
+        dataIndex: 'batch',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('batch'),
+    },
+];
+
+let columnsOther = [
+    {
+        title: formatMessage('db.man_loc_detl.loc_id', '搴撲綅'),
+        dataIndex: 'locId$',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('locId$'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.loc_no', '搴撲綅鍙�'),
+        dataIndex: 'locNo',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('locNo'),
+    },
+    // {
+    //     title: formatMessage('db.man_loc_detl.mat_id', '鍟嗗搧'),
+    //     dataIndex: 'matId$',
+    //     width: 140,
+    //     ellipsis: true,
+    //     ...getColumnSearchProps('matId$'),
+    // },
+    {
+        title: formatMessage('db.man_loc_detl.order_no', '璁㈠崟鍙�'),
+        dataIndex: 'orderNo',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('orderNo'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.anfme', '鏁伴噺'),
+        dataIndex: 'anfme',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('anfme'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.freeze', '鏄惁鍐荤粨'),
+        dataIndex: 'freeze$',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('freeze$'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.status', '鐘舵��'),
+        dataIndex: 'status$',
+        width: 140,
+        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$',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('updateTime$'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.update_by', '淇敼浜哄憳'),
+        dataIndex: 'updateBy$',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('updateBy$'),
+    },
+    {
+        title: formatMessage('db.man_loc_detl.memo', '澶囨敞'),
+        dataIndex: 'memo',
+        width: 140,
+        ellipsis: true,
+        ...getColumnSearchProps('memo'),
+    },
+]
+
+let fieldList = [];
+//鍔犺浇鎵╁睍瀛楁
+async function getColumns() {
+    let fieldResp = await post('/api/matField/list', {
+        unique: 1
+    })
+    let fieldResult = fieldResp.data;
+    let tmp = state.columns;
+    if (fieldResult.code == 200) {
+        let data = fieldResult.data;
+        data.forEach((item) => {
+            let filed = {
+                title: formatMessage(item.language, item.describe),
+                name: item.name,
+                dataIndex: item.name,
+                key: item.name,
+                width: 140,
+                editable: true,
+            }
+            tmp.push(filed)
+            fieldList.push(filed)
+        })
+
+        tmp = tmp.concat(columnsOther)
+
+        tmp.push({
+            title: formatMessage('common.operation', '鎿嶄綔'),
+            name: 'oper',
+            dataIndex: 'oper',
+            key: 'oper',
+            width: 140,
+            fixed: 'right',
+        })
+
+        state.columns = tmp;
+    } else if (result.code === 401) {
+        message.error(result.msg);
+        logout()
+    } else {
+        message.error(result.msg);
+    }
+}
+
+const openSelect = () => {
+    if (loc.value == null) {
+        message.error(formatMessage('page.stockAdjust.locDetlListNull', '璇锋绱㈠簱浣�'));
+        return;
+    }
+
+    if (loc.value.locSts$ != 'F') {
+        message.error(formatMessage('page.stockAdjust.locDetlListNull', '褰撳墠搴撲綅鐘舵�佷笉鍙皟鏁�'));
+        return;
+    }
+
+    matQueryChild.value.open = true;
+}
+
+const handleMatQueryOk = (result) => {
+    let tmp = [];
+
+    if (tableData.value != undefined) {
+        tmp = [...tableData.value]
+    }
+
+    for (let i = 0; i < result.length; i++) {
+        let item = result[i]
+        item.anfme = 0;
+        item.qty = 0;
+        item.matId = item.id;
+        item.id = null;
+
+        fieldList.forEach((filed) => {
+            item[filed.key] = ''
+        })
+
+        tmp.push(item)
+    }
+
+    tableData.value = tmp;
+}
+
+const handleDel = (record) => {
+    let data = tableData.value;
+    let tmp = []
+
+    for (let i = 0; i < data.length; i++) {
+        let item = data[i]
+        if (item.id == record.id) {
+            continue
+        }
+        tmp.push(item)
+    }
+    tableData.value = tmp
+}
+
+const loc = ref(null)
+const onSearch = () => {
+    if (searchInput.value == '' || searchInput.value == null) {
+        message.error(formatMessage('page.stockAdjust.input.loc', '璇峰厛杈撳叆搴撲綅鍙�'));
+        return;
+    }
+
+    postForm('/api/loc/search/locNo', {
+        locNo: searchInput.value,
+    }).then(resp => {
+        let result = resp.data;
+        if (result.code == 200) {
+            loc.value = result.data.loc;
+
+            let detls = [];
+            result.data.locDetls.forEach((item) => {
+                item.qty = item.anfme;
+                detls.push(item)
+            })
+            tableData.value = detls;
+        } else {
+            message.error(result.msg);
+            loc.value = null;
+            tableData.value = null;
+        }
+    })
+}
+
+const submitAdj = () => {
+    Modal.confirm({
+        title: formatMessage('page.stockAdjust.adjust', '璋冩暣搴撳瓨'),
+        content: formatMessage('page.stockAdjust.confirm', '纭畾璋冩暣搴撳瓨鍚楋紵'),
+        maskClosable: true,
+        onOk: async () => {
+            confirmAdj()
+        },
+    });
+
+}
+
+const confirmAdj = () => {
+    if (loc.value == null) {
+        message.error(formatMessage('page.stockAdjust.locDetlListNull', '璇锋绱㈠簱浣�'));
+        return;
+    }
+
+    if (loc.value.locSts$ != 'F') {
+        message.error(formatMessage('page.stockAdjust.locDetlListNull', '褰撳墠搴撲綅鐘舵�佷笉鍙皟鏁�'));
+        return;
+    }
+
+    let tmpData = tableData.value;
+    if (tmpData.length == 0) {
+        message.error(formatMessage('page.stockAdjust.locDetlListNull', '搴撳瓨淇℃伅涓嶈兘涓虹┖'));
+        return;
+    }
+
+    post('/api/loc/adjust', {
+        locNo: loc.value.locNo,
+        detls: tmpData
+    }).then(resp => {
+        let result = resp.data;
+        if (result.code == 200) {
+            message.success(formatMessage('page.stockAdjust.success', '搴撳瓨璋冩暣鎴愬姛'));
+
+            loc.value = null;
+            tableData.value = null;
+            searchInput.value = null;
+        } else {
+            message.error(result.msg);
+        }
+    })
+}
+
+</script>
+
+<script>
+export default {
+    name: '搴撳瓨璋冩暣'
+}
+</script>
+
+<template>
+    <div>
+        <div style="margin-bottom: 20px;display: flex;align-items: center;">
+            <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
+                style="width: 200px;" @search="onSearch" />
+            <div v-if="loc" style="margin-left: 20px;font-size: 18px;">
+                褰撳墠妫�绱㈠簱浣�: {{ loc.locNo }} ,搴撲綅鐘舵��: {{ loc.locSts$ }}.{{ loc.locStsId$ }}
+            </div>
+        </div>
+        <div class="table-header">
+            <div>
+                <a-button @click="openSelect">鏂板搴撳瓨</a-button>
+                <a-button style="margin-left: 5px;" type="primary" @click="submitAdj">璋冩暣搴撳瓨</a-button>
+            </div>
+        </div>
+        <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
+            :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
+            :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="state.columns"
+            @resizeColumn="handleResizeColumn">
+            <template #bodyCell="{ column, text, record }">
+                <template v-if="column.dataIndex === 'oper'">
+                    <div style="display: flex;justify-content: space-evenly;">
+                        <a-button type="link" danger @click="handleDel(record)">{{ formatMessage('page.delete', '鍒犻櫎')
+                            }}</a-button>
+                    </div>
+                </template>
+
+                <template v-if="column.dataIndex === 'qty'">
+                    <div>
+                        <a-input-number v-model:value="record[column.dataIndex]" :min="1" />
+                    </div>
+                </template>
+
+                <template v-if="column.dataIndex === 'batch'">
+                    <div>
+                        <a-input v-model:value="record[column.dataIndex]" />
+                    </div>
+                </template>
+
+                <template v-if="column.editable">
+                    <div>
+                        <a-input v-model:value="record[column.dataIndex]" />
+                    </div>
+                </template>
+            </template>
+        </a-table>
+
+        <MatQueryView ref="matQueryChild" @handle-ok="handleMatQueryOk" />
+    </div>
+</template>
+
+<style></style>
diff --git a/zy-asrs-admin/src/views/out/manual/index.vue b/zy-asrs-admin/src/views/out/manual/index.vue
index ddd5d7b..00cdf76 100644
--- a/zy-asrs-admin/src/views/out/manual/index.vue
+++ b/zy-asrs-admin/src/views/out/manual/index.vue
@@ -34,7 +34,7 @@
 
 state.columns = [
     {
-        title: formatMessage('db.man_loc_detl.anfme', '鍑哄簱鏁伴噺'),
+        title: formatMessage('db.man_loc_detl.workQty', '鍑哄簱鏁伴噺'),
         dataIndex: 'workQty',
         width: 140,
         ellipsis: true,
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocController.java
index 0fa0681..38a0079 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocController.java
@@ -4,6 +4,8 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.zy.asrs.framework.common.Cools;
 import com.zy.asrs.framework.common.R;
+import com.zy.asrs.wms.asrs.entity.LocDetl;
+import com.zy.asrs.wms.asrs.service.LocDetlService;
 import com.zy.asrs.wms.common.annotation.OperationLog;
 import com.zy.asrs.wms.common.domain.BaseParam;
 import com.zy.asrs.wms.common.domain.KeyValVo;
@@ -17,10 +19,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RestController
 @RequestMapping("/api")
@@ -28,6 +27,8 @@
 
     @Autowired
     private LocService locService;
+    @Autowired
+    private LocDetlService locDetlService;
 
     @PreAuthorize("hasAuthority('asrs:loc:list')")
     @PostMapping("/loc/page")
@@ -49,6 +50,22 @@
         return R.ok().add(locService.getById(id));
     }
 
+    @PreAuthorize("hasAuthority('asrs:loc:list')")
+    @PostMapping("/loc/search/locNo")
+    public R get(@RequestParam("locNo") String locNo) {
+        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, locNo));
+        if(loc == null) {
+            return R.error("搴撲綅涓嶅瓨鍦�");
+        }
+        List<LocDetl> locDetls = locDetlService.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocId, loc.getId()));
+        locDetls = locDetlService.parseLocDetl(locDetls);
+
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("loc", loc);
+        map.put("locDetls", locDetls);
+        return R.ok().add(map);
+    }
+
     @PreAuthorize("hasAuthority('asrs:loc:save')")
     @OperationLog("娣诲姞搴撲綅")
     @PostMapping("/loc/save")
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/WorkController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/WorkController.java
index 17d3e81..cf6b603 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/WorkController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/WorkController.java
@@ -1,15 +1,27 @@
 package com.zy.asrs.wms.asrs.controller;
 
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.zy.asrs.framework.common.Cools;
 import com.zy.asrs.framework.common.R;
+import com.zy.asrs.framework.exception.CoolException;
+import com.zy.asrs.wms.asrs.entity.Loc;
+import com.zy.asrs.wms.asrs.entity.LocDetl;
+import com.zy.asrs.wms.asrs.entity.LocDetlField;
+import com.zy.asrs.wms.asrs.entity.MatField;
 import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam;
-import com.zy.asrs.wms.asrs.service.WorkService;
+import com.zy.asrs.wms.asrs.entity.param.LocAdjustParam;
+import com.zy.asrs.wms.asrs.service.*;
 import com.zy.asrs.wms.common.annotation.OperationLog;
 import com.zy.asrs.wms.system.controller.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+
+import java.util.*;
 
 @RestController
 @RequestMapping("/api")
@@ -17,6 +29,14 @@
 
     @Autowired
     private WorkService workService;
+    @Autowired
+    private LocDetlService locDetlService;
+    @Autowired
+    private LocService locService;
+    @Autowired
+    private MatFieldService matFieldService;
+    @Autowired
+    private LocDetlFieldService locDetlFieldService;
 
     @OperationLog("鐢熸垚鍏ュ簱浠诲姟")
     @PostMapping("/rpc/generatePakIn")
@@ -33,4 +53,69 @@
         }
     }
 
+    @OperationLog("搴撳瓨璋冩暣")
+    @PostMapping("/loc/adjust")
+    @Transactional
+    public R locAdjust(@RequestBody LocAdjustParam param) {
+        if (param == null) {
+            return R.error("鍙傛暟涓嶈兘涓虹┖");
+        }
+
+        if (Cools.isEmpty(param.getLocNo())) {
+            return R.error("搴撲綅鍙蜂笉鑳戒负绌�");
+        }
+
+        if (param.getDetls() == null) {
+            return R.error("搴撳瓨鏄庣粏涓嶈兘涓虹┖");
+        }
+
+        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, param.getLocNo()));
+        if (loc == null) {
+            return R.error("搴撲綅涓嶅瓨鍦�");
+        }
+
+        //鍒犻櫎婧愬簱瀛�
+        locDetlService.removeLocDetl(loc.getId());
+
+        List<MatField> matFields = matFieldService.list(new LambdaQueryWrapper<MatField>().eq(MatField::getUnique, 1));
+        for (Map<String, Object> map : param.getDetls()) {
+            LocDetl locDetl = JSON.parseObject(JSON.toJSONString(map), LocDetl.class);
+            HashMap<String, Object> uniqueFields = new HashMap<>();
+            for (Map.Entry<String, Object> entry : map.entrySet()) {
+                for (MatField field : matFields) {
+                    if (entry.getKey().equals(field.getName())) {
+                        uniqueFields.put(entry.getKey(), entry.getValue());
+                    }
+                }
+            }
+            locDetl.setAnfme(Double.parseDouble(map.get("qty").toString()));
+            locDetl.syncFieldMap(uniqueFields);
+
+            if (locDetl.getAnfme() <= 0D) {
+                throw new CoolException("鏁伴噺涓嶈兘灏忎簬0");
+            }
+
+            locDetl.setId(null);
+            locDetl.setLocId(loc.getId());
+            locDetl.setLocNo(loc.getLocNo());
+            boolean save = locDetlService.save(locDetl);
+            if (!save) {
+                throw new CoolException("搴撳瓨璋冩暣澶辫触");
+            }
+
+            //鎻掑叆搴撳瓨鏄庣粏瀛楁
+            for (MatField matField : matFields) {
+                LocDetlField locDetlField = new LocDetlField();
+                locDetlField.setDetlId(locDetl.getId());
+                locDetlField.setFieldId(matField.getId());
+                locDetlField.setName(matField.getName());
+                locDetlField.setValue(Optional.ofNullable(uniqueFields.get(matField.getName()).toString()).orElse(""));
+                locDetlFieldService.save(locDetlField);
+            }
+
+        }
+
+        return R.ok();
+    }
+
 }
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java
index 8de20b0..e033336 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java
@@ -80,7 +80,6 @@
      * 鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  
      */
     @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  ")
-    @TableLogic
     private Integer deleted;
 
     /**
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/LocAdjustParam.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/LocAdjustParam.java
new file mode 100644
index 0000000..7f26d4c
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/LocAdjustParam.java
@@ -0,0 +1,15 @@
+package com.zy.asrs.wms.asrs.entity.param;
+
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class LocAdjustParam {
+
+    private String locNo;
+
+    private List<Map<String, Object>> detls;
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java
index 742aa16..f9b9748 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java
@@ -27,4 +27,6 @@
 
     void locDetlFreeze(LocDetlFreezeParam param);
 
+    void removeLocDetl(Long locId);
+
 }
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
index a90b5f6..badac6c 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
@@ -210,4 +210,20 @@
             }
         }
     }
+
+    @Override
+    public void removeLocDetl(Long locId) {
+        List<LocDetl> locDetls = this.list(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocId, locId));
+        for (LocDetl locDetl : locDetls) {
+            boolean remove = locDetlFieldService.remove(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locDetl.getId()));
+            if (!remove) {
+                throw new CoolException("鎵╁睍瀛楁鍒犻櫎澶辫触");
+            }
+
+            boolean result = this.removeById(locDetl.getId());
+            if (!result) {
+                throw new CoolException("鏄庣粏鍒犻櫎澶辫触");
+            }
+        }
+    }
 }
diff --git a/zy-asrs-wms/src/main/resources/license.lic b/zy-asrs-wms/src/main/resources/license.lic
index f447708..7112c07 100644
--- a/zy-asrs-wms/src/main/resources/license.lic
+++ b/zy-asrs-wms/src/main/resources/license.lic
Binary files differ

--
Gitblit v1.9.1