#新增
1. 添加批次规则信息
2. 物料添加控制属性
| | |
| | | name: "name", |
| | | }, |
| | | matnr: { |
| | | uuid: "uuid", |
| | | shipperId: "shipperId", |
| | | name: "name", |
| | | code: "code", |
| | | shipperId: "shipperId", |
| | | groupId: "groupId", |
| | | batchRegularId: "batchRegularId", |
| | | erpCode: "erpCode", |
| | | spec: "spec", |
| | | model: "model", |
| | | weight: "weight", |
| | | color: "color", |
| | | size: "size", |
| | | desc: "desc", |
| | | describle: "describle", |
| | | nromNum: "nromNum", |
| | | unit: "unit", |
| | | purchaseUnit: "purchaseUnit", |
| | | stockUnit: "stockUnit", |
| | | stockLeval: "stockLeval", |
| | | isLabelMange: "isLabelMange", |
| | | safetyQty: "safetyQty", |
| | | minQty: "minQty", |
| | | maxQty: "maxQty", |
| | | stagnate: "stagnate", |
| | | validity: "validity", |
| | | validityWarr: "validityWarr", |
| | | flagCheck: "flagCheck", |
| | | }, |
| | | matnrGroup: { |
| | | name: "name", |
| | |
| | | name: "名称", |
| | | }, |
| | | matnr: { |
| | | uuid: "编码", |
| | | shipperId: "货主ID", |
| | | name: "名称", |
| | | name: "物料名称", |
| | | code: "物料编码", |
| | | groupId: "分类标识", |
| | | shipperId: "货主标识", |
| | | groupId: "分组标识", |
| | | batchRegularId: "批次规则标识", |
| | | erpCode: "ERP编码", |
| | | spec: "规格", |
| | | model: "型号", |
| | | weight: "重量", |
| | | color: "颜色", |
| | | size: "尺寸", |
| | | desc: "描述", |
| | | describle: "描述", |
| | | nromNum: "标包数量", |
| | | unit: "单位", |
| | | purchaseUnit: "采购单位", |
| | | stockUnit: "库存单位", |
| | | stockLeval: "ABC分类", |
| | | isLabelMange: "是否标签管理", |
| | | isLabelMange: "标签管理", |
| | | safetyQty: "安全值", |
| | | minQty: "最小值", |
| | | maxQty: "最大值", |
| | | stagnate: "停滞预警值", |
| | | validity: "保质期", |
| | | validityWarr: "效期预警", |
| | | flagCheck: "免检", |
| | | }, |
| | | matnrGroup: { |
| | | name: "名称", |
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, |
| | | } 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 BatchRegularCreate = (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}> |
| | | <TextInput |
| | | label="table.field.batchRegular.name" |
| | | source="name" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.batchRegular.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.batchRegular.property" |
| | | source="property" |
| | | parse={v => v} |
| | | /> |
| | | </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 BatchRegularCreate; |
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, |
| | | } 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"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const BatchRegularEdit = () => { |
| | | 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}> |
| | | <TextInput |
| | | label="table.field.batchRegular.name" |
| | | source="name" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.batchRegular.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.batchRegular.property" |
| | | source="property" |
| | | parse={v => v} |
| | | /> |
| | | </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 BatchRegularEdit; |
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 BatchRegularCreate from "./BatchRegularCreate"; |
| | | import BatchRegularPanel from "./BatchRegularPanel"; |
| | | 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'; |
| | | |
| | | 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 />, |
| | | |
| | | <TextInput source="name" label="table.field.batchRegular.name" />, |
| | | <TextInput source="code" label="table.field.batchRegular.code" />, |
| | | <TextInput source="property" label="table.field.batchRegular.property" />, |
| | | |
| | | <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 BatchRegularList = () => { |
| | | 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.batchRegular"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='batchRegular' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='batchRegular' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <BatchRegularPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="name" label="table.field.batchRegular.name" /> |
| | | <TextField source="code" label="table.field.batchRegular.code" /> |
| | | <TextField source="property" label="table.field.batchRegular.property" /> |
| | | |
| | | <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> |
| | | <BatchRegularCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='BatchRegular Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default BatchRegularList; |
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 BatchRegularPanel = () => { |
| | | 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.batchRegular.name'))}: {record.name} |
| | | </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.batchRegular.name" |
| | | property={record.name} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.batchRegular.code" |
| | | property={record.code} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.batchRegular.property" |
| | | property={record.property} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default BatchRegularPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import BatchRegularList from "./BatchRegularList"; |
| | | import BatchRegularEdit from "./BatchRegularEdit"; |
| | | |
| | | export default { |
| | | list: BatchRegularList, |
| | | edit: BatchRegularEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.name}` |
| | | } |
| | | }; |
| | |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.name" |
| | | source="name" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="shipperId" |
| | | reference="shipper" |
| | |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="groupId" |
| | | reference="matnrGroup" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.matnr.groupId" |
| | | optionText="code" |
| | | filterToQuery={(val) => ({ code: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="batchRegularId" |
| | | reference="batchRegular" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.matnr.batchRegularId" |
| | | optionText="code" |
| | | filterToQuery={(val) => ({ code: val })} |
| | | /> |
| | |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.desc" |
| | | source="desc" |
| | | label="table.field.matnr.describle" |
| | | source="describle" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | |
| | | ]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.safetyQty" |
| | | source="safetyQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.minQty" |
| | | source="minQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.maxQty" |
| | | source="maxQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.stagnate" |
| | | source="stagnate" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.validity" |
| | | source="validity" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.validityWarr" |
| | | source="validityWarr" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.flagCheck" |
| | | source="flagCheck" |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.matnr.name" |
| | | source="name" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.matnr.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <ReferenceInput |
| | | source="shipperId" |
| | | reference="shipper" |
| | |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.matnr.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.matnr.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <ReferenceInput |
| | | source="groupId" |
| | | reference="matnrGroup" |
| | |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.matnr.groupId" |
| | | optionText="code" |
| | | filterToQuery={(val) => ({ code: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <ReferenceInput |
| | | source="batchRegularId" |
| | | reference="batchRegular" |
| | | perPage={REFERENCE_INPUT_PAGESIZE} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.matnr.batchRegularId" |
| | | optionText="code" |
| | | filterToQuery={(val) => ({ code: val })} |
| | | /> |
| | |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.matnr.desc" |
| | | source="desc" |
| | | label="table.field.matnr.describle" |
| | | source="describle" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.safetyQty" |
| | | source="safetyQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.minQty" |
| | | source="minQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.maxQty" |
| | | source="maxQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.stagnate" |
| | | source="stagnate" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.validity" |
| | | source="validity" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.validityWarr" |
| | | source="validityWarr" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.matnr.flagCheck" |
| | | source="flagCheck" |
| | | /> |
| | | </Stack> |
| | | |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="name" label="table.field.matnr.name" />, |
| | | <TextInput source="code" label="table.field.matnr.code" />, |
| | | <ReferenceInput source="shipperId" label="table.field.matnr.shipperId" reference="shipper"> |
| | | <AutocompleteInput label="table.field.matnr.shipperId" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | | </ReferenceInput>, |
| | | <TextInput source="name" label="table.field.matnr.name" />, |
| | | <TextInput source="code" label="table.field.matnr.code" />, |
| | | <ReferenceInput source="groupId" label="table.field.matnr.groupId" reference="matnrGroup"> |
| | | <AutocompleteInput label="table.field.matnr.groupId" optionText="code" filterToQuery={(val) => ({ code: val })} /> |
| | | </ReferenceInput>, |
| | | <ReferenceInput source="batchRegularId" label="table.field.matnr.batchRegularId" reference="batchRegular"> |
| | | <AutocompleteInput label="table.field.matnr.batchRegularId" optionText="code" filterToQuery={(val) => ({ code: val })} /> |
| | | </ReferenceInput>, |
| | | <TextInput source="erpCode" label="table.field.matnr.erpCode" />, |
| | | <TextInput source="spec" label="table.field.matnr.spec" />, |
| | |
| | | <NumberInput source="weight" label="table.field.matnr.weight" />, |
| | | <TextInput source="color" label="table.field.matnr.color" />, |
| | | <TextInput source="size" label="table.field.matnr.size" />, |
| | | <TextInput source="desc" label="table.field.matnr.desc" />, |
| | | <TextInput source="describle" label="table.field.matnr.describle" />, |
| | | <NumberInput source="nromNum" label="table.field.matnr.nromNum" />, |
| | | <TextInput source="unit" label="table.field.matnr.unit" />, |
| | | <TextInput source="purchaseUnit" label="table.field.matnr.purchaseUnit" />, |
| | |
| | | { id: 1, name: ' 是' }, |
| | | ]} |
| | | />, |
| | | <NumberInput source="safetyQty" label="table.field.matnr.safetyQty" />, |
| | | <NumberInput source="minQty" label="table.field.matnr.minQty" />, |
| | | <NumberInput source="maxQty" label="table.field.matnr.maxQty" />, |
| | | <NumberInput source="stagnate" label="table.field.matnr.stagnate" />, |
| | | <NumberInput source="validity" label="table.field.matnr.validity" />, |
| | | <NumberInput source="validityWarr" label="table.field.matnr.validityWarr" />, |
| | | <NumberInput source="flagCheck" label="table.field.matnr.flagCheck" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="name" label="table.field.matnr.name" /> |
| | | <TextField source="code" label="table.field.matnr.code" /> |
| | | <ReferenceField source="shipperId" label="table.field.matnr.shipperId" reference="shipper" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <TextField source="name" label="table.field.matnr.name" /> |
| | | <TextField source="code" label="table.field.matnr.code" /> |
| | | <ReferenceField source="groupId" label="table.field.matnr.groupId" reference="matnrGroup" link={false} sortable={false}> |
| | | <TextField source="code" /> |
| | | </ReferenceField> |
| | | <ReferenceField source="batchRegularId" label="table.field.matnr.batchRegularId" reference="batchRegular" link={false} sortable={false}> |
| | | <TextField source="code" /> |
| | | </ReferenceField> |
| | | <TextField source="erpCode" label="table.field.matnr.erpCode" /> |
| | |
| | | <NumberField source="weight" label="table.field.matnr.weight" /> |
| | | <TextField source="color" label="table.field.matnr.color" /> |
| | | <TextField source="size" label="table.field.matnr.size" /> |
| | | <TextField source="desc" label="table.field.matnr.desc" /> |
| | | <TextField source="describle" label="table.field.matnr.describle" /> |
| | | <NumberField source="nromNum" label="table.field.matnr.nromNum" /> |
| | | <TextField source="unit" label="table.field.matnr.unit" /> |
| | | <TextField source="purchaseUnit" label="table.field.matnr.purchaseUnit" /> |
| | | <TextField source="stockUnit" label="table.field.matnr.stockUnit" /> |
| | | <TextField source="stockLeval$" label="table.field.matnr.stockLeval" sortable={false} /> |
| | | <TextField source="isLabelMange$" label="table.field.matnr.isLabelMange" sortable={false} /> |
| | | <NumberField source="safetyQty" label="table.field.matnr.safetyQty" /> |
| | | <NumberField source="minQty" label="table.field.matnr.minQty" /> |
| | | <NumberField source="maxQty" label="table.field.matnr.maxQty" /> |
| | | <NumberField source="stagnate" label="table.field.matnr.stagnate" /> |
| | | <NumberField source="validity" label="table.field.matnr.validity" /> |
| | | <NumberField source="validityWarr" label="table.field.matnr.validityWarr" /> |
| | | <NumberField source="flagCheck" label="table.field.matnr.flagCheck" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.shipperId" |
| | | property={record.shipperId$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.name" |
| | | property={record.name} |
| | | /> |
| | |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.shipperId" |
| | | property={record.shipperId$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.groupId" |
| | | property={record.groupId$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.batchRegularId" |
| | | property={record.batchRegularId$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.desc" |
| | | property={record.desc} |
| | | title="table.field.matnr.describle" |
| | | property={record.describle} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | |
| | | property={record.isLabelMange$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.safetyQty" |
| | | property={record.safetyQty} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.minQty" |
| | | property={record.minQty} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.maxQty" |
| | | property={record.maxQty} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.stagnate" |
| | | property={record.stagnate} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.validity" |
| | | property={record.validity} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.validityWarr" |
| | | property={record.validityWarr} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.matnr.flagCheck" |
| | | property={record.flagCheck} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
New file |
| | |
| | | -- save batchRegular record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.batchRegular', '0', '/manager/batchRegular', 'batchRegular', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 批次属性规则', '', '1', 'manager:batchRegular:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 批次属性规则', '', '1', 'manager:batchRegular:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 批次属性规则', '', '1', 'manager:batchRegular:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 批次属性规则', '', '1', 'manager:batchRegular:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | batchRegular: 'BatchRegular', |
| | | |
| | | -- locale field |
| | | batchRegular: { |
| | | name: "name", |
| | | code: "code", |
| | | property: "property", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import batchRegular from './batchRegular'; |
| | | |
| | | case 'batchRegular': |
| | | return batchRegular; |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="man_matnr_group"; |
| | | generator.tableDesc="物料分类表"; |
| | | generator.table="man_matnr"; |
| | | 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.BatchRegular; |
| | | import com.vincent.rsf.server.manager.service.BatchRegularService; |
| | | 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 BatchRegularController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BatchRegularService batchRegularService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:list')") |
| | | @PostMapping("/batchRegular/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<BatchRegular, BaseParam> pageParam = new PageParam<>(baseParam, BatchRegular.class); |
| | | return R.ok().add(batchRegularService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:list')") |
| | | @PostMapping("/batchRegular/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(batchRegularService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:list')") |
| | | @PostMapping({"/batchRegular/many/{ids}", "/batchRegulars/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(batchRegularService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:list')") |
| | | @GetMapping("/batchRegular/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(batchRegularService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:save')") |
| | | @OperationLog("Create 批次属性规则") |
| | | @PostMapping("/batchRegular/save") |
| | | public R save(@RequestBody BatchRegular batchRegular) { |
| | | batchRegular.setCreateBy(getLoginUserId()); |
| | | batchRegular.setCreateTime(new Date()); |
| | | batchRegular.setUpdateBy(getLoginUserId()); |
| | | batchRegular.setUpdateTime(new Date()); |
| | | if (!batchRegularService.save(batchRegular)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(batchRegular); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:update')") |
| | | @OperationLog("Update 批次属性规则") |
| | | @PostMapping("/batchRegular/update") |
| | | public R update(@RequestBody BatchRegular batchRegular) { |
| | | batchRegular.setUpdateBy(getLoginUserId()); |
| | | batchRegular.setUpdateTime(new Date()); |
| | | if (!batchRegularService.updateById(batchRegular)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(batchRegular); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:remove')") |
| | | @OperationLog("Delete 批次属性规则") |
| | | @PostMapping("/batchRegular/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!batchRegularService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:list')") |
| | | @PostMapping("/batchRegular/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<BatchRegular> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(BatchRegular::getName, condition); |
| | | } |
| | | batchRegularService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getName())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:batchRegular:list')") |
| | | @PostMapping("/batchRegular/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(batchRegularService.list(), BatchRegular.class), response); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:save')") |
| | | @OperationLog("Create 物料表") |
| | | @OperationLog("Create 物料信息表") |
| | | @PostMapping("/matnr/save") |
| | | public R save(@RequestBody Matnr matnr) { |
| | | matnr.setCreateBy(getLoginUserId()); |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:update')") |
| | | @OperationLog("Update 物料表") |
| | | @OperationLog("Update 物料信息表") |
| | | @PostMapping("/matnr/update") |
| | | public R update(@RequestBody Matnr matnr) { |
| | | matnr.setUpdateBy(getLoginUserId()); |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:remove')") |
| | | @OperationLog("Delete 物料表") |
| | | @OperationLog("Delete 物料信息表") |
| | | @PostMapping("/matnr/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!matnrService.removeByIds(Arrays.asList(ids))) { |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.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_batch_regular") |
| | | public class BatchRegular 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 name; |
| | | |
| | | /** |
| | | * 编码 |
| | | */ |
| | | @ApiModelProperty(value= "编码") |
| | | private String code; |
| | | |
| | | /** |
| | | * 属性格式 |
| | | */ |
| | | @ApiModelProperty(value= "属性格式") |
| | | private String property; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | @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; |
| | | |
| | | public BatchRegular() {} |
| | | |
| | | public BatchRegular(String name,String code,String property,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.name = name; |
| | | this.code = code; |
| | | this.property = property; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // BatchRegular batchRegular = new BatchRegular( |
| | | // 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 "正常"; |
| | | 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 Boolean getStatusBool(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return true; |
| | | case 0: |
| | | return false; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.vincent.rsf.server.manager.service.BatchRegularService; |
| | | import com.vincent.rsf.server.manager.service.MatnrGroupService; |
| | | import com.vincent.rsf.server.manager.service.ShipperService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 货主ID |
| | | */ |
| | | @ApiModelProperty(value= "货主ID") |
| | | private Long shipperId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | |
| | | private String code; |
| | | |
| | | /** |
| | | * 分组ID |
| | | * 货主ID |
| | | */ |
| | | @ApiModelProperty(value= "分组ID") |
| | | @ApiModelProperty(value= "货主ID") |
| | | private Long shipperId; |
| | | |
| | | /** |
| | | * 分组ID(*) |
| | | */ |
| | | @ApiModelProperty(value= "分组ID(*)") |
| | | private Long groupId; |
| | | |
| | | /** |
| | | * 规则代码 |
| | | */ |
| | | @ApiModelProperty(value= "规则代码") |
| | | private Long batchRegularId; |
| | | |
| | | /** |
| | | * ERP编码 |
| | |
| | | private Short isLabelMange; |
| | | |
| | | /** |
| | | * 安全库存 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存") |
| | | private Double safetyQty; |
| | | |
| | | /** |
| | | * 最小库存预警值 |
| | | */ |
| | | @ApiModelProperty(value= "最小库存预警值") |
| | | private Double minQty; |
| | | |
| | | /** |
| | | * 最大库存预警值 |
| | | */ |
| | | @ApiModelProperty(value= "最大库存预警值") |
| | | private Double maxQty; |
| | | |
| | | /** |
| | | * 停滞天数 |
| | | */ |
| | | @ApiModelProperty(value= "停滞天数") |
| | | private Integer stagnate; |
| | | |
| | | /** |
| | | * 保质期天数 |
| | | */ |
| | | @ApiModelProperty(value= "保质期天数") |
| | | private Integer validity; |
| | | |
| | | /** |
| | | * 效期预警阈值 |
| | | */ |
| | | @ApiModelProperty(value= "效期预警阈值") |
| | | private Integer validityWarr; |
| | | |
| | | /** |
| | | * 是否免检 |
| | | */ |
| | | @ApiModelProperty(value= "是否免检") |
| | | private Short flagCheck; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | |
| | | |
| | | public Matnr() {} |
| | | |
| | | public Matnr(Long shipperId,String name,String code,Long groupId,String erpCode,String spec,String model,Double weight,String color,String size,String describle,Integer nromNum,String unit,String purchaseUnit,String stockUnit,Short stockLeval,Short isLabelMange,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.shipperId = shipperId; |
| | | public Matnr(String name,String code,Long shipperId,Long groupId,Long batchRegularId,String erpCode,String spec,String model,Double weight,String color,String size,String describle,Integer nromNum,String unit,String purchaseUnit,String stockUnit,Short stockLeval,Short isLabelMange,Double safetyQty,Double minQty,Double maxQty,Integer stagnate,Integer validity,Integer validityWarr,Short flagCheck,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.name = name; |
| | | this.code = code; |
| | | this.shipperId = shipperId; |
| | | this.groupId = groupId; |
| | | this.batchRegularId = batchRegularId; |
| | | this.erpCode = erpCode; |
| | | this.spec = spec; |
| | | this.model = model; |
| | |
| | | this.stockUnit = stockUnit; |
| | | this.stockLeval = stockLeval; |
| | | this.isLabelMange = isLabelMange; |
| | | this.safetyQty = safetyQty; |
| | | this.minQty = minQty; |
| | | this.maxQty = maxQty; |
| | | this.stagnate = stagnate; |
| | | this.validity = validity; |
| | | this.validityWarr = validityWarr; |
| | | this.flagCheck = flagCheck; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | |
| | | } |
| | | |
| | | // Matnr matnr = new Matnr( |
| | | // null, // 标识 |
| | | // null, // 货主ID |
| | | // null, // 名称 |
| | | // null, // 编码 |
| | | // null, // 分组ID |
| | | // null, // 货主ID |
| | | // null, // 分组ID(*) |
| | | // null, // 规则代码 |
| | | // null, // ERP编码 |
| | | // null, // 规格 |
| | | // null, // 型号 |
| | |
| | | // null, // 库位单位 |
| | | // null, // 出入库优先级别[非空] |
| | | // null, // 是否标签管理(*)[非空] |
| | | // null, // 安全库存 |
| | | // null, // 最小库存预警值 |
| | | // null, // 最大库存预警值 |
| | | // null, // 停滞天数 |
| | | // null, // 保质期天数 |
| | | // null, // 效期预警阈值 |
| | | // null, // 是否免检 |
| | | // null, // 状态[非空] |
| | | // null, // 是否删除[非空] |
| | | // null, // 租户 |
| | |
| | | return null; |
| | | } |
| | | |
| | | // public String getGroupId$(){ |
| | | // MatnrGroupService service = SpringUtils.getBean(MatnrGroupService.class); |
| | | // MatnrGroup matnrGroup = service.getById(this.groupId); |
| | | // if (!Cools.isEmpty(matnrGroup)){ |
| | | // return String.valueOf(matnrGroup.getCode()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | public String getGroupId$(){ |
| | | MatnrGroupService service = SpringUtils.getBean(MatnrGroupService.class); |
| | | MatnrGroup matnrGroup = service.getById(this.groupId); |
| | | if (!Cools.isEmpty(matnrGroup)){ |
| | | return String.valueOf(matnrGroup.getCode()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getBatchRegularId$(){ |
| | | BatchRegularService service = SpringUtils.getBean(BatchRegularService.class); |
| | | BatchRegular batchRegular = service.getById(this.batchRegularId); |
| | | if (!Cools.isEmpty(batchRegular)){ |
| | | return String.valueOf(batchRegular.getCode()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getStockLeval$(){ |
| | | if (null == this.stockLeval){ return null; } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.BatchRegular; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BatchRegularMapper extends BaseMapper<BatchRegular> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.BatchRegular; |
| | | |
| | | public interface BatchRegularService extends IService<BatchRegular> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.BatchRegularMapper; |
| | | import com.vincent.rsf.server.manager.entity.BatchRegular; |
| | | import com.vincent.rsf.server.manager.service.BatchRegularService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("batchRegularService") |
| | | public class BatchRegularServiceImpl extends ServiceImpl<BatchRegularMapper, BatchRegular> implements BatchRegularService { |
| | | |
| | | } |
| | |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.matnr', '0', '/manager/matnr', 'matnr', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 物料表', '57', '1', 'manager:matnr:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 物料表', '57', '1', 'manager:matnr:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 物料表', '57', '1', 'manager:matnr:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 物料表', '57', '1', 'manager:matnr:remove', '3', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 物料信息表', '', '1', 'manager:matnr:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 物料信息表', '', '1', 'manager:matnr:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 物料信息表', '', '1', 'manager:matnr:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 物料信息表', '', '1', 'manager:matnr:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | matnr: 'Matnr', |
| | | |
| | | -- locale field |
| | | matnr: { |
| | | shipperId: "shipperId", |
| | | name: "name", |
| | | code: "code", |
| | | shipperId: "shipperId", |
| | | groupId: "groupId", |
| | | batchRegularId: "batchRegularId", |
| | | erpCode: "erpCode", |
| | | spec: "spec", |
| | | model: "model", |
| | | weight: "weight", |
| | | color: "color", |
| | | size: "size", |
| | | desc: "desc", |
| | | describle: "describle", |
| | | nromNum: "nromNum", |
| | | unit: "unit", |
| | | purchaseUnit: "purchaseUnit", |
| | | stockUnit: "stockUnit", |
| | | stockLeval: "stockLeval", |
| | | isLabelMange: "isLabelMange", |
| | | safetyQty: "safetyQty", |
| | | minQty: "minQty", |
| | | maxQty: "maxQty", |
| | | stagnate: "stagnate", |
| | | validity: "validity", |
| | | validityWarr: "validityWarr", |
| | | flagCheck: "flagCheck", |
| | | }, |
| | | |
| | | -- ResourceContent |
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.BatchRegularMapper"> |
| | | |
| | | </mapper> |