| | |
| | | <PrintButton /> |
| | | </WrapperField> |
| | | setColumns([...arr, ...fields, opt]); |
| | | |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | useRefresh, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import LocItemCreate from "./LocItemCreate"; |
| | | import LocItemPanel from "./LocItemPanel"; |
| | |
| | | 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'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | |
| | | const LocItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='locItem' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime','locId','orderId', 'orderItemId', 'matnrId', 'splrBatch','workQty','qty', 'createBy', 'memo','fieldsIndex']} |
| | | |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="locId" label="table.field.locItem.locId" /> |
| | | <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" /> |
| | | <TextField source="splrBatch" label="table.field.locItem.splrBatch" /> |
| | | <TextField source="fieldsIndex" label="table.field.locItem.fieldsIndex" /> |
| | | <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} /> |
| | | </StyledDatagrid> |
| | | <DynamicFields /> |
| | | </List> |
| | | <LocItemCreate |
| | | open={createDialog} |
| | |
| | | } |
| | | |
| | | 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="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" />, |
| | | <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', 'locId', 'orderId', 'orderItemId', 'matnrId', 'splrBatch', 'workQty', 'qty', 'createBy', 'memo', 'fieldsIndex']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | Button, |
| | | useEditContext, |
| | | useGetRecordId, |
| | | useRefresh, |
| | | useGetOne |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack, Dialog, DialogActions, DialogTitle } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, Dialog, DialogActions, DialogTitle, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import AsnOrderItemCreate from "./AsnOrderItemCreate"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import request from '@/utils/request'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import AsnOrderItemEdit from "./AsnOrderItemEdit"; |
| | | import ImportButton from "../../components/ImportButton"; |
| | |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderItem' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | // rowClick={(id, resource, record) => { |
| | | // setSelect(record) |
| | | // setEditDialog(true) |
| | | // }} |
| | | omit={['id', 'purQty', 'purUnit', 'platItemId', 'poDetlCode', 'trackCode', 'memo', 'model', 'packName', 'splrCode', 'qrcode', 'poDetlId', 'matnrId', 'asnId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.asnOrderItem.asnId" /> |
| | | <TextField source="asnCode" label="table.field.asnOrderItem.asnCode" /> |
| | | <TextField source="poDetlId" label="table.field.asnOrderItem.poDetlId" /> |
| | | <TextField source="poDetlCode" label="table.field.asnOrderItem.poDetlCode" /> |
| | | <TextField source="platItemId" label="table.field.asnOrderItem.platItemId" /> |
| | | <TextField source="matnrId" label="table.field.asnOrderItem.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.asnOrderItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.asnOrderItem.maktx" /> |
| | | <TextField source="splrBatch" label="table.field.asnOrderItem.splrBatch" /> |
| | | <TextField source="spec" label="table.field.asnOrderItem.spec" /> |
| | | <TextField source="model" label="table.field.asnOrderItem.model" /> |
| | | <NumberField source="anfme" label="table.field.asnOrderItem.anfme" /> |
| | | <TextField source="stockUnit" label="table.field.asnOrderItem.stockUnit" /> |
| | | <NumberField source="purQty" label="table.field.asnOrderItem.purQty" /> |
| | | <TextField source="purUnit" label="table.field.asnOrderItem.purUnit" /> |
| | | <NumberField source="qty" label="table.field.asnOrderItem.qty" /> |
| | | {/* <NumberField source="safeQty" label="table.field.asnOrderItem.safeQty" /> |
| | | <NumberField source="disQty" label="table.field.asnOrderItem.disQty" /> |
| | | <TextField source="isptResult$" label="table.field.asnOrderItem.isptResult" /> */} |
| | | <TextField source="splrCode" label="table.field.asnOrderItem.splrCode" /> |
| | | <TextField source="splrName" label="table.field.asnOrderItem.splrName" /> |
| | | <TextField source="isptResult$" label="table.field.asnOrderItem.isptResult" /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" /> |
| | | <TextField source="trackCode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItem.packName" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <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 /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | <DynamicFields /> |
| | | </List> |
| | | <AsnOrderItemCreate |
| | | open={createDialog} |
| | |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | AsnOrderItemList.Context = React.createContext() |
| | | |
| | | export default AsnOrderItemList; |
| | | |
| | | 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="asnId" label="table.field.asnOrderItem.asnId" />, |
| | | <TextField source="asnCode" label="table.field.asnOrderItem.asnCode" />, |
| | | <TextField source="poDetlId" label="table.field.asnOrderItem.poDetlId" />, |
| | | <TextField source="poDetlCode" label="table.field.asnOrderItem.poDetlCode" />, |
| | | <TextField source="platItemId" label="table.field.asnOrderItem.platItemId" />, |
| | | <TextField source="matnrId" label="table.field.asnOrderItem.matnrId" />, |
| | | <TextField source="matnrCode" label="table.field.asnOrderItem.matnrCode" />, |
| | | <TextField source="maktx" label="table.field.asnOrderItem.maktx" />, |
| | | <TextField source="splrBatch" label="table.field.asnOrderItem.splrBatch" />, |
| | | <TextField source="spec" label="table.field.asnOrderItem.spec" />, |
| | | <TextField source="model" label="table.field.asnOrderItem.model" />, |
| | | <NumberField source="anfme" label="table.field.asnOrderItem.anfme" />, |
| | | <TextField source="stockUnit" label="table.field.asnOrderItem.stockUnit" />, |
| | | <NumberField source="purQty" label="table.field.asnOrderItem.purQty" />, |
| | | <TextField source="purUnit" label="table.field.asnOrderItem.purUnit" />, |
| | | <NumberField source="qty" label="table.field.asnOrderItem.qty" />, |
| | | <TextField source="splrCode" label="table.field.asnOrderItem.splrCode" />, |
| | | <TextField source="splrName" label="table.field.asnOrderItem.splrName" />, |
| | | <TextField source="isptResult$" label="table.field.asnOrderItem.isptResult" />, |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" />, |
| | | <TextField source="trackCode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextField source="packName" label="table.field.asnOrderItem.packName" />, |
| | | ] |
| | | const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) |
| | | const lastArr = [ |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime />, |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <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 />, |
| | | <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='asnOrderItem' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'asnId', 'poDetlId', 'poDetlCode', 'matnrId', 'purQty', 'purUnit', 'qrcode', 'trackCode']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | headerName: el.fieldsAlise, |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: false |
| | | editable: true |
| | | })) |
| | | setColumns([...columns, ...cols, action]) |
| | | } else { |
| | |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | useRefresh, |
| | | DateInput, |
| | | useNotify, |
| | | SelectInput, |
| | | useListContext, |
| | | NumberInput, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import TaskItemCreate from "./TaskItemCreate"; |
| | | |
| | | import request from '@/utils/request'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | | <DateInput label='common.time.before' source="timeEnd" />, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | | <DateInput label='common.time.before' source="timeEnd" />, |
| | | <NumberInput source="taskId" label="table.field.taskItem.taskId" />, |
| | | <NumberInput source="orderId" label="table.field.taskItem.orderId" />, |
| | | <NumberInput source="orderType" label="table.field.taskItem.orderType" />, |
| | |
| | | empty={false} |
| | | pagination={false} |
| | | filters={filters} |
| | | filter={{taskId: recordId}} |
| | | filter={{ taskId: recordId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='taskItem' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | // expand={() => <TaskItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="taskId" label="table.field.taskItem.taskId" /> |
| | | <NumberField source="orderId" label="table.field.taskItem.orderId" /> |
| | | <NumberField source="orderType$" label="table.field.taskItem.orderType" /> |
| | | <NumberField source="orderItemId" label="table.field.taskItem.orderItemId" /> |
| | | <NumberField source="matnrId" label="table.field.taskItem.matnrId" /> |
| | | <TextField source="maktx" label="table.field.taskItem.maktx" /> |
| | | <TextField source="matnrCode" label="table.field.taskItem.matnrCode" /> |
| | | <TextField source="unit" label="table.field.taskItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.taskItem.anfme" /> |
| | | <TextField source="batch" label="table.field.taskItem.batch" /> |
| | | <TextField source="isptResult$" label="table.field.taskItem.isptResult" /> |
| | | <TextField source="spec" label="table.field.taskItem.spec" /> |
| | | <TextField source="model" label="table.field.taskItem.model" /> |
| | | <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} /> |
| | | </StyledDatagrid> |
| | | <DynamicFields /> |
| | | </List> |
| | | <TaskItemCreate |
| | | open={createDialog} |
| | |
| | | } |
| | | |
| | | export default TaskItemList; |
| | | |
| | | |
| | | 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="taskId" label="table.field.taskItem.taskId" />, |
| | | <NumberField source="orderId" label="table.field.taskItem.orderId" />, |
| | | <NumberField source="orderType$" label="table.field.taskItem.orderType" />, |
| | | <NumberField source="orderItemId" label="table.field.taskItem.orderItemId" />, |
| | | <NumberField source="matnrId" label="table.field.taskItem.matnrId" />, |
| | | <TextField source="maktx" label="table.field.taskItem.maktx" />, |
| | | <TextField source="matnrCode" label="table.field.taskItem.matnrCode" />, |
| | | <TextField source="unit" label="table.field.taskItem.unit" />, |
| | | <NumberField source="anfme" label="table.field.taskItem.anfme" />, |
| | | <TextField source="batch" label="table.field.taskItem.batch" />, |
| | | <TextField source="isptResult$" label="table.field.taskItem.isptResult" />, |
| | | <TextField source="spec" label="table.field.taskItem.spec" />, |
| | | <TextField source="model" label="table.field.taskItem.model" />, |
| | | ] |
| | | const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) |
| | | const lastArr = [ |
| | | <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} />, |
| | | ] |
| | | 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='taskItem' |
| | | bulkActionButtons={false} |
| | | rowClick={false} |
| | | // expand={() => <TaskItemPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | useRefresh, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import WaitPakinItemCreate from "./WaitPakinItemCreate"; |
| | | import EmptyData from "../components/EmptyData"; |
| | |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import request from '@/utils/request'; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="waitPakinItem" |
| | | filter={{pakinId: pakinId}} |
| | | resource="waitPakinItem" |
| | | filter={{ pakinId: pakinId }} |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItem' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'pakinId', 'createTime', 'matnrId', 'createBy', 'memo', 'fieldsIndex']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="pakinId" label="table.field.waitPakinItem.pakinId" /> |
| | | <TextField source="matnrCode" label="table.field.waitPakinItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.waitPakinItem.maktx" /> |
| | | <TextField source="batch" label="table.field.waitPakinItem.batch" /> |
| | | <NumberField source="matnrId" label="table.field.waitPakinItem.matnrId" /> |
| | | <NumberField source="anfme" label="table.field.waitPakinItem.anfme" /> |
| | | <TextField source="unit" label="table.field.waitPakinItem.unit" /> |
| | | <NumberField source="workQty" label="table.field.waitPakinItem.workQty" /> |
| | | <NumberField source="qty" label="table.field.waitPakinItem.qty" /> |
| | | <TextField source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" /> |
| | | <TextField source="isptResult$" label="table.field.waitPakinItem.isptResult" /> |
| | | <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} /> |
| | | </StyledDatagrid> |
| | | <DynamicFields /> |
| | | </List> |
| | | <WaitPakinItemCreate |
| | | open={createDialog} |
| | |
| | | } |
| | | |
| | | export default WaitPakinItemList; |
| | | |
| | | |
| | | |
| | | 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="pakinId" label="table.field.waitPakinItem.pakinId" />, |
| | | <TextField source="matnrCode" label="table.field.waitPakinItem.matnrCode" />, |
| | | <TextField source="maktx" label="table.field.waitPakinItem.maktx" />, |
| | | <TextField source="batch" label="table.field.waitPakinItem.batch" />, |
| | | <NumberField source="matnrId" label="table.field.waitPakinItem.matnrId" />, |
| | | <NumberField source="anfme" label="table.field.waitPakinItem.anfme" />, |
| | | <TextField source="unit" label="table.field.waitPakinItem.unit" />, |
| | | <NumberField source="workQty" label="table.field.waitPakinItem.workQty" />, |
| | | <NumberField source="qty" label="table.field.waitPakinItem.qty" />, |
| | | <TextField source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" />, |
| | | <TextField source="isptResult$" label="table.field.waitPakinItem.isptResult" />, |
| | | ] |
| | | 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 />, |
| | | <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='waitPakinItem' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'pakinId', 'createTime', 'matnrId', 'createBy', 'memo', 'fieldsIndex']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | useRefresh, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import WarehouseAreasItemCreate from "./WarehouseAreasItemCreate"; |
| | | import WarehouseAreasItemPanel from "./WarehouseAreasItemPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import request from '@/utils/request'; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='warehouseAreasItem' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'memo', 'areaId', 'brand', 'createBy$', 'weight', 'matnrId', 'batch', 'shipperId', 'splrId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="asnCode" label="table.field.warehouseAreasItem.asnCode" /> |
| | | <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="maktx" label="table.field.warehouseAreasItem.matnrName" /> |
| | | <TextField source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" /> |
| | | <TextField source="trackCode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <NumberField source="anfme" label="table.field.warehouseAreasItem.anfme" /> |
| | | <NumberField source="workQty" label="table.field.warehouseAreasItem.workQty" /> |
| | | <NumberField source="qty" label="table.field.warehouseAreasItem.qty" /> |
| | | <TextField source="splrBatch" label="table.field.warehouseAreasItem.splrBtch" /> |
| | | <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" /> |
| | | <TextField source="shipperId" label="table.field.warehouseAreasItem.shipperId" /> |
| | | <TextField source="splrId" label="table.field.warehouseAreasItem.splrId" /> |
| | | <TextField source="isptResult$" label="table.field.warehouseAreasItem.isptResult" sortable={false} /> |
| | | <NumberField source="weight" label="table.field.warehouseAreasItem.weight" /> |
| | | <TextField source="prodTime" label="table.field.warehouseAreasItem.prodTime" /> |
| | | <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} /> |
| | | |
| | | </StyledDatagrid> |
| | | <DynamicFields /> |
| | | </List> |
| | | <WarehouseAreasItemCreate |
| | | open={createDialog} |
| | |
| | | } |
| | | |
| | | export default WarehouseAreasItemList; |
| | | |
| | | |
| | | 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" />, |
| | | <TextField source="asnCode" label="table.field.warehouseAreasItem.asnCode" />, |
| | | <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="maktx" label="table.field.warehouseAreasItem.matnrName" />, |
| | | <TextField source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" />, |
| | | <TextField source="trackCode" label="table.field.warehouseAreasItem.barcode" />, |
| | | <NumberField source="anfme" label="table.field.warehouseAreasItem.anfme" />, |
| | | <NumberField source="workQty" label="table.field.warehouseAreasItem.workQty" />, |
| | | <NumberField source="qty" label="table.field.warehouseAreasItem.qty" />, |
| | | <TextField source="splrBatch" label="table.field.warehouseAreasItem.splrBtch" />, |
| | | <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" />, |
| | | <TextField source="shipperId" label="table.field.warehouseAreasItem.shipperId" />, |
| | | <TextField source="splrId" label="table.field.warehouseAreasItem.splrId" />, |
| | | <TextField source="isptResult$" label="table.field.warehouseAreasItem.isptResult" sortable={false} />, |
| | | <NumberField source="weight" label="table.field.warehouseAreasItem.weight" />, |
| | | <TextField source="prodTime" label="table.field.warehouseAreasItem.prodTime" />, |
| | | ] |
| | | 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='warehouseAreasItem' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'memo', 'areaId', 'brand', 'createBy$', 'weight', 'matnrId', 'batch', 'shipperId', 'splrId']} |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | import java.lang.reflect.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return intersection; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 对汉字字符串进行MD5加密 |
| | | * @param input 要加密的汉字字符串 |
| | | * @return 32位小写MD5哈希值 |
| | | * @throws NoSuchAlgorithmException |
| | | */ |
| | | public static String md5Chinese(String input) throws NoSuchAlgorithmException { |
| | | if (input == null) { |
| | | return null; |
| | | } |
| | | |
| | | // 统一使用UTF-8编码 |
| | | byte[] inputBytes = input.getBytes(StandardCharsets.UTF_8); |
| | | |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | byte[] digest = md.digest(inputBytes); |
| | | |
| | | // 将字节数组转换为16进制字符串 |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (byte b : digest) { |
| | | sb.append(String.format("%02x", b)); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 验证汉字字符串与MD5哈希是否匹配 |
| | | * @param input 要验证的汉字字符串 |
| | | * @param md5Hash 存储的MD5哈希值 |
| | | * @return 如果匹配返回true,否则false |
| | | */ |
| | | public static boolean verifyChinese(String input, String md5Hash) { |
| | | try { |
| | | String computedHash = md5Chinese(input); |
| | | return computedHash.equals(md5Hash.toLowerCase()); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | // 理论上不会发生,因为MD5是Java标准库支持的 |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | |
| | | public class ChineseMD5Util { |
| | | |
| | | /** |
| | | * 对汉字字符串进行MD5加密 |
| | | * @param input 要加密的汉字字符串 |
| | | * @return 32位小写MD5哈希值 |
| | | * @throws NoSuchAlgorithmException |
| | | */ |
| | | public static String md5Chinese(String input) throws NoSuchAlgorithmException { |
| | | if (input == null) { |
| | | return null; |
| | | } |
| | | |
| | | // 统一使用UTF-8编码 |
| | | byte[] inputBytes = input.getBytes(StandardCharsets.UTF_8); |
| | | |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | byte[] digest = md.digest(inputBytes); |
| | | |
| | | // 将字节数组转换为16进制字符串 |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (byte b : digest) { |
| | | sb.append(String.format("%02x", b)); |
| | | } |
| | | |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 验证汉字字符串与MD5哈希是否匹配 |
| | | * @param input 要验证的汉字字符串 |
| | | * @param md5Hash 存储的MD5哈希值 |
| | | * @return 如果匹配返回true,否则false |
| | | */ |
| | | public static boolean verifyChinese(String input, String md5Hash) { |
| | | try { |
| | | String computedHash = md5Chinese(input); |
| | | return computedHash.equals(md5Hash.toLowerCase()); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | // 理论上不会发生,因为MD5是Java标准库支持的 |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | String chineseText = "你好,世界!"; |
| | | |
| | | // 加密 |
| | | String md5Hash = md5Chinese(chineseText); |
| | | System.out.println("原文: " + chineseText); |
| | | System.out.println("MD5哈希: " + md5Hash); |
| | | |
| | | // 验证 |
| | | boolean isValid = verifyChinese(chineseText, md5Hash); |
| | | System.out.println("验证结果: " + (isValid ? "匹配" : "不匹配")); |
| | | |
| | | // 错误验证示例 |
| | | boolean isWrongValid = verifyChinese("你好,世界!", md5Hash); |
| | | System.out.println("错误文本验证: " + (isWrongValid ? "匹配" : "不匹配")); |
| | | |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | return R.error("托盘码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getItems()) || param.getItems().isEmpty()) { |
| | | return R.error("跟踪码不能为空!!"); |
| | | return R.error("解绑明细不能为空!!"); |
| | | } |
| | | return R.ok(mobileService.unBind(param)); |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty("行号") |
| | | private String platItemId; |
| | | |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | private Map<String, Object> extendFields; |
| | | private Map<String, String> extendFields; |
| | | |
| | | } |
| | | |
| | |
| | | List<AsnOrderItem> asnOrderItem = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getTrackCode, barcode)); |
| | | |
| | | |
| | | if (Objects.isNull(asnOrderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | |
| | | return getAsnOrderItem(asnOrderItem); |
| | | List<AsnOrderItem> items = new ArrayList<>(); |
| | | for (AsnOrderItem record : asnOrderItem) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | items.add(record); |
| | | } |
| | | return getAsnOrderItem(items); |
| | | } |
| | | |
| | | /** |
| | |
| | | .setStockUnit(dto.getStockUnit()) |
| | | .setProdTime(dto.getProdTime()); |
| | | |
| | | if (!Objects.isNull(rcpt)) { |
| | | try { |
| | | if (Objects.isNull(rcpt.get("fieldsindex")) || StringUtils.isBlank(rcpt.get("fieldsindex").toString())) { |
| | | //获取16位uuid |
| | | // String uuid16 = Cools.md5(dto.getBarcode()); |
| | | String uuid16 = Cools.md5(dto.getId() + dto.getMatnr()); |
| | | rcpt.put("index", uuid16); |
| | | orderItem.setFieldsIndex(uuid16); |
| | | } |
| | | //保存或更新扩展字段 |
| | | FieldsUtils.updateFieldsValue(rcpt); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | // if (!Objects.isNull(rcpt)) { |
| | | // try { |
| | | // if (Objects.isNull(rcpt.get("fieldsindex")) || StringUtils.isBlank(rcpt.get("fieldsindex").toString())) { |
| | | // StringBuffer sb = new StringBuffer(); |
| | | // if (!dto.getExtendFields().isEmpty()) { |
| | | // dto.getExtendFields().forEach(field -> { |
| | | // field.keySet().forEach(key -> { |
| | | // sb.append(field.get(key)); |
| | | // }); |
| | | // }); |
| | | // } |
| | | // sb.append(dto.getAsnCode() + dto.getMatnr() + dto.getSplrBatch() + orderItem.getIsptResult$()); |
| | | // //获取16位uuid |
| | | // String uuid16 = Cools.md5Chinese(sb.toString()); |
| | | // rcpt.put("index", uuid16); |
| | | // orderItem.setFieldsIndex(uuid16); |
| | | // } |
| | | // //保存或更新扩展字段 |
| | | // FieldsUtils.updateFieldsValue(rcpt); |
| | | // } catch (Exception e) { |
| | | // throw new RuntimeException(e); |
| | | // } |
| | | // } |
| | | |
| | | if (asnOrderItemMapper.updateById(orderItem) < 1) { |
| | | throw new CoolException("通知单明细数量修改失败!!"); |
| | |
| | | if (Objects.isNull(params.getAsnCode())) { |
| | | throw new CoolException("通知单不能为空!!"); |
| | | } |
| | | List<AsnOrderItem> asnOrderItem = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnCode, params.getAsnCode()) |
| | | .eq(!Objects.isNull(params.getTrackCode()), AsnOrderItem::getTrackCode, params.getTrackCode()) |
| | | .eq(!Cools.isEmpty(params.getMatnrCode()), AsnOrderItem::getMatnrCode, params.getMatnrCode()) |
| | | ); |
| | | |
| | | if (Objects.isNull(asnOrderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | List<Short> shorts = Arrays.asList(AsnExceStatus.ASN_EXCE_STATUS_TASK_CANCEL.val, AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE |
| | | .val, AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val); |
| | | AsnOrder order = asnOrderMapper.getOne(new LambdaQueryWrapper<AsnOrder>() |
| | |
| | | throw new CoolException("请检查订单状态是否已完成或已取消!!"); |
| | | } |
| | | |
| | | return getAsnOrderItem(asnOrderItem); |
| | | List<AsnOrderItem> asnOrderItem = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnCode, params.getAsnCode()) |
| | | .eq(!Objects.isNull(params.getTrackCode()), AsnOrderItem::getTrackCode, params.getTrackCode()) |
| | | .eq(!Cools.isEmpty(params.getMatnrCode()), AsnOrderItem::getMatnrCode, params.getMatnrCode()) |
| | | ); |
| | | |
| | | if (Objects.isNull(asnOrderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | |
| | | List<AsnOrderItem> items = new ArrayList<>(); |
| | | for (AsnOrderItem record : asnOrderItem) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | items.add(record); |
| | | } |
| | | |
| | | return getAsnOrderItem(items); |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<Fields> getDynamicFields() { |
| | | return fieldsMapper.selectList(new LambdaQueryWrapper<Fields>().eq(Fields::getFlagEnable, 1).eq(Fields::getStatus, 1)); |
| | | return fieldsMapper.selectList(new LambdaQueryWrapper<Fields>() |
| | | .eq(Fields::getFlagEnable, 1) |
| | | .eq(Fields::getStatus, 1).orderByAsc(Fields::getId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | //TODO 后续需根据策略配置,获取组拖数据。如:混装,按批次混装等 |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .eq(!Cools.isEmpty(code), WarehouseAreasItem::getTrackCode, code) |
| | | .eq(!Cools.isEmpty(batch), WarehouseAreasItem::getSplrBatch, batch) |
| | | .eq(!Cools.isEmpty(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode) |
| | | .eq(!Cools.isEmpty(asnCode), WarehouseAreasItem::getAsnCode, asnCode); |
| | | .or().eq(!Cools.isEmpty(code), WarehouseAreasItem::getTrackCode, code) |
| | | .or().eq(!Cools.isEmpty(batch), WarehouseAreasItem::getSplrBatch, batch) |
| | | .or().eq(!Cools.isEmpty(matnrCode), WarehouseAreasItem::getMatnrCode, matnrCode) |
| | | .or().eq(!Cools.isEmpty(asnCode), WarehouseAreasItem::getAsnCode, asnCode); |
| | | List<WarehouseAreasItem> list = warehouseAreasItemService.list(queryWrapper); |
| | | list.removeIf(e -> e.getAnfme() <= e.getWorkQty()); |
| | | return R.ok(list); |
| | |
| | | // throw new CoolException("参数不能为空!!"); |
| | | // } |
| | | //获取组拖未生成任务的组拖档 |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | Short flagDefect = 0; |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) { |
| | | flagDefect = 1; |
| | | } |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | List<WaitPakin> waitPakin = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | // .eq(WaitPakin::getFlagDefect, flagDefect) |
| | | .in(WaitPakin::getIoStatus, asList)); |
| | | if (Cools.isEmpty(waitPakin)) { |
| | | throw new CoolException("托盘可用"); |
| | | } else { |
| | | throw new CoolException("托盘不可用"); |
| | | if (!Cools.isEmpty(waitPakin)) { |
| | | throw new CoolException("托盘不可用,在组托中已存在"); |
| | | } |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, params.get("barcode").toString())); |
| | | if (!Cools.isEmpty(locs)) { |
| | | throw new CoolException("托盘不可用,在库位中已存在"); |
| | | } |
| | | return R.ok("托盘可用"); |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.ok(new ArrayList<>()); |
| | | return R.error("未找到该容器码的组托明细,请检查组托状态"); |
| | | } |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakin.getId())); |
| | | if (pakinItems.isEmpty()) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<Long> list = pakinItems.stream().map(WaitPakinItem::getSource).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>().in(WarehouseAreasItem::getId, list); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | for (WaitPakinItem pakinItem : pakinItems) { |
| | | if (warehouseAreasItems.get(i).getId().equals(pakinItem.getSource())) { |
| | | warehouseAreasItems.get(i).setAnfme(pakinItem.getAnfme()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(warehouseAreasItems); |
| | | // if (pakinItems.isEmpty()) { |
| | | // return R.ok(new ArrayList<>()); |
| | | // } |
| | | // List<Long> list = pakinItems.stream().map(WaitPakinItem::getSource).collect(Collectors.toList()); |
| | | // LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>().in(WarehouseAreasItem::getId, list); |
| | | // List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | // for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | // for (WaitPakinItem pakinItem : pakinItems) { |
| | | // if (warehouseAreasItems.get(i).getId().equals(pakinItem.getSource())) { |
| | | // warehouseAreasItems.get(i).setAnfme(pakinItem.getAnfme()); |
| | | // } |
| | | // } |
| | | // } |
| | | return R.ok(pakinItems); |
| | | } |
| | | |
| | | |
| | |
| | | .setAnfme(asnOrderItem.getAnfme()) |
| | | .setPurQty(asnOrderItem.getPurQty()) |
| | | .setSplrBatch(asnOrderItem.getSplrBatch()) |
| | | .setExtendFields(asnOrderItem.getExtendFields()) |
| | | .setMatnr(asnOrderItem.getMatnrCode()) |
| | | .setInspect(asnOrderItem.getIsptResult$()) //质检结果 |
| | | .setPlatItemId(asnOrderItem.getPlatItemId()) |
| | | ; |
| | | .setPlatItemId(asnOrderItem.getPlatItemId()); |
| | | |
| | | Matnr matnr = matnrMapper.selectById(asnOrderItem.getMatnrId()); |
| | | if (Objects.isNull(matnr)) { |
| | |
| | | * @time 2025/4/7 15:28 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized static void updateFieldsValue(Map<String, Object> params) throws Exception { |
| | | public static synchronized void updateFieldsValue(Map<String, Object> params) throws Exception { |
| | | List<Fields> fields = getFieldsSta(); |
| | | if (fields.isEmpty()) { return; } |
| | | Object fieldsIndex = params.get("fieldsIndex"); |
| | |
| | | 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.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.vincent.rsf.server.manager.entity.Matnr; |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.CompanysType; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrderItem, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrderItem.class); |
| | | return R.ok().add(asnOrderItemService.listByAsnId(pageParam, pageParam.buildWrapper(true))); |
| | | /**拼接扩展字段*/ |
| | | PageParam<AsnOrderItem, BaseParam> page = asnOrderItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<AsnOrderItem> records = page.getRecords(); |
| | | for (AsnOrderItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | |
| | | 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.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import com.vincent.rsf.server.manager.service.LocItemService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<LocItem, BaseParam> pageParam = new PageParam<>(baseParam, LocItem.class); |
| | | return R.ok().add(locItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | |
| | | /**拼接扩展字段*/ |
| | | PageParam<LocItem, BaseParam> page = locItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<LocItem> records = page.getRecords(); |
| | | for (LocItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locItem:list')") |
| | |
| | | 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.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.LocItem; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<TaskItem, BaseParam> pageParam = new PageParam<>(baseParam, TaskItem.class); |
| | | return R.ok().add(taskItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | /**拼接扩展字段*/ |
| | | PageParam<TaskItem, BaseParam> page = taskItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<TaskItem> records = page.getRecords(); |
| | | for (TaskItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:taskItem:list')") |
| | |
| | | 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.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakinItem; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinItemService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<WaitPakinItem, BaseParam> pageParam = new PageParam<>(baseParam, WaitPakinItem.class); |
| | | return R.ok().add(waitPakinItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | /**拼接扩展字段*/ |
| | | PageParam<WaitPakinItem, BaseParam> page = waitPakinItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<WaitPakinItem> records = page.getRecords(); |
| | | for (WaitPakinItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakinItem:list')") |
| | |
| | | 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.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasItemService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<WarehouseAreasItem, BaseParam> pageParam = new PageParam<>(baseParam, WarehouseAreasItem.class); |
| | | QueryWrapper<WarehouseAreasItem> queryWrapper = pageParam.buildWrapper(true); |
| | | return R.ok().add(warehouseAreasItemService.page(pageParam, queryWrapper)); |
| | | /**拼接扩展字段*/ |
| | | PageParam<WarehouseAreasItem, BaseParam> page = warehouseAreasItemService.page(pageParam, queryWrapper); |
| | | List<WarehouseAreasItem> records = page.getRecords(); |
| | | for (WarehouseAreasItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreasItem:list')") |
| | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | |
| | | @ApiModelProperty(value= "字段索引") |
| | | private String fieldsIndex; |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.vincent.rsf.server.system.constant.DictTypeCode; |
| | |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | |
| | | @ApiModelProperty(value= "字段索引") |
| | | private String fieldsIndex; |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | 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.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.manager.enums.OrderType; |
| | |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.vincent.rsf.server.manager.service.MatnrService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | | import com.vincent.rsf.server.system.service.FieldsService; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | |
| | | @Autowired |
| | | private DictDataService dictDataService; |
| | | |
| | | @Override |
| | | public R generateBarcode(List<Long> orders) { |
| | |
| | | if (Objects.isNull(date)) { |
| | | throw new CoolException("时间格式错误!!"); |
| | | } |
| | | if (Objects.isNull((OrderType.getTypeVal(template.getType())))) { |
| | | sbFaild.append(template.getCode()).append(",单据状态不存在!!"); |
| | | throw new CoolException(sbFaild.toString()); |
| | | } |
| | | if (Objects.isNull((OrderWorkType.getWorkType(template.getWkType())))) { |
| | | sbFaild.append(template.getCode()).append(",业务状态不存在!!"); |
| | | throw new CoolException(sbFaild.toString()); |
| | | } |
| | | |
| | | order.setCode(template.getCode()) |
| | | .setPoCode(template.getPoCode()) |
| | | .setMemo(template.getMemo()) |
| | |
| | | // } |
| | | //保存扩展字段 |
| | | try { |
| | | String uuid16 = CommonUtil.randomUUID16(); |
| | | Boolean fields = FieldsUtils.saveFields(params, uuid16); |
| | | if (fields) { |
| | | if (Objects.isNull(asnOrderItem.getFieldsIndex()) || StringUtils.isBlank(asnOrderItem.getFieldsIndex())) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | if (!asnOrderItem.getExtendFields().isEmpty()) { |
| | | Map<String, String> fields = asnOrderItem.getExtendFields(); |
| | | asnOrderItem.getExtendFields().keySet().forEach(key -> { |
| | | sb.append(fields.get(key)); |
| | | }); |
| | | } |
| | | sb.append(asnOrderItem.getAsnCode() + asnOrderItem.getMatnrId() + asnOrderItem.getSplrBatch() + asnOrderItem.getIsptResult$()); |
| | | //获取16位uuid |
| | | String uuid16 = Cools.md5Chinese(sb.toString()); |
| | | asnOrderItem.setFieldsIndex(uuid16); |
| | | if (FieldsUtils.saveFields(params, uuid16)) { |
| | | asnOrderItem.setFieldsIndex(uuid16); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | |
| | | .setTrackCode(item.getTrackCode()) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setExtendFields(item.getExtendFields()) |
| | | .setOrderId(item.getAsnId()) |
| | | .setOrderItemId(item.getAsnItemId()); |
| | | taskItems.add(taskItem); |
| | |
| | | } |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .notIn(WaitPakin::getIoStatus, asList) |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!Objects.isNull(pakin)) { |
| | | throw new CoolException("托盘码:" + waitPakin.getBarcode() + "已被组托单:" + pakin.getCode() + "使用!!"); |
| | |
| | | throw new CoolException("组托不存在!!"); |
| | | } |
| | | List<PakinItem> paramItems = param.getItems(); |
| | | |
| | | if (Objects.isNull(paramItems) || paramItems.isEmpty()) { |
| | | throw new CoolException("解绑物料不能为空!!"); |
| | | } |
| | | List<Long> list = paramItems.stream().map(PakinItem::getId).collect(Collectors.toList()); |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakins.getId()) |
| | | .in(WaitPakinItem::getSource, list)); |
| | | .in(WaitPakinItem::getId, list) |
| | | ); |
| | | if (pakinItems.isEmpty()) { |
| | | throw new CoolException("数据错误:组托明细不存在!!"); |
| | | } |
| | | List<Long> ids = pakinItems.stream().map(WaitPakinItem::getId).collect(Collectors.toList()); |
| | | if (!waitPakinItemService.removeByIds(ids)) { |
| | | throw new CoolException("组托明细解绑失败!!"); |
| | | } |
| | | |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.listByIds(list); |
| | | // List<Long> ids = pakinItems.stream().map(WaitPakinItem::getId).collect(Collectors.toList()); |
| | | // if (!waitPakinItemService.removeByIds(ids)) { |
| | | // throw new CoolException("组托明细解绑失败!!"); |
| | | // } |
| | | List<Long> list2 = pakinItems.stream().map(WaitPakinItem::getSource).collect(Collectors.toList()); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.listByIds(list2); |
| | | for (int i1 = 0; i1 < pakinItems.size(); i1++) { |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | if (warehouseAreasItems.get(i).getId().equals(pakinItems.get(i1).getId())) { |
| | | double v = warehouseAreasItems.get(i).getWorkQty() - pakinItems.get(i1).getAnfme(); |
| | | warehouseAreasItems.get(i).setWorkQty(v); |
| | | if (!warehouseAreasItemService.updateById(warehouseAreasItems.get(i))) { |
| | | throw new CoolException("收货区数量修改失败!!"); |
| | | for (PakinItem item : paramItems) { |
| | | if (item.getId().equals(pakinItems.get(i1).getId())) { |
| | | if (pakinItems.get(i1).getAnfme().compareTo(item.getReceiptQty()) > 0) { |
| | | if (item.getReceiptQty().compareTo(0.00) == 0) { |
| | | throw new CoolException("解绑数量不能为零!!"); |
| | | } |
| | | if (item.getReceiptQty().compareTo(pakinItems.get(i1).getAnfme() - pakinItems.get(i1).getWorkQty() - pakinItems.get(i1).getQty()) > 0) { |
| | | throw new CoolException("解绑数量不能大于剩余可执行数!!"); |
| | | } |
| | | pakinItems.get(i1).setAnfme(pakinItems.get(i1).getAnfme() - item.getReceiptQty()); |
| | | if (!waitPakinItemService.updateById(pakinItems.get(i1))) { |
| | | throw new CoolException("组托明细数量修改失败!!"); |
| | | } |
| | | } else { |
| | | if (!waitPakinItemService.removeById(pakinItems.get(i1).getId())) { |
| | | throw new CoolException("组托明细删除失败!!"); |
| | | } |
| | | } |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | if (warehouseAreasItems.get(i).getId().equals(pakinItems.get(i1).getSource())) { |
| | | double v = warehouseAreasItems.get(i).getWorkQty() - item.getReceiptQty(); |
| | | warehouseAreasItems.get(i).setWorkQty(v); |
| | | if (!warehouseAreasItemService.updateById(warehouseAreasItems.get(i))) { |
| | | throw new CoolException("收货区数量修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | double anfmes = warehouseAreasItems.stream().mapToDouble(WarehouseAreasItem::getAnfme).sum(); |
| | | |
| | | double anfmes = paramItems.stream().mapToDouble(PakinItem::getReceiptQty).sum(); |
| | | // double anfmes = warehouseAreasItems.stream().mapToDouble(WarehouseAreasItem::getAnfme).sum(); |
| | | if (waitPakins.getAnfme().compareTo(anfmes) <= 0) { |
| | | if (!waitPakinService.removeById(waitPakins.getId())) { |
| | | throw new CoolException("组托删除失败!!"); |
| | |
| | | if (!taskItems.isEmpty()) { |
| | | return R.error("组拖档有明细任务"); |
| | | } |
| | | } |
| | | |
| | | Set<Long> sourceIds = pakinItems.stream().map(WaitPakinItem::getSource).collect(Collectors.toSet()); |
| | | Set<Long> sourceIds = pakinItems.stream().map(WaitPakinItem::getSource).collect(Collectors.toSet()); |
| | | |
| | | List<WarehouseAreasItem> areasItems = warehouseAreasItemService.listByIds(sourceIds); |
| | | List<WarehouseAreasItem> areasItems = warehouseAreasItemService.list(new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .in(WarehouseAreasItem::getId, sourceIds)); |
| | | |
| | | if (areasItems.isEmpty()) { |
| | | return R.error("收货区数据不存在!!"); |
| | | } |
| | | |
| | | Map<Long, List<WaitPakinItem>> listMap = pakinItems.stream().collect(Collectors.groupingBy(WaitPakinItem::getSource)); |
| | | for (WarehouseAreasItem item : areasItems) { |
| | | List<WaitPakinItem> pakin = listMap.get(item.getId()); |
| | | if (Objects.isNull(pakin)) { |
| | | continue; |
| | | if (areasItems.isEmpty()) { |
| | | return R.error("收货区数据不存在!!"); |
| | | } |
| | | double sum = pakin.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | item.setWorkQty(item.getWorkQty() - sum) |
| | | .setAnfme(item.getAnfme() + sum); |
| | | if (!warehouseAreasItemService.updateById(item)) { |
| | | throw new CoolException("收货区数据回滚失败!!"); |
| | | |
| | | Map<Long, List<WaitPakinItem>> listMap = pakinItems.stream().collect(Collectors.groupingBy(WaitPakinItem::getSource)); |
| | | for (WarehouseAreasItem item : areasItems) { |
| | | List<WaitPakinItem> pakin = listMap.get(item.getId()); |
| | | if (Objects.isNull(pakin)) { |
| | | continue; |
| | | } |
| | | double sum = pakin.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | item.setWorkQty(item.getWorkQty() - sum) |
| | | .setAnfme(item.getAnfme() + sum); |
| | | if (!warehouseAreasItemService.updateById(item)) { |
| | | throw new CoolException("收货区数据回滚失败!!"); |
| | | } |
| | | } |
| | | |
| | | Set<Long> pakinItemIds = pakinItems.stream().map(WaitPakinItem::getId).collect(Collectors.toSet()); |
| | | |
| | | if (!waitPakinItemService.removeByIds(pakinItemIds)) { |
| | | throw new CoolException("明细删除失败!!"); |
| | | } |
| | | } |
| | | |
| | |
| | | return R.error("Delete Fail"); |
| | | } |
| | | |
| | | Set<Long> pakinItemIds = pakinItems.stream().map(WaitPakinItem::getId).collect(Collectors.toSet()); |
| | | |
| | | if (!waitPakinItemService.removeByIds(pakinItemIds)) { |
| | | throw new CoolException("明细删除失败!!"); |
| | | } |
| | | return R.ok("Delete Success").add(pakinIds); |
| | | |
| | | |
| | | } |
| | | } |