| | |
| | | package com.zy.client.controller; |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.client.domain.CrnStateTableVo; |
| | | import com.zy.client.domain.enums.CrnStatusType; |
| | | 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.concurrent.atomic.AtomicInteger; |
| | | |
| | | /** |
| | | * 堆垛机接口 |
| | |
| | | public class CrnController { |
| | | |
| | | |
| | | private AtomicInteger integer = new AtomicInteger(); |
| | | |
| | | @PostMapping("/table/crn/state") |
| | | @ManagerAuth(memo = "堆垛机信息表") |
| | | public R crnTable(){ |
| | | List<CrnStateTableVo> list = new ArrayList<>(); |
| | | for (int i=0;i<4;i++){ |
| | | CrnStateTableVo vo = new CrnStateTableVo("1", CrnStatusType.AUTO, "正常", "有物", "99", "3", "中位", "18233", "422", "0", "1204", "关闭", "0"); |
| | | if (integer.get()%5 == 0) { |
| | | vo.setWorkNo("0000"); |
| | | } else { |
| | | vo.setWorkNo("9998"); |
| | | } |
| | | list.add(vo); |
| | | } |
| | | integer.getAndIncrement(); |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @PostMapping("/output/site") |
| | | @ManagerAuth(memo = "堆垛机报文日志输出") |
| | | public R crnOutput(){ |
| | | String str = "\n" +new Date().toLocaleString() + "【2020-5-29 13:14:22】扫描plcA 目标站--273283723728327636432343234323422732837237283276364323432343234227328372372832763643234323432342"; |
| | | return R.ok().add(str); |
| | | } |
| | | } |