| | |
| | | |
| | | import java.util.List; |
| | | import com.se.common.core.utils.DateUtils; |
| | | import com.se.system.domain.SysSoft; |
| | | import com.se.system.service.WebSocketService; |
| | | import com.se.system.utils.CaffeineUtils; |
| | | import com.se.system.utils.ConnectUtils; |
| | | import com.se.system.utils.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import com.se.system.mapper.SysStatusCtrlMapper; |
| | | import com.se.system.domain.SysStatusCtrl; |
| | |
| | | return list; |
| | | } |
| | | |
| | | public void runSubSysTest() throws Exception { |
| | | public void runSubSysTest() { |
| | | List<SysStatusCtrl> list = getList(); |
| | | if (CollectionUtils.isEmpty(list)) return; |
| | | |
| | | // |
| | | for (SysStatusCtrl ctrl : list) { |
| | | ctrl.setStatus("0"); |
| | | ctrl.setRemark(""); |
| | | if (!StringUtils.isEmpty(ctrl.getIp()) && !ConnectUtils.isReachable(ctrl.getIp())) { |
| | | ctrl.setStatus("1"); |
| | | ctrl.setRemark("IP不连通"); |
| | | } |
| | | if (!StringUtils.isEmpty(ctrl.getUrl()) && !ConnectUtils.testUrl(ctrl.getUrl(), ctrl.getMethod())) { |
| | | ctrl.setStatus("1"); |
| | | ctrl.setRemark((ctrl.getRemark().length() > 0 ? ctrl.getRemark() + "," : "") + "URL连接不上"); |
| | | } |
| | | } |
| | | |
| | | sysStatusCtrlMapper.updates(list); |
| | | } |
| | | |
| | | private void sendMsg(String json) throws Exception { |
| | | //String json = JSONObject.toJSONStringWithDateFormat(jsonObject, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue); |
| | | WebSocketService.broadCastInfo(json); |
| | | } |
| | | } |