| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.PakinItem; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private LocService locService; |
| | | |
| | | /** |
| | | * @param |
| | | * @param userId |
| | | * @return |
| | | * @author Ryan |
| | | * @description 组拖 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 14:42 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin) { |
| | | if (waitPakin.getItems().isEmpty()) { |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId) { |
| | | if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) { |
| | | throw new CoolException("参数错误:物料跟踪码为空!"); |
| | | } |
| | | if (StringUtils.isBlank(waitPakin.getBarcode())) { |
| | |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setMatnrId(item.getMatnrId()) |
| | | .setMaktx(item.getMaktx()) |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme() && waitPakinItem.getReceiptQty().compareTo(0.0) >= 0) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem.setAnfme(waitPakinItem.getReceiptQty()).setTrackCode(waitPakinItem.getTrackCode()); |
| | |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setMatnrId(item.getMatnrId()) |
| | | .setMaktx(item.getMaktx()) |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme() && waitPakinItem.getReceiptQty().compareTo(0.0) >= 0) { |
| | | throw new CoolException("组拖数量不能大于收货数量且不能小于零!!"); |
| | | } |
| | | pakinItem.setAnfme(waitPakinItem.getReceiptQty()).setTrackCode(waitPakinItem.getTrackCode()); |
| | | } |