Commit ff1c02a2 authored by wanghao's avatar wanghao

1 上料后 机械臂 回零 后 出现了一次 没有上电的操作,涉及到的 机械臂回零判断流程 优化。

2 实时数据 根据 托盘编号排序
3 如果设备号为空,则不设置各种状态信息,防止出现 没有板子的位置也报错,不能解绑的问题。
parent 9dc83746
......@@ -93,6 +93,8 @@ public class CalibrationResultEventHandler {
for (PalletDeviceBinding palletDeviceBinding : palletDeviceBindings) {
MesDeviceDomain mesDeviceDomain = new MesDeviceDomain();
// 如果设备编号为空 则不处理改设备
if(StringUtils.isBlank(palletDeviceBinding.getDeviceCode())) continue;
// 主板码
mesDeviceDomain.setMotherboardCode(palletDeviceBinding.getDeviceCode());
// 浓度
......@@ -499,4 +501,4 @@ public class CalibrationResultEventHandler {
this.calibrationValue = calibrationValue;
}
}
}
\ No newline at end of file
}
......@@ -36,12 +36,12 @@ import javax.annotation.Resource;
/**
* 机械臂指令Service业务层处理
*
*
* @author zehong
* @date 2025-08-04
*/
@Service
public class RobotArmCommandServiceImpl implements IRobotArmCommandService
public class RobotArmCommandServiceImpl implements IRobotArmCommandService
{
private static final Logger log = LoggerFactory.getLogger(RobotArmCommandServiceImpl.class);
......@@ -89,6 +89,10 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
}
}
/**
* 机械臂空闲状态下 需要执行的待执行的指令
*/
@Override
@Transactional
public void processPendingCommands() {
......@@ -336,6 +340,10 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
return 0;
}
/**
* 完成指令
* @param commandId c
*/
@Override
@Transactional
public void completeCommand(Long commandId) {
......@@ -346,7 +354,6 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
log.info("command != null && \"2\".equals(command.getStatus()");
// 发送上电指令
try {
String storeyCode = command.getStoreyCode();
String equitmentCode;
int registerOffset;
......@@ -361,6 +368,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
log.info("tEquipmentInfo != null");
String powerOutageIp = tEquipmentInfo.getfPowerOutageIp();
Integer powerOutagePort = tEquipmentInfo.getfPowerOutagePort();
log.info("powerOutageIp: {}, powerOutagePort: {},command.getType:{}", powerOutageIp, powerOutagePort, command.getType());
if(StringUtils.isNotBlank(powerOutageIp) && powerOutagePort != null) {
if("0".equals(command.getType())) {
eventPublisher.publishEvent(new CheckPowerOnCommandEvent(
......@@ -415,7 +423,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
/**
* 查询机械臂指令
*
*
* @param robotArmCommandId 机械臂指令ID
* @return 机械臂指令
*/
......@@ -427,7 +435,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
/**
* 查询机械臂指令列表
*
*
* @param robotArmCommand 机械臂指令
* @return 机械臂指令
*/
......@@ -475,7 +483,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
/**
* 新增机械臂指令
*
*
* @param robotArmCommand 机械臂指令
* @return 结果
*/
......@@ -578,7 +586,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
/**
* 修改机械臂指令
*
*
* @param robotArmCommand 机械臂指令
* @return 结果
*/
......@@ -606,7 +614,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
/**
* 批量删除机械臂指令
*
*
* @param robotArmCommandIds 需要删除的机械臂指令ID
* @return 结果
*/
......@@ -620,7 +628,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
/**
* 删除机械臂指令信息
*
*
* @param robotArmCommandId 机械臂指令ID
* @return 结果
*/
......
......@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.PalletDeviceBindingMapper">
<resultMap type="PalletDeviceBinding" id="PalletDeviceBindingResult">
<result property="palletDeviceBindingId" column="f_pallet_device_binding_id" />
<result property="trayId" column="f_tray_id" />
......@@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectPalletDeviceBindingList" parameterType="PalletDeviceBinding" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/>
<where>
<where>
<if test="trayId != null "> and palDeviceBinding.f_tray_id = #{trayId}</if>
<if test="deviceCode != null and deviceCode != ''"> and palDeviceBinding.f_device_code like concat('%',#{deviceCode},'%') </if>
<if test="fTrayCode != null and fTrayCode != ''"> and trayInfo.f_tray_code like concat('%',#{fTrayCode},'%')</if>
......@@ -114,18 +114,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null "> and palDeviceBinding.f_create_time = #{createTime}</if>
<if test="status != null and status != '' "> and palDeviceBinding.f_status = #{status}</if>
</where>
order by trayInfo.f_tray_code ,palDeviceBinding.f_index asc
order by trayInfo.f_tray_code ,palDeviceBinding.f_number asc
</select>
<select id="getAllExcludeUnbindingTimeByTrayId" parameterType="long" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/>
where palDeviceBinding.f_tray_id = #{trayId}
order by palDeviceBinding.f_index asc
order by palDeviceBinding.f_number asc
</select>
<select id="listByTrayCode" parameterType="string" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/>
where trayInfo.f_tray_code = #{trayCode}
</select>
<select id="selectPalletDeviceBindingById" parameterType="Long" resultMap="PalletDeviceBindingResult">
<include refid="selectPalletDeviceBindingVo"/>
where palDeviceBinding.f_pallet_device_binding_id = #{palletDeviceBindingId}
......@@ -327,7 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="simCardStatus != null">f_sim_card_status = #{simCardStatus},</if>
<if test="networkStatus != null">f_network_status = #{networkStatus},</if>
</trim>
where f_pallet_device_binding_id = #{palletDeviceBindingId}
where f_pallet_device_binding_id = #{palletDeviceBindingId} and f_device_code is not null
</update>
<update id="batchUpdateDeviceCode" parameterType="list">
<foreach collection="palletDeviceBindingList" item="item" index="index" separator=";">
......@@ -350,7 +350,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="item.calibrationConcentration != null">f_calibration_concentration = #{item.calibrationConcentration},</if>
<if test="item.calibrationConcentrationStatus != null">f_calibration_concentration_status = #{item.calibrationConcentrationStatus},</if>
</trim>
where f_pallet_device_binding_id = #{item.palletDeviceBindingId}
where f_pallet_device_binding_id = #{item.palletDeviceBindingId} and f_device_code is not null
</foreach>
</update>
<update id="batchUpdateDeviceCodeAndUnbindingTime" parameterType="list">
......@@ -430,9 +430,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deletePalletDeviceBindingByIds" parameterType="String">
delete from t_pallet_device_binding where f_pallet_device_binding_id in
delete from t_pallet_device_binding where f_pallet_device_binding_id in
<foreach item="palletDeviceBindingId" collection="array" open="(" separator="," close=")">
#{palletDeviceBindingId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</mapper>
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