From 9011a1e1ce8ce80e0fd547d78d0f0f1b8f227071 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 13 九月 2024 14:22:53 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/page/codeGap/CodeGapEdit.jsx                                              |  113 +++++++++
 zy-acs-flow/src/i18n/en.js                                                                |    6 
 zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java                   |    4 
 zy-acs-flow/src/page/ResourceContent.js                                                   |    3 
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/CodeGapController.java |  111 +++++++++
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Code.java                  |    2 
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/CodeGap.java               |   56 +++-
 zy-acs-flow/src/page/codeGap/CodeGapPanel.jsx                                             |   69 +++++
 zy-acs-flow/src/i18n/zh.js                                                                |    6 
 zy-acs-flow/src/page/codeGap/index.jsx                                                    |   18 +
 zy-acs-flow/src/page/codeGap/CodeGapCreate.jsx                                            |  141 +++++++++++
 zy-acs-flow/src/page/codeGap/CodeGapList.jsx                                              |  162 +++++++++++++
 12 files changed, 670 insertions(+), 21 deletions(-)

diff --git a/zy-acs-flow/src/i18n/en.js b/zy-acs-flow/src/i18n/en.js
index c5d22db..b240d65 100644
--- a/zy-acs-flow/src/i18n/en.js
+++ b/zy-acs-flow/src/i18n/en.js
@@ -96,6 +96,7 @@
         staType: 'Station Type',
         code: 'Code',
         sta: 'Station',
+        codeGap: 'Code Gap',
     },
     table: {
         field: {
@@ -232,6 +233,11 @@
                 zpallet: "zpallet",
                 staSts: "station status",
             },
+            codeGap: {
+                code0: "code 1",
+                code1: "code 2",
+                distance: "distance",
+            },
         }
     }
 };
diff --git a/zy-acs-flow/src/i18n/zh.js b/zy-acs-flow/src/i18n/zh.js
index f295bc9..4226c83 100644
--- a/zy-acs-flow/src/i18n/zh.js
+++ b/zy-acs-flow/src/i18n/zh.js
@@ -96,6 +96,7 @@
         staType: '绔欑偣绫诲瀷',
         code: '鏉$爜绠$悊',
         sta: '绔欑偣绠$悊',
+        codeGap: '鏉$爜闂磋窛',
     },
     table: {
         field: {
@@ -231,6 +232,11 @@
                 zpallet: "鏂欑鐮�",
                 staSts: "绔欑偣鐘舵��",
             },
+            codeGap: {
+                code0: "code 1",
+                code1: "code 2",
+                distance: "闂磋窛",
+            },
         }
     }
 };
diff --git a/zy-acs-flow/src/page/ResourceContent.js b/zy-acs-flow/src/page/ResourceContent.js
index b4c9dff..274b6be 100644
--- a/zy-acs-flow/src/page/ResourceContent.js
+++ b/zy-acs-flow/src/page/ResourceContent.js
@@ -18,6 +18,7 @@
 import staType from './staType';
 import code from './code';
 import sta from './sta';
