jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterfaceTemp/mapper/DaTestDeviceInterfaceTempMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jcdm.main.da.testDeviceInterfaceTemp.domain.DaTestDeviceInterfaceTemp; import org.apache.ibatis.annotations.Param; /** * 测试设备接口数据备份Mapper接口 @@ -60,4 +61,6 @@ * @return 结果 */ public int deleteDaTestDeviceInterfaceTempByIds(Long[] ids); void deleteDaTestDeviceInterfaceTempByProductNum(@Param("cellCode") String cellCode); } jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterfaceTemp/service/IDaTestDeviceInterfaceTempService.java
@@ -60,4 +60,6 @@ * @return 结果 */ public int deleteDaTestDeviceInterfaceTempById(Long id); void deleteDaTestDeviceInterfaceTempByProductNum(String cellCode); } jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterfaceTemp/service/impl/DaTestDeviceInterfaceTempServiceImpl.java
@@ -95,4 +95,9 @@ { return daTestDeviceInterfaceTempMapper.deleteDaTestDeviceInterfaceTempById(id); } @Override public void deleteDaTestDeviceInterfaceTempByProductNum(String cellCode) { daTestDeviceInterfaceTempMapper.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); } } jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -770,14 +770,15 @@ .eq(DaTestDeviceInterfaceTemp::getStationCode, device) .eq(DaTestDeviceInterfaceTemp::getProductNum,cellCode)); if (CollUtil.isNotEmpty(list)){ DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(0); DaTestDeviceInterfaceTemp daTestDeviceInterfaceTemp = list.get(list.size()-1); if (Constants.ONE.equals(daTestDeviceInterfaceTemp.getTotalResult())){ miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(1).build()); }else { flag = false; miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_1").value(2).build()); } daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempById(daTestDeviceInterfaceTemp.getId()); daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode); } return flag; } jcdm-main/src/main/resources/mapper/da/testDeviceInterfaceTemp/DaTestDeviceInterfaceTempMapper.xml
@@ -141,4 +141,12 @@ #{id} </foreach> </delete> <delete id="deleteDaTestDeviceInterfaceTempByProductNum" parameterType="String"> DELETE FROM da_test_device_interface_temp WHERE product_num = #{cellCode} </delete> </mapper>