From 8a5e7957290d6cf1be0d1499f0be0172a44701dd Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 26 三月 2024 14:52:47 +0800
Subject: [PATCH] Merge branch 'Four-Way-Rack' of http://47.97.1.152:5880/r/zy-asrs-master into Four-Way-Rack
---
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/DeviceCtg.java | 206 +++++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/DeviceCtgController.java | 101 ++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/MotionStsType.java | 31 +
zy-asrs-wcs/src/main/java/deviceCtg.sql | 9
zy-asrs-flow/src/pages/core/deviceCtg/components/edit.jsx | 148 +++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java | 2
zy-asrs-flow/src/pages/core/deviceCtg/index.jsx | 428 ++++++++++++++++++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/DeviceCtgMapper.java | 12
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/DeviceCtgService.java | 10
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/DeviceCtgType.java | 39 +
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java | 5
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java | 67 +++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleCommand.java | 121 +++++
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/DeviceCtgServiceImpl.java | 18
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java | 36 +
zy-asrs-wcs/src/main/resources/mapper/core/DeviceCtgMapper.xml | 5
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java | 16
17 files changed, 1,235 insertions(+), 19 deletions(-)
diff --git a/zy-asrs-flow/src/pages/core/deviceCtg/components/edit.jsx b/zy-asrs-flow/src/pages/core/deviceCtg/components/edit.jsx
new file mode 100644
index 0000000..8dfc2ae
--- /dev/null
+++ b/zy-asrs-flow/src/pages/core/deviceCtg/components/edit.jsx
@@ -0,0 +1,148 @@
+import React, { useState, useRef, useEffect } from 'react';
+import {
+ ProForm,
+ ProFormDigit,
+ ProFormText,
+ ProFormSelect,
+ ProFormDateTimePicker
+} from '@ant-design/pro-components';
+import { Form, Modal } from 'antd';
+import { FormattedMessage, useIntl } from '@umijs/max';
+import moment from 'moment';
+import Http from '@/utils/http';
+
+const Edit = (props) => {
+ const intl = useIntl();
+ const [form] = Form.useForm();
+ const { } = props;
+
+ useEffect(() => {
+ form.resetFields();
+ form.setFieldsValue({
+ ...props.values
+ })
+ }, [form, props])
+
+ const handleCancel = () => {
+ props.onCancel();
+ };
+
+ const handleOk = () => {
+ form.submit();
+ }
+
+ const handleFinish = async (values) => {
+ props.onSubmit({ ...values });
+ }
+
+ return (
+ <>
+ <Modal
+ title={
+ Object.keys(props.values).length > 0
+ ? intl.formatMessage({ id: 'page.edit', defaultMessage: '缂栬緫' })
+ : intl.formatMessage({ id: 'page.add', defaultMessage: '娣诲姞' })
+ }
+ width={640}
+ forceRender
+ destroyOnClose
+ open={props.open}
+ onCancel={handleCancel}
+ onOk={handleOk}
+ >
+ <ProForm
+ form={form}
+ submitter={false}
+ onFinish={handleFinish}
+ layout="horizontal"
+ grid={true}
+ >
+ <ProFormDigit
+ name="id"
+ disabled
+ hidden={true}
+ />
+ <ProForm.Group>
+ <ProFormText
+ name="uuid"
+ label="缂栧彿"
+ colProps={{ md: 12, xl: 12 }}
+ />
+ <ProFormText
+ name="name"
+ label="鍚嶇О"
+ colProps={{ md: 12, xl: 12 }}
+ rules={[{ required: true }]}
+ />
+ </ProForm.Group>
+ <ProForm.Group>
+ <ProFormText
+ name="flag"
+ label="鏍囪瘑"
+ colProps={{ md: 12, xl: 12 }}
+ />
+ <ProFormSelect
+ name="status"
+ label="鐘舵��"
+ colProps={{ md: 12, xl: 12 }}
+ options={[
+ { label: '姝e父', value: 1 },
+ { label: '绂佺敤', value: 0 },
+ ]}
+ />
+ </ProForm.Group>
+ <ProForm.Group>
+ <ProFormSelect
+ name="createBy"
+ label="娣诲姞浜哄憳"
+ colProps={{ md: 12, xl: 12 }}
+ fieldProps={{ precision: 0 }}
+ showSearch
+ debounceTime={300}
+ request={async ({ keyWords }) => {
+ const resp = await Http.doPostForm('api/user/query', { condition: keyWords });
+ return resp.data;
+ }}
+ />
+ <ProFormDateTimePicker
+ name="createTime"
+ label="娣诲姞鏃堕棿"
+ colProps={{ md: 12, xl: 12 }}
+ transform={(value) => moment(value).toISOString()}
+ />
+ </ProForm.Group>
+ <ProForm.Group>
+ <ProFormSelect
+ name="updateBy"
+ label="淇敼浜哄憳"
+ colProps={{ md: 12, xl: 12 }}
+ fieldProps={{ precision: 0 }}
+ showSearch
+ debounceTime={300}
+ request={async ({ keyWords }) => {
+ const resp = await Http.doPostForm('api/user/query', { condition: keyWords });
+ return resp.data;
+ }}
+ />
+ <ProFormDateTimePicker
+ name="updateTime"
+ label="淇敼鏃堕棿"
+ colProps={{ md: 12, xl: 12 }}
+ transform={(value) => moment(value).toISOString()}
+ />
+ </ProForm.Group>
+ <ProForm.Group>
+ <ProFormText
+ name="memo"
+ label="澶囨敞"
+ colProps={{ md: 12, xl: 12 }}
+ />
+ </ProForm.Group>
+
+ </ProForm>
+ </Modal>
+ </>
+ )
+}
+
+export default Edit;
diff --git a/zy-asrs-flow/src/pages/core/deviceCtg/index.jsx b/zy-asrs-flow/src/pages/core/deviceCtg/index.jsx
new file mode 100644
index 0000000..499e210
--- /dev/null
+++ b/zy-asrs-flow/src/pages/core/deviceCtg/index.jsx
@@ -0,0 +1,428 @@
+
+import React, { useState, useRef, useEffect } from 'react';
+import { Button, message, Modal, Tag } from 'antd';
+import {
+ FooterToolbar,
+ PageContainer,
+ ProTable,
+ LightFilter,
+} from '@ant-design/pro-components';
+import { FormattedMessage, useIntl } from '@umijs/max';
+import { PlusOutlined, ExportOutlined } from '@ant-design/icons';
+import Http from '@/utils/http';
+import Edit from './components/edit'
+import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch'
+import { statusMap } from '@/utils/enum-util'
+import { repairBug } from '@/utils/common-util';
+
+const TABLE_KEY = 'pro-table-deviceCtg';
+
+const handleSave = async (val, intl) => {
+ const hide = message.loading(intl.formatMessage({ id: 'page.adding', defaultMessage: '姝e湪娣诲姞' }));
+ try {
+ const resp = await Http.doPost('api/deviceCtg/save', val);
+ if (resp.code === 200) {
+ message.success(intl.formatMessage({ id: 'page.add.success', defaultMessage: '娣诲姞鎴愬姛' }));
+ return true;
+ } else {
+ message.error(resp.msg);
+ return false;
+ }
+ } catch (error) {
+ message.error(intl.formatMessage({ id: 'page.add.fail', defaultMessage: '娣诲姞澶辫触璇烽噸璇曪紒' }));
+ return false;
+ } finally {
+ hide();
+ }
+};
+
+const handleUpdate = async (val, intl) => {
+ const hide = message.loading(intl.formatMessage({ id: 'page.updating', defaultMessage: '姝e湪鏇存柊' }));
+ try {
+ const resp = await Http.doPost('api/deviceCtg/update', val);
+ if (resp.code === 200) {
+ message.success(intl.formatMessage({ id: 'page.update.success', defaultMessage: '鏇存柊鎴愬姛' }));
+ return true;
+ } else {
+ message.error(resp.msg);
+ return false;
+ }
+ } catch (error) {
+ message.error(intl.formatMessage({ id: 'page.update.fail', defaultMessage: '鏇存柊澶辫触璇烽噸璇曪紒' }));
+ return false;
+ } finally {
+ hide();
+ }
+};
+
+const handleRemove = async (rows, intl) => {
+ if (!rows) return true;
+ const hide = message.loading(intl.formatMessage({ id: 'page.deleting', defaultMessage: '姝e湪鍒犻櫎' }));
+ try {
+ const resp = await Http.doPost('api/deviceCtg/remove/' + rows.map((row) => row.id).join(','));
+ if (resp.code === 200) {
+ message.success(intl.formatMessage({ id: 'page.delete.success', defaultMessage: '鍒犻櫎鎴愬姛' }));
+ return true;
+ } else {
+ message.error(resp.msg);
+ return false;
+ }
+ } catch (error) {
+ message.error(intl.formatMessage({ id: 'page.delete.fail', defaultMessage: '鍒犻櫎澶辫触锛岃閲嶈瘯锛�' }));
+ return false;
+ } finally {
+ hide();
+ }
+};
+
+const handleExport = async (intl) => {
+ const hide = message.loading(intl.formatMessage({ id: 'page.exporting', defaultMessage: '姝e湪瀵煎嚭' }));
+ try {
+ const resp = await Http.doPostBlob('api/deviceCtg/export');
+ const blob = new Blob([resp], { type: 'application/vnd.ms-excel' });
+ window.location.href = window.URL.createObjectURL(blob);
+ message.success(intl.formatMessage({ id: 'page.export.success', defaultMessage: '瀵煎嚭鎴愬姛' }));
+ return true;
+ } catch (error) {
+ message.error(intl.formatMessage({ id: 'page.export.fail', defaultMessage: '瀵煎嚭澶辫触锛岃閲嶈瘯' }));
+ return false;
+ } finally {
+ hide();
+ }
+};
+
+
+const Main = () => {
+ const intl = useIntl();
+ const formTableRef = useRef();
+ const actionRef = useRef();
+ const [selectedRows, setSelectedRows] = useState([]);
+ const [modalVisible, setModalVisible] = useState(false);
+ const [currentRow, setCurrentRow] = useState();
+ const [searchParam, setSearchParam] = useState({});
+
+ useEffect(() => {
+
+ }, []);
+
+ const columns = [
+ {
+ title: intl.formatMessage({
+ id: 'page.table.no',
+ defaultMessage: 'No'
+ }),
+ dataIndex: 'index',
+ valueType: 'indexBorder',
+ width: 48,
+ },
+ {
+ title: '缂栧彿',
+ dataIndex: 'uuid',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <TextFilter
+ name='uuid'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '鍚嶇О',
+ dataIndex: 'name',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ copyable: true,
+ filterDropdown: (props) => <TextFilter
+ name='name'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '鏍囪瘑',
+ dataIndex: 'flag',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <TextFilter
+ name='flag'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '鐘舵��',
+ dataIndex: 'status$',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <SelectFilter
+ name='status'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ data={[
+ { label: '姝e父', value: 1 },
+ { label: '绂佺敤', value: 0 },
+ ]}
+ />,
+ },
+ {
+ title: '娣诲姞浜哄憳',
+ dataIndex: 'createBy$',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <LinkFilter
+ name='createBy'
+ major='user'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '娣诲姞鏃堕棿',
+ dataIndex: 'createTime$',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <DatetimeRangeFilter
+ name='createTime'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '淇敼浜哄憳',
+ dataIndex: 'updateBy$',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <LinkFilter
+ name='updateBy'
+ major='user'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '淇敼鏃堕棿',
+ dataIndex: 'updateTime$',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <DatetimeRangeFilter
+ name='updateTime'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+ {
+ title: '澶囨敞',
+ dataIndex: 'memo',
+ valueType: 'text',
+ hidden: false,
+ width: 140,
+ filterDropdown: (props) => <TextFilter
+ name='memo'
+ {...props}
+ actionRef={actionRef}
+ setSearchParam={setSearchParam}
+ />,
+ },
+
+ {
+ title: '鎿嶄綔',
+ dataIndex: 'option',
+ width: 140,
+ valueType: 'option',
+ render: (_, record) => [
+ <Button
+ type="link"
+ key="edit"
+ onClick={() => {
+ setModalVisible(true);
+ setCurrentRow(record);
+ }}
+ >
+ <FormattedMessage id='page.edit' defaultMessage='缂栬緫' />
+ </Button>,
+ <Button
+ type="link"
+ danger
+ key="batchRemove"
+ onClick={async () => {
+ Modal.confirm({
+ title: intl.formatMessage({ id: 'page.delete', defaultMessage: '鍒犻櫎' }),
+ content: intl.formatMessage({ id: 'page.delete.confirm', defaultMessage: '纭畾鍒犻櫎璇ラ」鍚楋紵' }),
+ onOk: async () => {
+ const success = await handleRemove([record], intl);
+ if (success) {
+ if (actionRef.current) {
+ actionRef.current.reload();
+ }
+ }
+ },
+ });
+ }}
+ >
+ <FormattedMessage id='page.delete' defaultMessage='鍒犻櫎' />
+ </Button>,
+ ],
+ },
+ ];
+
+ return (
+ <PageContainer
+ header={{
+ breadcrumb: {},
+ }}
+ >
+ <div style={{ width: '100%', float: 'right' }}>
+ <ProTable
+ key="deviceCtg"
+ rowKey="id"
+ actionRef={actionRef}
+ formRef={formTableRef}
+ columns={columns}
+ cardBordered
+ scroll={{ x: 1300 }}
+ dateFormatter="string"
+ pagination={{ pageSize: 16 }}
+ search={false}
+ toolbar={{
+ search: {
+ onSearch: (value) => {
+ setSearchParam(prevState => ({
+ ...prevState,
+ condition: value
+ }));
+ actionRef.current?.reload();
+ },
+ },
+ filter: (
+ <LightFilter
+ onValuesChange={(val) => {
+ }}
+ >
+ </LightFilter>
+ ),
+ actions: [
+ <Button
+ type="primary"
+ key="save"
+ onClick={async () => {
+ setModalVisible(true)
+ }}
+ >
+ <PlusOutlined />
+ <FormattedMessage id='page.add' defaultMessage='娣诲姞' />
+ </Button>,
+ <Button
+ key="export"
+ onClick={async () => {
+ handleExport(intl);
+ }}
+ >
+ <ExportOutlined />
+ <FormattedMessage id='page.export' defaultMessage='瀵煎嚭' />
+ </Button>,
+ ],
+ }}
+ request={(params, sorter, filter) =>
+ Http.doPostPromise('/api/deviceCtg/page', { ...params, ...searchParam }, (res) => {
+ return {
+ data: res.data.records,
+ total: res.data.total,
+ success: true,
+ }
+ })
+ }
+ rowSelection={{
+ onChange: (ids, rows) => {
+ setSelectedRows(rows);
+ }
+ }}
+ columnsState={{
+ persistenceKey: TABLE_KEY,
+ persistenceType: 'localStorage',
+ defaultValue: {
+ // memo: { show: repairBug(TABLE_KEY, 'memo', false) },
+ option: { fixed: 'right', disable: true },
+ },
+ onChange(value) {
+ },
+ }}
+ />
+ </div>
+
+ {selectedRows?.length > 0 && (
+ <FooterToolbar
+ extra={
+ <div>
+ <a style={{ fontWeight: 600 }}>{selectedRows.length}</a>
+ <FormattedMessage id='page.selected' defaultMessage=' 椤瑰凡閫夋嫨' />
+ </div>
+ }
+ >
+ <Button
+ key="remove"
+ danger
+ onClick={async () => {
+ Modal.confirm({
+ title: intl.formatMessage({ id: 'page.delete', defaultMessage: '鍒犻櫎' }),
+ content: intl.formatMessage({ id: 'page.delete.confirm', defaultMessage: '纭畾鍒犻櫎璇ラ」鍚楋紵' }),
+ onOk: async () => {
+ const success = await handleRemove(selectedRows, intl);
+ if (success) {
+ setSelectedRows([]);
+ actionRef.current?.reloadAndRest?.();
+ }
+ },
+ });
+ }}
+ >
+ <FormattedMessage id='page.delete.batch' defaultMessage='鎵归噺鍒犻櫎' />
+ </Button>
+ </FooterToolbar>
+ )}
+
+ <Edit
+ open={modalVisible}
+ values={currentRow || {}}
+ onCancel={
+ () => {
+ setModalVisible(false);
+ setCurrentRow(undefined);
+ }
+ }
+ onSubmit={async (values) => {
+ let ok = false;
+ if (values.id) {
+ ok = await handleUpdate({ ...values }, intl)
+ } else {
+ ok = await handleSave({ ...values }, intl)
+ }
+ if (ok) {
+ setModalVisible(false);
+ setCurrentRow(undefined);
+ if (actionRef.current) {
+ actionRef.current.reload();
+ }
+ }
+ }}
+ />
+ </PageContainer>
+ );
+};
+
+export default Main;
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/DeviceCtgController.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/DeviceCtgController.java
new file mode 100644
index 0000000..91bf347
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/DeviceCtgController.java
@@ -0,0 +1,101 @@
+package com.zy.asrs.wcs.system.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.wcs.common.annotation.OperationLog;
+import com.zy.asrs.wcs.common.domain.BaseParam;
+import com.zy.asrs.wcs.common.domain.KeyValVo;
+import com.zy.asrs.wcs.common.domain.PageParam;
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+import com.zy.asrs.wcs.core.service.DeviceCtgService;
+import com.zy.asrs.wcs.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 DeviceCtgController extends BaseController {
+
+ @Autowired
+ private DeviceCtgService deviceCtgService;
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:list')")
+ @PostMapping("/deviceCtg/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<DeviceCtg, BaseParam> pageParam = new PageParam<>(baseParam, DeviceCtg.class);
+ return R.ok().add(deviceCtgService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:list')")
+ @PostMapping("/deviceCtg/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(deviceCtgService.list());
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:list')")
+ @GetMapping("/deviceCtg/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(deviceCtgService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:save')")
+ @OperationLog("娣诲姞Motion璁惧绫诲瀷")
+ @PostMapping("/deviceCtg/save")
+ public R save(@RequestBody DeviceCtg deviceCtg) {
+ if (!deviceCtgService.save(deviceCtg)) {
+ return R.error("娣诲姞澶辫触");
+ }
+ return R.ok("娣诲姞鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:update')")
+ @OperationLog("淇敼Motion璁惧绫诲瀷")
+ @PostMapping("/deviceCtg/update")
+ public R update(@RequestBody DeviceCtg deviceCtg) {
+ if (!deviceCtgService.updateById(deviceCtg)) {
+ return R.error("淇敼澶辫触");
+ }
+ return R.ok("淇敼鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:remove')")
+ @OperationLog("鍒犻櫎Motion璁惧绫诲瀷")
+ @PostMapping("/deviceCtg/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!deviceCtgService.removeByIds(Arrays.asList(ids))) {
+ return R.error("鍒犻櫎澶辫触");
+ }
+ return R.ok("鍒犻櫎鎴愬姛");
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:list')")
+ @PostMapping("/deviceCtg/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<DeviceCtg> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(DeviceCtg::getName, condition);
+ }
+ deviceCtgService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+ item -> vos.add(new KeyValVo(item.getId(), item.getName()))
+ );
+ return R.ok().add(vos);
+ }
+
+ @PreAuthorize("hasAuthority('core:deviceCtg:list')")
+ @PostMapping("/deviceCtg/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(deviceCtgService.list(), DeviceCtg.class), response);
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/DeviceCtg.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/DeviceCtg.java
new file mode 100644
index 0000000..1e8d20e
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/entity/DeviceCtg.java
@@ -0,0 +1,206 @@
+package com.zy.asrs.wcs.core.entity;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.zy.asrs.wcs.system.entity.Host;
+import com.zy.asrs.wcs.system.entity.User;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+
+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.wcs.system.service.UserService;
+import com.zy.asrs.wcs.system.service.HostService;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("rcs_device_ctg")
+public class DeviceCtg 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 uuid;
+
+ /**
+ * 鍚嶇О
+ */
+ @ApiModelProperty(value= "鍚嶇О")
+ private String name;
+
+ /**
+ * 鏍囪瘑
+ */
+ @ApiModelProperty(value= "鏍囪瘑")
+ private String flag;
+
+ /**
+ * 鐘舵�� 1: 姝e父 0: 绂佺敤
+ */
+ @ApiModelProperty(value= "鐘舵�� 1: 姝e父 0: 绂佺敤 ")
+ private Integer status;
+
+ /**
+ * 娣诲姞浜哄憳
+ */
+ @ApiModelProperty(value= "娣诲姞浜哄憳")
+ private Long createBy;
+
+ /**
+ * 娣诲姞鏃堕棿
+ */
+ @ApiModelProperty(value= "娣诲姞鏃堕棿")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+ /**
+ * 淇敼浜哄憳
+ */
+ @ApiModelProperty(value= "淇敼浜哄憳")
+ private Long updateBy;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @ApiModelProperty(value= "淇敼鏃堕棿")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+
+ /**
+ * 澶囨敞
+ */
+ @ApiModelProperty(value= "澶囨敞")
+ private String memo;
+
+ /**
+ * 鏄惁鍒犻櫎 1: 鏄� 0: 鍚�
+ */
+ @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄� 0: 鍚� ")
+ @TableLogic
+ private Integer deleted;
+
+ /**
+ * 鎵�灞炴満鏋�
+ */
+ @ApiModelProperty(value= "鎵�灞炴満鏋�")
+ private Long hostId;
+
+ public DeviceCtg() {}
+
+ public DeviceCtg(String uuid,String name,String flag,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
+ this.uuid = uuid;
+ this.name = name;
+ this.flag = flag;
+ this.status = status;
+ this.createBy = createBy;
+ this.createTime = createTime;
+ this.updateBy = updateBy;
+ this.updateTime = updateTime;
+ this.memo = memo;
+ this.deleted = deleted;
+ this.hostId = hostId;
+ }
+
+// DeviceCtg deviceCtg = new DeviceCtg(
+// null, // 缂栧彿
+// null, // 鍚嶇О[闈炵┖]
+// null, // 鏍囪瘑
+// null, // 鐘舵��
+// null, // 娣诲姞浜哄憳
+// null, // 娣诲姞鏃堕棿
+// null, // 淇敼浜哄憳
+// null, // 淇敼鏃堕棿
+// null, // 澶囨敞
+// null, // 鏄惁鍒犻櫎
+// 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 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 getCreateTime$(){
+ if (Cools.isEmpty(this.createTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+ }
+
+ 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 String getUpdateTime$(){
+ if (Cools.isEmpty(this.updateTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+ }
+
+ 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 getHostId$(){
+ HostService service = SpringUtils.getBean(HostService.class);
+ Host host = service.getById(this.hostId);
+ if (!Cools.isEmpty(host)){
+ return String.valueOf(host.getName());
+ }
+ return null;
+ }
+
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
similarity index 94%
rename from zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java
rename to zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
index 29dc778..19a0fed 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/kernel/command/ShuttleCommandService.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -1,14 +1,27 @@
-//package com.zy.asrs.wcs.rcs.kernel.command;
+//package com.zy.asrs.wcs.core.kernel.command;
//
-//import com.zy.asrs.common.wms.mapper.WrkMastMapper;
-//import com.zy.asrs.common.wms.service.LocMastService;
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.zy.asrs.wcs.core.model.command.ShuttleAssignCommand;
+//import com.zy.asrs.wcs.core.model.command.ShuttleCommand;
+//import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
+//import com.zy.asrs.wcs.core.model.enums.MotionStsType;
+//import com.zy.asrs.wcs.core.service.BasShuttleService;
+//import com.zy.asrs.wcs.core.service.LocService;
+//import com.zy.asrs.wcs.core.service.TaskService;
//import com.zy.asrs.wcs.core.utils.NavigateMapUtils;
//import com.zy.asrs.wcs.core.utils.RedisUtil;
+//import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
+//import com.zy.asrs.wcs.rcs.entity.Motion;
+//import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
+//import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol;
+//import com.zy.asrs.wcs.rcs.service.MotionService;
+//import com.zy.asrs.wcs.rcs.thread.ShuttleThread;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.ArrayList;
+//import java.util.List;
//import java.util.Objects;
//import java.util.Optional;
//
@@ -26,11 +39,11 @@
// @Autowired
// private MotionService motionService;
// @Autowired
-// private WrkMastMapper wrkMastMapper;
+// private TaskService taskService;
// @Autowired
// private BasShuttleService basShuttleService;
// @Autowired
-// private LocMastService locMastService;
+// private LocService locService;
// @Autowired
// private NavigateMapUtils navigateMapUtils;
//
@@ -38,21 +51,20 @@
// public Boolean accept(Motion motion) {
// Integer deviceNo = Integer.parseInt(motion.getDevice());
// ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, deviceNo);
-// ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol();
+// ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
// if (null == shuttleProtocol) {
// return false;
// }
-// if (shuttleProtocol.getBusyStatus().intValue() == ShuttleStatusType.BUSY.id
-// || !shuttleProtocol.isIdle()) {
+// if (!shuttleProtocol.getIdle()) {//璁惧涓嶇┖闂�
// return false;
// }
// if (!shuttleProtocol.getPakMk()) {
// return false;
// }
-// if (motionService.selectCount(new EntityWrapper<Motion>()
-// .eq("device_ctg", DeviceCtgType.SHUTTLE.val())
-// .eq("device", motion.getDevice())
-// .eq("motion_sts", MotionStsType.EXECUTING.val())) > 0) {
+// if (motionService.count(new LambdaQueryWrapper<Motion>()
+// .eq(Motion::getDeviceCtg, DeviceCtgType.SHUTTLE.val())
+// .eq(Motion::getDevice, motion.getDevice())
+// .eq(Motion::getMotionSts, MotionStsType.EXECUTING.val())) > 0) {
// return false;
// }
//
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/DeviceCtgMapper.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/DeviceCtgMapper.java
new file mode 100644
index 0000000..9589adf
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/DeviceCtgMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.wcs.core.mapper;
+
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface DeviceCtgMapper extends BaseMapper<DeviceCtg> {
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java
new file mode 100644
index 0000000..0b00083
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleAssignCommand.java
@@ -0,0 +1,67 @@
+package com.zy.asrs.wcs.core.model.command;
+
+import com.zy.asrs.wcs.core.model.NavigateNode;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class ShuttleAssignCommand {
+
+ /**
+ * 鍥涘悜绌挎杞﹀彿
+ */
+ private Short shuttleNo = 0;
+
+ /**
+ * 浠诲姟鍙�
+ */
+ private Short taskNo = 0;
+
+ /**
+ * 浣滀笟绫诲瀷
+ * 1: 鍏ュ簱
+ * 2锛� 鍑哄簱
+ * 3锛� 鎵樼洏椤跺崌
+ * 4锛� 鎵樼洏涓嬮檷
+ * 5锛� 宸︾Щ
+ * 6锛� 鍙崇Щ
+ * 7锛� 鍓嶇Щ
+ * 8锛� 鍚庣Щ
+ * 9: 鍏呯數
+ */
+ private Short taskMode = 0;
+
+ /**
+ * 婧愬簱浣�
+ */
+ private String sourceLocNo;
+
+ /**
+ * 鐩爣搴撲綅
+ */
+ private String locNo;
+
+ /**
+ * 鍛戒护list
+ */
+ private List<ShuttleCommand> commands = new ArrayList<>();
+
+ /**
+ * 鏄惁鑷姩锛宼rue锛氳嚜鍔ㄦā寮忥紝false锛氭墜鍔ㄦā寮�
+ */
+ private Boolean auto = true;
+
+
+ /**
+ * 鏄惁涓哄厖鐢典换鍔°�倀rue锛氭槸锛宖alse锛氬惁
+ */
+ private Boolean charge = false;
+
+ /**
+ * 褰撳墠浠诲姟鎵�鍗犵敤鐨勮妭鐐筶ist
+ */
+ private List<NavigateNode> nodes;
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleCommand.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleCommand.java
new file mode 100644
index 0000000..6756dc6
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/command/ShuttleCommand.java
@@ -0,0 +1,121 @@
+package com.zy.asrs.wcs.core.model.command;
+
+import com.zy.asrs.wcs.core.model.NavigateNode;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 鍥涘悜绌挎杞﹀懡浠ゆ姤鏂�
+ */
+@Data
+public class ShuttleCommand {
+
+ /**
+ * 鍥涘悜绌挎杞﹀彿
+ */
+ private Short shuttleNo = 0;
+
+ /**
+ * 浠诲姟鍙�
+ */
+ private Short taskNo = 0;
+
+ /**
+ * 浣滀笟绫诲瀷
+ */
+ private Short taskMode = 0;
+
+ /**
+ * 鍔熻兘璇存槑
+ * 0銆佺┖
+ * 1銆佹甯哥Щ鍔�
+ * 2銆佹墭鐩橀《鍗�
+ * 3銆佸己鍒剁Щ鍔�
+ * 4銆佹煡鎵惧畾浣嶇偣
+ * 5銆佸厖鐢靛紑鍏�
+ * 6銆佺郴缁熷浣�
+ * 7銆佺揣鎬ュ仠姝�
+ * 8銆両O鎺у埗
+ * 9銆佽璧扮數鏈哄己鍒剁Щ鍔紙杈撳叆涓鸿剦鍐叉寚浠わ級
+ * 10銆佸崌闄嶄己鏈嶅己鍒剁Щ鍔紙杈撳叆涓鸿剦鍐叉寚浠わ級
+ * 鎺у埗鎸囦护瀛�
+ */
+ private Short commandWord;
+
+ /**
+ * 鍚浜岀淮缂栧彿
+ */
+ private Short startCodeNum;
+
+ /**
+ * 涓棿浜岀淮缂栧彿
+ */
+ private Short middleCodeNum;
+
+ /**
+ * 鐩爣浜岀淮缂栧彿
+ */
+ private Short distCodeNum;
+
+ /**
+ * 璧风偣鍒扮洰鏍囩偣鐨勮窛绂婚暱搴�
+ */
+ private Integer startToDistDistance;
+
+ /**
+ * 涓棿鐐瑰埌鐩爣鐐圭殑璺濈闀垮害
+ */
+ private Integer middleToDistDistance;
+
+ /**
+ * 灏忚溅杩愯鏂瑰悜
+ */
+ private Short runDirection;
+
+ /**
+ * 鎵樼洏椤跺崌
+ */
+ private Short palletLift;
+
+ /**
+ * 灏忚溅寮哄埗绉诲姩璺濈
+ */
+ private Integer forceMoveDistance;
+
+ /**
+ * 鍏呯數寮�鍏�
+ */
+ private Short chargeSwitch;
+
+ /**
+ * 灏忚溅IO鎺у埗
+ */
+ private Short IOControl;
+
+ /**
+ * 灏忚溅杩愯閫熷害
+ */
+ private Short runSpeed;
+
+ /**
+ * 灏忚溅闆疯揪澶囩敤
+ */
+ private Short radarTmp;
+
+ /**
+ * 鎸囦护缁撴潫浣�
+ */
+ private Short commandEnd;
+
+ /**
+ * 鍛戒护鏄惁瀹屾垚,榛樿false鏈畬鎴�
+ */
+ private Boolean complete = false;
+
+ /**
+ * 琛岃蛋鍛戒护鎵�鍗犵敤鐨勮妭鐐筶ist
+ */
+ private List<NavigateNode> nodes;
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/DeviceCtgType.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/DeviceCtgType.java
new file mode 100644
index 0000000..2542faa
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/DeviceCtgType.java
@@ -0,0 +1,39 @@
+package com.zy.asrs.wcs.core.model.enums;
+
+import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.framework.exception.CoolException;
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+import com.zy.asrs.wcs.core.service.DeviceCtgService;
+
+public enum DeviceCtgType {
+
+ CONVEYOR,
+ CRANE,
+ LIFT,
+ SHUTTLE,
+ AGV,
+ ;
+
+ DeviceCtgType() {
+ }
+
+ public long val() {
+ DeviceCtgService service = SpringUtils.getBean(DeviceCtgService.class);
+ DeviceCtg entity = service.selectByFlag(this.toString());
+ if (entity == null) {
+ throw new CoolException("DeviceCtgType Error!");
+ }
+ return entity.getId();
+ }
+
+
+ public static DeviceCtgType get(String el) {
+ for (DeviceCtgType value : DeviceCtgType.values()) {
+ if (el.equals(value.toString())) {
+ return value;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/MotionStsType.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/MotionStsType.java
new file mode 100644
index 0000000..4f2346c
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/MotionStsType.java
@@ -0,0 +1,31 @@
+package com.zy.asrs.wcs.core.model.enums;
+
+
+import com.zy.asrs.framework.common.SpringUtils;
+import com.zy.asrs.framework.exception.CoolException;
+import com.zy.asrs.wcs.rcs.entity.MotionSts;
+import com.zy.asrs.wcs.rcs.service.MotionStsService;
+
+public enum MotionStsType {
+
+ INIT,
+ WAITING,
+ EXECUTING,
+ COMPLETE,
+ CANCEL,
+ ERROR,
+ ;
+
+ MotionStsType() {
+ }
+
+ public long val() {
+ MotionStsService service = SpringUtils.getBean(MotionStsService.class);
+ MotionSts entity = service.selectByFlag(this.toString());
+ if (entity == null) {
+ throw new CoolException("DeviceCtgType Error!");
+ }
+ return entity.getId();
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/DeviceCtgService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/DeviceCtgService.java
new file mode 100644
index 0000000..c56680c
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/DeviceCtgService.java
@@ -0,0 +1,10 @@
+package com.zy.asrs.wcs.core.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+
+public interface DeviceCtgService extends IService<DeviceCtg> {
+
+ DeviceCtg selectByFlag(String flag);
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/DeviceCtgServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/DeviceCtgServiceImpl.java
new file mode 100644
index 0000000..7732610
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/DeviceCtgServiceImpl.java
@@ -0,0 +1,18 @@
+package com.zy.asrs.wcs.core.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.zy.asrs.wcs.core.mapper.DeviceCtgMapper;
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+import com.zy.asrs.wcs.core.service.DeviceCtgService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("deviceCtgService")
+public class DeviceCtgServiceImpl extends ServiceImpl<DeviceCtgMapper, DeviceCtg> implements DeviceCtgService {
+
+ @Override
+ public DeviceCtg selectByFlag(String flag) {
+ return this.getOne(new LambdaQueryWrapper<DeviceCtg>().eq(DeviceCtg::getFlag, flag));
+ }
+
+}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
index 1b895ad..574c505 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/Motion.java
@@ -3,6 +3,8 @@
import java.text.SimpleDateFormat;
import java.util.Date;
+import com.zy.asrs.wcs.core.entity.DeviceCtg;
+import com.zy.asrs.wcs.core.service.DeviceCtgService;
import com.zy.asrs.wcs.rcs.service.DeviceTypeService;
import com.zy.asrs.wcs.rcs.service.MotionCtgService;
import com.zy.asrs.wcs.rcs.service.MotionStsService;
@@ -101,7 +103,7 @@
* 璁惧绫诲瀷
*/
@ApiModelProperty(value= "璁惧绫诲瀷")
- private Long deviceType;
+ private Long deviceCtg;
/**
* 璁惧
@@ -238,7 +240,7 @@
public Motion() {}
- public Motion(String uuid,Integer wrkNo,String serialNo,String title,Integer priority,Integer sync,Long motionCtg,Long motionSts,Long deviceType,String device,String origin,Integer oriDrt,String target,Integer tarDrt,String dockNo,Date ioTime,Date startTime,Date endTime,Date errTime,Long errCode,String errDesc,String temp,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
+ public Motion(String uuid,Integer wrkNo,String serialNo,String title,Integer priority,Integer sync,Long motionCtg,Long motionSts,Long deviceCtg,String device,String origin,Integer oriDrt,String target,Integer tarDrt,String dockNo,Date ioTime,Date startTime,Date endTime,Date errTime,Long errCode,String errDesc,String temp,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer deleted,Long hostId) {
this.uuid = uuid;
this.wrkNo = wrkNo;
this.serialNo = serialNo;
@@ -247,7 +249,7 @@
this.sync = sync;
this.motionCtg = motionCtg;
this.motionSts = motionSts;
- this.deviceType = deviceType;
+ this.deviceCtg = deviceCtg;
this.device = device;
this.origin = origin;
this.oriDrt = oriDrt;
@@ -335,10 +337,10 @@
}
public String getDeviceType$(){
- DeviceTypeService service = SpringUtils.getBean(DeviceTypeService.class);
- DeviceType deviceType = service.getById(this.deviceType);
- if (!Cools.isEmpty(deviceType)){
- return String.valueOf(deviceType.getName());
+ DeviceCtgService service = SpringUtils.getBean(DeviceCtgService.class);
+ DeviceCtg deviceCtg = service.getById(this.deviceCtg);
+ if (!Cools.isEmpty(deviceCtg)){
+ return String.valueOf(deviceCtg.getName());
}
return null;
}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java
index 7c1bfa5..e5d6c65 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/MotionStsService.java
@@ -5,4 +5,6 @@
public interface MotionStsService extends IService<MotionSts> {
+ MotionSts selectByFlag(String flag);
+
}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java
index 1b1dfa6..42826ec 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/service/impl/MotionStsServiceImpl.java
@@ -1,5 +1,6 @@
package com.zy.asrs.wcs.rcs.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.wcs.rcs.mapper.MotionStsMapper;
import com.zy.asrs.wcs.rcs.entity.MotionSts;
import com.zy.asrs.wcs.rcs.service.MotionStsService;
@@ -9,4 +10,8 @@
@Service("motionStsService")
public class MotionStsServiceImpl extends ServiceImpl<MotionStsMapper, MotionSts> implements MotionStsService {
+ @Override
+ public MotionSts selectByFlag(String flag) {
+ return this.getOne(new LambdaQueryWrapper<MotionSts>().eq(MotionSts::getFlag, flag));
+ }
}
diff --git a/zy-asrs-wcs/src/main/java/deviceCtg.sql b/zy-asrs-wcs/src/main/java/deviceCtg.sql
new file mode 100644
index 0000000..bb084bc
--- /dev/null
+++ b/zy-asrs-wcs/src/main/java/deviceCtg.sql
@@ -0,0 +1,9 @@
+-- save deviceCtg record
+-- mysql
+insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( 'Motion璁惧绫诲瀷绠$悊', '0', '/core/deviceCtg', '/core/deviceCtg', '0' , '0', '1' , '1');
+
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鏌ヨMotion璁惧绫诲瀷', '', '1', 'core:deviceCtg:list', '0', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '娣诲姞Motion璁惧绫诲瀷', '', '1', 'core:deviceCtg:save', '1', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '淇敼Motion璁惧绫诲瀷', '', '1', 'core:deviceCtg:update', '2', '1', '1');
+insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '鍒犻櫎Motion璁惧绫诲瀷', '', '1', 'core:deviceCtg:remove', '3', '1', '1');
+
diff --git a/zy-asrs-wcs/src/main/resources/mapper/core/DeviceCtgMapper.xml b/zy-asrs-wcs/src/main/resources/mapper/core/DeviceCtgMapper.xml
new file mode 100644
index 0000000..7c0536f
--- /dev/null
+++ b/zy-asrs-wcs/src/main/resources/mapper/core/DeviceCtgMapper.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.wcs.core.mapper.DeviceCtgMapper">
+
+</mapper>
--
Gitblit v1.9.1