skyouc
1 天以前 83bebf33f2a141a13a7adef66d09b43145fc29e9
库位信息查询
2个文件已删除
7个文件已修改
1046 ■■■■■ 已修改文件
rsf-admin/src/page/locItem/LocItemCreate.jsx 236 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/locItem/LocItemEdit.jsx 282 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/locItem/LocItemList.jsx 265 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/locItem/LocItemPanel.jsx 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/orders/stock/OrderItemList.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/CompanysController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocItemController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/locItem/LocItemCreate.jsx
File was deleted
rsf-admin/src/page/locItem/LocItemEdit.jsx
@@ -10,6 +10,7 @@
    DateInput,
    SelectInput,
    ReferenceInput,
    SelectArrayInput,
    ReferenceArrayInput,
    AutocompleteInput,
    SaveButton,
@@ -19,6 +20,7 @@
    required,
    useRecordContext,
    DeleteButton,
    useNotify,
} from 'react-admin';
import { useWatch, useFormContext } from "react-hook-form";
import { Stack, Grid, Box, Typography } from '@mui/material';
@@ -28,153 +30,175 @@
import CustomerTopToolBar from "../components/EditTopToolBar";
import MemoInput from "../components/MemoInput";
import StatusSelectInput from "../components/StatusSelectInput";
import request from '@/utils/request';
import DictionarySelect from "../components/DictionarySelect";
import LocQueryList from "./LocQueryList";
const FormToolbar = () => {
    const { getValues } = useFormContext();
    return (
        <Toolbar sx={{ justifyContent: 'end' }}>
            <SaveButton />
            {/* <DeleteButton mutationMode="optimistic" /> */}
        </Toolbar>
    )
}
const LocItemEdit = () => {
    const translate = useTranslate();
    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || [];
    const [warehouseId, setWrehouseId] = useState();
    const warehouseChange = (val) => {
        setWrehouseId(val)
    }
    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 />}
                title={"menu.loc"}
            >
                <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}>
                    <Grid item xs={14} md={10}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.main')}
                        </Typography>
                        <Stack direction='row' gap={2}>
                            <NumberInput
                                label="table.field.locItem.locId"
                                source="locId"
                                autoFocus
                            />
                            <TextInput
                                label="table.field.locItem.locCode"
                                source="locCode"
                                parse={v => v}
                            />
                            <NumberInput
                                label="table.field.locItem.orderId"
                                source="orderId"
                            />
                            <TextInput
                                label="table.field.locItem.type"
                                source="type$"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <NumberInput
                                label="table.field.locItem.orderItemId"
                                source="orderItemId"
                            />
                            <NumberInput
                                label="table.field.locItem.wkType"
                                source="wkType"
                            />
                            <NumberInput
                                label="table.field.locItem.matnrId"
                                source="matnrId"
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.locItem.maktx"
                                source="maktx"
                                parse={v => v}
                            />
                <SimpleForm
                    shouldUnregister
                    warnWhenUnsavedChanges
                    toolbar={false}
                    mode="onTouched"
                    defaultValues={{}}
                // validate={(values) => { }}
                >
                    <Grid container width={{ xs: '100%', xl: '90%' }} rowSpacing={3} columnSpacing={3}
                        sx={{
                            "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": {
                                bgcolor: 'white',
                                WebkitTextFillColor: "rgba(0, 0, 0)"
                            },
                            <TextInput
                                label="table.field.locItem.matnrCode"
                                source="matnrCode"
                                parse={v => v}
                            />
                            <TextInput
                                label="table.field.locItem.trackCode"
                                source="trackCode"
                                parse={v => v}
                            />
                            <TextInput
                                label="table.field.locItem.unit"
                                source="unit"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <NumberInput
                                label="table.field.locItem.anfme"
                                source="anfme"
                            />
                            <NumberInput
                                label="table.field.locItem.qty"
                                source="qty"
                            />
                            <NumberInput
                                label="table.field.locItem.workQty"
                                source="workQty"
                            />
                            <TextInput
                                label="table.field.locItem.batch"
                                source="batch"
                                parse={v => v}
                            />
                        </Stack>
                        <Stack direction='row' gap={2}>
                            <TextInput
                                label="table.field.locItem.splrBatch"
                                source="splrBatch"
                                parse={v => v}
                            />
                            <TextInput
                                label="table.field.locItem.spec"
                                source="spec"
                                parse={v => v}
                            />
                            <TextInput
                                label="table.field.locItem.model"
                                source="model"
                                parse={v => v}
                            />
                            <TextInput
                                label="table.field.locItem.fieldsIndex"
                                source="fieldsIndex"
                                parse={v => v}
                            />
                        </Stack>
                            "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": {
                                bgcolor: 'white',
                                WebkitTextFillColor: "rgba(0, 0, 0)"
                            },
                            "& .MuiFilledInput-root.MuiInputBase-sizeSmall": {
                                bgcolor: 'white',
                            }
                        }}
                    >
                        <Grid item xs={12} md={10}>
                            <Typography variant="h6" gutterBottom>
                                {translate('common.edit.title.main')}
                            </Typography>
                            <Grid container rowSpacing={2} columnSpacing={2}>
                                <Grid item display="flex" gap={2}>
                                    <ReferenceInput
                                        source="warehouseId"
                                        reference="warehouse"
                                    >
                                        <AutocompleteInput
                                            label="table.field.loc.warehouseId"
                                            optionText="name"
                                            readOnly
                                            validate={[required()]}
                                            onChange={warehouseChange}
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
                                    <ReferenceInput
                                        source="areaId"
                                        reference="warehouseAreas"
                                        filter={{ warehouseId }}
                                    >
                                        <AutocompleteInput
                                            label="table.field.loc.areaId"
                                            optionText="name"
                                            readOnly
                                            validate={[required()]}
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
                                    <TextInput
                                        label="table.field.loc.code"
                                        source="code"
                                        parse={v => v}
                                        readOnly
                                        validate={required()}
                                    />
                                    <NumberInput
                                        label="table.field.loc.length"
                                        source="length"
                                        readOnly
                                        validate={required()}
                                    />
                                    <NumberInput
                                        label="table.field.loc.width"
                                        source="width"
                                        readOnly
                                        validate={required()}
                                    />
                                    <NumberInput
                                        label="table.field.loc.height"
                                        source="height"
                                        readOnly
                                        validate={required()}
                                    />
                                </Grid>
                                <Grid item display="flex" gap={1}>
                                    <ReferenceArrayInput source="typeIds" reference="locType" >
                                        <SelectArrayInput label="table.field.loc.type" readOnly validate={[required()]} />
                                    </ReferenceArrayInput>
                                    <TextInput
                                        label="table.field.loc.unit"
                                        source="unit"
                                        readOnly
                                        parse={v => v}
                                    />
                                    <DictionarySelect
                                        label={translate("table.field.loc.useStatus")}
                                        name="useStatus"
                                        validate={[required()]}
                                        readOnly
                                        size="small"
                                        dictTypeCode="sys_loc_use_stas"
                                    />
                                    <NumberInput
                                        label="table.field.loc.row"
                                        source="row"
                                        readOnly
                                        validate={required()}
                                    />
                                    <NumberInput
                                        label="table.field.loc.col"
                                        source="col"
                                        readOnly
                                        validate={required()}
                                    />
                                    <NumberInput
                                        label="table.field.loc.lev"
                                        source="lev"
                                        readOnly
                                        validate={required()}
                                    />
                                </Grid>
                            </Grid>
                        </Grid>
                        <Grid item xs={12} md={2}>
                            <Typography variant="h6" gutterBottom>
                                {translate('common.edit.title.common')}
                            </Typography>
                            <StatusSelectInput readOnly />
                            <Box mt="2em" />
                            <MemoInput />
                        </Grid>
                    </Grid>
                    <Grid item xs={10} md={2}>
                        <Typography variant="h6" gutterBottom>
                            {translate('common.edit.title.common')}
                        </Typography>
                        <StatusSelectInput />
                        <Box mt="2em" />
                        <MemoInput />
                    </Grid>
                </Grid>
            </SimpleForm>
        </Edit >
                </SimpleForm>
            </Edit >
            <LocQueryList />
        </>
    )
}
rsf-admin/src/page/locItem/LocItemList.jsx
@@ -29,22 +29,18 @@
    NumberInput,
    ReferenceInput,
    ReferenceArrayInput,
    useRefresh,
    AutocompleteInput,
    DeleteButton,
    useRefresh,
    Button,
    useList,
} from 'react-admin';
import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
import LocItemCreate from "./LocItemCreate";
import LocItemPanel from "./LocItemPanel";
import EmptyData from "../components/EmptyData";
import MyCreateButton from "../components/MyCreateButton";
import MyExportButton from '../components/MyExportButton';
import PageDrawer from "../components/PageDrawer";
import MyField from "../components/MyField";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
import request from '@/utils/request';
import LocListAside from "./LocListAside";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -56,49 +52,97 @@
    '& .column-name': {
    },
    '& .opt': {
        width: 100
        width: 180
    },
    '& .type .MuiTypography-root': {
        whiteSpace: 'nowrap',
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        display: 'block',
        width: 'auto',
    },
}));
const filters = [
    <SearchInput source="condition" alwaysOn />,
    <DateInput label='common.time.after' source="timeStart" />,
    <DateInput label='common.time.before' source="timeEnd" />,
    <NumberInput source="locId" label="table.field.locItem.locId" />,
    <TextInput source="locCode" label="table.field.locItem.locCode" />,
    <NumberInput source="orderId" label="table.field.locItem.orderId" />,
    <TextInput source="type" label="table.field.locItem.type" />,
    <NumberInput source="orderItemId" label="table.field.locItem.orderItemId" />,
    <NumberInput source="wkType" label="table.field.locItem.wkType" />,
    <NumberInput source="matnrId" label="table.field.locItem.matnrId" />,
    <TextInput source="maktx" label="table.field.locItem.maktx" />,
    <TextInput source="matnrCode" label="table.field.locItem.matnrCode" />,
    <TextInput source="trackCode" label="table.field.locItem.trackCode" />,
    <TextInput source="unit" label="table.field.locItem.unit" />,
    <NumberInput source="anfme" label="table.field.locItem.anfme" />,
    <NumberInput source="qty" label="table.field.locItem.qty" />,
    <NumberInput source="workQty" label="table.field.locItem.workQty" />,
    <TextInput source="batch" label="table.field.locItem.batch" />,
    <TextInput source="splrBatch" label="table.field.locItem.splrBatch" />,
    <TextInput source="spec" label="table.field.locItem.spec" />,
    <TextInput source="model" label="table.field.locItem.model" />,
    <TextInput source="fieldsIndex" label="table.field.locItem.fieldsIndex" />,
    <TextInput label="common.field.memo" source="memo" />,
    <SelectInput
        label="common.field.status"
        source="status"
        choices={[
            { id: '1', name: 'common.enums.statusTrue' },
            { id: '0', name: 'common.enums.statusFalse' },
        ]}
        resettable
    />,
]
const LocItemList = () => {
    const translate = useTranslate();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    const [initDialog, setInitDialog] = useState(false);
    const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_use_stas')) || [];
    const locType = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || [];
    const filters = [
        <SearchInput source="condition" alwaysOn />,
        <ReferenceInput
            source="warehouseId"
            label="table.field.loc.warehouseId"
            reference="warehouse"
        >
            <AutocompleteInput
                label="table.field.loc.warehouseId"
                optionText="name"
                filterToQuery={(val) => ({ name: val })}
            />
        </ReferenceInput>,
        <ReferenceInput
            source="areaId"
            label="table.field.loc.areaId"
            reference="warehouseAreas"
        >
            <AutocompleteInput
                label="table.field.loc.areaId"
                optionText="name"
                filterToQuery={(val) => ({ name: val })}
            />
        </ReferenceInput>,
        <AutocompleteInput
            choices={dicts}
            optionText="label"
            label="table.field.loc.useStatus"
            source="useStatus"
            optionValue="value"
            parse={v => v}
        />,
        <TextInput source="code" label="table.field.loc.code" />,
        <AutocompleteInput
            choices={locType}
            optionText="label"
            label="table.field.loc.type"
            source="type"
            optionValue="value"
            parse={v => v}
        />, <TextInput source="name" label="table.field.loc.name" />,
        <NumberInput source="flagLogic" label="table.field.loc.flagLogic" />,
        <TextInput source="fucAtrrs" label="table.field.loc.fucAtrrs" />,
        <TextInput source="barcode" label="table.field.loc.barcode" />,
        <TextInput source="unit" label="table.field.loc.unit" />,
        <TextInput source="size" label="table.field.loc.size" />,
        <NumberInput source="row" label="table.field.loc.row" />,
        <NumberInput source="col" label="table.field.loc.col" />,
        <NumberInput source="lev" label="table.field.loc.lev" />,
        <NumberInput source="channel" label="table.field.loc.channel" />,
        <NumberInput source="maxParts" label="table.field.loc.maxParts" />,
        <NumberInput source="maxPack" label="table.field.loc.maxPack" />,
        <NumberInput source="flagLabelMange" label="table.field.loc.flagLabelMange" />,
        <TextInput source="locAttrs" label="table.field.loc.locAttrs" />,
        <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
        />,
    ]
    return (
        <Box display="flex">
@@ -109,8 +153,10 @@
                        theme.transitions.create(['all'], {
                            duration: theme.transitions.duration.enteringScreen,
                        }),
                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                    marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                }}
                storeKey="locItem"
                resource="loc"
                title={"menu.locItem"}
                empty={false}
                filters={filters}
