| | |
| | | poDetlCode: "DO Detl Code", |
| | | matnrId: "matnrId", |
| | | maktx: "maktx", |
| | | workQty: 'Work Qty', |
| | | anfme: "anfme", |
| | | platOrderCode: 'Customer Code', |
| | | stockUnit: "stockUnit", |
| | | purQty: "purQty", |
| | | purUnit: "purUnit", |
| | |
| | | fieldsIndex: "fieldsIndex", |
| | | unit: "unit", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | workQty: 'Work Qty', |
| | | qty: "Qty", |
| | | nromQty: "nromQty", |
| | | printQty: "printQty", |
| | | splrName: "splrName", |
| | |
| | | type: "类型", |
| | | wkType: "业务类型", |
| | | anfme: "数量", |
| | | qty: "已出库数量", |
| | | workQty: '执行数', |
| | | qty: "完成数", |
| | | logisNo: "物流单号", |
| | | arrTime: "预计到达时间", |
| | | rleStatus: "释放状态", |
| | |
| | | matnrId: "物料标识", |
| | | maktx: "物料名称", |
| | | matnrCode: "物料编码", |
| | | platOrderCode: '客单号', |
| | | anfme: "计划出库数", |
| | | stockUnit: "库存单位", |
| | | workQty: '执行数', |
| | | purQty: "下单数量", |
| | | purUnit: "单位", |
| | | qty: "完成数量", |
| | |
| | | fieldsIndex: "字段索引", |
| | | unit: "单位", |
| | | anfme: "数量", |
| | | qty: "完成数量", |
| | | nromQty: "nromQty", |
| | | workQty: '执行数', |
| | | qty: "完成数", |
| | | nromQty: "标包数", |
| | | printQty: "打印数量", |
| | | splrName: "供应商名称", |
| | | splrCode: "供应商编码", |
| | |
| | | 2: '#52C41A', |
| | | 3: '#595959', |
| | | 4: '#FF4D4F', |
| | | 10: '#BFBFBF', |
| | | 11: '#FFC53D', |
| | | 12: '#52C41A', |
| | | 13: '#595959', |
| | | 14: '#FF4D4F', |
| | | } |
| | | return ( |
| | | <Typography |
| | |
| | | title={"menu.asnOrder"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ deleted: 0, type: 'in' }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true); setmodalType(0) }} /> |
| | | <CreateByPoButton setPoCreate={setPoCreate}/> |
| | | <CreateByPoButton setPoCreate={setPoCreate} /> |
| | | <SelectColumnsButton preferenceKey='asnOrder' /> |
| | | <ImportButton value={'asnOrderItem'} /> |
| | | <MyExportButton /> |
| | |
| | | <DateField source="arrTime" label="table.field.asnOrder.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | {/* <TextField source="ntyStatus$" label="table.field.asnOrder.ntyStatus" /> */} |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | |
| | | export default AsnOrderList; |
| | | |
| | | //按PO单新建 |
| | | const CreateByPoButton = ({setPoCreate}) => { |
| | | const CreateByPoButton = ({ setPoCreate }) => { |
| | | const record = useRecordContext(); |
| | | |
| | | const createEvent = (event) => { |
| | |
| | | const DeliveryEdit = () => { |
| | | const translate = useTranslate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_order_type')) || []; |
| | | const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type' && dict.group == 2)) || []; |
| | | |
| | | return ( |
| | | <> |
| | |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | <TextInput |
| | | label="table.field.delivery.platId" |
| | | source="platId" |
| | | parse={v => v} |
| | | /> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.delivery.source" |
| | | source="source" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.delivery.anfme" |
| | | source="anfme" |
| | |
| | | source="workQty" |
| | | /> |
| | | <TextInput |
| | | label="table.field.delivery.platId" |
| | | source="platId" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.delivery.platCode" |
| | | source="platCode" |
| | | parse={v => v} |
| | |
| | | }} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'deliveryId', 'fieldsIndex', 'qty', 'printQty', 'nromQty', 'createBy', 'memo']} |
| | | omit={['id', 'createTime', 'deliveryId', 'fieldsIndex', 'printQty', 'nromQty', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="deliveryId" label="table.field.deliveryItem.deliveryId" /> |
| | | <TextField source="platItemId" label="table.field.deliveryItem.platItemId" /> |
| | | <TextField source="matnrCode" label="table.field.deliveryItem.matnrCode" /> |
| | | <TextField source="matnrName" label="table.field.deliveryItem.matnrName" /> |
| | | <TextField source="maktx" label="table.field.deliveryItem.matnrName" /> |
| | | <TextField source="fieldsIndex" label="table.field.deliveryItem.fieldsIndex" /> |
| | | <TextField source="unit" label="table.field.deliveryItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.deliveryItem.anfme" /> |
| | | <NumberField source="workQty" label="table.field.deliveryItem.workQty" /> |
| | | <NumberField source="qty" label="table.field.deliveryItem.qty" /> |
| | | <NumberField source="nromQty" label="table.field.deliveryItem.nromQty" /> |
| | | <NumberField source="printQty" label="table.field.deliveryItem.printQty" /> |
| | | <TextField source="unit" label="table.field.deliveryItem.unit" /> |
| | | <TextField source="splrName" label="table.field.deliveryItem.splrName" /> |
| | | <TextField source="splrCode" label="table.field.deliveryItem.splrCode" /> |
| | | <TextField source="splrBatch" label="table.field.deliveryItem.splrBatch" /> |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='delivery' /> |
| | | <ImportButton value={'delivery'} /> |
| | | {/* <MyExportButton /> */} |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'platId', 'memo', 'workQty', 'startTime', 'endTime', 'updateBy', 'createTime']} |
| | | omit={['id', 'createTime', 'createBy', 'platId', 'platCode', 'memo', 'startTime', 'endTime', 'updateBy', 'createTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.delivery.code" /> |
| | |
| | | <TextField source="wkType$" label="table.field.delivery.wkType" /> |
| | | <TextField source="source" label="table.field.delivery.source" /> |
| | | <NumberField source="anfme" label="table.field.delivery.anfme" /> |
| | | <NumberField source="qty" label="table.field.delivery.qty" /> |
| | | <NumberField source="workQty" label="table.field.delivery.workQty" /> |
| | | <NumberField source="qty" label="table.field.delivery.qty" /> |
| | | <TextField source="platCode" label="table.field.delivery.platCode" /> |
| | | <DateField source="startTime" label="table.field.delivery.startTime" showTime /> |
| | | <DateField source="endTime" label="table.field.delivery.endTime" showTime /> |
| | |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.asnOrder.exceStatus" /> |
| | | {/* <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} /> |
| | | <CustomDelteButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | ) |
| | | } |
| | | |
| | | |
| | | const CustomDelteButton = () => { |
| | | const record = useRecordContext(); |
| | | return ( |
| | | record?.exceStatus == 0 ? <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> : <></> |
| | | ) |
| | | } |
| | | |
| | | |
| | | export default DeliveryList; |
| | |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import OutOrderItemList from "./OutOrderItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <></> |
| | | {/* <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> */} |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const OutOrderEdit = () => { |
| | | const translate = useTranslate(); |
| | |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | toolbar={false} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <NumberInput source="asnId" label="table.field.outStockItem.asnId" />, |
| | | <TextInput source="asnCode" label="table.field.outStockItem.asnCode" alwaysOn/>, |
| | | <TextInput source="asnCode" label="table.field.outStockItem.asnCode" alwaysOn />, |
| | | <TextInput source="poDetlId" label="table.field.outStockItem.poDetlId" />, |
| | | <TextInput source="matnrId" label="table.field.outStockItem.matnrId" />, |
| | | <TextInput source="maktx" label="table.field.outStockItem.maktx" alwaysOn/>, |
| | | <TextInput source="matnrCode" label="table.field.outStockItem.matnrCode" alwaysOn/>, |
| | | <TextInput source="maktx" label="table.field.outStockItem.maktx" alwaysOn />, |
| | | <TextInput source="matnrCode" label="table.field.outStockItem.matnrCode" alwaysOn />, |
| | | <NumberInput source="anfme" label="table.field.outStockItem.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.outStockItem.stockUnit" />, |
| | | <NumberInput source="purQty" label="table.field.outStockItem.purQty" />, |
| | |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poDetlId', 'purQty','purUnit','trackCode','packName','splrName','matnrId', 'asnId']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poDetlId', 'purQty', 'purUnit', 'trackCode', 'packName','qrcode', 'splrName', 'matnrId', 'asnId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.outStockItem.asnId" /> |
| | |
| | | <TextField source="matnrId" label="table.field.outStockItem.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.outStockItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.outStockItem.maktx" /> |
| | | <TextField source="platOrderCode" label="table.field.outStockItem.platOrderCode" /> |
| | | <NumberField source="anfme" label="table.field.outStockItem.anfme" /> |
| | | <TextField source="stockUnit" label="table.field.outStockItem.stockUnit" /> |
| | | <NumberField source="purQty" label="table.field.outStockItem.purQty" /> |
| | | <TextField source="purUnit" label="table.field.outStockItem.purUnit" /> |
| | | <NumberField source="workQty" label="table.field.outStockItem.workQty" /> |
| | | <NumberField source="qty" label="table.field.outStockItem.qty" /> |
| | | <TextField source="stockUnit" label="table.field.outStockItem.stockUnit" /> |
| | | <TextField source="purUnit" label="table.field.outStockItem.purUnit" /> |
| | | <TextField source="splrCode" label="table.field.outStockItem.splrCode" /> |
| | | <TextField source="splrName" label="table.field.outStockItem.splrName" /> |
| | | <TextField source="qrcode" label="table.field.outStockItem.qrcode" /> |
| | |
| | | <ReferenceInput source="type" reference="dictData" filter={{ dictTypeCode: 'sys_order_type', group: '2' }} label="table.field.outStock.type" alwaysOn> |
| | | <AutocompleteInput label="table.field.outStock.type" optionValue="value" /> |
| | | </ReferenceInput>, |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type', group: '2'}} label="table.field.outStock.wkType" alwaysOn> |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type', group: '2' }} label="table.field.outStock.wkType" alwaysOn> |
| | | <AutocompleteInput label="table.field.outStock.wkType" optionValue="value" /> |
| | | </ReferenceInput>, |
| | | <NumberInput source="anfme" label="table.field.outStock.anfme" />, |
| | |
| | | <TextField source="type$" label="table.field.outStock.type" /> |
| | | <TextField cellClassName="wkType" source="wkType$" label="table.field.outStock.wkType" /> |
| | | <NumberField source="anfme" label="table.field.outStock.anfme" /> |
| | | <NumberField source="workQty" label="table.field.outStock.workQty" /> |
| | | <NumberField source="qty" label="table.field.outStock.qty" /> |
| | | <TextField source="logisNo" label="table.field.outStock.logisNo" /> |
| | | <TextField source="rleStatus$" label="table.field.outStock.rleStatus" sortable={false} /> |
| | |
| | | } |
| | | |
| | | return ( |
| | | record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelOutlinedIcon /> } onConfirm={cancelOrder} /> : <></> |
| | | record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelOutlinedIcon />} onConfirm={cancelOrder} /> : <></> |
| | | ) |
| | | } |
| | |
| | | import { Dialog, DialogActions, DialogContent, DialogTitle, Box } from "@mui/material"; |
| | | import { Dialog, DialogActions, DialogContent, DialogTitle, Box, LinearProgress } from "@mui/material"; |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | List, |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | SimpleForm, |
| | | Form, |
| | | SaveButton, |
| | | useRefresh, |
| | |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import { Grid, Stack, width } from "@mui/system"; |
| | | import { Grid, margin, Stack, width } from "@mui/system"; |
| | | import request from '@/utils/request'; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import debounce from "lodash/debounce"; |
| | |
| | | width: 90 |
| | | }, |
| | | })); |
| | | |
| | | const StyledForm = styled(Form)(({ theme }) => ({ |
| | | width: '100%', |
| | | marginBottom: '45px', |
| | | |
| | | '& .MuiGrid-root': { |
| | | margin: '0 10px' |
| | | } |
| | | })); |
| | | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | |
| | | const { filterValues, setFilters, refetch } = useListContext('deliveryItem'); |
| | | const [formValues, setFormValues] = useState(filterValues); |
| | | const handleChange = (event) => { |
| | | if (event.target == undefined || event.target == null) {return} |
| | | if (event.target == undefined || event.target == null) { return } |
| | | setFormValues(formValues => ({ |
| | | ...formValues, |
| | | [event.target.name]: event.target.value |
| | | [event.target.name]: event.target.value |
| | | })); |
| | | }; |
| | | |
| | | |
| | | |
| | | const handleSubmit = (event) => { |
| | | setParams(formValues) |
| | | }; |
| | | |
| | | return ( |
| | | <Form> |
| | | <Grid container rowSpacing={2} columnSpacing={2} > |
| | | <StyledForm> |
| | | <Grid container rowSpacing={3} columnSpacing={3} > |
| | | <Stack> |
| | | <TextInput |
| | | source="condition" |
| | |
| | | <SaveButton onClick={handleSubmit} label={"toolbar.query"} /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </StyledForm> |
| | | ); |
| | | }; |
| | | return ( |
| | |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | sx={{ height: '400' }} |
| | | preferenceKey='deliveryItem' |
| | | bulkActionButtons={<AddOutStockButton setOpen={setOpen} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'workQty', 'startTime', 'endTime', 'updateBy', 'createTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="deliveryCode" label="table.field.deliveryItem.deliveryCode" /> |
| | | <TextField source="matnrCode" label="table.field.deliveryItem.matnrCode" /> |
| | | <TextField source="matnrName" label="table.field.deliveryItem.matnrName" /> |
| | | <TextField source="unit" label="table.field.deliveryItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.deliveryItem.anfme" /> |
| | | <TextField source="splrName" label="table.field.deliveryItem.splrName" /> |
| | | <TextField source="splrBatch" label="table.field.deliveryItem.splrBatch" /> |
| | | <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> |
| | | <Box sx={{ position: 'relative', minHeight: "60vh", }}> |
| | | <LinearProgress |
| | | sx={{ |
| | | height: "2px", |
| | | position: 'absolute', |
| | | top: 0, |
| | | left: 0, |
| | | right: 0, |
| | | }} |
| | | /> |
| | | <StyledDatagrid |
| | | preferenceKey='deliveryItem' |
| | | bulkActionButtons={<AddOutStockButton setOpen={setOpen} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'workQty', 'startTime', 'endTime', 'updateBy', 'createTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="deliveryCode" label="table.field.deliveryItem.deliveryCode" /> |
| | | <TextField source="matnrCode" label="table.field.deliveryItem.matnrCode" /> |
| | | <TextField source="matnrName" label="table.field.deliveryItem.matnrName" /> |
| | | <TextField source="unit" label="table.field.deliveryItem.unit" /> |
| | | <NumberField source="anfme" label="table.field.deliveryItem.anfme" /> |
| | | <TextField source="splrName" label="table.field.deliveryItem.splrName" /> |
| | | <TextField source="splrBatch" label="table.field.deliveryItem.splrBatch" /> |
| | | <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> |
| | | </Box> |
| | | </List> |
| | | </Grid> |
| | | </DialogContent> |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrder, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrder.class); |
| | | QueryWrapper<AsnOrder> queryWrapper = pageParam.buildWrapper(true); |
| | | List<String> asList = Arrays.asList(OrderType.ORDER_OUT.type); |
| | | queryWrapper.notIn("type", asList); |
| | | // List<String> asList = Arrays.asList(OrderType.ORDER_OUT.type); |
| | | // queryWrapper.notIn("type", asList); |
| | | return R.ok().add(asnOrderService.page(pageParam, queryWrapper)); |
| | | } |
| | | |
| | |
| | | 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.common.exception.BusinessException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | |
| | | import com.vincent.rsf.server.manager.entity.Delivery; |
| | | import com.vincent.rsf.server.manager.entity.DeliveryItem; |
| | | import com.vincent.rsf.server.manager.entity.excel.DeliveryTemplate; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.OrderWorkType; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | |
| | | @OperationLog("Delete 综合单据明细") |
| | | @PostMapping("/delivery/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!deliveryService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | List<Long> list = Arrays.asList(ids); |
| | | if (list.isEmpty()) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | return R.ok("操作成功").add(deliveryService.removeDo(list)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:delivery:list')") |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrder, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrder.class); |
| | | return R.ok().add(outStockService.page(pageParam, pageParam.buildWrapper(true))); |
| | | QueryWrapper<AsnOrder> queryWrapper = pageParam.buildWrapper(true); |
| | | List<String> list = Arrays.asList(OrderType.ORDER_IN.type); |
| | | queryWrapper.in("type", list); |
| | | return R.ok().add(outStockService.page(pageParam, queryWrapper)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:list')") |
| | |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<Long> ids = (List<Long>) params.get("ids"); |
| | | return outStockService.genOutStock(ids); |
| | | return outStockService.genOutStock(ids, getLoginUserId()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:update')") |
| | |
| | | } |
| | | return outStockService.updateOrderItem(params, getLoginUserId()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value= "主单标识") |
| | | private Long deliveryId; |
| | | |
| | | |
| | | @ApiModelProperty("主单编码") |
| | | private String deliveryCode; |
| | | |
| | | @ApiModelProperty("客户订单号") |
| | | private String platOrderCode; |
| | | |
| | | @ApiModelProperty("工单号") |
| | | private String platWorkCode; |
| | | |
| | | @ApiModelProperty("项目号") |
| | | private String projectCode; |
| | | |
| | | /** |
| | | * erp明细标识 |
| | |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 执行数量 |
| | | */ |
| | | @ApiModelProperty(value= "执行数量") |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 已出数量 |
| | | */ |
| | | @ApiModelProperty(value= "已出数量") |
| | |
| | | // PO_EXCE_STATUS_ALL_DONE("3", "已完成"), |
| | | |
| | | |
| | | OUT_STOCK_STATUS_TASK_INIT("11", "初始化"), |
| | | OUT_STOCK_STATUS_TASK_EXCE("12", "待处理"), |
| | | OUT_STOCK_STATUS_TASK_WAVE("13", "生成波次"), |
| | | OUT_STOCK_STATUS_TASK_WORKING("14", "作业中") |
| | | OUT_STOCK_STATUS_TASK_INIT("10", "初始化"), |
| | | OUT_STOCK_STATUS_TASK_EXCE("11", "待处理"), |
| | | OUT_STOCK_STATUS_TASK_WAVE("12", "生成波次"), |
| | | OUT_STOCK_STATUS_TASK_WORKING("13", "作业中") |
| | | ; |
| | | AsnExceStatus(String val, String desc) { |
| | | this.val = Short.parseShort(val); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.Delivery; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DeliveryService extends IService<Delivery> { |
| | | |
| | | Delivery removeDo(List<Long> list); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.manager.controller.params.AsnOrderAndItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.BatchUpdateParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface OutStockService extends IService<AsnOrder> { |
| | | |
| | | R cancelOutOrder(String id); |
| | | |
| | | R genOutStock(List<Long> ids); |
| | | R genOutStock(List<Long> ids, Long loginUserId); |
| | | |
| | | R generateWaves(List<Long> ids); |
| | | |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.exception.BusinessException; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.mapper.DeliveryMapper; |
| | | import com.vincent.rsf.server.manager.entity.Delivery; |
| | | import com.vincent.rsf.server.manager.service.DeliveryItemService; |
| | | import com.vincent.rsf.server.manager.service.DeliveryService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("deliveryService") |
| | | public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements DeliveryService { |
| | | |
| | | @Autowired |
| | | private DeliveryItemService deliveryItemService; |
| | | |
| | | |
| | | @Override |
| | | public Delivery removeDo(List<Long> list) { |
| | | List<Delivery> deliveries = this.list(new LambdaQueryWrapper<Delivery>().eq(Delivery::getId, list)); |
| | | if (deliveries.isEmpty()) { |
| | | throw new BusinessException("数据错误:单据信息不存在!!"); |
| | | } |
| | | deliveries.forEach(delivery -> { |
| | | if (delivery.getExceStatus().equals(AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val)){ |
| | | if (!this.removeById(delivery.getId())) { |
| | | throw new CoolException("主单删除失败!!"); |
| | | } |
| | | if (!deliveryItemService.removeById(delivery.getId())) { |
| | | throw new CoolException("单据明细删除失败!1"); |
| | | } |
| | | } else { |
| | | throw new CoolException("单据已执行,不可执行删除操作!!"); |
| | | } |
| | | }); |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.AsnOrderAndItemsParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.POExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.WaveExceStatus; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | |
| | | * @time 2025/4/7 13:28 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private void svaeOrUpdateOrderItem(AsnOrderAndItemsParams params, Long loginUserId) throws Exception { |
| | | public void svaeOrUpdateOrderItem(AsnOrderAndItemsParams params, Long loginUserId) throws Exception { |
| | | AsnOrder orders = params.getOrders(); |
| | | params.getItems().forEach(item -> { |
| | | item.put("asnId", orders.getId()); |
| | |
| | | |
| | | /** |
| | | * @param |
| | | * @param loginUserId |
| | | * @return |
| | | * @author Ryan |
| | | * @description 通过DO单生成出库单 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R genOutStock(List<Long> ids) { |
| | | public R genOutStock(List<Long> ids, Long loginUserId) { |
| | | if (Objects.isNull(ids) || ids.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | |
| | | throw new CoolException("编码规则错误:请检查 「SYS_OUT_STOCK_CODE」编码是否设置成功"); |
| | | } |
| | | order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val) |
| | | .setType(delivery.getType()) |
| | | .setWkType(delivery.getWkType()) |
| | | .setCode(ruleCode) |
| | | .setPoId(delivery.getId()) |
| | | .setId(null) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId) |
| | | .setPoCode(delivery.getCode()); |
| | | if (!this.save(order)) { |
| | | throw new CoolException("主单保存失败!!"); |
| | |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setAsnId(order.getId()) |
| | | .setAsnCode(order.getCode()) |
| | | .setStockUnit(item.getUnit()) |
| | | .setPurUnit(item.getUnit()) |
| | | .setPlatWorkCode(item.getPlatWorkCode()) |
| | | .setPlatOrderCode(item.getPlatOrderCode()) |
| | | .setProjectCode(item.getProjectCode()) |
| | | .setPlatItemId(item.getPlatItemId()) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId) |
| | | .setPoDetlId(item.getId()); |
| | | orderItems.add(orderItem); |
| | | |
| | | if (!deliveryItemService.update(new LambdaUpdateWrapper<DeliveryItem>() |
| | | .set(DeliveryItem::getWorkQty, item.getAnfme()) |
| | | .eq(DeliveryItem::getId, item.getId()))) { |
| | | throw new CoolException("DO单明细修改失败!!"); |
| | | } |
| | | }); |
| | | |
| | | double sum = orderItems.stream().mapToDouble(AsnOrderItem::getAnfme).sum(); |
| | | Double sum = orderItems.stream().mapToDouble(AsnOrderItem::getAnfme).sum(); |
| | | //修改计划数量 |
| | | order.setAnfme(sum); |
| | | if (!this.saveOrUpdate(order)) { |
| | |
| | | if (!asnOrderItemService.saveBatch(orderItems)) { |
| | | throw new CoolException("明细保存失败!!"); |
| | | } |
| | | |
| | | if (!deliveryService.update(new LambdaUpdateWrapper<Delivery>() |
| | | .set(Delivery::getExceStatus, POExceStatus.PO_EXCE_STATUS_EXCE_ING.val) |
| | | .set(Delivery::getWorkQty, sum) |
| | | .eq(Delivery::getId, key))) { |
| | | throw new CoolException("主单修改失败!!"); |
| | | } |
| | | |
| | | }); |
| | | return R.ok(); |
| | | } |
| | |
| | | aoi.asn_code, |
| | | aoi.plat_item_id, |
| | | aoi.po_detl_id, |
| | | aoi.plat_work_code, |
| | | aoi.po_code, |
| | | aoi.fields_index, |
| | | aoi.matnr_id, |
| | |
| | | aoi.anfme, |
| | | aoi.stock_unit, |
| | | aoi.pur_qty, |
| | | aoi.work_qty, |
| | | aoi.pur_unit, |
| | | aoi.prod_time, |
| | | aoi.qty, |
| | |
| | | aoi.asn_id, |
| | | aoi.asn_code, |
| | | aoi.plat_item_id, |
| | | aoi.plat_work_code, |
| | | aoi.po_detl_id, |
| | | aoi.po_code, |
| | | aoi.fields_index, |
| | |
| | | aoi.maktx, |
| | | aoi.anfme, |
| | | aoi.stock_unit, |
| | | aoi.work_qty, |
| | | aoi.pur_qty, |
| | | aoi.pur_unit, |
| | | aoi.prod_time, |