Commit 2a1ab005 authored by wanghao's avatar wanghao

1 老化过程中 获取卡号,获取IOT状态调整中

parent a7ca757c
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.zehong</groupId> <groupId>com.zehong</groupId>
<artifactId>zehong</artifactId> <artifactId>zehong</artifactId>
<version>3.5.0</version> <version>3.5.0</version>
<name>zehong</name> <name>zehong</name>
<description>项目管理系统</description> <description>项目管理系统</description>
<properties> <properties>
<zehong.version>3.5.0</zehong.version> <zehong.version>3.5.0</zehong.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<velocity.version>1.7</velocity.version> <velocity.version>1.7</velocity.version>
<jwt.version>0.9.1</jwt.version> <jwt.version>0.9.1</jwt.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
...@@ -203,7 +203,6 @@ ...@@ -203,7 +203,6 @@
<artifactId>zhmes-agecal-common</artifactId> <artifactId>zhmes-agecal-common</artifactId>
<version>${zehong.version}</version> <version>${zehong.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
...@@ -262,4 +261,4 @@ ...@@ -262,4 +261,4 @@
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
</project> </project>
\ No newline at end of file
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<!-- JSON工具类 --> <!-- JSON工具类 -->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
...@@ -134,6 +134,11 @@ ...@@ -134,6 +134,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.0-jre</version> <!-- 建议使用最新稳定版 -->
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -134,6 +134,8 @@ public class Constants ...@@ -134,6 +134,8 @@ public class Constants
public static final String IOT_LOGIN_USERNAME = "iot.login.username"; public static final String IOT_LOGIN_USERNAME = "iot.login.username";
public static final String IOT_LOGIN_ADDRESS = "iot.login.url";
public static final String IOT_LOGIN_PASSWORD = "iot.login.password"; public static final String IOT_LOGIN_PASSWORD = "iot.login.password";
public static final String IOT_LOGIN_TOKEN = "iot.login.token"; public static final String IOT_LOGIN_TOKEN = "iot.login.token";
......
...@@ -219,7 +219,7 @@ public class PalletDeviceBinding extends BaseEntity ...@@ -219,7 +219,7 @@ public class PalletDeviceBinding extends BaseEntity
/** /**
* iot状态 * iot状态
* 0-异常 1-正常 * 0-异常 1-正常 2-Nb码为空 3-网络状态异常
*/ */
private Integer iotStatus; private Integer iotStatus;
......
...@@ -86,6 +86,8 @@ public interface PalletDeviceBindingMapper ...@@ -86,6 +86,8 @@ public interface PalletDeviceBindingMapper
public int batchUpdateNbCode(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList); public int batchUpdateNbCode(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList);
public int batchUpdateIotStatus(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList);
public int batchUpdateDeviceCodeAndUnbindingTime(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList); public int batchUpdateDeviceCodeAndUnbindingTime(@Param("palletDeviceBindingList") List<PalletDeviceBinding> palletDeviceBindingList);
public int unbindAllDevice(Long trayId); public int unbindAllDevice(Long trayId);
......
...@@ -41,6 +41,8 @@ public interface IPalletDeviceBindingService ...@@ -41,6 +41,8 @@ public interface IPalletDeviceBindingService
public void batchUpdateNbCode(List<PalletDeviceBinding> palletDeviceBindingList); public void batchUpdateNbCode(List<PalletDeviceBinding> palletDeviceBindingList);
public void batchUpdateIotStatus(List<PalletDeviceBinding> palletDeviceBindingList);
/** /**
* 新增托盘绑定的设备列 * 新增托盘绑定的设备列
* *
......
...@@ -142,6 +142,11 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi ...@@ -142,6 +142,11 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
palletDeviceBindingMapper.batchUpdateNbCode(palletDeviceBindingList); palletDeviceBindingMapper.batchUpdateNbCode(palletDeviceBindingList);
} }
@Override
public void batchUpdateIotStatus(List<PalletDeviceBinding> palletDeviceBindingList) {
palletDeviceBindingMapper.batchUpdateIotStatus(palletDeviceBindingList);
}
/** /**
* 新增托盘绑定的设备列 * 新增托盘绑定的设备列
* *
......
...@@ -190,6 +190,8 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService ...@@ -190,6 +190,8 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
Modbus4jUtils.writeCoil(master, 1, registerOffsetInt, false); Modbus4jUtils.writeCoil(master, 1, registerOffsetInt, false);
log.info("已发送断电指令 - 设备:{} 层:{}", tEquipmentInfo.getfEquipmentCode(), layer); log.info("已发送断电指令 - 设备:{} 层:{}", tEquipmentInfo.getfEquipmentCode(), layer);
master.destroy(); master.destroy();
// 如果正常 则发送 IOT请求
} catch (ModbusTransportException | ModbusInitException e) { } catch (ModbusTransportException | ModbusInitException e) {
log.info("下料发送断电指令失败 - 设备:{} 层:{}", tEquipmentInfo.getfEquipmentCode(), layer); log.info("下料发送断电指令失败 - 设备:{} 层:{}", tEquipmentInfo.getfEquipmentCode(), layer);
throw new RuntimeException(e); throw new RuntimeException(e);
......
package com.zehong.system.task.event; package com.zehong.system.task.event;
import org.springframework.context.ApplicationEvent;
/** /**
* @author lenovo * @author lenovo
* @date 2026/7/18 * @date 2026/7/18
* @description IOTstatus event * @description IOT status event
*/ */
public class IotStatusEvent{ public class IotStatusEvent extends ApplicationEvent {
private String storeyCode;
public IotStatusEvent(Object source, String storeyCode) {
super(source);
this.storeyCode = storeyCode;
}
public String getStoreyCode() {
return storeyCode;
}
public void setStoreyCode(String storeyCode) {
this.storeyCode = storeyCode;
}
} }
...@@ -154,10 +154,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -154,10 +154,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="listByTrayCode" parameterType="string" resultMap="PalletDeviceBindingResult"> <select id="listByTrayCode" parameterType="string" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/> <include refid="selectPalletDeviceBindingVo"/>
where trayInfo.f_tray_code = #{trayCode} where trayInfo.f_tray_code = #{trayCode}
and palDeviceBinding.f_motherboard_code is not null
and palDeviceBinding.f_motherboard_code != ''
</select> </select>
<select id="listByStoreyCode" parameterType="string" resultMap="PalletDeviceBindingResult"> <select id="listByStoreyCode" parameterType="string" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/> <include refid="selectPalletDeviceBindingVo"/>
where palDeviceBinding.f_storey_code = #{storeyCode} where palDeviceBinding.f_storey_code = #{storeyCode}
and palDeviceBinding.f_motherboard_code is not null
and palDeviceBinding.f_motherboard_code != ''
</select> </select>
<select id="selectPalletDeviceBindingById" parameterType="Long" resultMap="PalletDeviceBindingResult"> <select id="selectPalletDeviceBindingById" parameterType="Long" resultMap="PalletDeviceBindingResult">
...@@ -437,6 +441,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -437,6 +441,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where f_pallet_device_binding_id = #{item.palletDeviceBindingId} and f_motherboard_code is not null where f_pallet_device_binding_id = #{item.palletDeviceBindingId} and f_motherboard_code is not null
</foreach> </foreach>
</update> </update>
<update id="batchUpdateIotStatus" parameterType="list">
<foreach collection="palletDeviceBindingList" item="item" index="index" separator=";">
UPDATE t_pallet_device_binding
SET f_iot_status = #{item.iotStatus}
where f_pallet_device_binding_id = #{item.palletDeviceBindingId}
</foreach>
</update>
<update id="batchUpdateDeviceCodeAndUnbindingTime" parameterType="list"> <update id="batchUpdateDeviceCodeAndUnbindingTime" parameterType="list">
<foreach collection="palletDeviceBindingList" item="item" index="index" separator=";"> <foreach collection="palletDeviceBindingList" item="item" index="index" separator=";">
UPDATE t_pallet_device_binding UPDATE t_pallet_device_binding
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment