堆垛机状态反馈映射
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="xtxh" column="xtxh" />
|
||||
<result property="dqxd" column="dqxd" />
|
||||
<result property="hczt" column="hczt" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
<result property="currentRow" column="current_row" />
|
||||
<result property="currentColumn" column="current_column" />
|
||||
<result property="currentFloor" column="current_floor" />
|
||||
<result property="ip" column="ip" />
|
||||
<result property="port" column="port" />
|
||||
<result property="plcDbReadAddress" column="plc_db_read_address" />
|
||||
@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMsgDdjVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectMsgDdjList" parameterType="MsgDdj" resultMap="MsgDdjResult">
|
||||
@@ -52,9 +52,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="xtxh != null "> and xtxh = #{xtxh}</if>
|
||||
<if test="dqxd != null "> and dqxd = #{dqxd}</if>
|
||||
<if test="hczt != null "> and hczt = #{hczt}</if>
|
||||
<if test="spare1 != null "> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null "> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null "> and spare3 = #{spare3}</if>
|
||||
<if test="currentRow != null "> and current_row = #{currentRow}</if>
|
||||
<if test="currentColumn != null "> and current_column = #{currentColumn}</if>
|
||||
<if test="currentFloor != null "> and current_floor = #{currentFloor}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -82,9 +82,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="xtxh != null">xtxh,</if>
|
||||
<if test="dqxd != null">dqxd,</if>
|
||||
<if test="hczt != null">hczt,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
<if test="currentRow != null">current_row,</if>
|
||||
<if test="currentColumn != null">current_column,</if>
|
||||
<if test="currentFloor != null">current_floor,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
@@ -103,9 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="xtxh != null">#{xtxh},</if>
|
||||
<if test="dqxd != null">#{dqxd},</if>
|
||||
<if test="hczt != null">#{hczt},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
<if test="currentRow != null">#{currentRow},</if>
|
||||
<if test="currentColumn != null">#{currentColumn},</if>
|
||||
<if test="currentFloor != null">#{currentFloor},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -127,9 +127,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="xtxh != null">xtxh = #{xtxh},</if>
|
||||
<if test="dqxd != null">dqxd = #{dqxd},</if>
|
||||
<if test="hczt != null">hczt = #{hczt},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
<if test="currentRow != null">current_row = #{currentRow},</if>
|
||||
<if test="currentColumn != null">current_column = #{currentColumn},</if>
|
||||
<if test="currentFloor != null">current_floor = #{currentFloor},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user