change - addAGV位移状态接口
parent
4325f2bbb3
commit
12b8c4a439
@ -0,0 +1,41 @@
|
||||
package com.hw.dms.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hw.dms.domain.vo.ModelBoardVo;
|
||||
import com.hw.dms.service.IModelInterfacesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.hw.dms.domain.WcsAgvStatus;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
|
||||
|
||||
/**
|
||||
* AGV位移状态Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/model")
|
||||
public class modelInterfacesController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IModelInterfacesService modelInterfacesService;
|
||||
|
||||
/**
|
||||
* 查询AGV设备状态列表
|
||||
* @param modelBoardVo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAgvDeviceStatus")
|
||||
public AjaxResult getAgvDeviceStatus(ModelBoardVo modelBoardVo) {
|
||||
HashMap<String, Object> result = modelInterfacesService.getAgvDeviceStatus(modelBoardVo);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,264 @@
|
||||
package com.hw.dms.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* AGV位移状态对象 wcs_agv_status
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public class WcsAgvStatus extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 电量 */
|
||||
@Excel(name = "电量")
|
||||
private String battery;
|
||||
|
||||
/** 是否已被排除,被排除后不接受新任务( 1-排除, 0-正常) */
|
||||
@Excel(name = "是否已被排除,被排除后不接受新任务", readConverterExp = "1=-排除,,0=-正常")
|
||||
private String exclType;
|
||||
|
||||
/** 地图编号 */
|
||||
@Excel(name = "地图编号")
|
||||
private String mapCode;
|
||||
|
||||
/** 是否在线 */
|
||||
@Excel(name = "是否在线")
|
||||
private String online;
|
||||
|
||||
/** 路线 */
|
||||
@Excel(name = "路线")
|
||||
private String path;
|
||||
|
||||
/** 背货架的编号 */
|
||||
@Excel(name = "背货架的编号")
|
||||
private String podCode;
|
||||
|
||||
/** 背货架的方向 */
|
||||
@Excel(name = "背货架的方向")
|
||||
private String podDir;
|
||||
|
||||
/** X */
|
||||
@Excel(name = "X")
|
||||
private String posX;
|
||||
|
||||
/** Y */
|
||||
@Excel(name = "Y")
|
||||
private String posY;
|
||||
|
||||
/** 机器人编号 */
|
||||
private String robotCode;
|
||||
|
||||
/** 机器人方向 (范围 -180~360度) */
|
||||
@Excel(name = "机器人方向 (范围 -180~360度)")
|
||||
private String robotDir;
|
||||
|
||||
/** 机器人Ip */
|
||||
@Excel(name = "机器人Ip")
|
||||
private String robotIp;
|
||||
|
||||
/** 机器人速度 */
|
||||
@Excel(name = "机器人速度")
|
||||
private String speed;
|
||||
|
||||
/** 机器人状态 */
|
||||
@Excel(name = "机器人状态")
|
||||
private String status;
|
||||
|
||||
/** 是否暂停 0-否 1-是 */
|
||||
@Excel(name = "是否暂停 0-否 1-是")
|
||||
private String stop;
|
||||
|
||||
/** 时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date timestamp;
|
||||
|
||||
/** 小车名称 */
|
||||
@Excel(name = "小车名称")
|
||||
private String agvName;
|
||||
|
||||
public void setBattery(String battery)
|
||||
{
|
||||
this.battery = battery;
|
||||
}
|
||||
|
||||
public String getBattery()
|
||||
{
|
||||
return battery;
|
||||
}
|
||||
public void setExclType(String exclType)
|
||||
{
|
||||
this.exclType = exclType;
|
||||
}
|
||||
|
||||
public String getExclType()
|
||||
{
|
||||
return exclType;
|
||||
}
|
||||
public void setMapCode(String mapCode)
|
||||
{
|
||||
this.mapCode = mapCode;
|
||||
}
|
||||
|
||||
public String getMapCode()
|
||||
{
|
||||
return mapCode;
|
||||
}
|
||||
public void setOnline(String online)
|
||||
{
|
||||
this.online = online;
|
||||
}
|
||||
|
||||
public String getOnline()
|
||||
{
|
||||
return online;
|
||||
}
|
||||
public void setPath(String path)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getPath()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
public void setPodCode(String podCode)
|
||||
{
|
||||
this.podCode = podCode;
|
||||
}
|
||||
|
||||
public String getPodCode()
|
||||
{
|
||||
return podCode;
|
||||
}
|
||||
public void setPodDir(String podDir)
|
||||
{
|
||||
this.podDir = podDir;
|
||||
}
|
||||
|
||||
public String getPodDir()
|
||||
{
|
||||
return podDir;
|
||||
}
|
||||
public void setPosX(String posX)
|
||||
{
|
||||
this.posX = posX;
|
||||
}
|
||||
|
||||
public String getPosX()
|
||||
{
|
||||
return posX;
|
||||
}
|
||||
public void setPosY(String posY)
|
||||
{
|
||||
this.posY = posY;
|
||||
}
|
||||
|
||||
public String getPosY()
|
||||
{
|
||||
return posY;
|
||||
}
|
||||
public void setRobotCode(String robotCode)
|
||||
{
|
||||
this.robotCode = robotCode;
|
||||
}
|
||||
|
||||
public String getRobotCode()
|
||||
{
|
||||
return robotCode;
|
||||
}
|
||||
public void setRobotDir(String robotDir)
|
||||
{
|
||||
this.robotDir = robotDir;
|
||||
}
|
||||
|
||||
public String getRobotDir()
|
||||
{
|
||||
return robotDir;
|
||||
}
|
||||
public void setRobotIp(String robotIp)
|
||||
{
|
||||
this.robotIp = robotIp;
|
||||
}
|
||||
|
||||
public String getRobotIp()
|
||||
{
|
||||
return robotIp;
|
||||
}
|
||||
public void setSpeed(String speed)
|
||||
{
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public String getSpeed()
|
||||
{
|
||||
return speed;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setStop(String stop)
|
||||
{
|
||||
this.stop = stop;
|
||||
}
|
||||
|
||||
public String getStop()
|
||||
{
|
||||
return stop;
|
||||
}
|
||||
public void setTimestamp(Date timestamp)
|
||||
{
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public Date getTimestamp()
|
||||
{
|
||||
return timestamp;
|
||||
}
|
||||
public void setAgvName(String agvName)
|
||||
{
|
||||
this.agvName = agvName;
|
||||
}
|
||||
|
||||
public String getAgvName()
|
||||
{
|
||||
return agvName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("battery", getBattery())
|
||||
.append("exclType", getExclType())
|
||||
.append("mapCode", getMapCode())
|
||||
.append("online", getOnline())
|
||||
.append("path", getPath())
|
||||
.append("podCode", getPodCode())
|
||||
.append("podDir", getPodDir())
|
||||
.append("posX", getPosX())
|
||||
.append("posY", getPosY())
|
||||
.append("robotCode", getRobotCode())
|
||||
.append("robotDir", getRobotDir())
|
||||
.append("robotIp", getRobotIp())
|
||||
.append("speed", getSpeed())
|
||||
.append("status", getStatus())
|
||||
.append("stop", getStop())
|
||||
.append("timestamp", getTimestamp())
|
||||
.append("agvName", getAgvName())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.hw.dms.domain.vo;
|
||||
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 模型看板Vo对象 ModelBoardVo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public class ModelBoardVo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.dms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.dms.domain.WcsAgvStatus;
|
||||
|
||||
/**
|
||||
* AGV位移状态Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface WcsAgvStatusMapper
|
||||
{
|
||||
/**
|
||||
* 查询AGV位移状态
|
||||
*
|
||||
* @param robotCode AGV位移状态主键
|
||||
* @return AGV位移状态
|
||||
*/
|
||||
public WcsAgvStatus selectWcsAgvStatusByRobotCode(String robotCode);
|
||||
|
||||
/**
|
||||
* 查询AGV位移状态列表
|
||||
*
|
||||
* @param wcsAgvStatus AGV位移状态
|
||||
* @return AGV位移状态集合
|
||||
*/
|
||||
public List<WcsAgvStatus> selectWcsAgvStatusList(WcsAgvStatus wcsAgvStatus);
|
||||
|
||||
/**
|
||||
* 新增AGV位移状态
|
||||
*
|
||||
* @param wcsAgvStatus AGV位移状态
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWcsAgvStatus(WcsAgvStatus wcsAgvStatus);
|
||||
|
||||
/**
|
||||
* 修改AGV位移状态
|
||||
*
|
||||
* @param wcsAgvStatus AGV位移状态
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWcsAgvStatus(WcsAgvStatus wcsAgvStatus);
|
||||
|
||||
/**
|
||||
* 删除AGV位移状态
|
||||
*
|
||||
* @param robotCode AGV位移状态主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsAgvStatusByRobotCode(String robotCode);
|
||||
|
||||
/**
|
||||
* 批量删除AGV位移状态
|
||||
*
|
||||
* @param robotCodes 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsAgvStatusByRobotCodes(String[] robotCodes);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.hw.dms.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hw.dms.domain.vo.ModelBoardVo;
|
||||
|
||||
/**
|
||||
* AGV位移状态Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IModelInterfacesService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询AGV设备状态列表
|
||||
* @param modelBoardVo
|
||||
* @return
|
||||
*/
|
||||
HashMap<String, Object> getAgvDeviceStatus(ModelBoardVo modelBoardVo);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.hw.dms.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.dms.domain.vo.ModelBoardVo;
|
||||
import com.hw.dms.service.IModelInterfacesService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hw.dms.mapper.WcsAgvStatusMapper;
|
||||
import com.hw.dms.domain.WcsAgvStatus;
|
||||
|
||||
/**
|
||||
* AGV位移状态Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class ModelInterfacesServiceImpl implements IModelInterfacesService
|
||||
{
|
||||
@Autowired
|
||||
private WcsAgvStatusMapper wcsAgvStatusMapper;
|
||||
|
||||
/**
|
||||
* 查询AGV设备状态列表
|
||||
* @param modelBoardVo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HashMap<String, Object> getAgvDeviceStatus(ModelBoardVo modelBoardVo) {
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
WcsAgvStatus wcsAgvStatus = new WcsAgvStatus();
|
||||
List<WcsAgvStatus> agvStatusList = wcsAgvStatusMapper.selectWcsAgvStatusList(wcsAgvStatus);
|
||||
result.put("agvStatusList", agvStatusList);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hw.dms.mapper.WcsAgvStatusMapper">
|
||||
|
||||
<resultMap type="WcsAgvStatus" id="WcsAgvStatusResult">
|
||||
<result property="battery" column="battery"/>
|
||||
<result property="exclType" column="exclType"/>
|
||||
<result property="mapCode" column="mapCode"/>
|
||||
<result property="online" column="online"/>
|
||||
<result property="path" column="path"/>
|
||||
<result property="podCode" column="podCode"/>
|
||||
<result property="podDir" column="podDir"/>
|
||||
<result property="posX" column="posX"/>
|
||||
<result property="posY" column="posY"/>
|
||||
<result property="robotCode" column="robotCode"/>
|
||||
<result property="robotDir" column="robotDir"/>
|
||||
<result property="robotIp" column="robotIp"/>
|
||||
<result property="speed" column="speed"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="stop" column="stop"/>
|
||||
<result property="timestamp" column="timestamp"/>
|
||||
<result property="agvName" column="agvName"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWcsAgvStatusVo">
|
||||
select battery,
|
||||
exclType,
|
||||
mapCode,
|
||||
online,
|
||||
path,
|
||||
podCode,
|
||||
podDir,
|
||||
posX,
|
||||
posY,
|
||||
robotCode,
|
||||
robotDir,
|
||||
robotIp,
|
||||
speed,
|
||||
status,
|
||||
stop, timestamp, agvName
|
||||
from wcs_agv_status
|
||||
</sql>
|
||||
|
||||
<select id="selectWcsAgvStatusList" parameterType="WcsAgvStatus" resultMap="WcsAgvStatusResult">
|
||||
<include refid="selectWcsAgvStatusVo"/>
|
||||
<where>
|
||||
<if test="battery != null and battery != ''">and battery = #{battery}</if>
|
||||
<if test="exclType != null and exclType != ''">and exclType = #{exclType}</if>
|
||||
<if test="mapCode != null and mapCode != ''">and mapCode = #{mapCode}</if>
|
||||
<if test="online != null and online != ''">and online = #{online}</if>
|
||||
<if test="path != null and path != ''">and path = #{path}</if>
|
||||
<if test="podCode != null and podCode != ''">and podCode = #{podCode}</if>
|
||||
<if test="podDir != null and podDir != ''">and podDir = #{podDir}</if>
|
||||
<if test="posX != null and posX != ''">and posX = #{posX}</if>
|
||||
<if test="posY != null and posY != ''">and posY = #{posY}</if>
|
||||
<if test="robotDir != null and robotDir != ''">and robotDir = #{robotDir}</if>
|
||||
<if test="robotIp != null and robotIp != ''">and robotIp = #{robotIp}</if>
|
||||
<if test="speed != null and speed != ''">and speed = #{speed}</if>
|
||||
<if test="status != null and status != ''">and status = #{status}</if>
|
||||
<if test="stop != null and stop != ''">and stop = #{stop}</if>
|
||||
<if test="params.beginTimestamp != null and params.beginTimestamp != '' and params.endTimestamp != null and params.endTimestamp != ''">
|
||||
and timestamp between #{params.beginTimestamp} and #{params.endTimestamp}
|
||||
</if>
|
||||
<if test="agvName != null and agvName != ''">and agvName like concat('%', #{agvName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWcsAgvStatusByRobotCode" parameterType="String" resultMap="WcsAgvStatusResult">
|
||||
<include refid="selectWcsAgvStatusVo"/>
|
||||
where robotCode = #{robotCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertWcsAgvStatus" parameterType="WcsAgvStatus">
|
||||
insert into wcs_agv_status
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="battery != null">battery,</if>
|
||||
<if test="exclType != null">exclType,</if>
|
||||
<if test="mapCode != null">mapCode,</if>
|
||||
<if test="online != null">online,</if>
|
||||
<if test="path != null">path,</if>
|
||||
<if test="podCode != null">podCode,</if>
|
||||
<if test="podDir != null">podDir,</if>
|
||||
<if test="posX != null">posX,</if>
|
||||
<if test="posY != null">posY,</if>
|
||||
<if test="robotCode != null">robotCode,</if>
|
||||
<if test="robotDir != null">robotDir,</if>
|
||||
<if test="robotIp != null">robotIp,</if>
|
||||
<if test="speed != null">speed,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="stop != null">stop,</if>
|
||||
<if test="timestamp != null">timestamp,</if>
|
||||
<if test="agvName != null">agvName,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="battery != null">#{battery},</if>
|
||||
<if test="exclType != null">#{exclType},</if>
|
||||
<if test="mapCode != null">#{mapCode},</if>
|
||||
<if test="online != null">#{online},</if>
|
||||
<if test="path != null">#{path},</if>
|
||||
<if test="podCode != null">#{podCode},</if>
|
||||
<if test="podDir != null">#{podDir},</if>
|
||||
<if test="posX != null">#{posX},</if>
|
||||
<if test="posY != null">#{posY},</if>
|
||||
<if test="robotCode != null">#{robotCode},</if>
|
||||
<if test="robotDir != null">#{robotDir},</if>
|
||||
<if test="robotIp != null">#{robotIp},</if>
|
||||
<if test="speed != null">#{speed},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="stop != null">#{stop},</if>
|
||||
<if test="timestamp != null">#{timestamp},</if>
|
||||
<if test="agvName != null">#{agvName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWcsAgvStatus" parameterType="WcsAgvStatus">
|
||||
update wcs_agv_status
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="battery != null">battery = #{battery},</if>
|
||||
<if test="exclType != null">exclType = #{exclType},</if>
|
||||
<if test="mapCode != null">mapCode = #{mapCode},</if>
|
||||
<if test="online != null">online = #{online},</if>
|
||||
<if test="path != null">path = #{path},</if>
|
||||
<if test="podCode != null">podCode = #{podCode},</if>
|
||||
<if test="podDir != null">podDir = #{podDir},</if>
|
||||
<if test="posX != null">posX = #{posX},</if>
|
||||
<if test="posY != null">posY = #{posY},</if>
|
||||
<if test="robotDir != null">robotDir = #{robotDir},</if>
|
||||
<if test="robotIp != null">robotIp = #{robotIp},</if>
|
||||
<if test="speed != null">speed = #{speed},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="stop != null">stop = #{stop},</if>
|
||||
<if test="timestamp != null">timestamp = #{timestamp},</if>
|
||||
<if test="agvName != null">agvName = #{agvName},</if>
|
||||
</trim>
|
||||
where robotCode = #{robotCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWcsAgvStatusByRobotCode" parameterType="String">
|
||||
delete
|
||||
from wcs_agv_status
|
||||
where robotCode = #{robotCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWcsAgvStatusByRobotCodes" parameterType="String">
|
||||
delete from wcs_agv_status where robotCode in
|
||||
<foreach item="robotCode" collection="array" open="(" separator="," close=")">
|
||||
#{robotCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue