自动化立体仓库 - WMS系统
#
野心家
2023-10-10 ba4e5ac7bd44e0d24f480b44a94cfe8d256a86e9
src/main/java/com/zy/asrs/controller/AgvBasDevpController.java
@@ -206,15 +206,34 @@
     */
    @RequestMapping(value = "/basDevp/visualized/container/moveOut")
    public R visualiZedContainerMoveOut(@RequestBody Map<String,Object> map) {
        List<String> devNos = (List<String>) map.get("devNo");
        List<AgvWrkMast> agvWrkMastList = devNos.stream().map(devNo -> {
        List<String> devNos = new ArrayList<>();
        List<AgvWrkMast> agvWrkMastList = new ArrayList<>();
        try {
            devNos = (List<String>) map.get("devNo");
            agvWrkMastList = devNos.stream().map(devNo -> {
                AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", devNo));
                if(agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110){
                    throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型不为101.出库,无法执行容器离场任务,请重新选择站点。");
                }
                return agvWrkMast;
            }).collect(Collectors.toList());
        }catch (Exception e){
            String devNo = map.get("devNo").toString();
            AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", devNo));
            if(agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110){
                throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型不为101.出库,无法执行容器离场任务,请重新选择站点。");
            }
            return agvWrkMast;
        }).collect(Collectors.toList());
            agvWrkMastList.add(agvWrkMast);
        }
//        List<AgvWrkMast> agvWrkMastList = devNos.stream().map(devNo -> {
//            AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", devNo));
//            if(agvWrkMast.getIoType() != 101 && agvWrkMast.getIoType() != 110){
//                throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型不为101.出库,无法执行容器离场任务,请重新选择站点。");
//            }
//            return agvWrkMast;
//        }).collect(Collectors.toList());
        try {
           int code = agvWrkMastService.containerMoveOut(agvWrkMastList);
@@ -245,14 +264,34 @@
     */
    @RequestMapping(value = "/basDevp/visualized/container/pickIn")
    public R visualiZedPickIn(@RequestBody Map<String,Object> map){
        List<String> devNos = (List<String>) map.get("devNo");
        List<AgvWrkMast> agvWrkMastList = devNos.stream().map(devNo -> {
        List<String> devNos = new ArrayList<>();
        List<AgvWrkMast> agvWrkMastList = new ArrayList<>();
        try {
            devNos = (List<String>) map.get("devNo");
            agvWrkMastList = devNos.stream().map(devNo -> {
                AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", devNo));
                if(agvWrkMast.getIoType() == 101){
                    throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型为101.出库,无法执行拣料入库任务,请重新选择站点。");
                }
                return agvWrkMast;
            }).collect(Collectors.toList());
        }catch (Exception e){
            String devNo = map.get("devNo").toString();
            AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", devNo));
            if(agvWrkMast.getIoType() == 101){
                throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型为101.出库,无法执行拣料入库任务,请重新选择站点。");
            }
            return agvWrkMast;
        }).collect(Collectors.toList());
            agvWrkMastList.add(agvWrkMast);
        }
//        List<String> devNos = (List<String>) map.get("devNo");
//        List<AgvWrkMast> agvWrkMastList = devNos.stream().map(devNo -> {
//            AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("loc_no", devNo));
//            if(agvWrkMast.getIoType() == 101){
//                throw new CoolException("工作号为" + agvWrkMast.getWrkNo() + "类型为101.出库,无法执行拣料入库任务,请重新选择站点。");
//            }
//            return agvWrkMast;
//        }).collect(Collectors.toList());
        agvWorkService.pickIn(agvWrkMastList);