#
luxiaotao1123
2024-09-29 0114b079a32f03f69dfcd4d77ed89b54694126e2
#
5个文件已修改
48 ■■■■■ 已修改文件
zy-acs-flow/src/page/action/Action.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/mission/MissionCard.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/mission/MissionShow.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/result/MissionVo.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/action/Action.jsx
@@ -22,7 +22,7 @@
    const translate = useTranslate();
    const theme = useTheme();
    const [isHover, setHover] = useState(false);
    console.log(data);
    // console.log(data);
    return (
        <Box
zy-acs-flow/src/page/mission/MissionCard.jsx
@@ -66,7 +66,7 @@
                                Backpack: {mission.backpack}
                            </Typography>
                            <Typography variant="caption" color="textPrimary">
                                Code: {mission.destCode}
                                Code: {mission.currCode}
                            </Typography>
                        </Stack>
                        <Divider orientation="horizontal" flexItem />
zy-acs-flow/src/page/mission/MissionShow.jsx
@@ -23,6 +23,7 @@
    Stack,
    Typography,
    Avatar,
    useTheme,
} from '@mui/material';
import DialogCloseButton from "../components/DialogCloseButton";
import { blueGrey } from '@mui/material/colors';
@@ -61,6 +62,7 @@
}
const MissionShowContent = ({ handleClose }) => {
    const theme = useTheme();
    const record = useRecordContext();
    const translate = useTranslate();
    if (!record) return null;
@@ -191,8 +193,14 @@
                                >
                                    Run Path
                                </Typography>
                                <Typography variant="body2">
                                    [&nbsp;{record.codeList.join(' , ')}&nbsp;]
                                <Typography variant="body2" sx={{ whiteSpace: 'normal', overflow: 'hidden', display: 'flex', flexWrap: 'wrap' }}>
                                    [&nbsp;{record.codeList.map((code, index) => (
                                        <span key={index} style={{
                                            color: record.currCode === code ? theme.palette.primary.main : 'inherit',
                                        }}>
                                            {code}{index < record.codeList.length - 1 && ','}&nbsp;
                                        </span>
                                    ))}&nbsp;]
                                </Typography>
                            </Box>
                        )}
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/controller/result/MissionVo.java
@@ -20,6 +20,8 @@
    private String agv;
    private String currCode;
    private List<String> taskNos = new ArrayList<>();
    private List<Long> taskIds = new ArrayList<>();
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java
@@ -49,16 +49,27 @@
        if (Cools.isEmpty(groupNo)) {
            return null;
        }
        // segment -------------------------------
        List<Segment> list = segmentService.list(new LambdaQueryWrapper<Segment>().eq(Segment::getGroupId, groupNo).orderByAsc(Segment::getSerial));
        if (Cools.isEmpty(list)) {
            return null;
        }
        Segment segment = list.get(0);
        // agv -------------------------------
        AgvDetail agvDetail = agvDetailService.selectByAgvId(segment.getAgvId());
        Long recentCode = agvDetail.getRecentCode();
        String currCode = null;
        if (null != recentCode) {
            currCode = codeService.getById(recentCode).getData();
        }
        // action -------------------------------
        List<Action> actionList = actionService.list(new LambdaQueryWrapper<Action>()
                .eq(Action::getGroupId, groupNo).orderByDesc(Action::getPriority));
        if (Cools.isEmpty(actionList)) {
            return null;
        }
        Segment segment = list.get(0);
        MissionVo vo = new MissionVo();
        vo.setGroupNo(groupNo);
@@ -68,7 +79,8 @@
        vo.setTaskNos(list.stream().map(Segment::getTaskId$).collect(Collectors.toList()));
        vo.setBackpack(segment.getBackpack());
        vo.setDestCode(segment.getEndNode$());
        vo.setProgress(calcProgress(actionList));
        vo.setCurrCode(currCode);
        vo.setProgress(calcProgress(currCode, actionList));
        return vo;
    }
@@ -100,24 +112,16 @@
        return vo;
    }
    public Double calcProgress(List<Action> actionList) {
    public Double calcProgress(String currCode, List<Action> actionList) {
        double progress = 0D;
        if (Cools.isEmpty(actionList)) {
        if (Cools.isEmpty(actionList, currCode)) {
            return progress;
        }
        Action action = actionList.get(0);
        AgvDetail agvDetail = agvDetailService.selectByAgvId(action.getAgvId());
        Long recentCode = agvDetail.getRecentCode();
        if (null == recentCode) {
            return progress;
        }
        Code code = codeService.getById(recentCode);
        List<String> codeList = actionList.stream().map(Action::getCode).distinct().collect(Collectors.toList());
        int totalCodes = codeList.size();
        int currentIndex = codeList.indexOf(code.getData());
        int currentIndex = codeList.indexOf(currCode);
        if (currentIndex >= 0) {
            progress = (currentIndex + 1) * 100.0 / totalCodes;