Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
11个文件已修改
3个文件已添加
4个文件已删除
1 文件已重命名
| | |
| | | import waitPakin from './waitPakin'; |
| | | import waitPakinItem from './waitPakinItem'; |
| | | import waitPakinLog from './waitPakinLog'; |
| | | import waitPakinItemLog from './waitPakinItemLog'; |
| | | import asnOrderLog from './asnOrderLog'; |
| | | // import asnOrderItemLog from './asnOrderItemLog'; |
| | | import task from './task'; |
| | | // import taskItem from './taskItem'; |
| | | import taskLog from './taskLog'; |
| | | // import taskItemLog from './taskItemLog'; |
| | | |
| | | |
| | | const ResourceContent = (node) => { |
| | | switch (node.component) { |
| | |
| | | return asnOrderItem; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | // case 'asnOrderItemLog': |
| | | // return asnOrderItemLog; |
| | | case 'purchaseItem': |
| | | return purchaseItem; |
| | | case 'purchase': |
| | |
| | | return waitPakinItem; |
| | | case 'waitPakinLog': |
| | | return waitPakinLog; |
| | | case 'waitPakinItemLog': |
| | | return waitPakinItemLog; |
| | | case 'task': |
| | | return task; |
| | | // case 'taskItem': |
| | | // return taskItem; |
| | | case 'taskLog': |
| | | return taskLog; |
| | | // case 'taskItemLog': |
| | | // return taskItemLog; |
| | | |
| | | default: |
| | | return { |
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, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import EmptyData from "../components/EmptyData"; |
| | | 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 />, |
| | | |
| | | <NumberInput source="asnId" label="table.field.asnOrderItemLog.asnId" />, |
| | | <TextInput source="asnCode" label="table.field.asnOrderItemLog.asnCode" />, |
| | | <TextInput source="platItemId" label="table.field.asnOrderItemLog.platItemId" />, |
| | | <NumberInput source="poDetlId" label="table.field.asnOrderItemLog.poDetlId" />, |
| | | <TextInput source="poCode" label="table.field.asnOrderItemLog.poCode" />, |
| | | <TextInput source="fieldsIndex" label="table.field.asnOrderItemLog.fieldsIndex" />, |
| | | <TextInput source="matnrId" label="table.field.asnOrderItemLog.matnrId" />, |
| | | <TextInput source="matnrCode" label="table.field.asnOrderItemLog.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.asnOrderItemLog.maktx" />, |
| | | <NumberInput source="anfme" label="table.field.asnOrderItemLog.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.asnOrderItemLog.stockUnit" />, |
| | | <NumberInput source="purQty" label="table.field.asnOrderItemLog.purQty" />, |
| | | <TextInput source="purUnit" label="table.field.asnOrderItemLog.purUnit" />, |
| | | <NumberInput source="qty" label="table.field.asnOrderItemLog.qty" />, |
| | | <TextInput source="splrCode" label="table.field.asnOrderItemLog.splrCode" />, |
| | | <TextInput source="splrBatch" label="table.field.asnOrderItemLog.splrBatch" />, |
| | | <TextInput source="splrName" label="table.field.asnOrderItemLog.splrName" />, |
| | | <TextInput source="qrcode" label="table.field.asnOrderItemLog.qrcode" />, |
| | | <TextInput source="trackCode" label="table.field.asnOrderItemLog.trackCode" />, |
| | | <TextInput source="barcode" label="table.field.asnOrderItemLog.barcode" />, |
| | | <TextInput source="packName" label="table.field.asnOrderItemLog.packName" />, |
| | | <SelectInput source="ntyStatus" label="table.field.asnOrderItemLog.ntyStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 未上报' }, |
| | | { id: 1, name: ' 已上报' }, |
| | | ]} |
| | | />, |
| | | |
| | | <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 AsnOrderItemLogList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const recodeId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="asnOrderItemLog" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrderItemLog"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ logId: recodeId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='asnOrderItemLog' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderItemLog' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'asnId', 'poDetlId', 'poCode', 'qrcode', 'packName', 'createTime', 'memo', 'fieldsIndex', 'matnrId', 'splrCode', 'status', 'createBy$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.asnOrderItemLog.asnId" /> |
| | | <TextField source="asnCode" label="table.field.asnOrderItemLog.asnCode" /> |
| | | <TextField source="platItemId" label="table.field.asnOrderItemLog.platItemId" /> |
| | | <NumberField source="poDetlId" label="table.field.asnOrderItemLog.poDetlId" /> |
| | | <TextField source="poCode" label="table.field.asnOrderItemLog.poCode" /> |
| | | <TextField source="fieldsIndex" label="table.field.asnOrderItemLog.fieldsIndex" /> |
| | | <TextField source="matnrId" label="table.field.asnOrderItemLog.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.asnOrderItemLog.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.asnOrderItemLog.maktx" /> |
| | | <NumberField source="anfme" label="table.field.asnOrderItemLog.anfme" /> |
| | | <NumberField source="purQty" label="table.field.asnOrderItemLog.purQty" /> |
| | | <TextField source="purUnit" label="table.field.asnOrderItemLog.purUnit" /> |
| | | <NumberField source="qty" label="table.field.asnOrderItemLog.qty" /> |
| | | <TextField source="splrCode" label="table.field.asnOrderItemLog.splrCode" /> |
| | | <TextField source="splrBatch" label="table.field.asnOrderItemLog.splrBatch" /> |
| | | <TextField source="splrName" label="table.field.asnOrderItemLog.splrName" /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItemLog.qrcode" /> |
| | | <TextField source="trackCode" label="table.field.asnOrderItemLog.trackCode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItemLog.packName" /> |
| | | <TextField source="ntyStatus$" label="table.field.asnOrderItemLog.ntyStatus" sortable={false} /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PageDrawer |
| | | title='AsnOrderItemLog Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default AsnOrderItemLogList; |
| | |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import SerialRuleItemList from "./SerialRuleItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <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.serialRule.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.delimit" |
| | | source="delimit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.resetDep" |
| | | source="resetDep" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.currValue" |
| | | source="currValue" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.lastCode" |
| | | source="lastCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.code" |
| | | source="code" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.delimit" |
| | | source="delimit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.resetDep" |
| | | source="resetDep" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.currValue" |
| | | source="currValue" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.lastCode" |
| | | source="lastCode" |
| | | 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> |
| | | <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 > |
| | | </SimpleForm> |
| | | </Edit > |
| | | <SerialRuleItemList></SerialRuleItemList> |
| | | </> |
| | | ) |
| | | } |
| | | |
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 SerialRuleItemCreate = (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.serialRuleItem.ruleId" |
| | | source="ruleId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.feildValue" |
| | | source="feildValue" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.len" |
| | | source="len" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.lenStr" |
| | | source="lenStr" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.sort" |
| | | source="sort" |
| | | 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 SerialRuleItemCreate; |
New file |
| | |
| | | import React, { |
| | | useState, |
| | | useRef, |
| | | useEffect, |
| | | useMemo, |
| | | useCallback, |
| | | } from "react"; |
| | | import { useNavigate, useLocation } 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, |
| | | useGetRecordId, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import SerialRuleItemCreate from "./SerialRuleItemCreate"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from "../../components/MyExportButton"; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { |
| | | PAGE_DRAWER_WIDTH, |
| | | OPERATE_MODE, |
| | | DEFAULT_PAGE_SIZE, |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | |
| | | 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" />, |
| | | <DateInput label="common.time.before" source="timeEnd" />, |
| | | <NumberInput source="ruleId" label="table.field.serialRuleItem.ruleId" />, |
| | | <TextInput source="wkType" label="table.field.serialRuleItem.wkType" />, |
| | | <TextInput source="feildValue" label="table.field.serialRuleItem.feildValue" />, |
| | | <NumberInput source="len" label="table.field.serialRuleItem.len" />, |
| | | <NumberInput source="lenStr" label="table.field.serialRuleItem.lenStr" />, |
| | | <NumberInput source="sort" label="table.field.serialRuleItem.sort" />, |
| | | <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 SerialRuleItemList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const ruleId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <> |
| | | <Box display="flex"> |
| | | <List |
| | | resource="serialRuleItem" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(["all"], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.serialRuleItem"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | filters={filters} |
| | | filter={{ ruleId: ruleId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={ |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | <SelectColumnsButton preferenceKey="serialRuleItem" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | } |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey="serialRuleItem" |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={false} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField |
| | | source="ruleId" |
| | | label="table.field.serialRuleItem.ruleId" |
| | | /> |
| | | <TextField |
| | | source="wkType$" |
| | | label="table.field.serialRuleItem.wkType" |
| | | /> |
| | | <TextField |
| | | source="feildValue" |
| | | label="table.field.serialRuleItem.feildValue" |
| | | /> |
| | | <NumberField source="len" label="table.field.serialRuleItem.len" /> |
| | | <NumberField |
| | | source="lenStr" |
| | | label="table.field.serialRuleItem.lenStr" |
| | | /> |
| | | <NumberField |
| | | source="sort" |
| | | label="table.field.serialRuleItem.sort" |
| | | /> |
| | | <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> |
| | | <SerialRuleItemCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title="SerialRuleItem Detail" |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | ></PageDrawer> |
| | | </Box> |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default SerialRuleItemList; |
| | |
| | | <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.serialRule.code" />, |
| | | <TextInput source="name" label="table.field.serialRule.name" />, |
| | | <TextInput source="delimit" label="table.field.serialRule.delimit" />, |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [detailDialog, setDetailDialog] = useState(false); |
| | | |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | | navigate(`/serialRuleItem?ruleId=${record.id}`); |
| | | }; |
| | | // const navigate = useNavigate(); |
| | | // const assign = (record) => { |
| | | // navigate(`/serialRuleItem?ruleId=${record.id}`); |
| | | // }; |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick={'edit'} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <MyField |
| | | source="code" |
| | | label="table.field.serialRule.code" |
| | | onClick={(event, record, val) => { |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |
| | | /> |
| | | {/* <MyField |
| | | source="code" |
| | | label="table.field.serialRule.code" |
| | | onClick={() => { |
| | | setDetailDialog(true); |
| | | }} |
| | | /> */} |
| | | |
| | | <TextField source="code" label="table.field.serialRule.code" /> |
| | | <TextField source="name" label="table.field.serialRule.name" /> |
| | | <TextField source="delimit" label="table.field.serialRule.delimit" /> |
| | | <TextField source="reset" label="table.field.serialRule.reset" /> |
| | |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useRefresh, |
| | | useDataProvider, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; |
| | |
| | | |
| | | const TaskList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [data, setData] = useState([]); |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | filter={{ taskId: record.id }} |
| | | title={"menu.taskItem"} |
| | | // title={"menu.taskItem"} |
| | | pagination={false} |
| | | empty={false} |
| | | actions={false} |
| | |
| | | <TextField source="createBy$" label="common.field.createBy"/> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <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} /> |
| | | </StyledDatagrid> |
| | | </List> |
File was renamed from rsf-admin/src/page/waitPakinItemLog/WaitPakinItemLogList.jsx |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import WaitPakinItemLogCreate from "./WaitPakinItemLogCreate"; |
| | | import WaitPakinItemLogPanel from "./WaitPakinItemLogPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import { styled } from '@mui/material/styles'; import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <ReferenceInput source="pakinId" label="table.field.waitPakinItemLog.pakinId" reference="waitPakin"> |
| | | <AutocompleteInput label="table.field.waitPakinItemLog.pakinId" optionText="id" filterToQuery={(val) => ({ id: val })} /> |
| | | </ReferenceInput>, |
| | |
| | | <TextInput source="fieldsIndex" label="table.field.waitPakinItemLog.fieldsIndex" />, |
| | | <NumberInput source="qty" label="table.field.waitPakinItemLog.qty" />, |
| | | <TextInput source="batch" label="table.field.waitPakinItemLog.batch" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const WaitPakinItemLogList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const recordId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="waitPakinItemLog" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | title={"menu.waitPakinItemLog"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | filter={{ logId: recordId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='waitPakinItemLog' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItemLog' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | rowClick={ false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'pakinId', 'pakinItemId', 'asnId' ,'asnItemId', 'createBy$', 'fieldsIndex']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <ReferenceField source="pakinId" label="table.field.waitPakinItemLog.pakinId" reference="waitPakin" link={false} sortable={false}> |
| | |
| | | <TextField source="fieldsIndex" label="table.field.waitPakinItemLog.fieldsIndex" /> |
| | | <NumberField source="qty" label="table.field.waitPakinItemLog.qty" /> |
| | | <TextField source="batch" label="table.field.waitPakinItemLog.batch" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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> |
| | | <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> |
| | | <WaitPakinItemLogCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='WaitPakinItemLog Detail' |
| | | drawerVal={drawerVal} |
| | |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import WaitPakinItemLogList from "./WaitPakinItemLogList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <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.waitPakinLog.pakinId" |
| | | source="pakinId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.waitPakinLog.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.waitPakinLog.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.waitPakinLog.anfme" |
| | | source="anfme" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.waitPakinLog.ioStatus" |
| | | source="ioStatus" |
| | | choices={[ |
| | | { id: 0, name: '待入库' }, |
| | | { id: 1, name: ' 入库中' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={24} md={12}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.waitPakinLog.pakinId" |
| | | source="pakinId" |
| | | autoFocus |
| | | /> |
| | | <TextInput |
| | | label="table.field.waitPakinLog.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.waitPakinLog.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.waitPakinLog.anfme" |
| | | source="anfme" |
| | | /> |
| | | <SelectInput |
| | | label="table.field.waitPakinLog.ioStatus" |
| | | source="ioStatus" |
| | | choices={[ |
| | | { id: 0, name: '待入库' }, |
| | | { id: 1, name: ' 入库中' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </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 > |
| | | </SimpleForm> |
| | | </Edit > |
| | | <WaitPakinItemLogList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import WaitPakinLogCreate from "./WaitPakinLogCreate"; |
| | | import WaitPakinLogPanel from "./WaitPakinLogPanel"; |
| | | 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 WaitPakinLogList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='waitPakinLog' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinLog' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <WaitPakinLogPanel />} |
| | | bulkActionButtons={false} |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <WaitPakinLogCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='WaitPakinLog Detail' |
| | | drawerVal={drawerVal} |
| | |
| | | throw new CoolException("通知单明细不存在!!"); |
| | | } |
| | | if (Objects.isNull(dto.getReceiptQty()) || Double.compare(dto.getReceiptQty(), 0.0) == 0) { |
| | | throw new CoolException("收货数量不能为零!!"); |
| | | throw new CoolException("物料:" + dto.getMaktx() + "收货数量不能为零!!"); |
| | | } |
| | | Double itemRcptQty = dto.getReceiptQty() + orderItem.getQty(); |
| | | orderItem.setQty(itemRcptQty) |
| | |
| | | .setWeight(dto.getWeigth()) |
| | | .setStockUnit(dto.getStockUnit()) |
| | | .setBatch(SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_RECEIPT_BATCH, dto)) |
| | | .setAnfme(itemRcptQty) |
| | | .setAnfme(dto.getReceiptQty()) |
| | | .setSplrBatch(dto.getSplrBatch()) |
| | | .setMatnrCode(matnr.getCode()) |
| | | .setMatnrId(matnr.getId()) |
| | |
| | | */ |
| | | @Override |
| | | public R getItemByContainer(Map<String, Object> params) { |
| | | //获取组拖未生成任务的组拖档 |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | |
| | | .lambda() |
| | | .in(WarehouseAreasItem::getTrackCode, list) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, |
| | | WarehouseAreasItem::getAsnId, |
| | | WarehouseAreasItem::getAreaId, |
| | | WarehouseAreasItem::getTrackCode, |
| | | WarehouseAreasItem::getMatnrId); |
| | | return R.ok(warehouseAreasItemService.list(queryWrapper)); |
| | | WarehouseAreasItem::getTrackCode); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | for (WaitPakinItem pakinItem : pakinItems) { |
| | | if (warehouseAreasItems.get(i).getTrackCode().equals(pakinItem.getTrackCode())) { |
| | | warehouseAreasItems.get(i).setAnfme(pakinItem.getAnfme()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(warehouseAreasItems); |
| | | } |
| | | |
| | | /** |
| | |
| | | return "待入库"; |
| | | case 1: |
| | | return " 入库中"; |
| | | case 2: |
| | | return "任务执行中"; |
| | | case 3: |
| | | return "任务完成"; |
| | | default: |
| | | return String.valueOf(this.ioStatus); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface WarehouseAreasItemService extends IService<WarehouseAreasItem> { |
| | | |
| | | List<WarehouseAreasItem> getList(); |
| | | |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.PakinItem; |
| | |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("waitPakinService") |
| | |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private WarehouseAreasItemService warehouseAreasItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | |
| | | if (StringUtils.isBlank(waitPakin.getBarcode())) { |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | |
| | | List<WaitPakin> list = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!list.isEmpty()) { |
| | | List<String> stringList = list.stream().map(WaitPakin::getCode).collect(Collectors.toList()); |
| | | String join = StringUtils.join(stringList, ","); |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被组拖单:" + join + "使用!!"); |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin list = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .notIn(WaitPakin::getIoStatus, asList) |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!Objects.isNull(list)) { |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被组拖单:" + list.getCode() + "使用!!"); |
| | | } |
| | | |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, waitPakin.getBarcode())); |
| | | if (!locs.isEmpty()) { |
| | | List<String> locCodes = locs.stream().map(Loc::getCode).collect(Collectors.toList()); |
| | | String join = StringUtils.join(locCodes, ","); |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被库位:" + join + "使用!!"); |
| | | } |
| | | |
| | | double sum = waitPakin.getItems().stream().mapToDouble(PakinItem::getReceiptQty).sum(); |
| | | |
| | | WaitPakin pakin = new WaitPakin(); |
| | | |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_WAIT_PAKIN_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误: 编码规则「SYS_WAIT_PAKIN_CODE」规则是不存在"); |
| | | WaitPakin waitPakin1 = new WaitPakin(); |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .in(WaitPakin::getIoStatus, asList) |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (Objects.isNull(pakin)) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_WAIT_PAKIN_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误: 编码规则「SYS_WAIT_PAKIN_CODE」规则是不存在"); |
| | | } |
| | | waitPakin1.setCode(ruleCode) |
| | | //状态修改为入库中 |
| | | .setIoStatus(Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)) |
| | | .setAnfme(sum) |
| | | .setBarcode(waitPakin.getBarcode()); |
| | | if (!this.save(waitPakin1)) { |
| | | throw new CoolException("主单保存失败!!"); |
| | | } |
| | | } else { |
| | | BeanUtils.copyProperties(pakin, waitPakin1); |
| | | waitPakin1.setAnfme(sum); |
| | | if (!this.saveOrUpdate(waitPakin1)) { |
| | | throw new CoolException("主单修改失败!!"); |
| | | } |
| | | } |
| | | pakin.setCode(ruleCode) |
| | | //状态修改为入库中 |
| | | .setIoStatus(Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)) |
| | | .setAnfme(sum) |
| | | .setBarcode(waitPakin.getBarcode()); |
| | | if (!this.save(pakin)) { |
| | | throw new CoolException("主单保存失败!!"); |
| | | } |
| | | |
| | | /**物料跟踪码*/ |
| | | List<String> tracks = waitPakin.getItems().stream().map(PakinItem::getTrackCode).collect(Collectors.toList()); |
| | | |
| | | List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getTrackCode, tracks)); |
| | | if (Objects.isNull(asnOrderItems) || asnOrderItems.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakin1.getId()) |
| | | .in(WaitPakinItem::getTrackCode, tracks)); |
| | | if (!pakinItems.isEmpty()) { |
| | | if (!waitPakinItemService.remove(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakin1.getId()) |
| | | .in(WaitPakinItem::getTrackCode, tracks))) { |
| | | throw new CoolException("原单据清除失败!!"); |
| | | } |
| | | } |
| | | |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new QueryWrapper<WarehouseAreasItem>() |
| | | .select("SUM(anfme) as anfme, track_code, asn_code, id, splr_batch, ispt_result, plat_item_id, batch, qty, work_qty, matnr_code, matnr_id, maktx") |
| | | .lambda() |
| | | .in(WarehouseAreasItem::getTrackCode, tracks) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, |
| | | WarehouseAreasItem::getTrackCode); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | if (Objects.isNull(warehouseAreasItems) || warehouseAreasItems.isEmpty()) { |
| | | throw new CoolException("物料未送至收货区!!"); |
| | | } |
| | | List<WaitPakinItem> items = new ArrayList<>(); |
| | | for (AsnOrderItem item : asnOrderItems) { |
| | | for (WarehouseAreasItem item : warehouseAreasItems) { |
| | | WaitPakinItem pakinItem = new WaitPakinItem(); |
| | | pakinItem.setAnfme(item.getAnfme()) |
| | | .setPakinId(pakin.getId()) |
| | | .setPakinId(waitPakin1.getId()) |
| | | .setAsnId(item.getAsnId()) |
| | | .setAsnCode(item.getAsnCode()) |
| | | .setAsnItemId(item.getId()) |
| | |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | // Double v = item.getWorkQty() + waitPakinItem.getReceiptQty(); |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem |
| | | .setWorkQty(waitPakinItem.getReceiptQty()) |
| | | .setAnfme(waitPakinItem.getReceiptQty()) |
| | | .setTrackCode(waitPakinItem.getTrackCode()); |
| | | /**更新单据执行中库存*/ |
| | |
| | | } |
| | | items.add(pakinItem); |
| | | } |
| | | double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | if (!waitPakinItemService.saveBatch(items)) { |
| | | throw new CoolException("组拖明细保存失败!!"); |
| | | } |
| | | waitPakin1.setAnfme(sum1); |
| | | if (!this.updateById(waitPakin1)) { |
| | | throw new CoolException("组拖数量修改失败!!"); |
| | | } |
| | | return pakin; |
| | | } |
| | | |