#
Junjie
2025-01-12 7b9de83ff213a44b8a20f51833ff3ff8e84f9e33
#
3个文件已修改
133 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/OpenController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ShuttleController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/task.html 126 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -8,10 +8,7 @@
import com.zy.core.dispatcher.ShuttleDispatchUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -182,7 +182,7 @@
    public R shuttleCommandQuery(@RequestParam("wrkNo") Integer wrkNo) {
        Object o = redisUtil.get(RedisKeyType.SHUTTLE_WORK_FLAG.key + wrkNo);
        if (o == null) {
            return R.error();
            return R.error("指令不存在");
        }
        ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class);
        return R.ok().add(redisCommand);
src/main/webapp/views/task.html
@@ -74,32 +74,28 @@
                </el-card>
            </div>
            <el-dialog :title="taskWrkFormTitle" :visible.sync="taskWrkFormVisible">
                <el-form :model="taskWrkForm">
                    <el-form-item label="站点状态" :label-width="taskWrkFormLabelWidth">
                        <el-select v-model="taskWrkForm.siteStatus" placeholder="站点状态">
                            <el-option label="无托盘" value="1"></el-option>
                            <el-option label="空盘头" value="2"></el-option>
                            <el-option label="满盘头" value="3"></el-option>
                            <el-option label="空托盘" value="4"></el-option>
                            <el-option label="托盘入站中" value="5"></el-option>
                            <el-option label="托盘出站中" value="6"></el-option>
                            <el-option label="禁用" value="7"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="物料号" :label-width="taskWrkFormLabelWidth">
                        <el-input v-model="taskWrkForm.matnr" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="工作号" :label-width="taskWrkFormLabelWidth">
                        <el-input v-model="taskWrkForm.wrkNo" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="托盘码" :label-width="taskWrkFormLabelWidth">
                        <el-input v-model="taskWrkForm.barcode" autocomplete="off"></el-input>
                    </el-form-item>
                </el-form>
            <el-dialog :title="shuttleCommandTitle" :visible.sync="shuttleCommandVisible">
                <el-table ref="singleTable" :data="shuttleCommandData.assignCommand.commands" style="width: 100%;">
                    <el-table-column property="mode" label="命令类型">
                    </el-table-column>
                    <el-table-column property="start" label="起点">
                    </el-table-column>
                    <el-table-column property="target" label="终点">
                    </el-table-column>
                    <el-table-column property="taskId" label="taskId">
                    </el-table-column>
                    <el-table-column property="robotId" label="robotId">
                    </el-table-column>
                    <el-table-column property="complete" label="是否完成">
                    </el-table-column>
                    <el-table-column label="操作" width="100">
                        <template slot-scope="scope">
                            <el-button @click="shuttleCommandVisible = false" size="mini">回退指令</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="taskWrkFormVisible = false">取 消</el-button>
                    <el-button type="primary" @click="taskWrkFormConfirm">确 定</el-button>
                    <el-button @click="shuttleCommandVisible = false">关闭</el-button>
                </div>
            </el-dialog>
@@ -120,15 +116,14 @@
                    tableSearchParam: {
                        wrk_no: null,
                    },
                    taskWrkFormVisible: false,
                    taskWrkForm: {
                        siteStatus: '1',
                        matnr: '',
                        wrkNo: '',
                        barcode: '',
                    shuttleCommandVisible: false,
                    shuttleCommandData: {
                        assignCommand: {
                            commands: []
                        }
                    },
                    taskWrkFormLabelWidth: '80px',
                    taskWrkFormTitle: ''
                    shuttleCommandLabelWidth: '80px',
                    shuttleCommandTitle: ''
                },
                created() {
                    this.init()
@@ -196,7 +191,37 @@
                            case "cancel":
                                this.cancelTask(row)
                                break;
                            case "shuttleCommand":
                                this.showShuttleCommand(row)
                                break;
                        }
                    },
                    showShuttleCommand(row){
                        let that = this;
                        $.ajax({
                            url: baseUrl + "/shuttle/command/query",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: {
                                wrkNo: row.wrkNo
                            },
                            method: 'GET',
                            success: function(res) {
                                if (res.code == 200) {
                                    console.log(res)
                                    that.shuttleCommandVisible = true;
                                    that.shuttleCommandData = res.data;
                                } else if (res.code === 403) {
                                    top.location.href = baseUrl + "/";
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    },
                    completeTask(row) {
                        let that = this
@@ -278,41 +303,6 @@
                            //     type: 'info',
                            //     message: '已取消删除'
                            // });
                        });
                    },
                    taskWrkFormConfirm() {
                        //修改指定任务数据
                        let that = this
                        $.ajax({
                            url: baseUrl + "/basCacheSite/update/auth",
                            headers: {
                                'token': localStorage.getItem('token')
                            },
                            data: {
                                id: this.taskWrkForm.id,
                                siteStatus: this.taskWrkForm.siteStatus,
                                matnr: this.taskWrkForm.matnr,
                                wrkNo: this.taskWrkForm.wrkNo,
                                barcode: this.taskWrkForm.barcode,
                            },
                            method: 'POST',
                            success: function(res) {
                                if (res.code == 200) {
                                    that.taskWrkFormVisible = false
                                    that.$message({
                                        message: "更新成功",
                                        type: 'success'
                                    });
                                    that.getTableData()
                                } else if (res.code === 403) {
                                    top.location.href = baseUrl + "/";
                                } else {
                                    that.$message({
                                        message: res.msg,
                                        type: 'error'
                                    });
                                }
                            }
                        });
                    },
                },