+import codeGap from './codeGap';
 
 
 const ResourceContent = (node) => {
@@ -50,6 +51,8 @@
             return code;
         case 'sta':
             return sta;
+        case 'codeGap':
+            return codeGap;
         default:
             return {
                 list: ListGuesser,
diff --git a/zy-acs-flow/src/page/codeGap/CodeGapCreate.jsx b/zy-acs-flow/src/page/codeGap/CodeGapCreate.jsx
new file mode 100644
index 0000000..da6b3c0
--- /dev/null
+++ b/zy-acs-flow/src/page/codeGap/CodeGapCreate.jsx
@@ -0,0 +1,141 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+    CreateBase,
+    useTranslate,
+    TextInput,
+    NumberInput,
+    BooleanInput,
+    DateInput,
+    SaveButton,
+    SelectInput,
+    ReferenceInput,
+    ReferenceArrayInput,
+    AutocompleteInput,
+    Toolbar,
+    required,
+    useDataProvider,
+    useNotify,
+    Form,
+    useCreateController,
+} from 'react-admin';
+import {
+    Dialog,
+    DialogActions,
+    DialogContent,
+    DialogTitle,
+    Stack,
+    Grid,
+    Box,
+} from '@mui/material';
+import DialogCloseButton from "../components/DialogCloseButton";
+import StatusSelectInput from "../components/StatusSelectInput";
+import MemoInput from "../components/MemoInput";
+
+const CodeGapCreate = (props) => {
+    const { open, setOpen } = props;
+
+    const translate = useTranslate();
+    const notify = useNotify();
+
+    const handleClose = (event, reason) => {
+        if (reason !== "backdropClick") {
+            setOpen(false);
+        }
+    };
+
+    const handleSuccess = async (data) => {
+        setOpen(false);
+        notify('common.response.success');
+    };
+
+    const handleError = async (data) => {
+        notify('common.response.fail');
+    };
+
+    return (
+        <>
+            <CreateBase
+                record={{}}
+                transform={(data) => {
+                    return data;
+                }}
+                mutationOptions={{ onSuccess: handleSuccess, onError: handleError }}
+            >
+                <Dialog
+                    open={open}
+                    onClose={handleClose}
+                    aria-labelledby="form-dialog-title"
+                    fullWidth
+                    disableRestoreFocus
+                    maxWidth="md"   // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
+                >
+                    <Form>
+                        <DialogTitle id="form-dialog-title" sx={{
+                            position: 'sticky',
+                            top: 0,
+                            backgroundColor: 'background.paper',
+                            zIndex: 1000
+                        }}
+                        >
+                            {translate('create.title')}
+                            <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}>
+                                <DialogCloseButton onClose={handleClose} />
+                            </Box>
+                        </DialogTitle>
+                        <DialogContent>
+                            <Grid container rowSpacing={2} columnSpacing={2}>
+                                <Grid item xs={6} display="flex" gap={1}>
+                                    <ReferenceInput
+                                        source="code0"
+                                        reference="code"
+                                        autoFocus
+                                    >
+                                        <AutocompleteInput
+                                            label="table.field.codeGap.code0"
+                                            optionText="data"
+                                            validate={required()}
+                                        />
+                                    </ReferenceInput>
+                                </Grid>
+                                <Grid item xs={6} display="flex" gap={1}>
+                                    <ReferenceInput
+                                        source="code1"
+                                        reference="code"
+                                    >
+                                        <AutocompleteInput
+                                            label="table.field.codeGap.code1"
+                                            optionText="data"
+                                            validate={required()}
+                                        />
+                                    </ReferenceInput>
+                                </Grid>
+                                <Grid item xs={6} display="flex" gap={1}>
+                                    <NumberInput
+                                        label="table.field.codeGap.distance"
+                                        source="distance"
+                                    />
+                                </Grid>
+
+                                <Grid item xs={6} display="flex" gap={1}>
+                                    <StatusSelectInput />
+                                </Grid>
+                                <Grid item xs={12} display="flex" gap={1}>
+                                    <Stack direction="column" spacing={1} width={'100%'}>
+                                        <MemoInput />
+                                    </Stack>
+                                </Grid>
+                            </Grid>
+                        </DialogContent>
+                        <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
+                            <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }}  >
+                                <SaveButton />
+                            </Toolbar>
+                        </DialogActions>
+                    </Form>
+                </Dialog>
+            </CreateBase>
+        </>
+    )
+}
+
+export default CodeGapCreate;
diff --git a/zy-acs-flow/src/page/codeGap/CodeGapEdit.jsx b/zy-acs-flow/src/page/codeGap/CodeGapEdit.jsx
new file mode 100644
index 0000000..02477f4
--- /dev/null
+++ b/zy-acs-flow/src/page/codeGap/CodeGapEdit.jsx
@@ -0,0 +1,113 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+    Edit,
+    SimpleForm,
+    FormDataConsumer,
+    useTranslate,
+    TextInput,
+    NumberInput,
+    BooleanInput,
+    DateInput,
+    SelectInput,
+    ReferenceInput,
+    ReferenceArrayInput,
+    AutocompleteInput,
+    SaveButton,
+    Toolbar,
+    Labeled,
+    NumberField,
+    required,
+    useRecordContext,
+    DeleteButton,
+} from 'react-admin';
+import { useWatch, useFormContext } from "react-hook-form";
+import { Stack, Grid, Box, Typography } from '@mui/material';
+import * as Common from '@/utils/common';
+import { EDIT_MODE } from '@/config/setting';
+import EditBaseAside from "../components/EditBaseAside";
+import CustomerTopToolBar from "../components/EditTopToolBar";
+import MemoInput from "../components/MemoInput";
+import StatusSelectInput from "../components/StatusSelectInput";
+
+const FormToolbar = () => {
+    const { getValues } = useFormContext();
+
+    return (
+        <Toolbar sx={{ justifyContent: 'space-between' }}>
+            <SaveButton />
+            <DeleteButton mutationMode="optimistic" />
+        </Toolbar>
+    )
+}
+
+const CodeGapEdit = () => {
+    const translate = useTranslate();
+
+    return (
+        <Edit
+            redirect="list"
+            mutationMode={EDIT_MODE}
+            actions={<CustomerTopToolBar />}
+            aside={<EditBaseAside />}
+        >
+            <SimpleForm
+                shouldUnregister
+                warnWhenUnsavedChanges
+                toolbar={<FormToolbar />}
+                mode="onTouched"
+                defaultValues={{}}
+            // validate={(values) => { }}
+            >
+                <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}>
+                    <Grid item xs={12} md={8}>
+                        <Typography variant="h6" gutterBottom>
+                            {translate('common.edit.title.main')}
+                        </Typography>
+                        <Stack direction='row' gap={2}>
+                            <ReferenceInput
+                                source="code0"
+                                reference="code"
+                                autoFocus
+                            >
+                                <AutocompleteInput
+                                    label="table.field.codeGap.code0"
+                                    optionText="data"
+                                    validate={required()}
+                                />
+                            </ReferenceInput>
+                        </Stack>
+                        <Stack direction='row' gap={2}>
+                            <ReferenceInput
+                                source="code1"
+                                reference="code"
+                            >
+                                <AutocompleteInput
+                                    label="table.field.codeGap.code1"
+                                    optionText="data"
+                                    validate={required()}
+                                />
+                            </ReferenceInput>
+                        </Stack>
+                        <Stack direction='row' gap={2}>
+                            <NumberInput
+                                label="table.field.codeGap.distance"
+                                source="distance"
+                            />
+                        </Stack>
+
+                    </Grid>
+                    <Grid item xs={12} md={4}>
+                        <Typography variant="h6" gutterBottom>
+                            {translate('common.edit.title.common')}
+                        </Typography>
+                        <StatusSelectInput />
+                        <Box mt="2em" />
+                        <MemoInput />
+                    </Grid>
+                </Grid>
+            </SimpleForm>
+        </Edit >
+    )
+}
+
+export default CodeGapEdit;
diff --git a/zy-acs-flow/src/page/codeGap/CodeGapList.jsx b/zy-acs-flow/src/page/codeGap/CodeGapList.jsx
new file mode 100644
index 0000000..6b723a2
--- /dev/null
+++ b/zy-acs-flow/src/page/codeGap/CodeGapList.jsx
@@ -0,0 +1,162 @@
+import React, { useState, useRef, useEffect, useMemo, useCallback } from "react";
+import { useNavigate } from 'react-router-dom';
+import {
+    List,
+    DatagridConfigurable,
+    SearchInput,
+    TopToolbar,
+    SelectColumnsButton,
+    EditButton,
+    FilterButton,
+    CreateButton,
+    ExportButton,
+    BulkDeleteButton,
+    WrapperField,
+    useRecordContext,
+    useTranslate,
+    useListContext,
+    useCreatePath,
+    TextField,
+    NumberField,
+    DateField,
+    BooleanField,
+    ReferenceField,
+    TextInput,
+    DateTimeInput,
+    DateInput,
+    SelectInput,
+    NumberInput,
+    ReferenceInput,
+    ReferenceArrayInput,
+    AutocompleteInput,
+    DeleteButton,
+} from 'react-admin';
+import { Box, Typography, Card, Stack } from '@mui/material';
+import { styled } from '@mui/material/styles';
+import CodeGapCreate from "./CodeGapCreate";
+import CodeGapPanel from "./CodeGapPanel";
+import EmptyData from "../components/EmptyData";
+import MyCreateButton from "../components/MyCreateButton";
+import MyExportButton from '../components/MyExportButton';
+import PageDrawer from "../components/PageDrawer";
+import MyField from "../components/MyField";
+import { PAGE_DRAWER_WIDTH, OPERATE_MODE } from '@/config/setting';
+import * as Common from '@/utils/common';
+
+const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
+    '& .css-1vooibu-MuiSvgIcon-root': {
+        height: '.9em'
+    },
+    '& .RaDatagrid-row': {
+        cursor: 'auto'
+    },
+    '& .column-name': {
+    },
+    '& .opt': {
+        width: 200
+    },
+}));
+
+const filters = [
+    <SearchInput source="condition" alwaysOn />,
+    <DateInput label='common.time.after' source="timeStart" alwaysOn />,
+    <DateInput label='common.time.before' source="timeEnd" alwaysOn />,
+
+    <ReferenceInput source="code0" label="table.field.codeGap.code0" reference="code" alwaysOn>
+        <AutocompleteInput label="table.field.codeGap.code0" optionText="data" />
+    </ReferenceInput>,
+    <ReferenceInput source="code1" label="table.field.codeGap.code1" reference="code" alwaysOn>
+        <AutocompleteInput label="table.field.codeGap.code1" optionText="data" />
+    </ReferenceInput>,
+    <NumberInput source="distance" label="table.field.codeGap.distance" />,
+
+    <TextInput label="common.field.memo" source="memo" />,
+    <SelectInput
+        label="common.field.status"
+        source="status"
+        choices={[
+            { id: '1', name: 'common.enums.statusTrue' },
+            { id: '0', name: 'common.enums.statusFalse' },
+        ]}
+    />,
+]
+
+const CodeGapList = () => {
+    const translate = useTranslate();
+
+    const [createDialog, setCreateDialog] = useState(false);
+    const [drawerVal, setDrawerVal] = useState(false);
+
+    return (
+        <Box display="flex">
+            <List
+                sx={{
+                    flexGrow: 1,
+                    transition: (theme) =>
+                        theme.transitions.create(['all'], {
+                            duration: theme.transitions.duration.enteringScreen,
+                        }),
+                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
+                }}
+                title={"menu.codeGap"}
+                empty={<EmptyData onClick={() => { setCreateDialog(true) }} />}
+                filters={filters}
+                sort={{ field: "create_time", order: "desc" }}
+                actions={(
+                    <TopToolbar>
+                        <FilterButton />
+                        <MyCreateButton onClick={() => { setCreateDialog(true) }} />
+                        <SelectColumnsButton preferenceKey='codeGap' />
+                        <MyExportButton />
+                    </TopToolbar>
+                )}
+                perPage={25}
+            >
+                <StyledDatagrid
+                    preferenceKey='codeGap'
+                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
+                    rowClick={(id, resource, record) => false}
+                    expand={() => <CodeGapPanel />}
+                    expandSingle={true}
+                    omit={['id', 'createTime', 'createBy', 'memo']}
+                >
+                    <NumberField source="id" />
+                    <ReferenceField source="code0" label="table.field.codeGap.code0" reference="code" link={false} sortable={false}>
+                        <TextField source="data" />
+                    </ReferenceField>
+                    <ReferenceField source="code1" label="table.field.codeGap.code1" reference="code" link={false} sortable={false}>
+                        <TextField source="data" />
+                    </ReferenceField>
+                    <NumberField source="distance" label="table.field.codeGap.distance" />
+
+                    <DateField source="updateTime" label="common.field.updateTime" showTime />
+                    <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
+                        <TextField source="nickname" />
+                    </ReferenceField>
+                    <DateField source="createTime" label="common.field.createTime" showTime />
+                    <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}>
+                        <TextField source="nickname" />
+                    </ReferenceField>
+                    <BooleanField source="statusBool" label="common.field.status" sortable={false} />
+                    <TextField source="memo" label="common.field.memo" sortable={false} />
+                    <WrapperField cellClassName="opt" label="common.field.opt">
+                        <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
+                        <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
+                    </WrapperField>
+                </StyledDatagrid>
+            </List>
+            <CodeGapCreate
+                open={createDialog}
+                setOpen={setCreateDialog}
+            />
+            <PageDrawer
+                title='CodeGap Detail'
+                drawerVal={drawerVal}
+                setDrawerVal={setDrawerVal}
+            >
+            </PageDrawer>
+        </Box>
+    )
+}
+
+export default CodeGapList;
diff --git a/zy-acs-flow/src/page/codeGap/CodeGapPanel.jsx b/zy-acs-flow/src/page/codeGap/CodeGapPanel.jsx
new file mode 100644
index 0000000..4722ff0
--- /dev/null
+++ b/zy-acs-flow/src/page/codeGap/CodeGapPanel.jsx
@@ -0,0 +1,69 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
+import {
+    useTranslate,
+    useRecordContext,
+} from 'react-admin';
+import PanelTypography from "../components/PanelTypography";
+import * as Common from '@/utils/common'
+
+const CodeGapPanel = () => {
+    const record = useRecordContext();
+    if (!record) return null;
+    const translate = useTranslate();
+    return (
+        <>
+            <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
+                <CardContent>
+                    <Grid container spacing={2}>
+                        <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}>
+                            <Typography variant="h6" gutterBottom align="left" sx={{
+                                maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' },
+                                whiteSpace: 'nowrap',
+                                overflow: 'hidden',
+                                textOverflow: 'ellipsis',
+                            }}>
+                                {Common.camelToPascalWithSpaces(translate('table.field.codeGap.id'))}: {record.id}
+                            </Typography>
+                            {/*  inherit, primary, secondary, textPrimary, textSecondary, error */}
+                            <Typography variant="h6" gutterBottom align="right" >
+                                ID: {record.id}
+                            </Typography>
+                        </Grid>
+                    </Grid>
+                    <Grid container spacing={2}>
+                        <Grid item xs={12} container alignContent="flex-end">
+                            <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}>
+                                {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo}
+                            </Typography>
+                        </Grid>
+                    </Grid>
+                    <Box height={20}>&nbsp;</Box>
+                    <Grid container spacing={2}>
+                        <Grid item xs={6}>
+                            <PanelTypography
+                                title="table.field.codeGap.code0" 
+                                property={record.code0$}
+                            />
+                        </Grid>
+                        <Grid item xs={6}>
+                            <PanelTypography
+                                title="table.field.codeGap.code1" 
+                                property={record.code1$}
+                            />
+                        </Grid>
+                        <Grid item xs={6}>
+                            <PanelTypography
+                                title="table.field.codeGap.distance" 
+                                property={record.distance}
+                            />
+                        </Grid>
+
+                    </Grid>
+                </CardContent>
+            </Card >
+        </>
+    );
+};
+
+export default CodeGapPanel;
diff --git a/zy-acs-flow/src/page/codeGap/index.jsx b/zy-acs-flow/src/page/codeGap/index.jsx
new file mode 100644
index 0000000..81e7001
--- /dev/null
+++ b/zy-acs-flow/src/page/codeGap/index.jsx
@@ -0,0 +1,18 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import {
+    ListGuesser,
+    EditGuesser,
+    ShowGuesser,
+} from "react-admin";
+
+import CodeGapList from "./CodeGapList";
+import CodeGapEdit from "./CodeGapEdit";
+
+export default {
+    list: CodeGapList,
+    edit: CodeGapEdit,
+    show: ShowGuesser,
+    recordRepresentation: (record) => {
+        return `${record.id}`
+    }
+};
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java
index 3ddbb2e..4a69a18 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/common/CodeBuilder.java
@@ -22,8 +22,8 @@
 //        generator.username="sa";
 //        generator.password="Zoneyung@zy56$";
 
