| | |
| | | import com.zy.common.model.SearchLocParam; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.LedSlave; |
| | |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.ShuttleThread; |
| | | import com.zy.core.thread.impl.NormalLedThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | /** |
| | | * Created by vincent on 2020/11/16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/monitor") |
| | | public class TVController { |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private BasShuttleErrService basShuttleErrService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Value("${asrs.wmsUrl}") |
| | | private String wmsUrl; |
| | | |
| | |
| | | if (basDevp.getWrkNo() == null || basDevp.getWrkNo() == 0) { |
| | | return R.ok(); |
| | | } |
| | | List<LedCommand> commands = new ArrayList<>(); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("taskNo", basDevp.getWrkNo()); |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath("/rpc/led/getTask2") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | Object o = redisUtil.get("LED_" + dev_no); |
| | | if (o != null) { |
| | | log.info("电视机显示:{}",JSONObject.toJSONString(o)); |
| | | return R.ok().add(o); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (code.equals(200)) { |
| | | String data = jsonObject.getString("data"); |
| | | List<LedCommand> wrkDetls = JSONArray.parseArray(data, LedCommand.class); |
| | | commands.addAll(wrkDetls); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(commands); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | /** |