| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.AgvBasDevpService; |
| | | import com.zy.asrs.service.AgvMobileService; |
| | | import com.zy.asrs.service.AgvWorkService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 移动端接口控制器 |
| | |
| | | |
| | | @Autowired |
| | | private AgvMobileService agvMobileService; |
| | | @Autowired |
| | | private AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | private AgvWorkService workService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | |
| | | /* |
| | | locno?组托+绑定暂存位 : 组托 |
| | | */ |
| | | @PostMapping("/comb/auth") |
| | | public R comb(@RequestBody CombParam combParam){ |
| | | agvMobileService.comb(combParam, 1l); |
| | | return R.ok("组托成功"); |
| | | String message = agvMobileService.comb(combParam, 1l); |
| | | return R.ok(message); |
| | | } |
| | | |
| | | /* |
| | | 绑定托盘条码与暂存位 |
| | | */ |
| | | @PostMapping("/combBinging/auth") |
| | | public R combBinding(@RequestBody Map<String,Object> map){ |
| | | String barcode = map.get("barcode").toString(); |
| | |
| | | return R.ok("托盘绑定站点成功"); |
| | | } |
| | | |
| | | /* |
| | | 获取当前已绑定的还没生成工作档的暂存位 |
| | | */ |
| | | @PostMapping("/getBasDevp/auth") |
| | | public R getBasDevpByFloor(@RequestBody Map<String,Object> map){ |
| | | String floor = map.get("floor").toString(); |
| | | if("1".equals(floor) || "3".equals(floor)){ |
| | | return R.ok(agvMobileService.getAgvBasDevpByFloor(Integer.parseInt(floor))); |
| | | } |
| | | return R.error("参数错误"); |
| | | } |
| | | |
| | | /* |
| | | 获取输送线站点 |
| | | */ |
| | | @PostMapping("/getBasDevp/noCacheShelves/auth") |
| | | public R getBasDevpByNoCacheShelves(){ |
| | | return R.ok(agvBasDevpService.getBasDevpByNoCacheShelves()); |
| | | } |
| | | |
| | | /* |
| | | 启动入库,生成工作档 |
| | | */ |
| | | @PostMapping("/pakin/auth") |
| | | @Synchronized |
| | | public R pakin(@RequestBody Map<String,Object> map){ |
| | | List<String> devNos = (List<String>) map.get("devNo"); |
| | | |
| | | List<AgvBasDevp> agvBasDevpList = devNos.stream().map(devNo -> { |
| | | return agvBasDevpService.selectById(devNo); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | workService.createWaitPainWrkMastStart(agvBasDevpList, getUserId(),false); |
| | | |
| | | return R.ok("生成工作档成功"); |
| | | } |
| | | |
| | | |
| | | } |