#
cpT
9 天以前 219fcc8c2bfc0974450fdc89bce8f27f21d7a8f6
#
4个文件已修改
48 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/StationController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/RedisKeyType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/ZyStationV3Thread.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/components/DevpCard.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/StationController.java
@@ -3,6 +3,8 @@
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;
@@ -29,6 +31,8 @@
    @Autowired
    private BasDevpService basDevpService;
    @Autowired
    private RedisUtil redisUtil;
    @PostMapping("/command/move")
    public R commandMove(@RequestBody StationCommandMoveParam param) {
@@ -72,4 +76,15 @@
        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();
    }
}
src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -28,6 +28,7 @@
    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_"),
src/main/java/com/zy/core/thread/impl/ZyStationV3Thread.java
@@ -339,6 +339,11 @@
            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){
src/main/webapp/components/DevpCard.js
@@ -15,6 +15,7 @@
                <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;">
@@ -199,5 +200,31 @@
        },
      });
    },
    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",
            });
          }
        },
      });
    },
  },
});