-        generator.table="man_sta";
-        generator.tableDesc="Sta";
+        generator.table="man_code_gap";
+        generator.tableDesc="CodeGap";
         generator.packagePath="com.zy.acs.manager.manager";
 
         generator.build();
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/CodeGapController.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/CodeGapController.java
new file mode 100644
index 0000000..867c421
--- /dev/null
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/CodeGapController.java
@@ -0,0 +1,111 @@
+package com.zy.acs.manager.manager.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zy.acs.framework.common.Cools;
+import com.zy.acs.framework.common.R;
+import com.zy.acs.manager.common.utils.ExcelUtil;
+import com.zy.acs.manager.common.annotation.OperationLog;
+import com.zy.acs.manager.common.domain.BaseParam;
+import com.zy.acs.manager.common.domain.KeyValVo;
+import com.zy.acs.manager.common.domain.PageParam;
+import com.zy.acs.manager.manager.entity.CodeGap;
+import com.zy.acs.manager.manager.service.CodeGapService;
+import com.zy.acs.manager.system.controller.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
+
+@RestController
+@RequestMapping("/api")
+public class CodeGapController extends BaseController {
+
+    @Autowired
+    private CodeGapService codeGapService;
+
+    @PreAuthorize("hasAuthority('manager:codeGap:list')")
+    @PostMapping("/codeGap/page")
+    public R page(@RequestBody Map<String, Object> map) {
+        BaseParam baseParam = buildParam(map, BaseParam.class);
+        PageParam<CodeGap, BaseParam> pageParam = new PageParam<>(baseParam, CodeGap.class);
+        return R.ok().add(codeGapService.page(pageParam, pageParam.buildWrapper(true)));
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:list')")
+    @PostMapping("/codeGap/list")
+    public R list(@RequestBody Map<String, Object> map) {
+        return R.ok().add(codeGapService.list());
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:list')")
+    @PostMapping({"/codeGap/many/{ids}", "/codeGaps/many/{ids}"})
+    public R many(@PathVariable Long[] ids) {
+        return R.ok().add(codeGapService.listByIds(Arrays.asList(ids)));
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:list')")
+    @GetMapping("/codeGap/{id}")
+    public R get(@PathVariable("id") Long id) {
+        return R.ok().add(codeGapService.getById(id));
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:save')")
+    @OperationLog("Create CodeGap")
+    @PostMapping("/codeGap/save")
+    public R save(@RequestBody CodeGap codeGap) {
+        codeGap.setCreateBy(getLoginUserId());
+        codeGap.setCreateTime(new Date());
+        codeGap.setUpdateBy(getLoginUserId());
+        codeGap.setUpdateTime(new Date());
+        if (!codeGapService.save(codeGap)) {
+            return R.error("Save Fail");
+        }
+        return R.ok("Save Success").add(codeGap);
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:update')")
+    @OperationLog("Update CodeGap")
+    @PostMapping("/codeGap/update")
+    public R update(@RequestBody CodeGap codeGap) {
+        codeGap.setUpdateBy(getLoginUserId());
+        codeGap.setUpdateTime(new Date());
+        if (!codeGapService.updateById(codeGap)) {
+            return R.error("Update Fail");
+        }
+        return R.ok("Update Success").add(codeGap);
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:remove')")
+    @OperationLog("Delete CodeGap")
+    @PostMapping("/codeGap/remove/{ids}")
+    public R remove(@PathVariable Long[] ids) {
+        if (!codeGapService.removeByIds(Arrays.asList(ids))) {
+            return R.error("Delete Fail");
+        }
+        return R.ok("Delete Success").add(ids);
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:list')")
+    @PostMapping("/codeGap/query")
+    public R query(@RequestParam(required = false) String condition) {
+        List<KeyValVo> vos = new ArrayList<>();
+        LambdaQueryWrapper<CodeGap> wrapper = new LambdaQueryWrapper<>();
+        if (!Cools.isEmpty(condition)) {
+            wrapper.like(CodeGap::getId, condition);
+        }
+        codeGapService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+                item -> vos.add(new KeyValVo(item.getId(), item.getId()))
+        );
+        return R.ok().add(vos);
+    }
+
+    @PreAuthorize("hasAuthority('manager:codeGap:list')")
+    @PostMapping("/codeGap/export")
+    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+        ExcelUtil.build(ExcelUtil.create(codeGapService.list(), CodeGap.class), response);
+    }
+
+}
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Code.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Code.java
index e3b8bd4..ba22b44 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Code.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/Code.java
@@ -176,6 +176,4 @@
         }
     }
 
-
-
 }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/CodeGap.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/CodeGap.java
index f5b9c01..5ff2113 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/CodeGap.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/CodeGap.java
@@ -9,6 +9,7 @@
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.Date;
 
 @Data
 @TableName("man_code_gap")
@@ -42,7 +43,13 @@
     private Double distance;
 
     /**
-     * 鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  
+     * 鐘舵�� 1: 姝e父  0: 鍐荤粨
+     */
+    @ApiModelProperty(value= "鐘舵�� 1: 姝e父  0: 鍐荤粨  ")
+    private Integer status;
+
+    /**
+     * 鏄惁鍒犻櫎 1: 鏄�  0: 鍚�
      */
     @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  ")
     private Integer deleted;
@@ -53,25 +60,29 @@
     @ApiModelProperty(value= "绉熸埛")
     private Long tenantId;
 
-    public CodeGap() {}
+    /**
+     * 娣诲姞浜哄憳
+     */
+    @ApiModelProperty(value= "娣诲姞浜哄憳")
+    private Long createBy;
 
-    public CodeGap(Long code0,Long code1,Double distance,Integer deleted,Long tenantId) {
-        this.code0 = code0;
-        this.code1 = code1;
-        this.distance = distance;
-        this.deleted = deleted;
-        this.tenantId = tenantId;
-    }
+    /**
+     * 娣诲姞鏃堕棿
+     */
+    @ApiModelProperty(value= "娣诲姞鏃堕棿")
+    private Date createTime;
 
-//    CodeGap codeGap = new CodeGap(
-//            null,    // 鏉$爜[闈炵┖]
-//            null,    // 鏉$爜[闈炵┖]
-//            null,    // 璺濈
-//            null,    // 鏄惁鍒犻櫎[闈炵┖]
-//            null    // 绉熸埛
-//    );
+    /**
+     * 淇敼浜哄憳
+     */
+    @ApiModelProperty(value= "淇敼浜哄憳")
+    private Long updateBy;
 
-
+    /**
+     * 淇敼鏃堕棿
+     */
+    @ApiModelProperty(value= "淇敼鏃堕棿")
+    private Date updateTime;
 
     public String getCode0$() {
         CodeService service = SpringUtils.getBean(CodeService.class);
@@ -91,6 +102,17 @@
         return null;
     }
 
+    public Boolean getStatusBool(){
+        if (null == this.status){ return null; }
+        switch (this.status){
+            case 1:
+                return true;
+            case 0:
+                return false;
+            default:
+                return null;
+        }
+    }
 
 
 }

--
Gitblit v1.9.1