| | |
| | | import com.zy.core.thread.NyShuttleThread; |
| | | import lombok.Data; |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | buffer.append("超重"); |
| | | } |
| | | |
| | | if (liftProtocol.getErrorCode() > 0) { |
| | | buffer.append(liftProtocol.getErrCode$()); |
| | | } |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("deviceNo", liftProtocol.getLiftNo());//设备号-提升机号 |
| | | map.put("errorMsg", buffer.toString());//异常信息 |
| | |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | /** |
| | | * 获取设备运行异常统计 |
| | | */ |
| | | @GetMapping("/deviceRunErrorStatistic/{type}") |
| | | public R deviceRunErrorStatistic(@PathVariable("type") String type) { |
| | | int time = 1;//默认1天 |
| | | if (type.equals("day")) { |
| | | time = 1; |
| | | } else if (type.equals("week")) { |
| | | time = 7; |
| | | } else if (type.equals("month")) { |
| | | time = 30; |
| | | } |
| | | //获取提升机运行异常数据 |
| | | List<Map<String, Object>> liftList = basLiftOptMapper.selectRunErrorStatistic(time); |
| | | //获取小车运行异常数据 |
| | | List<Map<String, Object>> shuttleList = basShuttleOptMapper.selectRunErrorStatistic(time); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("lift", liftList); |
| | | map.put("shuttle", shuttleList); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | |
| | | |
| | | |