@@ -118,107 +164,46 @@
                actions={(
                    <TopToolbar>
                        <FilterButton />
                        {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */}
                        <SelectColumnsButton preferenceKey='locItem' />
                        {/* <MyExportButton /> */}
                        <SelectColumnsButton preferenceKey='loc' />
                    </TopToolbar>
                )}
                perPage={DEFAULT_PAGE_SIZE}
                aside={<LocListAside />}
            >
                <DynamicFields />
                <StyledDatagrid
                    preferenceKey='locItem'
                    align="left"
                    bulkActionButtons={false}
                    rowClick={() => false}
                    omit={['id', 'createTime', 'createBy', 'memo', 'updateTime', 'updateBy']}
                >
                    <NumberField source="id" />
                    <NumberField source="warehouseId$" label="table.field.loc.warehouseId" />
                    <NumberField source="areaId$" label="table.field.loc.areaId" />
                    <TextField source="code" label="table.field.loc.code" />
                    <TextField source="typeIds$" label="table.field.loc.type" cellClassName="type" />
                    <TextField source="barcode" label="table.field.loc.barcode" />
                    <TextField source="length" label="table.field.loc.length" />
                    <TextField source="width" label="table.field.loc.width" />
                    <TextField source="height" label="table.field.loc.height" />
                    <NumberField source="row" label="table.field.loc.row" />
                    <NumberField source="col" label="table.field.loc.col" />
                    <NumberField source="lev" label="table.field.loc.lev" />
                    <NumberField source="channel" label="table.field.loc.channel" />
                    <TextField source="useStatus$" label="table.field.loc.useStatus" />
                    <TextField source="updateBy$" label="common.field.updateBy" />
                    <DateField source="updateTime" label="common.field.updateTime" showTime align="left" />
                    <TextField source="createBy$" label="common.field.createBy" />
                    <DateField source="createTime" label="common.field.createTime" showTime align="left" />
                    <BooleanField source="statusBool" label="common.field.status" sortable={false} align="left" />
                    <TextField source="memo" label="common.field.memo" sortable={false} />
                    <WrapperField cellClassName="opt" label="common.field.opt">
                        <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} resource="locItem" label="toolbar.detail" />
                    </WrapperField>
                </StyledDatagrid>
            </List>
            <LocItemCreate
                open={createDialog}
                setOpen={setCreateDialog}
            />
            <PageDrawer
                title='LocItem Detail'
                drawerVal={drawerVal}
                setDrawerVal={setDrawerVal}
            >
            </PageDrawer>
        </Box>
    )
}
export default LocItemList;
const DynamicFields = (props) => {
    const translate = useTranslate();
    const notify = useNotify();
    const [columns, setColumns] = useState([]);
    const { isLoading } = useListContext();
    const refresh = useRefresh();
    useEffect(() => {
        getDynamicFields();
    }, []);
    const getDynamicFields = async () => {
        const { data: { code, data, msg }, } = await request.get("/fields/enable/list");
        if (code == 200) {
            const arr = [
                <NumberField source="id" />,
                <NumberField source="locId" label="table.field.locItem.locId" />,
                <TextField source="wareArea" label="table.field.locItem.wareArea" />,
                <TextField source="locCode" label="table.field.locItem.locCode" />,
                <NumberField source="orderId" label="table.field.locItem.orderId" />,
                <TextField source="type$" label="table.field.locItem.type" />,
                <NumberField source="orderItemId" label="table.field.locItem.orderItemId" />,
                <NumberField source="wkType$" label="table.field.locItem.wkType" />,
                <NumberField source="matnrId" label="table.field.locItem.matnrId" />,
                <TextField source="matnrCode" label="table.field.locItem.matnrCode" />,
                <TextField source="maktx" label="table.field.locItem.maktx" />,
                <TextField source="spec" label="table.field.locItem.spec" />,
                <TextField source="model" label="table.field.locItem.model" />,
                <TextField source="batch" label="table.field.locItem.batch" />,
                <TextField source="trackCode" label="table.field.locItem.trackCode" />,
                <TextField source="unit" label="table.field.locItem.unit" />,
                <NumberField source="anfme" label="table.field.locItem.anfme" />,
                <NumberField source="workQty" label="table.field.locItem.workQty" />,
                <NumberField source="qty" label="table.field.locItem.qty" />,
                <TextField source="splrBatch" label="table.field.locItem.splrBatch" />,
                <TextField source="fieldsIndex" label="table.field.locItem.fieldsIndex" />,
            ]
            const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />)
            const lastArr = [
                <TextField source="updateBy$" label="common.field.updateBy" />,
                <DateField source="updateTime" label="common.field.updateTime" showTime />,
                <TextField source="createBy$" label="common.field.createBy" />,
                <DateField source="createTime" label="common.field.createTime" showTime />,
                <BooleanField source="statusBool" label="common.field.status" sortable={false} />,
                <TextField source="memo" label="common.field.memo" sortable={false} />,
            ]
            setColumns([...arr, ...fields, ...lastArr]);
        } else {
            notify(msg);
        }
    }
    return (
        <Box sx={{ position: 'relative', minHeight: "60vh", }}>
            {isLoading && (
                <LinearProgress
                    sx={{
                        height: "2px",
                        position: 'absolute',
                        top: 0,
                        left: 0,
                        right: 0,
                    }}
                />
            )}
            {columns.length > 0 &&
                <StyledDatagrid
                    preferenceKey='locItem'
                    bulkActionButtons={false}
                    rowClick={false}
                    expand={false}
                    expandSingle={true}
                    omit={['id', 'createTime','spec', 'model', 'locId', 'orderId', 'trackCode', 'orderItemId', 'matnrId', 'splrBatch','createBy', 'memo', 'fieldsIndex']}
                >
                    {columns.map((column) => column)}
                </StyledDatagrid>}
        </Box>
    )
}
export default LocItemList;
rsf-admin/src/page/locItem/LocItemPanel.jsx
File was deleted
rsf-admin/src/page/orders/stock/OrderItemList.jsx
@@ -68,8 +68,6 @@
    <TextInput source="matnrId" label="table.field.stockItem.matnrId" />,
    <TextInput source="matnrCode" label="table.field.stockItem.matnrCode" />,
    <TextInput source="maktx" label="table.field.stockItem.maktx" />,
    <TextInput source="locCode" label="table.field.loc.code" />,
    <TextInput source="barcode" label="table.field.task.barcode" />,
    <NumberInput source="anfme" label="table.field.stockItem.anfme" />,
    <TextInput source="stockUnit" label="table.field.stockItem.stockUnit" />,
    <NumberInput source="workQty" label="table.field.stockItem.workQty" />,
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/CompanysController.java
@@ -115,20 +115,6 @@
        if (Objects.isNull(companys.getType())) {
            throw new CoolException("类型不能为空!!");
        }
