| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.dto.AxisBean; |
| | | import com.zy.asrs.domain.dto.WorkChartAxis; |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import com.zy.asrs.entity.BasCrnError; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.mapper.BasCrnErrorMapper; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.common.model.annotations.RateLimit; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.SiemensCrnThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | private ReportQueryMapper reportQueryMapper; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | /** |
| | | * 获取当前时间 |
| | |
| | | /** |
| | | * 入库报表 -- 折线图 |
| | | */ |
| | | @RateLimit(2) |
| | | // @RateLimit(2) |
| | | @GetMapping("/pakin/rep") |
| | | public R monitorPakinRep(){ |
| | | // 入库 |
| | |
| | | /** |
| | | * 库位使用情况统计 |
| | | */ |
| | | @RateLimit(2) |
| | | // @RateLimit(60) |
| | | @GetMapping("/loc/rep") |
| | | public R monitorLocRep(){ |
| | | List<Map<String, Object>> pie = new ArrayList<>(); |
| | | |
| | | LocChartPie locUseRate = reportQueryMapper.getLocUseRate(); |
| | | int i = locMastService.selectCount(new EntityWrapper<LocMast>().eq("loc_sts", "D")); |
| | | if(locUseRate!=null) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("name", "在库"); |
| | |
| | | pie.add(map2); |
| | | |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("name", "禁用"); |
| | | map3.put("value", locUseRate.getXqty()); |
| | | map3.put("name", "空板"); |
| | | map3.put("value", i); |
| | | pie.add(map3); |
| | | } |
| | | |
| | |
| | | |
| | | return R.ok( |
| | | Cools.add("pie", pie) |
| | | .add("stockCunt", locUseRate.getFqty()) |
| | | .add("stockCunt", locUseRate.getFqty() - i) |
| | | .add("emptyCount", locUseRate.getOqty()) |
| | | .add("noneCount", locUseRate.getXqty()) |
| | | .add("noneCount", i) |
| | | .add("total", total) |
| | | .add("used", used) |
| | | .add("usedPr", usedPr) |
| | |
| | | return R.ok().add(errorMsg); |
| | | } |
| | | |
| | | @GetMapping("/crn/error") |
| | | public R crnError() { |
| | | ArrayList<HashMap<String, Object>> list = new ArrayList<>(); |
| | | for (CrnSlave slave : slaveProperties.getCrn()) { |
| | | SiemensCrnThread crnThread = (SiemensCrnThread) SlaveConnection.get(SlaveType.Crn, slave.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); |
| | | String errorName = crnError == null ? String.valueOf(crnProtocol.getAlarm()) : crnError.getErrName(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | HashMap<String, Object> data = new HashMap<>(); |
| | | data.put("crnNo", slave.getId()); |
| | | data.put("errorName", errorName); |
| | | list.add(data); |
| | | } |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | /** |
| | | * 自动补零 |