| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | |
| | | .setId(isptItem.getId()) |
| | | .setMatnrCode(isptItem.getMatnrCode()) |
| | | .setMaktx(isptItem.getMaktx()) |
| | | .setDisQty(isptItem.getDisQty()) |
| | | // .setDisQty(isptItem.getDisQty()) |
| | | .setDlyQty(isptItem.getDlyQty()) |
| | | .setRcptQty(isptItem.getRcptQty()) |
| | | .setIsptResult(isptItem.getIsptResult()) |
| | | .setSplrBatch(isptItem.getSplrBatch()) |
| | | .setSplrName(isptItem.getSplrName()) |
| | | .setPicPath(isptItem.getPicPath()) |
| | | .setMemo(isptItem.getMemo()) |
| | | .setSafeQty(isptItem.getSafeQty()); |
| | | .setMemo(isptItem.getMemo()); |
| | | // .setSafeQty(isptItem.getSafeQty()); |
| | | dtos.add(objDto); |
| | | }); |
| | | return R.ok(dtos); |
| | |
| | | * 快速质检 |
| | | * |
| | | * @param params |
| | | * @param loginUserId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R checkUpdate(List<QlyIsptItem> params) { |
| | | public R checkUpdate(List<QlyIsptItem> params, Long loginUserId) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | IsptItemsParams itemsParams = new IsptItemsParams(); |
| | | itemsParams.setIsptItem(params).setType("0"); |
| | | if (qlyIsptItemService.batchUpdate(itemsParams)) { |
| | | if (qlyIsptItemService.batchUpdate(itemsParams, loginUserId)) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.error("保存失败!!"); |
| | |
| | | @Override |
| | | public R operateToStock(OpStockParams params) { |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(params.getBarcode())) { |
| | | throw new CoolException("拖盘码不能为空!!"); |
| | | throw new CoolException("托盘码不能为空!!"); |
| | | } |
| | | if (StringUtils.isBlank(params.getAsnCode())) { |
| | | throw new CoolException("单据不能为空!!"); |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.getBarcode()) |
| | | .eq(WaitPakin::getIoStatus,PakinIOStatus.PAKIN_IO_STATUS_DONE.val) |
| | | ); |
| | | if (Cools.isEmpty(waitPakin)){ |
| | | throw new CoolException("未找到组托数据,请检查状态"); |
| | | } |
| | | if (StringUtils.isBlank(params.getMatnrCode())) { |
| | | throw new CoolException("物料编码不能为空!!"); |
| | | List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin.getId())); |
| | | if (Cools.isEmpty(waitPakinItems)){ |
| | | throw new CoolException("数据错误,未找到组托明细"); |
| | | } |
| | | AsnOrder asnOrders = asnOrderMapper.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getCode, params.getAsnCode())); |
| | | if (Objects.isNull(asnOrders)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, params.getBarcode())); |
| | | if (!locs.isEmpty()) { |
| | | throw new CoolException("拖盘已使用"); |
| | | } |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, params.getBarcode())); |
| | | if (!waitPakins.isEmpty()) { |
| | | throw new CoolException("拖盘已使用!!"); |
| | | } |
| | | AsnOrderItem orderItems = asnOrderItemMapper.selectOne(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, asnOrders.getId()) |
| | | .eq(AsnOrderItem::getMatnrCode, params.getMatnrCode())); |
| | | if (Objects.isNull(orderItems)) { |
| | | return R.ok(null); |
| | | } |
| | | orderItems.setBarcode(params.getBarcode()); |
| | | |
| | | return R.ok(orderItems); |
| | | |
| | | return R.ok(waitPakinItems); |
| | | } |
| | | |
| | | /** |