| | |
| | | import com.fzzy.api.data.ApiCommonDevice; |
| | | import com.fzzy.gateway.GatewayUtils; |
| | | import com.fzzy.gateway.entity.GatewayDevice; |
| | | import com.fzzy.gateway.service.GatewayDeviceService; |
| | | import com.fzzy.protocol.fzzy.builder.ObjectCommandBuilder; |
| | | import com.fzzy.protocol.fzzy.builder.SimpleCommandBuilder; |
| | | import com.fzzy.protocol.fzzy.cmd.BaseRemoteImpl; |
| | |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | public static final String BEAN_ID = "fzzy.analysisSystem"; |
| | | |
| | | |
| | | @Resource |
| | | private GatewayDeviceService gatewayDeviceService; |
| | | |
| | | |
| | | public void analysis1001(ReMessage reMessage) { |
| | | |
| | | //获取到登陆信息,执行设备信息整理 |
| | | ApiCommonDevice device = Constant.getCommonDeviceCache(reMessage.getSn()); |
| | | if (null == device) { |
| | | device = new ApiCommonDevice(); |
| | | GatewayDevice d = GatewayUtils.getCacheByDeviceSn(reMessage.getSn()); |
| | | if (null == d) { |
| | | d = new GatewayDevice(); |
| | | } |
| | | ApiCommonDevice device = new ApiCommonDevice(); |
| | | device.setIp(reMessage.getIp()); |
| | | device.setPort(reMessage.getPort()); |
| | | device.setSn(reMessage.getSn()); |
| | | device.setId(reMessage.getIedId()); |
| | | device.setId(d.getId()); |
| | | device.setOnlineTime(new Date()); |
| | | device.setCode("SUCCESS"); |
| | | Constant.updateCache(device); |
| | | |
| | | //更新设备在线 |
| | | gatewayDeviceService.onlineByCommonDevice(device); |
| | | |
| | | |
| | | //返回当前系统时间 |
| | | Response1001 response = new Response1001(); |