| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | import com.zy.asrs.entity.TvDevice; |
| | | |
| | | import com.zy.asrs.entity.dto.TvDataDto; |
| | | import com.zy.asrs.entity.dto.TvLocDataDto; |
| | | import com.zy.asrs.entity.dto.WcsStationDto; |
| | | import com.zy.asrs.enums.RedisKeyType; |
| | | import com.zy.asrs.service.BasStationTvService; |
| | | import com.zy.asrs.service.TvDeviceService; |
| | | import com.zy.asrs.utils.StationUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private BasStationTvService basStationTvService; |
| | | @Autowired |
| | | private StationUtils stationUtils; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Value("${app.version:1.0.0}") |
| | | private String appVersion; |
| | |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 获取库位数据 |
| | | */ |
| | | @GetMapping("/queryLoc") |
| | | public R queryLoc() { |
| | | TvLocDataDto tvLocDataDto = new TvLocDataDto(); |
| | | Object o = redisUtil.get(RedisKeyType.TV_LOC_DATA_DTO.key); |
| | | if(o == null){ |
| | | return R.ok().add(tvLocDataDto); |
| | | } |
| | | |
| | | tvLocDataDto = JSON.parseObject(o.toString(), TvLocDataDto.class); |
| | | return R.ok().add(tvLocDataDto); |
| | | } |
| | | |
| | | /** |
| | | * WMS入出库折线图 |
| | | */ |
| | | @GetMapping("/inOutLineCharts") |
| | | public R inOutLineCharts() { |
| | | Object o = redisUtil.get(RedisKeyType.TV_LINE_CHARTS.key); |
| | | if(o == null){ |
| | | return R.error(); |
| | | } |
| | | |
| | | return R.ok().add(JSON.parseObject(o.toString())); |
| | | } |
| | | |
| | | /** |
| | | * WMS库存数据统计 |
| | | */ |
| | | @GetMapping("/locDetlStatistics") |
| | | public R locDetlStatistics() { |
| | | Object o = redisUtil.get(RedisKeyType.TV_LOC_DETL_STATISTICS.key); |
| | | if(o == null){ |
| | | return R.error(); |
| | | } |
| | | |
| | | return R.ok().add(JSON.parseArray(o.toString())); |
| | | } |
| | | |
| | | } |