#
luxiaotao1123
2025-04-02 67524c6348ee4a9d879b050862c6b9429ff9a97e
#
5个文件已修改
1个文件已添加
333 ■■■■ 已修改文件
zy-acs-flow/src/map/insight/agv/AgvControl.jsx 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/sta/StaList.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/sta/rowSx.jsx 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/page/task/TaskList.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/KernelScheduler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/insight/agv/AgvControl.jsx
@@ -281,41 +281,6 @@
                                </Grid>
                            )}
                            {showField('endLocNo') && (
                                <Grid item xs={12}>
                                    <Controller
                                        name="endLocNo"
                                        control={control}
                                        rules={{ required: translate('ra.validation.required') }}
                                        render={({ field, fieldState }) => {
                                            const selectedOption = endLocOptions.find(option => option.id === field.value) || null;
                                            return (
                                                <Autocomplete
                                                    options={endLocOptions}
                                                    getOptionLabel={(option) => option.label}
                                                    isOptionEqualToValue={(option, value) => option.id === value.id}
                                                    value={selectedOption}
                                                    onInputChange={(event, value) => {
                                                        setEndLocInputValue(value);
                                                    }}
                                                    onChange={(event, value) => {
                                                        field.onChange(value ? value.id : null);
                                                    }}
                                                    renderInput={(params) => (
                                                        <TextField
                                                            {...params}
                                                            label={translate('page.map.insight.control.endLoc')}
                                                            error={!!fieldState.error}
                                                            helperText={fieldState.error?.message}
                                                        />
                                                    )}
                                                />
                                            );
                                        }}
                                    />
                                </Grid>
                            )}
                            {showField('startStaNo') && (
                                <Grid item xs={12}>
                                    <Controller
@@ -351,6 +316,41 @@
                                </Grid>
                            )}
                            {showField('endLocNo') && (
                                <Grid item xs={12}>
                                    <Controller
                                        name="endLocNo"
                                        control={control}
                                        rules={{ required: translate('ra.validation.required') }}
                                        render={({ field, fieldState }) => {
                                            const selectedOption = endLocOptions.find(option => option.id === field.value) || null;
                                            return (
                                                <Autocomplete
                                                    options={endLocOptions}
                                                    getOptionLabel={(option) => option.label}
                                                    isOptionEqualToValue={(option, value) => option.id === value.id}
                                                    value={selectedOption}
                                                    onInputChange={(event, value) => {
                                                        setEndLocInputValue(value);
                                                    }}
                                                    onChange={(event, value) => {
                                                        field.onChange(value ? value.id : null);
                                                    }}
                                                    renderInput={(params) => (
                                                        <TextField
                                                            {...params}
                                                            label={translate('page.map.insight.control.endLoc')}
                                                            error={!!fieldState.error}
                                                            helperText={fieldState.error?.message}
                                                        />
                                                    )}
                                                />
                                            );
                                        }}
                                    />
                                </Grid>
                            )}
                            {showField('endStaNo') && (
                                <Grid item xs={12}>
                                    <Controller
zy-acs-flow/src/page/sta/StaList.jsx
@@ -42,6 +42,7 @@
import MyField from "../components/MyField";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
import rowSx from "./rowSx";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -130,6 +131,7 @@
                    rowClick={(id, resource, record) => false}
                    expand={() => <StaPanel />}
                    expandSingle={true}
                    rowSx={rowSx(drawerVal || null)}
                    omit={['id', 'uuid', 'name', 'zpallet', 'updateBy', 'createTime', 'createBy', 'statusBool', 'memo']}
                >
                    <NumberField source="id" />
zy-acs-flow/src/page/sta/rowSx.jsx
New file
@@ -0,0 +1,63 @@
import green from '@mui/material/colors/green';
import orange from '@mui/material/colors/orange';
import red from '@mui/material/colors/red';
import blue from '@mui/material/colors/blue';
import grey from '@mui/material/colors/grey';
const rowSx = (selectedRow) => (record) => {
    let style = {};
    if (!record) {
        return style;
    }
    if (selectedRow && selectedRow.id === record.id) {
        style = {
            ...style,
            backgroundColor: 'action.selected',
        };
    }
    if (record.staSts$ === '无货')
        return {
            ...style,
            borderLeftColor: green[500],
            borderLeftWidth: 5,
            borderLeftStyle: 'solid',
        };
    if (record.staSts$ === '有货')
        return {
            ...style,
            borderLeftColor: blue[500],
            borderLeftWidth: 5,
            borderLeftStyle: 'solid',
        };
    if (record.staSts$ === '禁用')
        return {
            ...style,
            borderLeftColor: red[500],
            borderLeftWidth: 5,
            borderLeftStyle: 'solid',
        };
    if (record.staSts$ === '放货预约')
        return {
            ...style,
            borderLeftColor: orange[500],
            borderLeftWidth: 5,
            borderLeftStyle: 'solid',
        };
    if (record.staSts$ === '取货预约')
        return {
            ...style,
            borderLeftColor: orange[500],
            borderLeftWidth: 5,
            borderLeftStyle: 'solid',
        };
    if (record.staSts$ === '其他')
        return {
            ...style,
            borderLeftColor: grey[500],
            borderLeftWidth: 5,
            borderLeftStyle: 'solid',
        };
    return style;
};
export default rowSx;
zy-acs-flow/src/page/task/TaskList.jsx
@@ -223,7 +223,7 @@
                    expand={() => <TaskPanel />}
                    expandSingle={true}
                    omit={['id', 'uuid', 'startTime', 'endTime', 'errTime', 'emptyMk', 'zpallet',
                        'oriSta', 'oriLoc', 'oriCode', 'destSta', 'destLoc', 'destCode',
                        'oriSta', 'oriLoc', 'oriCode', 'destSta', 'destLoc', 'destCode', 'errDesc',
                        'updateTime', 'updateBy', 'ioTime', 'createBy', 'statusBool', 'memo']}
                >
                    <NumberField source="id" />
zy-acs-manager/src/main/java/com/zy/acs/manager/core/HandlerController.java
@@ -11,10 +11,7 @@
import com.zy.acs.manager.core.service.*;
import com.zy.acs.manager.core.service.astart.MapDataDispatcher;
import com.zy.acs.manager.manager.entity.*;
import com.zy.acs.manager.manager.enums.ActionStsType;
import com.zy.acs.manager.manager.enums.LocStsType;
import com.zy.acs.manager.manager.enums.TaskStsType;
import com.zy.acs.manager.manager.enums.TaskTypeType;
import com.zy.acs.manager.manager.enums.*;
import com.zy.acs.manager.manager.service.*;
import com.zy.acs.manager.system.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
@@ -56,6 +53,8 @@
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private LocService locService;
    @Autowired
    private StaService staService;
    @Autowired
    private TrafficService trafficService;
    @Autowired
@@ -100,6 +99,11 @@
        }
        // generate
        Loc oriLoc = null;
        Loc destLoc = null;
        Sta oriSta = null;
        Sta destSta = null;
        Task task = null;
        switch (param.getTaskMode()) {
            case MOVE:
                Code endCode = null;
@@ -124,7 +128,6 @@
                break;
            case LOC_TO_LOC:
                // oriLoc
                Loc oriLoc = null;
                if (!Cools.isEmpty(param.getStartLocNo())) {
                    oriLoc = locService.getById(param.getStartLocNo());
                }
@@ -137,8 +140,13 @@
                if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
                    throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " 不是在库状态");
                }
                oriLoc.setLocSts(LocStsType.PAKOUT.val());
                oriLoc.setUpdateTime(now);
                if (!locService.updateById(oriLoc)) {
                    throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " 修改库位状态失败");
                }
                // destLoc
                Loc destLoc = null;
                if (!Cools.isEmpty(param.getEndLocNo())) {
                    destLoc = locService.getById(param.getEndLocNo());
                }
