| | |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.param.AgvMobileStartPakin; |
| | | import com.zy.asrs.entity.param.AgvMobileStartParam; |
| | | 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.*; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | private AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | private AgvWorkService workService; |
| | | @Autowired |
| | | private AgvLocMastService agvLocMastService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | |
| | | /* |
| | |
| | | */ |
| | | @PostMapping("/comb/auth") |
| | | public R comb(@RequestBody CombParam combParam){ |
| | | String message = agvMobileService.comb(combParam, 1l); |
| | | return R.ok(message); |
| | | agvMobileService.comb(combParam, getUserId()); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | |
| | | public R combBinding(@RequestBody Map<String,Object> map){ |
| | | String barcode = map.get("barcode").toString(); |
| | | String stationCode = map.get("stationCode").toString(); |
| | | agvMobileService.combBinding(barcode,stationCode); |
| | | Short containerType = Short.valueOf(barcode.substring(0,2)); |
| | | agvMobileService.combBinding(barcode,stationCode,containerType); |
| | | return R.ok("托盘绑定站点成功"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /* |
| | | 获取输送线站点 |
| | | */ |
| | | @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"); |
| | | |
| | |
| | | return agvBasDevpService.selectById(devNo); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | workService.createWaitPainWrkMastStart(agvBasDevpList, getUserId()); |
| | | workService.createWaitPainWrkMastStart(agvBasDevpList, getUserId(),false); |
| | | |
| | | return R.ok("生成工作档成功"); |
| | | } |
| | | |
| | | /* |
| | | 启动入库,组托 + 生产工作档 |
| | | */ |
| | | @PostMapping("/start/pakin/auth") |
| | | @Synchronized |
| | | @Transactional |
| | | public R startPakin(@RequestBody AgvMobileStartPakin params){ |
| | | // 组托 |
| | | params.getCombParams().forEach(combParam -> { |
| | | agvMobileService.comb(combParam,getUserId()); |
| | | }); |
| | | params.setContainerType(Short.valueOf(params.getContainerCode().substring(0,2))); |
| | | workService.emptyPlateIn(params.getDevNo(),params.getContainerCode(),params.getContainerType(), getUserId(),false); |
| | | |
| | | return R.ok("生成工作档成功"); |
| | | } |
| | | |
| | | /* |
| | | 入库 |
| | | */ |
| | | @PostMapping("/pakin/empty/auth") |
| | | @Synchronized |
| | | public R pakinEmpty(@RequestBody AgvMobileStartParam params){ |
| | | |
| | | for (AgvMobileStartParam.Pda pda : params.getPad()) { |
| | | pda.setContainerType(Short.valueOf(pda.getContainerCode().substring(0,2))); |
| | | workService.emptyPlateIn(pda.getDevNo(),pda.getContainerCode(),pda.getContainerType(), getUserId(),false); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | | 空板出库 |
| | | */ |
| | | @PostMapping("/pakout/empty/auth") |
| | | @Synchronized |
| | | public R pakoutEmpty(@RequestBody AgvMobileStartParam params){ |
| | | |
| | | for (AgvMobileStartParam.Pda pda : params.getPad()) { |
| | | workService.emptyPlateOut(pda.getDevNo(),pda.getContainerType(), getUserId()); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | | 空板出库容器码选择 |
| | | */ |
| | | @PostMapping("/pakout/empty/container/selector/auth") |
| | | public R containerType(@RequestBody HashMap<String,String> params){ |
| | | |
| | | String devNo = params.get("devNo"); |
| | | AgvBasDevp agvBasDevp = agvBasDevpService.selectById(devNo); |
| | | |
| | | return R.ok(agvLocMastService.queryContainerTypeByLocType1(agvBasDevp.getLocType1())); |
| | | |
| | | } |
| | | |
| | | |
| | | } |