#
Junjie
2024-07-12 504b712bc9dac49aad4276df285968a47fdd3962
#
13个文件已修改
12个文件已添加
1个文件已删除
1 文件已复制
2 文件已重命名
2139 ■■■■ 已修改文件
zy-asrs-admin/src/views/asrs/locDetlField/edit.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/asrs/locDetlField/index.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/asrs/manLocDetl/edit.vue 321 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/asrs/manLocDetl/index.vue 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/config/matField/field.vue 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/loc/locDetl/edit.vue 244 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/loc/locDetl/index.vue 217 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocDetlController.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocDetlFieldController.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MatFieldController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetl.java 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java 234 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ViewLocDetl.java 311 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/FieldParam.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/LocDetlFieldMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/LocDetlMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/MatFieldMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ViewLocDetlMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlFieldService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/MatFieldService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlFieldServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MatFieldServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/config/MybatisPlusConfig.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/locDetlField.sql 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/resources/mapper/asrs/LocDetlFieldMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/resources/mapper/asrs/LocDetlMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-admin/src/views/asrs/locDetlField/edit.vue
File was renamed from zy-asrs-admin/src/views/asrs/matFieldValue/edit.vue
@@ -24,7 +24,7 @@
const onFinish = values => {
    // console.log('Success:', values);
    open.value = false;
    post(isSave.value ? '/api/matFieldValue/save' : '/api/matFieldValue/update', formData.value).then((resp) => {
    post(isSave.value ? '/api/locDetlField/save' : '/api/locDetlField/update', formData.value).then((resp) => {
        let result = resp.data;
        if (result.code === 200) {
            message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功'));
@@ -49,12 +49,12 @@
        matFieldQueryList.value = result.data;
    })
}
const matQueryList = ref(null);
matQuery();
function matQuery() {
    postForm('/api/mat/query', {}).then(resp => {
const locDetlQueryList = ref(null);
locDetlQuery();
function locDetlQuery() {
    postForm('/api/locDetl/query', {}).then(resp => {
        let result = resp.data;
        matQueryList.value = result.data;
        locDetlQueryList.value = result.data;
    })
}
const userQueryList = ref(null); 
@@ -78,7 +78,7 @@
<script>
export default {
    name: '商品属性扩展值-edit'
    name: '库存明细扩展-edit'
}
</script>
@@ -91,7 +91,7 @@
                style="display: flex;justify-content: space-between;flex-wrap: wrap;" autocomplete="off"
                @finish="onFinish" @finishFailed="onFinishFailed">
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.name', '字段名') "
                      :label="formatMessage('db.man_loc_detl_field.name', '字段名') "
                      name="name" 
                      style="width: 250px;" 
                            >
@@ -100,7 +100,7 @@
                     /> 
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.field_id', '字段') "
                      :label="formatMessage('db.man_loc_detl_field.field_id', '字段') "
                      name="fieldId" 
                      style="width: 250px;" 
                            >
@@ -116,23 +116,23 @@
                    </a-select>
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.mat_id', '物料') "
                      name="matId"
                      :label="formatMessage('db.man_loc_detl_field.detl_id', '库存明细') "
                      name="detlId"
                      style="width: 250px;" 
                            >
                    <a-select 
                        v-model:value="formData.matId"
                        v-model:value="formData.detlId"
                        :placeholder="formatMessage('common.select', '请选择')" 
                        style="width: 100%" 
                        show-search 
                        :options="matQueryList"
                        :options="locDetlQueryList"
                        optionFilterProp="label" 
                        optionLabelProp="label" 
                     > 
                    </a-select>
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.value', '参数值') "
                      :label="formatMessage('db.man_loc_detl_field.value', '参数值') "
                      name="value" 
                      style="width: 250px;" 
                            >
@@ -141,7 +141,7 @@
                     /> 
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.status', '状态') "
                      :label="formatMessage('db.man_loc_detl_field.status', '状态') "
                      name="status" 
                      style="width: 250px;" 
                            >
@@ -155,7 +155,7 @@
                    </a-select>
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.create_time', '添加时间') "
                      :label="formatMessage('db.man_loc_detl_field.create_time', '添加时间') "
                      name="createTime" 
                      style="width: 250px;" 
                            >
@@ -167,7 +167,7 @@
                     /> 
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.create_by', '添加人员') "
                      :label="formatMessage('db.man_loc_detl_field.create_by', '添加人员') "
                      name="createBy" 
                      style="width: 250px;" 
                            >
@@ -183,7 +183,7 @@
                    </a-select>
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.update_time', '修改时间') "
                      :label="formatMessage('db.man_loc_detl_field.update_time', '修改时间') "
                      name="updateTime" 
                      style="width: 250px;" 
                            >
@@ -195,7 +195,7 @@
                     /> 
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.update_by', '修改人员') "
                      :label="formatMessage('db.man_loc_detl_field.update_by', '修改人员') "
                      name="updateBy" 
                      style="width: 250px;" 
                            >
@@ -211,7 +211,7 @@
                    </a-select>
                        </a-form-item>
                    <a-form-item 
                      :label="formatMessage('db.man_mat_field_value.memo', '备注') "
                      :label="formatMessage('db.man_loc_detl_field.memo', '备注') "
                      name="memo" 
                      style="width: 250px;" 
                            >
zy-asrs-admin/src/views/asrs/locDetlField/index.vue
File was renamed from zy-asrs-admin/src/views/asrs/matFieldValue/index.vue
@@ -10,7 +10,7 @@
const router = useRouter();
const TABLE_KEY = 'table-matFieldValue';
const TABLE_KEY = 'table-locDetlField';
let currentPage = 1;
let pageSize = 10;
const searchInput = ref("")
@@ -21,61 +21,61 @@
const columns = [
        {
            title: formatMessage('db.man_mat_field_value.name', '字段名'),
            title: formatMessage('db.man_loc_detl_field.name', '字段名'),
            dataIndex: 'name',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.field_id', '字段'),
            title: formatMessage('db.man_loc_detl_field.field_id', '字段'),
            dataIndex: 'fieldId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.mat_id', '物料'),
            dataIndex: 'matId$',
            title: formatMessage('db.man_loc_detl_field.detl_id', '库存明细'),
            dataIndex: 'detlId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.value', '参数值'),
            title: formatMessage('db.man_loc_detl_field.value', '参数值'),
            dataIndex: 'value',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.status', '状态'),
            title: formatMessage('db.man_loc_detl_field.status', '状态'),
            dataIndex: 'status$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.create_time', '添加时间'),
            title: formatMessage('db.man_loc_detl_field.create_time', '添加时间'),
            dataIndex: 'createTime$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.create_by', '添加人员'),
            title: formatMessage('db.man_loc_detl_field.create_by', '添加人员'),
            dataIndex: 'createBy$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.update_time', '修改时间'),
            title: formatMessage('db.man_loc_detl_field.update_time', '修改时间'),
            dataIndex: 'updateTime$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.update_by', '修改人员'),
            title: formatMessage('db.man_loc_detl_field.update_by', '修改人员'),
            dataIndex: 'updateBy$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.memo', '备注'),
            title: formatMessage('db.man_loc_detl_field.memo', '备注'),
            dataIndex: 'memo',
            width: 140,
            ellipsis: true,
@@ -109,7 +109,7 @@
};
function getPage() {
  post('/api/matFieldValue/page', {
  post('/api/locDetlField/page', {
    current: currentPage,
    pageSize: pageSize,
    condition: searchInput.value
@@ -141,7 +141,7 @@
    onOk: async () => {
      const hide = message.loading(formatMessage('common.loading', '请求中'));
      try {
        post('/api/matFieldValue/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
        post('/api/locDetlField/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
          let result = resp.data;
          if (result.code === 200) {
            message.success(result.msg);
@@ -159,7 +159,7 @@
}
const handleExport = async (intl) => {
  postBlob('/api/matFieldValue/export', {}).then(result => {
  postBlob('/api/locDetlField/export', {}).then(result => {
    const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' });
    window.location.href = window.URL.createObjectURL(blob);
    return true;
@@ -185,7 +185,7 @@
<script>
export default {
  name: '商品属性扩展值'
  name: '库存明细扩展'
}
</script>
zy-asrs-admin/src/views/asrs/manLocDetl/edit.vue
New file
@@ -0,0 +1,321 @@
<script setup>
import { ref, nextTick } from 'vue';
import { get, post, postBlob, postForm } from '@/utils/request.js'
import { formatMessage } from '@/utils/localeUtils.js';
import { message } from 'ant-design-vue';
const formTable = ref(null);
const submitButton = ref(null);
const isSave = ref(true);
const open = ref(false);
const initFormData = {}
let formData = ref(initFormData);
const emit = defineEmits(['tableReload'])
const handleOk = (e) => {
    nextTick(() => {
        setTimeout(() => {
            submitButton.value.$el.click();
        }, 100);
    });
};
const onFinish = values => {
    // console.log('Success:', values);
    open.value = false;
    post(isSave.value ? '/api/manLocDetl/save' : '/api/manLocDetl/update', formData.value).then((resp) => {
        let result = resp.data;
        if (result.code === 200) {
            message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功'));
        } else {
            message.error(result.msg);
        }
        emit('tableReload', 'reload')
        nextTick(() => {
            formTable.value.resetFields()
        })
    })
};
const onFinishFailed = errorInfo => {
    console.log('Failed:', errorInfo);
};
const locQueryList = ref(null);
locQuery();
function locQuery() {
    postForm('/api/loc/query', {}).then(resp => {
        let result = resp.data;
        locQueryList.value = result.data;
    })
}
const matQueryList = ref(null);
matQuery();
function matQuery() {
    postForm('/api/mat/query', {}).then(resp => {
        let result = resp.data;
        matQueryList.value = result.data;
    })
}
const userQueryList = ref(null);
userQuery();
function userQuery() {
    postForm('/api/user/query', {}).then(resp => {
        let result = resp.data;
        userQueryList.value = result.data;
    })
}
const locDetlQueryList = ref(null);
locDetlQuery();
function locDetlQuery() {
    postForm('/api/locDetl/query', {}).then(resp => {
        let result = resp.data;
        locDetlQueryList.value = result.data;
    })
}
defineExpose({
    open,
    formData,
    initFormData,
    isSave,
})
</script>
<script>
export default {
    name: '库存明细视图-edit'
}
</script>
<template>
    <div>
        <a-modal v-model:open="open"
            :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk"
            style="width: 600px;">
            <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
                style="display: flex;justify-content: space-between;flex-wrap: wrap;" autocomplete="off"
                @finish="onFinish" @finishFailed="onFinishFailed">
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.id', 'ID') "
                      name="id"
                      style="width: 250px;"
                            :rules="[{ required: true }]"
                            >
                    <a-input
                        v-model:value="formData.id"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.loc_id', '库位') "
                      name="locId"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.locId"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="locQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.loc_no', '库位号') "
                      name="locNo"
                      style="width: 250px;"
                            :rules="[{ required: true }]"
                            >
                    <a-input
                        v-model:value="formData.locNo"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.mat_id', '物料') "
                      name="matId"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.matId"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="matQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.matnr', '物料号') "
                      name="matnr"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.matnr"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.order_no', '订单号') "
                      name="orderNo"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.orderNo"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.batch', '批号') "
                      name="batch"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.batch"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.anfme', '数量') "
                      name="anfme"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.anfme"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.status', '状态') "
                      name="status"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.status"
                        :options="[
                                { label: '正常', value: 1 },
                                { label: '禁用', value: 0 },
                            ]"
                        >
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.create_time', '添加时间') "
                      name="createTime"
                      style="width: 250px;"
                            >
                    <a-date-picker
                        v-model:value="formData.createTime"
                        show-time
                        format="YYYY-MM-DD HH:mm:ss"
                        value-format="YYYY-MM-DD HH:mm:ss"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.create_by', '添加人员') "
                      name="createBy"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.createBy"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="userQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.update_time', '修改时间') "
                      name="updateTime"
                      style="width: 250px;"
                            >
                    <a-date-picker
                        v-model:value="formData.updateTime"
                        show-time
                        format="YYYY-MM-DD HH:mm:ss"
                        value-format="YYYY-MM-DD HH:mm:ss"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.update_by', '修改人员') "
                      name="updateBy"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.updateBy"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="userQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.memo', '备注') "
                      name="memo"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.memo"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.detl_id', '库存明细') "
                      name="detlId"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.detlId"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="locDetlQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.special', '') "
                      name="special"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.special"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.special2', '') "
                      name="special2"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.special2"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.view_man_loc_detl.tttt', '') "
                      name="tttt"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.tttt"
                     />
                        </a-form-item>
                <a-form-item>
                    <a-button type="primary" html-type="submit" ref="submitButton"
                        style="visibility: hidden;">Submit</a-button>
                </a-form-item>
            </a-form>
        </a-modal>
    </div>
</template>
<style></style>
zy-asrs-admin/src/views/asrs/manLocDetl/index.vue
copy from zy-asrs-admin/src/views/asrs/matFieldValue/index.vue copy to zy-asrs-admin/src/views/asrs/manLocDetl/index.vue
File was copied from zy-asrs-admin/src/views/asrs/matFieldValue/index.vue
@@ -10,7 +10,7 @@
const router = useRouter();
const TABLE_KEY = 'table-matFieldValue';
const TABLE_KEY = 'table-manLocDetl';
let currentPage = 1;
let pageSize = 10;
const searchInput = ref("")
@@ -21,62 +21,110 @@
const columns = [
        {
            title: formatMessage('db.man_mat_field_value.name', '字段名'),
            dataIndex: 'name',
            title: formatMessage('db.view_man_loc_detl.id', 'ID'),
            dataIndex: 'id',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.field_id', '字段'),
            dataIndex: 'fieldId$',
            title: formatMessage('db.view_man_loc_detl.loc_id', '库位'),
            dataIndex: 'locId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.mat_id', '物料'),
            title: formatMessage('db.view_man_loc_detl.loc_no', '库位号'),
            dataIndex: 'locNo',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.mat_id', '物料'),
            dataIndex: 'matId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.value', '参数值'),
            dataIndex: 'value',
            title: formatMessage('db.view_man_loc_detl.matnr', '物料号'),
            dataIndex: 'matnr',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.status', '状态'),
            title: formatMessage('db.view_man_loc_detl.order_no', '订单号'),
            dataIndex: 'orderNo',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.batch', '批号'),
            dataIndex: 'batch',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.anfme', '数量'),
            dataIndex: 'anfme',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.status', '状态'),
            dataIndex: 'status$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.create_time', '添加时间'),
            title: formatMessage('db.view_man_loc_detl.create_time', '添加时间'),
            dataIndex: 'createTime$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.create_by', '添加人员'),
            title: formatMessage('db.view_man_loc_detl.create_by', '添加人员'),
            dataIndex: 'createBy$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.update_time', '修改时间'),
            title: formatMessage('db.view_man_loc_detl.update_time', '修改时间'),
            dataIndex: 'updateTime$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.update_by', '修改人员'),
            title: formatMessage('db.view_man_loc_detl.update_by', '修改人员'),
            dataIndex: 'updateBy$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_mat_field_value.memo', '备注'),
            title: formatMessage('db.view_man_loc_detl.memo', '备注'),
            dataIndex: 'memo',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.detl_id', '库存明细'),
            dataIndex: 'detlId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.special', ''),
            dataIndex: 'special',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.special2', ''),
            dataIndex: 'special2',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.view_man_loc_detl.tttt', ''),
            dataIndex: 'tttt',
            width: 140,
            ellipsis: true,
        },
@@ -109,7 +157,7 @@
};
function getPage() {
  post('/api/matFieldValue/page', {
  post('/api/manLocDetl/page', {
    current: currentPage,
    pageSize: pageSize,
    condition: searchInput.value
@@ -141,7 +189,7 @@
    onOk: async () => {
      const hide = message.loading(formatMessage('common.loading', '请求中'));
      try {
        post('/api/matFieldValue/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
        post('/api/manLocDetl/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
          let result = resp.data;
          if (result.code === 200) {
            message.success(result.msg);
@@ -159,7 +207,7 @@
}
const handleExport = async (intl) => {
  postBlob('/api/matFieldValue/export', {}).then(result => {
  postBlob('/api/manLocDetl/export', {}).then(result => {
    const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' });
    window.location.href = window.URL.createObjectURL(blob);
    return true;
@@ -185,7 +233,7 @@
<script>
export default {
  name: '商品属性扩展值'
  name: '库存明细视图'
}
</script>
zy-asrs-admin/src/views/config/matField/field.vue
File was deleted
zy-asrs-admin/src/views/loc/locDetl/edit.vue
@@ -41,26 +41,26 @@
    console.log('Failed:', errorInfo);
};
const locQueryList = ref(null);
const locQueryList = ref(null);
locQuery();
function locQuery() {
    postForm('/api/loc/query', {}).then(resp => {
function locQuery() {
    postForm('/api/loc/query', {}).then(resp => {
        let result = resp.data;
        locQueryList.value = result.data;
    })
}
const matQueryList = ref(null);
const matQueryList = ref(null);
matQuery();
function matQuery() {
    postForm('/api/mat/query', {}).then(resp => {
function matQuery() {
    postForm('/api/mat/query', {}).then(resp => {
        let result = resp.data;
        matQueryList.value = result.data;
    })
}
const userQueryList = ref(null);
const userQueryList = ref(null);
userQuery();
function userQuery() {
    postForm('/api/user/query', {}).then(resp => {
function userQuery() {
    postForm('/api/user/query', {}).then(resp => {
        let result = resp.data;
        userQueryList.value = result.data;
    })
@@ -87,175 +87,73 @@
        <a-modal v-model:open="open"
            :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk"
            style="width: 600px;">
            <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
                style="display: flex;justify-content: space-between;flex-wrap: wrap;" autocomplete="off"
                @finish="onFinish" @finishFailed="onFinishFailed">
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.loc_id', '库位') "
                      name="locId"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.locId"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="locQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
            <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }"
                :wrapper-col="{ span: 16 }" style="display: flex;justify-content: space-between;flex-wrap: wrap;"
                autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed">
                <a-form-item :label="formatMessage('db.man_loc_detl.loc_id', '库位')" name="locId" style="width: 250px;">
                    <a-select v-model:value="formData.locId" :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%" show-search :options="locQueryList" optionFilterProp="label"
                        optionLabelProp="label">
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.loc_no', '库位号') "
                      name="locNo"
                      style="width: 250px;"
                            :rules="[{ required: true }]"
                            >
                    <a-input
                        v-model:value="formData.locNo"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.mat_id', '物料') "
                      name="matId"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.matId"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="matQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.loc_no', '库位号')" name="locNo" style="width: 250px;"
                    :rules="[{ required: true }]">
                    <a-input v-model:value="formData.locNo" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.mat_id', '物料')" name="matId" style="width: 250px;">
                    <a-select v-model:value="formData.matId" :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%" show-search :options="matQueryList" optionFilterProp="label"
                        optionLabelProp="label">
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.matnr', '物料号') "
                      name="matnr"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.matnr"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.order_no', '订单号') "
                      name="orderNo"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.orderNo"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.batch', '批号') "
                      name="batch"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.batch"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.anfme', '数量') "
                      name="anfme"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.anfme"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.extend', '扩展') "
                      name="extend"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.extend"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.status', '状态') "
                      name="status"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.status"
                        :options="[
                                { label: '正常', value: 1 },
                                { label: '禁用', value: 0 },
                            ]"
                        >
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.matnr', '物料号')" name="matnr" style="width: 250px;">
                    <a-input v-model:value="formData.matnr" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.order_no', '订单号')" name="orderNo"
                    style="width: 250px;">
                    <a-input v-model:value="formData.orderNo" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.batch', '批号')" name="batch" style="width: 250px;">
                    <a-input v-model:value="formData.batch" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.anfme', '数量')" name="anfme" style="width: 250px;">
                    <a-input v-model:value="formData.anfme" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.status', '状态')" name="status"
                    style="width: 250px;">
                    <a-select v-model:value="formData.status" :options="[
                        { label: '正常', value: 1 },
                        { label: '禁用', value: 0 },
                    ]">
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.create_time', '添加时间') "
                      name="createTime"
                      style="width: 250px;"
                            >
                    <a-date-picker
                        v-model:value="formData.createTime"
                        show-time
                        format="YYYY-MM-DD HH:mm:ss"
                        value-format="YYYY-MM-DD HH:mm:ss"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.create_by', '添加人员') "
                      name="createBy"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.createBy"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="userQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.create_time', '添加时间')" name="createTime"
                    style="width: 250px;">
                    <a-date-picker v-model:value="formData.createTime" show-time format="YYYY-MM-DD HH:mm:ss"
                        value-format="YYYY-MM-DD HH:mm:ss" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.create_by', '添加人员')" name="createBy"
                    style="width: 250px;">
                    <a-select v-model:value="formData.createBy" :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%" show-search :options="userQueryList" optionFilterProp="label"
                        optionLabelProp="label">
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.update_time', '修改时间') "
                      name="updateTime"
                      style="width: 250px;"
                            >
                    <a-date-picker
                        v-model:value="formData.updateTime"
                        show-time
                        format="YYYY-MM-DD HH:mm:ss"
                        value-format="YYYY-MM-DD HH:mm:ss"
                     />
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.update_by', '修改人员') "
                      name="updateBy"
                      style="width: 250px;"
                            >
                    <a-select
                        v-model:value="formData.updateBy"
                        :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%"
                        show-search
                        :options="userQueryList"
                        optionFilterProp="label"
                        optionLabelProp="label"
                     >
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.update_time', '修改时间')" name="updateTime"
                    style="width: 250px;">
                    <a-date-picker v-model:value="formData.updateTime" show-time format="YYYY-MM-DD HH:mm:ss"
                        value-format="YYYY-MM-DD HH:mm:ss" />
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.update_by', '修改人员')" name="updateBy"
                    style="width: 250px;">
                    <a-select v-model:value="formData.updateBy" :placeholder="formatMessage('common.select', '请选择')"
                        style="width: 100%" show-search :options="userQueryList" optionFilterProp="label"
                        optionLabelProp="label">
                    </a-select>
                        </a-form-item>
                    <a-form-item
                      :label="formatMessage('db.man_loc_detl.memo', '备注') "
                      name="memo"
                      style="width: 250px;"
                            >
                    <a-input
                        v-model:value="formData.memo"
                     />
                        </a-form-item>
                </a-form-item>
                <a-form-item :label="formatMessage('db.man_loc_detl.memo', '备注')" name="memo" style="width: 250px;">
                    <a-input v-model:value="formData.memo" />
                </a-form-item>
                <a-form-item>
                    <a-button type="primary" html-type="submit" ref="submitButton"
zy-asrs-admin/src/views/loc/locDetl/index.vue
@@ -17,106 +17,13 @@
const editChild = ref(null)
let tableData = ref([]);
getColumns();
getPage();
const columns = [
        {
            title: formatMessage('db.man_loc_detl.loc_id', '库位'),
            dataIndex: 'locId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.loc_no', '库位号'),
            dataIndex: 'locNo',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.mat_id', '物料'),
            dataIndex: 'matId$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.matnr', '物料号'),
            dataIndex: 'matnr',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.order_no', '订单号'),
            dataIndex: 'orderNo',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.batch', '批号'),
            dataIndex: 'batch',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.anfme', '数量'),
            dataIndex: 'anfme',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.extend', '扩展'),
            dataIndex: 'extend',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.status', '状态'),
            dataIndex: 'status$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.create_time', '添加时间'),
            dataIndex: 'createTime$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.create_by', '添加人员'),
            dataIndex: 'createBy$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.update_time', '修改时间'),
            dataIndex: 'updateTime$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.update_by', '修改人员'),
            dataIndex: 'updateBy$',
            width: 140,
            ellipsis: true,
        },
        {
            title: formatMessage('db.man_loc_detl.memo', '备注'),
            dataIndex: 'memo',
            width: 140,
            ellipsis: true,
        },
  {
    title: formatMessage('common.operation', '操作'),
    name: 'oper',
    dataIndex: 'oper',
    key: 'oper',
    width: 140,
  },
];
const state = reactive({
  selectedRowKeys: [],
  loading: false,
  columns: [],
});
const hasSelected = computed(() => state.selectedRowKeys.length > 0);
const start = () => {
@@ -131,6 +38,124 @@
  // console.log('selectedRowKeys changed: ', selectedRowKeys);
  state.selectedRowKeys = selectedRowKeys;
};
state.columns = [
  {
    title: formatMessage('db.man_loc_detl.loc_id', '库位'),
    dataIndex: 'locId$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.loc_no', '库位号'),
    dataIndex: 'locNo',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.mat_id', '物料'),
    dataIndex: 'matId$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.matnr', '物料号'),
    dataIndex: 'matnr',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.order_no', '订单号'),
    dataIndex: 'orderNo',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.batch', '批号'),
    dataIndex: 'batch',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.anfme', '数量'),
    dataIndex: 'anfme',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.status', '状态'),
    dataIndex: 'status$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.create_time', '添加时间'),
    dataIndex: 'createTime$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.create_by', '添加人员'),
    dataIndex: 'createBy$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.update_time', '修改时间'),
    dataIndex: 'updateTime$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.update_by', '修改人员'),
    dataIndex: 'updateBy$',
    width: 140,
    ellipsis: true,
  },
  {
    title: formatMessage('db.man_loc_detl.memo', '备注'),
    dataIndex: 'memo',
    width: 140,
    ellipsis: true,
  },
];
//加载扩展字段
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) => {
      tmp.push({
        title: formatMessage(item.language, item.describe),
        name: item.name,
        dataIndex: item.name,
        key: item.name,
        width: 140,
      })
    })
    tmp.push({
      title: formatMessage('common.operation', '操作'),
      name: 'oper',
      dataIndex: 'oper',
      key: 'oper',
      width: 140,
    })
    state.columns = tmp;
  } else if (result.code === 401) {
    message.error(result.msg);
    logout()
  } else {
    message.error(result.msg);
  }
}
function getPage() {
  post('/api/locDetl/page', {
@@ -227,7 +252,7 @@
    <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
      :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
      :pagination="{ total: tableData.total, onChange: onPageChange }"
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns">
      :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="state.columns">
      <template #bodyCell="{ column, text, record }">
        <template v-if="column.dataIndex === 'oper'">
          <div style="display: flex;justify-content: space-evenly;">
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocDetlController.java
@@ -1,14 +1,18 @@
package com.zy.asrs.wms.asrs.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.*;
import com.zy.asrs.wms.asrs.service.LocDetlFieldService;
import com.zy.asrs.wms.asrs.service.MatFieldService;
import com.zy.asrs.wms.common.annotation.OperationLog;
import com.zy.asrs.wms.common.domain.BaseParam;
import com.zy.asrs.wms.common.domain.KeyValVo;
import com.zy.asrs.wms.common.domain.PageParam;
import com.zy.asrs.wms.asrs.entity.LocDetl;
import com.zy.asrs.wms.asrs.service.LocDetlService;
import com.zy.asrs.wms.system.controller.BaseController;
import com.zy.asrs.wms.utils.ExcelUtil;
@@ -28,19 +32,38 @@
    @Autowired
    private LocDetlService locDetlService;
    @Autowired
    private MatFieldService matFieldService;
    @Autowired
    private LocDetlFieldService locDetlFieldService;
    @PreAuthorize("hasAuthority('asrs:locDetl:list')")
    @PostMapping("/locDetl/page")
    public R page(@RequestBody Map<String, Object> map) {
//        BaseParam baseParam = buildParam(map, BaseParam.class);
//        PageParam<LocDetl, BaseParam> pageParam = new PageParam<>(baseParam, LocDetl.class);
//
//        PageParam<LocDetl, BaseParam> page = locDetlService.page(pageParam, pageParam.buildWrapper(true));
//        JSONObject data = JSON.parseObject(JSON.toJSONString(page));
//
//        List<LocDetl> records = page.getRecords();
//        data.put("records", records);
//        for (LocDetl locDetl : records) {
//            List<LocDetlField> list = locDetlFieldService.list(new LambdaQueryWrapper<LocDetlField>().eq(LocDetlField::getDetlId, locDetl.getId()));
//            locDetl.syncField(list);
//        }
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<LocDetl, BaseParam> pageParam = new PageParam<>(baseParam, LocDetl.class);
        return R.ok().add(locDetlService.page(pageParam, pageParam.buildWrapper(true)));
        PageParam<ViewLocDetl, BaseParam> pageParam = new PageParam<>(baseParam, ViewLocDetl.class);
        PageParam<ViewLocDetl, BaseParam> data = locDetlService.getPage(pageParam, pageParam.buildWrapper(true));
        return R.ok().add(data);
    }
    @PreAuthorize("hasAuthority('asrs:locDetl:list')")
    @PostMapping("/locDetl/list")
    public R list(@RequestBody Map<String, Object> map) {
        return R.ok().add(locDetlService.list());
        List<LocDetl> list = locDetlService.getLocDetlList(map);
        return R.ok().add(list);
    }
    @PreAuthorize("hasAuthority('asrs:locDetl:list')")
@@ -50,12 +73,31 @@
    }
    @PreAuthorize("hasAuthority('asrs:locDetl:save')")
    @OperationLog("批量插入库存明细")
    @PostMapping("/locDetl/batchAdd")
    public R save(@RequestBody List<LocDetl> locDetls) {
        return R.ok().add(locDetls);
    }
    @PreAuthorize("hasAuthority('asrs:locDetl:save')")
    @OperationLog("添加库存明细")
    @PostMapping("/locDetl/save")
    public R save(@RequestBody LocDetl locDetl) {
        if (!locDetlService.save(locDetl)) {
            return R.error("添加失败");
        }
        //插入库存明细字段
        List<MatField> matFields = matFieldService.list(new LambdaQueryWrapper<MatField>().eq(MatField::getUnique, 1));
        for (MatField matField : matFields) {
            LocDetlField locDetlField = new LocDetlField();
            locDetlField.setDetlId(locDetl.getId());
            locDetlField.setFieldId(matField.getId());
            locDetlField.setName(matField.getName());
            locDetlFieldService.save(locDetlField);
        }
        return R.ok("添加成功");
    }
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LocDetlFieldController.java
New file
@@ -0,0 +1,103 @@
package com.zy.asrs.wms.asrs.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.mapper.LocDetlFieldMapper;
import com.zy.asrs.wms.common.annotation.OperationLog;
import com.zy.asrs.wms.common.domain.BaseParam;
import com.zy.asrs.wms.common.domain.KeyValVo;
import com.zy.asrs.wms.common.domain.PageParam;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.zy.asrs.wms.asrs.service.LocDetlFieldService;
import com.zy.asrs.wms.system.controller.BaseController;
import com.zy.asrs.wms.utils.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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;
@RestController
@RequestMapping("/api")
public class LocDetlFieldController extends BaseController {
    @Autowired
    private LocDetlFieldService locDetlFieldService;
    @PreAuthorize("hasAuthority('asrs:locDetlField:list')")
    @PostMapping("/locDetlField/page")
    public R page(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<LocDetlField, BaseParam> pageParam = new PageParam<>(baseParam, LocDetlField.class);
        return R.ok().add(locDetlFieldService.page(pageParam, pageParam.buildWrapper(true)));
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:list')")
    @PostMapping("/locDetlField/list")
    public R list(@RequestBody Map<String, Object> map) {
        return R.ok().add(locDetlFieldService.list());
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:list')")
    @GetMapping("/locDetlField/{id}")
    public R get(@PathVariable("id") Long id) {
        return R.ok().add(locDetlFieldService.getById(id));
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:save')")
    @OperationLog("添加库存明细扩展")
    @PostMapping("/locDetlField/save")
    public R save(@RequestBody LocDetlField locDetlField) {
        if (!locDetlFieldService.save(locDetlField)) {
            return R.error("添加失败");
        }
        return R.ok("添加成功");
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:update')")
    @OperationLog("修改库存明细扩展")
    @PostMapping("/locDetlField/update")
    public R update(@RequestBody LocDetlField locDetlField) {
        if (!locDetlFieldService.updateById(locDetlField)) {
            return R.error("修改失败");
        }
        return R.ok("修改成功");
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:remove')")
    @OperationLog("删除库存明细扩展")
    @PostMapping("/locDetlField/remove/{ids}")
    public R remove(@PathVariable Long[] ids) {
        if (!locDetlFieldService.removeByIds(Arrays.asList(ids))) {
            return R.error("删除失败");
        }
        return R.ok("删除成功");
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:list')")
    @PostMapping("/locDetlField/query")
    public R query(@RequestParam(required = false) String condition) {
        List<KeyValVo> vos = new ArrayList<>();
        LambdaQueryWrapper<LocDetlField> wrapper = new LambdaQueryWrapper<>();
        if (!Cools.isEmpty(condition)) {
            wrapper.like(LocDetlField::getId, condition);
        }
        locDetlFieldService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
                item -> vos.add(new KeyValVo(item.getId(), item.getId()))
        );
        return R.ok().add(vos);
    }
    @PreAuthorize("hasAuthority('asrs:locDetlField:list')")
    @PostMapping("/locDetlField/export")
    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
        ExcelUtil.build(ExcelUtil.create(locDetlFieldService.list(), LocDetlField.class), response);
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MatFieldController.java
@@ -4,6 +4,7 @@
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.service.LocDetlFieldService;
import com.zy.asrs.wms.common.annotation.OperationLog;
import com.zy.asrs.wms.common.domain.BaseParam;
import com.zy.asrs.wms.common.domain.KeyValVo;
@@ -40,7 +41,11 @@
    @PreAuthorize("hasAuthority('asrs:matField:list')")
    @PostMapping("/matField/list")
    public R list(@RequestBody Map<String, Object> map) {
        return R.ok().add(matFieldService.list());
        List<MatField> list = matFieldService.list();
        if (map.containsKey("unique")) {
            list = matFieldService.list(new LambdaQueryWrapper<MatField>().eq(MatField::getUnique, map.get("unique")));
        }
        return R.ok().add(list);
    }
    @PreAuthorize("hasAuthority('asrs:matField:list')")
@@ -56,6 +61,8 @@
        if (!matFieldService.save(matField)) {
            return R.error("添加失败");
        }
        matFieldService.createView();//更新视图
        return R.ok("添加成功");
    }
@@ -66,6 +73,8 @@
        if (!matFieldService.updateById(matField)) {
            return R.error("修改失败");
        }
        matFieldService.createView();//更新视图
        return R.ok("修改成功");
    }
@@ -76,6 +85,8 @@
        if (!matFieldService.removeByIds(Arrays.asList(ids))) {
            return R.error("删除失败");
        }
        matFieldService.createView();//更新视图
        return R.ok("删除成功");
    }
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetl.java
@@ -1,9 +1,13 @@
package com.zy.asrs.wms.asrs.entity;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.*;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.zy.asrs.common.utils.Synchro;
import com.zy.asrs.wms.asrs.service.LocService;
import com.zy.asrs.wms.asrs.service.MatService;
import com.zy.asrs.wms.system.entity.Host;
@@ -83,12 +87,6 @@
    private Double anfme;
    /**
     * 扩展
     */
    @ApiModelProperty(value= "扩展")
    private String extend;
    /**
     * 所属机构
     */
    @ApiModelProperty(value= "所属机构")
@@ -141,7 +139,7 @@
    public LocDetl() {}
    public LocDetl(Long locId,String locNo,Long matId,String matnr,String orderNo,String batch,Double anfme,String extend,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
    public LocDetl(Long locId,String locNo,Long matId,String matnr,String orderNo,String batch,Double anfme,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
        this.locId = locId;
        this.locNo = locNo;
        this.matId = matId;
@@ -149,7 +147,6 @@
        this.orderNo = orderNo;
        this.batch = batch;
        this.anfme = anfme;
        this.extend = extend;
        this.hostId = hostId;
        this.status = status;
        this.deleted = deleted;
@@ -262,5 +259,61 @@
        return null;
    }
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
    //动态扩展字段
    public transient Map<String, Object> dynamicFields = new HashMap<>();
    @JsonAnyGetter
    public Map<String,Object> getDynamicFields() {
        return dynamicFields;
    }
    public void syncField(List<LocDetlField> list) {
        ArrayList<String> keys = new ArrayList<>();
        Field[] fields = this.getClass().getFields();
        for (Field field : fields) {
            keys.add(field.getName());
        }
        Map<String, Object> dynamicFields = new HashMap<>();
        for (LocDetlField locDetlField : list) {
            if (keys.contains(locDetlField.getName())) {
                continue;
            }
            dynamicFields.put(locDetlField.getName(), locDetlField.getValue());
        }
        this.dynamicFields = dynamicFields;
    }
    public void syncFieldMap(Map<String, Object> map) {
        ArrayList<String> keys = new ArrayList<>();
        Field[] fields = this.getClass().getDeclaredFields();
        for (Field field : fields) {
            keys.add(field.getName());
        }
        keys.add("detlId");
        Map<String, Object> dynamicFields = new HashMap<>();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (keys.contains(entry.getKey())) {
                continue;
            }
            dynamicFields.put(entry.getKey(), entry.getValue());
        }
        this.dynamicFields = dynamicFields;
    }
    public String getFieldString(String key) {
        return dynamicFields.get(key).toString();
    }
    public void setField(String key, Object value) {
        dynamicFields.put(key, value);
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LocDetlField.java
New file
@@ -0,0 +1,234 @@
package com.zy.asrs.wms.asrs.entity;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.zy.asrs.wms.asrs.service.LocDetlService;
import com.zy.asrs.wms.asrs.service.MatFieldService;
import com.zy.asrs.wms.system.entity.Host;
import com.zy.asrs.wms.system.entity.User;
import org.springframework.format.annotation.DateTimeFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wms.system.service.UserService;
import com.zy.asrs.wms.system.service.HostService;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName("man_loc_detl_field")
public class LocDetlField implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 字段名
     */
    @ApiModelProperty(value= "字段名")
    private String name;
    /**
     * 字段
     */
    @ApiModelProperty(value= "字段")
    private Long fieldId;
    /**
     * 库存明细
     */
    @ApiModelProperty(value= "库存明细")
    private Long detlId;
    /**
     * 参数值
     */
    @ApiModelProperty(value= "参数值")
    private String value;
    /**
     * 所属机构
     */
    @ApiModelProperty(value= "所属机构")
    private Long hostId;
    /**
     * 状态 1: 正常  0: 禁用
     */
    @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ")
    private Integer status;
    /**
     * 是否删除 1: 是  0: 否
     */
    @ApiModelProperty(value= "是否删除 1: 是  0: 否  ")
    @TableLogic
    private Integer deleted;
    /**
     * 添加时间
     */
    @ApiModelProperty(value= "添加时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 添加人员
     */
    @ApiModelProperty(value= "添加人员")
    private Long createBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value= "修改时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 修改人员
     */
    @ApiModelProperty(value= "修改人员")
    private Long updateBy;
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    private String memo;
    public LocDetlField() {}
    public LocDetlField(String name,Long fieldId,Long detlId,String value,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
        this.name = name;
        this.fieldId = fieldId;
        this.detlId = detlId;
        this.value = value;
        this.hostId = hostId;
        this.status = status;
        this.deleted = deleted;
        this.createTime = createTime;
        this.createBy = createBy;
        this.updateTime = updateTime;
        this.updateBy = updateBy;
        this.memo = memo;
    }
//    LocDetlField locDetlField = new LocDetlField(
//            null,    // 字段名
//            null,    // 字段
//            null,    // 库存明细
//            null,    // 参数值
//            null,    // 所属机构
//            null,    // 状态
//            null,    // 是否删除
//            null,    // 添加时间
//            null,    // 添加人员
//            null,    // 修改时间
//            null,    // 修改人员
//            null    // 备注
//    );
    public String getFieldId$(){
        MatFieldService service = SpringUtils.getBean(MatFieldService.class);
        MatField matField = service.getById(this.fieldId);
        if (!Cools.isEmpty(matField)){
            return String.valueOf(matField.getId());
        }
        return null;
    }
    public String getDetlId$(){
        LocDetlService service = SpringUtils.getBean(LocDetlService.class);
        LocDetl locDetl = service.getById(this.detlId);
        if (!Cools.isEmpty(locDetl)){
            return String.valueOf(locDetl.getId());
        }
        return null;
    }
    public String getHostId$(){
        HostService service = SpringUtils.getBean(HostService.class);
        Host host = service.getById(this.hostId);
        if (!Cools.isEmpty(host)){
            return String.valueOf(host.getName());
        }
        return null;
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return "正常";
            case 0:
                return "禁用";
            default:
                return String.valueOf(this.status);
        }
    }
    public String getDeleted$(){
        if (null == this.deleted){ return null; }
        switch (this.deleted){
            case 1:
                return "是";
            case 0:
                return "否";
            default:
                return String.valueOf(this.deleted);
        }
    }
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public String getCreateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.getById(this.createBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
    public String getUpdateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.getById(this.updateBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ViewLocDetl.java
New file
@@ -0,0 +1,311 @@
package com.zy.asrs.wms.asrs.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.zy.asrs.common.utils.Synchro;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wms.asrs.service.LocService;
import com.zy.asrs.wms.asrs.service.MatService;
import com.zy.asrs.wms.system.entity.Host;
import com.zy.asrs.wms.system.entity.User;
import com.zy.asrs.wms.system.service.HostService;
import com.zy.asrs.wms.system.service.UserService;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.*;
@Data
@TableName("view_man_loc_detl")
public class ViewLocDetl implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 库位
     */
    @ApiModelProperty(value= "库位")
    private Long locId;
    /**
     * 库位号
     */
    @ApiModelProperty(value= "库位号")
    private String locNo;
    /**
     * 物料
     */
    @ApiModelProperty(value= "物料")
    private Long matId;
    /**
     * 物料号
     */
    @ApiModelProperty(value= "物料号")
    private String matnr;
    /**
     * 订单号
     */
    @ApiModelProperty(value= "订单号")
    private String orderNo;
    /**
     * 批号
     */
    @ApiModelProperty(value= "批号")
    private String batch;
    /**
     * 数量
     */
    @ApiModelProperty(value= "数量")
    private Double anfme;
    /**
     * 所属机构
     */
    @ApiModelProperty(value= "所属机构")
    private Long hostId;
    /**
     * 状态 1: 正常  0: 禁用
     */
    @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ")
    private Integer status;
    /**
     * 是否删除 1: 是  0: 否
     */
    @ApiModelProperty(value= "是否删除 1: 是  0: 否  ")
    @TableLogic
    private Integer deleted;
    /**
     * 添加时间
     */
    @ApiModelProperty(value= "添加时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 添加人员
     */
    @ApiModelProperty(value= "添加人员")
    private Long createBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value= "修改时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 修改人员
     */
    @ApiModelProperty(value= "修改人员")
    private Long updateBy;
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    private String memo;
    public ViewLocDetl() {}
    public ViewLocDetl(Long locId, String locNo, Long matId, String matnr, String orderNo, String batch, Double anfme, Long hostId, Integer status, Integer deleted, Date createTime, Long createBy, Date updateTime, Long updateBy, String memo) {
        this.locId = locId;
        this.locNo = locNo;
        this.matId = matId;
        this.matnr = matnr;
        this.orderNo = orderNo;
        this.batch = batch;
        this.anfme = anfme;
        this.hostId = hostId;
        this.status = status;
        this.deleted = deleted;
        this.createTime = createTime;
        this.createBy = createBy;
        this.updateTime = updateTime;
        this.updateBy = updateBy;
        this.memo = memo;
    }
//    LocDetl locDetl = new LocDetl(
//            null,    // 库位
//            null,    // 库位号[非空]
//            null,    // 物料
//            null,    // 物料号
//            null,    // 订单号
//            null,    // 批号
//            null,    // 数量
//            null,    // 扩展
//            null,    // 所属机构
//            null,    // 状态
//            null,    // 是否删除
//            null,    // 添加时间
//            null,    // 添加人员
//            null,    // 修改时间
//            null,    // 修改人员
//            null    // 备注
//    );
    public String getLocId$(){
        LocService service = SpringUtils.getBean(LocService.class);
        Loc loc = service.getById(this.locId);
        if (!Cools.isEmpty(loc)){
            return String.valueOf(loc.getLocNo());
        }
        return null;
    }
    public String getMatId$(){
        MatService service = SpringUtils.getBean(MatService.class);
        Mat mat = service.getById(this.matId);
        if (!Cools.isEmpty(mat)){
            return String.valueOf(mat.getId());
        }
        return null;
    }
    public String getHostId$(){
        HostService service = SpringUtils.getBean(HostService.class);
        Host host = service.getById(this.hostId);
        if (!Cools.isEmpty(host)){
            return String.valueOf(host.getName());
        }
        return null;
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return "正常";
            case 0:
                return "禁用";
            default:
                return String.valueOf(this.status);
        }
    }
    public String getDeleted$(){
        if (null == this.deleted){ return null; }
        switch (this.deleted){
            case 1:
                return "是";
            case 0:
                return "否";
            default:
                return String.valueOf(this.deleted);
        }
    }
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public String getCreateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.getById(this.createBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
    public String getUpdateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.getById(this.updateBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
    //动态扩展字段
    public transient Map<String, Object> dynamicFields = new HashMap<>();
    @JsonAnyGetter
    public Map<String,Object> getDynamicFields() {
        return dynamicFields;
    }
    public void syncField(List<LocDetlField> list) {
        ArrayList<String> keys = new ArrayList<>();
        Field[] fields = this.getClass().getFields();
        for (Field field : fields) {
            keys.add(field.getName());
        }
        Map<String, Object> dynamicFields = new HashMap<>();
        for (LocDetlField locDetlField : list) {
            if (keys.contains(locDetlField.getName())) {
                continue;
            }
            dynamicFields.put(locDetlField.getName(), locDetlField.getValue());
        }
        this.dynamicFields = dynamicFields;
    }
    public void syncFieldMap(Map<String, Object> map) {
        ArrayList<String> keys = new ArrayList<>();
        Field[] fields = this.getClass().getDeclaredFields();
        for (Field field : fields) {
            keys.add(field.getName());
        }
        keys.add("detlId");
        Map<String, Object> dynamicFields = new HashMap<>();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (keys.contains(entry.getKey())) {
                continue;
            }
            dynamicFields.put(entry.getKey(), entry.getValue());
        }
        this.dynamicFields = dynamicFields;
    }
    public String getFieldString(String key) {
        return dynamicFields.get(key).toString();
    }
    public void setField(String key, Object value) {
        dynamicFields.put(key, value);
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/param/FieldParam.java
New file
@@ -0,0 +1,12 @@
package com.zy.asrs.wms.asrs.entity.param;
import lombok.Data;
@Data
public class FieldParam {
    private String name;
    private Object value;
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/LocDetlFieldMapper.java
New file
@@ -0,0 +1,19 @@
package com.zy.asrs.wms.asrs.mapper;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface LocDetlFieldMapper extends BaseMapper<LocDetlField> {
    LocDetlField getLocDetlField(FieldParam param);
    List<LocDetlField> getList(List<FieldParam> list);
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/LocDetlMapper.java
@@ -5,8 +5,12 @@
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface LocDetlMapper extends BaseMapper<LocDetl> {
    List<LocDetl> getList(String matnr, String batch, List<Long> ids);
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/MatFieldMapper.java
@@ -1,12 +1,38 @@
package com.zy.asrs.wms.asrs.mapper;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.zy.asrs.wms.asrs.entity.MatField;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
public interface MatFieldMapper extends BaseMapper<MatField> {
    @SelectProvider(type = SqlProvider.class, method = "createViewSql")
    void createView(@Param("list") List<MatField> list);
    class SqlProvider {
        public String createViewSql(Map<String, Object> params) {
            List<MatField> list = (List<MatField>) params.get("list");
            StringBuilder sql = new StringBuilder();
            sql.append(" CREATE OR REPLACE VIEW view_man_loc_detl_field AS \n");
            sql.append(" SELECT detl_id ");
            for (MatField matField : list) {
                sql.append(", MAX(CASE WHEN name = '").append(matField.getName()).append("' THEN value END) AS ").append(matField.getName());
            }
            sql.append(" FROM man_loc_detl_field ");
            sql.append(" GROUP BY detl_id ");
            return sql.toString();
        }
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ViewLocDetlMapper.java
New file
@@ -0,0 +1,20 @@
package com.zy.asrs.wms.asrs.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zy.asrs.wms.asrs.entity.ViewLocDetl;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
public interface ViewLocDetlMapper extends BaseMapper<ViewLocDetl> {
    List<Map<String,Object>> getList(String matnr, String batch, List<FieldParam> param);
    Map<String,Object> getById(Long id);
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlFieldService.java
New file
@@ -0,0 +1,16 @@
package com.zy.asrs.wms.asrs.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import java.util.List;
import java.util.Map;
public interface LocDetlFieldService extends IService<LocDetlField> {
    LocDetlField getLocDetlField(FieldParam param);
    List<LocDetlField> getList(List<FieldParam> list);
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/LocDetlService.java
@@ -1,8 +1,21 @@
package com.zy.asrs.wms.asrs.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zy.asrs.wms.asrs.entity.LocDetl;
import com.zy.asrs.wms.asrs.entity.ViewLocDetl;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import com.zy.asrs.wms.common.domain.BaseParam;
import com.zy.asrs.wms.common.domain.PageParam;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
import java.util.Map;
public interface LocDetlService extends IService<LocDetl> {
    PageParam<ViewLocDetl, BaseParam> getPage(PageParam<ViewLocDetl, BaseParam> pageParam, QueryWrapper<ViewLocDetl> buildWrapper);
    List<LocDetl> getLocDetlList(Map<String, Object> map);
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/MatFieldService.java
@@ -5,4 +5,6 @@
public interface MatFieldService extends IService<MatField> {
    void createView();
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlFieldServiceImpl.java
New file
@@ -0,0 +1,26 @@
package com.zy.asrs.wms.asrs.service.impl;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import com.zy.asrs.wms.asrs.mapper.LocDetlFieldMapper;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.zy.asrs.wms.asrs.service.LocDetlFieldService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@Service("locDetlFieldService")
public class LocDetlFieldServiceImpl extends ServiceImpl<LocDetlFieldMapper, LocDetlField> implements LocDetlFieldService {
    @Override
    public LocDetlField getLocDetlField(FieldParam param) {
        return this.baseMapper.getLocDetlField(param);
    }
    @Override
    public List<LocDetlField> getList(List<FieldParam> list) {
        return this.baseMapper.getList(list);
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/LocDetlServiceImpl.java
@@ -1,12 +1,75 @@
package com.zy.asrs.wms.asrs.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.zy.asrs.wms.asrs.entity.ViewLocDetl;
import com.zy.asrs.wms.asrs.entity.param.FieldParam;
import com.zy.asrs.wms.asrs.mapper.LocDetlMapper;
import com.zy.asrs.wms.asrs.entity.LocDetl;
import com.zy.asrs.wms.asrs.mapper.ViewLocDetlMapper;
import com.zy.asrs.wms.asrs.service.LocDetlService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zy.asrs.wms.common.domain.BaseParam;
import com.zy.asrs.wms.common.domain.PageParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service("locDetlService")
public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService {
    @Autowired
    private ViewLocDetlMapper viewLocDetlMapper;
    @Override
    public PageParam<ViewLocDetl, BaseParam> getPage(PageParam<ViewLocDetl, BaseParam> pageParam, QueryWrapper<ViewLocDetl> buildWrapper) {
        PageParam<ViewLocDetl, BaseParam> result = viewLocDetlMapper.selectPage(pageParam, buildWrapper);
        //解析动态字段
        JSONObject data = JSON.parseObject(JSON.toJSONString(result));
        List<ViewLocDetl> records = result.getRecords();
        data.put("records", records);
        for (ViewLocDetl locDetl : records) {
            Map<String, Object> resultMap = viewLocDetlMapper.getById(locDetl.getId());
            locDetl.syncFieldMap(resultMap);
        }
        return result;
    }
    @Override
    public List<LocDetl> getLocDetlList(Map<String, Object> map) {
        String matnr = null;
        String batch = null;
        if (map.containsKey("matnr")) {
            matnr = map.get("matnr").toString();
            map.remove("matnr");
        }
        if (map.containsKey("batch")) {
            batch = map.get("batch").toString();
            map.remove("batch");
        }
        ArrayList<FieldParam> param = new ArrayList<>();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (entry.getValue() == null) {
                continue;
            }
            FieldParam fieldParam = new FieldParam();
            fieldParam.setName(entry.getKey());
            fieldParam.setValue(entry.getValue());
            param.add(fieldParam);
        }
        List<Map<String, Object>> list2 = viewLocDetlMapper.getList(matnr, batch, param);
        List<LocDetl> locDetls = new ArrayList<>();
        for (Map<String, Object> objectMap : list2) {
            LocDetl locDetl = JSON.parseObject(JSON.toJSONString(objectMap), LocDetl.class);
            locDetl.syncFieldMap(objectMap);
            locDetls.add(locDetl);
        }
        return locDetls;
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MatFieldServiceImpl.java
@@ -1,12 +1,21 @@
package com.zy.asrs.wms.asrs.service.impl;
import com.zy.asrs.wms.asrs.entity.LocDetlField;
import com.zy.asrs.wms.asrs.mapper.MatFieldMapper;
import com.zy.asrs.wms.asrs.entity.MatField;
import com.zy.asrs.wms.asrs.service.MatFieldService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("matFieldService")
public class MatFieldServiceImpl extends ServiceImpl<MatFieldMapper, MatField> implements MatFieldService {
    @Override
    public void createView() {
        List<MatField> list = this.list();
        this.baseMapper.createView(list);
    }
}
zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/config/MybatisPlusConfig.java
@@ -1,5 +1,7 @@
package com.zy.asrs.wms.common.config;
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
import com.baomidou.mybatisplus.extension.MybatisMapWrapperFactory;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
@@ -46,7 +48,8 @@
                return Arrays.asList(
                        "sys_host",
                        "sys_user_role",
                        "sys_role_menu"
                        "sys_role_menu",
                        "view_man_loc_detl_field"
                ).contains(tableName);
            }
@@ -83,4 +86,9 @@
        return new NullValue();
    }
    @Bean
    public ConfigurationCustomizer mybatisConfigurationCustomizer(){
        return configuration -> configuration.setObjectWrapperFactory(new MybatisMapWrapperFactory());
    }
}
zy-asrs-wms/src/main/java/locDetlField.sql
New file
@@ -0,0 +1,9 @@
-- save locDetlField record
-- mysql
insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( '库存明细扩展管理', '0', '/asrs/locDetlField', '/asrs/locDetlField', '0' , '0', '1' , '1');
insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '查询库存明细扩展', '', '1', 'asrs:locDetlField:list', '0', '1', '1');
insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '添加库存明细扩展', '', '1', 'asrs:locDetlField:save', '1', '1', '1');
insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '修改库存明细扩展', '', '1', 'asrs:locDetlField:update', '2', '1', '1');
insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '删除库存明细扩展', '', '1', 'asrs:locDetlField:remove', '3', '1', '1');
zy-asrs-wms/src/main/resources/mapper/asrs/LocDetlFieldMapper.xml
New file
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.asrs.wms.asrs.mapper.LocDetlFieldMapper">
    <select id="getLocDetlField" resultType="com.zy.asrs.wms.asrs.entity.LocDetlField">
        SELECT * FROM man_loc_detl_field
        WHERE CONCAT(`name`, `value`) like concat(#{param.name},'%',#{param.value},'%')
    </select>
    <select id="getList" resultType="com.zy.asrs.wms.asrs.entity.LocDetlField">
        <foreach item="item" collection="list" index="index">
            <if test="index == 0">
                SELECT * FROM man_loc_detl_field
                WHERE CONCAT(`name`, `value`) like concat(#{item.name},'%',#{item.value},'%')
            </if>
            <if test="index != 0">
                union
                SELECT * FROM man_loc_detl_field
                WHERE CONCAT(`name`, `value`) like concat(#{item.name},'%',#{item.value},'%')
            </if>
        </foreach>
    </select>
</mapper>
zy-asrs-wms/src/main/resources/mapper/asrs/LocDetlMapper.xml
@@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.asrs.wms.asrs.mapper.LocDetlMapper">
    <select id="getList" resultType="com.zy.asrs.wms.asrs.entity.LocDetl">
        select * from man_loc_detl
        where matnr = #{matnr}
        <if test="batch!=null">
            and batch = #{batch}
        </if>
        <if test="ids!=null and ids.size()>0">
            and id in
            <foreach item="item" collection="ids" index="index"  separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>
zy-asrs-wms/src/main/resources/mapper/asrs/ViewLocDetlMapper.xml
New file
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.asrs.wms.asrs.mapper.ViewLocDetlMapper">
    <select id="getList" resultType="map">
        select * from view_man_loc_detl ld
        where matnr = #{matnr}
        <if test="batch!=null">
            and batch = #{batch}
        </if>
        <if test="param!=null and param.size()>0">
            <foreach item="item" collection="param" index="index">
                and ${item.name} like CONCAT('%',#{item.value},'%')
            </foreach>
        </if>
    </select>
    <select id="getById" resultType="map">
        select * from view_man_loc_detl
        where id = #{id}
    </select>
</mapper>