1.完善AGV任务创建和下发
2.完善数据孪生
3.新增拍照获取照片
4.新增PDA配盘出库单立即出库
5.新增PDA配盘入库单下拉框获取订单号
| | |
| | | // @ManagerAuth |
| | | public R overview(@RequestParam(required = false) String areaId){ |
| | | |
| | | //digitalTwinService.overview(areaId); |
| | | DtOverviewVo dtOverviewVo = digitalTwinService.overview(areaId); |
| | | |
| | | DtOverviewVo dtOverviewVo = DtOverviewVo.builder() |
| | | .totalLoc(999) |
| | | .useLoc(900) |
| | | .idleLoc(99) |
| | | .todayOutbound(160) |
| | | .todayWarehousing(170) |
| | | .remainingStock(180) |
| | | .build(); |
| | | // DtOverviewVo dtOverviewVo = DtOverviewVo.builder() |
| | | // .totalLoc(999) |
| | | // .useLoc(900) |
| | | // .idleLoc(99) |
| | | // .todayOutbound(160) |
| | | // .todayWarehousing(170) |
| | | // .remainingStock(180) |
| | | // .build(); |
| | | |
| | | return R.ok().add(dtOverviewVo); |
| | | } |
| | |
| | | public R recentOrder(@RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | |
| | | // digitalTwinService.order(startDate, endDate); |
| | | List<DtOrderVo> orderVoList = digitalTwinService.order(startDate, endDate); |
| | | |
| | | DtOrderVo dtOrderVo = DtOrderVo.builder() |
| | | .orderDate("2025-10-22") |
| | | .orderNum(156) |
| | | .build(); |
| | | DtOrderVo dtOrderVo2 = DtOrderVo.builder() |
| | | .orderDate("2025-10-23") |
| | | .orderNum(166) |
| | | .build(); |
| | | List<DtOrderVo> orderVoList = new ArrayList<>(); |
| | | orderVoList.add(dtOrderVo); |
| | | orderVoList.add(dtOrderVo2); |
| | | // DtOrderVo dtOrderVo = DtOrderVo.builder() |
| | | // .orderDate("2025-10-22") |
| | | // .orderNum(156) |
| | | // .build(); |
| | | // DtOrderVo dtOrderVo2 = DtOrderVo.builder() |
| | | // .orderDate("2025-10-23") |
| | | // .orderNum(166) |
| | | // .build(); |
| | | // List<DtOrderVo> orderVoList = new ArrayList<>(); |
| | | // orderVoList.add(dtOrderVo); |
| | | // orderVoList.add(dtOrderVo2); |
| | | |
| | | return R.ok().add(orderVoList); |
| | | } |
| | |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | |
| | | // digitalTwinService.recentLoc(areaId, startDate, endDate); |
| | | List<DtLocVo> locVoList = digitalTwinService.recentLoc(areaId, startDate, endDate); |
| | | |
| | | DtLocVo dtLocVo = DtLocVo.builder() |
| | | .locDate("2025-10-22") |
| | | .idleNum(208) |
| | | .build(); |
| | | DtLocVo dtLocVo2 = DtLocVo.builder() |
| | | .locDate("2025-10-23") |
| | | .idleNum(177) |
| | | .build(); |
| | | List<DtLocVo> locVoList = new ArrayList<>(); |
| | | locVoList.add(dtLocVo); |
| | | locVoList.add(dtLocVo2); |
| | | // DtLocVo dtLocVo = DtLocVo.builder() |
| | | // .locDate("2025-10-22") |
| | | // .idleNum(208) |
| | | // .build(); |
| | | // DtLocVo dtLocVo2 = DtLocVo.builder() |
| | | // .locDate("2025-10-23") |
| | | // .idleNum(177) |
| | | // .build(); |
| | | // List<DtLocVo> locVoList = new ArrayList<>(); |
| | | // locVoList.add(dtLocVo); |
| | | // locVoList.add(dtLocVo2); |
| | | |
| | | return R.ok().add(locVoList); |
| | | } |
| | |
| | | @RequestParam(required = false) String startDate, |
| | | @RequestParam(required = false) String endDate){ |
| | | |
| | | // digitalTwinService.inAndOutBound(areaId, startDate, endDate); |
| | | List<DtInAndOutBoundVo> inAndOutBoundVoList = digitalTwinService.inAndOutBound(areaId, startDate, endDate); |
| | | |
| | | DtInAndOutBoundVo dtInAndOutBoundVo = DtInAndOutBoundVo.builder() |
| | | .boundDate("2025-10-22") |
| | | .inBoundNum(237) |
| | | .outBoundNum(487) |
| | | .build(); |
| | | DtInAndOutBoundVo dtInAndOutBoundVo2 = DtInAndOutBoundVo.builder() |
| | | .boundDate("2025-10-23") |
| | | .inBoundNum(187) |
| | | .outBoundNum(287) |
| | | .build(); |
| | | List<DtInAndOutBoundVo> inAndOutBoundVoList = new ArrayList<>(); |
| | | inAndOutBoundVoList.add(dtInAndOutBoundVo); |
| | | inAndOutBoundVoList.add(dtInAndOutBoundVo2); |
| | | |
| | | // DtInAndOutBoundVo dtInAndOutBoundVo = DtInAndOutBoundVo.builder() |
| | | // .boundDate("2025-10-22") |
| | | // .inBoundNum(237) |
| | | // .outBoundNum(487) |
| | | // .build(); |
| | | // DtInAndOutBoundVo dtInAndOutBoundVo2 = DtInAndOutBoundVo.builder() |
| | | // .boundDate("2025-10-23") |
| | | // .inBoundNum(187) |
| | | // .outBoundNum(287) |
| | | // .build(); |
| | | // List<DtInAndOutBoundVo> inAndOutBoundVoList = new ArrayList<>(); |
| | | // inAndOutBoundVoList.add(dtInAndOutBoundVo); |
| | | // inAndOutBoundVoList.add(dtInAndOutBoundVo2); |
| | | |
| | | return R.ok().add(inAndOutBoundVoList); |
| | | } |
| | |
| | | @RequestParam(required = false) Integer pageIndex, |
| | | @RequestParam(required = false) Integer pageSize){ |
| | | |
| | | // digitalTwinService.recentDetainMat(areaId, overDayNum, pageIndex, pageSize); |
| | | List<DtDetainMatVo> detainMatVoList = digitalTwinService.recentDetainMat(areaId, overDayNum, pageIndex, pageSize); |
| | | |
| | | DtDetainMatVo dtDetainMatVo = DtDetainMatVo.builder() |
| | | .belongAreaId("A1") |
| | | .belongAreaName("刀具库") |
| | | .matId("mat10001") |
| | | .matName("道具把") |
| | | .lokId("loc1001") |
| | | .lokName("库位10001") |
| | | .detainTime(765) |
| | | .inBoundTime("2025-10-11T11:15:16") |
| | | .build(); |
| | | DtDetainMatVo dtDetainMatVo2 = DtDetainMatVo.builder() |
| | | .belongAreaId("A1") |
| | | .belongAreaName("刀具库") |
| | | .matId("mat10002") |
| | | .matName("道具把") |
| | | .lokId("loc1002") |
| | | .lokName("库位10002") |
| | | .detainTime(665) |
| | | .inBoundTime("2025-10-10T11:15:16") |
| | | .build(); |
| | | List<DtDetainMatVo> detainMatVoList = new ArrayList<>(); |
| | | detainMatVoList.add(dtDetainMatVo); |
| | | detainMatVoList.add(dtDetainMatVo2); |
| | | // DtDetainMatVo dtDetainMatVo = DtDetainMatVo.builder() |
| | | // .belongAreaId("A1") |
| | | // .belongAreaName("刀具库") |
| | | // .matId("mat10001") |
| | | // .matName("道具把") |
| | | // .lokId("loc1001") |
| | | // .lokName("库位10001") |
| | | // .detainTime(765) |
| | | // .inBoundTime("2025-10-11T11:15:16") |
| | | // .build(); |
| | | // DtDetainMatVo dtDetainMatVo2 = DtDetainMatVo.builder() |
| | | // .belongAreaId("A1") |
| | | // .belongAreaName("刀具库") |
| | | // .matId("mat10002") |
| | | // .matName("道具把") |
| | | // .lokId("loc1002") |
| | | // .lokName("库位10002") |
| | | // .detainTime(665) |
| | | // .inBoundTime("2025-10-10T11:15:16") |
| | | // .build(); |
| | | // List<DtDetainMatVo> detainMatVoList = new ArrayList<>(); |
| | | // detainMatVoList.add(dtDetainMatVo); |
| | | // detainMatVoList.add(dtDetainMatVo2); |
| | | |
| | | return R.ok().add(detainMatVoList); |
| | | } |
| | |
| | | @RequestMapping(value = "/warehouseDetail") |
| | | // @ManagerAuth |
| | | public R warehouseDetail(@RequestParam(required = false) String areaId){ |
| | | List<DtLocDetailVo> dtLocDetailVoList = digitalTwinService.warehouseDetail(areaId); |
| | | |
| | | // digitalTwinService.warehouseDetail(areaId); |
| | | |
| | | List<DtLocDetailVo> dtLocDetailVoList = new ArrayList<>(); |
| | | DtLocDetailVo dtLocDetailVo = new DtLocDetailVo(); |
| | | dtLocDetailVo.setLocNo("CA0100202"); |
| | | dtLocDetailVo.setLocSts("O"); |
| | | dtLocDetailVo.setAreaId(10010L); |
| | | dtLocDetailVo.setAreaName("刀具库"); |
| | | dtLocDetailVo.setRow1(1); |
| | | dtLocDetailVo.setBay1(2); |
| | | dtLocDetailVo.setLev1(2); |
| | | |
| | | LocMast locMast = new LocMast(); |
| | | locMast.setLocNo("CA0100202"); |
| | | locMast.setLocSts("O"); |
| | | locMast.setRow1(1); |
| | | locMast.setBay1(2); |
| | | locMast.setLev1(2); |
| | | dtLocDetailVo.setLocMast(locMast); |
| | | |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.setLocNo("CA0100202"); |
| | | locDetl.setAreaId(10010L); |
| | | locDetl.setAreaName("刀具库"); |
| | | locDetl.setMatnr("mat10001"); |
| | | locDetl.setMaktx("刀把"); |
| | | dtLocDetailVo.setLocDetl(locDetl); |
| | | dtLocDetailVoList.add(dtLocDetailVo); |
| | | |
| | | |
| | | DtLocDetailVo dtLocDetailVo2 = new DtLocDetailVo(); |
| | | dtLocDetailVo2.setLocNo("CA0100202"); |
| | | dtLocDetailVo2.setLocSts("O"); |
| | | dtLocDetailVo2.setAreaId(10010L); |
| | | dtLocDetailVo2.setAreaName("刀具库"); |
| | | dtLocDetailVo2.setRow1(1); |
| | | dtLocDetailVo2.setBay1(2); |
| | | dtLocDetailVo2.setLev1(2); |
| | | |
| | | LocMast locMast2 = new LocMast(); |
| | | locMast2.setLocNo("CA0100203"); |
| | | locMast2.setLocSts("O"); |
| | | locMast2.setRow1(1); |
| | | locMast2.setBay1(2); |
| | | locMast2.setLev1(3); |
| | | dtLocDetailVo2.setLocMast(locMast2); |
| | | |
| | | LocDetl locDetl2 = new LocDetl(); |
| | | locDetl2.setLocNo("CA0100203"); |
| | | locDetl2.setAreaId(10010L); |
| | | locDetl2.setAreaName("刀具库"); |
| | | locDetl2.setMatnr("mat10001"); |
| | | locDetl2.setMaktx("刀把"); |
| | | dtLocDetailVo2.setLocDetl(locDetl2); |
| | | dtLocDetailVoList.add(dtLocDetailVo2); |
| | | |
| | | |
| | | return R.ok().add(dtLocDetailVoList); |
| | | } |
| | | // List<DtLocDetailVo> dtLocDetailVoList = new ArrayList<>(); |
| | | // DtLocDetailVo dtLocDetailVo = new DtLocDetailVo(); |
| | | // dtLocDetailVo.setLocNo("CA0100202"); |
| | | // dtLocDetailVo.setLocSts("O"); |
| | | // dtLocDetailVo.setAreaId(10010L); |
| | | // dtLocDetailVo.setAreaName("刀具库"); |
| | | // dtLocDetailVo.setRow1(1); |
| | | // dtLocDetailVo.setBay1(2); |
| | | // dtLocDetailVo.setLev1(2); |
| | | // |
| | | // LocMast locMast = new LocMast(); |
| | | // locMast.setLocNo("CA0100202"); |
| | | // locMast.setLocSts("O"); |
| | | // locMast.setRow1(1); |
| | | // locMast.setBay1(2); |
| | | // locMast.setLev1(2); |
| | | // dtLocDetailVo.setLocMast(locMast); |
| | | // |
| | | // LocDetl locDetl = new LocDetl(); |
| | | // locDetl.setLocNo("CA0100202"); |
| | | // locDetl.setAreaId(10010L); |
| | | // locDetl.setAreaName("刀具库"); |
| | | // locDetl.setMatnr("mat10001"); |
| | | // locDetl.setMaktx("刀把"); |
| | | // dtLocDetailVo.setLocDetl(locDetl); |
| | | // dtLocDetailVoList.add(dtLocDetailVo); |
| | | // |
| | | // |
| | | // DtLocDetailVo dtLocDetailVo2 = new DtLocDetailVo(); |
| | | // dtLocDetailVo2.setLocNo("CA0100202"); |
| | | // dtLocDetailVo2.setLocSts("O"); |
| | | // dtLocDetailVo2.setAreaId(10010L); |
| | | // dtLocDetailVo2.setAreaName("刀具库"); |
| | | // dtLocDetailVo2.setRow1(1); |
| | | // dtLocDetailVo2.setBay1(2); |
| | | // dtLocDetailVo2.setLev1(2); |
| | | // |
| | | // LocMast locMast2 = new LocMast(); |
| | | // locMast2.setLocNo("CA0100203"); |
| | | // locMast2.setLocSts("O"); |
| | | // locMast2.setRow1(1); |
| | | // locMast2.setBay1(2); |
| | | // locMast2.setLev1(3); |
| | | // dtLocDetailVo2.setLocMast(locMast2); |
| | | // |
| | | // LocDetl locDetl2 = new LocDetl(); |
| | | // locDetl2.setLocNo("1001"); |
| | | // locDetl2.setLocNo("CA0100203"); |
| | | // locDetl2.setAreaId(10010L); |
| | | // locDetl2.setAreaName("刀具库"); |
| | | // locDetl2.setMatnr("mat10001"); |
| | | // locDetl2.setMaktx("刀把"); |
| | | // dtLocDetailVo2.setLocDetl(locDetl2); |
| | | // dtLocDetailVoList.add(dtLocDetailVo2); |
| | | // |
| | | //// List<LocDetl> locDetlList = new ArrayList<>(); |
| | | //// locDetlList.add(locDetl); |
| | | //// locDetlList.add(locDetl2); |
| | | |
| | | return R.ok().add(dtLocDetailVoList); |
| | | } |
| | | // |
| | | //// LocDetl locDetl2 = new LocDetl(); |
| | | //// locDetl2.setLocNo("1001"); |
| | | //// locDetl2.setAreaId(10010L); |
| | | //// locDetl2.setAreaName("刀具库"); |
| | | //// locDetl2.setMatnr("mat10001"); |
| | | //// locDetl2.setMaktx("刀把"); |
| | | //// |
| | | ////// List<LocDetl> locDetlList = new ArrayList<>(); |
| | | ////// locDetlList.add(locDetl); |
| | | ////// locDetlList.add(locDetl2); |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.digitaltwin.LocPicDto; |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Resource |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Value("${wcs.url}") |
| | | private String WCS_URL; |
| | | |
| | | @RequestMapping(value = "/locMast/init/pwd") |
| | | public R locMastInitPwd(@RequestParam(required = false) String pwd) { |
| | |
| | | return R.error("初始化失败===>" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/locMast/picUrl") |
| | | @ManagerAuth |
| | | public R getPicUrl(@RequestParam String locNo) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", locNo)); |
| | | if (locMast == null) { |
| | | return R.error(); |
| | | } |
| | | |
| | | List<LocPicDto> list = new ArrayList<>(); |
| | | String picStr = locMast.getPic(); |
| | | if (Cools.isEmpty(picStr)) { |
| | | return R.ok().add(list); |
| | | } |
| | | List<String> pics = JSON.parseArray(picStr, String.class); |
| | | for (String pic : pics) { |
| | | List<String> picList = new ArrayList<>(); |
| | | String[] split = pic.split("_"); |
| | | String picPath = split[0]; |
| | | String locNoStr = ""; |
| | | if (split.length > 1) { |
| | | locNoStr = split[1]; |
| | | picPath += "_" + locNoStr; |
| | | } |
| | | picList.add("http://" + WCS_URL + "/image/" + picPath + "-1.jpg"); |
| | | picList.add("http://" + WCS_URL + "/image/" + picPath + "-2.jpg"); |
| | | |
| | | LocPicDto locPicDto = new LocPicDto(); |
| | | locPicDto.setLocNo(locNoStr); |
| | | locPicDto.setPics(picList); |
| | | list.add(locPicDto); |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | } |
| | |
| | | return mesReturn; |
| | | } |
| | | |
| | | // // 出库申请 |
| | | // @PostMapping("/api/mes/outBoundOrder") |
| | | // public MesReturn outBoundOrder(@RequestBody MesOutApply param){ |
| | | // |
| | | // MesReturn mesReturn = new MesReturn(); |
| | | // mesReturn.setSuccess(mesService.outBoundOrder(param) == 1 ? "1" : "2"); |
| | | // return mesReturn; |
| | | // } |
| | | // 出库申请 |
| | | @PostMapping("/api/mes/outBoundOrder") |
| | | public MesReturn outBoundOrder(@RequestBody MesOutApply param){ |
| | | |
| | | MesReturn mesReturn = new MesReturn(); |
| | | mesReturn.setSuccess(mesService.outBoundOrder(param) == 1 ? "1" : "2"); |
| | | return mesReturn; |
| | | } |
| | | |
| | | // // 出库入库订单申请 |
| | | @PostMapping("/api/mes/callOutBoundOrder") |
| | |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.OrderDetlPakinServiceImpl; |
| | | import com.zy.asrs.service.impl.OrderDetlPakoutServiceImpl; |
| | | import com.zy.asrs.service.impl.OrderPakinServiceImpl; |
| | | import com.zy.asrs.service.impl.OrderPakoutServiceImpl; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.utils.HttpHandler; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private OrderPakinServiceImpl orderPakinService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private OrderDetlPakinServiceImpl orderDetlPakinService; |
| | | @Autowired |
| | | private OrderPakoutServiceImpl orderPakoutService; |
| | | @Autowired |
| | | private OrderDetlPakoutServiceImpl orderDetlPakoutService; |
| | | |
| | | @RequestMapping("/pda/WarehouseOut/v1") |
| | | @ManagerAuth(memo = "并板途中拣料-参考念初") |
| | |
| | | @RequestMapping("/order/search/orderNo/auth") |
| | | @ManagerAuth |
| | | public R orderSearchByBarcode(@RequestParam String orderNo){ |
| | | if (Cools.isEmpty(orderNo)){ |
| | | orderNo=null; |
| | | } |
| | | // List<Order> orders = orderService.selectorderNoL(orderNo); |
| | | List<Order> orders = OrderInAndOutUtil.selectOrderNoL(null, orderNo); |
| | | if (Cools.isEmpty(orders)){ |
| | | OrderPakin orderPakin = orderPakinService.selectByNo(orderNo); |
| | | if (orderPakin == null) { |
| | | return R.ok(); |
| | | } |
| | | LinkedList<CombParam> combParams = new LinkedList<>(); |
| | | if (!Cools.isEmpty(orders)){ |
| | | for (Order order:orders){ |
| | | CombParam combParam=new CombParam(); |
| | | if (order == null) { |
| | | continue; |
| | | } |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType.getPakin() == null || docType.getPakin() != 1) { |
| | | continue; |
| | | } |
| | | if (order.getSettle() > 2) { |
| | | continue; |
| | | } |
| | | // List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); |
| | | List<OrderDetl> orderDetls = OrderInAndOutUtil.selectWorkingDetls(order.getPakinPakoutStatus$(), order.getId()); |
| | | if (!Cools.isEmpty(orderDetls)) { |
| | | LinkedList<CombParam.CombMat> combMats = new LinkedList<>(); |
| | | for (OrderDetl orderDetl:orderDetls){ |
| | | CombParam.CombMat combMat = new CombParam.CombMat(); |
| | | combMat.setMatnr(orderDetl.getMatnr()); |
| | | combMat.setBatch(orderDetl.getBatch()); |
| | | combMat.setAnfme(orderDetl.getAnfme()-orderDetl.getWorkQty()); |
| | | combMat.setMaktx(orderDetl.getMaktx()); |
| | | combMat.setSpecs(orderDetl.getSpecs()); |
| | | combMats.add(combMat); |
| | | } |
| | | combParam.setCombMats(combMats); |
| | | } |
| | | combParam.setOrderNo(order.getOrderNo()); |
| | | combParams.add(combParam); |
| | | } |
| | | DocType docType = docTypeService.selectById(orderPakin.getDocType()); |
| | | if (docType.getPakin() != 1) { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(combParams); |
| | | |
| | | List<OrderDetlPakin> orderDetlPakins = orderPakinService.selectWorkingDetls(orderPakin.getId()); |
| | | if (Cools.isEmpty(orderDetlPakins)) { |
| | | return R.ok(); |
| | | } |
| | | List<OrderDetlPakin> orderDetls1= new ArrayList<>(); |
| | | for (OrderDetlPakin orderDetl : orderDetlPakins) { |
| | | if(orderDetl.getAnfme()-orderDetl.getWorkQty()>0){ |
| | | orderDetls1.add(orderDetl); |
| | | } |
| | | |
| | | } |
| | | return R.ok().add(orderDetls1); |
| | | } |
| | | |
| | | @RequestMapping("/order/search/orderNo/out/auth") |
| | | @ManagerAuth |
| | | public R orderSearchByBarcodeOut(@RequestParam String orderNo){ |
| | | OrderPakout orderPakout = orderPakoutService.selectByNo(orderNo); |
| | | if (orderPakout == null) { |
| | | return R.ok(); |
| | | } |
| | | DocType docType = docTypeService.selectById(orderPakout.getDocType()); |
| | | |
| | | List<OrderDetlPakout> orderDetlPakouts = orderPakoutService.selectWorkingDetls(orderPakout.getId()); |
| | | if (Cools.isEmpty(orderDetlPakouts)) { |
| | | return R.ok(); |
| | | } |
| | | List<OrderDetlPakout> orderDetls1= new ArrayList<>(); |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | if(orderDetl.getAnfme()-orderDetl.getWorkQty()>0){ |
| | | orderDetls1.add(orderDetl); |
| | | } |
| | | |
| | | } |
| | | return R.ok().add(orderDetls1); |
| | | } |
| | | |
| | | @RequestMapping("/comb/auth") |
| | |
| | | return mobileService.callEmptyBinOutBound(locNo,size,getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 空板回库或者拣料回库 |
| | | * |
| | | * @param sourceStaNo |
| | | * @param staNo |
| | | * @return |
| | | */ |
| | | @RequestMapping("/AGVStartReturn") |
| | | public synchronized R AGVStartReturn(@RequestParam(required = false) String sourceStaNo |
| | | , @RequestParam(required = false) String staNo |
| | | , @RequestParam(required = false) String taskNo) { |
| | | if (Cools.isEmpty(sourceStaNo) || Cools.isEmpty(staNo)) { |
| | | return R.error("源站点和托盘码不能为空"); |
| | | } |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("source_sta_no", sourceStaNo).eq("barcode", staNo)); |
| | | if (tasks.size() > 0) { |
| | | return R.error("该托盘="+staNo+"已经存在搬运任务,请不要重复下发"); |
| | | } |
| | | |
| | | String barcode = staNo.substring(0,1); |
| | | if(barcode.equals("3")){ |
| | | taskNo = "307"; |
| | | }else if(barcode.equals("4")){ |
| | | taskNo = "402"; |
| | | }else if(barcode.equals("5")){ |
| | | taskNo = "401"; |
| | | } |
| | | |
| | | R r = R.ok(); |
| | | //生成AGV搬运出库任务 |
| | | // 保存工作档 |
| | | Task task = new Task(); |
| | | Date date = new Date(); |
| | | String TaskNo = 555555 + "aa" + date.getTime(); |
| | | task.setWrkNo((int) date.getTime()) |
| | | .setTaskNo(TaskNo) |
| | | .setIoTime(date) |
| | | .setWrkSts(301L) // 工作状态:301.任务下发 |
| | | .setIoType(3) // 入出库状态: 3.站到站 4.站到区域 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setFullPlt("Y") // 满板:Y |
| | | .setPicking("N") // 拣料 |
| | | .setExitMk("N")// 退出 |
| | | .setStaNo(staNo) |
| | | .setSourceStaNo(taskNo)//agv取货站点 |
| | | .setEmptyMk("N")// 空板 |
| | | .setBarcode(staNo)// 托盘码 |
| | | .setLinkMis("N") |
| | | .setAppeUser(9945L) |
| | | .setAppeTime(date) |
| | | .setModiUser(9945L) |
| | | .setModiTime(date); |
| | | if (!taskService.insert(task)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | return r; |
| | | } |
| | | |
| | | @RequestMapping("/orderIn") |
| | | public synchronized R AGVOrderInReturn() { |
| | | List<OrderPakin> settle = orderPakinService.selectList(new EntityWrapper<OrderPakin>().in("settle", 1, 2)); |
| | | List<String> list = new ArrayList<>(); |
| | | for (OrderPakin orderPakin : settle) { |
| | | if (orderPakin.getSettle()==2){ |
| | | List<OrderDetlPakin> orderId = orderDetlPakinService.selectList(new EntityWrapper<OrderDetlPakin>().eq("order_id", orderPakin.getId())); |
| | | Boolean boo=true; |
| | | for (OrderDetlPakin orderDetlPakin : orderId) { |
| | | if (orderDetlPakin.getAnfme()>orderDetlPakin.getWorkQty()){ |
| | | boo=false; |
| | | break; |
| | | } |
| | | } |
| | | if (boo) { |
| | | settle.remove(orderPakin); |
| | | }else { |
| | | list.add(orderPakin.getOrderNo()); |
| | | } |
| | | }else { |
| | | list.add(orderPakin.getOrderNo()); |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @RequestMapping("/orderOut") |
| | | public synchronized R AGVOrderOutReturn() { |
| | | List<OrderPakout> settle = orderPakoutService.selectList(new EntityWrapper<OrderPakout>().in("settle", 1, 2).eq("doc_type",11)); |
| | | List<String> list = new ArrayList<>(); |
| | | for (OrderPakout orderPakout: settle) { |
| | | if (orderPakout.getSettle()==2){ |
| | | List<OrderDetlPakout> orderId = orderDetlPakoutService.selectList(new EntityWrapper<OrderDetlPakout>().eq("order_id", orderPakout.getId())); |
| | | Boolean boo=true; |
| | | for (OrderDetlPakout orderDetlPakout: orderId) { |
| | | if (orderDetlPakout.getAnfme()>orderDetlPakout.getWorkQty()){ |
| | | boo=false; |
| | | break; |
| | | } |
| | | } |
| | | if (boo) { |
| | | settle.remove(orderPakout); |
| | | }else { |
| | | list.add(orderPakout.getOrderNo()); |
| | | } |
| | | }else { |
| | | list.add(orderPakout.getOrderNo()); |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.common.model.LocDto; |
| | | import com.zy.common.model.TaskDto; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist, orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderPakOut.getDocType()==11?null:orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist, orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(), orderPakOut.getDocType() == 11 ? null : orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | return R.ok().add(locDtos); |
| | | } |
| | | |
| | | @Synchronized |
| | | @PostMapping("/out/pakout/auth") |
| | | @ManagerAuth(memo = "订单出库") |
| | | public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | public R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | if (Cools.isEmpty(locDtos)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<LocDto> locDtoArrayList = new ArrayList<>(); |
| | | for (LocDto locDto : locDtos){ |
| | | if (locDto.getFrozen()!=1 && locDto.getFrozenLoc()!=1){ |
| | | for (LocDto locDto : locDtos) { |
| | | if (locDto.getFrozen() != 1 && locDto.getFrozenLoc() != 1) { |
| | | locDtoArrayList.add(locDto); |
| | | } |
| | | } |
| | |
| | | List<TaskDto> taskDtos = new ArrayList<>(); |
| | | // 根据 (库位 & 出库站) 分组; 理想状态:一组为一次出库任务 |
| | | for (LocDto locDto : locDtos) { |
| | | if (locDto.isLack()) { continue; } |
| | | if (locDto.isLack()) { |
| | | continue; |
| | | } |
| | | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto); |
| | | if (TaskDto.has(taskDtos, taskDto)) { |
| | | TaskDto dto = TaskDto.find(taskDtos, taskDto); |
| | |
| | | //优先级 |
| | | int ioPri = 50; |
| | | //已下空板出库任务数量 |
| | | int j=1; |
| | | int j = 1; |
| | | // ----------------------------------------------------------------------------------------------- |
| | | for (TaskDto taskDto : taskDtos) { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); |
| | | workService.stockOut(staNo, taskDto, getUserId(),ioPri); |
| | | workService.stockOut(staNo, taskDto, getUserId(), ioPri); |
| | | ioPri--; |
| | | i++; |
| | | //配盘出库单使用,下发需要出的空板任务 |
| | | if (orderPakout.getDocType() == 11) { |
| | | if (i==size){ |
| | | for (;j<=orderPakout.getPayType();j++){ |
| | | String bar=""; |
| | | if (i == size) { |
| | | for (; j <= orderPakout.getPayType(); j++) { |
| | | LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", taskDto.getLocNo())); |
| | | Integer locType = Integer.valueOf(locMast1.getLocType2()); |
| | | //配盘 出库单出库区域时Q-L4时,出大托盘空板 |
| | | if(orderPakout.getCstmrName().equals("Q-L4")){ |
| | | locType = 2; |
| | | } |
| | | String bar = ""; |
| | | //具体待定 |
| | | // if(!Cools.isEmpty(orderPakout.getShipCode())&&orderPakout.getShipCode().equals("A01")){ |
| | | // bar = "A01"; |
| | | // } |
| | | LocMast locMast = new LocMast(); |
| | | if(Cools.isEmpty(bar)){ |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D")); |
| | | }else { |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").like("barcode", bar)); |
| | | LocMast locMast = new LocMast(); |
| | | if (Cools.isEmpty(bar)) { |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").eq("loc_type2", locType)); |
| | | } else { |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").eq("loc_type2", locType).like("barcode", bar)); |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast)) { |
| | |
| | | String locNo = locMast.getLocNo(); |
| | | EmptyPlateOutParam emptyPlateOutParam = new EmptyPlateOutParam(); |
| | | emptyPlateOutParam.setOutSite(303); |
| | | emptyPlateOutParam.setLocNos(new ArrayList<String>(){{add(locNo);}}); |
| | | emptyPlateOutParam.setLocNos(new ArrayList<String>() {{ |
| | | add(locNo); |
| | | }}); |
| | | String agvSta = ""; |
| | | if(locMast.getLocType3()==2){ |
| | | if (locMast.getLocType3() == 2) { |
| | | |
| | | }else { |
| | | } else { |
| | | agvSta = orderPakout.getCstmrName();//agv目标站点位置 |
| | | } |
| | | WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam,ioPri,agvSta); |
| | | WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam, ioPri, agvSta); |
| | | ioPri--; |
| | | |
| | | } |
| | | }else if(i == 4){ |
| | | String bar=""; |
| | | if(!Cools.isEmpty(orderPakout.getShipCode())&&orderPakout.getShipCode().equals("A01")){ |
| | | } else if (i == 4) { |
| | | LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", taskDto.getLocNo())); |
| | | Integer locType = Integer.valueOf(locMast1.getLocType2()); |
| | | //配盘 出库单出库区域时Q-L4时,出大托盘空板 |
| | | if(orderPakout.getCstmrName().equals("Q-L4")){ |
| | | locType = 2; |
| | | } |
| | | |
| | | String bar = ""; |
| | | if (!Cools.isEmpty(orderPakout.getShipCode()) && orderPakout.getShipCode().equals("A01")) { |
| | | bar = "A01"; |
| | | } |
| | | LocMast locMast = null; |
| | | if(Cools.isEmpty(bar)){ |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D")); |
| | | }else { |
| | | locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").like("barcode", bar)); |
| | | if (Cools.isEmpty(bar)) { |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").eq("loc_type2", locType)); |
| | | } else { |
| | | locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "D").eq("loc_type2", locType).like("barcode", bar)); |
| | | } |
| | | |
| | | if (Cools.isEmpty(locMast)) { |
| | |
| | | String locNo = locMast.getLocNo(); |
| | | EmptyPlateOutParam emptyPlateOutParam = new EmptyPlateOutParam(); |
| | | emptyPlateOutParam.setOutSite(303); |
| | | emptyPlateOutParam.setLocNos(new ArrayList<String>(){{add(locNo);}}); |
| | | emptyPlateOutParam.setLocNos(new ArrayList<String>() {{ |
| | | add(locNo); |
| | | }}); |
| | | String agvSta = ""; |
| | | if(locMast.getLocType3()==2){ |
| | | if (locMast.getLocType3() == 2) { |
| | | |
| | | }else { |
| | | } else { |
| | | agvSta = orderPakout.getCstmrName();//agv目标站点位置 |
| | | } |
| | | WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam,ioPri,agvSta); |
| | | WrkMast wrkMast = workService.emptyPlateOut(emptyPlateOutParam, ioPri, agvSta); |
| | | ioPri--; |
| | | j++; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/out/pakout/preview/auth1") |
| | | @ManagerAuth |
| | | public R pakoutPreview1(@RequestBody String orderNo) throws InterruptedException { |
| | | if (Cools.isEmpty(orderNo)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<OrderDetlPakout> orderDetlPakouts = orderDetlPakoutService.selectList(new EntityWrapper<OrderDetlPakout>().eq("order_no", orderNo)); |
| | | |
| | | if (orderDetlPakouts.size() == 0) { |
| | | return R.parse("订单明细为空"); |
| | | } |
| | | |
| | | List<LocDto> locDtos = new ArrayList<>(); |
| | | |
| | | Set<String> exist = new HashSet<>(); |
| | | |
| | | // 获取订单主表 |
| | | OrderPakout orderPakOut = orderPakOutService.selectByNo(orderDetlPakouts.get(0).getOrderNo()); |
| | | |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist, orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(), orderPakOut.getDocType() == 11 ? null : orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); |
| | | locDto.setFrozen(locDetl.getFrozen()); |
| | | locDto.setFrozenLoc(locMast.getFrozen()); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | locDto.setStaNos(staNos); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | |
| | | locDto.setStandby1(orderDetl.getStandby1()); |
| | | locDto.setStandby2(orderDetl.getStandby2()); |
| | | locDto.setStandby3(orderDetl.getStandby3()); |
| | | locDto.setBoxType1(orderDetl.getBoxType1()); |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDtos.add(locDto); |
| | | exist.add(locDetl.getLocNo()); |
| | | // 剩余待出数量递减 |
| | | issued = issued - locDetl.getAnfme(); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | locDto.setStandby1(orderDetl.getStandby1()); |
| | | locDto.setStandby2(orderDetl.getStandby2()); |
| | | locDto.setStandby3(orderDetl.getStandby3()); |
| | | locDto.setBoxType1(orderDetl.getBoxType1()); |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtos.add(locDto); |
| | | } |
| | | } |
| | | R pakout = pakout(locDtos); |
| | | return R.ok().add(pakout); |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField("frozen_memo") |
| | | private String frozenMemo; |
| | | |
| | | @ApiModelProperty(value= "拍照图片") |
| | | private String pic; |
| | | |
| | | |
| | | public String getWhsType$(){ |
| | | BasWhsTypeService service = SpringUtils.getBean(BasWhsTypeService.class); |
| | |
| | | @ApiModelProperty(value= "料架号") |
| | | private String packed; |
| | | |
| | | @ApiModelProperty(value= "下发AGV任务计数") |
| | | @TableField("ctn_type") |
| | | private Integer ctnType=0; |
| | | |
| | | /** |
| | | * 拣料 |
| | | */ |
| | |
| | | @ApiModelProperty(value= "工作时间") |
| | | @TableField("io_time") |
| | | private Date ioTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ctn_type") |
| | | private Integer ctnType; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ove_mk") |
| | |
| | | @TableField("task_no") |
| | | private String taskNo; |
| | | |
| | | @ApiModelProperty(value= "拍照图片") |
| | | private String pic; |
| | | |
| | | public WrkMast() {} |
| | | |
| | | public String getYmd$(){ |
| | |
| | | @TableField("take_none") |
| | | private String takeNone; |
| | | |
| | | @ApiModelProperty(value= "拍照图片") |
| | | private String pic; |
| | | |
| | | public WrkMastLog() { |
| | | } |
| | | |
| | |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.util.Date; |
| | | |
| | | // 数字孪生:按天订单数量 |
| | | @Data |
| | | @Builder |
| | | // DtOrderVo.java |
| | | public class DtOrderVo { |
| | | |
| | | // 日期 |
| | | private String orderDate; |
| | | // 订单数量 |
| | | private String orderDate; // 或 LocalDate |
| | | private Integer orderNum; |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity.digitaltwin; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class LocPicDto { |
| | | private String locNo; |
| | | |
| | | private List<String> pics; |
| | | |
| | | } |
| | |
| | | // 库位编号 |
| | | private String locNo; |
| | | |
| | | //agv原站点 |
| | | private String rsta; |
| | | |
| | | private List<CombMat> combMats; |
| | | |
| | | @Data |
| | |
| | | public class RcsTaskSubmit { |
| | | |
| | | // 任务类型,枚举值:TRANSPORT搬运。 |
| | | private String taskType = "TRANSPORT"; |
| | | private String taskType = "CS3"; |
| | | // 执行步骤集合。本次任务机器人需要执行的关键路径,序号0代表起点,序号1代表终点。 |
| | | private List<RcsTaskTargetRoute> targetRoute; |
| | | // 任务唯一编号,如果为空,系统生成任务号并返回。 |
| | |
| | | endTime = endDate.substring(0, 4) + "-" + endDate.substring(4, 6) + "-" + endDate.substring(6, 8) + "00:00:00"; |
| | | List<DtOrderVo> dbOrder = digitalTwinMapper.recentOrder(startTime, endTime); |
| | | // 空日期补全 |
| | | |
| | | for (DtOrderVo dtOrderVo : dbOrder) { |
| | | dtOrderVo.setOrderDate(dtOrderVo.getOrderDate()); |
| | | } |
| | | |
| | | return dbOrder; |
| | | } |
| | |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, orderNo); |
| | | OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId); |
| | | }); |
| | | if(!Cools.isEmpty(param.getLocNo())){ |
| | | if(!Cools.isEmpty(param.getRsta()) && param.getRsta().contains("-")){ |
| | | //生成AGV搬运任务 |
| | | //生成AGV搬运出库任务 |
| | | // 保存工作档 |
| | |
| | | Date date = new Date(); |
| | | String s = ""; |
| | | if (param.getBarcode().charAt(0) == '3'){ |
| | | s = "307"; |
| | | s = "Z-307"; |
| | | }else if (param.getBarcode().charAt(0) == '4'){ |
| | | s = "401"; |
| | | s = "Z-402"; |
| | | }else if (param.getBarcode().charAt(0) == '5'){ |
| | | s = "402"; |
| | | s = "Z-401"; |
| | | } |
| | | String TaskNo = param.getBarcode()+"-"+date.getTime(); |
| | | task.setWrkNo(Integer.getInteger(param.getBarcode())) |
| | | String TaskNo = param.getBarcode()+"aa"+date.getTime(); |
| | | task.setWrkNo((int) date.getTime()) |
| | | .setTaskNo(TaskNo) |
| | | .setIoTime(date) |
| | | .setWrkSts(301L) // 工作状态:301.任务下发 |
| | |
| | | .setPicking("N") // 拣料 |
| | | .setExitMk("N")// 退出 |
| | | .setStaNo(s) |
| | | .setSourceStaNo(param.getLocNo())//空料架缓存区E1 |
| | | .setSourceStaNo(param.getRsta())//agv取货位 |
| | | .setEmptyMk("N")// 空板 |
| | | .setBarcode(param.getBarcode())// 托盘码 |
| | | .setLinkMis("N") |
| | |
| | | //滑块库 |
| | | if(locMast.getLocType3()==1){ |
| | | if(locMast.getLocType2()==1){ |
| | | |
| | | |
| | | sta = "Z-402"; |
| | | }else if(locMast.getLocType2()==2){ |
| | | sta = "Z-401"; |
| | | } |
| | | }else if(locMast.getLocType3()==2){ |
| | | sta="307"; |
| | | sta="Z-307"; |
| | | } |
| | | |
| | | // 获取路径 |
| | |
| | | orderDetl.setCreateBy(order.getCreateBy()); |
| | | orderDetl.setUpdateTime(order.getUpdateTime()); |
| | | orderDetl.setUpdateBy(order.getUpdateBy()); |
| | | orderDetl.setBarcode(wrkDetl.getZpallet()); |
| | | if (!orderDetlPakinService.insert(orderDetl)) { |
| | | throw new CoolException("重整出库订单【orderNo = " + order.getOrderNo() + "】明细失败"); |
| | | } |
| | |
| | | RcsReturn rcsReturn = JSONObject.parseObject(response, RcsReturn.class); |
| | | if("SUCCESS".equals(rcsReturn.getCode())||"200".equals(rcsReturn.getCode())) { |
| | | JSONObject data = rcsReturn.getData(); |
| | | String robotTaskCode = data.getString("RobotTaskCode"); |
| | | String robotTaskCode = data.getString("robotTaskCode"); |
| | | if (robotTaskCode.equals(rcsTaskSubmit.getRobotTaskCode())){ |
| | | return 1; |
| | | } |
| | |
| | | |
| | | String robotTaskCode = rcsReporterTask.getRobotTaskCode(); |
| | | String singleRobotCode = rcsReporterTask.getSingleRobotCode(); |
| | | String[] split = robotTaskCode.split("-"); |
| | | robotTaskCode = split[0]; |
| | | //华晓AGV状态反馈,及申请 |
| | | if(Cools.isEmpty(rcsReporterTask.getExtra())){ |
| | | if(Cools.isEmpty(rcsReporterTask.getMethod())){ |
| | |
| | | // 保存工作档 |
| | | Task task = new Task(); |
| | | Date date = new Date(); |
| | | String TaskNo = wrkMast.getWrkNo() + "-" + date.getTime(); |
| | | String TaskNo = wrkMast.getWrkNo() + "aa" + date.getTime(); |
| | | task.setWrkNo(wrkMast.getWrkNo()) |
| | | .setTaskNo(TaskNo) |
| | | .setIoTime(date) |
| | |
| | | .setFullPlt("Y") // 满板:Y |
| | | .setPicking("N") // 拣料 |
| | | .setExitMk("N")// 退出 |
| | | .setStaNo(stnNo) |
| | | .setSourceStaNo(wrkMast.getSourceStaNo())//空料架缓存区E1 |
| | | .setStaNo(wrkMast.getMemo()) |
| | | .setSourceStaNo("Z-"+wrkMast.getSourceStaNo()) |
| | | .setEmptyMk("N")// 空板 |
| | | .setBarcode(wrkMast.getBarcode())// 托盘码 |
| | | .setLinkMis("N") |
| | |
| | | //如果是接驳站点则需要判断接驳站点是否有空料架 |
| | | //如果有空料架需要判断是否有出库任务 |
| | | //有出库任务则禁止下发本次搬运任务 |
| | | if (task.getStaNo().equals("401") || task.getStaNo().equals("402") || task.getStaNo().equals("307")) { |
| | | if (task.getStaNo().equals("Z-401") || task.getStaNo().equals("Z-402") || task.getStaNo().equals("Z-307")) { |
| | | BasDevp basDevp = basDevpService.checkSiteStatus(Integer.parseInt(task.getStaNo())); |
| | | if (basDevp != null && !Cools.isEmpty(basDevp.getInreq1()) && basDevp.getInreq1().equals("Y")) { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | |
| | | //生成AGV搬运出库任务 |
| | | // 保存工作档 |
| | | String SourceStaNo = ""; |
| | | if (task.getStaNo().equals("401")) { |
| | | if (task.getStaNo().equals("Z-401")) { |
| | | //大料架缓冲区 |
| | | SourceStaNo = "E3"; |
| | | }else if (task.getStaNo().equals("402")) { |
| | | SourceStaNo = "E2"; |
| | | }else if (task.getStaNo().equals("307")) { |
| | | SourceStaNo = "E1"; |
| | | SourceStaNo = "Q-E3"; |
| | | }else if (task.getStaNo().equals("Z-402")) { |
| | | SourceStaNo = "Q-E2"; |
| | | }else if (task.getStaNo().equals("Z-307")) { |
| | | SourceStaNo = "Q-E1"; |
| | | } |
| | | Task task3 = new Task(); |
| | | Date date = new Date(); |
| | |
| | | if (!start.isSuccess()) { |
| | | task.setUpdMk("X"); |
| | | task.setErrorMemo(start.getMsg()); |
| | | task.setCtnType(task.getCtnType()+1);//下发任务计数 |
| | | task.setModiTime(new Date()); |
| | | if (!taskService.updateById(task)) { |
| | | log.error("工作档[workNo={}]标记待处理失败", task.getWrkNo()); |
| | | } |
| | | }else { |
| | | task.setCtnType(task.getCtnType()+1); |
| | | task.setModiTime(new Date()); |
| | | task.setWrkSts(302L);//任务执行中 |
| | | if (!taskService.updateById(task)) { |
| | | log.error("工作档[workNo={}]标记待处理失败", task.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | void otherInOrderCompleteReport() { |
| | | String erpReport = Parameter.get().getErpReport(); |
| | | if (!Cools.isEmpty(erpReport) && erpReport.equals("true")) { |
| | | OrderPakin orderPakin = orderPakinService.selectOne(new EntityWrapper<OrderPakin>().eq("settle", 4) |
| | | OrderPakin orderPakin = orderPakinService.selectOne(new EntityWrapper<OrderPakin>().ne("doc_type",1).eq("settle", 4) |
| | | .ne("doc_type", 1).orderBy("update_time")); |
| | | if (orderPakin == null) { |
| | | return; |
| | |
| | | }else if(task.getIoType()==5){ |
| | | SourceStaNoType = "ZONE"; |
| | | } |
| | | String taskType = "CS3"; |
| | | Boolean flag1 = false; |
| | | Boolean flag2 = false; |
| | | if(task.getStaNo().equals("Z-401")|| task.getStaNo().equals("Z-402")|| task.getStaNo().equals("Z-307")){ |
| | | taskType = "YLIN"; |
| | | flag1 = true; |
| | | } |
| | | if (task.getSourceStaNo().equals("Z-401")|| task.getSourceStaNo().equals("Z-402")|| task.getSourceStaNo().equals("Z-307")){ |
| | | taskType = "YLOUT"; |
| | | flag2 = true; |
| | | } |
| | | if(flag1&&flag2){ |
| | | taskType = "YLBOTH"; |
| | | } |
| | | //AGV区域中无法用- |
| | | String StaNo = task.getStaNo(); |
| | | String SourceStaNo = task.getSourceStaNo(); |
| | | if (task.getStaNo().split("-")[0].equals("Q")) { |
| | | String[] split = task.getStaNo().split("-"); |
| | | StaNo = split[0]+split[1]; |
| | | } |
| | | if (task.getSourceStaNo().split("-")[0].equals("Q")) { |
| | | String[] split = task.getStaNo().split("-"); |
| | | SourceStaNo = split[0]+split[1]; |
| | | } |
| | | |
| | | // 下发给RCS |
| | | RcsTaskSubmit rcsTaskSubmit = new RcsTaskSubmit(); |
| | | rcsTaskSubmit.setRobotTaskCode(task.getTaskNo()); |
| | | rcsTaskSubmit.setTaskType(taskType); |
| | | rcsTaskSubmit.setRobotTaskCode(task.getTaskNo()+"-"+task.getCtnType()); |
| | | rcsTaskSubmit.setInitPriority(10); //默认10 |
| | | List<RcsTaskTargetRoute> targetRouteList = new ArrayList<>(); |
| | | RcsTaskTargetRoute startRoute = new RcsTaskTargetRoute(); |
| | | startRoute.setSeq(0); |
| | | startRoute.setType(SourceStaNoType); |
| | | startRoute.setCode(task.getSourceStaNo()); |
| | | startRoute.setCode(SourceStaNo); |
| | | startRoute.setOperation("COLLECT"); |
| | | targetRouteList.add(startRoute); |
| | | RcsTaskTargetRoute endRoute = new RcsTaskTargetRoute(); |
| | | endRoute.setSeq(1); |
| | | endRoute.setType(TargetStaNoType); |
| | | endRoute.setCode(task.getStaNo()); |
| | | endRoute.setCode(StaNo); |
| | | endRoute.setOperation("DELIVERY"); |
| | | targetRouteList.add(endRoute); |
| | | rcsTaskSubmit.setTargetRoute(targetRouteList); |
| | |
| | | locMast.setLocSts("D"); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setPic(wrkMast.getPic()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("空板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setPic(wrkMast.getPic()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("全板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setPic(wrkMast.getPic()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("拣料入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setPic(wrkMast.getPic()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("并板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setPic(wrkMast.getPic()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("盘点入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | } |
| | | } |
| | | // 修改源库位状态 ==> O |
| | | String picUrl = ""; |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (null != sourceLoc) { |
| | | picUrl = sourceLoc.getPic(); |
| | | sourceLoc.setBarcode(""); |
| | | sourceLoc.setLocSts("O"); |
| | | sourceLoc.setModiTime(now); |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setPic(picUrl); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("库位移转 ===>> 修改目标库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | if (Cools.isEmpty(matnr)) { |
| | | return null; |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | for (DetlDto detlDto : detlDtos) {//&& standby1.equals(detlDto.getStandby1()) |
| | | if (matnr.equals(detlDto.getMatnr()) && Cools.eq(batch, detlDto.getBatch()) |
| | | && brand.equals(detlDto.getBrand()) && standby1.equals(detlDto.getStandby1()) |
| | | && brand.equals(detlDto.getBrand()) |
| | | && standby2.equals(detlDto.getStandby2()) && standby3.equals(detlDto.getStandby3()) |
| | | && boxType1.equals(detlDto.getBoxType1()) && boxType2.equals(detlDto.getBoxType2()) |
| | | && boxType3.equals(detlDto.getBoxType3())) { |
| | |
| | | // 汇总不考虑序列码 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | for (LocDto locDto : this.getLocDtos()) { |
| | | DetlDto dto = new DetlDto(locDto.getMatnr(), locDto.getBatch(),locDto.getBrand(),locDto.getStandby1(),locDto.getStandby2(),locDto.getStandby3(),locDto.getBoxType1(),locDto.getBoxType2(),locDto.getBoxType3(), locDto.getAnfme()); |
| | | DetlDto dto = new DetlDto(locDto.getMatnr(), locDto.getBatch(),locDto.getBrand(),null,locDto.getStandby2(),locDto.getStandby3(),locDto.getBoxType1(),locDto.getBoxType2(),locDto.getBoxType3(), locDto.getAnfme()); |
| | | if (DetlDto.has(detlDtos, dto)) { |
| | | DetlDto detlDto = DetlDto.find(detlDtos, locDto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3()); |
| | | DetlDto detlDto = DetlDto.find(detlDtos, locDto.getMatnr(), dto.getBatch(),dto.getBrand(),null,dto.getStandby2(),dto.getStandby3(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + locDto.getAnfme()); |
| | | } else { |
| | | detlDtos.add(new DetlDto(locDto.getMatnr(), locDto.getBatch() |
| | | ,locDto.getBrand(),locDto.getStandby1(),locDto.getStandby2(),locDto.getStandby3(),locDto.getBoxType1(),locDto.getBoxType2(),locDto.getBoxType3() |
| | | ,locDto.getBrand(),null,locDto.getStandby2(),locDto.getStandby3(),locDto.getBoxType1(),locDto.getBoxType2(),locDto.getBoxType3() |
| | | , locDto.getAnfme())); |
| | | } |
| | | } |
| | |
| | | #托盘物料号 |
| | | zpalletId: tuopan |
| | | |
| | | wcs: |
| | | url: 127.0.0.1:9094/wcs |
| | | |
| | | #mes对接 |
| | | mes: |
| | | |
| | |
| | | #海康对接 |
| | | hik: |
| | | switch: true |
| | | url: http://172.26.11.98:80/ |
| | | url: http://172.26.11.98:80/rcs/rtas/ |
| | | |
| | | #华晓对接 |
| | | hx: |
| | |
| | | <result column="ctn_no" property="ctnNo" /> |
| | | <result column="frozen" property="frozen" /> |
| | | <result column="frozen_memo" property="frozenMemo" /> |
| | | <result column="pic" property="pic" /> |
| | | </resultMap> |
| | | |
| | | <select id="queryFreeLocMast" resultMap="BaseResultMap"> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.DigitalTwinMapper"> |
| | | |
| | | <resultMap id="dtOrderMap" type="com.zy.asrs.entity.digitaltwin.DtOrderVo"> |
| | | <constructor> |
| | | <arg column="orderDate" javaType="java.util.Date"/> |
| | | <arg column="orderNum" javaType="java.lang.Integer"/> |
| | | </constructor> |
| | | </resultMap> |
| | | |
| | | <!--总览:总库位、已用库位、今日库存、今日出库、今日入库--> |
| | | <select id="overview" resultType="Double"> |
| | | SELECT COUNT(*) FROM asr_loc_mast WHERE loc_sts != 'Z' |
| | |
| | | </select> |
| | | |
| | | <select id="recentOrder" resultType="com.zy.asrs.entity.digitaltwin.DtOrderVo"> |
| | | SELECT CONVERT(VARCHAR, order_time, 23) as orderDate, COUNT(*) AS orderNum |
| | | FROM man_order |
| | | |
| | | SELECT |
| | | FORMAT(orderDate, 'yyyyMMdd') as orderDate, |
| | | COUNT(*) as orderNum |
| | | FROM ( |
| | | SELECT |
| | | CAST(order_time AS DATE) as orderDate |
| | | FROM man_order_pakin |
| | | WHERE order_time BETWEEN #{startTime} AND #{endTime} |
| | | GROUP BY CONVERT(VARCHAR, order_time, 23) |
| | | |
| | | UNION ALL |
| | | |
| | | SELECT |
| | | CAST(order_time AS DATE) as orderDate |
| | | FROM man_order_pakout |
| | | WHERE order_time BETWEEN #{startTime} AND #{endTime} |
| | | ) combined |
| | | GROUP BY orderDate |
| | | ORDER BY orderDate |
| | | |
| | | </select> |
| | | |
| | | <select id="recentInBound" resultType="com.zy.asrs.entity.digitaltwin.DtInAndOutBoundVo"> |
| | |
| | | <result column="full_plt" property="fullPlt" /> |
| | | <result column="pre_have" property="preHave" /> |
| | | <result column="take_none" property="takeNone" /> |
| | | <result column="pic" property="pic" /> |
| | | </resultMap> |
| | | <sql id="queryWhere"> |
| | | <where> |
| | |
| | | <result column="full_plt" property="fullPlt" /> |
| | | <result column="pre_have" property="preHave" /> |
| | | <result column="take_none" property="takeNone" /> |
| | | <result column="pic" property="pic" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectToBeCompleteData" resultMap="BaseResultMap"> |
| | |
| | | ,{field: 'locType3$', align: 'center',title: '轻重类型', hide:true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', width: 180, hide:false} |
| | | ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate'} |
| | | ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 180} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | } |
| | | locDetlToLayer(data.locNo); |
| | | break; |
| | | case 'showPic': |
| | | let imgHtml = '<div style="height:100%;display: flex;justify-content: space-around;align-items: center;flex-wrap: wrap;">'; |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/picUrl", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | locNo: data.locNo |
| | | }, |
| | | method: 'GET', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | res.data.forEach((item) => { |
| | | let locNo = item.locNo; |
| | | let pics = item.pics; |
| | | pics.forEach((pic) => { |
| | | let tmp = '<div><div><img width="600" src="' + pic + '" /></div><div>' + locNo + '</div></div>'; |
| | | imgHtml += tmp; |
| | | }) |
| | | }) |
| | | imgHtml += "</div>"; |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | title: '查看图片', |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: imgHtml, |
| | | success: function(layero, index){ |
| | | } |
| | | }); |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-xs loc-detl" lay-event="locDetl">查看明细</a> |
| | | <a class="layui-btn layui-btn-xs loc-detl" lay-event="showPic">查看图片</a> |
| | | </script> |
| | | |
| | | <!--明细表--> |