| | |
| | | add_filter: "过滤条件", |
| | | add: "添加", |
| | | back: "返回", |
| | | bulk_actions: "1 item selected |||| %{smart_count} items selected", |
| | | bulk_actions: "%{smart_count} 条被选中 |||| %{smart_count} 条被选中", |
| | | cancel: "取消", |
| | | clear_array_input: "情空列表", |
| | | clear_input_value: "清空", |
| | |
| | | taskItem: 'TaskItem', |
| | | taskItemLog: 'TaskItemLog', |
| | | taskLog: 'TaskLog', |
| | | orderItem: 'OrderItem', |
| | | order: 'Order', |
| | | |
| | | }, |
| | | table: { |
| | | field: { |
| | |
| | | spec: "spec", |
| | | model: "model", |
| | | }, |
| | | order: { |
| | | code: "code", |
| | | sourceCode: "sourceCode", |
| | | sourceId: "sourceId", |
| | | type: "type", |
| | | wkType: "wkType", |
| | | anfme: "anfme", |
| | | }, |
| | | orderItem: { |
| | | orderId: "orderId", |
| | | orderCode: "orderCode", |
| | | sourceItemId: "sourceItemId", |
| | | matnrId: "matnrId", |
| | | matnrCode: "matnrCode", |
| | | maktx: "maktx", |
| | | anfme: "anfme", |
| | | stockUnit: "stockUnit", |
| | | workQty: "workQty", |
| | | purQty: "purQty", |
| | | purUnit: "purUnit", |
| | | qty: "qty", |
| | | splrCode: "splrCode", |
| | | batch: "batch", |
| | | splrBatch: "splrBatch", |
| | | splrName: "splrName", |
| | | trackCode: "trackCode", |
| | | barcode: "barcode", |
| | | prodTime: "prodTime", |
| | | packName: "packName", |
| | | }, |
| | | } |
| | | }, |
| | | page: { |
| | |
| | | asnCreate: "asnCreate", |
| | | createTask: "createTask", |
| | | recover: "recover", |
| | | order: 'Orders', |
| | | |
| | | }, |
| | | }; |
| | | |
| | |
| | | taskItem: '任务档明细', |
| | | taskLog: '任务历史档', |
| | | taskItemLog: '任务明细历史档', |
| | | order: '综合单据管理', |
| | | |
| | | }, |
| | | table: { |
| | | field: { |
| | |
| | | spec: "规格", |
| | | model: "型号", |
| | | }, |
| | | order: { |
| | | code: "编码", |
| | | sourceCode: "源单据", |
| | | sourceId: "源单据ID", |
| | | type: "单据类型", |
| | | wkType: "业务类型", |
| | | anfme: "数量", |
| | | }, |
| | | orderItem: { |
| | | orderId: "主单ID", |
| | | orderCode: "单据编码", |
| | | sourceItemId: "源明细ID", |
| | | matnrId: "物料ID", |
| | | matnrCode: "物料编码", |
| | | maktx: "物料名称", |
| | | anfme: "数量", |
| | | stockUnit: "stockUnit", |
| | | workQty: "执行数", |
| | | purQty: "采购数", |
| | | purUnit: "采购单位", |
| | | qty: "总数", |
| | | splrCode: "供应商编码", |
| | | batch: "批次", |
| | | splrBatch: "供应商批次", |
| | | splrName: "供应商名称", |
| | | trackCode: "跟踪码", |
| | | barcode: "条形码", |
| | | prodTime: "生产日期", |
| | | packName: "包装名称", |
| | | }, |
| | | } |
| | | }, |
| | | page: { |
| | |
| | | import asnOrderLog from './histories/asnOrderLog'; |
| | | import task from './task'; |
| | | import taskLog from './histories/taskLog'; |
| | | import order from './orders/order'; |
| | | |
| | | const ResourceContent = (node) => { |
| | | switch (node.component) { |
| | |
| | | return task; |
| | | case 'taskLog': |
| | | return taskLog; |
| | | |
| | | case 'order': |
| | | return order; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
| | |
| | | </CustomTabPanel> |
| | | <CustomTabPanel value={value} index={1}> |
| | | <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} |
| | | required |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.code" |
| | | source="code" |
| | | required |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.matnr.safeQty" |
| | |
| | | </CustomTabPanel> |
| | | <CustomTabPanel value={value} index={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} |
| | | required |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.matnr.code" |
| | | source="code" |
| | | required |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="rglar_id" |
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 LocItemCreate = (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}> |
| | | <NumberInput |
| | | label="table.field.locItem.locId" |
| | | source="locId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locItem.orderId" |
| | | source="orderId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.type" |
| | | source="type" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locItem.orderItemId" |
| | | source="orderItemId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locItem.wkType" |
| | | source="wkType" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locItem.matnrId" |
| | | source="matnrId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.trackCode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.locItem.anfme" |
| | | source="anfme" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.spec" |
| | | source="spec" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.model" |
| | | source="model" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.locItem.fieldsIndex" |
| | | source="fieldsIndex" |
| | | 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 LocItemCreate; |
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 LocItemEdit = () => { |
| | | 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}> |
| | | <NumberInput |
| | | label="table.field.locItem.locId" |
| | | source="locId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locItem.orderId" |
| | | source="orderId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.type" |
| | | source="type" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locItem.orderItemId" |
| | | source="orderItemId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locItem.wkType" |
| | | source="wkType" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locItem.matnrId" |
| | | source="matnrId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.trackCode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.locItem.anfme" |
| | | source="anfme" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.spec" |
| | | source="spec" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.model" |
| | | source="model" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.locItem.fieldsIndex" |
| | | source="fieldsIndex" |
| | | 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 LocItemEdit; |
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 LocItemCreate from "./LocItemCreate"; |
| | | import LocItemPanel from "./LocItemPanel"; |
| | | 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 />, |
| | | |
| | | <NumberInput source="locId" label="table.field.locItem.locId" />, |
| | | <NumberInput source="orderId" label="table.field.locItem.orderId" />, |
| | | <TextInput source="type" label="table.field.locItem.type" />, |
| | | <NumberInput source="orderItemId" label="table.field.locItem.orderItemId" />, |
| | | <NumberInput source="wkType" label="table.field.locItem.wkType" />, |
| | | <NumberInput source="matnrId" label="table.field.locItem.matnrId" />, |
| | | <TextInput source="maktx" label="table.field.locItem.maktx" />, |
| | | <TextInput source="matnrCode" label="table.field.locItem.matnrCode" />, |
| | | <TextInput source="trackCode" label="table.field.locItem.trackCode" />, |
| | | <TextInput source="unit" label="table.field.locItem.unit" />, |
| | | <NumberInput source="anfme" label="table.field.locItem.anfme" />, |
| | | <TextInput source="batch" label="table.field.locItem.batch" />, |
| | | <TextInput source="splrBatch" label="table.field.locItem.splrBatch" />, |
| | | <TextInput source="spec" label="table.field.locItem.spec" />, |
| | | <TextInput source="model" label="table.field.locItem.model" />, |
| | | <TextInput source="fieldsIndex" label="table.field.locItem.fieldsIndex" />, |
| | | |
| | | <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 LocItemList = () => { |
| | | 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.locItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='locItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='locItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <LocItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="locId" label="table.field.locItem.locId" /> |
| | | <NumberField source="orderId" label="table.field.locItem.orderId" /> |
| | | <TextField source="type" label="table.field.locItem.type" /> |
| | | <NumberField source="orderItemId" label="table.field.locItem.orderItemId" /> |
| | | <NumberField source="wkType" label="table.field.locItem.wkType" /> |
| | | <NumberField source="matnrId" label="table.field.locItem.matnrId" /> |
| | | <TextField source="maktx" label="table.field.locItem.maktx" /> |
| | | <TextField source="matnrCode" label="table.field.locItem.matnrCode" /> |
| | | <TextField source="trackCode" label="table.field.locItem.trackCode" /> |
| | | <TextField source="unit" label="table.field.locItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.locItem.anfme" /> |
| | | <TextField source="batch" label="table.field.locItem.batch" /> |
| | | <TextField source="splrBatch" label="table.field.locItem.splrBatch" /> |
| | | <TextField source="spec" label="table.field.locItem.spec" /> |
| | | <TextField source="model" label="table.field.locItem.model" /> |
| | | <TextField source="fieldsIndex" label="table.field.locItem.fieldsIndex" /> |
| | | |
| | | <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> |
| | | <LocItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='LocItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default LocItemList; |
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 LocItemPanel = () => { |
| | | 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.locItem.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.locItem.locId" |
| | | property={record.locId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.orderId" |
| | | property={record.orderId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.type" |
| | | property={record.type} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.orderItemId" |
| | | property={record.orderItemId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.wkType" |
| | | property={record.wkType} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.matnrId" |
| | | property={record.matnrId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.maktx" |
| | | property={record.maktx} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.matnrCode" |
| | | property={record.matnrCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.trackCode" |
| | | property={record.trackCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.unit" |
| | | property={record.unit} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.anfme" |
| | | property={record.anfme} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.batch" |
| | | property={record.batch} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.splrBatch" |
| | | property={record.splrBatch} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.spec" |
| | | property={record.spec} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.model" |
| | | property={record.model} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.locItem.fieldsIndex" |
| | | property={record.fieldsIndex} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default LocItemPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import LocItemList from "./LocItemList"; |
| | | import LocItemEdit from "./LocItemEdit"; |
| | | |
| | | export default { |
| | | list: LocItemList, |
| | | edit: LocItemEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
| | | } |
| | | }; |
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 OrderItemCreate = (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}> |
| | | <NumberInput |
| | | label="table.field.orderItem.orderId" |
| | | source="orderId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.orderCode" |
| | | source="orderCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.sourceItemId" |
| | | source="sourceItemId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrId" |
| | | source="matnrId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.purQty" |
| | | source="purQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.purUnit" |
| | | source="purUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.qty" |
| | | source="qty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.trackCode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.prodTime" |
| | | source="prodTime" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.packName" |
| | | source="packName" |
| | | 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 OrderItemCreate; |
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 OrderItemEdit = () => { |
| | | 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}> |
| | | <NumberInput |
| | | label="table.field.orderItem.orderId" |
| | | source="orderId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.orderCode" |
| | | source="orderCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.sourceItemId" |
| | | source="sourceItemId" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrId" |
| | | source="matnrId" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.purQty" |
| | | source="purQty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.purUnit" |
| | | source="purUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.qty" |
| | | source="qty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.trackCode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.prodTime" |
| | | source="prodTime" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.packName" |
| | | source="packName" |
| | | 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 OrderItemEdit; |
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 OrderItemCreate from "./OrderItemCreate"; |
| | | import OrderItemPanel from "./OrderItemPanel"; |
| | | 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 />, |
| | | |
| | | <NumberInput source="orderId" label="table.field.orderItem.orderId" />, |
| | | <TextInput source="orderCode" label="table.field.orderItem.orderCode" />, |
| | | <TextInput source="sourceItemId" label="table.field.orderItem.sourceItemId" />, |
| | | <TextInput source="matnrId" label="table.field.orderItem.matnrId" />, |
| | | <TextInput source="matnrCode" label="table.field.orderItem.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.orderItem.maktx" />, |
| | | <NumberInput source="anfme" label="table.field.orderItem.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.orderItem.stockUnit" />, |
| | | <NumberInput source="workQty" label="table.field.orderItem.workQty" />, |
| | | <NumberInput source="purQty" label="table.field.orderItem.purQty" />, |
| | | <TextInput source="purUnit" label="table.field.orderItem.purUnit" />, |
| | | <NumberInput source="qty" label="table.field.orderItem.qty" />, |
| | | <TextInput source="splrCode" label="table.field.orderItem.splrCode" />, |
| | | <TextInput source="batch" label="table.field.orderItem.batch" />, |
| | | <TextInput source="splrBatch" label="table.field.orderItem.splrBatch" />, |
| | | <TextInput source="splrName" label="table.field.orderItem.splrName" />, |
| | | <TextInput source="trackCode" label="table.field.orderItem.trackCode" />, |
| | | <TextInput source="barcode" label="table.field.orderItem.barcode" />, |
| | | <TextInput source="prodTime" label="table.field.orderItem.prodTime" />, |
| | | <TextInput source="packName" label="table.field.orderItem.packName" />, |
| | | |
| | | <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 OrderItemList = () => { |
| | | 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.orderItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='orderItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='orderItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <OrderItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="orderId" label="table.field.orderItem.orderId" /> |
| | | <TextField source="orderCode" label="table.field.orderItem.orderCode" /> |
| | | <TextField source="sourceItemId" label="table.field.orderItem.sourceItemId" /> |
| | | <TextField source="matnrId" label="table.field.orderItem.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.orderItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.orderItem.maktx" /> |
| | | <NumberField source="anfme" label="table.field.orderItem.anfme" /> |
| | | <TextField source="stockUnit" label="table.field.orderItem.stockUnit" /> |
| | | <NumberField source="workQty" label="table.field.orderItem.workQty" /> |
| | | <NumberField source="purQty" label="table.field.orderItem.purQty" /> |
| | | <TextField source="purUnit" label="table.field.orderItem.purUnit" /> |
| | | <NumberField source="qty" label="table.field.orderItem.qty" /> |
| | | <TextField source="splrCode" label="table.field.orderItem.splrCode" /> |
| | | <TextField source="batch" label="table.field.orderItem.batch" /> |
| | | <TextField source="splrBatch" label="table.field.orderItem.splrBatch" /> |
| | | <TextField source="splrName" label="table.field.orderItem.splrName" /> |
| | | <TextField source="trackCode" label="table.field.orderItem.trackCode" /> |
| | | <TextField source="barcode" label="table.field.orderItem.barcode" /> |
| | | <TextField source="prodTime" label="table.field.orderItem.prodTime" /> |
| | | <TextField source="packName" label="table.field.orderItem.packName" /> |
| | | |
| | | <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> |
| | | <OrderItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='OrderItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default OrderItemList; |
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 OrderItemPanel = () => { |
| | | 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.orderItem.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.orderItem.orderId" |
| | | property={record.orderId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.orderCode" |
| | | property={record.orderCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.sourceItemId" |
| | | property={record.sourceItemId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.matnrId" |
| | | property={record.matnrId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.matnrCode" |
| | | property={record.matnrCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.maktx" |
| | | property={record.maktx} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.anfme" |
| | | property={record.anfme} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.stockUnit" |
| | | property={record.stockUnit} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.workQty" |
| | | property={record.workQty} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.purQty" |
| | | property={record.purQty} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.purUnit" |
| | | property={record.purUnit} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.qty" |
| | | property={record.qty} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.splrCode" |
| | | property={record.splrCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.batch" |
| | | property={record.batch} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.splrBatch" |
| | | property={record.splrBatch} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.splrName" |
| | | property={record.splrName} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.trackCode" |
| | | property={record.trackCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.barcode" |
| | | property={record.barcode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.prodTime" |
| | | property={record.prodTime} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.orderItem.packName" |
| | | property={record.packName} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default OrderItemPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import OrderItemList from "./OrderItemList"; |
| | | import OrderItemEdit from "./OrderItemEdit"; |
| | | |
| | | export default { |
| | | list: OrderItemList, |
| | | edit: OrderItemEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
| | | } |
| | | }; |
| | |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.qty" |
| | | source="qty" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.splrCode" |
| | |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.barcode" |
| | | source="barcode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.packName" |
| | |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <Button label="ra.action.edit" onClick={(id, resource, record) => { |
| | | console.log(record); |
| | | setEditDialog(true) |
| | | setSelect(record) }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { useLocation, useNavigate } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button, |
| | | useRedirect, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const [select, setSelect] = useState(0); |
| | | |
| | | const billReload = useRef(); |
| | | const location = useLocation(); |
| | | const redirect = useRedirect(); |
| | | const navigate = useNavigate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const assign = (record) => { |
| | |
| | | sx={{ width: '100%' }} |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={() => 'edit'} |
| | | rowClick='toggleSelection' |
| | | onToggleItem={(id, resource, record)=>{ |
| | | redirect(location.pathname + '/' + id) |
| | | }} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} |
| | | > |
| | |
| | | |
| | | const MyButton = ({ setCreateDialog, setmodalType }) => { |
| | | const record = useRecordContext(); |
| | | const handleEditClick = () => { |
| | | const handleEditClick = (btn) => { |
| | | btn.stopPropagation(); |
| | | const id = record.id; |
| | | setmodalType(id); |
| | | setCreateDialog(true); |
| | |
| | | <Button |
| | | color="primary" |
| | | startIcon={<EditIcon />} |
| | | onClick={() => handleEditClick()} |
| | | onClick={(btn) => handleEditClick(btn)} |
| | | sx={{ ml: 1 }} |
| | | label={'ra.action.edit'} |
| | | > |
| | |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const inspection = () => { |
| | | const inspection = (btn) => { |
| | | btn.stopPropagation(); |
| | | requestInspect([record]) |
| | | }; |
| | | |
| | |
| | | const { selectedIds, onUnselectItems, data } = useListContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const inspection = () => { |
| | | const inspection = (btn) => { |
| | | btn.stopPropagation(); |
| | | if (selectedIds.length === 0) { |
| | | notify('请选择通知单'); |
| | | return; |
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 OrderCreate = (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.order.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.order.sourceCode" |
| | | source="sourceCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.order.sourceId" |
| | | source="sourceId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.order.type" |
| | | source="type" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.order.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.order.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </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 OrderCreate; |
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, |
| | | required, |
| | | 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"; |
| | | import OrderItemList from "./OrderItemList"; |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const OrderEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Box> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <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.order.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.order.sourceCode" |
| | | source="sourceCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.order.sourceId" |
| | | source="sourceId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.order.type" |
| | | source="type" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.order.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.order.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </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 > |
| | | <OrderItemList /> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default OrderEdit; |
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 OrderItemCreate = (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}> |
| | | <NumberInput |
| | | label="table.field.orderItem.orderId" |
| | | source="orderId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.orderCode" |
| | | source="orderCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.sourceItemId" |
| | | source="sourceItemId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrId" |
| | | source="matnrId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.purQty" |
| | | source="purQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.purUnit" |
| | | source="purUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.orderItem.qty" |
| | | source="qty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.trackCode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.prodTime" |
| | | source="prodTime" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.orderItem.packName" |
| | | source="packName" |
| | | 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 OrderItemCreate; |
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 OrderItemEdit = () => { |
| | | 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}> |
| | | <NumberInput |
| | | label="table.field.orderItem.orderId" |
| | | source="orderId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.orderCode" |
| | | source="orderCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.sourceItemId" |
| | | source="sourceItemId" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrId" |
| | | source="matnrId" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.purQty" |
| | | source="purQty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.purUnit" |
| | | source="purUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.orderItem.qty" |
| | | source="qty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.trackCode" |
| | | source="trackCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.prodTime" |
| | | source="prodTime" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.orderItem.packName" |
| | | source="packName" |
| | | 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 OrderItemEdit; |
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 OrderItemCreate from "./OrderItemCreate"; |
| | | 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 />, |
| | | <NumberInput source="orderId" label="table.field.orderItem.orderId" />, |
| | | <TextInput source="orderCode" label="table.field.orderItem.orderCode" />, |
| | | <TextInput source="sourceItemId" label="table.field.orderItem.sourceItemId" />, |
| | | <TextInput source="matnrId" label="table.field.orderItem.matnrId" />, |
| | | <TextInput source="matnrCode" label="table.field.orderItem.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.orderItem.maktx" />, |
| | | <NumberInput source="anfme" label="table.field.orderItem.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.orderItem.stockUnit" />, |
| | | <NumberInput source="workQty" label="table.field.orderItem.workQty" />, |
| | | <NumberInput source="purQty" label="table.field.orderItem.purQty" />, |
| | | <TextInput source="purUnit" label="table.field.orderItem.purUnit" />, |
| | | <NumberInput source="qty" label="table.field.orderItem.qty" />, |
| | | <TextInput source="splrCode" label="table.field.orderItem.splrCode" />, |
| | | <TextInput source="batch" label="table.field.orderItem.batch" />, |
| | | <TextInput source="splrBatch" label="table.field.orderItem.splrBatch" />, |
| | | <TextInput source="splrName" label="table.field.orderItem.splrName" />, |
| | | <TextInput source="trackCode" label="table.field.orderItem.trackCode" />, |
| | | <TextInput source="barcode" label="table.field.orderItem.barcode" />, |
| | | <TextInput source="prodTime" label="table.field.orderItem.prodTime" />, |
| | | <TextInput source="packName" label="table.field.orderItem.packName" />, |
| | | <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 OrderItemList = () => { |
| | | 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.orderItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='orderItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='orderItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="orderId" label="table.field.orderItem.orderId" /> |
| | | <TextField source="orderCode" label="table.field.orderItem.orderCode" /> |
| | | <TextField source="sourceItemId" label="table.field.orderItem.sourceItemId" /> |
| | | <TextField source="matnrId" label="table.field.orderItem.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.orderItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.orderItem.maktx" /> |
| | | <NumberField source="anfme" label="table.field.orderItem.anfme" /> |
| | | <TextField source="stockUnit" label="table.field.orderItem.stockUnit" /> |
| | | <NumberField source="workQty" label="table.field.orderItem.workQty" /> |
| | | <NumberField source="purQty" label="table.field.orderItem.purQty" /> |
| | | <TextField source="purUnit" label="table.field.orderItem.purUnit" /> |
| | | <NumberField source="qty" label="table.field.orderItem.qty" /> |
| | | <TextField source="splrCode" label="table.field.orderItem.splrCode" /> |
| | | <TextField source="batch" label="table.field.orderItem.batch" /> |
| | | <TextField source="splrBatch" label="table.field.orderItem.splrBatch" /> |
| | | <TextField source="splrName" label="table.field.orderItem.splrName" /> |
| | | <TextField source="trackCode" label="table.field.orderItem.trackCode" /> |
| | | <TextField source="barcode" label="table.field.orderItem.barcode" /> |
| | | <TextField source="prodTime" label="table.field.orderItem.prodTime" /> |
| | | <TextField source="packName" label="table.field.orderItem.packName" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <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> |
| | | <OrderItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='OrderItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default OrderItemList; |
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 OrderCreate from "./OrderCreate"; |
| | | import OrderPanel from "./OrderPanel"; |
| | | 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="code" label="table.field.order.code" />, |
| | | <TextInput source="sourceCode" label="table.field.order.sourceCode" />, |
| | | <NumberInput source="sourceId" label="table.field.order.sourceId" />, |
| | | <TextInput source="type" label="table.field.order.type" />, |
| | | <TextInput source="wkType" label="table.field.order.wkType" />, |
| | | <NumberInput source="anfme" label="table.field.order.anfme" />, |
| | | |
| | | <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 OrderList = () => { |
| | | 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.order"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='order' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='order' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <OrderPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.order.code" /> |
| | | <TextField source="sourceCode" label="table.field.order.sourceCode" /> |
| | | <NumberField source="sourceId" label="table.field.order.sourceId" /> |
| | | <TextField source="type" label="table.field.order.type" /> |
| | | <TextField source="wkType" label="table.field.order.wkType" /> |
| | | <NumberField source="anfme" label="table.field.order.anfme" /> |
| | | |
| | | <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> |
| | | <OrderCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='Order Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default OrderList; |
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 OrderPanel = () => { |
| | | 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.order.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.order.code" |
| | | property={record.code} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.order.sourceCode" |
| | | property={record.sourceCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.order.sourceId" |
| | | property={record.sourceId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.order.type" |
| | | property={record.type} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.order.wkType" |
| | | property={record.wkType} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.order.anfme" |
| | | property={record.anfme} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default OrderPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import OrderList from "./OrderList"; |
| | | import OrderEdit from "./OrderEdit"; |
| | | |
| | | export default { |
| | | list: OrderList, |
| | | edit: OrderEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
| | | } |
| | | }; |
| | |
| | | import { Dialog, DialogTitle, Box, DialogActions, DialogContent } from "@mui/material"; |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback, Form } from "react"; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { FilterButton, TopToolbar, Toolbar, useTranslate, SaveButton, List, SelectInput, NumberField, WrapperField, EditButton, DeleteButton, TextField, DateField, TextInput, BooleanField, NumberInput, ReferenceField, SearchInput, SelectColumnsButton, DatagridConfigurable, Button } from "react-admin"; |
| | | import { FilterButton, TopToolbar, Toolbar, useTranslate, SaveButton, List, useRecordSelection, SelectInput, NumberField, WrapperField, EditButton, DeleteButton, TextField, DateField, TextInput, BooleanField, NumberInput, ReferenceField, SearchInput, SelectColumnsButton, DatagridConfigurable, Button, useRefresh, useRecordContext, useNotify } from "react-admin"; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="type" label="table.field.deviceSite.type" />, |
| | | <TextInput source="site" label="table.field.deviceSite.site" />, |
| | | <TextInput source="name" label="table.field.deviceSite.name" />, |
| | | <TextInput source="wcsCode" label="table.field.deviceSite.wcsCode" />, |
| | | <TextInput source="label" label="table.field.deviceSite.label" />, |
| | | <TextInput source="device" label="table.field.deviceSite.device" />, |
| | | <TextInput source="deviceCode" label="table.field.deviceSite.deviceCode" />, |
| | | <TextInput source="deviceSite" label="table.field.deviceSite.deviceSite" />, |
| | | <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 |
| | | /> |
| | | ] |
| | | import request from '@/utils/request'; |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | })); |
| | | |
| | | const SelectSiteModel = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const { open, setOpen, source } = props; |
| | | const translate = useTranslate(); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const refresh = useRefresh(); |
| | | const notify = useNotify(); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | console.log(source); |
| | | return ( |
| | | <Box> |
| | | <Dialog |
| | | sx={{width: '90%'}} |
| | | open={open} |
| | | onClose={handleClose} |
| | | fullWidth |
| | |
| | | }} |
| | | title={"menu.deviceSite"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='deviceSite' /> |
| | | </TopToolbar> |
| | | )} |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='deviceSite' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'updateBy$', 'createBy$', 'createTime', 'updateTime']} |
| | | rowClick='toggleSelection' |
| | | onToggleItem={async (id)=>{ |
| | | setOpen(false); |
| | | const res = await request.post(`/waitPakin/merge`, {waitPakins: source, siteId: id}); |
| | | if (res?.data?.code === 200) { |
| | | refresh(); |
| | | notify(res.data.msg); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | }} |
| | | omit={['id','name', 'createTime','label', 'createBy', 'memo', 'updateBy$', 'createBy$', 'createTime', 'updateTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="name" label="table.field.deviceSite.name" /> |
| | |
| | | <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"> |
| | | <Button label="toolbar.selectSite" onClick={(event)=>{ |
| | | setOpen(false) |
| | | }}/> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | </DialogContent> |
| | |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import AddIcon from '@mui/icons-material/Add'; |
| | | import request from '@/utils/request'; |
| | | import TaskIcon from '@mui/icons-material/Task'; |
| | | import { width } from "@mui/system"; |
| | | import SelectSiteModel from "./SelectSiteModel"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [siteDialog, setSiteDialog] = useState(false); |
| | | const [source, setSource] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const CreateTaskButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const { selectedIds, onUnselectItems, data } = useListContext(); |
| | | const rows = data.filter(map => selectedIds.includes(map.id)); |
| | | const createTask = () => { |
| | | setSiteDialog(true) |
| | | setSource(rows) |
| | | refresh() |
| | | } |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => createTask()} label={"toolbar.createTask"}> |
| | | <AddIcon /> |
| | | </Button> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | const BulkActionButtons = () => { |
| | | |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="waitPakin" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakin' |
| | | bulkActionButtons={<Box> <Button label="ra.action.edit" onClick={()=>{ |
| | | setSiteDialog(true) |
| | | }} /> <BulkDeleteButton mutationMode={OPERATE_MODE} /></Box>} |
| | | bulkActionButtons={ |
| | | <> |
| | | <CreateTaskButton /> |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </>} |
| | | rowClick='edit' |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SelectSiteModel open={siteDialog} setOpen={setSiteDialog}/> |
| | | <SelectSiteModel open={siteDialog} setOpen={setSiteDialog} source={source} /> |
| | | <WaitPakinCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | |
| | | |
| | | export default WaitPakinList; |
| | | |
| | | const CreateTaskButton = () => { |
| | | const record = useRecordContext(); |
| | | const [siteDialog, setSiteDialog] = useState(false); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const { selectedIds, onUnselectItems, data } = useListContext(); |
| | | |
| | | const createTask = () => { |
| | | // const rows = data.filter((item) => selectedIds.includes(item.id)) || []; |
| | | // const res = await request.post(`/waitPakin/merge`, rows); |
| | | // if (res?.data?.code === 200) { |
| | | // refresh(); |
| | | // notify(res.data.msg); |
| | | // } else { |
| | | // notify(res.data.msg); |
| | | // } |
| | | console.log('-------->'); |
| | | setSiteDialog(true) |
| | | |
| | | } |
| | | // return ( |
| | | // <ConfirmButton label={"toolbar.createTask"} startIcon={<TaskIcon />} onConfirm={createTask} /> |
| | | // ) |
| | | return ( |
| | | <> |
| | | <Button onClick={() => createTask()} label={"toolbar.createTask"}> |
| | | <AddIcon /> |
| | | </Button> |
| | | </> |
| | | ) |
| | | } |
| | |
| | | private QlyIsptItemService qlyIsptItemService; |
| | | @Resource |
| | | private StockItemMapper stockItemMapper; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Resource |
| | | private PurchaseItemMapper purchaseItemMapper; |
| | | @Resource |
| | |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | Stock stock = new Stock(); |
| | | stock.setAsnId(OrderId).setAsnCode(order.getCode()); |
| | | if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |
| | | if (!Objects.isNull(purchase)) { |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | } |
| | | } |
| | | // if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | // Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |
| | | // if (!Objects.isNull(purchase)) { |
| | | // stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | // } |
| | | // } |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("当前业务:" + SerialRuleCode.SYS_STOCK_CODE + ",编码规则不存在!!"); |
| | | } |
| | | List<AsnOrderItem> itemList = params.getItemList(); |
| | | double sum = itemList.stream().mapToDouble(AsnOrderItem::getAnfme).sum(); |
| | | stock.setAnfme(sum) |
| | | .setSourceId(order.getId()) |
| | | .setType(order.getType()) |
| | | .setWkType(Short.parseShort(order.getWkType())); |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | | } |
| | | //TODO 平库上架策略问题: 1 平库库位是单独设计,还是与产库一起用类型区分 |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, params.getLocCode())); |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("库位不存在!!"); |
| | | } |
| | | //locItemSerivce |
| | | List<LocItem> locItems = new ArrayList<>(); |
| | | itemList.forEach(asnOrderItem -> { |
| | | LocItem item = new LocItem(); |
| | | BeanUtils.copyProperties(asnOrderItem, item); |
| | | item.setId(loc.getId()) |
| | | .setOrderId(order.getId()) |
| | | .setOrderItemId(asnOrderItem.getId()) |
| | | .setWkType(Short.parseShort(order.getWkType())) |
| | | .setType(order.getType()); |
| | | locItems.add(item); |
| | | }); |
| | | if (!locItemService.saveBatch(locItems)) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | |
| | | List<StockItem> stockItems = new ArrayList<>(); |
| | | params.getItemList().forEach(orderItem -> { |
| | | itemList.forEach(orderItem -> { |
| | | StockItem stockItem = new StockItem(); |
| | | BeanUtils.copyProperties(orderItem, stockItem); |
| | | stockItem.setAsnItemId(orderItem.getId()) |
| | | stockItem.setSourceItemId(orderItem.getId()) |
| | | .setBarcode(orderItem.getBarcode()) |
| | | .setLocId(loc.getId()) |
| | | .setStockCode(stock.getCode()) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId) |
| | | .setId(null) |
| | | .setStockId(stock.getId()); |
| | | stockItems.add(stockItem); |
| | |
| | | detlsDto.setInspect(inspect.getStatus$()); |
| | | } |
| | | //获取当前库存信息 |
| | | StockItem stockItem = stockItemMapper.selectOne(new LambdaQueryWrapper<StockItem>() |
| | | .eq(StockItem::getAsnItemId, asnOrderItem.getId()) |
| | | .eq(StockItem::getMatnrId, asnOrderItem.getMatnrId())); |
| | | LocItem stockItem = locItemService.getOne(new LambdaQueryWrapper<LocItem>() |
| | | .eq(LocItem::getOrderItemId, asnOrderItem.getId()) |
| | | .eq(LocItem::getBatch, asnOrderItem.getBatch()) |
| | | .eq(LocItem::getMatnrId, asnOrderItem.getMatnrId())); |
| | | //SET 当前库存数量 |
| | | if (Objects.isNull(stockItem)) { |
| | | detlsDto.setStockQty(0.0); |
| | | } else { |
| | | detlsDto.setStockQty(stockItem.getQty() + stockItem.getWorkQty()); |
| | | detlsDto.setStockQty(stockItem.getAnfme() + stockItem.getWorkQty()); |
| | | } |
| | | |
| | | if (!Objects.isNull(asnOrderItem.getPoDetlId())) { |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="man_task_item_log"; |
| | | generator.tableDesc="任务工作档"; |
| | | generator.table="man_loc_item"; |
| | | generator.tableDesc="库位明细"; |
| | | generator.packagePath="com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
| | |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.function.Consumer; |
| | | |
| | | /** |
| | |
| | | return this.buildWrapper(like, null, timeField); |
| | | } |
| | | |
| | | public QueryWrapper<T> buildWrapper(boolean like, List<String> fields) { |
| | | return this.buildWrapper(like, null,"create_time", fields); |
| | | } |
| | | |
| | | @SuppressWarnings("all") |
| | | public QueryWrapper<T> buildWrapper(boolean like, Consumer<QueryWrapper<T>> consumer, String timeField) { |
| | | QueryWrapper<T> queryWrapper = new QueryWrapper<>(); |
| | |
| | | if (this.isToUnderlineCase) { |
| | | key = Utils.toSymbolCase(key, '_'); |
| | | } |
| | | if (like) { |
| | | if (like && key.contains(timeField)) { |
| | | queryWrapper.like("`" + key + "`", val); |
| | | } else { |
| | | queryWrapper.eq("`" + key + "`", val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (null != consumer) { |
| | | consumer.accept(queryWrapper); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(where.getTimeStart())) { |
| | | Date timeStart = DateUtils.convert(String.valueOf(where.getTimeStart()), DateUtils.yyyyMMdd_F); |
| | | queryWrapper.ge(timeField, timeStart); |
| | | |
| | | } |
| | | if (!Cools.isEmpty(where.getTimeEnd())) { |
| | | Date timeStart = DateUtils.convert(String.valueOf(where.getTimeEnd()), DateUtils.yyyyMMdd_F); |
| | | queryWrapper.le(timeField, timeStart); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(where.getOrderBy())) { |
| | | if (sortIsSQL(where.getOrderBy())) { |
| | | setOrders(parseOrderSQL(where.getOrderBy())); |
| | | } |
| | | } else { |
| | | // queryWrapper.orderByDesc("create_time"); |
| | | } |
| | | |
| | | if (!Cools.isEmpty(where.getCondition()) && !Cools.isEmpty(cls)) { |
| | | List<String> columns = new ArrayList<>(); |
| | | for (Field field : Cools.getAllFields(cls)){ |
| | | if (Modifier.isFinal(field.getModifiers()) |
| | | || Modifier.isStatic(field.getModifiers()) |
| | | || Modifier.isTransient(field.getModifiers())){ |
| | | continue; |
| | | } |
| | | |
| | | if (field.isAnnotationPresent(TableField.class)){ |
| | | TableField annotation = field.getAnnotation(TableField.class); |
| | | if (!annotation.exist()) { |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | String column = Utils.toSymbolCase(field.getName(), '_'); |
| | | columns.add(column); |
| | | } |
| | | if (!columns.isEmpty()) { |
| | | for (int i=0;i<columns.size();i++){ |
| | | String column = columns.get(i); |
| | | String condition = where.getCondition(); |
| | | |
| | | if (i == 0) { |
| | | queryWrapper.and(wrapper -> wrapper.like("`" + column + "`", condition)); |
| | | } else { |
| | | queryWrapper.or().like("`" + column + "`", condition); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return queryWrapper; |
| | | } |
| | | |
| | | @SuppressWarnings("all") |
| | | public QueryWrapper<T> buildWrapper(boolean like, Consumer<QueryWrapper<T>> consumer,String timeField, List<String> fields) { |
| | | QueryWrapper<T> queryWrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = where.getMap(); |
| | | for (String key : map.keySet()) { |
| | | Object val = map.get(key); |
| | | |
| | | if (key.contains("Range")) { |
| | | ArrayList<String> list = null; |
| | | if (val instanceof ArrayList) { |
| | | list = (ArrayList<String>) val; |
| | | } |
| | | if (null != list) { |
| | | key = key.replaceAll("Range", ""); |
| | | if (this.isToUnderlineCase) { |
| | | key = Utils.toSymbolCase(key, '_'); |
| | | } |
| | | queryWrapper.ge(key, DateUtils.convert(list.get(0))); |
| | | queryWrapper.le(key, DateUtils.convert(list.get(1))); |
| | | } |
| | | } else { |
| | | if (this.isToUnderlineCase) { |
| | | key = Utils.toSymbolCase(key, '_'); |
| | | } |
| | | if (like && !fields.contains(key)) { |
| | | queryWrapper.like("`" + key + "`", val); |
| | | } else { |
| | | queryWrapper.eq("`" + key + "`", val); |
| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Loc, BaseParam> pageParam = new PageParam<>(baseParam, Loc.class); |
| | | return R.ok().add(locService.page(pageParam, pageParam.buildWrapper(true))); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add("row"); |
| | | list.add("col"); |
| | | list.add("lev"); |
| | | return R.ok().add(locService.page(pageParam, pageParam.buildWrapper(true,list))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:list')") |
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.LocItem; |
| | | import com.vincent.rsf.server.manager.service.LocItemService; |
| | | 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 LocItemController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping("/locItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<LocItem, BaseParam> pageParam = new PageParam<>(baseParam, LocItem.class); |
| | | return R.ok().add(locItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping("/locItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(locItemService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping({"/locItem/many/{ids}", "/locItems/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(locItemService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @GetMapping("/locItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(locItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:save')") |
| | | @OperationLog("Create 库位明细") |
| | | @PostMapping("/locItem/save") |
| | | public R save(@RequestBody LocItem locItem) { |
| | | locItem.setCreateBy(getLoginUserId()); |
| | | locItem.setCreateTime(new Date()); |
| | | locItem.setUpdateBy(getLoginUserId()); |
| | | locItem.setUpdateTime(new Date()); |
| | | if (!locItemService.save(locItem)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(locItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:update')") |
| | | @OperationLog("Update 库位明细") |
| | | @PostMapping("/locItem/update") |
| | | public R update(@RequestBody LocItem locItem) { |
| | | locItem.setUpdateBy(getLoginUserId()); |
| | | locItem.setUpdateTime(new Date()); |
| | | if (!locItemService.updateById(locItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(locItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:remove')") |
| | | @OperationLog("Delete 库位明细") |
| | | @PostMapping("/locItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!locItemService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping("/locItem/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<LocItem> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(LocItem::getId, condition); |
| | | } |
| | | locItemService.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:locItem:list')") |
| | | @PostMapping("/locItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(locItemService.list(), LocItem.class), response); |
| | | } |
| | | |
| | | } |
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.Order; |
| | | import com.vincent.rsf.server.manager.service.OrderService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | 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.*; |
| | | |
| | | @Api(tags = "综合订单管理") |
| | | @RestController |
| | | public class OrderController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:list')") |
| | | @PostMapping("/order/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Order, BaseParam> pageParam = new PageParam<>(baseParam, Order.class); |
| | | return R.ok().add(orderService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:list')") |
| | | @PostMapping("/order/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(orderService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:list')") |
| | | @PostMapping({"/order/many/{ids}", "/orders/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(orderService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:list')") |
| | | @GetMapping("/order/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(orderService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:save')") |
| | | @OperationLog("Create 综合订单管理") |
| | | @PostMapping("/order/save") |
| | | public R save(@RequestBody Order order) { |
| | | order.setCreateBy(getLoginUserId()); |
| | | order.setCreateTime(new Date()); |
| | | order.setUpdateBy(getLoginUserId()); |
| | | order.setUpdateTime(new Date()); |
| | | if (!orderService.save(order)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(order); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:update')") |
| | | @OperationLog("Update 综合订单管理") |
| | | @PostMapping("/order/update") |
| | | public R update(@RequestBody Order order) { |
| | | order.setUpdateBy(getLoginUserId()); |
| | | order.setUpdateTime(new Date()); |
| | | if (!orderService.updateById(order)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(order); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:remove')") |
| | | @OperationLog("Delete 综合订单管理") |
| | | @PostMapping("/order/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!orderService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:order:list')") |
| | | @PostMapping("/order/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Order::getId, condition); |
| | | } |
| | | orderService.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:order:list')") |
| | | @PostMapping("/order/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(orderService.list(), Order.class), response); |
| | | } |
| | | |
| | | } |
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.OrderItem; |
| | | import com.vincent.rsf.server.manager.service.OrderItemService; |
| | | 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 OrderItemController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderItemService orderItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:list')") |
| | | @PostMapping("/orderItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<OrderItem, BaseParam> pageParam = new PageParam<>(baseParam, OrderItem.class); |
| | | return R.ok().add(orderItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:list')") |
| | | @PostMapping("/orderItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(orderItemService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:list')") |
| | | @PostMapping({"/orderItem/many/{ids}", "/orderItems/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(orderItemService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:list')") |
| | | @GetMapping("/orderItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(orderItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:save')") |
| | | @OperationLog("Create 综合订单明细管理") |
| | | @PostMapping("/orderItem/save") |
| | | public R save(@RequestBody OrderItem orderItem) { |
| | | orderItem.setCreateBy(getLoginUserId()); |
| | | orderItem.setCreateTime(new Date()); |
| | | orderItem.setUpdateBy(getLoginUserId()); |
| | | orderItem.setUpdateTime(new Date()); |
| | | if (!orderItemService.save(orderItem)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(orderItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:update')") |
| | | @OperationLog("Update 综合订单明细管理") |
| | | @PostMapping("/orderItem/update") |
| | | public R update(@RequestBody OrderItem orderItem) { |
| | | orderItem.setUpdateBy(getLoginUserId()); |
| | | orderItem.setUpdateTime(new Date()); |
| | | if (!orderItemService.updateById(orderItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(orderItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:remove')") |
| | | @OperationLog("Delete 综合订单明细管理") |
| | | @PostMapping("/orderItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!orderItemService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:orderItem:list')") |
| | | @PostMapping("/orderItem/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<OrderItem> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(OrderItem::getId, condition); |
| | | } |
| | | orderItemService.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:orderItem:list')") |
| | | @PostMapping("/orderItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(orderItemService.list(), OrderItem.class), response); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.controller.params.GenerateTaskParams; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("生成任务列表") |
| | | @PostMapping("/waitPakin/merge") |
| | | public R generateTask(@RequestBody List<WaitPakin> waitPakin) { |
| | | if (Objects.isNull(waitPakin) || waitPakin.isEmpty()) { |
| | | public R generateTask(@RequestBody GenerateTaskParams taskParams) { |
| | | if (Objects.isNull(taskParams)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return taskService.generateTasks(waitPakin, getLoginUserId()); |
| | | if (Objects.isNull(taskParams.getWaitPakins()) || taskParams.getWaitPakins().isEmpty()) { |
| | | throw new CoolException("组拖档不能为空!!"); |
| | | } |
| | | return taskService.generateTasks(taskParams, getLoginUserId()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.controller.params; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title GenerateTaskParams |
| | | * @description |
| | | * @create 2025/4/15 09:54 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "GenerateTaskParams", description = "生成任务参数") |
| | | public class GenerateTaskParams implements Serializable { |
| | | |
| | | @ApiModelProperty("组拖档") |
| | | public List<WaitPakin> waitPakins; |
| | | |
| | | @ApiModelProperty("站点ID") |
| | | public Long siteId; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | 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 |
| | | @Accessors(chain = true) |
| | | @TableName("man_loc_item") |
| | | public class LocItem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 主单ID |
| | | */ |
| | | @ApiModelProperty(value= "主单ID") |
| | | private Long locId; |
| | | |
| | | /** |
| | | * 单据ID |
| | | */ |
| | | @ApiModelProperty(value= "单据ID") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 单据类型 |
| | | */ |
| | | @ApiModelProperty(value= "单据类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * 订单明细id |
| | | */ |
| | | @ApiModelProperty(value= "订单明细id") |
| | | private Long orderItemId; |
| | | |
| | | /** |
| | | * 业务类型 |
| | | */ |
| | | @ApiModelProperty(value= "业务类型") |
| | | private Short wkType; |
| | | |
| | | /** |
| | | * 物料ID |
| | | */ |
| | | @ApiModelProperty(value= "物料ID") |
| | | private Long matnrId; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnrCode; |
| | | |
| | | /** |
| | | * 物料跟踪码 |
| | | */ |
| | | @ApiModelProperty(value= "物料跟踪码") |
| | | private String trackCode; |
| | | |
| | | /** |
| | | * 库存单位 |
| | | */ |
| | | @ApiModelProperty(value= "库存单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | @ApiModelProperty("执行数量") |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 库存批次 |
| | | */ |
| | | @ApiModelProperty(value= "库存批次") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBatch; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String spec; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 字段索引 |
| | | */ |
| | | @ApiModelProperty(value= "字段索引") |
| | | private String fieldsIndex; |
| | | |
| | | /** |
| | | * 状态 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 LocItem() {} |
| | | |
| | | public LocItem(Long locId,Long orderId,String type,Long orderItemId,Short wkType,Long matnrId,String maktx,String matnrCode,String trackCode,String unit,Double anfme,String batch,String splrBatch,String spec,String model,String fieldsIndex,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.locId = locId; |
| | | this.orderId = orderId; |
| | | this.type = type; |
| | | this.orderItemId = orderItemId; |
| | | this.wkType = wkType; |
| | | this.matnrId = matnrId; |
| | | this.maktx = maktx; |
| | | this.matnrCode = matnrCode; |
| | | this.trackCode = trackCode; |
| | | this.unit = unit; |
| | | this.anfme = anfme; |
| | | this.batch = batch; |
| | | this.splrBatch = splrBatch; |
| | | this.spec = spec; |
| | | this.model = model; |
| | | this.fieldsIndex = fieldsIndex; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // LocItem locItem = new LocItem( |
| | | // null, // 主单ID |
| | | // null, // 单据ID |
| | | // null, // 单据类型 |
| | | // null, // 订单明细id |
| | | // null, // 业务类型 |
| | | // null, // 物料ID |
| | | // null, // 物料名称 |
| | | // null, // 物料编码 |
| | | // null, // 物料跟踪码 |
| | | // null, // 库存单位 |
| | | // null, // 数量 |
| | | // null, // 库存批次 |
| | | // null, // 供应商批次 |
| | | // 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value= "名称") |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 编码 |
| | | */ |
| | | @ApiModelProperty(value= "编码") |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String code; |
| | | |
| | | /** |
| | | * 货主ID |
| | | */ |
| | | @ApiModelProperty(value= "货主ID") |
| | | @ApiModelProperty(value= "货主标识") |
| | | private Long shipperId; |
| | | |
| | | // @ApiModelProperty(value = "货主编码") |
| | |
| | | /** |
| | | * 分组ID(*) |
| | | */ |
| | | @ApiModelProperty(value= "分组ID(*)") |
| | | @ApiModelProperty(value= "物料分组(*)") |
| | | private Long groupId; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 规则代码 |
| | | */ |
| | | @ApiModelProperty(value= "规则代码") |
| | | @ApiModelProperty(value= "批次规则标识") |
| | | private Long rglarId; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 长*宽*高(m) |
| | | */ |
| | | @ApiModelProperty(value= "长*宽*高(m)") |
| | | @ApiModelProperty(value= "尺寸(m)") |
| | | private String size; |
| | | |
| | | /** |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | 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 |
| | | @Accessors(chain = true) |
| | | @TableName("man_order") |
| | | public class Order 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 code; |
| | | |
| | | /** |
| | | * 源单据编码 |
| | | */ |
| | | @ApiModelProperty(value= "源单据编码") |
| | | private String sourceCode; |
| | | |
| | | /** |
| | | * 源单据ID |
| | | */ |
| | | @ApiModelProperty(value= "源单据ID") |
| | | private Long sourceId; |
| | | |
| | | /** |
| | | * 单据类型 |
| | | */ |
| | | @ApiModelProperty(value= "单据类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * 业务类型 |
| | | */ |
| | | @ApiModelProperty(value= "业务类型") |
| | | private String wkType; |
| | | |
| | | /** |
| | | * 库存数量 |
| | | */ |
| | | @ApiModelProperty(value= "库存数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 状态 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 Order() {} |
| | | |
| | | public Order(String code,String sourceCode,Long sourceId,String type,String wkType,Double anfme,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.code = code; |
| | | this.sourceCode = sourceCode; |
| | | this.sourceId = sourceId; |
| | | this.type = type; |
| | | this.wkType = wkType; |
| | | this.anfme = anfme; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Order order = new Order( |
| | | // null, // 编号 |
| | | // null, // 源单据编码 |
| | | // null, // 源单据ID |
| | | // 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; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | 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 |
| | | @Accessors(chain = true) |
| | | @TableName("man_order_item") |
| | | public class OrderItem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 主单ID |
| | | */ |
| | | @ApiModelProperty(value= "主单ID") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 主单编号 |
| | | */ |
| | | @ApiModelProperty(value= "主单编号") |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private String sourceItemId; |
| | | |
| | | /** |
| | | * 物料ID |
| | | */ |
| | | @ApiModelProperty(value= "物料ID") |
| | | private String matnrId; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnrCode; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 送货数量 |
| | | */ |
| | | @ApiModelProperty(value= "送货数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 库存单位 |
| | | */ |
| | | @ApiModelProperty(value= "库存单位") |
| | | private String stockUnit; |
| | | |
| | | /** |
| | | * 执行中数量 |
| | | */ |
| | | @ApiModelProperty(value= "执行中数量") |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 采购数量 |
| | | */ |
| | | @ApiModelProperty(value= "采购数量") |
| | | private Double purQty; |
| | | |
| | | /** |
| | | * 采购单位 |
| | | */ |
| | | @ApiModelProperty(value= "采购单位") |
| | | private String purUnit; |
| | | |
| | | /** |
| | | * 已收数量 |
| | | */ |
| | | @ApiModelProperty(value= "已收数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | private String splrCode; |
| | | |
| | | /** |
| | | * 库存批次 |
| | | */ |
| | | @ApiModelProperty(value= "库存批次") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBatch; |
| | | |
| | | /** |
| | | * 供应商名称 |
| | | */ |
| | | @ApiModelProperty(value= "供应商名称") |
| | | private String splrName; |
| | | |
| | | /** |
| | | * 跟踪码 |
| | | */ |
| | | @ApiModelProperty(value= "跟踪码") |
| | | private String trackCode; |
| | | |
| | | /** |
| | | * 条形码 |
| | | */ |
| | | @ApiModelProperty(value= "条形码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | private String prodTime; |
| | | |
| | | /** |
| | | * 包装名称 |
| | | */ |
| | | @ApiModelProperty(value= "包装名称") |
| | | private String packName; |
| | | |
| | | /** |
| | | * 状态 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 OrderItem() {} |
| | | |
| | | public OrderItem(Long orderId,String orderCode,String sourceItemId,String matnrId,String matnrCode,String maktx,Double anfme,String stockUnit,Double workQty,Double purQty,String purUnit,Double qty,String splrCode,String batch,String splrBatch,String splrName,String trackCode,String barcode,String prodTime,String packName,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.orderId = orderId; |
| | | this.orderCode = orderCode; |
| | | this.sourceItemId = sourceItemId; |
| | | this.matnrId = matnrId; |
| | | this.matnrCode = matnrCode; |
| | | this.maktx = maktx; |
| | | this.anfme = anfme; |
| | | this.stockUnit = stockUnit; |
| | | this.workQty = workQty; |
| | | this.purQty = purQty; |
| | | this.purUnit = purUnit; |
| | | this.qty = qty; |
| | | this.splrCode = splrCode; |
| | | this.batch = batch; |
| | | this.splrBatch = splrBatch; |
| | | this.splrName = splrName; |
| | | this.trackCode = trackCode; |
| | | this.barcode = barcode; |
| | | this.prodTime = prodTime; |
| | | this.packName = packName; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // OrderItem orderItem = new OrderItem( |
| | | // null, // 主单ID |
| | | // null, // 主单编号 |
| | | // null, // 编号 |
| | | // null, // 物料ID |
| | | // null, // 物料编码 |
| | | // null, // 物料名称 |
| | | // null, // 送货数量[非空] |
| | | // null, // 库存单位 |
| | | // null, // 执行中数量[非空] |
| | | // null, // 采购数量[非空] |
| | | // null, // 采购单位 |
| | | // null, // 已收数量 |
| | | // null, // 供应商编码 |
| | | // null, // 库存批次 |
| | | // null, // 供应商批次 |
| | | // null, // 供应商名称 |
| | | // null, // 跟踪码 |
| | | // 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @Accessors(chain = true) |
| | | @TableName("man_stock") |
| | | public class Stock implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * ASN单据, 带出PO单 |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "ASN单据, 带出PO单") |
| | | private Long asnId; |
| | | @ApiModelProperty("订单编码") |
| | | private String asnCode; |
| | | @ApiModelProperty(value= "编号") |
| | | private String code; |
| | | |
| | | /** |
| | | * ERP凭证 |
| | | * 源单据编码 |
| | | */ |
| | | @ApiModelProperty(value= "plat凭证") |
| | | private String platToken; |
| | | @ApiModelProperty(value= "源单据编码") |
| | | private String sourceCode; |
| | | |
| | | /** |
| | | * plat单号 |
| | | * 源单据ID |
| | | */ |
| | | @ApiModelProperty(value= "plat单号") |
| | | private String platOrderNo; |
| | | @ApiModelProperty(value= "源单据ID") |
| | | private Long sourceId; |
| | | |
| | | /** |
| | | * plat库存地址 |
| | | * 单据类型 |
| | | */ |
| | | @ApiModelProperty(value= "plat库存地址") |
| | | private String platStkAdr; |
| | | @ApiModelProperty(value= "单据类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * 合同标识 |
| | | * 业务类型 |
| | | */ |
| | | @ApiModelProperty(value= "合同标识") |
| | | private String contractId; |
| | | @ApiModelProperty(value= "业务类型") |
| | | private Short wkType; |
| | | |
| | | /** |
| | | * 锁定原因 |
| | | * 库存数量 |
| | | */ |
| | | @ApiModelProperty(value= "锁定原因") |
| | | private String lockReason; |
| | | |
| | | /** |
| | | * 锁定状态 |
| | | */ |
| | | @ApiModelProperty(value= "锁定状态") |
| | | private Short lockStatus; |
| | | |
| | | /** |
| | | * 锁定人 |
| | | */ |
| | | @ApiModelProperty(value= "锁定人") |
| | | private String locker; |
| | | |
| | | /** |
| | | * 锁定时间 |
| | | */ |
| | | @ApiModelProperty(value= "锁定时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date lockedTime; |
| | | @ApiModelProperty(value= "库存数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | |
| | | |
| | | public Stock() {} |
| | | |
| | | public Stock(String asnOrder,String platToken,String platOrder,String platStkAdr,String contractId,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.platOrderNo = asnOrder; |
| | | this.platToken = platToken; |
| | | this.platOrderNo = platOrder; |
| | | this.platStkAdr = platStkAdr; |
| | | this.contractId = contractId; |
| | | this.lockReason = lockReason; |
| | | this.lockStatus = lockStatus; |
| | | this.locker = locker; |
| | | this.lockedTime = lockedTime; |
| | | public Stock(String code,String sourceCode,Long sourceId,String type,Short wkType,Double anfme,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.code = code; |
| | | this.sourceCode = sourceCode; |
| | | this.sourceId = sourceId; |
| | | this.type = type; |
| | | this.wkType = wkType; |
| | | this.anfme = anfme; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getLockedTime$(){ |
| | | if (Cools.isEmpty(this.lockedTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime); |
| | | } |
| | | // public String getLockedTime$(){ |
| | | // if (Cools.isEmpty(this.lockedTime)){ |
| | | // return ""; |
| | | // } |
| | | // return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime); |
| | | // } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任务明细ID |
| | | * 主单ID |
| | | */ |
| | | @ApiModelProperty("任务明细ID") |
| | | private Long taskItemId; |
| | | |
| | | /** |
| | | * 库存外键标识 |
| | | */ |
| | | @ApiModelProperty(value= "库存外键标识") |
| | | @ApiModelProperty(value= "主单ID") |
| | | private Long stockId; |
| | | |
| | | /** |
| | | * 物料标识 |
| | | * 主单编号 |
| | | */ |
| | | @ApiModelProperty(value= "物料标识") |
| | | @ApiModelProperty(value= "主单编号") |
| | | private String stockCode; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "明细ID") |
| | | private Long sourceItemId; |
| | | |
| | | /** |
| | | * 物料ID |
| | | */ |
| | | @ApiModelProperty(value= "物料ID") |
| | | private Long matnrId; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnrCode; |
| | | |
| | | |
| | | @ApiModelProperty(value = "通知单明细标识") |
| | | private Long asnItemId; |
| | | |
| | | /** |
| | | * 名称 |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "名称") |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 数量 |
| | | * 送货数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value= "送货数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 库存单位 |
| | | */ |
| | | @ApiModelProperty(value= "库存单位") |
| | | private String stockUnit; |
| | | |
| | | /** |
| | | * 执行中数量 |
| | |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 完成数量 |
| | | * 采购数量 |
| | | */ |
| | | @ApiModelProperty(value= "完成数量") |
| | | @ApiModelProperty(value= "采购数量") |
| | | private Double purQty; |
| | | |
| | | /** |
| | | * 采购单位 |
| | | */ |
| | | @ApiModelProperty(value= "采购单位") |
| | | private String purUnit; |
| | | |
| | | /** |
| | | * 已收数量 |
| | | */ |
| | | @ApiModelProperty(value= "已收数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 收货重量 |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "收货重量") |
| | | private Double weight; |
| | | @ApiModelProperty(value= "供应商编码") |
| | | private String splrCode; |
| | | |
| | | /** |
| | | * 单位 |
| | | * 库存批次 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 货主标识 |
| | | */ |
| | | @ApiModelProperty(value= "货主标识") |
| | | private Long shipperId; |
| | | |
| | | /** |
| | | * 供应商标识 |
| | | */ |
| | | @ApiModelProperty(value= "供应商标识") |
| | | private String splrId; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 批次 |
| | | */ |
| | | @ApiModelProperty(value= "批次") |
| | | @ApiModelProperty(value= "库存批次") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBatch; |
| | | |
| | | /** |
| | | * 供应商名称 |
| | | */ |
| | | @ApiModelProperty(value= "供应商名称") |
| | | private String splrName; |
| | | |
| | | /** |
| | | * 跟踪码 |
| | | */ |
| | | @ApiModelProperty(value= "跟踪码") |
| | | private String trackCode; |
| | | |
| | | /** |
| | | * 条形码 |
| | | */ |
| | | @ApiModelProperty(value= "条形码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 生产日期 |
| | |
| | | private String prodTime; |
| | | |
| | | /** |
| | | * 质检标识 |
| | | * 包装名称 |
| | | */ |
| | | @ApiModelProperty(value= "质检标识") |
| | | private Long inspectId; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBtch; |
| | | |
| | | /** |
| | | * ASN单据,带出PO单 |
| | | */ |
| | | @ApiModelProperty(value= "ASN单据,带出PO单") |
| | | @TableField(exist = false) |
| | | private String asnOrder; |
| | | |
| | | /** |
| | | * ERP凭证 |
| | | */ |
| | | @ApiModelProperty(value= "ERP凭证") |
| | | @TableField(exist = false) |
| | | private String erpToken; |
| | | |
| | | /** |
| | | * ERP单号 |
| | | */ |
| | | @ApiModelProperty(value= "ERP单号") |
| | | @TableField(exist = false) |
| | | private String erpOrder; |
| | | |
| | | /** |
| | | * ERP库存地址 |
| | | */ |
| | | @ApiModelProperty(value= "ERP库存地址") |
| | | @TableField(exist = false) |
| | | private String erpStkAdr; |
| | | |
| | | /** |
| | | * 库位标识 |
| | | */ |
| | | @ApiModelProperty(value= "库位标识") |
| | | private Long locId; |
| | | |
| | | /** |
| | | * 容器编码 |
| | | */ |
| | | @ApiModelProperty(value= "容器编码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 采购单位 |
| | | */ |
| | | @ApiModelProperty(value= "采购单位") |
| | | private Double purPrice; |
| | | |
| | | /** |
| | | * 锁定原因 |
| | | */ |
| | | @ApiModelProperty(value= "锁定原因") |
| | | private String lockReason; |
| | | |
| | | /** |
| | | * 锁定状态 |
| | | */ |
| | | @ApiModelProperty(value= "锁定状态") |
| | | private Short lockStatus; |
| | | |
| | | /** |
| | | * 锁定人 |
| | | */ |
| | | @ApiModelProperty(value= "锁定人") |
| | | private String locker; |
| | | |
| | | /** |
| | | * 锁定时间 |
| | | */ |
| | | @ApiModelProperty(value= "锁定时间") |
| | | private Date lockedTime; |
| | | @ApiModelProperty(value= "包装名称") |
| | | private String packName; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | |
| | | |
| | | public StockItem() {} |
| | | |
| | | public StockItem(Long stockId,Long matnrId,Long asnItemId, String code,String matnrk,Double anfme,Double workQty,Double qty,Double weight,String unit,Long shipperId,String splrId,String brand,String batch,String prodTime,Long inspectId,String splrBtch,String asnOrder,String erpToken,String erpOrder,String erpStkAdr,Long locId,String barcode,Double purPrice,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.stockId = stockId; |
| | | public StockItem(Long orderId,String orderCode,Long sourceItemId,Long matnrId,String matnrCode,String maktx,Double anfme,String stockUnit,Double workQty,Double purQty,String purUnit,Double qty,String splrCode,String batch,String splrBatch,String splrName,String trackCode,String barcode,String prodTime,String packName,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.stockId = orderId; |
| | | this.stockCode = orderCode; |
| | | this.sourceItemId = sourceItemId; |
| | | this.matnrId = matnrId; |
| | | this.asnItemId = asnItemId; |
| | | this.matnrCode = code; |
| | | this.maktx = matnrk; |
| | | this.matnrCode = matnrCode; |
| | | this.maktx = maktx; |
| | | this.anfme = anfme; |
| | | this.stockUnit = stockUnit; |
| | | this.workQty = workQty; |
| | | this.purQty = purQty; |
| | | this.purUnit = purUnit; |
| | | this.qty = qty; |
| | | this.weight = weight; |
| | | this.unit = unit; |
| | | this.shipperId = shipperId; |
| | | this.splrId = splrId; |
| | | this.brand = brand; |
| | | this.splrCode = splrCode; |
| | | this.batch = batch; |
| | | this.prodTime = prodTime; |
| | | this.inspectId = inspectId; |
| | | this.splrBtch = splrBtch; |
| | | this.asnOrder = asnOrder; |
| | | this.erpToken = erpToken; |
| | | this.erpOrder = erpOrder; |
| | | this.erpStkAdr = erpStkAdr; |
| | | this.locId = locId; |
| | | this.splrBatch = splrBatch; |
| | | this.splrName = splrName; |
| | | this.trackCode = trackCode; |
| | | this.barcode = barcode; |
| | | this.purPrice = purPrice; |
| | | this.lockReason = lockReason; |
| | | this.lockStatus = lockStatus; |
| | | this.locker = locker; |
| | | this.lockedTime = lockedTime; |
| | | this.prodTime = prodTime; |
| | | this.packName = packName; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getStockId$(){ |
| | | StockService service = SpringUtils.getBean(StockService.class); |
| | | Stock stock = service.getById(this.stockId); |
| | | if (!Cools.isEmpty(stock)){ |
| | | return String.valueOf(stock.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | // public String getStockId$(){ |
| | | // StockService service = SpringUtils.getBean(StockService.class); |
| | | // Stock stock = service.getById(this.stockId); |
| | | // if (!Cools.isEmpty(stock)){ |
| | | // return String.valueOf(stock.getId()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | |
| | | public String getMatnrId$(){ |
| | | MatnrService service = SpringUtils.getBean(MatnrService.class); |
| | |
| | | return null; |
| | | } |
| | | |
| | | public String getShipperId$(){ |
| | | CompanysService service = SpringUtils.getBean(CompanysService.class); |
| | | Companys shipper = service.getById(this.shipperId); |
| | | if (!Cools.isEmpty(shipper)){ |
| | | return String.valueOf(shipper.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | // public String getShipperId$(){ |
| | | // CompanysService service = SpringUtils.getBean(CompanysService.class); |
| | | // Companys shipper = service.getById(this.shipperId); |
| | | // if (!Cools.isEmpty(shipper)){ |
| | | // return String.valueOf(shipper.getName()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | |
| | | // public String getSplrId$(){ |
| | | // SupplierService service = SpringUtils.getBean(SupplierService.class); |
| | |
| | | // return null; |
| | | // } |
| | | // |
| | | public String getInspectId$(){ |
| | | QlyInspectService service = SpringUtils.getBean(QlyInspectService.class); |
| | | QlyInspect qlyInspect = service.getById(this.inspectId); |
| | | if (!Cools.isEmpty(qlyInspect)){ |
| | | return String.valueOf(qlyInspect.getCode()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getLocId$(){ |
| | | LocService service = SpringUtils.getBean(LocService.class); |
| | | Loc loc = service.getById(this.locId); |
| | | if (!Cools.isEmpty(loc)){ |
| | | return String.valueOf(loc.getCode()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getLockedTime$(){ |
| | | if (Cools.isEmpty(this.lockedTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime); |
| | | } |
| | | // public String getInspectId$(){ |
| | | // QlyInspectService service = SpringUtils.getBean(QlyInspectService.class); |
| | | // QlyInspect qlyInspect = service.getById(this.inspectId); |
| | | // if (!Cools.isEmpty(qlyInspect)){ |
| | | // return String.valueOf(qlyInspect.getCode()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | // |
| | | // public String getLocId$(){ |
| | | // LocService service = SpringUtils.getBean(LocService.class); |
| | | // Loc loc = service.getById(this.locId); |
| | | // if (!Cools.isEmpty(loc)){ |
| | | // return String.valueOf(loc.getCode()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | // |
| | | // public String getLockedTime$(){ |
| | | // if (Cools.isEmpty(this.lockedTime)){ |
| | | // return ""; |
| | | // } |
| | | // return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime); |
| | | // } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | |
| | | @ApiModelProperty("单据类型") |
| | | private String orderType; |
| | | |
| | | @ApiModelProperty("业务类型") |
| | | private Short wkType; |
| | | |
| | | @ApiModelProperty("单据明细ID") |
| | | private Long orderItemId; |
| | | /** |
| | |
| | | private String name; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类助记码*") |
| | | @ExcelComment(example = "256874556") |
| | | private String groupCode; |
| | | @Excel(name = "物料编码*") |
| | | @ExcelComment(example = "matnr123") |
| | | private String code; |
| | | |
| | | |
| | | @Excel(name = "货主标识") |
| | | @ExcelComment(example = "123") |
| | | private Long shipperId; |
| | | |
| | | |
| | | |
| | | @NotNull |
| | | @Excel(name = "物料分组") |
| | | @ExcelComment(example = "手机") |
| | | private Long groupId; |
| | | |
| | | |
| | | @Excel(name = "ERP编码") |
| | | @ExcelComment(example = "erp001") |
| | | private String platCode; |
| | | |
| | | @NotNull |
| | | @Excel(name = "规格") |
| | | @ExcelComment(example = "HW-148*68*10") |
| | | private String spec; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类名称*") |
| | |
| | | @Excel(name = "物料助记码*") |
| | | @ExcelComment(example = "P3528461569") |
| | | private String erpCode; |
| | | |
| | | @NotNull |
| | | @Excel(name = "规格") |
| | | @ExcelComment(example = "HW-148*68*10") |
| | | private String spec; |
| | | |
| | | @NotNull |
| | | @Excel(name = "型号") |
| | |
| | | @ExcelComment(notNull = false, example = "紫红色") |
| | | private String color; |
| | | |
| | | @Excel(name = "大小") |
| | | @Excel(name = "尺寸") |
| | | @ExcelComment(notNull = false, example = "148*68*10") |
| | | private String size; |
| | | |
| | |
| | | @ExcelComment(notNull = false, example = "新上市三折叠") |
| | | private String describle; |
| | | |
| | | @Excel(name = "描述") |
| | | @Excel(name = "标包数量") |
| | | @ExcelComment(notNull = false, example = "新上市三折叠") |
| | | private String nromNum; |
| | | |
| | | @NotNull |
| | | @Excel(name = "主单位") |
| | | @Excel(name = "单位") |
| | | @ExcelComment(example = "部") |
| | | private String unit; |
| | | |
| | |
| | | @ExcelComment(example = "部") |
| | | private String purUnit; |
| | | |
| | | @Excel(name = "库位单位") |
| | | @ExcelComment(example = "部") |
| | | private String stockUnit; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类助记码*") |
| | | @ExcelComment(example = "256874556") |
| | | private String groupCode; |
| | | |
| | | @Excel(name = "ABC类") |
| | | @ExcelComment(notNull = false, example = "0") |
| | | private String stockLevel; |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocItemMapper extends BaseMapper<LocItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.OrderItem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OrderItemMapper extends BaseMapper<OrderItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.Order; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | } |
| | |
| | | * @return |
| | | * @time 2025/3/29 12:36 |
| | | */ |
| | | // @Scheduled(cron = "0 0/05 * * * ? ") |
| | | @Scheduled(cron = "0/25 * * * * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void pakinLog() { |
| | |
| | | private StockService stockService; |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderItemService orderItemService; |
| | | /** |
| | | * @author Ryan |
| | | * @description 完成入库,更新库存 |
| | |
| | | if (taskItems.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | List<TaskLog> taskLogs = new ArrayList<>(); |
| | | tasks.forEach(task -> { |
| | | TaskLog taskLog = new TaskLog(); |
| | |
| | | throw new CoolException("任务历史档保存失败!!"); |
| | | } |
| | | List<TaskItemLog >itemLogs = new ArrayList<>(); |
| | | |
| | | taskItems.forEach(item -> { |
| | | TaskItemLog itemLog = new TaskItemLog(); |
| | | BeanUtils.copyProperties(item, itemLog); |
| | | itemLog.setId(null).setTaskItemId(item.getId()); |
| | | itemLogs.add(itemLog); |
| | | }); |
| | | |
| | | if (!taskItemLogService.saveBatch(itemLogs)) { |
| | | throw new CoolException("任务明细历史档保存失败!!"); |
| | | } |
| | | |
| | | if (!taskService.removeByIds(list)) { |
| | | throw new CoolException("原始任务删除失败!!"); |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | |
| | | public interface LocItemService extends IService<LocItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.OrderItem; |
| | | |
| | | public interface OrderItemService extends IService<OrderItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.Order; |
| | | |
| | | public interface OrderService extends IService<Order> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.Task; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TaskService extends IService<Task> { |
| | | |
| | | R generateTasks(List<WaitPakin> waitPakin, Long loginUserId); |
| | | R generateTasks(GenerateTaskParams waitPakin, Long loginUserId); |
| | | |
| | | // R completeTask(String id); |
| | | |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.service.LocItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("locItemService") |
| | | public class LocItemServiceImpl extends ServiceImpl<LocItemMapper, LocItem> implements LocItemService { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.OrderItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.OrderItem; |
| | | import com.vincent.rsf.server.manager.service.OrderItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("orderItemService") |
| | | public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.OrderMapper; |
| | | import com.vincent.rsf.server.manager.entity.Order; |
| | | import com.vincent.rsf.server.manager.service.OrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("orderService") |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { |
| | | |
| | | } |
| | |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | } |
| | | if (Double.compare(safeQty, inspect.getDlyQty()) == 0) { |
| | | inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | // inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val); |
| | | } |
| | | if (!qlyInspectService.updateById(inspect)) { |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.entity.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | |
| | | private StockService stockService; |
| | | @Autowired |
| | | private StockItemService stockItemService; |
| | | @Autowired |
| | | private DeviceSiteService deviceSiteService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderItemService orderItemService; |
| | | |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized R generateTasks(List<WaitPakin> waitPakin, Long loginUserId) { |
| | | if (Objects.isNull(waitPakin) || waitPakin.isEmpty()) { |
| | | public synchronized R generateTasks(GenerateTaskParams waitPakin, Long loginUserId) { |
| | | if (Objects.isNull(waitPakin) || waitPakin.getWaitPakins().isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | |
| | | DeviceSite deviceSite = deviceSiteService.getById(waitPakin.getSiteId()); |
| | | if (Objects.isNull(deviceSite)) { |
| | | throw new CoolException("站点不存在!!"); |
| | | } |
| | | /**获取组拖*/ |
| | | List<Long> ids = waitPakin.stream().map(WaitPakin::getId).collect(Collectors.toList()); |
| | | List<Long> ids = waitPakin.getWaitPakins().stream().map(WaitPakin::getId).collect(Collectors.toList()); |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>() |
| | | .in(WaitPakin::getId, ids) |
| | | .eq(WaitPakin::getIoStatus, Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val))); |
| | |
| | | .setTaskType(TaskType.TASK_TYPE_IN.type.shortValue()) |
| | | .setTargLoc(LocManageUtil.getTargetLoc()) |
| | | .setBarcode(pakin.getBarcode()) |
| | | .setTargSite(deviceSite.getDeviceCode()) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setTargSite(LocManageUtil.getTargetSite()); |
| | | |
| | | if (!this.save(task)) { |
| | | throw new CoolException("任务保存失败!!"); |
| | | } |
| | |
| | | waitPakinItems.forEach(item -> { |
| | | TaskItem taskItem = new TaskItem(); |
| | | BeanUtils.copyProperties(item, taskItem); |
| | | AsnOrder order = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getId, item.getAsnId())); |
| | | if (Objects.isNull(order)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | taskItem.setTaskId(task.getId()) |
| | | .setOrderType(OrderType.ORDER_RECEIPT.type) |
| | | .setWkType(Short.parseShort(order.getWkType())) |
| | | .setSource(item.getId()) |
| | | .setTrackCode(item.getTrackCode()) |
| | | .setCreateBy(loginUserId) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 完成任务 |
| | | * 完成任务 更新库位明细信息,将单据库存更新到单据库存表 |
| | | * @param tasks |
| | | * @throws Exception |
| | | */ |
| | |
| | | List<Long> list = tasks.stream().map(Task::getId).collect(Collectors.toList()); |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, list)); |
| | | if (taskItems.isEmpty()) { |
| | | throw new CoolException("任务明细不能为空!!"); |
| | | throw new CoolException("任务明细不存在!!"); |
| | | } |
| | | List<String> locCodes = tasks.stream().map(Task::getTargLoc).collect(Collectors.toList()); |
| | | Map<Long, List<TaskItem>> listMap = taskItems.stream().collect(Collectors.groupingBy(TaskItem::getTaskId)); |
| | | /**对任务明细按任务主单进行分组*/ |
| | | listMap.keySet().forEach(key -> { |
| | | List<TaskItem> items = listMap.get(key); |
| | | //更新库位明细 |
| | | try { |
| | | saveLocItem(items, key); |
| | | } catch (Exception e) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | }); |
| | | |
| | | /**对任务明细按订单进行分组*/ |
| | | Map<Long, List<TaskItem>> orderMap = taskItems.stream().collect(Collectors.groupingBy(TaskItem::getOrderId)); |
| | | List<StockItem> stockItems = new ArrayList<>(); |
| | | orderMap.keySet().forEach(key -> { |
| | | AsnOrder order = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>() |
| | | .eq(AsnOrder::getId, key) |
| | | .select(AsnOrder::getId, AsnOrder::getPoCode, AsnOrder::getCode)); |
| | | Stock stock = new Stock(); |
| | | if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |
| | | if (!Objects.isNull(purchase)) { |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | } |
| | | } |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("当前业务:" + SerialRuleCode.SYS_STOCK_CODE + ",编码规则不存在!!"); |
| | | } |
| | | stock.setAsnId(order.getId()).setAsnCode(order.getCode()); |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | | } |
| | | List<TaskItem> items = orderMap.get(key); |
| | | for (TaskItem item : items) { |
| | | /**通过任务明细中的taskId查询,获取TASK的目标库位信息*/ |
| | | Task taskServiceOne = this.getOne(new LambdaQueryWrapper<Task>() |
| | | .select(Task::getId, Task::getTargLoc, Task::getOrgLoc, Task::getBarcode) |
| | | .eq(Task::getId, item.getTaskId())); |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, taskServiceOne.getTargLoc())); |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("库位不存在!!"); |
| | | } |
| | | AsnOrderItem orderItem = asnOrderItemService.getOne(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getId, item.getOrderItemId())); |
| | | if (Objects.isNull(orderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | StockItem stockItem = new StockItem(); |
| | | BeanUtils.copyProperties(orderItem, stockItem); |
| | | stockItem.setAsnItemId(item.getOrderItemId()) |
| | | .setBarcode(taskServiceOne.getBarcode()) |
| | | .setLocId(loc.getId()) |
| | | .setId(null) |
| | | .setStockId(stock.getId()); |
| | | stockItems.add(stockItem); |
| | | } |
| | | if (!stockItemService.saveBatch(stockItems)) { |
| | | throw new CoolException("库存修改架失败!!"); |
| | | //保存库存明细 |
| | | try { |
| | | saveStockItems(items, order); |
| | | } catch (Exception e) { |
| | | throw new CoolException("库存管理保存更新失败!!"); |
| | | } |
| | | }); |
| | | /**修改库位状态为F.在库*/ |
| | | List<String> locCodes = tasks.stream().map(Task::getTargLoc).collect(Collectors.toList()); |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type).in(Loc::getCode, locCodes))) { |
| | | throw new CoolException("库位状态修改失败!!"); |
| | | } |
| | |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 更新库位明细 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/15 15:28 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void saveLocItem(List<TaskItem> items, Long taskId) throws Exception { |
| | | Task task = this.getById(taskId); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("任务不存在!!"); |
| | | } |
| | | List<LocItem> locItems = new ArrayList<>(); |
| | | items.forEach(taskItem -> { |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc())); |
| | | LocItem item = new LocItem(); |
| | | BeanUtils.copyProperties(taskItem, item); |
| | | item.setLocId(loc.getId()).setType(taskItem.getOrderType()); |
| | | locItems.add(item); |
| | | }); |
| | | if (!locItemService.saveBatch(locItems)) { |
| | | throw new CoolException("库位明细更新失败!!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成库存明细 |
| | | * @param items |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void saveStockItems(List<TaskItem> items, AsnOrder order) throws Exception { |
| | | Stock stock = new Stock(); |
| | | // if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | // Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |
| | | // if (!Objects.isNull(purchase)) { |
| | | // stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | // } |
| | | // } |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("当前业务:" + SerialRuleCode.SYS_STOCK_CODE + ",编码规则不存在!!"); |
| | | } |
| | | stock.setSourceId(order.getId()).setSourceCode(order.getCode()); |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | | } |
| | | |
| | | List<StockItem> stockItems = new ArrayList<>(); |
| | | for (TaskItem item : items) { |
| | | /**通过任务明细中的taskId查询,获取TASK的目标库位信息*/ |
| | | AsnOrderItem orderItem = asnOrderItemService.getOne(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getId, item.getOrderItemId())); |
| | | if (Objects.isNull(orderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | StockItem stockItem = new StockItem(); |
| | | BeanUtils.copyProperties(orderItem, stockItem); |
| | | stockItem.setSourceItemId(item.getOrderItemId()) |
| | | .setStockCode(stock.getCode()) |
| | | .setSourceItemId(orderItem.getId()) |
| | | .setId(null) |
| | | .setStockId(stock.getId()); |
| | | stockItems.add(stockItem); |
| | | } |
| | | if (!stockItemService.saveBatch(stockItems)) { |
| | | throw new CoolException("库存修改架失败!!"); |
| | | } |
| | | } |
| | | |
| | | // public void generateOrders() { |
| | | // Map<Long, List<TaskItem>> listMap = taskItems.stream().collect(Collectors.groupingBy(TaskItem::getOrderId)); |
| | | // listMap.keySet().forEach(key -> { |
| | | // double sum = listMap.get(key).stream().mapToDouble(TaskItem::getAnfme).sum(); |
| | | // listMap.get(key).forEach(taskItem -> { |
| | | // Order order = new Order(); |
| | | // String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_MANAGE_ORDER_CODE, taskItem); |
| | | // if (Objects.isNull(ruleCode) || StringUtils.isBlank(ruleCode)) { |
| | | // throw new CoolException("编码规则错误:" + "请查看编码:" + "「SYS_MANAGE_ORDER_CODE」" + "是否设置"); |
| | | // } |
| | | // order.setCode(ruleCode).setAnfme(sum).setSourceId(taskItem.getOrderId()); |
| | | // }); |
| | | // }); |
| | | // |
| | | // if (!orderItemService.saveBatch(orderItems)) { |
| | | // throw new CoolException("单据明细保存失败!!"); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | //状态修改为入库中 |
| | | .setIoStatus(Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)) |
| | | .setAnfme(sum) |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setBarcode(waitPakin.getBarcode()); |
| | | if (!this.save(waitPakin1)) { |
| | | throw new CoolException("主单保存失败!!"); |
| | |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme() || waitPakinItem.getReceiptQty().compareTo(0.0) >= 0) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem.setAnfme(waitPakinItem.getReceiptQty()).setTrackCode(waitPakinItem.getTrackCode()); |
| | |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme() || waitPakinItem.getReceiptQty().compareTo(0.0) <= 0) { |
| | | throw new CoolException("组拖数量不能大于收货数量且不能小于零!!"); |
| | | } |
| | | pakinItem.setAnfme(waitPakinItem.getReceiptQty()).setTrackCode(waitPakinItem.getTrackCode()); |
| | | } |
| | |
| | | * 仓库编码规则 |
| | | */ |
| | | public final static String SYS_STOCK_CODE = "sys_stock_code"; |
| | | |
| | | /** |
| | | * 综合订单编码规则 |
| | | */ |
| | | public final static String SYS_MANAGE_ORDER_CODE = "sys_manage_order_code"; |
| | | } |
New file |
| | |
| | | -- save locItem record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.locItem', '0', '/manager/locItem', 'locItem', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 库位明细', '', '1', 'manager:locItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 库位明细', '', '1', 'manager:locItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 库位明细', '', '1', 'manager:locItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 库位明细', '', '1', 'manager:locItem:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | locItem: 'LocItem', |
| | | |
| | | -- locale field |
| | | locItem: { |
| | | locId: "locId", |
| | | orderId: "orderId", |
| | | type: "type", |
| | | orderItemId: "orderItemId", |
| | | wkType: "wkType", |
| | | matnrId: "matnrId", |
| | | maktx: "maktx", |
| | | matnrCode: "matnrCode", |
| | | trackCode: "trackCode", |
| | | unit: "unit", |
| | | anfme: "anfme", |
| | | batch: "batch", |
| | | splrBatch: "splrBatch", |
| | | spec: "spec", |
| | | model: "model", |
| | | fieldsIndex: "fieldsIndex", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import locItem from './locItem'; |
| | | |
| | | case 'locItem': |
| | | return locItem; |
New file |
| | |
| | | -- save order record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.order', '0', '/manager/order', 'order', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 综合订单管理', '', '1', 'manager:order:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 综合订单管理', '', '1', 'manager:order:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 综合订单管理', '', '1', 'manager:order:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 综合订单管理', '', '1', 'manager:order:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | order: 'Order', |
| | | |
| | | -- locale field |
| | | order: { |
| | | code: "code", |
| | | sourceCode: "sourceCode", |
| | | sourceId: "sourceId", |
| | | type: "type", |
| | | wkType: "wkType", |
| | | anfme: "anfme", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import order from './order'; |
| | | |
| | | case 'order': |
| | | return order; |
New file |
| | |
| | | -- save orderItem record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.orderItem', '0', '/manager/orderItem', 'orderItem', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 综合订单明细管理', '', '1', 'manager:orderItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 综合订单明细管理', '', '1', 'manager:orderItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 综合订单明细管理', '', '1', 'manager:orderItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 综合订单明细管理', '', '1', 'manager:orderItem:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | orderItem: 'OrderItem', |
| | | |
| | | -- locale field |
| | | orderItem: { |
| | | orderId: "orderId", |
| | | orderCode: "orderCode", |
| | | sourceItemId: "sourceItemId", |
| | | matnrId: "matnrId", |
| | | matnrCode: "matnrCode", |
| | | maktx: "maktx", |
| | | anfme: "anfme", |
| | | stockUnit: "stockUnit", |
| | | workQty: "workQty", |
| | | purQty: "purQty", |
| | | purUnit: "purUnit", |
| | | qty: "qty", |
| | | splrCode: "splrCode", |
| | | batch: "batch", |
| | | splrBatch: "splrBatch", |
| | | splrName: "splrName", |
| | | trackCode: "trackCode", |
| | | barcode: "barcode", |
| | | prodTime: "prodTime", |
| | | packName: "packName", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import orderItem from './orderItem'; |
| | | |
| | | case 'orderItem': |
| | | return orderItem; |
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.LocItemMapper"> |
| | | |
| | | </mapper> |
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.OrderItemMapper"> |
| | | |
| | | </mapper> |
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.OrderMapper"> |
| | | |
| | | </mapper> |