From cf3c6082e48c67461d36596eff6d3da6e54bf84f Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 05 七月 2024 11:25:35 +0800
Subject: [PATCH] #
---
zy-asrs-admin/src/main.js | 2
zy-asrs-admin/src/views/base/zpalletBarcode/index.vue | 287 +++++++++++++++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/CodeBuilder.java | 4
zy-asrs-admin/package-lock.json | 19
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ZpalletBarcodeMapper.java | 12
zy-asrs-admin/src/components/print/zpalletBarcodePrint/index.vue | 71 +++
zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template1.vue | 47 ++
zy-asrs-admin/package.json | 3
zy-asrs-wms/src/main/resources/mapper/asrs/ZpalletBarcodeMapper.xml | 5
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ZpalletBarcode.java | 226 +++++++++++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java | 125 ++++++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ZpalletBarcodeService.java | 8
zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/controller/AuthController.java | 30 +
zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/security/SecurityConfig.java | 1
zy-asrs-wms/src/main/java/zpalletBarcode.sql | 9
zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/domain/PageParam.java | 4
zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template2.vue | 47 ++
zy-asrs-admin/src/locales/en_US.js | 16
zy-asrs-admin/src/views/base/zpalletBarcode/edit.vue | 207 ++++++++++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ZpalletBarcodeServiceImpl.java | 12
20 files changed, 1,130 insertions(+), 5 deletions(-)
diff --git a/zy-asrs-admin/package-lock.json b/zy-asrs-admin/package-lock.json
index 61d399e..8451b2f 100644
--- a/zy-asrs-admin/package-lock.json
+++ b/zy-asrs-admin/package-lock.json
@@ -14,7 +14,8 @@
"axios": "^1.7.2",
"pinia": "^2.1.7",
"vue": "^3.4.29",
- "vue-router": "^4.3.3"
+ "vue-router": "^4.3.3",
+ "vue3-print-nb": "^0.1.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
@@ -2126,6 +2127,14 @@
"vue": "^3.0.0"
}
},
+ "node_modules/vue3-print-nb": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/vue3-print-nb/-/vue3-print-nb-0.1.4.tgz",
+ "integrity": "sha512-LExI7viEzplR6ZKQ2b+V4U0cwGYbVD4fut/XHvk3UPGlT5CcvIGs6VlwGp107aKgk6P8Pgx4rco3Rehv2lti3A==",
+ "dependencies": {
+ "vue": "^3.0.5"
+ }
+ },
"node_modules/warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
@@ -3449,6 +3458,14 @@
"is-plain-object": "3.0.1"
}
},
+ "vue3-print-nb": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/vue3-print-nb/-/vue3-print-nb-0.1.4.tgz",
+ "integrity": "sha512-LExI7viEzplR6ZKQ2b+V4U0cwGYbVD4fut/XHvk3UPGlT5CcvIGs6VlwGp107aKgk6P8Pgx4rco3Rehv2lti3A==",
+ "requires": {
+ "vue": "^3.0.5"
+ }
+ },
"warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
diff --git a/zy-asrs-admin/package.json b/zy-asrs-admin/package.json
index b3f7ed8..4ba2ff9 100644
--- a/zy-asrs-admin/package.json
+++ b/zy-asrs-admin/package.json
@@ -15,7 +15,8 @@
"axios": "^1.7.2",
"pinia": "^2.1.7",
"vue": "^3.4.29",
- "vue-router": "^4.3.3"
+ "vue-router": "^4.3.3",
+ "vue3-print-nb": "^0.1.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
diff --git a/zy-asrs-admin/src/components/print/zpalletBarcodePrint/index.vue b/zy-asrs-admin/src/components/print/zpalletBarcodePrint/index.vue
new file mode 100644
index 0000000..4da0afc
--- /dev/null
+++ b/zy-asrs-admin/src/components/print/zpalletBarcodePrint/index.vue
@@ -0,0 +1,71 @@
+<script setup>
+import { ref } from 'vue';
+import { formatMessage } from '@/utils/localeUtils';
+import Template1 from './template/template1.vue';
+import Template2 from './template/template2.vue';
+
+const template = {
+ Template1,
+ Template2,
+}
+const selectTemplate = ref('Template1');
+const printChild = ref(null);
+
+let open = ref(false);
+let printData = ref([]);
+let repeatNum = ref(1);
+
+const handleOk = () => {
+
+}
+
+const printObj = ref({
+ id: "printMe",
+ beforeOpenCallback(vue) {
+ console.log('鎵撳紑涔嬪墠')
+ },
+ openCallback(vue) {
+ console.log('鎵ц浜嗘墦鍗�')
+ },
+ closeCallback(vue) {
+ console.log('鍏抽棴浜嗘墦鍗板伐鍏�')
+ }
+});
+
+defineExpose({
+ open,
+ printData,
+})
+</script>
+
+<template>
+ <a-modal v-model:open="open" :title="formatMessage('db.man_zpallet_barcode.batchPrint', '鎵归噺鎵撳嵃')" @ok="handleOk">
+ <div style="height: 500px;overflow-x: hidden;overflow-y: scroll;">
+ <div style="display: flex;justify-content: center;">
+ <a-radio-group v-model:value="selectTemplate" button-style="solid">
+ <a-radio-button value="Template1">
+ {{ formatMessage('common.template', '妯℃澘') }} 1
+ </a-radio-button>
+ <a-radio-button value="Template2">
+ {{ formatMessage('common.template', '妯℃澘') }} 2
+ </a-radio-button>
+ </a-radio-group>
+ </div>
+ <div style="display: flex;justify-content: center;margin-top: 20px;">
+ <div style="width: 140px;text-align: center;">
+ {{ formatMessage('common.repeatNum', '閲嶅鏁伴噺') }}<a-input-number :min="1" v-model:value="repeatNum" :placeholder="formatMessage('common.repeatNum', '閲嶅鏁伴噺')" />
+ </div>
+ </div>
+ <div style="margin-top: 20px;">
+ <component :is="template[selectTemplate]" ref="printChild" :list="printData" :repeatNum="repeatNum" />
+ </div>
+ </div>
+ <template #footer>
+ <a-button key="submit" type="primary" v-print="printObj" @click="handleOk">
+ {{ formatMessage('common.print', '鎵撳嵃') }}
+ </a-button>
+ </template>
+ </a-modal>
+</template>
+
+<style></style>
\ No newline at end of file
diff --git a/zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template1.vue b/zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template1.vue
new file mode 100644
index 0000000..917c677
--- /dev/null
+++ b/zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template1.vue
@@ -0,0 +1,47 @@
+<script setup>
+import { toRefs, ref, defineProps } from 'vue';
+import { globalState } from '@/config.js'
+import { formatMessage } from '@/utils/localeUtils';
+
+const props = defineProps({
+ list: {
+ type: Array,
+ default: []
+ },
+ repeatNum: {
+ type: Number,
+ default: 1
+ }
+});
+const { list, repeatNum } = toRefs(props)
+</script>
+
+<template>
+ <div id="printMe">
+ <div v-for="(item, index) in list" :key="index">
+ <div v-for="count in repeatNum" style="font-size: 16px;margin-top: 20px;">
+ <div style="text-align: center;">
+ <img :src="globalState.url + '/api/code/auth?type=1¶m=' + item.barcode" />
+ </div>
+ <div style="text-align: center;">
+ {{ item.barcode }}
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<style>
+@media print {
+ body {
+ margin: 0;
+ padding: 0;
+ }
+
+ .print-area {
+ margin: 0;
+ padding: 0;
+ height: auto;
+ }
+}
+</style>
\ No newline at end of file
diff --git a/zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template2.vue b/zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template2.vue
new file mode 100644
index 0000000..a7b783e
--- /dev/null
+++ b/zy-asrs-admin/src/components/print/zpalletBarcodePrint/template/template2.vue
@@ -0,0 +1,47 @@
+<script setup>
+import { toRefs, ref, defineProps } from 'vue';
+import { globalState } from '@/config.js'
+import { formatMessage } from '@/utils/localeUtils';
+
+const props = defineProps({
+ list: {
+ type: Array,
+ default: []
+ },
+ repeatNum: {
+ type: Number,
+ default: 1
+ }
+});
+const { list, repeatNum } = toRefs(props)
+</script>
+
+<template>
+ <div id="printMe">
+ <div v-for="(item, index) in list" :key="index">
+ <div v-for="count in repeatNum" style="font-size: 16px;margin-top: 20px;">
+ <div style="text-align: center;">
+ <img :src="globalState.url + '/api/code/auth?type=2¶m=' + item.barcode" />
+ </div>
+ <div style="text-align: center;">
+ {{ item.barcode }}
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<style>
+@media print {
+ body {
+ margin: 0;
+ padding: 0;
+ }
+
+ .print-area {
+ margin: 0;
+ padding: 0;
+ height: auto;
+ }
+}
+</style>
\ No newline at end of file
diff --git a/zy-asrs-admin/src/locales/en_US.js b/zy-asrs-admin/src/locales/en_US.js
index 9c627f5..e2d4334 100644
--- a/zy-asrs-admin/src/locales/en_US.js
+++ b/zy-asrs-admin/src/locales/en_US.js
@@ -32,6 +32,9 @@
'common.search.placeholder': 'Please enter search content',
'common.loading.api.message': 'Calling Server...',
'common.loading': 'Loading',
+ 'common.print': 'Print',
+ 'common.template': 'Template',
+ 'common.repeatNum': 'RepeatNum',
'':'',
'':'',
'':'',
@@ -144,6 +147,9 @@
'base.locArea':'LocArea',
'base.locSts':'LocSts',
'base.loc':'Loc',
+ 'base.locType':'LocType',
+ 'base.locTypeBind':'LocTypeBind',
+ 'base.zpalletBarcode':'ZpalletBarcode',
'':'',
'':'',
'':'',
@@ -217,4 +223,14 @@
'db.sys_operation_record.user_id':'UserId',
'db.sys_operation_record.create_time':'CreateTime',
'db.sys_operation_record.memo':'Memo',
+ '':'',
+ '':'',
+ '':'',
+ '':'',
+ '':'',
+ '':'',
+ 'db.man_zpallet_barcode.generateBarcode':'Generate Barcode',
+ 'db.man_zpallet_barcode.barcodeValue':'Barcode Value',
+ 'db.man_zpallet_barcode.generateNum':'Generate Num',
+ 'db.man_zpallet_barcode.batchPrint':'Batch Print',
};
\ No newline at end of file
diff --git a/zy-asrs-admin/src/main.js b/zy-asrs-admin/src/main.js
index e082ae3..35e814f 100644
--- a/zy-asrs-admin/src/main.js
+++ b/zy-asrs-admin/src/main.js
@@ -7,6 +7,7 @@
import 'ant-design-vue/dist/reset.css';
import { initRouter } from '@/router/index.js'
import { globalState } from './config.js'
+import print from 'vue3-print-nb'
const app = createApp(App)
@@ -31,6 +32,7 @@
app.use(createPinia())
app.use(router)
app.use(Antd)
+ app.use(print)
router.isReady().then((e) => {
app.mount('#app')
})
diff --git a/zy-asrs-admin/src/views/base/zpalletBarcode/edit.vue b/zy-asrs-admin/src/views/base/zpalletBarcode/edit.vue
new file mode 100644
index 0000000..15a5528
--- /dev/null
+++ b/zy-asrs-admin/src/views/base/zpalletBarcode/edit.vue
@@ -0,0 +1,207 @@
+<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/zpalletBarcode/save' : '/api/zpalletBarcode/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 userQueryList = ref(null);
+userQuery();
+function userQuery() {
+ postForm('/api/user/query', {}).then(resp => {
+ let result = resp.data;
+ userQueryList.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.man_zpallet_barcode.barcode', '瀹瑰櫒鏉$爜') "
+ name="barcode"
+ style="width: 250px;"
+ >
+ <a-input
+ v-model:value="formData.barcode"
+ />
+ </a-form-item>
+ <a-form-item
+ :label="formatMessage('db.man_zpallet_barcode.flag', '鏍囪瘑') "
+ name="flag"
+ style="width: 250px;"
+ >
+ <a-input
+ v-model:value="formData.flag"
+ />
+ </a-form-item>
+ <a-form-item
+ :label="formatMessage('db.man_zpallet_barcode.barcode_print', '鎵撳嵃鐘舵��') "
+ name="barcodePrint"
+ style="width: 250px;"
+ >
+ <a-select
+ v-model:value="formData.barcodePrint"
+ :options="[
+ { label: '瀹屾垚', value: 1 },
+ { label: '鏈畬鎴�', value: 0 },
+ ]"
+ >
+ </a-select>
+ </a-form-item>
+ <a-form-item
+ :label="formatMessage('db.man_zpallet_barcode.uuid', '缂栧彿') "
+ name="uuid"
+ style="width: 250px;"
+ >
+ <a-input
+ v-model:value="formData.uuid"
+ />
+ </a-form-item>
+ <a-form-item
+ :label="formatMessage('db.man_zpallet_barcode.status', '鐘舵��') "
+ name="status"
+ style="width: 250px;"
+ >
+ <a-select
+ v-model:value="formData.status"
+ :options="[
+ { label: '姝e父', value: 1 },
+ { label: '绂佺敤', value: 0 },
+ ]"
+ >
+ </a-select>
+ </a-form-item>
+ <a-form-item
+ :label="formatMessage('db.man_zpallet_barcode.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_zpallet_barcode.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_zpallet_barcode.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_zpallet_barcode.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_zpallet_barcode.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"
+ style="visibility: hidden;">Submit</a-button>
+ </a-form-item>
+ </a-form>
+ </a-modal>
+ </div>
+</template>
+
+<style></style>
diff --git a/zy-asrs-admin/src/views/base/zpalletBarcode/index.vue b/zy-asrs-admin/src/views/base/zpalletBarcode/index.vue
new file mode 100644
index 0000000..4402c12
--- /dev/null
+++ b/zy-asrs-admin/src/views/base/zpalletBarcode/index.vue
@@ -0,0 +1,287 @@
+<script setup>
+import { getCurrentInstance, ref, computed, reactive, nextTick } from 'vue';
+import { useRouter } from "vue-router";
+import { get, post, postBlob } from '@/utils/request.js'
+import { message, Modal } from 'ant-design-vue';
+import { logout } from '@/config.js';
+import EditView from './edit.vue'
+import { formatMessage } from '@/utils/localeUtils.js';
+import ZpalletBarcodePrint from '@/components/print/zpalletBarcodePrint/index.vue';
+const context = getCurrentInstance()?.appContext.config.globalProperties;
+
+const router = useRouter();
+
+const TABLE_KEY = 'table-zpalletBarcode';
+let currentPage = 1;
+let pageSize = 10;
+const searchInput = ref("")
+const editChild = ref(null);
+const printChild = ref(null);
+
+let openGenerate = ref(false);
+let generateBarcodeValue = ref("80000001");
+let generateNum = ref(100);
+
+let tableData = ref([]);
+getPage();
+
+const columns = [
+ {
+ title: formatMessage('db.man_zpallet_barcode.barcode', '瀹瑰櫒鏉$爜'),
+ dataIndex: 'barcode',
+ width: 140,
+ ellipsis: true,
+ },
+ {
+ title: formatMessage('db.man_zpallet_barcode.flag', '鏍囪瘑'),
+ dataIndex: 'flag',
+ width: 140,
+ ellipsis: true,
+ },
+ {
+ title: formatMessage('db.man_zpallet_barcode.barcode_print', '鎵撳嵃鐘舵��'),
+ dataIndex: 'barcodePrint$',
+ width: 140,
+ ellipsis: true,
+ },
+ // {
+ // title: formatMessage('db.man_zpallet_barcode.uuid', '缂栧彿'),
+ // dataIndex: 'uuid',
+ // width: 140,
+ // ellipsis: true,
+ // },
+ {
+ title: formatMessage('db.man_zpallet_barcode.status', '鐘舵��'),
+ dataIndex: 'status$',
+ width: 140,
+ ellipsis: true,
+ },
+ // {
+ // title: formatMessage('db.man_zpallet_barcode.create_time', '娣诲姞鏃堕棿'),
+ // dataIndex: 'createTime$',
+ // width: 140,
+ // ellipsis: true,
+ // },
+ // {
+ // title: formatMessage('db.man_zpallet_barcode.create_by', '娣诲姞浜哄憳'),
+ // dataIndex: 'createBy$',
+ // width: 140,
+ // ellipsis: true,
+ // },
+ // {
+ // title: formatMessage('db.man_zpallet_barcode.update_time', '淇敼鏃堕棿'),
+ // dataIndex: 'updateTime$',
+ // width: 140,
+ // ellipsis: true,
+ // },
+ // {
+ // title: formatMessage('db.man_zpallet_barcode.update_by', '淇敼浜哄憳'),
+ // dataIndex: 'updateBy$',
+ // width: 140,
+ // ellipsis: true,
+ // },
+ {
+ title: formatMessage('db.man_zpallet_barcode.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,
+});
+const hasSelected = computed(() => state.selectedRowKeys.length > 0);
+const start = () => {
+ state.loading = true;
+ // ajax request after empty completing
+ setTimeout(() => {
+ state.loading = false;
+ state.selectedRowKeys = [];
+ }, 1000);
+};
+const onSelectChange = selectedRowKeys => {
+ // console.log('selectedRowKeys changed: ', selectedRowKeys);
+ state.selectedRowKeys = selectedRowKeys;
+};
+
+function getPage() {
+ post('/api/zpalletBarcode/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;
+ } else if (result.code === 401) {
+ message.error(result.msg);
+ logout()
+ } else {
+ message.error(result.msg);
+ }
+ })
+}
+
+const handleEdit = (item) => {
+ editChild.value.open = true;
+ editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item));
+ editChild.value.isSave = item == null;
+}
+
+const handleDel = (rows) => {
+ Modal.confirm({
+ title: formatMessage('page.delete', '鍒犻櫎'),
+ content: formatMessage('page.delete.confirm', '纭畾鍒犻櫎璇ラ」鍚楋紵'),
+ maskClosable: true,
+ onOk: async () => {
+ const hide = message.loading(formatMessage('common.loading', '璇锋眰涓�'));
+ try {
+ post('/api/zpalletBarcode/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => {
+ let result = resp.data;
+ if (result.code === 200) {
+ message.success(result.msg);
+ } else {
+ message.error(result.msg);
+ }
+ getPage()
+ hide()
+ })
+ } catch (error) {
+ message.error(formatMessage('common.fail', '璇锋眰澶辫触'));
+ }
+ },
+ });
+}
+
+const handleExport = async (intl) => {
+ postBlob('/api/zpalletBarcode/export', {}).then(result => {
+ const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' });
+ window.location.href = window.URL.createObjectURL(blob);
+ return true;
+ })
+};
+
+const onSearch = () => {
+ // console.log('search');
+ getPage()
+}
+
+const onPageChange = (page, size) => {
+ currentPage = page;
+ pageSize = size;
+ getPage();
+}
+
+function handleTableReload(value) {
+ getPage()
+}
+
+const handleOpenGenerate = () => {
+ openGenerate.value = true;
+}
+
+const handleGenerateSubmit = () => {
+ post('/api/zpalletBarcode/generate', {
+ barcode: generateBarcodeValue.value,
+ num: generateNum.value,
+ }).then((resp) => {
+ let result = resp.data;
+ if (result.code == 200) {
+ let data = result.data;
+ message.success(result.msg);
+ getPage()
+ } else if (result.code === 401) {
+ message.error(result.msg);
+ logout()
+ } else {
+ message.error(result.msg);
+ }
+ })
+}
+
+const handlePrint = () => {
+ if (state.selectedRowKeys.length == 0) {
+ message.warning(formatMessage('common.select', '璇烽�夋嫨'));
+ return;
+ }
+ let data = tableData.value.records;
+ let tmp = [];
+ data.forEach((item) => {
+ if (state.selectedRowKeys.indexOf(item.id) != -1) {
+ tmp.push(item);
+ }
+ })
+
+ printChild.value.printData = tmp;
+ printChild.value.open = true;
+}
+
+</script>
+
+<script>
+export default {
+ name: '瀹瑰櫒绠$悊'
+}
+</script>
+
+<template>
+ <div>
+ <EditView ref="editChild" @tableReload="handleTableReload" />
+ <div class="table-header">
+ <div>
+ <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
+ style="width: 200px;" @search="onSearch" />
+ <a-button @click="handlePrint()" type="primary">
+ {{ formatMessage('db.man_zpallet_barcode.batchPrint', '鎵归噺鎵撳嵃') }}
+ </a-button>
+ </div>
+ <div class="table-header-right">
+ <a-button @click="handleOpenGenerate()" type="primary">{{
+ formatMessage('db.man_zpallet_barcode.generateBarcode', '鐢熸垚鏉$爜') }}</a-button>
+ <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '娣诲姞') }}</a-button>
+ <a-button @click="handleExport">{{ formatMessage('page.export', '瀵煎嚭') }}</a-button>
+ </div>
+ </div>
+ <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">
+ <template #bodyCell="{ column, text, record }">
+ <template v-if="column.dataIndex === 'oper'">
+ <div style="display: flex;justify-content: space-evenly;">
+ <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '缂栬緫') }}</a-button>
+ <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '鍒犻櫎')
+ }}</a-button>
+ </div>
+ </template>
+ </template>
+ </a-table>
+
+ <a-modal v-model:open="openGenerate" :title="formatMessage('db.man_zpallet_barcode.generateBarcode', '鐢熸垚鏉$爜')"
+ @ok="handleGenerateSubmit">
+ <a-form style="display: flex;justify-content: center;flex-wrap: wrap;" autocomplete="off">
+ <a-form-item :label="formatMessage('db.man_zpallet_barcode.barcodeValue', '鏉$爜鍊�')">
+ <a-input v-model:value="generateBarcodeValue" />
+ </a-form-item>
+ <a-form-item :label="formatMessage('db.man_zpallet_barcode.generateNum', '鐢熸垚鏁伴噺')">
+ <a-input v-model:value="generateNum" />
+ </a-form-item>
+ </a-form>
+ </a-modal>
+
+ <ZpalletBarcodePrint ref="printChild" />
+ </div>
+</template>
+
+<style></style>
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
new file mode 100644
index 0000000..9711793
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
@@ -0,0 +1,125 @@
+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.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.ZpalletBarcode;
+import com.zy.asrs.wms.asrs.service.ZpalletBarcodeService;
+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 ZpalletBarcodeController extends BaseController {
+
+ @Autowired
+ private ZpalletBarcodeService zpalletBarcodeService;
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:list')")
+ @PostMapping("/zpalletBarcode/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<ZpalletBarcode, BaseParam> pageParam = new PageParam<>(baseParam, ZpalletBarcode.class);
+ return R.ok().add(zpalletBarcodeService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:list')")
+ @PostMapping("/zpalletBarcode/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(zpalletBarcodeService.list());
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:list')")
+ @GetMapping("/zpalletBarcode/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(zpalletBarcodeService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:save')")
+ @OperationLog("娣诲姞瀹瑰櫒绠$悊")
+ @PostMapping("/zpalletBarcode/save")
+ public R save(@RequestBody ZpalletBarcode zpalletBarcode) {
+ if (!zpalletBarcodeService.save(zpalletBarcode)) {
+ return R.error("娣诲姞澶辫触");
+ }
+ return R.ok("娣诲姞鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:update')")
+ @OperationLog("淇敼瀹瑰櫒绠$悊")
+ @PostMapping("/zpalletBarcode/update")
+ public R update(@RequestBody ZpalletBarcode zpalletBarcode) {
+ if (!zpalletBarcodeService.updateById(zpalletBarcode)) {
+ return R.error("淇敼澶辫触");
+ }
+ return R.ok("淇敼鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:remove')")
+ @OperationLog("鍒犻櫎瀹瑰櫒绠$悊")
+ @PostMapping("/zpalletBarcode/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!zpalletBarcodeService.removeByIds(Arrays.asList(ids))) {
+ return R.error("鍒犻櫎澶辫触");
+ }
+ return R.ok("鍒犻櫎鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:list')")
+ @PostMapping("/zpalletBarcode/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<ZpalletBarcode> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(ZpalletBarcode::getBarcode, condition);
+ }
+ zpalletBarcodeService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+ item -> vos.add(new KeyValVo(item.getId(), item.getBarcode()))
+ );
+ return R.ok().add(vos);
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:list')")
+ @PostMapping("/zpalletBarcode/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(zpalletBarcodeService.list(), ZpalletBarcode.class), response);
+ }
+
+ @PreAuthorize("hasAuthority('asrs:zpalletBarcode:save')")
+ @PostMapping("/zpalletBarcode/generate")
+ public R generate(@RequestBody Map<String, Object> map) {
+ Object barcode = map.get("barcode");
+ Object num = map.get("num");
+ if (barcode == null || num == null) {
+ return R.error("缂哄皯鍙傛暟");
+ }
+
+ ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>().eq(ZpalletBarcode::getBarcode, barcode));
+ if (one != null) {
+ return R.error("鏉$爜璧峰鍊煎凡瀛樺湪");
+ }
+ int barcodeInt = Integer.parseInt(String.valueOf(barcode));
+ for (int i = 0; i < Integer.parseInt(String.valueOf(num)); i++) {
+ ZpalletBarcode zpalletBarcode = new ZpalletBarcode();
+ zpalletBarcode.setBarcode(String.valueOf(barcodeInt));
+ zpalletBarcodeService.save(zpalletBarcode);
+ barcodeInt += 1;
+ }
+ return R.ok();
+ }
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ZpalletBarcode.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ZpalletBarcode.java
new file mode 100644
index 0000000..6001338
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ZpalletBarcode.java
@@ -0,0 +1,226 @@
+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.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_zpallet_barcode")
+public class ZpalletBarcode 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 barcode;
+
+ /**
+ * 鏍囪瘑
+ */
+ @ApiModelProperty(value= "鏍囪瘑")
+ private String flag;
+
+ /**
+ * 鎵撳嵃鐘舵�� 1: 瀹屾垚 0: 鏈畬鎴�
+ */
+ @ApiModelProperty(value= "鎵撳嵃鐘舵�� 1: 瀹屾垚 0: 鏈畬鎴� ")
+ private Integer barcodePrint;
+
+ /**
+ * 缂栧彿
+ */
+ @ApiModelProperty(value= "缂栧彿")
+ private String uuid;
+
+ /**
+ * 鎵�灞炴満鏋�
+ */
+ @ApiModelProperty(value= "鎵�灞炴満鏋�")
+ private Long hostId;
+
+ /**
+ * 鐘舵�� 1: 姝e父 0: 绂佺敤
+ */
+ @ApiModelProperty(value= "鐘舵�� 1: 姝e父 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 ZpalletBarcode() {}
+
+ public ZpalletBarcode(String barcode,String flag,Integer barcodePrint,String uuid,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
+ this.barcode = barcode;
+ this.flag = flag;
+ this.barcodePrint = barcodePrint;
+ this.uuid = uuid;
+ this.hostId = hostId;
+ this.status = status;
+ this.deleted = deleted;
+ this.createTime = createTime;
+ this.createBy = createBy;
+ this.updateTime = updateTime;
+ this.updateBy = updateBy;
+ this.memo = memo;
+ }
+
+// ZpalletBarcode zpalletBarcode = new ZpalletBarcode(
+// null, // 瀹瑰櫒鏉$爜
+// null, // 鏍囪瘑
+// null, // 鎵撳嵃鐘舵��
+// null, // 缂栧彿
+// null, // 鎵�灞炴満鏋�
+// null, // 鐘舵��
+// null, // 鏄惁鍒犻櫎
+// null, // 娣诲姞鏃堕棿
+// null, // 娣诲姞浜哄憳
+// null, // 淇敼鏃堕棿
+// null, // 淇敼浜哄憳
+// null // 澶囨敞
+// );
+
+ public String getBarcodePrint$(){
+ if (null == this.barcodePrint){ return null; }
+ switch (this.barcodePrint){
+ case 1:
+ return "瀹屾垚";
+ case 0:
+ return "鏈畬鎴�";
+ default:
+ return String.valueOf(this.barcodePrint);
+ }
+ }
+
+ 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 "姝e父";
+ 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;
+ }
+
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ZpalletBarcodeMapper.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ZpalletBarcodeMapper.java
new file mode 100644
index 0000000..8f9874f
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ZpalletBarcodeMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wms.asrs.mapper;
+
+import com.zy.asrs.wms.asrs.entity.ZpalletBarcode;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface ZpalletBarcodeMapper extends BaseMapper<ZpalletBarcode> {
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ZpalletBarcodeService.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ZpalletBarcodeService.java
new file mode 100644
index 0000000..ab6e044
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ZpalletBarcodeService.java
@@ -0,0 +1,8 @@
+package com.zy.asrs.wms.asrs.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zy.asrs.wms.asrs.entity.ZpalletBarcode;
+
+public interface ZpalletBarcodeService extends IService<ZpalletBarcode> {
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ZpalletBarcodeServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ZpalletBarcodeServiceImpl.java
new file mode 100644
index 0000000..f139d59
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ZpalletBarcodeServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wms.asrs.service.impl;
+
+import com.zy.asrs.wms.asrs.mapper.ZpalletBarcodeMapper;
+import com.zy.asrs.wms.asrs.entity.ZpalletBarcode;
+import com.zy.asrs.wms.asrs.service.ZpalletBarcodeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("zpalletBarcodeService")
+public class ZpalletBarcodeServiceImpl extends ServiceImpl<ZpalletBarcodeMapper, ZpalletBarcode> implements ZpalletBarcodeService {
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/domain/PageParam.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/domain/PageParam.java
index db04a14..b64e7f6 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/domain/PageParam.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/domain/PageParam.java
@@ -123,7 +123,9 @@
if (!Cools.isEmpty(cls)) {
fields = Cools.getAllFields(cls);
for (Field field : fields) {
- if ("createTime".equals(field.getName())) {
+ if ("id".equals(field.getName())) {
+ queryWrapper.orderByDesc("id");
+ } else if ("createTime".equals(field.getName())) {
queryWrapper.orderByDesc(Utils.toSymbolCase(field.getName(), '_'));
}
}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/security/SecurityConfig.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/security/SecurityConfig.java
index e89d538..42129dd 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/security/SecurityConfig.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/common/security/SecurityConfig.java
@@ -35,6 +35,7 @@
"/api/auth/host",
"/test/**",
"/api/login",
+ "/api/code/auth",
"/druid/**",
"/swagger-ui.html",
"/swagger-resources/**",
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/controller/AuthController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/controller/AuthController.java
index bdb6fd1..082f8d1 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/controller/AuthController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/system/controller/AuthController.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.common.domain.enums.LoginSystemType;
+import com.zy.asrs.common.utils.BarcodeUtils;
+import com.zy.asrs.common.utils.QrCode;
import com.zy.asrs.framework.annotations.ManagerAuth;
+import com.zy.asrs.framework.common.BaseRes;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
@@ -20,7 +23,11 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -222,4 +229,27 @@
}
}
+ @RequestMapping(value = "/code/auth")
+// @ManagerAuth(memo = "鐗╂枡缂栫爜鏉″舰鐮佽幏鍙�(type:1(鏉″舰鐮�);2(浜岀淮鐮�)")
+ public R matCodeBarcode(@RequestParam(defaultValue = "1") Integer type
+ , @RequestParam String param
+ , HttpServletResponse response) throws Exception {
+ response.setContentType("image/jpg");
+ if (Cools.isEmpty(param)){
+ return R.parse(BaseRes.EMPTY);
+ }
+ BufferedImage img;
+ if (type == 1) {
+ img = BarcodeUtils.encode(param);
+ } else {
+ img = QrCode.createImg(param);
+ }
+ if (!ImageIO.write(img, "jpg", response.getOutputStream())) {
+ throw new IOException("Could not write an image of format jpg");
+ }
+ response.getOutputStream().flush();
+ response.getOutputStream().close();
+ return R.ok();
+ }
+
}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/CodeBuilder.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/CodeBuilder.java
index 89db324..039b9d8 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/CodeBuilder.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/CodeBuilder.java
@@ -22,8 +22,8 @@
// generator.username="sa";
// generator.password="Zoneyung@zy56$";
- generator.table="man_loc_type_bind";
- generator.tableName="搴撲綅绫诲瀷缁戝畾";
+ generator.table="man_zpallet_barcode";
+ generator.tableName="瀹瑰櫒绠$悊";
generator.rootPackagePath="com.zy.asrs.wms";
generator.packagePath="com.zy.asrs.wms.asrs";
diff --git a/zy-asrs-wms/src/main/java/zpalletBarcode.sql b/zy-asrs-wms/src/main/java/zpalletBarcode.sql
new file mode 100644
index 0000000..71d3c39
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/zpalletBarcode.sql
@@ -0,0 +1,9 @@
+-- save zpalletBarcode record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( '瀹瑰櫒绠$悊绠$悊', '0', '/asrs/zpalletBarcode', '/asrs/zpalletBarcode', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨ瀹瑰櫒绠$悊', '', '1', 'asrs:zpalletBarcode:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞瀹瑰櫒绠$悊', '', '1', 'asrs:zpalletBarcode:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '淇敼瀹瑰櫒绠$悊', '', '1', 'asrs:zpalletBarcode:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鍒犻櫎瀹瑰櫒绠$悊', '', '1', 'asrs:zpalletBarcode:remove', '3', '1', '1');
+
diff --git a/zy-asrs-wms/src/main/resources/mapper/asrs/ZpalletBarcodeMapper.xml b/zy-asrs-wms/src/main/resources/mapper/asrs/ZpalletBarcodeMapper.xml
new file mode 100644
index 0000000..e44f0d5
--- /dev/null
+++ b/zy-asrs-wms/src/main/resources/mapper/asrs/ZpalletBarcodeMapper.xml
@@ -0,0 +1,5 @@
+<?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.ZpalletBarcodeMapper">
+
+</mapper>
--
Gitblit v1.9.1