| | |
| | | if (Objects.isNull(container)) { |
| | | throw new CoolException("数据错误:容器码不存在!!"); |
| | | } |
| | | // if (param.getBarcode().length() != 8) { |
| | | // throw new CoolException("条码长度不是8位===>>" + param.getBarcode()); |
| | | // } |
| | | |
| | | if (Objects.isNull(param.getType())) { |
| | | param.setType("0"); |
| | |
| | | OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>() |
| | | .eq("order_id", order.getId()) |
| | | .eq("matnr", elem.getMatnr())); |
| | | |
| | | if (Objects.isNull(elem.getBoxType1())) { |
| | | throw new CoolException("格层编码不能为空!!"); |
| | | } |
| | | detls.setBoxType1(elem.getBoxType1()); |
| | | if (Objects.isNull(detls)) { |
| | | throw new CoolException("数据错误:单据明细不存在!!"); |
| | | } |
| | |
| | | } |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(), |
| | | elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | "1", elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(order.getOrderNo(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), |
| | | elem.getStandby2(), elem.getStandby3(), |
| | | elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme(), |
| | |
| | | waitPakin.setThreeCode(detlDto.getThreeCode()); |
| | | waitPakin.setSuppCode(detlDto.getStandby1()); |
| | | waitPakin.setStandby1(detlDto.getStandby1()); |
| | | waitPakin.setBoxType1(detlDto.getBoxType1()); |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAnfme(detlDto.getAnfme()); // 数量 |
| | | waitPakin.setStatus("Y"); // 状态 |
| | |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PACK_DOWN_URL) |
| | | .setPath(MesConstant.IN_DISPATCH_RESULT) |
| | | .setJson(JSON.toJSONString(mesCombParam)) |
| | | .build() |
| | | .doPost(); |
| | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | } else if (jsonObject.getInteger("code").equals(500)) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException(jsonObject.getString("msg")); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "打包下线帮托上报", |
| | | MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | MesConstant.URL + MesConstant.IN_DISPATCH_RESULT, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(mesCombParam), |
| | |
| | | // } |
| | | OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(), |
| | | detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3(), |
| | | detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme()); |
| | | "1", detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme()); |
| | | // 保存入库通知档 |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl, |
| | | Double curOutQty, Integer ioType, Long userId, Date now) { |
| | | Double curOutQty, Integer ioType, Long userId, Date now) { |
| | | // 获取库位 |
| | | LocMast locMast = locMastService.selectById(locDetl.getLocNo()); |
| | | // 获取路径 |
| | |
| | | |
| | | /** |
| | | * SO/EO 区组托 |
| | | * @author Ryan |
| | | * @date 2025/12/18 15:19 |
| | | * |
| | | * @param params |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/12/18 15:19 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | if (!basStationDetlService.insert(basStationDetl)) { |
| | | throw new CoolException("插入明细失败"); |
| | | } |
| | | |
| | | } else { |
| | | BigDecimal anfme = new BigDecimal(basStationDetl.getAnfme().toString()).add(combMat.getWorkQty()); |
| | | basStationDetl.setAnfme(anfme.doubleValue()); |
| | |
| | | && wrkMast.getIoType().equals(TaskIOType.PICK_OUT.type)) { |
| | | throw new CoolException("人物类型错误"); |
| | | } |
| | | |
| | | wrkDetlService.selectList(new EntityWrapper<WrkDetl>() |
| | | .eq(!Objects.isNull(params.getMatnr()), "matnr", params.getMatnr()) |
| | | .eq("wrk_no", wrkMast.getWrkNo())); |
| | | |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | if (Cools.isEmpty(wrkDetls)) { |
| | |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | // // 更新入库通知档 ioStatus ===>> Y |
| | |
| | | WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no", locMast.getLocNo())); |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType)); |
| | | if (Cools.isEmpty(wrkMast1)){ |
| | | if (Cools.isEmpty(wrkMast1)) { |
| | | Integer outSta = devp.getDevNo(); |
| | | // 获取路径 |
| | | StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta); |
| | |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:" + locMast.getLocNo()); |
| | | } |
| | | }else { |
| | | } else { |
| | | workNo = wrkMast1.getWrkNo(); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetl detlDto : crnTaskDetlDTO.getLocDetlList()) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | BeanUtils.copyProperties(detlDto, wrkDetl); |
| | | wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setZpallet(null); |
| | |
| | | |
| | | /** |
| | | * 呼叫AGV空台车返回 |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | * |
| | | * @param callAgvBackParam |
| | | * @return com.core.common.R |
| | | * @author Ryan |
| | | * @date 2025/9/24 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | // 按当前查找库位顺序,查到一个后,不再往下查询 |
| | | LocCache locCache = findPriorityLocCache(); |
| | | |
| | | |
| | | if (Objects.isNull(locCache)) { |
| | | return R.error("未查询到可用库位"); |
| | | } |