@@ -151,46 +159,182 @@
                if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                    throw new BusinessException("destLoc:" + destLoc.getLocNo() + " 不是空闲状态");
                }
                destLoc.setLocSts(LocStsType.PAKIN.val());
                destLoc.setUpdateTime(now);
                if (!locService.updateById(destLoc)) {
                    throw new BusinessException("destLoc:" + destLoc.getLocNo() + " 修改库位状态失败");
                }
                // task
                Task task = new Task();
                task.setAgvId(agv.getId());
                task.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3));
                List<Task> lastTasks = taskService.list(new LambdaQueryWrapper<Task>().orderByDesc(Task::getId));
                task.setSeqNum(Utils.generateSeqNum(Cools.isEmpty(lastTasks)?null:lastTasks.get(0).getSeqNum()));
                task = new Task();
                task.setOriLoc(oriLoc.getId());
                task.setOriCode(oriLoc.getCode());
                task.setDestLoc(destLoc.getId());
                task.setDestCode(destLoc.getCode());
                task.setTaskType(param.getTaskMode().val());
                task.setTaskSts(TaskStsType.WAITING.val());
                task.setPriority(999);
                task.setIoTime(now);
                task.setStartTime(now);
                if (!taskService.save(task)) {
                    throw new BusinessException(task.getSeqNum() + "任务保存失败");
                break;
            case LOC_TO_STA:
                // oriLoc
                if (!Cools.isEmpty(param.getStartLocNo())) {
                    oriLoc = locService.getById(param.getStartLocNo());
                }
                // loc
                if (!Cools.isEmpty(param.getStartLocNoStr())) {
                    oriLoc = locService.selecatByLocNo(param.getStartLocNoStr());
                }
                if (null == oriLoc) {
                    return R.error();
                }
                if (!oriLoc.getLocSts().equals(LocStsType.STOCK.val())) {
                    throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " 不是在库状态");
                }
                oriLoc.setLocSts(LocStsType.PAKOUT.val());
                oriLoc.setUpdateTime(now);
                if (!locService.updateById(oriLoc)) {
                    throw new BusinessException("oriLoc:" + task.getOriLoc$() + " 修改库位状态失败");
                    throw new BusinessException("oriLoc:" + oriLoc.getLocNo() + " 修改库位状态失败");
                }
                // destSta
                if (!Cools.isEmpty(param.getEndStaNo())) {
                    destSta = staService.getById(param.getEndStaNo());
                }
                if (!Cools.isEmpty(param.getEndStaNoStr())) {
                    destSta = staService.selectByStaNo(param.getEndStaNoStr());
                }
                if (null == destSta) {
                    return R.error();
                }
                if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 不是无货状态");
                }
                destSta.setStaSts(StaStsType.READY_RELEASE.val());
                destSta.setUpdateTime(now);
                if (!staService.updateById(destSta)) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 修改站点状态失败");
                }
                // task
                task = new Task();
                task.setOriLoc(oriLoc.getId());
                task.setOriCode(oriLoc.getCode());
                task.setDestSta(destSta.getId());
                task.setDestCode(destSta.getCode());
                break;
            case STA_TO_LOC:
                // oriSta
                if (!Cools.isEmpty(param.getStartStaNo())) {
                    oriSta = staService.getById(param.getStartStaNo());
                }
                if (!Cools.isEmpty(param.getStartStaNoStr())) {
                    oriSta = staService.selectByStaNo(param.getStartStaNoStr());
                }
                if (null == oriSta) {
                    return R.error();
                }
                if (!oriSta.getStaSts().equals(StaStsType.STOCK.val())) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 不是有货状态");
                }
                oriSta.setStaSts(StaStsType.READY_TAKE.val());
                oriSta.setUpdateTime(now);
                if (!staService.updateById(oriSta)) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 修改站点状态失败");
                }
                // destLoc
                if (!Cools.isEmpty(param.getEndLocNo())) {
                    destLoc = locService.getById(param.getEndLocNo());
                }
                if (!Cools.isEmpty(param.getEndLocNoStr())) {
                    destLoc = locService.selecatByLocNo(param.getEndLocNoStr());
                }
                if (null == destLoc) {
                    return R.error();
                }
                if (!destLoc.getLocSts().equals(LocStsType.IDLE.val())) {
                    throw new BusinessException("destLoc:" + destLoc.getLocNo() + " 不是空闲状态");
                }
                destLoc.setLocSts(LocStsType.PAKIN.val());
                destLoc.setUpdateTime(now);
                if (!locService.updateById(destLoc)) {
                    throw new BusinessException("destLoc:" + task.getDestLoc$() + " 修改库位状态失败");
                    throw new BusinessException("destLoc:" + destLoc.getLocNo() + " 修改库位状态失败");
                }
                // task
                task = new Task();
                task.setOriSta(oriSta.getId());
                task.setOriCode(oriSta.getCode());
                task.setDestLoc(destLoc.getId());
                task.setDestCode(destLoc.getCode());
                break;
            case STA_TO_STA:
                // oriSta
                if (!Cools.isEmpty(param.getStartStaNo())) {
                    oriSta = staService.getById(param.getStartStaNo());
                }
                if (!Cools.isEmpty(param.getStartStaNoStr())) {
                    oriSta = staService.selectByStaNo(param.getStartStaNoStr());
                }
                if (null == oriSta) {
                    return R.error();
                }
                if (!oriSta.getStaSts().equals(StaStsType.STOCK.val())) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 不是有货状态");
                }
                oriSta.setStaSts(StaStsType.READY_TAKE.val());
                oriSta.setUpdateTime(now);
                if (!staService.updateById(oriSta)) {
                    throw new BusinessException("oriSta:" + oriSta.getStaNo() + " 修改站点状态失败");
                }
                // destSta
                if (!Cools.isEmpty(param.getEndStaNo())) {
                    destSta = staService.getById(param.getEndStaNo());
                }
                if (!Cools.isEmpty(param.getEndStaNoStr())) {
                    destSta = staService.selectByStaNo(param.getEndStaNoStr());
                }
                if (null == destSta) {
                    return R.error();
                }
                if (!destSta.getStaSts().equals(StaStsType.IDLE.val())) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 不是无货状态");
                }
                destSta.setStaSts(StaStsType.READY_RELEASE.val());
                destSta.setUpdateTime(now);
                if (!staService.updateById(destSta)) {
                    throw new BusinessException("destSta:" + destSta.getStaNo() + " 修改站点状态失败");
                }
                // task
                task = new Task();
                task.setOriSta(oriSta.getId());
                task.setOriCode(oriSta.getCode());
                task.setDestSta(destSta.getId());
                task.setDestCode(destSta.getCode());
                break;
            default:
                break;
        }
        if (null != task) {
            task.setAgvId(agv.getId());
            task.setUuid(String.valueOf(snowflakeIdWorker.nextId()).substring(3));
            List<Task> lastTasks = taskService.list(new LambdaQueryWrapper<Task>().orderByDesc(Task::getId));
            task.setSeqNum(Utils.generateSeqNum(Cools.isEmpty(lastTasks)?null:lastTasks.get(0).getSeqNum()));
            task.setTaskType(param.getTaskMode().val());
            task.setTaskSts(TaskStsType.WAITING.val());
            task.setPriority(999);
            task.setIoTime(now);
            task.setStartTime(now);
            if (!taskService.save(task)) {
                throw new BusinessException(task.getSeqNum() + "任务保存失败");
            }
        }
        return R.ok();
    }
zy-acs-manager/src/main/java/com/zy/acs/manager/core/scheduler/KernelScheduler.java
@@ -75,7 +75,7 @@
    @Scheduled(cron = "0/1 * * * * ? ")
    private void startupBus() throws InterruptedException {
        if (!configService.getVal("TaskAssignMode", Boolean.class)) { return; }
//        if (!configService.getVal("TaskAssignMode", Boolean.class)) { return; }
        if (!this.lock.tryLock(LOCK_TIMEOUT, TimeUnit.SECONDS)) { return; }
        List<Bus> busList = busService.selectBySts(BusStsType.RECEIVE);
        for (Bus bus : busList) {