| | |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.client.domain.PlcErrorTable; |
| | | import com.zy.client.domain.vo.PlcErrorTableVo; |
| | | import com.zy.client.domain.vo.SiteTableVo; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * 输送设备接口 |
| | |
| | | @RequestMapping("/site") |
| | | public class SiteController { |
| | | |
| | | private AtomicInteger integer = new AtomicInteger(); |
| | | |
| | | @PostMapping("/table/site") |
| | | @ManagerAuth(memo = "站点信息表") |
| | | public R siteTable(){ |
| | | List<SiteTableVo> list = new ArrayList<>(); |
| | | for (int i=0;i<32;i++){ |
| | | SiteTableVo vo = new SiteTableVo(); |
| | | vo.setDevNo(String.valueOf(i)); |
| | | vo.setWorkNo("1204"); |
| | | vo.setAutoing("Y"); |
| | | vo.setCanining("Y"); |
| | | vo.setCanouting("N"); |
| | | vo.setHighLow("1"); |
| | | vo.setInreqIn("Y"); |
| | | vo.setInreqOut("N"); |
| | | vo.setLoading("Y"); |
| | | if (integer.get()%5 == 0) { |
| | | vo.setStaNo("0000"); |
| | | } else { |
| | | vo.setStaNo("9998"); |
| | | } |
| | | list.add(vo); |
| | | } |
| | | integer.getAndIncrement(); |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/table/plc/errors") |
| | | @ManagerAuth(memo = "输送设备plc异常信息表") |
| | | public R crnLatestData(){ |
| | | List<PlcErrorTable> list = new ArrayList<>(); |
| | | public R plcErrorTable(){ |
| | | List<PlcErrorTableVo> list = new ArrayList<>(); |
| | | for (int i = 0; i<new Random().nextInt(13); i++){ |
| | | PlcErrorTable table = new PlcErrorTable(); |
| | | PlcErrorTableVo table = new PlcErrorTableVo(); |
| | | table.setNo(String.valueOf(i)); |
| | | table.setError("异常信息"); |
| | | table.setPlcDesc("plc异常描述"); |
| | |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/output/site") |
| | | @ManagerAuth(memo = "站点设备报文日志输出") |
| | | public R siteOutput(){ |
| | | String str = "\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--27328372372832763643234323432342"; |
| | | return R.ok().add(str); |
| | | } |
| | | |
| | | } |