#新增
1. PDA登录接口
2. PDA新增扫码收货接口
3. PDA新增确认收货接口
| | |
| | | packName: "packName", |
| | | ntyStatus: "ntyStatus", |
| | | }, |
| | | purchaseItem: { |
| | | purchaseId: "purchaseId", |
| | | erpItemId: "erpItemId", |
| | | matnrCode: "matnrCode", |
| | | matnrName: "matnrName", |
| | | unit: "unit", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | nromQty: "nromQty", |
| | | asnQty: "asnQty", |
| | | printQty: "printQty", |
| | | splrName: "splrName", |
| | | splrCode: "splrCode", |
| | | splrBatch: "splrBatch", |
| | | }, |
| | | purchase: { |
| | | code: "code", |
| | | erpId: "erpId", |
| | |
| | | }, |
| | | purchaseItem: { |
| | | purchaseId: "purchaseId", |
| | | erpItemId: "erpItemId", |
| | | platItemId: "erpItemId", |
| | | matnrCode: "matnrCode", |
| | | matnrName: "matnrName", |
| | | unit: "unit", |
| | |
| | | }, |
| | | purchaseItem: { |
| | | purchaseId: "PO主单标识", |
| | | erpItemId: "erp明细标识", |
| | | platItemId: "erp明细标识", |
| | | matnrCode: "物料编码", |
| | | matnrName: "物料名称", |
| | | unit: "计量单位", |
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 WarehouseAreasItemCreate = (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.warehouseAreasItem.areaId" |
| | | source="areaId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.areaName" |
| | | source="areaName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.warehouseAreasItem.matnrId" |
| | | source="matnrId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.matnrName" |
| | | source="matnrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.warehouseAreasItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.brand" |
| | | source="brand" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="shipperId" |
| | | reference="companys" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.warehouseAreasItem.shipperId" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.splrId" |
| | | source="splrId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.warehouseAreasItem.weight" |
| | | source="weight" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.prodTime" |
| | | source="prodTime" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.splrBtch" |
| | | source="splrBtch" |
| | | 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 WarehouseAreasItemCreate; |
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 WarehouseAreasItemEdit = () => { |
| | | 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.warehouseAreasItem.areaId" |
| | | source="areaId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.areaName" |
| | | source="areaName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.warehouseAreasItem.matnrId" |
| | | source="matnrId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.matnrName" |
| | | source="matnrName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.warehouseAreasItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.brand" |
| | | source="brand" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <ReferenceInput |
| | | source="shipperId" |
| | | reference="companys" |
| | | perPage={REFERENCE_INPUT_PAGESIZE} |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.warehouseAreasItem.shipperId" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.splrId" |
| | | source="splrId" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.warehouseAreasItem.weight" |
| | | source="weight" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.prodTime" |
| | | source="prodTime" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.warehouseAreasItem.splrBtch" |
| | | source="splrBtch" |
| | | 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 WarehouseAreasItemEdit; |
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 WarehouseAreasItemCreate from "./WarehouseAreasItemCreate"; |
| | | import WarehouseAreasItemPanel from "./WarehouseAreasItemPanel"; |
| | | 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="areaId" label="table.field.warehouseAreasItem.areaId" />, |
| | | <TextInput source="areaName" label="table.field.warehouseAreasItem.areaName" />, |
| | | <NumberInput source="matnrId" label="table.field.warehouseAreasItem.matnrId" />, |
| | | <TextInput source="matnrName" label="table.field.warehouseAreasItem.matnrName" />, |
| | | <TextInput source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" />, |
| | | <TextInput source="barcode" label="table.field.warehouseAreasItem.barcode" />, |
| | | <NumberInput source="anfme" label="table.field.warehouseAreasItem.anfme" />, |
| | | <TextInput source="batch" label="table.field.warehouseAreasItem.batch" />, |
| | | <TextInput source="unit" label="table.field.warehouseAreasItem.unit" />, |
| | | <TextInput source="stockUnit" label="table.field.warehouseAreasItem.stockUnit" />, |
| | | <TextInput source="brand" label="table.field.warehouseAreasItem.brand" />, |
| | | <ReferenceInput source="shipperId" label="table.field.warehouseAreasItem.shipperId" reference="companys"> |
| | | <AutocompleteInput label="table.field.warehouseAreasItem.shipperId" optionText="name" filterToQuery={(val) => ({ name: val })} /> |
| | | </ReferenceInput>, |
| | | <TextInput source="splrId" label="table.field.warehouseAreasItem.splrId" />, |
| | | <NumberInput source="weight" label="table.field.warehouseAreasItem.weight" />, |
| | | <TextInput source="prodTime" label="table.field.warehouseAreasItem.prodTime" />, |
| | | <TextInput source="splrBtch" label="table.field.warehouseAreasItem.splrBtch" />, |
| | | |
| | | <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 WarehouseAreasItemList = () => { |
| | | 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.warehouseAreasItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='warehouseAreasItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='warehouseAreasItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <WarehouseAreasItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="areaId" label="table.field.warehouseAreasItem.areaId" /> |
| | | <TextField source="areaName" label="table.field.warehouseAreasItem.areaName" /> |
| | | <NumberField source="matnrId" label="table.field.warehouseAreasItem.matnrId" /> |
| | | <TextField source="matnrName" label="table.field.warehouseAreasItem.matnrName" /> |
| | | <TextField source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" /> |
| | | <TextField source="barcode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <NumberField source="anfme" label="table.field.warehouseAreasItem.anfme" /> |
| | | <TextField source="batch" label="table.field.warehouseAreasItem.batch" /> |
| | | <TextField source="unit" label="table.field.warehouseAreasItem.unit" /> |
| | | <TextField source="stockUnit" label="table.field.warehouseAreasItem.stockUnit" /> |
| | | <TextField source="brand" label="table.field.warehouseAreasItem.brand" /> |
| | | <ReferenceField source="shipperId" label="table.field.warehouseAreasItem.shipperId" reference="companys" link={false} sortable={false}> |
| | | <TextField source="name" /> |
| | | </ReferenceField> |
| | | <TextField source="splrId" label="table.field.warehouseAreasItem.splrId" /> |
| | | <NumberField source="weight" label="table.field.warehouseAreasItem.weight" /> |
| | | <TextField source="prodTime" label="table.field.warehouseAreasItem.prodTime" /> |
| | | <TextField source="splrBtch" label="table.field.warehouseAreasItem.splrBtch" /> |
| | | |
| | | <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> |
| | | <WarehouseAreasItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='WarehouseAreasItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default WarehouseAreasItemList; |
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 WarehouseAreasItemPanel = () => { |
| | | 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.warehouseAreasItem.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.warehouseAreasItem.areaId" |
| | | property={record.areaId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.areaName" |
| | | property={record.areaName} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.matnrId" |
| | | property={record.matnrId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.matnrName" |
| | | property={record.matnrName} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.matnrCode" |
| | | property={record.matnrCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.barcode" |
| | | property={record.barcode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.anfme" |
| | | property={record.anfme} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.batch" |
| | | property={record.batch} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.unit" |
| | | property={record.unit} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.stockUnit" |
| | | property={record.stockUnit} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.brand" |
| | | property={record.brand} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.shipperId" |
| | | property={record.shipperId$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.splrId" |
| | | property={record.splrId$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.weight" |
| | | property={record.weight} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.prodTime" |
| | | property={record.prodTime} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.warehouseAreasItem.splrBtch" |
| | | property={record.splrBtch} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default WarehouseAreasItemPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import WarehouseAreasItemList from "./WarehouseAreasItemList"; |
| | | import WarehouseAreasItemEdit from "./WarehouseAreasItemEdit"; |
| | | |
| | | export default { |
| | | list: WarehouseAreasItemList, |
| | | edit: WarehouseAreasItemEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
| | | } |
| | | }; |
New file |
| | |
| | | package com.vincent.rsf.common.domain;
|
| | |
|
| | | public interface BaseRes {
|
| | |
|
| | | String OK = "200-操作成功";
|
| | | String SUCESS = "sucess";
|
| | | String EMPTY = "201-暂无数据";
|
| | | String LIMIT = "202-无权限";
|
| | | String PARAM = "401-参数为空";
|
| | | String DENIED = "403-请重新登录";
|
| | | String REPEAT = "407-已存在";
|
| | | String NO_ACTIVATION = "409-请先激活系统";
|
| | | String ERROR = "500-服务器错误";
|
| | | }
|
New file |
| | |
| | | package com.vincent.rsf.server.api.controller; |
| | | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.entity.dto.ReceiptDetlsDto; |
| | | import com.vincent.rsf.server.api.service.MobileService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.controller.param.LoginParam; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.tika.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title MobileController |
| | | * @description |
| | | * @create 2025/3/10 08:05 |
| | | */ |
| | | @Api(tags = "PDA操作接口") |
| | | @RequestMapping("/pda") |
| | | @RestController |
| | | public class MobileController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MobileService mobileService; |
| | | |
| | | |
| | | @PostMapping("/login") |
| | | @ApiOperation("PDA用户登录") |
| | | public R login(@RequestBody LoginParam param, HttpServletRequest request) { |
| | | if (Objects.isNull(param)) { |
| | | throw new CoolException("登录信息不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getUsername())) { |
| | | throw new CoolException("用户名不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getPassword())) { |
| | | throw new CoolException("密码不能为空!!"); |
| | | } |
| | | |
| | | return mobileService.login(param, request); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @GetMapping("/orders/{barcode}") |
| | | @ApiOperation("标准扫码收货") |
| | | public R getOrderBybarcode(@PathVariable String barcode) { |
| | | if (StringUtils.isEmpty(barcode)) { |
| | | throw new CoolException("条码不能为空!!"); |
| | | } |
| | | return mobileService.getOrderByCode(barcode); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreas:save')") |
| | | @PostMapping("/orders/confirm") |
| | | @ApiOperation("确认收货") |
| | | public R confirmReceipt(@RequestBody ReceiptParams params) { |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("请求参数不能为空!!"); |
| | | } |
| | | return mobileService.receiptToWarehouse(params); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.controller.params; |
| | | |
| | | import com.vincent.rsf.server.api.entity.dto.ReceiptDetlsDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title ReceiptParams |
| | | * @description |
| | | * @create 2025/3/10 16:22 |
| | | */ |
| | | @Data |
| | | @Accessors |
| | | @ApiModel(value = "ReceiptParams", description = "确认收货请求参数") |
| | | public class ReceiptParams { |
| | | |
| | | @ApiModelProperty(value = "收货明细", required = true) |
| | | private List<ReceiptDetlsDto> receipts; |
| | | |
| | | @ApiModelProperty(value = "库区标识", required = true) |
| | | private Long whAreaId; |
| | | } |
| | |
| | | private String purchaseId; |
| | | |
| | | @ApiModelProperty("Erp明细单标识") |
| | | private String erpItemId; |
| | | private String platItemId; |
| | | |
| | | @ApiModelProperty("物料编码") |
| | | private String matnrCode; |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.dto; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title ReceiptDetlsDto |
| | | * @description |
| | | * @create 2025/3/10 14:34 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ReceiptDetlsDto", description = "收货明细信息") |
| | | public class ReceiptDetlsDto implements Serializable { |
| | | |
| | | @ApiModelProperty("收货通知单") |
| | | private String asnCode; |
| | | |
| | | @ApiModelProperty("条形码") |
| | | private String barcode; |
| | | |
| | | @ApiModelProperty("采购单") |
| | | private String poCode; |
| | | |
| | | @ApiModelProperty("物料名称") |
| | | private String matnk; |
| | | |
| | | @ApiModelProperty("供应商批次") |
| | | private String splrBatch; |
| | | |
| | | @ApiModelProperty("最大库存") |
| | | private Double maxQty; |
| | | |
| | | @ApiModelProperty("平台行号") |
| | | private String platformId; |
| | | |
| | | @ApiModelProperty("实时库存") |
| | | private Double stockQty; |
| | | |
| | | @ApiModelProperty("质检结果") |
| | | private String inspect; |
| | | |
| | | @ApiModelProperty("采购单位") |
| | | private String purUnit; |
| | | |
| | | @ApiModelProperty("库存单位") |
| | | private String stockUnit; |
| | | |
| | | @ApiModelProperty("采购数量") |
| | | private Double purQty; |
| | | |
| | | @ApiModelProperty("收货数量") |
| | | private Double receiptQty; |
| | | |
| | | @ApiModelProperty("物料标识") |
| | | private Long matnrId; |
| | | |
| | | @ApiModelProperty("供应商编码") |
| | | private String splrCode; |
| | | } |
| | |
| | | */ |
| | | public interface ErpApiService { |
| | | |
| | | /** |
| | | * 采购单同步 |
| | | * @param orders |
| | | * @return |
| | | */ |
| | | boolean syncPurchasee(List<Order> orders); |
| | | |
| | | /** |
| | | * 一键报检 |
| | | * @param items |
| | | * @return |
| | | */ |
| | | boolean reportInspectNotify(List<PoItemsDto> items); |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.service; |
| | | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.system.controller.param.LoginParam; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title MobileService |
| | | * @description |
| | | * @create 2025/3/10 08:06 |
| | | */ |
| | | public interface MobileService { |
| | | |
| | | R login(LoginParam param, HttpServletRequest request); |
| | | |
| | | R getOrderByCode(String barcode); |
| | | |
| | | R receiptToWarehouse(ReceiptParams orders); |
| | | } |
| | |
| | | ErpInspectItem inspect= new ErpInspectItem(); |
| | | BeanUtils.copyProperties(dto, inspect); |
| | | //赋值erp明细编码 |
| | | inspect.setPoItemId(dto.getErpItemId()); |
| | | inspect.setPoItemId(dto.getPlatItemId()); |
| | | inspectItems.add(inspect); |
| | | }); |
| | | params.setChildren(inspectItems); |
New file |
| | |
| | | package com.vincent.rsf.server.api.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.entity.dto.ReceiptDetlsDto; |
| | | import com.vincent.rsf.server.api.service.MobileService; |
| | | import com.vincent.rsf.server.common.config.ConfigProperties; |
| | | import com.vincent.rsf.server.common.security.JwtSubject; |
| | | import com.vincent.rsf.server.common.utils.JwtUtil; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.mapper.*; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasItemService; |
| | | import com.vincent.rsf.server.system.constant.CodeRes; |
| | | import com.vincent.rsf.server.system.controller.param.LoginParam; |
| | | import com.vincent.rsf.server.system.controller.result.LoginResult; |
| | | import com.vincent.rsf.server.system.entity.Tenant; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import com.vincent.rsf.server.system.entity.UserLogin; |
| | | import com.vincent.rsf.server.system.mapper.TenantMapper; |
| | | import com.vincent.rsf.server.system.mapper.UserMapper; |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import org.apache.tika.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title MobileServiceImpl |
| | | * @description |
| | | * @create 2025/3/10 08:07 |
| | | */ |
| | | @Service |
| | | public class MobileServiceImpl implements MobileService { |
| | | |
| | | @Value("${super.pwd}") |
| | | private String superPwd; |
| | | @Resource |
| | | private ConfigProperties configProperties; |
| | | @Autowired |
| | | private TenantMapper tenantService; |
| | | @Autowired |
| | | private UserMapper userService; |
| | | @Autowired |
| | | private UserLoginService userLoginService; |
| | | |
| | | @Autowired |
| | | private WarehouseAreasItemService warehouseAreasItemService; |
| | | @Resource |
| | | private AsnOrderItemMapper asnOrderItemMapper; |
| | | @Resource |
| | | private MatnrMapper matnrMapper; |
| | | @Resource |
| | | private QlyInspectMapper qlyInspectMapper; |
| | | @Resource |
| | | private StockItemMapper stockItemMapper; |
| | | @Resource |
| | | private PurchaseItemMapper purchaseItemMapper; |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 手持PDA登录接口 |
| | | * @params LoginParam param, HttpServletRequest request |
| | | * @return |
| | | * @time 2025/3/10 15:36 |
| | | */ |
| | | @Override |
| | | public R login(LoginParam param, HttpServletRequest request) { |
| | | User user = userService.selectByUsernameWithoutTenant(param.getUsername(), null); |
| | | if (param.getUsername().equals("super") && param.getPassword().equals(Cools.md5(superPwd))) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | res.put("username", param.getUsername()); |
| | | res.put("token", JwtUtil.buildToken(new JwtSubject(param.getUsername(), user.getTenantId()), |
| | | configProperties.getTokenExpireTime(), configProperties.getTokenKey())); |
| | | return R.ok(res); |
| | | } |
| | | |
| | | if (Cools.isEmpty(user)) { |
| | | return R.parse(CodeRes.USER_10001); |
| | | } |
| | | if (user.getStatus() != 1) { |
| | | return R.parse(CodeRes.USER_10002); |
| | | } |
| | | if (!user.getPassword().equals(param.getPassword())) { |
| | | return R.parse(CodeRes.USER_10003); |
| | | } |
| | | |
| | | String accessToken = JwtUtil.buildToken(new JwtSubject(param.getUsername(), user.getTenantId()), |
| | | configProperties.getTokenExpireTime(), configProperties.getTokenKey()); |
| | | userLoginService.saveAsync(user.getId(), accessToken, UserLogin.TYPE_LOGIN, user.getTenantId(), null, request); |
| | | Tenant tenant = tenantService.selectById(user.getTenantId()); |
| | | return R.ok("Sign In Success").add(new LoginResult(accessToken, user, tenant.getName())); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 扫码获取收货明细 |
| | | * @param barcode |
| | | * @return |
| | | * @time 2025/3/10 15:37 |
| | | */ |
| | | @Override |
| | | public R getOrderByCode(String barcode) { |
| | | if (StringUtils.isEmpty(barcode)) { |
| | | return R.error("标签码不能为空!!"); |
| | | } |
| | | ReceiptDetlsDto detlsDto = new ReceiptDetlsDto(); |
| | | AsnOrderItem asnOrderItem = asnOrderItemMapper.selectOne(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getBarcode, barcode)); |
| | | if (Objects.isNull(asnOrderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | detlsDto.setAsnCode(asnOrderItem.getAsnCode()) |
| | | .setMatnk(asnOrderItem.getMatnk()) |
| | | .setBarcode(asnOrderItem.getBarcode()) |
| | | .setPoCode(asnOrderItem.getPoCode()) |
| | | .setPurQty(asnOrderItem.getAnfme()) |
| | | .setSplrBatch(asnOrderItem.getSplrBatch()); |
| | | |
| | | Matnr matnr = matnrMapper.selectById(asnOrderItem.getMatnrId()); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException("数据错误:当前物料不存在!!"); |
| | | } |
| | | //SET 物料最大存放数量 |
| | | detlsDto.setMaxQty(matnr.getMaxQty()) |
| | | .setMatnrId(matnr.getId()) |
| | | .setStockUnit(matnr.getStockUnit()); |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>() |
| | | .eq(QlyInspect::getAsnItemId, asnOrderItem.getId()).eq(QlyInspect::getPoItemId, asnOrderItem.getPoDetlId())); |
| | | //set 质检结果 |
| | | detlsDto.setInspect(inspect.getStatus$()); |
| | | //获取当前库存信息 |
| | | StockItem stockItem = stockItemMapper.selectOne(new LambdaQueryWrapper<StockItem>() |
| | | .eq(StockItem::getAsnItemId, asnOrderItem.getId()) |
| | | .eq(StockItem::getMatnrId, asnOrderItem.getMatnrId())); |
| | | //SET 当前库存数量 |
| | | if (Objects.isNull(stockItem)) { |
| | | detlsDto.setStockQty(0.0); |
| | | } else { |
| | | detlsDto.setStockQty(stockItem.getQty() + stockItem.getWorkQty()); |
| | | } |
| | | |
| | | //获取采购单明细信息 |
| | | PurchaseItem purchaseItem = purchaseItemMapper.selectOne(new LambdaQueryWrapper<PurchaseItem>().eq(PurchaseItem::getId, asnOrderItem.getPoDetlId())); |
| | | //SET 平台行号 |
| | | detlsDto.setPlatformId(purchaseItem.getPlatItemId()); |
| | | |
| | | return R.ok(detlsDto); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 收货至收货区 |
| | | * @param params |
| | | * @return |
| | | * @time 2025/3/10 15:41 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R receiptToWarehouse(ReceiptParams params) { |
| | | if (params.getReceipts().isEmpty()) { |
| | | throw new CoolException("收货明细不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getWhAreaId())) { |
| | | throw new CoolException("库区标识不能为空!!"); |
| | | } |
| | | WarehouseAreasItem areasItem = warehouseAreasItemService.getOne(new LambdaQueryWrapper<WarehouseAreasItem>().eq(WarehouseAreasItem::getAreaId, params.getWhAreaId())); |
| | | List<ReceiptDetlsDto> receipts = params.getReceipts(); |
| | | List<WarehouseAreasItem> allOrders = new ArrayList<>(); |
| | | receipts.forEach(dto -> { |
| | | Matnr matnr = matnrMapper.selectById(dto.getMatnrId()); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException("数据错误:当前物料不存在!!"); |
| | | } |
| | | WarehouseAreasItem item = new WarehouseAreasItem(); |
| | | item.setBarcode(dto.getBarcode()) |
| | | .setAreaName(areasItem.getAreaName()) |
| | | .setAreaId(areasItem.getAreaId()) |
| | | .setStockUnit(dto.getStockUnit()) |
| | | //TODO 编码规则生成批次 (物料号+日期) |
| | | .setBatch(null) |
| | | .setAnfme(dto.getReceiptQty()) |
| | | .setSplrBtch(dto.getSplrBatch()) |
| | | .setMatnrCode(matnr.getCode()) |
| | | .setMatnrId(matnr.getId()) |
| | | .setMatnrName(matnr.getName()) |
| | | //TODO 入库单位换算 |
| | | .setUnit(dto.getStockUnit()) |
| | | .setStockUnit(dto.getStockUnit()) |
| | | .setWeight(matnr.getWeight()) |
| | | .setShipperId(matnr.getShipperId()); |
| | | //TODO 供应商标识未设置 |
| | | |
| | | allOrders.add(item); |
| | | }); |
| | | |
| | | if (!warehouseAreasItemService.saveBatch(allOrders)) { |
| | | throw new CoolException("收货失败!!"); |
| | | } |
| | | |
| | | return R.ok("操作成功"); |
| | | } |
| | | } |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="man_purchase_item"; |
| | | generator.tableDesc="采购明细单"; |
| | | generator.table="man_warehouse_areas_item"; |
| | | generator.tableDesc="收货区库存信息"; |
| | | generator.packagePath="com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
| | |
| | | "/system/info", |
| | | "/tenant/list", |
| | | "/email/code", |
| | | "/pda/login", |
| | | "/erp/**", |
| | | "/login", |
| | | "/register", |
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.WarehouseAreasItem; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasItemService; |
| | | 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 WarehouseAreasItemController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WarehouseAreasItemService warehouseAreasItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:list')") |
| | | @PostMapping("/warehouseAreasItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<WarehouseAreasItem, BaseParam> pageParam = new PageParam<>(baseParam, WarehouseAreasItem.class); |
| | | return R.ok().add(warehouseAreasItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:list')") |
| | | @PostMapping("/warehouseAreasItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(warehouseAreasItemService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:list')") |
| | | @PostMapping({"/warehouseAreasItem/many/{ids}", "/warehouseAreasItems/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(warehouseAreasItemService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:list')") |
| | | @GetMapping("/warehouseAreasItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(warehouseAreasItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:save')") |
| | | @OperationLog("Create 收货区库存信息") |
| | | @PostMapping("/warehouseAreasItem/save") |
| | | public R save(@RequestBody WarehouseAreasItem warehouseAreasItem) { |
| | | warehouseAreasItem.setCreateBy(getLoginUserId()); |
| | | warehouseAreasItem.setCreateTime(new Date()); |
| | | warehouseAreasItem.setUpdateBy(getLoginUserId()); |
| | | warehouseAreasItem.setUpdateTime(new Date()); |
| | | if (!warehouseAreasItemService.save(warehouseAreasItem)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(warehouseAreasItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:update')") |
| | | @OperationLog("Update 收货区库存信息") |
| | | @PostMapping("/warehouseAreasItem/update") |
| | | public R update(@RequestBody WarehouseAreasItem warehouseAreasItem) { |
| | | warehouseAreasItem.setUpdateBy(getLoginUserId()); |
| | | warehouseAreasItem.setUpdateTime(new Date()); |
| | | if (!warehouseAreasItemService.updateById(warehouseAreasItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(warehouseAreasItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:remove')") |
| | | @OperationLog("Delete 收货区库存信息") |
| | | @PostMapping("/warehouseAreasItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!warehouseAreasItemService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:list')") |
| | | @PostMapping("/warehouseAreasItem/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<WarehouseAreasItem> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(WarehouseAreasItem::getId, condition); |
| | | } |
| | | warehouseAreasItemService.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:warehouseAreasItem:list')") |
| | | @PostMapping("/warehouseAreasItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(warehouseAreasItemService.list(), WarehouseAreasItem.class), response); |
| | | } |
| | | |
| | | } |
| | |
| | | * PO单明细标识 |
| | | */ |
| | | @ApiModelProperty(value= "PO单明细标识") |
| | | private String poDetlId; |
| | | private Long poDetlId; |
| | | |
| | | /** |
| | | * PO单明细编码 |
| | | */ |
| | | @ApiModelProperty(value= "PO单明细编码") |
| | | private String poDetlCode; |
| | | @ApiModelProperty(value= "PO单编码") |
| | | private String poCode; |
| | | |
| | | /** |
| | | * 物料标识 |
| | |
| | | */ |
| | | @ApiModelProperty(value= "供应商名称") |
| | | private String splrName; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value = "供应商批次") |
| | | private String splrBatch; |
| | | |
| | | /** |
| | | * 二维码 |
| | |
| | | |
| | | public AsnOrderItem() {} |
| | | |
| | | public AsnOrderItem(Long asnId,String asnCode,String poDetlId,String poDetlCode,String matnrId,String matnk,Double anfme,String stockUnit,Double purQty,String purUnit,Double qty,String splrCode,String splrName,String qrcode,String barcode,String packName,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public AsnOrderItem(Long asnId,String asnCode,Long poDetlId,String poCode,String matnrId,String matnk,Double anfme,String stockUnit,Double purQty,String purUnit,Double qty,String splrCode,String splrName,String qrcode,String barcode,String packName,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.asnId = asnId; |
| | | this.asnCode = asnCode; |
| | | this.poDetlId = poDetlId; |
| | | this.poDetlCode = poDetlCode; |
| | | this.poCode = poCode; |
| | | this.matnrId = matnrId; |
| | | this.matnk = matnk; |
| | | this.anfme = anfme; |
| | |
| | | * erp行号 |
| | | */ |
| | | @ApiModelProperty(value= "erp行号") |
| | | private String erpItemId; |
| | | private String platItemId; |
| | | |
| | | /** |
| | | * 物料编码 |
| | |
| | | |
| | | public PurchaseItem(Long purchaseId,String erpItemId,String matnrCode,String matnrName,String unit,Double anfme,Double qty,Double nromQty,Double asnQty,Double printQty,String splrName,String splrCode,String splrBatch,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.purchaseId = purchaseId; |
| | | this.erpItemId = erpItemId; |
| | | this.platItemId = erpItemId; |
| | | this.matnrCode = matnrCode; |
| | | this.matnrName = matnrName; |
| | | this.unit = unit; |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | |
| | | private String name; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | * 标签码 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | | @ApiModelProperty(value= "标签码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 通知单明细标识 |
| | | */ |
| | | @ApiModelProperty(value= "通知单明细标识") |
| | | private Long asnItemId; |
| | | |
| | | /** |
| | | * PO单明细标识 |
| | | */ |
| | | @ApiModelProperty(value= "PO单明细标识") |
| | | private Long poItemId; |
| | | |
| | | /** |
| | | * 合格数量 |
| | | */ |
| | | @ApiModelProperty(value= "合格数量") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | | * 不合格数量 |
| | | */ |
| | | @ApiModelProperty(value= "不合格数量") |
| | | private Double disQty; |
| | | |
| | | /** |
| | | * 状态 3: 部分合格 2: 不合格 1: 合格 0: 未检查 |
| | | */ |
| | | @ApiModelProperty(value= "状态 3: 部分合格 2: 不合格 1: 合格 0: 未检查 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | |
| | | |
| | | public QlyInspect() {} |
| | | |
| | | public QlyInspect(String code,String name,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public QlyInspect(String code, String name, String barcode, Long asnItemId, Long poItemId, Double safeQty, Double disQty, Integer status, Integer deleted, Integer tenantId, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) { |
| | | this.code = code; |
| | | this.name = name; |
| | | this.barcode = barcode; |
| | | this.asnItemId = asnItemId; |
| | | this.poItemId = poItemId; |
| | | this.safeQty = safeQty; |
| | | this.disQty = disQty; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | |
| | | // QlyInspect qlyInspect = new QlyInspect( |
| | | // null, // 编码[非空] |
| | | // null, // 名称 |
| | | // null, // 标签码 |
| | | // null, // 通知单明细标识 |
| | | // null, // PO单明细标识 |
| | | // null, // 合格数量 |
| | | // null, // 不合格数量 |
| | | // null, // 状态[非空] |
| | | // null, // 是否删除[非空] |
| | | // null, // 租户 |
| | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "冻结"; |
| | | case 3: |
| | | return " 部分合格"; |
| | | case 2: |
| | | return "不合格"; |
| | | case 1: |
| | | return "合格"; |
| | | case 0: |
| | | return "未检查"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String code; |
| | | |
| | | |
| | | @ApiModelProperty(value = "通知单明细标识") |
| | | private Long asnItemId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | |
| | | |
| | | public StockItem() {} |
| | | |
| | | public StockItem(String stockId,Long matnrId,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) { |
| | | public StockItem(String 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; |
| | | this.matnrId = matnrId; |
| | | this.asnItemId = asnItemId; |
| | | this.code = code; |
| | | this.matnrk = matnrk; |
| | | this.anfme = anfme; |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | 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_warehouse_areas_item") |
| | | public class WarehouseAreasItem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 仓库区域 |
| | | */ |
| | | @ApiModelProperty(value= "仓库区域") |
| | | private Long areaId; |
| | | |
| | | /** |
| | | * 区域名称 |
| | | */ |
| | | @ApiModelProperty(value= "区域名称") |
| | | private String areaName; |
| | | |
| | | /** |
| | | * 物料标识 |
| | | */ |
| | | @ApiModelProperty(value= "物料标识") |
| | | private Long matnrId; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String matnrName; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String matnrCode; |
| | | |
| | | /** |
| | | * 条形码 |
| | | */ |
| | | @ApiModelProperty(value= "条形码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 批次号 |
| | | */ |
| | | @ApiModelProperty(value= "批次号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 计量单位 |
| | | */ |
| | | @ApiModelProperty(value= "计量单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 库存单位 |
| | | */ |
| | | @ApiModelProperty(value= "库存单位") |
| | | private String stockUnit; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 货主标识 |
| | | */ |
| | | @ApiModelProperty(value= "货主标识") |
| | | private Long shipperId; |
| | | |
| | | /** |
| | | * 供应商标识 |
| | | */ |
| | | @ApiModelProperty(value= "供应商标识") |
| | | private String splrId; |
| | | |
| | | /** |
| | | * 收货重量 |
| | | */ |
| | | @ApiModelProperty(value= "收货重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | private String prodTime; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBtch; |
| | | |
| | | /** |
| | | * 状态 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 WarehouseAreasItem() {} |
| | | |
| | | public WarehouseAreasItem(Long areaId,String areaName,Long matnrId,String matnrName,String matnrCode,String barcode,Double anfme,String batch,String unit,String stockUnit,String brand,Long shipperId,String splrId,Double weight,String prodTime,String splrBtch,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.areaId = areaId; |
| | | this.areaName = areaName; |
| | | this.matnrId = matnrId; |
| | | this.matnrName = matnrName; |
| | | this.matnrCode = matnrCode; |
| | | this.barcode = barcode; |
| | | this.anfme = anfme; |
| | | this.batch = batch; |
| | | this.unit = unit; |
| | | this.stockUnit = stockUnit; |
| | | this.brand = brand; |
| | | this.shipperId = shipperId; |
| | | this.splrId = splrId; |
| | | this.weight = weight; |
| | | this.prodTime = prodTime; |
| | | this.splrBtch = splrBtch; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // WarehouseAreasItem warehouseAreasItem = new WarehouseAreasItem( |
| | | // 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 getShipperId$(){ |
| | | CompanysService service = SpringUtils.getBean(CompanysService.class); |
| | | Companys companys = service.getById(this.shipperId); |
| | | if (!Cools.isEmpty(companys)){ |
| | | return String.valueOf(companys.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getSplrId$(){ |
| | | CompanysService service = SpringUtils.getBean(CompanysService.class); |
| | | Companys companys = service.getById(this.splrId); |
| | | if (!Cools.isEmpty(companys)){ |
| | | return String.valueOf(companys.getName()); |
| | | } |
| | | return 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.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WarehouseAreasItemMapper extends BaseMapper<WarehouseAreasItem> { |
| | | |
| | | } |
| | |
| | | AsnOrderItem orderItem = new AsnOrderItem(); |
| | | Matnr matnr = matnrService.getOne(new LambdaQueryWrapper<Matnr>().eq(Matnr::getId, item.getMatnrCode())); |
| | | orderItem.setAnfme(item.getAnfme()) |
| | | .setAsnId(purchase.getId()) |
| | | .setAsnId(order.getId()) |
| | | .setQty(item.getQty()) |
| | | .setSplrName(item.getSplrName()) |
| | | .setSplrCode(item.getSplrCode()) |
| | | .setMatnk(item.getMatnrName()) |
| | | .setPoDetlId(item.getId() + "") |
| | | .setPoDetlId(item.getId()) |
| | | .setPoCode(purchase.getCode()) |
| | | .setPurQty(item.getAnfme()) |
| | | .setPurUnit(item.getUnit()) |
| | | .setMatnk(matnr.getName()) |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | |
| | | public interface WarehouseAreasItemService extends IService<WarehouseAreasItem> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.WarehouseAreasItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("warehouseAreasItemService") |
| | | public class WarehouseAreasItemServiceImpl extends ServiceImpl<WarehouseAreasItemMapper, WarehouseAreasItem> implements WarehouseAreasItemService { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.system.constant;
|
| | |
|
| | | import com.vincent.rsf.common.domain.BaseRes;
|
| | |
|
| | | public interface CodeRes extends BaseRes {
|
| | |
|
| | | // user
|
| | | String USER_10001 = "10001-账号不存在";
|
| | | String USER_10002 = "10002-账号已被禁用";
|
| | | String USER_10003 = "10003-密码错误";
|
| | |
|
| | | String PICK_600 = "600-拣料任务";
|
| | | String NO_COMB_700 = "700-请先组托";
|
| | |
|
| | | String SYSTEM_20001 = "20001-许可证已失效";
|
| | |
|
| | | }
|
| | |
| | | package com.vincent.rsf.server.system.controller.param; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "用户名",required = true) |
| | | private String username; |
| | | |
| | | @ApiModelProperty(value = "登录密码", required = true) |
| | | private String password; |
| | | |
| | | @ApiModelProperty("租记标识") |
| | | private Long tenantId; |
| | | |
| | | } |
| | |
| | | package com.vincent.rsf.server.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | |
| | | |
| | | @Data |
| | | @TableName("sys_user_login") |
| | | public class UserLogin implements Serializable { |
| | | public class UserLogin implements Serializable { |
| | | |
| | | public static final int TYPE_LOGIN = 0; // 登录成功 |
| | | public static final int TYPE_ERROR = 1; // 登录失败 |
| | |
| | | /** |
| | | * 登录系统 |
| | | */ |
| | | @TableField("`system`") |
| | | @ApiModelProperty(value= "登录系统") |
| | | private String system; |
| | | |
New file |
| | |
| | | package com.vincent.rsf.server.system.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title CompanyType |
| | | * @description |
| | | * @create 2025/3/10 16:45 |
| | | */ |
| | | public enum CompanyType { |
| | | |
| | | //重置类型:年 |
| | | COMPANY_TYPE_SUPPLIER("supplier", "供应商"), |
| | | //重置类型:月 |
| | | COMPANY_TYPE_SHIPPER("shipper", "货主"), |
| | | //重置类型:日 |
| | | COMPANY_TYPE_CUSTOMER("customer", "客户") |
| | | ; |
| | | |
| | | public String type; |
| | | public String desc; |
| | | |
| | | CompanyType(String type , String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.system.enums;
|
| | |
|
| | | /**
|
| | | * 登录系统类型枚举
|
| | | */
|
| | | public enum LoginSystemType {
|
| | |
|
| | | WMS,
|
| | | WMS_PDA,
|
| | | WCS
|
| | | ;
|
| | |
|
| | | }
|
| | |
| | | -- locale field |
| | | purchaseItem: { |
| | | purchaseId: "purchaseId", |
| | | erpItemId: "erpItemId", |
| | | platItemId: "erpItemId", |
| | | matnrCode: "matnrCode", |
| | | matnrName: "matnrName", |
| | | unit: "unit", |
New file |
| | |
| | | -- save warehouseAreasItem record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.warehouseAreasItem', '0', '/manager/warehouseAreasItem', 'warehouseAreasItem', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 收货区库存信息', '', '1', 'manager:warehouseAreasItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 收货区库存信息', '', '1', 'manager:warehouseAreasItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 收货区库存信息', '', '1', 'manager:warehouseAreasItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 收货区库存信息', '', '1', 'manager:warehouseAreasItem:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | warehouseAreasItem: 'WarehouseAreasItem', |
| | | |
| | | -- locale field |
| | | warehouseAreasItem: { |
| | | areaId: "areaId", |
| | | areaName: "areaName", |
| | | matnrId: "matnrId", |
| | | matnrName: "matnrName", |
| | | matnrCode: "matnrCode", |
| | | barcode: "barcode", |
| | | anfme: "anfme", |
| | | batch: "batch", |
| | | unit: "unit", |
| | | stockUnit: "stockUnit", |
| | | brand: "brand", |
| | | shipperId: "shipperId", |
| | | splrId: "splrId", |
| | | weight: "weight", |
| | | prodTime: "prodTime", |
| | | splrBtch: "splrBtch", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import warehouseAreasItem from './warehouseAreasItem'; |
| | | |
| | | case 'warehouseAreasItem': |
| | | return warehouseAreasItem; |
| | |
| | | #接口明细 |
| | | api: |
| | | #质检上报接口 |
| | | notifyInspect: /report/inspect |
| | | notify-inspect: /report/inspect |
| | | |
| | | #仓库功能参数配置 |
| | | stock: |
| | |
| | | # global-config:
|
| | | # field-strategy: 0
|
| | | configuration:
|
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | map-underscore-to-camel-case: true
|
| | | cache-enabled: true
|
| | | global-config:
|
| | |
| | | logic-delete-value: 1
|
| | | logic-not-delete-value: 0
|
| | |
|
| | | super:
|
| | | pwd: xltys1995
|
| | |
|
| | | logging:
|
| | | file:
|
| | | path: logs/@pom.artifactId@
|
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.WarehouseAreasItemMapper"> |
| | | |
| | | </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.test.mapper.QlyInspectMapper"> |
| | | |
| | | </mapper> |