| | |
| | | import MapSearch from "./header/MapSearch"; |
| | | import { startupOrShutdown } from "./http"; |
| | | import PulseSignal from "../page/components/PulseSignal"; |
| | | import FakeFab from "./header/FakeFab"; |
| | | |
| | | let player; |
| | | let websocket; |
| | |
| | | }} |
| | | > |
| | | {mode !== MAP_MODE.MOVABLE_MODE && ( |
| | | <> |
| | | <Fab |
| | | variant="extended" |
| | | color={showRoutes ? 'primary' : 'default'} |
| | |
| | | > |
| | | <AltRoute /> |
| | | </Fab> |
| | | <FakeFab |
| | | /> |
| | | </> |
| | | )} |
| | | <Fab |
| | | variant="extended" |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Select, |
| | | MenuItem, |
| | | Button, |
| | | Box, |
| | | useTheme, |
| | | Fab, |
| | | } from '@mui/material'; |
| | | import LensBlurIcon from '@mui/icons-material/LensBlur'; |
| | | import { getFakeSign } from "../http"; |
| | | |
| | | const FakeFab = (props) => { |
| | | const [fakeRun, setFakeRun] = useState(false); |
| | | |
| | | const querySign = () => { |
| | | getFakeSign(null, (data) => { |
| | | }); |
| | | } |
| | | |
| | | useEffect(() => { |
| | | querySign(); |
| | | }, []); |
| | | |
| | | return ( |
| | | <> |
| | | <Fab |
| | | variant="extended" |
| | | color={fakeRun ? 'primary' : 'default'} |
| | | size="small" |
| | | onClick={() => { |
| | | setFakeRun(!fakeRun); |
| | | }} |
| | | > |
| | | <LensBlurIcon /> |
| | | {/* {translate('page.map.action.adapt')} */} |
| | | </Fab> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default FakeFab; |
| | |
| | | const { code, msg, data } = res.data; |
| | | if (code === 200) { |
| | | notify.success(msg); |
| | | if (callback) { |
| | | callback(data) |
| | | } |
| | | } else { |
| | | notify.error(msg); |
| | | } |
| | | }).catch((error) => { |
| | | notify.error(error.message); |
| | | console.error(error.message); |
| | | }) |
| | | } |
| | | |
| | | export const getFakeSign = async (param, callback) => { |
| | | await request.get('/fake/sign').then((res) => { |
| | | const { code, msg, data } = res.data; |
| | | if (code === 200) { |
| | | if (callback) { |
| | | callback(data) |
| | | } |
| | |
| | | public static final String[] FILTER_PATH = new String[]{ |
| | | "/handler/**", |
| | | "/test/**", |
| | | "/fake/**", |
| | | "/digital/**", |
| | | "/rpc/**", |
| | | "/api/login", |
New file |
| | |
| | | package com.zy.acs.manager.fake; |
| | | |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.manager.system.controller.BaseController; |
| | | import com.zy.acs.manager.system.service.ConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * Created by vincent on 11/9/2024 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/api/fake") |
| | | public class FakeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | @GetMapping("/sign") |
| | | public R sign() { |
| | | return R.ok().add(configService.getVal("fakeSign", Boolean.class)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.acs.manager.fake; |
| | | |
| | | import com.zy.acs.manager.manager.service.AgvDetailService; |
| | | import com.zy.acs.manager.manager.service.AgvService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Created by vincent on 11/9/2024 |
| | | */ |
| | | @Component |
| | | public class FakeProcessor { |
| | | |
| | | @Autowired |
| | | private AgvService agvService; |
| | | @Autowired |
| | | private AgvDetailService agvDetailService; |
| | | |
| | | /** |
| | | * 1.AgvDataService.dataProcess [ agvDetail: vol, code, agvAngle, agvStatus ] |
| | | * 2.MainService.upDataSubscribe |
| | | * 3.AgvCmdService.executeRequest |
| | | * 4.AgvServiceImpl.judgeOnline |
| | | * 5. |
| | | */ |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | public void process() { |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.acs.manager.fake; |
| | | |
| | | import com.zy.acs.manager.system.service.ConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * Created by vincent on 11/9/2024 |
| | | */ |
| | | @Service |
| | | public class FakeService { |
| | | |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | public boolean fakeStartup() { |
| | | return configService.setVal("fakeSign", Boolean.TRUE); |
| | | } |
| | | |
| | | public boolean fakeShutdown() { |
| | | return configService.setVal("fakeSign", Boolean.FALSE); |
| | | } |
| | | |
| | | |
| | | } |