//        Companys companys1 = companysService.getById(companys.getId());
        List<Companys> warehouses = companysService.list(new LambdaQueryWrapper<Companys>()
                .eq(Companys::getName, companys.getName())
                .eq(Companys::getType, companys.getType())
                .eq(Companys::getBreifCode, companys.getBreifCode()));
        if (!warehouses.isEmpty()) {
            throw new CoolException("企业已存在!!");
        }
        if (!companysService.list(new LambdaQueryWrapper<Companys>()
                .eq(Companys::getType, companys.getType())
                .eq(Companys::getName, companys.getName())
                .eq(Companys::getCode, companys.getBreifCode())).isEmpty()) {
            throw new CoolException("企业编码重复!!");
        }
        if (!companysService.updateById(companys)) {
            return R.error("Update Fail");
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocItemController.java
@@ -13,6 +13,7 @@
import com.vincent.rsf.server.common.utils.FieldsUtils;
import com.vincent.rsf.server.manager.entity.LocItem;
import com.vincent.rsf.server.manager.service.LocItemService;
import com.vincent.rsf.server.manager.service.LocService;
import com.vincent.rsf.server.system.controller.BaseController;
import com.vincent.rsf.server.manager.enums.LocStsType;
import io.swagger.annotations.ApiOperation;
@@ -28,6 +29,8 @@
    @Autowired
    private LocItemService locItemService;
    @Autowired
    private LocService locService;
    @PreAuthorize("hasAuthority('manager:locItem:list')")
    @PostMapping("/locItem/page")
@@ -138,7 +141,7 @@
    @PreAuthorize("hasAuthority('manager:locItem:list')")
    @GetMapping("/locItem/{id}")
    public R get(@PathVariable("id") Long id) {
        return R.ok().add(locItemService.getById(id));
        return R.ok().add(locService.getById(id));
    }
    @PreAuthorize("hasAuthority('manager:locItem:save')")
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -5,17 +5,11 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.manager.entity.Loc;
import com.vincent.rsf.server.manager.entity.Task;
import com.vincent.rsf.server.manager.entity.TaskItem;
import com.vincent.rsf.server.manager.entity.*;
import com.vincent.rsf.server.manager.enums.*;
import com.vincent.rsf.server.manager.mapper.LocItemMapper;
import com.vincent.rsf.server.manager.entity.LocItem;
import com.vincent.rsf.server.manager.service.LocItemService;
import com.vincent.rsf.server.manager.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vincent.rsf.server.manager.service.LocService;
import com.vincent.rsf.server.manager.service.TaskItemService;
import com.vincent.rsf.server.manager.service.TaskService;
import com.vincent.rsf.server.system.constant.SerialRuleCode;
import com.vincent.rsf.server.system.utils.SerialRuleUtils;
import lombok.Synchronized;
@@ -25,10 +19,8 @@
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.lang.reflect.Array;
import java.util.*;
import java.util.stream.Collectors;
@Service("locItemService")
@@ -42,6 +34,8 @@
    private TaskItemService taskItemService;
    @Autowired
    private LocItemService locItemService;
    @Autowired
    private DeviceSiteService deviceSiteService;
    /**
@@ -104,20 +98,38 @@
                throw new CoolException("托盘任务执行中,不能重复创建!");
            }
            List<Integer> list = Arrays.asList(TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_PICK_AGAIN_OUT.type);
            if (type.equals("stock")) {
                Double useQty  = Math.round((outQty + workQty) * 10000) / 10000.0;
                if (orgQty.compareTo(useQty) > 0) {
                    //拣料出库
                    task.setTaskType(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type);
                    DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                            .eq(DeviceSite::getSite, loc.getCode()).eq(DeviceSite::getType, TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) );
                    if (Objects.isNull(deviceSite)) {
                        throw new CoolException("站点支持拣料出库!!");
                    }
                } else {
                    //全板出库
                    task.setTaskType(TaskType.TASK_TYPE_OUT.type);
                    DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                            .eq(DeviceSite::getSite, loc.getCode()).eq(DeviceSite::getType, TaskType.TASK_TYPE_OUT.type) );
                    if (Objects.isNull(deviceSite)) {
                        throw new CoolException("站点支持全板出库!!");
                    }
                }
            } else if (type.equals("check")) {
                //盘点出库
                task.setTaskType(TaskType.TASK_TYPE_CHECK_OUT.type);
                DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>()
                        .eq(DeviceSite::getSite, loc.getCode()).eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type) );
                if (Objects.isNull(deviceSite)) {
                    throw new CoolException("站点支持盘点出库!!");
                }
            }
            if (!taskService.save(task)) {
                throw new CoolException("任务创建失败!!");
            }
@@ -138,7 +150,7 @@
                    throw new CoolException("库存信息不存在!");
                }
                if (locItem.getOutQty().compareTo(0.0) < 0) {
                if (item.getOutQty().compareTo(0.0) < 0) {
                    throw new CoolException("出库数里不能小于0!!");
                }
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -687,6 +687,38 @@
            throw new CoolException("任务状态更新失败!!");
        }
        List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId()));
        for (int i = 0; i < taskItems.size(); i++) {
            TaskItem taskItem = taskItems.get(i);
            LocItemWorking locWorking = locItemWorkingService.getOne(new LambdaQueryWrapper<LocItemWorking>()
                    .eq(LocItemWorking::getTaskId, taskItem.getTaskId())
                    .eq(StringUtils.isNotBlank(taskItem.getBatch()), LocItemWorking::getBatch, taskItem.getBatch())
                    .eq(StringUtils.isNotBlank(taskItem.getFieldsIndex()), LocItemWorking::getFieldsIndex, taskItem.getFieldsIndex())
                    .eq(LocItemWorking::getMatnrId, taskItem.getMatnrId()));
            if (Objects.isNull(locWorking)) {
                throw new CoolException("数据错误,作业中库存数据丢失!!");
            }
            if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) {
                locWorking.setWorkQty(0.0);
                locWorking.setAnfme(taskItem.getAnfme());
            } else {
                if (locWorking.getAnfme().compareTo(taskItem.getAnfme()) >= 0) {
                    locWorking.setWorkQty(0.0);
                    locWorking.setAnfme(Math.round((locWorking.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0);
                } else {
                    continue;
                }
            }
            if (!locItemWorkingService.updateById(locWorking)) {
                throw new CoolException("临时库存更新失败!!");
            }
            taskItems.get(i).setAnfme(locWorking.getAnfme());
        }
        if (!taskItemService.updateBatchById(taskItems)) {
            throw new CoolException("任务明细更新失败!!");
        }
        Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc()));
        if (Objects.isNull(one)) {
            throw new CoolException("目标库位不存在!!");
@@ -798,6 +830,11 @@
                throw new CoolException("库存状态更新失败!!");
            }
            //全板出库,删除临时库存
           if (!locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId()))) {
               throw new CoolException("临时库存清除失败!!");
           }
        }
    }