| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.StationCommandType; |
| | | import com.zy.core.model.StationObjModel; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @PostMapping("/command/move") |
| | | public R commandMove(@RequestBody StationCommandMoveParam param) { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/command/reset") |
| | | public R commandReset(@RequestBody StationCommandMoveParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error("缺少参数"); |
| | | } |
| | | |
| | | Integer taskNo = param.getTaskNo(); |
| | | redisUtil.set(RedisKeyType.DEVICE_STATION_MOVE_RESET.key + taskNo, "cancel", 3); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | DEVICE_ERR_ACTIVE_RGV("device_err_active_rgv_"), |
| | | DEVICE_ERR_ACTIVE_CRN("device_err_active_crn_"), |
| | | DEVICE_ERR_ACTIVE_DUAL_CRN("device_err_active_dual_crn_"), |
| | | DEVICE_STATION_MOVE_RESET("device_station_move_reset_"), |
| | | |
| | | GENERATE_IN_TASK_LIMIT("generate_in_task_limit_"), |
| | | |
| | |
| | | boolean firstRun = true; |
| | | while (true) { |
| | | try { |
| | | Object cancel = redisUtil.get(RedisKeyType.DEVICE_STATION_MOVE_RESET.key + original.getTaskNo()); |
| | | if (cancel != null) { |
| | | break;//收到中断信号 |
| | | } |
| | | |
| | | StationProtocol currentStation = findCurrentStationByTask(original.getTaskNo()); |
| | | if (currentStation == null) { |
| | | if(System.currentTimeMillis() - runTime > 1000 * 60){ |
| | |
| | | <div style="margin-bottom: 10px;width: 33%;"><el-input size="mini" v-model="controlParam.taskNo" placeholder="工作号"></el-input></div> |
| | | <div style="margin-bottom: 10px;width: 33%;"><el-input size="mini" v-model="controlParam.targetStationId" placeholder="目标站"></el-input></div> |
| | | <div style="margin-bottom: 10px;"><el-button @click="controlCommand()" size="mini">下发</el-button></div> |
| | | <div style="margin-bottom: 10px;"><el-button @click="resetCommand()" size="mini">复位</el-button></div> |
| | | </div> |
| | | </div> |
| | | <div style="max-height: 55vh; overflow:auto;"> |
| | |
| | | }, |
| | | }); |
| | | }, |
| | | resetCommand() { |
| | | let that = this; |
| | | //下发命令 |
| | | $.ajax({ |
| | | url: baseUrl + "/station/command/move", |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | contentType: "application/json", |
| | | method: "post", |
| | | data: JSON.stringify(that.controlParam), |
| | | success: (res) => { |
| | | if (res.code == 200) { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | that.$message({ |
| | | message: res.msg, |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |