| | |
| | | container: 'Container', |
| | | contract: 'Contract', |
| | | qlyInspect: 'QlyInspect', |
| | | qlyIsptItem: '质检信息明细', |
| | | qlyIsptItem: 'qlyIsptItem', |
| | | dictType: 'DictType', |
| | | dictData: 'DictData', |
| | | companys: 'Companys', |
| | |
| | | dlyQty: "dlyQty", |
| | | rcptQty: "rcptQty", |
| | | isptQty: "isptQty", |
| | | isptResult: "isptResult", |
| | | isptStatus: "isptStatus", |
| | | }, |
| | | qlyIsptItem: { |
| | |
| | | dlyQty: "送货数量", |
| | | rcptQty: "收货数量 ", |
| | | isptQty: "质检数量", |
| | | isptResult: "质检结果", |
| | | isptStatus: "质检状态", |
| | | }, |
| | | qlyIsptItem: { |
| | |
| | | } from '@mui/material'; |
| | | import ExpandMore from '@mui/icons-material/ExpandMore'; |
| | | import { useTranslate, useSidebarState } from 'react-admin'; |
| | | |
| | | import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; |
| | | import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; |
| | | const SubMenu = (props) => { |
| | | const { handleToggle, isOpen, name, icon, children, dense } = props; |
| | | const translate = useTranslate(); |
| | |
| | | <MenuItem dense={dense} onClick={handleToggle} sx={{ display: 'flex', alignItems: 'center' }}> |
| | | <ListItemIcon sx={{ minWidth: 40, color: 'text.secondary', display: 'flex', alignItems: 'center' }}> |
| | | {/* {isOpen ? <ExpandMore /> : icon} */} |
| | | {icon} |
| | | {isOpen ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />} |
| | | </ListItemIcon> |
| | | <Typography variant="inherit" color="textSecondary" sx={{ ml: 1, display: 'flex', alignItems: 'center' }}> |
| | | {translate(name)} |
| | |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <TextInput source="wkType" label="table.field.asnOrder.wkType" />, |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{dictTypeCode: 'sys_business_type'}} label="table.field.asnOrder.wkType"> |
| | | <AutocompleteInput |
| | | label="table.field.asnOrder.wkType" |
| | | optionValue="value" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput>, |
| | | // <AutocompleteInput source='wkType' label='table.field.asnOrder.wkType' optionText={ } choices={JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []} />, |
| | | <NumberInput source="anfme" label="table.field.asnOrder.anfme" />, |
| | | <NumberInput source="qty" label="table.field.asnOrder.qty" />, |
| | | <TextInput source="logisNo" label="table.field.asnOrder.logisNo" />, |
| | |
| | | |
| | | const AsnOrderList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const billReload = useRef(); |
| | | |
| | | const navigate = useNavigate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | |
| | | const assign = (record) => { |
| | | navigate(`/asnOrderItem?asnId=${record.id}`); |
| | | }; |
| | |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | sx={{ width: '100%' }} |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={() => false} |
| | |
| | | <TextField source="poCode" label="table.field.asnOrder.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrder.poId" /> |
| | | <TextField source="type$" label="table.field.asnOrder.type" /> |
| | | {/* <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="wkType" /> |
| | | </ReferenceField> */} |
| | | {/* <AutocompleteInput choices={dicts} optionText="label" label="table.field.qlyInspect.wkType" source="wkType" optionValue="value" /> */} |
| | | <TextField source="wkType$" label="table.field.asnOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrder.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrder.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | <DateField source="arrTime" label="table.field.asnOrder.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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 /> |
| | |
| | | onClick={() => { setCreateDialog(true) }}> |
| | | {translate('create.empty.button')} |
| | | </Button> |
| | | |
| | | <Button |
| | | variant="contained" |
| | | color="primary" |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import LocAreaRelaCreate from "./LocAreaRelaCreate"; |
| | | import LocAreaRelaPanel from "./LocAreaRelaPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <NumberInput source="locAreaId" label="table.field.locAreaRela.locAreaId" />, |
| | | <NumberInput source="locId" label="table.field.locAreaRela.locId" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const LocAreaRelaList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.locAreaRela"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='locAreaRela' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='locAreaRela' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <LocAreaRelaPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="locAreaId" label="table.field.locAreaRela.locAreaId" /> |
| | | <NumberField source="locId" label="table.field.locAreaRela.locId" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <LocAreaRelaCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='LocAreaRela Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default LocAreaRelaList; |
| | |
| | | import request from '@/utils/request'; |
| | | import AsnSelModal from "./AsnSelModal"; |
| | | import InspectModal from "./InspectModal"; |
| | | |
| | | import QlyInspectOpCreate from './QlyInspectOpCreate'; |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.qlyInspect.code" />, |
| | | <TextInput source="wkType" label="table.field.qlyInspect.wkType" />, |
| | | <NumberInput source="safeQty" label="table.field.qlyInspect.safeQty" />, |
| | | <NumberInput source="dlyQty" label="table.field.qlyInspect.dlyQty" />, |
| | | <NumberInput source="rcptQty" label="table.field.qlyInspect.rcptQty" />, |
| | | <NumberInput source="isptQty" label="table.field.qlyInspect.isptQty" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const QlyInspectList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <AsnCreatButton /> |
| | | <MyCreateButton onClick={() => { setOpCreateDialog(true) }} /> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='qlyInspect' /> |
| | | <MyExportButton /> |
| | |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <QlyInspectOpCreate |
| | | open={opCreateDialog} |
| | | setOpen={setOpCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='QlyInspect Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | |
| | | |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | CreateBase, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | ReferenceField, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | | DialogActions, |
| | | DialogContent, |
| | | DialogTitle, |
| | | Stack, |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | |
| | | const QlyInspectOpCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const isptResult = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_inspect_result')) || []; |
| | | const isptStatus = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_qly_inspect_status')) || []; |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | const handleSuccess = async (data) => { |
| | | setOpen(false); |
| | | notify('common.response.success'); |
| | | }; |
| | | |
| | | const handleError = async (error) => { |
| | | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); |
| | | }; |
| | | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | | record={{}} |
| | | transform={(data) => { |
| | | return data; |
| | | }} |
| | | mutationOptions={{ onSuccess: handleSuccess, onError: handleError }} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" // 'xs' | 'sm' | 'md' | 'lg' | 'xl' |
| | | > |
| | | <Form> |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('create.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="asnCode" |
| | | reference="asnOrder" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.qlyInspect.asnCode" |
| | | optionText="code" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.qlyInspect.wkType" |
| | | source="wkType" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={[required()]} /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.safeQty" |
| | | source="safeQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.dlyQty" |
| | | source="dlyQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.rcptQty" |
| | | source="rcptQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.isptQty" |
| | | source="isptQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <AutocompleteInput |
| | | choices={isptStatus} |
| | | optionText="label" |
| | | label="table.field.qlyInspect.isptStatus" |
| | | source="isptStatus" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <AutocompleteInput |
| | | choices={isptResult} |
| | | optionText="label" |
| | | label="table.field.qlyInspect.isptResult" |
| | | source="isptResult" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | </Grid> |
| | | <Grid item xs={12} display="flex" gap={1}> |
| | | <Stack direction="column" spacing={1} width={'100%'}> |
| | | <MemoInput /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > |
| | | <SaveButton /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </Dialog> |
| | | </CreateBase> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default QlyInspectOpCreate; |
| | |
| | | |
| | | Double receiptQty = receipts.stream().mapToDouble(ReceiptDetlsDto::getReceiptQty).sum(); |
| | | |
| | | if (Objects.isNull(receiptQty) || receiptQty.compareTo(0.00) <= 0) { |
| | | throw new CoolException("收货数量不能小于或等于零!!"); |
| | | } |
| | | |
| | | String asnCode = receipts.stream().findFirst().get().getAsnCode(); |
| | | |
| | | AsnOrder asnOrder = asnOrderMapper.getOne(new LambdaQueryWrapper<AsnOrder>() |
| | |
| | | FieldsItem item = new FieldsItem(); |
| | | item.setUuid(uuid) |
| | | .setValue(template.get(obj.getFields()).toString()) |
| | | .setMatnrId(Long.parseLong(template.get("matnrId").toString())) |
| | | .setMatnrId(!Objects.isNull(template.get("matnrId")) ? Long.parseLong(template.get("matnrId").toString()) : null) |
| | | .setFieldsId(obj.getId()); |
| | | fieldsItems.add(item); |
| | | } |
| | |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getId, map.get("ids")).eq(AsnOrderItem::getStatus, 1)); |
| | | } else { |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().last("limit 1")); |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>()); |
| | | } |
| | | |
| | | ExcelUtil.build(ExcelUtil.create(orderItems, AsnOrderItem.class, true), response); |
| | |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().in(Matnr::getId, map.get("ids")).eq(Matnr::getStatus, 1)); |
| | | } else { |
| | | matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().last("limit 1")); |
| | | matnrs = matnrService.list(); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(matnrs, Matnr.class, true), response); |
| | | ExcelUtil.build(ExcelUtil.create(matnrs, Matnr.class, false), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspect; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public R save(@RequestBody QlyInspect qlyInspect) { |
| | | qlyInspect.setCreateBy(getLoginUserId()); |
| | | qlyInspect.setUpdateBy(getLoginUserId()); |
| | | if (!qlyInspectService.save(qlyInspect)) { |
| | | if (!qlyInspectService.qlySave(qlyInspect)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(qlyInspect); |
| | |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | |
| | | public class MatnrsTemplate { |
| | | |
| | | @NotNull |
| | | @Excel(name = "物料名称") |
| | | @Excel(name = "物料名称*") |
| | | @ExcelComment(example = "华为手机") |
| | | private String name; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类助记码") |
| | | @Excel(name = "分类助记码*") |
| | | @ExcelComment(example = "256874556") |
| | | private String groupCode; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类名称") |
| | | @Excel(name = "分类名称*") |
| | | @ExcelComment(example = "移动设备") |
| | | private String groupName; |
| | | |
| | | @NotNull |
| | | @Excel(name = "物料助记码") |
| | | @Excel(name = "物料助记码*") |
| | | @ExcelComment(example = "P3528461569") |
| | | private String erpCode; |
| | | |
| | |
| | | List<AsnOrder> getUnInspect(Map<String, Object> map); |
| | | |
| | | R saveSelected(IsptOrderParam param, Long loginUserId); |
| | | |
| | | boolean qlySave(QlyInspect qlyInspect); |
| | | } |
| | |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("收货明细为空!!"); |
| | | } |
| | | if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | throw new CoolException("收货数量不能为零!!"); |
| | | } |
| | | // if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | // throw new CoolException("收货数量不能为零!!"); |
| | | // } |
| | | AsnOrder order = this.getById(asrder.getId()); |
| | | AsnOrderLog orderLog = new AsnOrderLog(); |
| | | order.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val)); |
| | |
| | | AsnOrderItemLog itemLog = new AsnOrderItemLog(); |
| | | BeanUtils.copyProperties(item, itemLog); |
| | | itemLog.setAsnItemId(itemLog.getId()) |
| | | .setLogId(orderLog.getId()) |
| | | .setAsnId(item.getAsnId()); |
| | | logs.add(itemLog); |
| | | }); |
| | |
| | | } |
| | | return R.ok("保存成功!!"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean qlySave(QlyInspect qlyInspect) { |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_INSPECT_CODE, qlyInspect); |
| | | if (Objects.isNull(code) || StringUtils.isBlank(code)) { |
| | | throw new CoolException("编码规则错误:" + "请检查编码:" + "「SYS_INSPECT_CODE」" + "是否设置成功!!"); |
| | | } |
| | | qlyInspect.setCode(code); |
| | | if (Objects.isNull(qlyInspect.getAsnCode()) || StringUtils.isBlank(qlyInspect.getAsnCode())) { |
| | | throw new CoolException("收货单号不能为空!!"); |
| | | } |
| | | AsnOrder asnOrder = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getId, qlyInspect.getAsnCode())); |
| | | if (Objects.isNull(asnOrder)) { |
| | | throw new CoolException("收货单不存在!!"); |
| | | } |
| | | qlyInspect.setAsnCode(asnOrder.getCode()).setAsnId(asnOrder.getId()); |
| | | |
| | | return this.save(qlyInspect); |
| | | } |
| | | } |