| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.CheckObjParams; |
| | | import com.vincent.rsf.server.api.controller.params.OpStockParams; |
| | | import com.vincent.rsf.server.api.controller.params.OtherReceiptParams; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.entity.dto.CheckObjDto; |
| | |
| | | import com.vincent.rsf.server.system.service.FieldsService; |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.tika.utils.StringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @Autowired |
| | | private FieldsItemService fieldsItemService; |
| | | |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | */ |
| | | @Override |
| | | public R getOrderByCode(String barcode) { |
| | | if (StringUtils.isEmpty(barcode)) { |
| | | if (StringUtils.isBlank(barcode)) { |
| | | return R.error("标签码不能为空!!"); |
| | | } |
| | | List<AsnOrderItem> asnOrderItem = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getTrackCode, barcode)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 人工上架 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/2 16:33 |
| | | */ |
| | | @Override |
| | | public R operateToStock(OpStockParams params) { |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(params.getBarcode())) { |
| | | throw new CoolException("拖盘码不能为空!!"); |
| | | } |
| | | if (StringUtils.isBlank(params.getAsnCode())) { |
| | | throw new CoolException("单据不能为空!!"); |
| | | } |
| | | if (StringUtils.isBlank(params.getMatnrCode())) { |
| | | 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("拖盘已使用!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, asnOrders.getId()) |
| | | .eq(AsnOrderItem::getMatnrCode, params.getMatnrCode())); |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | List<AsnOrderItem> stocks = new ArrayList<>(); |
| | | orderItems.forEach(item -> { |
| | | item.setBarcode(params.getBarcode()); |
| | | stocks.add(item); |
| | | }); |
| | | return R.ok(stocks); |
| | | } |
| | | |
| | | /** |
| | | * 获取ReceiptDetlsDtos |
| | | */ |
| | | private R getAsnOrderItem(List<AsnOrderItem> items) { |