From 25afd6ad3665690ecad3eed2fee7ffba7364d70a Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 15 八月 2024 09:27:02 +0800
Subject: [PATCH] #
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ShelvesRuleController.java | 117 ++++++++
zy-asrs-admin/src/views/strategy/shelvesRule/index.vue | 223 +++++++++++++++
zy-asrs-wms/src/main/java/com/zy/asrs/wms/utils/CodeBuilder.java | 4
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ShelvesRuleServiceImpl.java | 12
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ShelvesRule.java | 241 +++++++++++++++++
zy-asrs-wms/src/main/resources/mapper/asrs/ShelvesRuleMapper.xml | 5
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LanewayRuleController.java | 2
zy-asrs-wms/src/main/resources/sql/menu/shelvesRule.sql | 9
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ShelvesRuleService.java | 8
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ShelvesRuleMapper.java | 12
zy-asrs-admin/src/views/strategy/shelvesRule/edit.vue | 147 ++++++++++
zy-asrs-admin/src/views/strategy/lanewayRule/index.vue | 6
zy-asrs-admin/src/views/strategy/lanewayRule/edit.vue | 4
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LanewayRule.java | 10
14 files changed, 790 insertions(+), 10 deletions(-)
diff --git a/zy-asrs-admin/src/views/strategy/lanewayRule/edit.vue b/zy-asrs-admin/src/views/strategy/lanewayRule/edit.vue
index 9b93cce..4d712d2 100644
--- a/zy-asrs-admin/src/views/strategy/lanewayRule/edit.vue
+++ b/zy-asrs-admin/src/views/strategy/lanewayRule/edit.vue
@@ -74,9 +74,9 @@
<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.strategy_laneway_rule.id', '宸烽亾鍙�')" name="id"
+ <a-form-item :label="formatMessage('db.strategy_laneway_rule.laneNo', '宸烽亾鍙�')" name="laneNo"
style="width: 250px;">
- <a-input v-model:value="formData.id" />
+ <a-input v-model:value="formData.laneNo" />
</a-form-item>
<a-form-item :label="formatMessage('db.strategy_laneway_rule.lane_x', 'X鍚�')" name="laneX"
style="width: 250px;">
diff --git a/zy-asrs-admin/src/views/strategy/lanewayRule/index.vue b/zy-asrs-admin/src/views/strategy/lanewayRule/index.vue
index f770c31..bfa53d2 100644
--- a/zy-asrs-admin/src/views/strategy/lanewayRule/index.vue
+++ b/zy-asrs-admin/src/views/strategy/lanewayRule/index.vue
@@ -27,11 +27,11 @@
const columns = [
{
- title: formatMessage('db.strategy_laneway_rule.id', '宸烽亾鍙�'),
- dataIndex: 'id',
+ title: formatMessage('db.strategy_laneway_rule.laneNo', '宸烽亾鍙�'),
+ dataIndex: 'laneNo',
width: 140,
ellipsis: true,
- ...getColumnSearchProps('id'),
+ ...getColumnSearchProps('laneNo'),
},
{
title: formatMessage('db.strategy_laneway_rule.lane_x', 'X鍚�'),
diff --git a/zy-asrs-admin/src/views/strategy/shelvesRule/edit.vue b/zy-asrs-admin/src/views/strategy/shelvesRule/edit.vue
new file mode 100644
index 0000000..c9a44f1
--- /dev/null
+++ b/zy-asrs-admin/src/views/strategy/shelvesRule/edit.vue
@@ -0,0 +1,147 @@
+<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/shelvesRule/save' : '/api/shelvesRule/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;
+ })
+}
+
+const lanewayRuleQueryList = ref(null);
+lanewayRuleQuery();
+function lanewayRuleQuery() {
+ postForm('/api/lanewayRule/query', {}).then(resp => {
+ let result = resp.data;
+ lanewayRuleQueryList.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.strategy_shelves_rule.rule_type', '瑙勫垯绫诲瀷')" name="ruleType"
+ style="width: 250px;">
+ <a-select v-model:value="formData.ruleType" :options="[
+ { label: '浼樺厛骞冲眰', value: 0 },
+ { label: '浼樺厛绔嬩綋', value: 1 },
+ ]">
+ </a-select>
+ </a-form-item>
+ <a-form-item :label="formatMessage('db.strategy_shelves_rule.lane', '宸烽亾')" name="lane"
+ style="width: 250px;">
+ <a-select v-model:value="formData.laneList" :placeholder="formatMessage('common.select', '璇烽�夋嫨')"
+ style="width: 100%" show-search mode="multiple" :options="lanewayRuleQueryList"
+ optionFilterProp="label" optionLabelProp="label">
+ </a-select>
+ </a-form-item>
+ <a-form-item :label="formatMessage('db.strategy_shelves_rule.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.strategy_shelves_rule.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.strategy_shelves_rule.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.strategy_shelves_rule.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.strategy_shelves_rule.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.strategy_shelves_rule.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/strategy/shelvesRule/index.vue b/zy-asrs-admin/src/views/strategy/shelvesRule/index.vue
new file mode 100644
index 0000000..2d71c77
--- /dev/null
+++ b/zy-asrs-admin/src/views/strategy/shelvesRule/index.vue
@@ -0,0 +1,223 @@
+<script setup>
+import { getCurrentInstance, ref, computed, reactive } 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 useTableSearch from '@/utils/tableUtils.jsx';
+const context = getCurrentInstance()?.appContext.config.globalProperties;
+
+const router = useRouter();
+
+const TABLE_KEY = 'table-shelvesRule';
+let currentPage = 1;
+let pageSize = 10;
+const searchInput = ref("")
+const editChild = ref(null)
+
+let tableData = ref([]);
+getPage();
+
+const {
+ getColumnSearchProps,
+ handleResizeColumn,
+} = useTableSearch();
+
+const columns = [
+ {
+ title: formatMessage('db.strategy_shelves_rule.rule_type', '瑙勫垯绫诲瀷'),
+ dataIndex: 'ruleType$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('ruleType$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.lane$', '宸烽亾'),
+ dataIndex: 'lane$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('lane$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.status', '鐘舵��'),
+ dataIndex: 'status$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('status$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.create_time', '娣诲姞鏃堕棿'),
+ dataIndex: 'createTime$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('createTime$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.create_by', '娣诲姞浜哄憳'),
+ dataIndex: 'createBy$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('createBy$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.update_time', '淇敼鏃堕棿'),
+ dataIndex: 'updateTime$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('updateTime$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.update_by', '淇敼浜哄憳'),
+ dataIndex: 'updateBy$',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('updateBy$'),
+ },
+ {
+ title: formatMessage('db.strategy_shelves_rule.memo', '澶囨敞'),
+ dataIndex: 'memo',
+ width: 140,
+ ellipsis: true,
+ ...getColumnSearchProps('memo'),
+ },
+
+ {
+ title: formatMessage('common.operation', '鎿嶄綔'),
+ name: 'oper',
+ dataIndex: 'oper',
+ key: 'oper',
+ width: 140,
+ fixed: 'right',
+ },
+];
+
+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/shelvesRule/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/shelvesRule/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/shelvesRule/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()
+}
+
+</script>
+
+<script>
+export default {
+ name: '涓婃灦瑙勫垯'
+}
+</script>
+
+<template>
+ <div>
+ <EditView ref="editChild" @tableReload="handleTableReload" />
+ <div class="table-header">
+ <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
+ style="width: 200px;" @search="onSearch" />
+ <div class="table-header-right">
+ <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" @resizeColumn="handleResizeColumn">
+ <template #bodyCell="{ column, text, record }">
+ <template v-if="column.dataIndex === 'oper'">
+ <div style="display: flex;justify-content: space-evenly;">
+ <a-button type="link" 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>
+ </div>
+</template>
+
+<style></style>
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LanewayRuleController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LanewayRuleController.java
index 68c8407..19a5bf0 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LanewayRuleController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/LanewayRuleController.java
@@ -88,7 +88,7 @@
wrapper.like(LanewayRule::getId, condition);
}
lanewayRuleService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
- item -> vos.add(new KeyValVo(item.getId(), item.getId()))
+ item -> vos.add(new KeyValVo(item.getId(), item.getLaneNo()))
);
return R.ok().add(vos);
}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ShelvesRuleController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ShelvesRuleController.java
new file mode 100644
index 0000000..f53228e
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ShelvesRuleController.java
@@ -0,0 +1,117 @@
+package com.zy.asrs.wms.asrs.controller;
+
+import com.alibaba.fastjson.JSON;
+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.ShelvesRule;
+import com.zy.asrs.wms.asrs.service.ShelvesRuleService;
+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.*;
+
+@RestController
+@RequestMapping("/api")
+public class ShelvesRuleController extends BaseController {
+
+ @Autowired
+ private ShelvesRuleService shelvesRuleService;
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:list')")
+ @PostMapping("/shelvesRule/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<ShelvesRule, BaseParam> pageParam = new PageParam<>(baseParam, ShelvesRule.class);
+ return R.ok().add(shelvesRuleService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:list')")
+ @PostMapping("/shelvesRule/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(shelvesRuleService.list());
+ }
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:list')")
+ @GetMapping("/shelvesRule/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(shelvesRuleService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:save')")
+ @OperationLog("娣诲姞涓婃灦瑙勫垯")
+ @PostMapping("/shelvesRule/save")
+ public R save(@RequestBody HashMap<String, Object> param) {
+ if(!param.containsKey("ruleType") || !param.containsKey("laneList")) {
+ return R.error("缂哄皯鍙傛暟");
+ }
+ ShelvesRule shelvesRule = new ShelvesRule();
+ shelvesRule.setRuleType(Integer.parseInt(param.get("ruleType").toString()));
+ shelvesRule.setLane(JSON.toJSONString(param.get("laneList")));
+ if (!shelvesRuleService.save(shelvesRule)) {
+ return R.error("娣诲姞澶辫触");
+ }
+ return R.ok("娣诲姞鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:update')")
+ @OperationLog("淇敼涓婃灦瑙勫垯")
+ @PostMapping("/shelvesRule/update")
+ public R update(@RequestBody HashMap<String, Object> param) {
+ if(!param.containsKey("ruleType") || !param.containsKey("laneList") || !param.containsKey("id")) {
+ return R.error("缂哄皯鍙傛暟");
+ }
+
+ ShelvesRule shelvesRule = shelvesRuleService.getById(param.get("id").toString());
+ if (shelvesRule == null) {
+ return R.error("涓婃灦瑙勫垯涓嶅瓨鍦�");
+ }
+
+ shelvesRule.setRuleType(Integer.parseInt(param.get("ruleType").toString()));
+ shelvesRule.setLane(JSON.toJSONString(param.get("laneList")));
+ if (!shelvesRuleService.updateById(shelvesRule)) {
+ return R.error("淇敼澶辫触");
+ }
+ return R.ok("淇敼鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:remove')")
+ @OperationLog("鍒犻櫎涓婃灦瑙勫垯")
+ @PostMapping("/shelvesRule/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!shelvesRuleService.removeByIds(Arrays.asList(ids))) {
+ return R.error("鍒犻櫎澶辫触");
+ }
+ return R.ok("鍒犻櫎鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('asrs:shelvesRule:list')")
+ @PostMapping("/shelvesRule/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<ShelvesRule> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(ShelvesRule::getId, condition);
+ }
+ shelvesRuleService.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:shelvesRule:list')")
+ @PostMapping("/shelvesRule/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(shelvesRuleService.list(), ShelvesRule.class), response);
+ }
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LanewayRule.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LanewayRule.java
index 4e2412c..40b77e8 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LanewayRule.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/LanewayRule.java
@@ -33,11 +33,17 @@
private static final long serialVersionUID = 1L;
/**
+ * ID
+ */
+ @ApiModelProperty(value= "ID")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
* 宸烽亾鍙�
*/
@ApiModelProperty(value= "宸烽亾鍙�")
- @TableId(value = "id", type = IdType.INPUT)
- private Long id;
+ private Integer laneNo;
/**
* X鍚�
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ShelvesRule.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ShelvesRule.java
new file mode 100644
index 0000000..952206e
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/entity/ShelvesRule.java
@@ -0,0 +1,241 @@
+package com.zy.asrs.wms.asrs.entity;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import com.zy.asrs.wms.asrs.service.LanewayRuleService;
+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 com.zy.asrs.common.utils.Synchro;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("strategy_shelves_rule")
+public class ShelvesRule implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ @ApiModelProperty(value= "ID")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 瑙勫垯绫诲瀷 0: 浼樺厛骞冲眰 1: 浼樺厛绔嬩綋
+ */
+ @ApiModelProperty(value= "瑙勫垯绫诲瀷 0: 浼樺厛骞冲眰 1: 浼樺厛绔嬩綋 ")
+ private Integer ruleType;
+
+ /**
+ * 宸烽亾
+ */
+ @ApiModelProperty(value= "宸烽亾")
+ private String lane;
+
+ /**
+ * 鎵�灞炴満鏋�
+ */
+ @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 ShelvesRule() {}
+
+ public ShelvesRule(Integer ruleType,String lane,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) {
+ this.ruleType = ruleType;
+ this.lane = lane;
+ this.hostId = hostId;
+ this.status = status;
+ this.deleted = deleted;
+ this.createTime = createTime;
+ this.createBy = createBy;
+ this.updateTime = updateTime;
+ this.updateBy = updateBy;
+ this.memo = memo;
+ }
+
+// ShelvesRule shelvesRule = new ShelvesRule(
+// null, // 鐘舵��
+// null, // 宸烽亾
+// null, // 鎵�灞炴満鏋�
+// null, // 鐘舵��
+// null, // 鏄惁鍒犻櫎
+// null, // 娣诲姞鏃堕棿
+// null, // 娣诲姞浜哄憳
+// null, // 淇敼鏃堕棿
+// null, // 淇敼浜哄憳
+// null // 澶囨敞
+// );
+
+ public String getLane$() {
+ LanewayRuleService service = SpringUtils.getBean(LanewayRuleService.class);
+ if (null == this.lane){ return ""; }
+ List<Long> list = JSON.parseArray(this.lane, Long.class);
+ if (list.isEmpty()) {
+ return "";
+ }
+ List<LanewayRule> lanewayRules = service.listByIds(list);
+ ArrayList<Integer> data = new ArrayList<>();
+ for (LanewayRule lanewayRule : lanewayRules) {
+ data.add(lanewayRule.getLaneNo());
+ }
+ return JSON.toJSONString(data);
+ }
+
+ public List<Long> getLaneList() {
+ if (null == this.lane){ return null; }
+ List<Long> list = JSON.parseArray(this.lane, Long.class);
+ if (list.isEmpty()) {
+ return null;
+ }
+ return list;
+ }
+
+ public String getRuleType$(){
+ if (null == this.ruleType){ return null; }
+ switch (this.ruleType){
+ case 0:
+ return "浼樺厛骞冲眰";
+ case 1:
+ return "浼樺厛绔嬩綋";
+ default:
+ return String.valueOf(this.ruleType);
+ }
+ }
+
+ 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;
+ }
+
+
+
+ public void sync(Object source) {
+ Synchro.Copy(source, this);
+ }
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ShelvesRuleMapper.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ShelvesRuleMapper.java
new file mode 100644
index 0000000..d4976c9
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/mapper/ShelvesRuleMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wms.asrs.mapper;
+
+import com.zy.asrs.wms.asrs.entity.ShelvesRule;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface ShelvesRuleMapper extends BaseMapper<ShelvesRule> {
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ShelvesRuleService.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ShelvesRuleService.java
new file mode 100644
index 0000000..512407f
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/ShelvesRuleService.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.ShelvesRule;
+
+public interface ShelvesRuleService extends IService<ShelvesRule> {
+
+}
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ShelvesRuleServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ShelvesRuleServiceImpl.java
new file mode 100644
index 0000000..4885f9e
--- /dev/null
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/ShelvesRuleServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wms.asrs.service.impl;
+
+import com.zy.asrs.wms.asrs.mapper.ShelvesRuleMapper;
+import com.zy.asrs.wms.asrs.entity.ShelvesRule;
+import com.zy.asrs.wms.asrs.service.ShelvesRuleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("shelvesRuleService")
+public class ShelvesRuleServiceImpl extends ServiceImpl<ShelvesRuleMapper, ShelvesRule> implements ShelvesRuleService {
+
+}
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 b02fbda..0964bf1 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="strategy_laneway_rule";
- generator.tableName="宸烽亾閰嶇疆";
+ generator.table="strategy_shelves_rule";
+ generator.tableName="涓婃灦瑙勫垯";
generator.rootPackagePath="com.zy.asrs.wms";
generator.packagePath="com.zy.asrs.wms.asrs";
diff --git a/zy-asrs-wms/src/main/resources/mapper/asrs/ShelvesRuleMapper.xml b/zy-asrs-wms/src/main/resources/mapper/asrs/ShelvesRuleMapper.xml
new file mode 100644
index 0000000..0739d87
--- /dev/null
+++ b/zy-asrs-wms/src/main/resources/mapper/asrs/ShelvesRuleMapper.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.ShelvesRuleMapper">
+
+</mapper>
diff --git a/zy-asrs-wms/src/main/resources/sql/menu/shelvesRule.sql b/zy-asrs-wms/src/main/resources/sql/menu/shelvesRule.sql
new file mode 100644
index 0000000..fc8c954
--- /dev/null
+++ b/zy-asrs-wms/src/main/resources/sql/menu/shelvesRule.sql
@@ -0,0 +1,9 @@
+-- save shelvesRule record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( '涓婃灦瑙勫垯绠$悊', '0', '/asrs/shelvesRule', '/asrs/shelvesRule', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨ涓婃灦瑙勫垯', '', '1', 'asrs:shelvesRule:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞涓婃灦瑙勫垯', '', '1', 'asrs:shelvesRule:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '淇敼涓婃灦瑙勫垯', '', '1', 'asrs:shelvesRule:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鍒犻櫎涓婃灦瑙勫垯', '', '1', 'asrs:shelvesRule:remove', '3', '1', '1');
+
--
Gitblit v1.9.1