Commit a8134cba LN

增加equipmentType :HANWHA

1 个父辈 57b39e6a
......@@ -45,5 +45,10 @@ public enum EquipmentType {
/**
* 6 AGV
*/
AGV()
AGV(),
/**
* 韩华
*/
HANWHA()
}
......@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.dashboard.bean.dto.box.MesInfoDto;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.equipment.enums.EquipmentType;
import com.neotel.smfcore.core.equipment.rest.dto.NsViewDto;
import com.neotel.smfcore.core.equipment.util.EquipmentCache;
import com.neotel.smfcore.core.equipment.bean.EquipMsg;
......@@ -15,6 +16,7 @@ import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.custom.hanwha.handler.TMSCommunicator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -42,6 +44,9 @@ public class EquipViewController {
@Autowired
private DataCache dataCache;
@Autowired
private TMSCommunicator tmsCommunicator;
@ApiOperation("获取看板数据")
@GetMapping
@PreAuthorize("@el.check('equipmentView:info')")
......@@ -64,6 +69,12 @@ public class EquipViewController {
}
}
if(equip.getType().equalsIgnoreCase(EquipmentType.HANWHA.name())){
if(tmsCommunicator.isConnected()){
dto.setOnLine(true);
}
}
resultList.add(dto);
}
......
......@@ -43,7 +43,7 @@ public class HanwhaApiHandler extends BaseSmfApiListener {
//
// hanwha:
// host: 3.39.76.183
// host: 192.168.3.166
// webPort: 1337
// apiPort: 8082
@Autowired
......
......@@ -170,7 +170,12 @@ public class TMSCommunicator implements WsMsgReceivedListener {
websocket.close();
}
}
public boolean isConnected() {
if (websocket != null &&(websocket.isConnecting()||websocket.isOpen()) ) {
return true;
}
return false;
}
public void SendData(Map<String, Object> messageMap) {
if (websocket == null) {
......@@ -282,8 +287,8 @@ public class TMSCommunicator implements WsMsgReceivedListener {
allStorage.values()) {
List<TMSPartReelPos> list = new ArrayList<>();
List<StoragePos> allPos = storagePosManager.findByStorage(storage.getId());
if (storage.isNLShelf() || storage.isMimoG2() ) {
// if (storage.isNLShelf() || storage.isMimoG2() ||storage.isBatchStorage()) {
if (allPos != null) {
for (StoragePos pos :
allPos) {
......@@ -307,7 +312,7 @@ public class TMSCommunicator implements WsMsgReceivedListener {
}
List<TMSPart> result = tmsApis.RequestSyncPartReelPosInfo(0, list);
log.info("RequestSyncPartReelPosInfo storageCID="+storage.getCid()+", count="+list.size());
log.info("RequestSyncPartReelPosInfo storageCID=" + storage.getCid() + ", count=" + list.size());
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!