Commit 2a1ab005 authored by wanghao's avatar wanghao

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

parent a7ca757c
......@@ -3,14 +3,14 @@
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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zehong</groupId>
<artifactId>zehong</artifactId>
<version>3.5.0</version>
<name>zehong</name>
<description>项目管理系统</description>
<properties>
<zehong.version>3.5.0</zehong.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -33,7 +33,7 @@
<velocity.version>1.7</velocity.version>
<jwt.version>0.9.1</jwt.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
......@@ -203,7 +203,6 @@
<artifactId>zhmes-agecal-common</artifactId>
<version>${zehong.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
......@@ -262,4 +261,4 @@
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
</project>
......@@ -52,7 +52,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- JSON工具类 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
......@@ -134,6 +134,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.0-jre</version> <!-- 建议使用最新稳定版 -->
</dependency>
</dependencies>
</project>
\ No newline at end of file
</project>
......@@ -134,6 +134,8 @@ public class Constants
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_TOKEN = "iot.login.token";
......
......@@ -219,7 +219,7 @@ public class PalletDeviceBinding extends BaseEntity
/**
* iot状态
* 0-异常 1-正常
* 0-异常 1-正常 2-Nb码为空 3-网络状态异常
*/
private Integer iotStatus;
......
......@@ -86,6 +86,8 @@ public interface PalletDeviceBindingMapper
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 unbindAllDevice(Long trayId);
......
......@@ -41,6 +41,8 @@ public interface IPalletDeviceBindingService
public void batchUpdateNbCode(List<PalletDeviceBinding> palletDeviceBindingList);
public void batchUpdateIotStatus(List<PalletDeviceBinding> palletDeviceBindingList);
/**
* 新增托盘绑定的设备列
*
......
......@@ -142,6 +142,11 @@ public class PalletDeviceBindingServiceImpl implements IPalletDeviceBindingServi
palletDeviceBindingMapper.batchUpdateNbCode(palletDeviceBindingList);
}
@Override
public void batchUpdateIotStatus(List<PalletDeviceBinding> palletDeviceBindingList) {
palletDeviceBindingMapper.batchUpdateIotStatus(palletDeviceBindingList);
}
/**
* 新增托盘绑定的设备列
*
......
......@@ -190,6 +190,8 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
Modbus4jUtils.writeCoil(master, 1, registerOffsetInt, false);
log.info("已发送断电指令 - 设备:{} 层:{}", tEquipmentInfo.getfEquipmentCode(), layer);
master.destroy();
// 如果正常 则发送 IOT请求
} catch (ModbusTransportException | ModbusInitException e) {
log.info("下料发送断电指令失败 - 设备:{} 层:{}", tEquipmentInfo.getfEquipmentCode(), layer);
throw new RuntimeException(e);
......
package com.zehong.system.task.event;
import org.springframework.context.ApplicationEvent;
/**
* @author lenovo
* @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"
<select id="listByTrayCode" parameterType="string" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/>
where trayInfo.f_tray_code = #{trayCode}
and palDeviceBinding.f_motherboard_code is not null
and palDeviceBinding.f_motherboard_code != ''
</select>
<select id="listByStoreyCode" parameterType="string" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/>
where palDeviceBinding.f_storey_code = #{storeyCode}
and palDeviceBinding.f_motherboard_code is not null
and palDeviceBinding.f_motherboard_code != ''
</select>
<select id="selectPalletDeviceBindingById" parameterType="Long" resultMap="PalletDeviceBindingResult">
......@@ -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
</foreach>
</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">
<foreach collection="palletDeviceBindingList" item="item" index="index" separator=";">
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