| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public String pickAgain(PickParam pickParams, Long userId) { |
| | | public synchronized String pickAgain(PickParam pickParams, Long userId) { |
| | | Date now = new Date(); |
| | | List<AgvLocDetl> agvLocDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no", pickParams.getLocNo())); |
| | | |
| | |
| | | } |
| | | for (PickParam.Pick pick : pickParams.getPicks()) { |
| | | if (pick.getCount().equals(0D)) continue; |
| | | |
| | | Double count = 0.0D; |
| | | AgvWrkDetl agvWrkDetl = agvWrkDetlService.selectOne(new EntityWrapper<AgvWrkDetl>().eq("matnr", pick.getMatnr()).eq("three_code", pick.getThreeCode()).eq("supp_code",pick.getSuppCode())); |
| | | |
| | |
| | | agvWrkDetlService.update(agvWrkDetl,new EntityWrapper<AgvWrkDetl>().eq("matnr",agvWrkDetl.getMatnr()).eq("three_code",agvWrkDetl.getThreeCode()).eq("supp_code",pick.getSuppCode())); |
| | | |
| | | } |
| | | |
| | | // 库存校验 |
| | | Optional<AgvLocDetl> first = agvLocDetls.stream().filter(agvLocDetl -> agvLocDetl.getThreeCode().equals(pick.getThreeCode())) |
| | | .filter(agvLocDetl -> agvLocDetl.getMatnr().equals(pick.getMatnr())).findFirst(); |
| | | if (first.isPresent()) { |
| | | AgvLocDetl agvLocDetl = first.get(); |
| | | if (agvLocDetl.getAnfme() < agvWrkDetl.getAnfme()) { |
| | | throw new CoolException("拣料数量不能大于库存数量"); |
| | | } |
| | | } |
| | | |
| | | // 更新订单 |
| | | OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no", pick.getOrderNo()).eq("matnr", pick.getMatnr()).eq("three_code",pick.getThreeCode())); |
| | |
| | | syncWaitPakin(detlDto,"",param.getBarcode(),userId,now); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | /* |
| | |
| | | agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",oldWrkNo)); |
| | | return "ok"; |
| | | } |
| | | |
| | | /* |
| | | 调拨进场 |
| | | */ |
| | |
| | | //删除AGV工作档 |
| | | return "ok"; |
| | | } |
| | | |
| | | /* |
| | | 空架离场 |
| | | */ |
| | |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"O","",agvWrkMast.getWhsType().shortValue()); |
| | | return "ok"; |
| | | } |
| | | |
| | | /* |
| | | 空架进场 |
| | | */ |
| | |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",param.getBarcode(),agvWrkMast.getWhsType().shortValue()); |
| | | return "ok"; |
| | | } |
| | | |
| | | /* |
| | | * 转手动回流 |
| | | */ |
| | |
| | | agvWrkMast.setIoTime(now); |
| | | |
| | | |
| | | |
| | | if (!agvWrkMastService.update(agvWrkMast,new EntityWrapper<AgvWrkMast>().eq("wrk_no",agvWrkMast.getWrkNo()))) { |
| | | throw new CoolException("更新工作档失败"); |
| | | } |
| | |
| | | }); |
| | | return "ok"; |
| | | } |
| | | |
| | | |
| | | |
| | | /* |
| | |
| | | agvWrkDetlService.delete(new EntityWrapper<AgvWrkDetl>().eq("wrk_no",oldWrkNo)); |
| | | return "ok"; |
| | | } |
| | | |
| | | /* |
| | | 更新目标库位信息 |
| | | */ |