Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
| | |
| | | deviceBind: 'Device Bind', |
| | | tasks: 'Tasks', |
| | | wave: 'Wave Manage', |
| | | |
| | | basStation: 'BasStation', |
| | | basContainer: 'BasContainer', |
| | | }, |
| | | table: { |
| | | field: { |
| | | basContainer: { |
| | | containerType:'containerType', |
| | | codeType: 'codeType', |
| | | areas: 'areas', |
| | | }, |
| | | basStation: { |
| | | stationName: 'stationName', |
| | | inAble: 'inAble', |
| | | outAble: 'outAble', |
| | | useStatus: 'useStatus', |
| | | status: 'status', |
| | | area: 'area', |
| | | isCrossZone: 'isCrossZone', |
| | | crossZoneArea: 'crossZoneArea', |
| | | isWcs: 'isWcs', |
| | | wcsData: 'wcsData', |
| | | containerType: 'containerType', |
| | | barcode: 'barcode', |
| | | autoTransfer: 'autoTransfer', |
| | | }, |
| | | host: { |
| | | |
| | | }, |
| | |
| | | import basContainer from "../page/basicInfo/basContainer"; |
| | | import chineseMessages from "./core/chineseMessages"; |
| | | |
| | | const customChineseMessages = { |
| | |
| | | deviceBind: '设备绑定', |
| | | tasks: '任务管理', |
| | | wave: '波次管理', |
| | | basStation: '站点信息' |
| | | basStation: '站点信息', |
| | | basContainer: '容器管理', |
| | | }, |
| | | table: { |
| | | field: { |
| | | basContainer: { |
| | | containerType:'容器类型', |
| | | codeType: '条码类型', |
| | | areas: '可入库区', |
| | | }, |
| | | basStation: { |
| | | stationName: '站点名称', |
| | | inAble: '能入', |
| | |
| | | import locItem from './locItem' |
| | | import basStation from './basicInfo/basStation'; |
| | | import warehouseStock from './statistics/stockManage'; |
| | | import basContainer from './basicInfo/basContainer'; |
| | | |
| | | const ResourceContent = (node) => { |
| | | switch (node.component) { |
| | |
| | | return locItem; |
| | | case 'basStation': |
| | | return basStation; |
| | | case 'basContainer': |
| | | return basContainer; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
New file |
| | |
| | | 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, |
| | | SelectArrayInput, |
| | | } 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"; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | |
| | | const BasContainerCreate = (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 (error) => { |
| | | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); |
| | | }; |
| | | |
| | | 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 sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DictionarySelect |
| | | label={translate("table.field.basStation.containerType")} |
| | | name="containerType" |
| | | size="small" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_container_type" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.basContainer.codeType" |
| | | source="codeType" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceArrayInput source="areaIds" reference="warehouseAreas"> |
| | | <SelectArrayInput |
| | | label="table.field.basStation.crossZoneArea" |
| | | optionText="name" |
| | | optionValue="id" |
| | | fullWidth |
| | | validate={[required()]} |
| | | /> |
| | | </ReferenceArrayInput> |
| | | </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 BasContainerCreate; |
New file |
| | |
| | | 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, |
| | | SelectArrayInput, |
| | | } 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, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const BasContainerEdit = () => { |
| | | 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}> |
| | | <DictionarySelect |
| | | label={translate("table.field.basStation.containerType")} |
| | | name="containerType" |
| | | size="small" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_container_type" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.basContainer.codeType" |
| | | source="codeType" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <ReferenceArrayInput source="areaIds" reference="warehouseAreas"> |
| | | <SelectArrayInput |
| | | label="table.field.basContainer.areas" |
| | | optionText="name" |
| | | optionValue="id" |
| | | fullWidth |
| | | validate={[required()]} |
| | | /> |
| | | </ReferenceArrayInput> |
| | | </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 BasContainerEdit; |
New file |
| | |
| | | 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, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | 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 BasContainerCreate from "./BasContainerCreate"; |
| | | import BasContainerPanel from "./BasContainerPanel"; |
| | | 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, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import CrossZoneAreaField from "../basStation/CrossZoneAreaField"; |
| | | |
| | | 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 />, |
| | | |
| | | <NumberInput source="containerType" label="table.field.basContainer.containerType" />, |
| | | <TextInput source="codeType" label="table.field.basContainer.codeType" />, |
| | | <TextInput source="areas" label="table.field.basContainer.areas" />, |
| | | |
| | | <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' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const BasContainerList = () => { |
| | | const translate = useTranslate(); |
| | | const [areaFieldDialog, setAreaFieldDialog] = useState(false); |
| | | 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.basContainer"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='basContainer' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='basContainer' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="containerType$" label="table.field.basContainer.containerType" /> |
| | | <TextField source="codeType" label="table.field.basContainer.codeType" /> |
| | | <WrapperField cellClassName="areas" label="table.field.basContainer.areas"> |
| | | <CrossZoneAreaField |
| | | open={areaFieldDialog} |
| | | setOpen={setAreaFieldDialog} |
| | | /> |
| | | </WrapperField> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <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> |
| | | <BasContainerCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='BasContainer Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default BasContainerList; |
New file |
| | |
| | | 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 BasContainerPanel = () => { |
| | | 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.basContainer.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}> </Box> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.basContainer.containerType" |
| | | property={record.containerType} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.basContainer.codeType" |
| | | property={record.codeType} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.basContainer.areas" |
| | | property={record.areas} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default BasContainerPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import BasContainerList from "./BasContainerList"; |
| | | import BasContainerEdit from "./BasContainerEdit"; |
| | | |
| | | export default { |
| | | list: BasContainerList, |
| | | edit: BasContainerEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
| | | } |
| | | }; |
| | |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | import DictionaryArraySelect from "../../components/DictionaryArraySelect"; |
| | | |
| | | const BasStationCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <DictionarySelect |
| | | <DictionaryArraySelect |
| | | label={translate("table.field.basStation.containerType")} |
| | | name="containerType" |
| | | name="containerTypes" |
| | | size="small" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_container_type" |
| | |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | import DictionaryArraySelect from "../../components/DictionaryArraySelect"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DictionarySelect |
| | | <DictionaryArraySelect |
| | | label={translate("table.field.basStation.containerType")} |
| | | name="containerType" |
| | | name="containerTypes" |
| | | size="small" |
| | | validate={[required()]} |
| | | dictTypeCode="sys_container_type" |
| | |
| | | import * as Common from '@/utils/common'; |
| | | import WarehouseAreaField from "./WarehouseAreaField"; |
| | | import CrossZoneAreaField from "./CrossZoneAreaField"; |
| | | import ContainerTypesField from "./ContainerTypesField"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [areaFieldDialog, setAreaFieldDialog] = useState(false); |
| | | const [areaFieldDialog2, setAreaFieldDialog2] = useState(false); |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | |
| | | render={record => record.inAble === 1 ? '是' : '否'} |
| | | /> |
| | | <NumberField source="containerType$" label="table.field.basStation.containerType" /> |
| | | <WrapperField cellClassName="containerType" label="table.field.basStation.containerType"> |
| | | <ContainerTypesField |
| | | open={areaFieldDialog2} |
| | | setOpen={setAreaFieldDialog2} |
| | | /> |
| | | </WrapperField> |
| | | <TextField source="barcode" label="table.field.basStation.barcode" /> |
| | | <FunctionField |
| | | source="autoTransfer" |
New file |
| | |
| | | import * as React from 'react'; |
| | | import { Stack, Chip, Dialog, DialogTitle, DialogContent, IconButton, CircularProgress } from '@mui/material'; |
| | | import { useTranslate, useRecordContext } from 'react-admin'; |
| | | import CloseIcon from '@mui/icons-material/Close'; |
| | | import request from '@/utils/request'; |
| | | |
| | | const ContainerTypesField = () => { |
| | | const translate = useTranslate(); |
| | | const record = useRecordContext(); |
| | | const [open, setOpen] = React.useState(false); |
| | | const [areaNames, setAreaNames] = React.useState([]); |
| | | const [loading, setLoading] = React.useState(false); |
| | | |
| | | const handleOpen = () => { |
| | | setOpen(true); |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | | setOpen(false); |
| | | }; |
| | | |
| | | const fetchAreaNames = async () => { |
| | | if (!record?.containerTypes || record.containerTypes.length === 0) return; |
| | | |
| | | setLoading(true); |
| | | try { |
| | | const res = await request.post(`/dictData/many/${record.containerTypes$.join(',')}`); |
| | | if (res?.data?.code === 200) { |
| | | setAreaNames(res.data.data || []); |
| | | } |
| | | } catch (error) { |
| | | console.error('获取区域名称失败:', error); |
| | | } finally { |
| | | setLoading(false); |
| | | } |
| | | }; |
| | | |
| | | React.useEffect(() => { |
| | | if (record?.containerTypes && record.containerTypes.length > 0) { |
| | | fetchAreaNames(); |
| | | } |
| | | }, [record]); |
| | | |
| | | if (loading) { |
| | | return <CircularProgress size={20} />; |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <Stack |
| | | direction="row" |
| | | gap={1} |
| | | flexWrap="wrap" |
| | | onClick={handleOpen} |
| | | sx={{ cursor: 'pointer' }} |
| | | > |
| | | {areaNames.slice(0, 1).map((item, idx) => ( |
| | | <Chip |
| | | size="small" |
| | | key={item.id} |
| | | label={item.label || item.id} |
| | | /> |
| | | ))} |
| | | {areaNames.length > 1 && ( |
| | | <Chip |
| | | size="small" |
| | | label={`+${areaNames.length - 1}`} |
| | | /> |
| | | )} |
| | | {areaNames.length === 0 && record.containerTypes && record.containerTypes.length > 0 && ( |
| | | <Chip |
| | | size="small" |
| | | label={`${record.containerTypes.length} 个区域`} |
| | | /> |
| | | )} |
| | | </Stack> |
| | | |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | maxWidth="md" |
| | | fullWidth |
| | | > |
| | | <DialogTitle> |
| | | {translate('table.field.basStation.crossZoneArea')} |
| | | <IconButton |
| | | aria-label="close" |
| | | onClick={handleClose} |
| | | sx={{ |
| | | position: 'absolute', |
| | | right: 8, |
| | | top: 8, |
| | | }} |
| | | > |
| | | <CloseIcon /> |
| | | </IconButton> |
| | | </DialogTitle> |
| | | <DialogContent> |
| | | {loading ? ( |
| | | <CircularProgress /> |
| | | ) : ( |
| | | <Stack direction="row" gap={1} flexWrap="wrap" sx={{ mt: 1 }}> |
| | | {areaNames.map((item) => ( |
| | | <Chip |
| | | size="small" |
| | | key={item.id} |
| | | label={item.label || item.id} |
| | | /> |
| | | ))} |
| | | </Stack> |
| | | )} |
| | | </DialogContent> |
| | | </Dialog> |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default ContainerTypesField; |
New file |
| | |
| | | import EditIcon from '@mui/icons-material/Edit'; |
| | | import { useState, useEffect } from 'react'; |
| | | import { |
| | | Button, useListContext, SelectInput, |
| | | required, SelectArrayInput, |
| | | useTranslate, useNotify, |
| | | SelectArrayInputClasses |
| | | } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | | |
| | | const DictionarySelect = (props) => { |
| | | const { |
| | | dictTypeCode, |
| | | name, |
| | | multiple = false, |
| | | perPage = 100, // 默认每页显示100条数据 |
| | | page = 1, // 默认第一页 |
| | | ...parmas |
| | | } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [list, setList] = useState([]); |
| | | const [loading, setLoading] = useState(false); |
| | | |
| | | useEffect(() => { |
| | | http(); |
| | | }, [dictTypeCode, page, perPage]); |
| | | |
| | | const http = async () => { |
| | | setLoading(true); |
| | | try { |
| | | const res = await request.post('/dictData/page', { |
| | | dictTypeCode, |
| | | current: page, |
| | | pageSize: perPage |
| | | }); |
| | | |
| | | if (res?.data?.code === 200) { |
| | | setList(res.data.data.records.map((item) => { |
| | | return { |
| | | id: item.value, |
| | | name: item.label |
| | | } |
| | | })); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | } catch (error) { |
| | | notify('加载字典数据失败', 'error'); |
| | | console.error('加载字典数据失败:', error); |
| | | } finally { |
| | | setLoading(false); |
| | | } |
| | | }; |
| | | |
| | | const InputComponent = multiple ? SelectArrayInput : SelectInput; |
| | | |
| | | return ( |
| | | <SelectArrayInput |
| | | source={name} |
| | | choices={list} |
| | | isLoading={loading} |
| | | {...parmas} |
| | | /> |
| | | ); |
| | | }; |
| | | |
| | | export default DictionarySelect; |
New file |
| | |
| | | -- save basContainer record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.basContainer', '0', '/manager/basContainer', 'basContainer', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 容器管理', '', '1', 'manager:basContainer:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 容器管理', '', '1', 'manager:basContainer:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 容器管理', '', '1', 'manager:basContainer:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 容器管理', '', '1', 'manager:basContainer:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | basContainer: 'BasContainer', |
| | | |
| | | -- locale field |
| | | basContainer: { |
| | | containerType: "containerType", |
| | | codeType: "codeType", |
| | | areas: "areas", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import basContainer from './basContainer'; |
| | | |
| | | case 'basContainer': |
| | | return basContainer; |
| | |
| | | generator.frontendPrefixPath = "rsf-admin/"; |
| | | |
| | | generator.sqlOsType = SqlOsType.MYSQL; |
| | | generator.url = "192.168.4.56:3306/rsf"; |
| | | generator.url = "192.168.4.50:3306/rsf"; |
| | | generator.username = "root"; |
| | | generator.password = "34821015"; |
| | | // generator.url="47.97.1.152:51433;databasename=jkasrs"; |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table = "man_qly_inspect_result"; |
| | | generator.tableDesc = "质检结果"; |
| | | generator.table = "man_bas_container"; |
| | | generator.tableDesc = "容器管理"; |
| | | generator.packagePath = "com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
New file |
| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.BasContainer; |
| | | import com.vincent.rsf.server.manager.entity.BasStation; |
| | | import com.vincent.rsf.server.manager.service.BasContainerService; |
| | | import com.vincent.rsf.server.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 |
| | | public class BasContainerController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BasContainerService basContainerService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @PostMapping("/basContainer/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<BasContainer, BaseParam> pageParam = new PageParam<>(baseParam, BasContainer.class); |
| | | PageParam<BasContainer, BaseParam> page = basContainerService.page(pageParam, pageParam.buildWrapper(true)); |
| | | for (BasContainer container : page.getRecords()) { |
| | | if (!Cools.isEmpty(container.getAreas())) { |
| | | String content = container.getAreas().substring(1, container.getAreas().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | container.setAreaIds(longArray); |
| | | } |
| | | |
| | | } |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @PostMapping("/basContainer/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(basContainerService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @PostMapping({"/basContainer/many/{ids}", "/basContainers/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(basContainerService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @GetMapping("/basContainer/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | BasContainer basContainer = basContainerService.getById(id); |
| | | String content = basContainer.getAreas().substring(1, basContainer.getAreas().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | basContainer.setAreaIds(longArray); |
| | | return R.ok().add(basContainer); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:save')") |
| | | @OperationLog("Create 容器管理") |
| | | @PostMapping("/basContainer/save") |
| | | public R save(@RequestBody BasContainer basContainer) { |
| | | basContainer.setCreateBy(getLoginUserId()); |
| | | basContainer.setCreateTime(new Date()); |
| | | basContainer.setUpdateBy(getLoginUserId()); |
| | | basContainer.setUpdateTime(new Date()); |
| | | BasContainer container = basContainerService.getOne(new LambdaQueryWrapper<BasContainer>().eq(BasContainer::getContainerType, basContainer.getContainerType())); |
| | | if (null != container) { |
| | | return R.error("该类型已被初始化"); |
| | | } |
| | | if (null !=basContainer.getAreaIds()){ |
| | | basContainer.setAreas(Arrays.toString(basContainer.getAreaIds())); |
| | | } |
| | | if (!basContainerService.save(basContainer)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(basContainer); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:update')") |
| | | @OperationLog("Update 容器管理") |
| | | @PostMapping("/basContainer/update") |
| | | public R update(@RequestBody BasContainer basContainer) { |
| | | basContainer.setUpdateBy(getLoginUserId()); |
| | | basContainer.setUpdateTime(new Date()); |
| | | if (null !=basContainer.getAreaIds()){ |
| | | basContainer.setAreas(Arrays.toString(basContainer.getAreaIds())); |
| | | } |
| | | if (!basContainerService.updateById(basContainer)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(basContainer); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:remove')") |
| | | @OperationLog("Delete 容器管理") |
| | | @PostMapping("/basContainer/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!basContainerService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @PostMapping("/basContainer/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<BasContainer> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(BasContainer::getId, condition); |
| | | } |
| | | basContainerService.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:basContainer:list')") |
| | | @PostMapping("/basContainer/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(basContainerService.list(), BasContainer.class), response); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | station.setAreaIds(longArray); |
| | | } |
| | | if (!Cools.isEmpty(station.getContainerType())) { |
| | | String content = station.getContainerType().substring(1, station.getContainerType().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | station.setContainerTypes(longArray); |
| | | } |
| | | |
| | | } |
| | | return R.ok().add(page); |
| | |
| | | @PreAuthorize("hasAuthority('manager:basStation:list')") |
| | | @GetMapping("/basStation/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | BasStation basStation = basStationService.getById(id); |
| | | BasStation station = basStationService.getById(id); |
| | | |
| | | |
| | | String content = basStation.getCrossZoneArea().substring(1, basStation.getCrossZoneArea().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | if (!Cools.isEmpty(station.getCrossZoneArea())) { |
| | | String content = station.getCrossZoneArea().substring(1, station.getCrossZoneArea().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | station.setAreaIds(longArray); |
| | | } |
| | | basStation.setAreaIds(longArray); |
| | | if (!Cools.isEmpty(station.getContainerType())) { |
| | | String content = station.getContainerType().substring(1, station.getContainerType().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | station.setContainerTypes(longArray); |
| | | } |
| | | |
| | | return R.ok().add(basStation); |
| | | return R.ok().add(station); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStation:save')") |
| | |
| | | if (null !=basStation.getAreaIds()){ |
| | | basStation.setCrossZoneArea(Arrays.toString(basStation.getAreaIds())); |
| | | } |
| | | if (null !=basStation.getContainerTypes()){ |
| | | basStation.setContainerType(Arrays.toString(basStation.getContainerTypes())); |
| | | } |
| | | if (!basStationService.save(basStation)) { |
| | | return R.error("保存失败"); |
| | | } |
| | |
| | | if (null !=basStation.getAreaIds()){ |
| | | basStation.setCrossZoneArea(Arrays.toString(basStation.getAreaIds())); |
| | | } |
| | | if (null !=basStation.getContainerTypes()){ |
| | | basStation.setContainerType(Arrays.toString(basStation.getContainerTypes())); |
| | | } |
| | | if (null !=basStation.getUseStatus() && basStation.getUseStatus().equals(StaUseStatusType.TYPE_O.type)){ |
| | | basStation.setBarcode(null); |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.server.system.entity.DictData; |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_bas_container") |
| | | public class BasContainer 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 containerType; |
| | | |
| | | /** |
| | | * 容器条码类型 |
| | | */ |
| | | @ApiModelProperty(value= "容器条码类型") |
| | | private String codeType; |
| | | |
| | | /** |
| | | * 可入库区 |
| | | */ |
| | | @ApiModelProperty(value= "可入库区") |
| | | private String areas; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @ApiModelProperty(value= "状态") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | @ApiModelProperty(value= "租户") |
| | | private Integer tenantId; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @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; |
| | | |
| | | @TableField(exist = false) |
| | | private Long[] areaIds; |
| | | |
| | | public BasContainer() {} |
| | | |
| | | public BasContainer(Long containerType,String codeType,String areas,Integer deleted,Integer status,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.containerType = containerType; |
| | | this.codeType = codeType; |
| | | this.areas = areas; |
| | | this.deleted = deleted; |
| | | this.status = status; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // BasContainer basContainer = new BasContainer( |
| | | // null, // 容器类型 |
| | | // null, // 容器条码类型 |
| | | // null, // 可入库区 |
| | | // null, // 是否删除 |
| | | // null, // 状态 |
| | | // null, // 租户 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间[非空] |
| | | // null, // 修改人员 |
| | | // null, // 修改时间[非空] |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getContainerType$(){ |
| | | if (Cools.isEmpty(this.containerType)){ |
| | | return ""; |
| | | } |
| | | DictDataService service = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictData = service.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, "sys_container_type") |
| | | .eq(DictData::getValue, this.containerType) |
| | | ); |
| | | if (!Cools.isEmpty(dictData)){ |
| | | return String.valueOf(dictData.getLabel()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | 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 Boolean getStatusBool(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return true; |
| | | case 0: |
| | | return false; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Data |
| | | @TableName("man_bas_station") |
| | |
| | | * 容器类型 |
| | | */ |
| | | @ApiModelProperty(value= "容器类型") |
| | | private Integer containerType; |
| | | private String containerType; |
| | | |
| | | /** |
| | | * 条码 |
| | |
| | | @TableField(exist = false) |
| | | private Long[] areaIds; |
| | | |
| | | @TableField(exist = false) |
| | | private Long[] containerTypes; |
| | | |
| | | public BasStation() {} |
| | | |
| | | |
| | |
| | | // null, // 更新人 |
| | | // null // 更新时间 |
| | | // ); |
| | | |
| | | public List<Long> getContainerTypes$(){ |
| | | if (Cools.isEmpty(this.containerType)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | DictDataService service = SpringUtils.getBean(DictDataService.class); |
| | | |
| | | |
| | | String content = this.getContainerType().substring(1, this.getContainerType().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | List<DictData> dictData = service.list(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, "sys_container_type") |
| | | .in(DictData::getValue, longArray) |
| | | ); |
| | | List<Long> longs = dictData.stream().map(DictData::getId).collect(Collectors.toList()); |
| | | return longs; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | |
| | | return ""; |
| | | } |
| | | |
| | | public String getContainerType$(){ |
| | | if (Cools.isEmpty(this.useStatus)){ |
| | | return ""; |
| | | } |
| | | DictDataService service = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictData = service.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, "sys_container_type") |
| | | .eq(DictData::getValue, this.containerType) |
| | | ); |
| | | if (!Cools.isEmpty(dictData)){ |
| | | return String.valueOf(dictData.getLabel()); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | public String getArea$(){ |
| | | if (null == this.area){ return null; } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.BasContainer; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BasContainerMapper extends BaseMapper<BasContainer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.BasContainer; |
| | | |
| | | public interface BasContainerService extends IService<BasContainer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.BasContainerMapper; |
| | | import com.vincent.rsf.server.manager.entity.BasContainer; |
| | | import com.vincent.rsf.server.manager.service.BasContainerService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basContainerService") |
| | | public class BasContainerServiceImpl extends ServiceImpl<BasContainerMapper, BasContainer> implements BasContainerService { |
| | | |
| | | } |
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.vincent.rsf.server.manager.mapper.BasContainerMapper"> |
| | | |
| | | </mapper> |