| | |
| | | }, |
| | | placeholder: 'Please enter your search content', |
| | | }, |
| | | aside: { |
| | | category: 'Category', |
| | | material: 'Material(default)', |
| | | supplier: 'Supplier', |
| | | warehouse: 'Warehouse', |
| | | batch: 'Batch', |
| | | dynamicFields: 'Dynamic Fields' |
| | | } |
| | | }, |
| | | filters: { |
| | | lastCreated: 'Last created', |
| | |
| | | type: "type", |
| | | orderItemId: "orderItemId", |
| | | wkType: "wkType", |
| | | aggType: "Agg Type", |
| | | matnrId: "matnrId", |
| | | maktx: "maktx", |
| | | matnrCode: "matnrCode", |
| | |
| | | }, |
| | | placeholder: '请输入搜索内容', |
| | | }, |
| | | aside: { |
| | | category: '汇总分类', |
| | | material: '物料(默认)', |
| | | supplier: '供应商', |
| | | warehouse: '仓库', |
| | | batch: '批次', |
| | | dynamicFields: '动态字段' |
| | | } |
| | | }, |
| | | filters: { |
| | | lastCreated: '最近创建', |
| | |
| | | matnrCode: "物料编码", |
| | | maktx: "物料名称", |
| | | anfme: "数量", |
| | | stockUnit: "stockUnit", |
| | | stockUnit: "单位", |
| | | workQty: "执行数", |
| | | purQty: "采购数", |
| | | purUnit: "采购单位", |
| | |
| | | type: "单据类型", |
| | | orderItemId: "单据明细ID", |
| | | wkType: "业务类型", |
| | | aggType: "汇总类型", |
| | | matnrId: "物料ID", |
| | | maktx: "物料名称", |
| | | unit: '单位', |
| | |
| | | workQty: '执行数', |
| | | qty: '不可用库存', |
| | | splrId: '供应商', |
| | | batch: "供应商批次", |
| | | splrBatch: "供应商批次", |
| | | batch: "批次", |
| | | splrBatch: "批次", |
| | | spec: "规格", |
| | | model: "型号", |
| | | fieldsIndex: "动态索引", |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import request from '@/utils/request'; |
| | | import { |
| | | SavedQueriesList, |
| | | FilterLiveSearch, |
| | | useNotify, |
| | | useListContext, |
| | | SearchInput, |
| | | FilterList, |
| | | FilterListItem, |
| | | } from 'react-admin'; |
| | | import BookmarkIcon from '@mui/icons-material/BookmarkBorder'; |
| | | import { Box, Typography, Card, CardContent, useTheme, Input } from '@mui/material'; |
| | | import CategoryIcon from '@mui/icons-material/LocalOffer'; |
| | | |
| | | |
| | | const WarehouseAside = () => { |
| | | const [isSelect, setIsSelect] = useState(false); |
| | | const isSelected = (value, filters) => { |
| | | const aggType = filters.aggType || []; |
| | | return aggType.includes(value.aggType); |
| | | }; |
| | | |
| | | const toggleFilter = (value, filters) => { |
| | | const aggType = filters.type || []; |
| | | return { |
| | | aggType: value.aggType, |
| | | }; |
| | | }; |
| | | |
| | | return ( |
| | | <Card |
| | | sx={{ |
| | | order: -1, |
| | | mr: 2, |
| | | mt: 8, |
| | | alignSelf: 'flex-start', |
| | | width: 250, |
| | | minWidth: 150, |
| | | height: `87%`, |
| | | "& .MuiTypography-root": {fontSize: '1rem'} |
| | | }} |
| | | > |
| | | <FilterList label="common.aside.category" icon={<CategoryIcon />} sx={{ml: 2}}> |
| | | <FilterListItem |
| | | label="common.aside.material" |
| | | value={{ aggType: 'matnr' }} |
| | | isSelected={isSelected} |
| | | toggleFilter={toggleFilter} |
| | | /> |
| | | <FilterListItem |
| | | label="common.aside.supplier" |
| | | value={{ aggType: 'supplier' }} |
| | | isSelected={isSelected} |
| | | toggleFilter={toggleFilter} |
| | | /> |
| | | <FilterListItem |
| | | label="common.aside.warehouse" |
| | | value={{ aggType: 'warehouse' }} |
| | | isSelected={isSelected} |
| | | toggleFilter={toggleFilter} |
| | | /> |
| | | <FilterListItem |
| | | label="common.aside.batch" |
| | | value={{ aggType: 'batch' }} |
| | | isSelected={isSelected} |
| | | toggleFilter={toggleFilter} |
| | | /> |
| | | <FilterListItem |
| | | label="common.aside.dynamicFields" |
| | | value={{ aggType: 'fieldsIndex' }} |
| | | isSelected={isSelected} |
| | | toggleFilter={toggleFilter} |
| | | /> |
| | | </FilterList> |
| | | |
| | | </Card> |
| | | |
| | | ) |
| | | } |
| | | |
| | | export default WarehouseAside; |
| | |
| | | } from 'react-admin'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import { Grid, Stack, width } from "@mui/system"; |
| | | import request from '@/utils/request'; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | |
| | | aria-hidden |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="lg" |
| | | maxWidth="xl" |
| | | > |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <DialogContent> |
| | | <Grid item sx={24}> |
| | | <List |
| | | storeKey="selectPurchase" |
| | | resource="purchase/filters" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | marginTop: 8, |
| | | height: 500, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: 0, |
| | | }} |
| | | // filters={<CustomFilter />} |
| | | queryOptions={{ meta: { ...params } }} |
| | | empty={false} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={false} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='selectPurchase' |
| | | bulkActionButtons={ |
| | | <> |
| | | <ConfirmSelectButton |
| | | setOpen={setOpen} |
| | | setPoItemDialog={setPoItemDialog} |
| | | setItem={setItem} |
| | | mutationMode="pessimistic" /> |
| | | </> |
| | | } |
| | | rowClick={false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'channel', 'platCode', 'memo', 'channel', 'startTime', 'workQty', 'endTime']} |
| | | <Box display="flex"> |
| | | <List |
| | | resource="warehouse/stock/histories" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: 0, |
| | | }} |
| | | title={"menu.stockItem"} |
| | | empty={false} |
| | | filter={{ stock: record }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <SelectColumnsButton preferenceKey='stockHistories' /> |
| | | {/* <MyExportButton /> */} |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.purchase.code" /> |
| | | <TextField source="type$" label="table.field.purchase.type" /> |
| | | <TextField source="wkType$" label="table.field.purchase.wkType" /> |
| | | <TextField source="source" label="table.field.purchase.source" /> |
| | | <NumberField source="anfme" label="table.field.purchase.anfme" /> |
| | | <NumberField source="qty" label="table.field.purchase.qty" /> |
| | | <TextField source="channel" label="table.field.purchase.channel" /> |
| | | <TextField source="platCode" label="table.field.purchase.platCode" /> |
| | | <DateField source="preArr" label="table.field.purchase.preArr" showTime /> |
| | | <DateField source="startTime" label="table.field.purchase.startTime" showTime /> |
| | | <DateField source="endTime" label="table.field.purchase.endTime" showTime /> |
| | | <TextField source="project" label="table.field.purchase.project" /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <StyledDatagrid |
| | | preferenceKey='stockHistories' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'orderId', 'sourceItemId', 'matnrId', 'createBy', 'barcode', 'splrCode', 'splrBatch', 'updateBy$', 'createBy$', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="orderId" label="table.field.stockItem.orderId" /> |
| | | <TextField source="orderCode" label="table.field.stockItem.orderCode" /> |
| | | <TextField source="sourceItemId" label="table.field.stockItem.sourceItemId" /> |
| | | <TextField source="matnrId" label="table.field.stockItem.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.stockItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.stockItem.maktx" /> |
| | | <NumberField source="anfme" label="table.field.stockItem.anfme" /> |
| | | <TextField source="stockUnit" label="table.field.stockItem.stockUnit" /> |
| | | <NumberField source="workQty" label="table.field.stockItem.workQty" /> |
| | | <NumberField source="qty" label="table.field.stockItem.qty" /> |
| | | <TextField source="splrCode" label="table.field.stockItem.splrCode" /> |
| | | <TextField source="batch" label="table.field.stockItem.batch" /> |
| | | <TextField source="splrBatch" label="table.field.stockItem.splrBatch" /> |
| | | <TextField source="splrName" label="table.field.stockItem.splrName" /> |
| | | <TextField source="trackCode" label="table.field.stockItem.trackCode" /> |
| | | <TextField source="barcode" label="table.field.stockItem.barcode" /> |
| | | <TextField source="prodTime" label="table.field.stockItem.prodTime" /> |
| | | <TextField source="packName" label="table.field.stockItem.packName" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | </Box> |
| | | </Grid> |
| | | </DialogContent> |
| | | </Grid> |
| | |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import request from '@/utils/request'; |
| | | import { Add, Edit, Delete } from '@mui/icons-material'; |
| | | import _, { set } from 'lodash'; |
| | | import { DataGrid, useGridApiRef, GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF, getGridDateOperators, useGridApiContext } from '@mui/x-data-grid'; |
| | | import { LocalizationProvider, DatePicker, DateTimePicker } from '@mui/x-date-pickers'; |
| | | import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; |
| | |
| | | const handleSubmit = async () => { |
| | | setFinally() |
| | | setDisabled(true) |
| | | const parmas = { |
| | | "purchaseId": record, |
| | | "items": tabelData, |
| | | } |
| | | const res = await request.post(`/asnOrder/purchases/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | notify(res.data.msg); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | // const parmas = { |
| | | // "purchaseId": record, |
| | | // "items": tabelData, |
| | | // } |
| | | // const res = await request.post(`/asnOrder/purchases/save`, parmas); |
| | | // if (res?.data?.code === 200) { |
| | | // notify(res.data.msg); |
| | | // } else { |
| | | // notify(res.data.msg); |
| | | // } |
| | | setOpen(false); |
| | | refresh(); |
| | | resetData() |
| | |
| | | }; |
| | | |
| | | const requestGetBody = async () => { |
| | | const res = await request.post(`warehouse/stock/page`, { matnrCode: record }); |
| | | const res = await request.post(`warehouse/stock/info`, { stock: record, aggType: record?.aggType }); |
| | | if (res?.data?.code === 200) { |
| | | setTableData(res.data.data.records) |
| | | } else { |
| | |
| | | |
| | | const [columns, setColumns] = useState([ |
| | | { |
| | | field: 'warehouse', |
| | | headerName: translate('table.field.warehouseStock.warehouse'), |
| | | width: 130, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'matnrCode', |
| | | headerName: translate('table.field.asnOrderItem.matnrCode'), |
| | | width: 130, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'matnrName', |
| | | field: 'maktx', |
| | | headerName: translate('table.field.asnOrderItem.maktx'), |
| | | width: 250, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'splrName', |
| | | headerName: translate('table.field.asnOrderItem.splrName') + "*", |
| | | field: 'locCode', |
| | | headerName: translate('table.field.warehouseStock.locCode'), |
| | | minWidth: 150, |
| | | flex: 1, |
| | | editable: false, |
| | |
| | | ), |
| | | }, |
| | | { |
| | | field: 'platItemId', |
| | | headerName: translate('table.field.asnOrderItem.platItemId') + "*", |
| | | field: 'batch', |
| | | headerName: translate('table.field.warehouseStock.splrBatch'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'anfme', |
| | | headerName: translate('table.field.asnOrderItem.anfme') + "*", |
| | | headerName: translate('table.field.warehouseStock.anfme'), |
| | | type: 'number', |
| | | minWidth: 100, |
| | | flex: 1, |
| | |
| | | }, |
| | | { |
| | | field: 'qty', |
| | | headerName: translate('table.field.asnOrderItem.qty') + "*", |
| | | headerName: translate('table.field.warehouseStock.qty'), |
| | | type: 'number', |
| | | minWidth: 100, |
| | | flex: 1, |
| | |
| | | }, |
| | | { |
| | | field: 'unit', |
| | | headerName: translate('table.field.asnOrderItem.stockUnit'), |
| | | headerName: translate('table.field.warehouseStock.unit'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: false, |
| | |
| | | ReferenceArrayInput, |
| | | useRefresh, |
| | | AutocompleteInput, |
| | | required, |
| | | DeleteButton, |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | 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 WarehouseStockCreate from "./WarehouseStockCreate"; |
| | | import WarehouseStockInfo from "./WarehouseStockInfo"; |
| | | import MatnrListAside from "./MatnrListAside"; |
| | | import MatnrListAside from "./WarehouseAside"; |
| | | import WarehouseHistories from "./WarehouseHistories"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 220 |
| | | width: 180 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="locId" label="table.field.locItem.locId" />, |
| | | <TextInput source="locCode" label="table.field.locItem.locCode" />, |
| | | <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="unit" label="table.field.locItem.unit" />, |
| | | <NumberInput source="anfme" label="table.field.locItem.anfme" />, |
| | | <NumberInput source="workQty" label="table.field.locItem.workQty" />, |
| | | <TextInput source="batch" label="table.field.locItem.batch" />, |
| | | <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" />, |
| | | ] |
| | | |
| | | const WarehouseStockList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [matnrCode, setMatnrCode] = useState(''); |
| | | const [select, setSelect] = useState({}); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="locId" label="table.field.locItem.locId" />, |
| | | <TextInput source="locCode" label="table.field.locItem.locCode" />, |
| | | <TextInput source="type" label="table.field.locItem.type" />, |
| | | <ReferenceInput source="aggType" reference="dictData" filter={{ dictTypeCode: 'sys_stock_summary_code' }} alwaysOn> |
| | | <AutocompleteInput optionText='label' optionValue="value" label="table.field.locItem.aggType" /> |
| | | </ReferenceInput>, |
| | | <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="unit" label="table.field.locItem.unit" />, |
| | | <NumberInput source="anfme" label="table.field.locItem.anfme" />, |
| | | <NumberInput source="workQty" label="table.field.locItem.workQty" />, |
| | | <TextInput source="batch" label="table.field.locItem.batch" />, |
| | | <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" />, |
| | | ] |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: 0, |
| | | }} |
| | | resource="warehouse/stock" |
| | | title={"common.button.detail"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='locItem' /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <> |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: 0, |
| | | }} |
| | | resource="warehouse/stock" |
| | | title={"common.button.detail"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='viewStockManage' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | aside={<MatnrListAside />} |
| | | > |
| | | <DynamicFields |
| | | setDrawerVal={setDrawerVal} |
| | | setCreateDialog={setCreateDialog} |
| | | setSelect={setSelect} |
| | | /> |
| | | </List> |
| | | <WarehouseStockInfo |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | record={select} |
| | | /> |
| | | <WarehouseHistories |
| | | open={drawerVal} |
| | | setOpen={setDrawerVal} |
| | | record={select} |
| | | /> |
| | | </Box> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default WarehouseStockList; |
| | | |
| | | |
| | | const DynamicFields = (props) => { |
| | | const {setDrawerVal, setCreateDialog, setSelect} = 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.warehouseStock.locId" />, |
| | | <TextField source="locCode" label="table.field.warehouseStock.locCode" />, |
| | | <NumberField source="orderId" label="table.field.warehouseStock.orderId" />, |
| | | <NumberField source="orderItemId" label="table.field.warehouseStock.orderItemId" />, |
| | | <NumberField source="matnrId" label="table.field.warehouseStock.matnrId" />, |
| | | <TextField source="matnrCode" label="table.field.warehouseStock.matnrCode" />, |
| | | <TextField source="maktx" label="table.field.warehouseStock.maktx" />, |
| | | <NumberField source="anfme" label="table.field.warehouseStock.anfme" />, |
| | | <NumberField source="workQty" label="table.field.warehouseStock.qty" />, |
| | | <TextField source="spec" label="table.field.warehouseStock.spec" />, |
| | | <TextField source="model" label="table.field.warehouseStock.model" />, |
| | | <TextField source="batch" label="table.field.warehouseStock.batch" />, |
| | | <TextField source="unit" label="table.field.warehouseStock.unit" />, |
| | | <TextField source="fieldsIndex" label="table.field.warehouseStock.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 />, |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <HistoriesButton setDrawerVal={setDrawerVal} setSelect={setSelect} /> |
| | | <StockInfoButton setCreateDialog={setCreateDialog} setSelect={setSelect} /> |
| | | </WrapperField> |
| | | ] |
| | | 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' |
| | | preferenceKey='viewStockManage' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'locId', 'spec', 'model', 'locCode', 'orderId', 'orderItemId', 'matnrId', 'splrBatch', 'createBy', 'memo', 'fieldsIndex']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="locId" label="table.field.warehouseStock.locId" /> |
| | | <TextField source="locCode" label="table.field.warehouseStock.locCode" /> |
| | | <NumberField source="orderId" label="table.field.warehouseStock.orderId" /> |
| | | <NumberField source="orderItemId" label="table.field.warehouseStock.orderItemId" /> |
| | | <NumberField source="matnrId" label="table.field.warehouseStock.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.warehouseStock.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.warehouseStock.maktx" /> |
| | | <NumberField source="anfme" label="table.field.warehouseStock.anfme" /> |
| | | <NumberField source="workQty" label="table.field.warehouseStock.qty" /> |
| | | <TextField source="spec" label="table.field.warehouseStock.spec" /> |
| | | <TextField source="model" label="table.field.warehouseStock.model" /> |
| | | {/* <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> */} |
| | | {/* <ReferenceField source="splrId" label="table.field.warehouseStock.splrId" reference="companys"> |
| | | <TextField source="name" filterToQuery={(val) => ({ name: val })} /> |
| | | </ReferenceField>, */} |
| | | <TextField source="batch" label="table.field.warehouseStock.batch" /> |
| | | <TextField source="unit" label="table.field.warehouseStock.unit" /> |
| | | <TextField source="fieldsIndex" label="table.field.warehouseStock.fieldsIndex" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <StockInfoButton /> |
| | | <HistoriesButton setCreateDialog={setCreateDialog} setMatnrCode={setMatnrCode} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <WarehouseStockInfo |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | record={matnrCode} |
| | | /> |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default WarehouseStockList; |
| | | |
| | | const HistoriesButton = ({ setCreateDialog , setMatnrCode}) => { |
| | | const HistoriesButton = ({ setDrawerVal, setSelect }) => { |
| | | const record = useRecordContext(); |
| | | const historyClick = (event) => { |
| | | event.stopPropagation(); |
| | | setCreateDialog(true) |
| | | setMatnrCode(record?.matnrCode) |
| | | setDrawerVal(true) |
| | | setSelect(record) |
| | | } |
| | | return ( |
| | | <Button label="common.button.histories" onClick={historyClick}></Button> |
| | | ) |
| | | } |
| | | |
| | | const StockInfoButton = () => { |
| | | const StockInfoButton = ({ setCreateDialog, setSelect }) => { |
| | | const record = useRecordContext(); |
| | | const {filterValues} = useListContext(); |
| | | const stockClick = (event) => { |
| | | event.stopPropagation(); |
| | | setCreateDialog(true) |
| | | const objRecord = {...record, ...filterValues} |
| | | setSelect(objRecord) |
| | | } |
| | | |
| | | return ( |
| | | <Button label="common.button.detail" onClick={stockClick}></Button> |
| | | ) |
| | | } |
| | | |
| | |
| | | "sys_role_menu", |
| | | "sys_menu", |
| | | "man_loc_type_rela", |
| | | "man_qly_inspect_result" |
| | | "man_qly_inspect_result", |
| | | "view_stock_manage" |
| | | ).contains(tableName); |
| | | } |
| | | }; |
| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakinItem; |
| | | import com.vincent.rsf.server.manager.controller.params.WarehouseStockParam; |
| | | import com.vincent.rsf.server.manager.entity.StockItem; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import com.vincent.rsf.server.manager.enums.ViewStockType; |
| | | import com.vincent.rsf.server.manager.service.WarehouseStockService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody Map<String, Object> param) { |
| | | if (Objects.isNull(param)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | BaseParam baseParam = buildParam(param, BaseParam.class); |
| | | PageParam<LocItem, BaseParam> pageParam = new PageParam<>(baseParam, LocItem.class); |
| | | QueryWrapper<LocItem> queryWrapper = pageParam.buildWrapper(true); |
| | | IPage<LocItem> pageResult = warehouseStockService.pageByStock(pageParam, queryWrapper); |
| | | List<LocItem> records = pageResult.getRecords(); |
| | | for (LocItem record : records) { |
| | | PageParam<ViewStockManage, BaseParam> pageParam = new PageParam<>(baseParam, ViewStockManage.class); |
| | | WarehouseStockParam stockParam = JSONObject.parseObject(JSONObject.toJSONString(param), WarehouseStockParam.class); |
| | | String type = stockParam.getAggType(); |
| | | ViewStockManage stock = stockParam.getStock(); |
| | | QueryWrapper<ViewStockManage> wrapper = new QueryWrapper<>(); |
| | | |
| | | if (type.equals(ViewStockType.VIEW_STOCK_TYPE_SUPPLIER.val)) { |
| | | wrapper.groupBy("splr_id"); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_BATCH.val)) { |
| | | wrapper.groupBy("batch"); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_WAREHOUSE.val)) { |
| | | wrapper.groupBy("warehouse"); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_FIELDSINDEX.val)) { |
| | | wrapper.groupBy("fields_index"); |
| | | } else { |
| | | wrapper.groupBy("matnr_id"); |
| | | } |
| | | IPage<ViewStockManage> pageResult = warehouseStockService.pageByStock(pageParam, wrapper); |
| | | List<ViewStockManage> records = pageResult.getRecords(); |
| | | for (ViewStockManage record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | pageResult.setRecords(records); |
| | | |
| | | return R.ok(pageResult); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping("/histories/page") |
| | | public R histories(@RequestBody Map<String, Object> param) { |
| | | if (Objects.isNull(param)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | BaseParam baseParam = buildParam(param, BaseParam.class); |
| | | PageParam<StockItem, BaseParam> pageParam = new PageParam<>(baseParam, StockItem.class); |
| | | WarehouseStockParam stockParam = JSONObject.parseObject(JSONObject.toJSONString(param), WarehouseStockParam.class); |
| | | String type = stockParam.getAggType(); |
| | | ViewStockManage stock = stockParam.getStock(); |
| | | QueryWrapper<StockItem> wrapper = new QueryWrapper<>(); |
| | | |
| | | if (type.equals(ViewStockType.VIEW_STOCK_TYPE_SUPPLIER.val)) { |
| | | wrapper.eq("sprl_id", stock.getSplrId()); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_BATCH.val)) { |
| | | wrapper.eq("batch", stock.getBatch()); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_WAREHOUSE.val)) { |
| | | wrapper.eq("warehouse", stock.getWarehouse()); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_FIELDSINDEX.val)) { |
| | | wrapper.eq("fields_index", stock.getFieldsIndex()); |
| | | } else { |
| | | wrapper.eq("matnr_id", stock.getMatnrId()); |
| | | } |
| | | IPage<StockItem> pageResult = warehouseStockService.pageByHistories(pageParam, wrapper); |
| | | |
| | | List<StockItem> records = pageResult.getRecords(); |
| | | for (StockItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | pageResult.setRecords(records); |
| | | |
| | | return R.ok(pageResult); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | | @PostMapping("/info") |
| | | public R stockInfo(@RequestBody Map<String, Object> param) { |
| | | if (Objects.isNull(param)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | BaseParam baseParam = buildParam(param, BaseParam.class); |
| | | PageParam<ViewStockManage, BaseParam> pageParam = new PageParam<>(baseParam, ViewStockManage.class); |
| | | WarehouseStockParam stockParam = JSONObject.parseObject(JSONObject.toJSONString(param), WarehouseStockParam.class); |
| | | String type = stockParam.getAggType(); |
| | | if (Objects.isNull(type)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | ViewStockManage stock = stockParam.getStock(); |
| | | LambdaQueryWrapper<ViewStockManage> wrapper = new LambdaQueryWrapper<ViewStockManage>(); |
| | | |
| | | if (type.equals(ViewStockType.VIEW_STOCK_TYPE_SUPPLIER.val)) { |
| | | wrapper.eq(ViewStockManage::getSplrId, stock.getSplrId()); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_BATCH.val)) { |
| | | wrapper.eq(ViewStockManage::getBatch, stock.getBatch()); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_WAREHOUSE.val)) { |
| | | wrapper.eq(ViewStockManage::getWarehouse, stock.getWarehouse()); |
| | | } else if (type.equals(ViewStockType.VIEW_STOCK_TYPE_FIELDSINDEX.val)) { |
| | | wrapper.eq(ViewStockManage::getFieldsIndex, stock.getFieldsIndex()); |
| | | } else { |
| | | wrapper.eq(ViewStockManage::getMatnrCode, stock.getMatnrCode()); |
| | | } |
| | | |
| | | return R.ok(warehouseStockService.page(pageParam, wrapper)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.controller.params; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class WarehouseStockParam implements Serializable { |
| | | |
| | | @ApiModelProperty("汇总类型") |
| | | private String aggType; |
| | | |
| | | @ApiModelProperty("汇总单据") |
| | | private ViewStockManage stock; |
| | | |
| | | } |
| | |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | |
| | | @ApiModelProperty(value= "跟踪码") |
| | | private String trackCode; |
| | | |
| | | @ApiModelProperty("字段索引") |
| | | private String fieldsIndex; |
| | | /** |
| | | * 条形码 |
| | | */ |
| | |
| | | */ |
| | | @ApiModelProperty(value= "包装名称") |
| | | private String packName; |
| | | |
| | | @ApiModelProperty("汇总类型") |
| | | @TableField(exist = false) |
| | | private String aggType; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | |
| | | public StockItem() {} |
| | | |
| | | public StockItem(Long orderId,String orderCode,Long sourceItemId,Long matnrId,String matnrCode,String maktx,Double anfme,String stockUnit,Double workQty,Double purQty,String purUnit,Double qty,String splrCode,String batch,String splrBatch,String splrName,String trackCode,String barcode,String prodTime,String packName,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("view_stock_manage") |
| | | public class ViewStockManage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("库位ID") |
| | | private Long locId; |
| | | |
| | | @ApiModelProperty("库位号") |
| | | private String locCode; |
| | | |
| | | @ApiModelProperty("仓库") |
| | | @TableField(exist = false) |
| | | private String warehouse; |
| | | |
| | | @ApiModelProperty("单据类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("业务类型") |
| | | private Short wkType; |
| | | |
| | | @ApiModelProperty("订单明细ID") |
| | | private Long orderItemId; |
| | | |
| | | @ApiModelProperty("物料ID") |
| | | private Long matnrId; |
| | | |
| | | @ApiModelProperty("物料名称") |
| | | private String maktx; |
| | | |
| | | @ApiModelProperty("物料编码") |
| | | private String matnrCode; |
| | | |
| | | @ApiModelProperty("供应商ID") |
| | | private Long splrId; |
| | | |
| | | @ApiModelProperty("单位") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty("可用库存") |
| | | private Double anfme; |
| | | |
| | | @ApiModelProperty("") |
| | | private Double qty; |
| | | |
| | | @ApiModelProperty("不可用库存") |
| | | private Double workQty; |
| | | |
| | | @ApiModelProperty("批次") |
| | | private String batch; |
| | | |
| | | @ApiModelProperty("规格") |
| | | private String spec; |
| | | |
| | | @ApiModelProperty("型号") |
| | | private String model; |
| | | |
| | | @ApiModelProperty("字段索引") |
| | | private String fieldsIndex; |
| | | |
| | | @ApiModelProperty("更新人员") |
| | | private Long updateBy; |
| | | |
| | | @ApiModelProperty("创建人员") |
| | | private Long createBy; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty("更新时间") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty("动态字段 ") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.enums; |
| | | |
| | | |
| | | public enum ViewStockType { |
| | | VIEW_STOCK_TYPE_MATNR("matnr", "按物料汇总"), |
| | | VIEW_STOCK_TYPE_SUPPLIER("supplier", "按供应商汇总"), |
| | | VIEW_STOCK_TYPE_WAREHOUSE("warehouse", "按仓库汇总"), |
| | | VIEW_STOCK_TYPE_BATCH("batch", "按批次汇总"), |
| | | VIEW_STOCK_TYPE_FIELDSINDEX("fieldsIndex", "按动态扩展字段汇总"), |
| | | ; |
| | | ViewStockType(String val, String desc) { |
| | | this.val = val; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String val; |
| | | public String desc; |
| | | |
| | | } |
| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | @Repository |
| | | public interface LocItemMapper extends BaseMapper<LocItem> { |
| | | |
| | | IPage<LocItem> pageByStock(PageParam<LocItem, BaseParam> pageParam, @Param(Constants.WRAPPER) QueryWrapper<LocItem> queryWrapper); |
| | | IPage<ViewStockManage> pageByStock(PageParam<ViewStockManage, BaseParam> pageParam, @Param(Constants.WRAPPER) QueryWrapper<ViewStockManage> queryWrapper); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.StockItem; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | @Repository |
| | | public interface StockItemMapper extends BaseMapper<StockItem> { |
| | | |
| | | IPage<StockItem> historiesByParams(PageParam<ViewStockManage, BaseParam> pageParam, QueryWrapper<StockItem> wrapper); |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WarehouseStockMapper extends BaseMapper<ViewStockManage> { |
| | | |
| | | IPage<ViewStockManage> pageByStock(PageParam<ViewStockManage, BaseParam> pageParam, @Param(Constants.WRAPPER) QueryWrapper<ViewStockManage> queryWrapper); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Stock; |
| | | import com.vincent.rsf.server.manager.entity.StockItem; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | |
| | | public interface StockItemService extends IService<StockItem> { |
| | | |
| | | IPage<StockItem> pageByHistories(PageParam<StockItem, BaseParam> pageParam, QueryWrapper<StockItem> wrapper); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.entity.StockItem; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | |
| | | public interface WarehouseStockService extends IService<LocItem> { |
| | | public interface WarehouseStockService extends IService<ViewStockManage> { |
| | | |
| | | IPage<LocItem> pageByStock(PageParam<LocItem, BaseParam> pageParam, QueryWrapper<LocItem> queryWrapper); |
| | | IPage<ViewStockManage> pageByStock(PageParam<ViewStockManage, BaseParam> pageParam, QueryWrapper<ViewStockManage> queryWrapper); |
| | | |
| | | IPage<StockItem> pageByHistories(PageParam<StockItem, BaseParam> pageParam, QueryWrapper<StockItem> wrapper); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import com.vincent.rsf.server.manager.mapper.StockItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.StockItem; |
| | | import com.vincent.rsf.server.manager.service.StockItemService; |
| | |
| | | @Service("stockItemService") |
| | | public class StockItemServiceImpl extends ServiceImpl<StockItemMapper, StockItem> implements StockItemService { |
| | | |
| | | @Override |
| | | public IPage<StockItem> pageByHistories(PageParam<StockItem, BaseParam> pageParam, QueryWrapper<StockItem> wrapper) { |
| | | IPage<StockItem> result = this.page(pageParam, wrapper);; |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.StockItem; |
| | | import com.vincent.rsf.server.manager.entity.ViewStockManage; |
| | | import com.vincent.rsf.server.manager.mapper.WarehouseStockMapper; |
| | | import com.vincent.rsf.server.manager.service.StockItemService; |
| | | import com.vincent.rsf.server.manager.service.WarehouseStockService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("warehouseStockService") |
| | | public class WarehouseStockServiceImpl extends ServiceImpl<LocItemMapper, LocItem> implements WarehouseStockService { |
| | | public class WarehouseStockServiceImpl extends ServiceImpl<WarehouseStockMapper, ViewStockManage> implements WarehouseStockService { |
| | | |
| | | @Autowired |
| | | private StockItemService stockItemService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | public IPage<LocItem> pageByStock(PageParam<LocItem, BaseParam> pageParam, QueryWrapper<LocItem> queryWrapper) { |
| | | IPage<LocItem> results = this.baseMapper.pageByStock(pageParam, queryWrapper); |
| | | public IPage<ViewStockManage> pageByStock(PageParam<ViewStockManage, BaseParam> pageParam, QueryWrapper<ViewStockManage> queryWrapper) { |
| | | IPage<ViewStockManage> results = this.baseMapper.pageByStock(pageParam, queryWrapper); |
| | | return results; |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/5/16 |
| | | * @description: 获取入出库明细 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | public IPage<StockItem> pageByHistories(PageParam<StockItem, BaseParam> pageParam, QueryWrapper<StockItem> wrapper) { |
| | | IPage<StockItem> results = stockItemService.pageByHistories(pageParam, wrapper); |
| | | return results; |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vincent.rsf.server.manager.mapper.LocItemMapper"> |
| | | |
| | | <select id="pageByStock" resultType="com.vincent.rsf.server.manager.entity.LocItem"> |
| | | SELECT * |
| | | FROM (SELECT id, |
| | | loc_id, |
| | | loc_code, |
| | | type, |
| | | order_item_id, |
| | | wk_type, |
| | | matnr_id, |
| | | maktx, |
| | | matnr_code, |
| | | unit, |
| | | SUM(anfme) anfme, |
| | | SUM(qty) qty, |
| | | SUM(work_qty) work_qty, |
| | | batch, |
| | | spec, |
| | | model, |
| | | fields_index, |
| | | update_by, |
| | | create_by, |
| | | update_time, |
| | | create_time |
| | | FROM man_loc_item |
| | | GROUP BY matnr_id |
| | | UNION ALL |
| | | SELECT id, |
| | | '' AS loc_id, |
| | | '' AS loc_code, |
| | | type, |
| | | asn_item_id AS order_item_id, |
| | | wk_type, |
| | | matnr_id, |
| | | maktx, |
| | | matnr_code, |
| | | unit, |
| | | SUM(anfme) anfme, |
| | | SUM(qty) qty, |
| | | SUM(work_qty) work_qty, |
| | | batch, |
| | | spec, |
| | | model, |
| | | fields_index, |
| | | update_by, |
| | | create_by, |
| | | update_time, |
| | | create_time |
| | | FROM man_warehouse_areas_item |
| | | GROUP BY matnr_id) t |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!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.StockItemMapper"> |
| | | |
| | | <select id="historiesByParams" resultType="com.vincent.rsf.server.manager.entity.StockItem"> |
| | | |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vincent.rsf.server.manager.mapper.WarehouseStockMapper"> |
| | | <select id="pageByStock" resultType="com.vincent.rsf.server.manager.entity.ViewStockManage"> |
| | | SELECT id, |
| | | loc_id, |
| | | loc_code, |
| | | type, |
| | | order_item_id, |
| | | wk_type, |
| | | matnr_id, |
| | | maktx, |
| | | matnr_code, |
| | | splr_id, |
| | | unit, |
| | | SUM(anfme) anfme, |
| | | SUM(qty) qty, |
| | | SUM(work_qty) work_qty, |
| | | batch, |
| | | spec, |
| | | model, |
| | | fields_index, |
| | | update_by, |
| | | create_by, |
| | | update_time, |
| | | create_time |
| | | FROM view_stock_manage |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |