50f2f8945f1ab86c931fee6cf9d9bd88a122ae6e..2a125d08bd4437dbf0e93f2d25ea196715ce82a4
2025-06-09 skyouc
下发执行功能优化 添加站点默认值
2a125d 对比 | 目录
2025-06-09 skyouc
下发执行功能优化
952f6d 对比 | 目录
2025-06-09 zjj
#单据出库
bbb5b0 对比 | 目录
2025-06-09 zjj
#单据出库
e85257 对比 | 目录
4个文件已修改
208 ■■■■ 已修改文件
rsf-admin/src/page/orders/outStock/OutOrderList.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/orders/outStock/OutStockPublic.jsx 165 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/dto/OrderOutItemDto.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/orders/outStock/OutOrderList.jsx
@@ -197,7 +197,7 @@
        drawerVal={drawerVal}
        setDrawerVal={setDrawerVal}
      >
        <OutStockPublic record={select} open={drawerVal}/>
        <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal}/>
      </PageEditDrawer>
    </Box >
  )
rsf-admin/src/page/orders/outStock/OutStockPublic.jsx
@@ -1,4 +1,4 @@
import { Box, Card, Grid, LinearProgress } from "@mui/material";
import { Box, Card, Grid, LinearProgress, Select, MenuItem, ListItemText, Tooltip } from "@mui/material";
import React, { useState, useRef, useEffect, useMemo } from "react";
import {
    List,
@@ -39,11 +39,11 @@
} from 'react-admin';
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting';
import { styled } from '@mui/material/styles';
import { DataGrid } from '@mui/x-data-grid';
import { DataGrid, useGridApiContext } from '@mui/x-data-grid';
import request from '@/utils/request';
import DictSelect from "../../components/DictSelect";
import ConfirmationNumberOutlinedIcon from '@mui/icons-material/ConfirmationNumberOutlined';
import CloseSharpIcon from '@mui/icons-material/CloseSharp';
import ConfirmButton from '../../components/ConfirmButton';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -59,9 +59,12 @@
const OutStockPublic = (props) => {
    const { record, open } = props;
    const { record, open, setOpen } = props;
    const dataGridRef = useRef(null);
    const notify = useNotify();
    const [rows, setRows] = useState({});
    const translate = useTranslate();
    const [selectedIds, setSelectedIds] = React.useState([]);
    const [formData, setFormData] = useState({
        orderId: record?.id
    });
@@ -73,11 +76,12 @@
        if (formData.waveId == null && formData.waveId == undefined) {
            return
        }
        const res = await request.post('/outStock/order/getOutTaskItems', { ...formData });
        if (res?.data?.code === 200) {
            setRows(res.data.data.records)
        const { data: { code, data, msg } } = await request.post('/outStock/order/getOutTaskItems', { ...formData });
        if (code === 200) {
            setRows(data)
        } else {
            notify(res.data.msg);
            notify(msg);
        }
    }
@@ -87,7 +91,6 @@
            [name]: value
        }));
    };
    return (
        <>
            <Box>
@@ -107,13 +110,6 @@
                                    />
                                </ReferenceInput>
                            </Form>
                            {/* <DictSelect
                                label={translate("table.field.waveRule.type")}
                                onChange={(e) => handleChange(e.target.value, 'type')}
                                value={formData.type}
                                dictTypeCode="sys_wave_rule_code"
                                required
                            /> */}
                            <List
                                resource="outStockItem"
                                storeKey='outStockItem'
@@ -169,13 +165,17 @@
                                            },
                                        },
                                    }}
                                    ref={dataGridRef}
                                    checkboxSelection
                                    onRowSelectionModelChange={(ids) => {
                                        setSelectedIds(ids)
                                    }}
                                    pageSizeOptions={[15, 25, 35, 45]}
                                    disableRowSelectionOnClick
                                />
                            </Box>
                            <Box sx={{ textAlign: 'center' }}>
                                <Button label="toolbar.close" variant="outlined" size="medium" startIcon={<CloseSharpIcon />} sx={{ margin: '3.5em' }} />
                                <Button label="toolbar.confirm" variant="contained" size="medium" startIcon={<ConfirmationNumberOutlinedIcon />} />
                                <CloseButton setOpen={setOpen} />
                                <SubmitButton selectedIds={selectedIds} setSelectedIds={setSelectedIds} />
                            </Box>
                        </Card>
                    </Grid>
