| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.acs.common.utils.GsonUtils; |
| | | import com.zy.acs.common.utils.QrCodeCodecSupport; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.framework.common.SnowflakeIdWorker; |
| | |
| | | @Autowired |
| | | private AgvDetailService agvDetailService; |
| | | @Autowired |
| | | private AgvModelService agvModelService; |
| | | @Autowired |
| | | private FloydNavigateService floydNavigateService; |
| | | @Autowired |
| | | private MapService mapService; |
| | |
| | | @PostMapping("/config/preferences") |
| | | public R configPreferences(@RequestParam(required = false) Long zoneId, @RequestParam(required = false) Integer floor) { |
| | | Integer dashboardAgvAngleOffsetVal = configService.getVal("dashboardAgvAngleOffsetVal", Integer.class); |
| | | Integer mapAngleOffsetVal = configService.getVal("mapAngleOffsetVal", Integer.class); |
| | | Boolean dashMapMirror = configService.getVal("dashMapMirror", Boolean.class); |
| | | return R.ok().add(Cools |
| | | .add("agvAngleOffsetVal", Optional.ofNullable(dashboardAgvAngleOffsetVal).orElse(0)) |
| | | .add("mapAngleOffsetVal", Optional.ofNullable(mapAngleOffsetVal).orElse(0)) |
| | | .add("mapMirror", Optional.ofNullable(dashMapMirror).orElse(Boolean.FALSE)) |
| | | ); |
| | | } |
| | |
| | | MapAgvVo vo = new MapAgvVo(); |
| | | vo.setAgvId(agv.getId()); |
| | | vo.setAgvNo(agv.getUuid()); |
| | | AgvModel agvModel = agvModelService.getByAgvId(agv.getId()); |
| | | if (agvModel != null) { |
| | | vo.setAgvModelType(agvModel.getType()); |
| | | } |
| | | vo.setStatus(agv.getStatus()); |
| | | if (null != agvDetail) { |
| | | vo.setOnline(agvService.judgeOnline(agvDetail.getAgvId())); |
| | |
| | | List<Code> codes = codeService.list(); |
| | | List<Code> codeArr = param.getCodeArr(); |
| | | for (Code code : codeArr) { |
| | | code.setData(QrCodeCodecSupport.normalize(code.getData())); |
| | | Code one = codeService.getCacheByData(code.getData()); |
| | | if (one == null) { |
| | | if (!codeService.save(code)) { |
| | |
| | | throw new BusinessException(code.getData()+" update fail![Code]"); |
| | | } |
| | | } |
| | | codes.removeIf(next -> code.getData().equals(next.getData())); |
| | | codes.removeIf(next -> Objects.equals(next.getId(), one == null ? code.getId() : one.getId())); |
| | | } |
| | | for (Code code : codes) { |
| | | if (!codeService.removeById(code.getId())) { |