| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.NotifyDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.annotations.OpenApiLog; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @PostMapping("/createMoveTask") |
| | | @OpenApiLog(memo = "å°è½¦ç§»å¨ä»»å¡") |
| | |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @PostMapping("/getLocInformation") |
| | | @OpenApiLog(memo = "è·åæå®åºä½ä¿¡æ¯") |
| | | public R getLocInformation(@RequestBody GetLocInformationParam param) { |
| | | if (param == null) { |
| | | return R.error("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | LocMast locMast = locMastService.queryByLoc(param.getLocNo()); |
| | | if (locMast == null) { |
| | | return R.error("åºä½ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("locNo", locMast.getLocNo()); |
| | | map.put("locSts", locMast.getLocSts()); |
| | | |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "è·åæå®åºä½ä¿¡æ¯" |
| | | , "/getLocInformation" |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(param) |
| | | , JSON.toJSONString(map) |
| | | , null |
| | | , null |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @PostMapping("/getAllLocInformation") |
| | | @OpenApiLog(memo = "è·åå
¨é¨åºä½ä¿¡æ¯") |
| | | public R getAllLocInformation() { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()); |
| | | if (locMasts.isEmpty()) { |
| | | return R.error("åºä½ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | |
| | | ArrayList<HashMap<String, Object>> list = new ArrayList<>(); |
| | | for (LocMast locMast : locMasts) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("locNo", locMast.getLocNo()); |
| | | map.put("locSts", locMast.getLocSts()); |
| | | list.add(map); |
| | | } |
| | | |
| | | apiLogService.insert(new ApiLog( |
| | | null |
| | | , "è·åæå®åºä½ä¿¡æ¯" |
| | | , "/getLocInformation" |
| | | , null |
| | | , null |
| | | , null |
| | | , null |
| | | , JSON.toJSONString(list) |
| | | , null |
| | | , null |
| | | , 1 |
| | | , new Date() |
| | | , null |
| | | , null |
| | | )); |
| | | |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | @GetMapping("/test") |
| | | public R test() { |
| | | notifyUtils.notify("task", 1, "9999", "W9999", NotifyMsgType.SHUTTLE_MOVING, "data"); |