@@ -186,29 +186,128 @@
}
//提交按钮
const SubmitButton = ({ selectedIds, setSelectedIds }) => {
    const submit = () => {
        if (selectedIds.length < 1) { return }
        console.log(selectedIds);
    }
const rows = [
    { id: 1, locCode: '03-02-1-2-1', container: 'Snow', batch: 'Jon', curQty: 14 },
    { id: 2, locCode: '03-02-1-2-1', container: 'Lannister', batch: 'Cersei', curQty: 31 },
    { id: 3, locCode: '03-02-1-2-1', container: 'Lannister', batch: 'Jaime', curQty: 31 },
    { id: 4, locCode: '03-02-1-2-1', container: 'Stark', batch: 'Arya', curQty: 11 },
    { id: 5, locCode: '03-02-1-2-1', container: 'Targaryen', batch: 'Daenerys', curQty: null },
    { id: 6, locCode: '03-02-1-2-1', container: 'Melisandre', batch: null, curQty: 150 },
    { id: 7, locCode: '03-02-1-2-1', container: 'Clifford', batch: 'Ferrara', curQty: 44 },
    { id: 8, locCode: '03-02-1-2-1', container: 'Frances', batch: 'Rossini', curQty: 36 },
    { id: 9, locCode: '03-02-1-2-1', container: 'Roxie', batch: 'Harvey', curQty: 65 },
]
    return (
        <ConfirmButton
            label="toolbar.confirm"
            variant="contained"
            size="medium"
            onConfirm={submit}
            startIcon={<ConfirmationNumberOutlinedIcon />}
        />
    )
}
//关闭按钮
const CloseButton = ({ setOpen }) => {
    const close = () => {
        setOpen(false)
    }
    return (
        <Button
            label="toolbar.close"
            variant="outlined"
            size="medium"
            onClick={close}
            startIcon={<CloseSharpIcon />}
            sx={{ margin: '3.5em' }} />
    )
}
const columns = [
    { field: 'id', headerName: 'ID', width: 40 },
    { field: 'locCode', headerName: '库位', width: 110 },
    { field: 'container', headerName: '容器', width: 120 },
    { field: 'barcode', headerName: '容器', width: 120 },
    { field: 'batch', headerName: '批次', width: 90 },
    { field: 'unit', headerName: '单位', width: 90 },
    { field: 'curQty', headerName: '本次出库数量', width: 110 },
    { field: 'siteNo', headerName: '出库口', width: 90 }, ``
    { field: 'workQty', headerName: '本次出库数量', width: 110 },
    {
        field: 'siteNo',
        headerName: '出库口',
        width: 90,
        type: 'singleSelect',
        editable: true,
        renderCell: (params) => (
            <OutStockSiteNo value={params.value} />
        ),
        renderEditCell: (params) => (
            <OutStockSite {...params} />
        ),
    },
]
const OutStockSiteNo = React.memo(function OutStockSiteNo(props) {
    const { value } = props;
    if (!value) {
        return null;
    }
    return (
        <Box
            sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}
        >
            <span>{value}</span>
        </Box>
    );
});
const OutStockSite = (params) => {
    const { id, field, siteNo, row: { staNos } } = params;
    const apiRef = useGridApiContext();
    const handleChange = async (event) => {
        await apiRef.current.setEditCellValue(
            { id, field, value: event.target.value },
            event,
        );
        apiRef.current.stopCellEditMode({ id, field });
    };
    const handleClose = (event, reason) => {
        if (reason === 'backdropClick') {
            apiRef.current.stopCellEditMode({ id, field });
        }
    };
    return (
        <Select
            value={siteNo}
            onChange={handleChange}
            MenuProps={{
                onClose: handleClose,
            }}
            sx={{
                height: '100%',
                '& .MuiSelect-select': {
                    display: 'flex',
                    alignItems: 'center',
                    pl: 1,
                },
            }}
            autoFocus
            fullWidth
            open
        >
            {staNos.map((option) => {
                return (
                    <MenuItem
                        key={option}
                        value={option.staNo}
                    >
                        <ListItemText sx={{ overflow: 'hidden' }} primary={option.staNo} />
                    </MenuItem>
                );
            })}
        </Select >
    )
}
export default OutStockPublic;
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/dto/OrderOutItemDto.java
@@ -2,26 +2,32 @@
import com.vincent.rsf.server.manager.entity.LocItem;
import com.vincent.rsf.server.manager.utils.Synchro;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.Delegate;
import java.util.List;
@Data
public class OrderOutItemDto  {
    @Delegate
@Accessors(chain = true)
public class OrderOutItemDto {
    @Delegate(excludes = Synchro.class)
    private LocItem locItem;
    private List<staListDto> staNos;
    private String siteNo;
    @Data
    public static class staListDto{
        private String staNo;
        private String staName;
    }
    public void sync(Object source) {
        Synchro.Copy(source, this);
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/OutStockServiceImpl.java
@@ -28,6 +28,7 @@
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import com.vincent.rsf.server.manager.enums.WaveRuleType;
/**
@@ -368,6 +369,7 @@
        }
        return R.ok();
    }
    /**
     * @param
     * @return
@@ -400,26 +402,26 @@
    @Override
    public R getOrderOutTaskItem(OrderOutTaskParam param) {
        if (Cools.isEmpty(param.getWaveId())){
        if (Cools.isEmpty(param.getWaveId())) {
            throw new CoolException("策略参数为空");
        }
        if (Cools.isEmpty(param.getOrderId())){
        if (Cools.isEmpty(param.getOrderId())) {
            throw new CoolException("单据id为空");
        }
        WaveRule waveRule = waveRuleService.getOne(new LambdaQueryWrapper<WaveRule>().eq(WaveRule::getId, param.getWaveId()));
        if (Cools.isEmpty(waveRule)){
        if (Cools.isEmpty(waveRule)) {
            throw new CoolException("未找到当前策略");
        }
        List<OrderOutItemDto> locItems = null;
        if (WaveRuleType.Efficiency_First.type.equals(waveRule.getType())) {
            locItems =  efficiencyFirst(param.getOrderId());
            locItems = efficiencyFirst(param.getOrderId());
        } else if (WaveRuleType.First_In_First_Out.type.equals(waveRule.getType())) {
        }
        return R.ok(locItems);
    }
    private List<LocItem> getEfficiencyFirstItemList(AsnOrderItem asnOrderItem){
    private List<LocItem> getEfficiencyFirstItemList(AsnOrderItem asnOrderItem) {
        QueryWrapper<LocItem> locItemQueryWrapper = new QueryWrapper<>();
        locItemQueryWrapper.eq("matnr_code", asnOrderItem.getMatnrCode());
        locItemQueryWrapper.eq("batch", asnOrderItem.getSplrBatch());
@@ -432,11 +434,11 @@
        );
        locItemQueryWrapper.apply(applySql);
        List<LocItem> locItems = locItemService.list(locItemQueryWrapper);
        locItems.sort((s1,s2)-> LocUtils.isShallowLoc(s1.getLocCode())?-1:0);
        locItems.sort((s1, s2) -> LocUtils.isShallowLoc(s1.getLocCode()) ? -1 : 0);
        return locItems;
    }
    private List<OrderOutItemDto> efficiencyFirst(Long orderId){
    private List<OrderOutItemDto> efficiencyFirst(Long orderId) {
        List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>()
                .eq(AsnOrderItem::getAsnId, orderId)
        );
@@ -458,15 +460,20 @@
            for (LocItem locItem : locItems) {
                Loc loc = locService.getById(locItem.getLocId());
                List<LocItem> itemList = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocCode, locItem.getLocCode()));
                if (issued.doubleValue() > 0){
                if (issued.doubleValue() > 0) {
                    ExistDto existDto = new ExistDto().setBatch(locItem.getBatch()).setMatnr(locItem.getMatnrCode()).setLocNo(locItem.getLocCode());
                    if (existDtos.add(existDto)){
                    if (existDtos.add(existDto)) {
                        locItem.setWorkQty(issued.doubleValue() >= locItem.getAnfme() ? locItem.getAnfme() : issued.doubleValue());
                        OrderOutItemDto orderOutItemDto = new OrderOutItemDto();
                        orderOutItemDto.sync(locItem);
                        orderOutItemDto.setLocItem(locItem);
                        List<DeviceSite> deviceSites = deviceSiteService.list(new LambdaQueryWrapper<DeviceSite>()
                                .eq(DeviceSite::getChannel, loc.getChannel())
                                .eq(DeviceSite::getType, issued.doubleValue() >= locItem.getAnfme() && itemList.size() == 1 ? TaskType.TASK_TYPE_OUT.type : TaskType.TASK_TYPE_PICK_AGAIN_OUT.type)
                        );
                        if (!deviceSites.isEmpty()) {
                            DeviceSite deviceSite = deviceSites.stream().findFirst().get();
                            orderOutItemDto.setSiteNo(deviceSite.getSite());
                        }
                        List<OrderOutItemDto.staListDto> maps = new ArrayList<>();
                        for (DeviceSite sta : deviceSites) {
                            OrderOutItemDto.staListDto staListDto = new OrderOutItemDto.staListDto();