From 6600520344a39cee677d7cf6be62205dbd176933 Mon Sep 17 00:00:00 2001 From: lsymicc Date: Mon, 30 Mar 2026 15:28:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A0=86=E5=9E=9B=E6=9C=BA=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ddj/controller/MsgDdjController.java | 22 ++++- .../com/ruoyi/device/ddj/domain/MsgDdj.java | 40 +++++--- .../device/ddj/domain/StackerStatus.java | 92 +++++++++++++++++++ .../schedule/plcRead/ddj/PlcDdj1Read.java | 4 + .../schedule/plcRead/ddj/PlcDdj2Read.java | 4 + .../resources/mapper/device/MsgDdjMapper.xml | 32 +++---- 6 files changed, 164 insertions(+), 30 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/StackerStatus.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/controller/MsgDdjController.java b/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/controller/MsgDdjController.java index 24f24f3..25812e3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/controller/MsgDdjController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/controller/MsgDdjController.java @@ -2,6 +2,8 @@ package com.ruoyi.device.ddj.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.device.ddj.domain.StackerStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -104,9 +106,25 @@ public class MsgDdjController extends BaseController @GetMapping("/getStackerStatus/{id}") - public MsgDdj getStackerStatus(@PathVariable Long id){ + public StackerStatus getStackerStatus(@PathVariable Long id){ + //返回堆垛机状态映射 if (id == 1) { - return msgDdjService.selectMsgDdjById(id); + MsgDdj msg = msgDdjService.selectMsgDdjById(id); + StackerStatus status = new StackerStatus(); + status.setId(msg.getId()); + status.setName(msg.getName()); + status.setMode(msg.getCzfs()); + status.setTaskNo(msg.getRwh()); + status.setDeviceStatus(msg.getSbzt()); + status.setForkStatus(msg.getHczt()); + status.setExecutionPhase(msg.getJdbz()); + status.setPermission(msg.getYxxf()); + status.setCurrentRow(msg.getCurrentRow()); + status.setCurrentColumn(msg.getCurrentColumn()); + status.setCurrentFloor(msg.getCurrentFloor()); + status.setCurrentPosition(msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层"); + + return status; }else{ return null; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/MsgDdj.java b/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/MsgDdj.java index e2f06fe..d1e2054 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/MsgDdj.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/MsgDdj.java @@ -1,5 +1,7 @@ package com.ruoyi.device.ddj.domain; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -71,9 +73,21 @@ public class MsgDdj extends BaseEntity private Integer mblh; /** 目标层 */ - @Excel(name = "目标层") + @Excel(name = "当前层") private Integer mbch; + /** 当前排 */ + @Excel(name = "当前排") + private Integer currentRow; + + /** 当前列 */ + @Excel(name = "当前列") + private Integer currentColumn; + + /** 当前层 */ + @Excel(name = "当前层") + private Integer currentFloor; + /** 心跳信号 */ @Excel(name = "心跳信号") private Integer xtxh; @@ -86,22 +100,24 @@ public class MsgDdj extends BaseEntity @Excel(name = "货叉状态") private Integer hczt; - /** 备用字段1 */ - @Excel(name = "备用字段1") - private Integer spare1; - - /** 备用字段2 */ - @Excel(name = "备用字段2") - private Integer spare2; - - /** 备用字段3 */ - @Excel(name = "备用字段3") - private Integer spare3; +// /** 备用字段1 */ +// @Excel(name = "备用字段1") +// private Integer spare1; +// +// /** 备用字段2 */ +// @Excel(name = "备用字段2") +// private Integer spare2; +// +// /** 备用字段3 */ +// @Excel(name = "备用字段3") +// private Integer spare3; private String plcDbReadAddress; + private String plcDbWriteAddress; private String ip; + private String port; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/StackerStatus.java b/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/StackerStatus.java new file mode 100644 index 0000000..f600cde --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/device/ddj/domain/StackerStatus.java @@ -0,0 +1,92 @@ +package com.ruoyi.device.ddj.domain; + + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.ruoyi.common.annotation.Excel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +/** + * wms请求的堆垛机状态映射 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class StackerStatus { + private static final long serialVersionUID = 1L; + + /** id */ + @JsonProperty("堆垛机编号") + private Integer id; + + /** 堆垛机名称 */ + @Excel(name = "堆垛机名称") + @JsonIgnore + private String name; + + /** 任务号 */ + @Excel(name = "任务号") + @JsonProperty("任务号") + private Long TaskNo; + + /** 阶段标志 */ + @Excel(name = "阶段标志") + @JsonProperty("执行阶段") + private Integer executionPhase; + + /** 状态 */ + @Excel(name = "状态") + @JsonProperty("设备状态") + private Integer deviceStatus; + + /** 操作方式 */ + @Excel(name = "操作方式") + @JsonProperty("操作模式") + private Integer mode; + + /** 允许下发 */ + @Excel(name = "允许下发") + @JsonProperty("是否允许下发任务") + private Integer permission; + + /** 当前排 */ + @Excel(name = "当前排") + @JsonProperty("当前排") + private Integer currentRow; + + /** 当前列 */ + @Excel(name = "当前列") + @JsonProperty("当前列") + private Integer currentColumn; + + /** 当前层 */ + @Excel(name = "当前层") + @JsonProperty("当前层") + private Integer currentFloor; + + /** 当前位置 */ + @Excel(name = "当前位置") + @JsonProperty("当前位置") + private String currentPosition; + + /** 心跳信号 */ + @Excel(name = "心跳信号") + private Integer xtxh; + + /** 当前巷道 */ + @Excel(name = "当前巷道") + @JsonProperty("当前巷道") + @JsonIgnore + private Integer currentRoad; + + /** 货叉状态 */ + @Excel(name = "货叉状态") + @JsonProperty("货叉状态") + private Integer forkStatus; + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj1Read.java b/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj1Read.java index b9fba24..04fed79 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj1Read.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj1Read.java @@ -71,6 +71,10 @@ public class PlcDdj1Read extends Thread { msgDdj.setMbch(ParseUtil.optInt(22, ddsx)); msgDdj.setYxxf(ParseUtil.optInt(24, ddsx)); msgDdj.setXtxh(ParseUtil.optInt(26, ddsx)); + + msgDdj.setCurrentRow(ParseUtil.optInt(26, ddsx)); + msgDdj.setCurrentColumn(ParseUtil.optInt(26, ddsx)); + msgDdj.setCurrentFloor(ParseUtil.optInt(26, ddsx)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj2Read.java b/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj2Read.java index 02dea53..3a061c4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj2Read.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/schedule/plcRead/ddj/PlcDdj2Read.java @@ -71,6 +71,10 @@ public class PlcDdj2Read extends Thread { msgDdj.setMbch(ParseUtil.optInt(22, ddsx)); msgDdj.setYxxf(ParseUtil.optInt(24, ddsx)); msgDdj.setXtxh(ParseUtil.optInt(26, ddsx)); + + msgDdj.setCurrentRow(ParseUtil.optInt(26, ddsx)); + msgDdj.setCurrentColumn(ParseUtil.optInt(26, ddsx)); + msgDdj.setCurrentFloor(ParseUtil.optInt(26, ddsx)); } } diff --git a/ruoyi-admin/src/main/resources/mapper/device/MsgDdjMapper.xml b/ruoyi-admin/src/main/resources/mapper/device/MsgDdjMapper.xml index 5c7baf6..30a07c6 100644 --- a/ruoyi-admin/src/main/resources/mapper/device/MsgDdjMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/device/MsgDdjMapper.xml @@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - + + + @@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, name, rwh, jdbz, sbzt, czfs, yxxf, yph, ylh, ych, mbph, mblh, mbch, xtxh, dqxd, hczt, spare1, spare2, spare3,ip,port,plc_db_read_address,plc_db_write_address from msg_ddj + select id, name, rwh, jdbz, sbzt, czfs, yxxf, yph, ylh, ych, mbph, mblh, mbch, xtxh, dqxd, hczt, current_row, current_column, current_floor,ip,port,plc_db_read_address,plc_db_write_address from msg_ddj @@ -82,9 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" xtxh, dqxd, hczt, - spare1, - spare2, - spare3, + current_row, + current_column, + current_floor, #{id}, @@ -103,9 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{xtxh}, #{dqxd}, #{hczt}, - #{spare1}, - #{spare2}, - #{spare3}, + #{currentRow}, + #{currentColumn}, + #{currentFloor}, @@ -127,9 +127,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" xtxh = #{xtxh}, dqxd = #{dqxd}, hczt = #{hczt}, - spare1 = #{spare1}, - spare2 = #{spare2}, - spare3 = #{spare3}, + current_row = #{currentRow}, + current_column = #{currentColumn}, + current_floor = #{currentFloor}, where id = #{id}