Merge remote-tracking branch 'origin/wms-dev' into wms-dev
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | <script setup> | 
 |  |  | import { ref, nextTick } from 'vue'; | 
 |  |  | import { ref, nextTick, reactive, watch } from 'vue'; | 
 |  |  | import { get, post, postBlob, postForm } from '@/utils/request.js' | 
 |  |  | import { formatMessage } from '@/utils/localeUtils.js'; | 
 |  |  | import { message } from 'ant-design-vue'; | 
 |  |  | import { | 
 |  |  |     MinusCircleOutlined, | 
 |  |  |     PlusOutlined, | 
 |  |  | } from "@ant-design/icons-vue"; | 
 |  |  |  | 
 |  |  | const formTable = ref(null); | 
 |  |  | const submitButton = ref(null); | 
 |  |  | 
 |  |  | const open = ref(false); | 
 |  |  | const initFormData = {} | 
 |  |  | let formData = ref(initFormData); | 
 |  |  |  | 
 |  |  | const dynamicValidateForm = reactive({ | 
 |  |  |     detls: [], | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | const emit = defineEmits(['tableReload']) | 
 |  |  |  | 
 |  |  | 
 |  |  | const onFinish = values => { | 
 |  |  |     // console.log('Success:', values); | 
 |  |  |     open.value = false; | 
 |  |  |  | 
 |  |  |     let detls = [] | 
 |  |  |     dynamicValidateForm.detls.forEach((item) => { | 
 |  |  |         detls.push(item.value) | 
 |  |  |     }) | 
 |  |  |     formData.value.detls = detls; | 
 |  |  |     post(isSave.value ? '/api/shelvesRule/save' : '/api/shelvesRule/update', formData.value).then((resp) => { | 
 |  |  |         let result = resp.data; | 
 |  |  |         if (result.code === 200) { | 
 |  |  | 
 |  |  |     }) | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const removeDomain = item => { | 
 |  |  |     const index = dynamicValidateForm.detls.indexOf(item); | 
 |  |  |     if (index !== -1) { | 
 |  |  |         dynamicValidateForm.detls.splice(index, 1); | 
 |  |  |     } | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | const addDomain = () => { | 
 |  |  |     dynamicValidateForm.detls.push({ | 
 |  |  |         value: '', | 
 |  |  |     }); | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | watch(open, (newVal, oldVal) => { | 
 |  |  |     if (open.value) { | 
 |  |  |         if (!isSave.value) { | 
 |  |  |             let ruleDetls = formData.value.ruleDetl$ | 
 |  |  |             let detls = [] | 
 |  |  |             ruleDetls.forEach((item) => { | 
 |  |  |                 detls.push({ | 
 |  |  |                     value: item.detlType | 
 |  |  |                 }) | 
 |  |  |             }) | 
 |  |  |  | 
 |  |  |             dynamicValidateForm.detls = detls; | 
 |  |  |         } | 
 |  |  |     }else { | 
 |  |  |         dynamicValidateForm.detls = [] | 
 |  |  |     } | 
 |  |  | }) | 
 |  |  |  | 
 |  |  | defineExpose({ | 
 |  |  |     open, | 
 |  |  | 
 |  |  |             <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.name', '规则名称')" name="name" | 
 |  |  |                     style="width: 250px;"> | 
 |  |  |                     <a-input v-model:value="formData.name" /> | 
 |  |  |                 </a-form-item> | 
 |  |  |                 <a-form-item :label="formatMessage('db.strategy_shelves_rule.rule_type', '规则类型')" name="ruleType" | 
 |  |  |                     style="width: 250px;"> | 
 |  |  |                     <a-select v-model:value="formData.ruleType" :options="[ | 
 |  |  | 
 |  |  |                     ]"> | 
 |  |  |                     </a-select> | 
 |  |  |                 </a-form-item> | 
 |  |  |                 <a-form-item :label="formatMessage('db.strategy_shelves_rule.create_time', '添加时间')" name="createTime" | 
 |  |  |                 <!-- <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" /> | 
 |  |  | 
 |  |  |                         style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" | 
 |  |  |                         optionLabelProp="label"> | 
 |  |  |                     </a-select> | 
 |  |  |                 </a-form-item> | 
 |  |  |                 </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" /> | 
 |  |  | 
 |  |  |                         style="visibility: hidden;">Submit</a-button> | 
 |  |  |                 </a-form-item> | 
 |  |  |             </a-form> | 
 |  |  |  | 
 |  |  |             <a-form> | 
 |  |  |                 <a-form-item v-for="(domain, index) in dynamicValidateForm.detls" :key="domain.key" | 
 |  |  |                     :label="formatMessage('db.strategy_shelves_rule.memo', '规则明细')" :name="['domains', index, 'value']" | 
 |  |  |                     :labelCol="{ span: 4, offset: 1 }" style="width: 100%;"> | 
 |  |  |                     <div style="width: 400px;"> | 
 |  |  |                         <a-select v-model:value="domain.value" :options="[ | 
 |  |  |                             { label: '库存或任务中匹配相邻库位', value: 1 }, | 
 |  |  |                             { label: '推荐区域', value: 2 }, | 
 |  |  |                             { label: '完整巷道', value: 3 }, | 
 |  |  |                         ]" style="width: 300px;margin-right: 20px;"> | 
 |  |  |                         </a-select> | 
 |  |  |                         <MinusCircleOutlined v-if="dynamicValidateForm.detls.length > 1" | 
 |  |  |                             @click="removeDomain(domain)" /> | 
 |  |  |                     </div> | 
 |  |  |                 </a-form-item> | 
 |  |  |                 <a-form-item :labelCol="{ span: 4, offset: 1 }" style="width: 100%;"> | 
 |  |  |                     <div style="width: 200px;"> | 
 |  |  |                         <a-button type="dashed" style="width: 200px;" @click="addDomain"> | 
 |  |  |                             <PlusOutlined /> | 
 |  |  |                             {{ formatMessage('db.strategy_shelves_rule.addDetl', '添加明细') }} | 
 |  |  |                         </a-button> | 
 |  |  |                     </div> | 
 |  |  |                 </a-form-item> | 
 |  |  |             </a-form> | 
 |  |  |         </a-modal> | 
 |  |  |     </div> | 
 |  |  | </template> | 
 
 |  |  | 
 |  |  | } = 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('db.strategy_shelves_rule.name', '规则名称'), | 
 |  |  |     dataIndex: 'name', | 
 |  |  |     width: 140, | 
 |  |  |     ellipsis: true, | 
 |  |  |     ...getColumnSearchProps('name'), | 
 |  |  |   }, | 
 |  |  |   { | 
 |  |  |     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', '操作'), | 
 
| New file | 
 |  |  | 
 |  |  | <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/shelvesRuleDetl/save' : '/api/shelvesRuleDetl/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 shelvesRuleQueryList = ref(null); | 
 |  |  | shelvesRuleQuery(); | 
 |  |  | function shelvesRuleQuery() { | 
 |  |  |     postForm('/api/shelvesRule/query', {}).then(resp => { | 
 |  |  |         let result = resp.data; | 
 |  |  |         shelvesRuleQueryList.value = result.data; | 
 |  |  |     }) | 
 |  |  | } | 
 |  |  | 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.strategy_shelves_rule_detl.rule_id', '所属规则')" name="ruleId" | 
 |  |  |                     style="width: 250px;"> | 
 |  |  |                     <a-select v-model:value="formData.ruleId" :placeholder="formatMessage('common.select', '请选择')" | 
 |  |  |                         style="width: 100%" show-search :options="shelvesRuleQueryList" optionFilterProp="label" | 
 |  |  |                         optionLabelProp="label"> | 
 |  |  |                     </a-select> | 
 |  |  |                 </a-form-item> | 
 |  |  |                 <a-form-item :label="formatMessage('db.strategy_shelves_rule_detl.detl_type', '类型')" name="detlType" | 
 |  |  |                     style="width: 250px;"> | 
 |  |  |                     <a-select v-model:value="formData.detlType" :options="[ | 
 |  |  |                         { label: '库存或任务中匹配相邻库位', value: 1 }, | 
 |  |  |                         { label: '推荐区域', value: 2 }, | 
 |  |  |                         { label: '完整巷道', value: 3 }, | 
 |  |  |                     ]"> | 
 |  |  |                     </a-select> | 
 |  |  |                 </a-form-item> | 
 |  |  |                 <a-form-item :label="formatMessage('db.strategy_shelves_rule_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.strategy_shelves_rule_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.strategy_shelves_rule_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.strategy_shelves_rule_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.strategy_shelves_rule_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.strategy_shelves_rule_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" | 
 |  |  |                         style="visibility: hidden;">Submit</a-button> | 
 |  |  |                 </a-form-item> | 
 |  |  |             </a-form> | 
 |  |  |         </a-modal> | 
 |  |  |     </div> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <style></style> | 
 
| New file | 
 |  |  | 
 |  |  | <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-shelvesRuleDetl'; | 
 |  |  | 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_detl.rule_id', '所属规则'), | 
 |  |  |             dataIndex: 'ruleId$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('ruleId$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.detl_type', '类型'), | 
 |  |  |             dataIndex: 'detlType$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('detlType$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.status', '状态'), | 
 |  |  |             dataIndex: 'status$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('status$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.create_time', '添加时间'), | 
 |  |  |             dataIndex: 'createTime$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('createTime$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.create_by', '添加人员'), | 
 |  |  |             dataIndex: 'createBy$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('createBy$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.update_time', '修改时间'), | 
 |  |  |             dataIndex: 'updateTime$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('updateTime$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.update_by', '修改人员'), | 
 |  |  |             dataIndex: 'updateBy$', | 
 |  |  |             width: 140, | 
 |  |  |             ellipsis: true, | 
 |  |  |             ...getColumnSearchProps('updateBy$'), | 
 |  |  |         }, | 
 |  |  |         { | 
 |  |  |             title: formatMessage('db.strategy_shelves_rule_detl.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/shelvesRuleDetl/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/shelvesRuleDetl/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/shelvesRuleDetl/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> | 
 
 |  |  | 
 |  |  | 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.framework.exception.CoolException; | 
 |  |  | import com.zy.asrs.wms.asrs.entity.ShelvesRuleDetl; | 
 |  |  | import com.zy.asrs.wms.asrs.service.ShelvesRuleDetlService; | 
 |  |  | 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.utils.ExcelUtil; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | import javax.servlet.http.HttpServletResponse; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ShelvesRuleService shelvesRuleService; | 
 |  |  |     @Autowired | 
 |  |  |     private ShelvesRuleDetlService shelvesRuleDetlService; | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRule:list')") | 
 |  |  |     @PostMapping("/shelvesRule/page") | 
 |  |  | 
 |  |  |             return R.error("缺少参数"); | 
 |  |  |         } | 
 |  |  |         ShelvesRule shelvesRule = new ShelvesRule(); | 
 |  |  |         shelvesRule.setName(param.get("name").toString()); | 
 |  |  |         shelvesRule.setRuleType(Integer.parseInt(param.get("ruleType").toString())); | 
 |  |  |         shelvesRule.setLane(JSON.toJSONString(param.get("laneList"))); | 
 |  |  |         if (!shelvesRuleService.save(shelvesRule)) { | 
 |  |  |             return R.error("添加失败"); | 
 |  |  |             throw new CoolException("添加失败"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         List<Integer> detls = JSON.parseArray(JSON.toJSONString(param.get("detls")), Integer.class); | 
 |  |  |         for (Integer detlType : detls) { | 
 |  |  |             ShelvesRuleDetl shelvesRuleDetl = new ShelvesRuleDetl(); | 
 |  |  |             shelvesRuleDetl.setRuleId(shelvesRule.getId()); | 
 |  |  |             shelvesRuleDetl.setDetlType(detlType); | 
 |  |  |             if (!shelvesRuleDetlService.save(shelvesRuleDetl)) { | 
 |  |  |                 throw new CoolException("添加规则明细失败"); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return R.ok("添加成功"); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRule:update')") | 
 |  |  |     @OperationLog("修改上架规则") | 
 |  |  |     @PostMapping("/shelvesRule/update") | 
 |  |  |     @Transactional | 
 |  |  |     public R update(@RequestBody HashMap<String, Object> param) { | 
 |  |  |         if(!param.containsKey("ruleType") || !param.containsKey("laneList") || !param.containsKey("id")) { | 
 |  |  |             return R.error("缺少参数"); | 
 |  |  | 
 |  |  |             return R.error("上架规则不存在"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         shelvesRule.setName(param.get("name").toString()); | 
 |  |  |         shelvesRule.setRuleType(Integer.parseInt(param.get("ruleType").toString())); | 
 |  |  |         shelvesRule.setLane(JSON.toJSONString(param.get("laneList"))); | 
 |  |  |         shelvesRule.setStatus(Integer.parseInt(param.get("status").toString())); | 
 |  |  |         if (!shelvesRuleService.updateById(shelvesRule)) { | 
 |  |  |             return R.error("修改失败"); | 
 |  |  |             throw new CoolException("修改失败"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         shelvesRuleDetlService.remove(new LambdaQueryWrapper<ShelvesRuleDetl>().eq(ShelvesRuleDetl::getRuleId, shelvesRule.getId())); | 
 |  |  |         List<Integer> detls = JSON.parseArray(JSON.toJSONString(param.get("detls")), Integer.class); | 
 |  |  |         for (Integer detlType : detls) { | 
 |  |  |             ShelvesRuleDetl shelvesRuleDetl = new ShelvesRuleDetl(); | 
 |  |  |             shelvesRuleDetl.setRuleId(shelvesRule.getId()); | 
 |  |  |             shelvesRuleDetl.setDetlType(detlType); | 
 |  |  |             if (!shelvesRuleDetlService.save(shelvesRuleDetl)) { | 
 |  |  |                 throw new CoolException("添加规则明细失败"); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return R.ok("修改成功"); | 
 |  |  |     } | 
 |  |  |  | 
 
| New file | 
 |  |  | 
 |  |  | 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.ShelvesRuleDetl; | 
 |  |  | import com.zy.asrs.wms.asrs.service.ShelvesRuleDetlService; | 
 |  |  | 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 ShelvesRuleDetlController extends BaseController { | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ShelvesRuleDetlService shelvesRuleDetlService; | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:list')") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/page") | 
 |  |  |     public R page(@RequestBody Map<String, Object> map) { | 
 |  |  |         BaseParam baseParam = buildParam(map, BaseParam.class); | 
 |  |  |         PageParam<ShelvesRuleDetl, BaseParam> pageParam = new PageParam<>(baseParam, ShelvesRuleDetl.class); | 
 |  |  |         return R.ok().add(shelvesRuleDetlService.page(pageParam, pageParam.buildWrapper(true))); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:list')") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/list") | 
 |  |  |     public R list(@RequestBody Map<String, Object> map) { | 
 |  |  |         return R.ok().add(shelvesRuleDetlService.list()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:list')") | 
 |  |  |     @GetMapping("/shelvesRuleDetl/{id}") | 
 |  |  |     public R get(@PathVariable("id") Long id) { | 
 |  |  |         return R.ok().add(shelvesRuleDetlService.getById(id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:save')") | 
 |  |  |     @OperationLog("添加上架规则明细") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/save") | 
 |  |  |     public R save(@RequestBody ShelvesRuleDetl shelvesRuleDetl) { | 
 |  |  |         if (!shelvesRuleDetlService.save(shelvesRuleDetl)) { | 
 |  |  |             return R.error("添加失败"); | 
 |  |  |         } | 
 |  |  |         return R.ok("添加成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:update')") | 
 |  |  |     @OperationLog("修改上架规则明细") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/update") | 
 |  |  |     public R update(@RequestBody ShelvesRuleDetl shelvesRuleDetl) { | 
 |  |  |         if (!shelvesRuleDetlService.updateById(shelvesRuleDetl)) { | 
 |  |  |             return R.error("修改失败"); | 
 |  |  |         } | 
 |  |  |         return R.ok("修改成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:remove')") | 
 |  |  |     @OperationLog("删除上架规则明细") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/remove/{ids}") | 
 |  |  |     public R remove(@PathVariable Long[] ids) { | 
 |  |  |         if (!shelvesRuleDetlService.removeByIds(Arrays.asList(ids))) { | 
 |  |  |             return R.error("删除失败"); | 
 |  |  |         } | 
 |  |  |         return R.ok("删除成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PreAuthorize("hasAuthority('asrs:shelvesRuleDetl:list')") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/query") | 
 |  |  |     public R query(@RequestParam(required = false) String condition) { | 
 |  |  |         List<KeyValVo> vos = new ArrayList<>(); | 
 |  |  |         LambdaQueryWrapper<ShelvesRuleDetl> wrapper = new LambdaQueryWrapper<>(); | 
 |  |  |         if (!Cools.isEmpty(condition)) { | 
 |  |  |             wrapper.like(ShelvesRuleDetl::getId, condition); | 
 |  |  |         } | 
 |  |  |         shelvesRuleDetlService.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:shelvesRuleDetl:list')") | 
 |  |  |     @PostMapping("/shelvesRuleDetl/export") | 
 |  |  |     public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { | 
 |  |  |         ExcelUtil.build(ExcelUtil.create(shelvesRuleDetlService.list(), ShelvesRuleDetl.class), response); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.util.*; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
 |  |  | import com.zy.asrs.wms.asrs.service.LanewayRuleService; | 
 |  |  | import com.zy.asrs.wms.asrs.service.ShelvesRuleDetlService; | 
 |  |  | import com.zy.asrs.wms.system.entity.Host; | 
 |  |  | import com.zy.asrs.wms.system.entity.User; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  | 
 |  |  |     private Long id; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 规则名称 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "规则名称") | 
 |  |  |     private String name; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 规则类型 0: 优先平层  1: 优先立体 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "规则类型 0: 优先平层  1: 优先立体  ") | 
 |  |  | 
 |  |  |      * 是否删除 1: 是  0: 否   | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "是否删除 1: 是  0: 否  ") | 
 |  |  |     @TableLogic | 
 |  |  |     private Integer deleted; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public List<ShelvesRuleDetl> getRuleDetl$() { | 
 |  |  |         ShelvesRuleDetlService service = SpringUtils.getBean(ShelvesRuleDetlService.class); | 
 |  |  |         return service.list(new LambdaQueryWrapper<ShelvesRuleDetl>().eq(ShelvesRuleDetl::getRuleId, id)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getRuleType$(){ | 
 |  |  |         if (null == this.ruleType){ return null; } | 
 |  |  |         switch (this.ruleType){ | 
 
| New file | 
 |  |  | 
 |  |  | 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.ShelvesRuleService; | 
 |  |  | 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_detl") | 
 |  |  | public class ShelvesRuleDetl 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 ruleId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 类型 1: 库存或任务中匹配相邻库位  2: 推荐区域  3: 完整巷道   | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "类型 1: 库存或任务中匹配相邻库位  2: 推荐区域  3: 完整巷道  ") | 
 |  |  |     private Integer detlType; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 所属机构 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "所属机构") | 
 |  |  |     private Long hostId; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 状态 1: 正常  0: 禁用   | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ") | 
 |  |  |     private Integer status; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 是否删除 1: 是  0: 否   | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "是否删除 1: 是  0: 否  ") | 
 |  |  |     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 ShelvesRuleDetl() {} | 
 |  |  |  | 
 |  |  |     public ShelvesRuleDetl(Long ruleId,Integer detlType,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { | 
 |  |  |         this.ruleId = ruleId; | 
 |  |  |         this.detlType = detlType; | 
 |  |  |         this.hostId = hostId; | 
 |  |  |         this.status = status; | 
 |  |  |         this.deleted = deleted; | 
 |  |  |         this.createTime = createTime; | 
 |  |  |         this.createBy = createBy; | 
 |  |  |         this.updateTime = updateTime; | 
 |  |  |         this.updateBy = updateBy; | 
 |  |  |         this.memo = memo; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | //    ShelvesRuleDetl shelvesRuleDetl = new ShelvesRuleDetl( | 
 |  |  | //            null,    // 所属规则 | 
 |  |  | //            null,    // 类型 | 
 |  |  | //            null,    // 所属机构 | 
 |  |  | //            null,    // 状态 | 
 |  |  | //            null,    // 是否删除 | 
 |  |  | //            null,    // 添加时间 | 
 |  |  | //            null,    // 添加人员 | 
 |  |  | //            null,    // 修改时间 | 
 |  |  | //            null,    // 修改人员 | 
 |  |  | //            null    // 备注 | 
 |  |  | //    ); | 
 |  |  |  | 
 |  |  |     public String getRuleId$(){ | 
 |  |  |         ShelvesRuleService service = SpringUtils.getBean(ShelvesRuleService.class); | 
 |  |  |         ShelvesRule shelvesRule = service.getById(this.ruleId); | 
 |  |  |         if (!Cools.isEmpty(shelvesRule)){ | 
 |  |  |             return String.valueOf(shelvesRule.getId()); | 
 |  |  |         } | 
 |  |  |         return null; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getDetlType$(){ | 
 |  |  |         if (null == this.detlType){ return null; } | 
 |  |  |         switch (this.detlType){ | 
 |  |  |             case 1: | 
 |  |  |                 return "库存或任务中匹配相邻库位"; | 
 |  |  |             case 2: | 
 |  |  |                 return "推荐区域"; | 
 |  |  |             case 3: | 
 |  |  |                 return "完整巷道"; | 
 |  |  |             default: | 
 |  |  |                 return String.valueOf(this.detlType); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     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); | 
 |  |  |     } | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.zy.asrs.wms.asrs.entity.enums; | 
 |  |  |  | 
 |  |  | public enum ShelvesRuleType { | 
 |  |  |  | 
 |  |  |     LEVEL(0, "优先平层"), | 
 |  |  |     HIGH(1, "优先立体"), | 
 |  |  |     ; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public Integer id; | 
 |  |  |     public String desc; | 
 |  |  |  | 
 |  |  |     ShelvesRuleType(Integer id, String desc) { | 
 |  |  |         this.id = id; | 
 |  |  |         this.desc = desc; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.zy.asrs.wms.asrs.mapper; | 
 |  |  |  | 
 |  |  | import com.zy.asrs.wms.asrs.entity.ShelvesRuleDetl; | 
 |  |  | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
 |  |  | import org.apache.ibatis.annotations.Mapper; | 
 |  |  | import org.springframework.stereotype.Repository; | 
 |  |  |  | 
 |  |  | @Mapper | 
 |  |  | @Repository | 
 |  |  | public interface ShelvesRuleDetlMapper extends BaseMapper<ShelvesRuleDetl> { | 
 |  |  |  | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.zy.asrs.wms.asrs.service; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.extension.service.IService; | 
 |  |  | import com.zy.asrs.wms.asrs.entity.ShelvesRuleDetl; | 
 |  |  |  | 
 |  |  | public interface ShelvesRuleDetlService extends IService<ShelvesRuleDetl> { | 
 |  |  |  | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | package com.zy.asrs.wms.asrs.service.impl; | 
 |  |  |  | 
 |  |  | import com.zy.asrs.wms.asrs.mapper.ShelvesRuleDetlMapper; | 
 |  |  | import com.zy.asrs.wms.asrs.entity.ShelvesRuleDetl; | 
 |  |  | import com.zy.asrs.wms.asrs.service.ShelvesRuleDetlService; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  |  | 
 |  |  | @Service("shelvesRuleDetlService") | 
 |  |  | public class ShelvesRuleDetlServiceImpl extends ServiceImpl<ShelvesRuleDetlMapper, ShelvesRuleDetl> implements ShelvesRuleDetlService { | 
 |  |  |  | 
 |  |  | } | 
 
| New file | 
 |  |  | 
 |  |  | <?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.ShelvesRuleDetlMapper"> | 
 |  |  |  | 
 |  |  | </mapper> | 
 
| New file | 
 |  |  | 
 |  |  | -- save shelvesRuleDetl record | 
 |  |  | -- mysql | 
 |  |  | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( '上架规则明细管理', '0', '/asrs/shelvesRuleDetl', '/asrs/shelvesRuleDetl', '0' , '0', '1' , '1'); | 
 |  |  |  | 
 |  |  | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '查询上架规则明细', '', '1', 'asrs:shelvesRuleDetl:list', '0', '1', '1'); | 
 |  |  | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '添加上架规则明细', '', '1', 'asrs:shelvesRuleDetl:save', '1', '1', '1'); | 
 |  |  | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '修改上架规则明细', '', '1', 'asrs:shelvesRuleDetl:update', '2', '1', '1'); | 
 |  |  | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '删除上架规则明细', '', '1', 'asrs:shelvesRuleDetl:remove', '3', '1', '1'); | 
 |  |  |  |