chenhj
3 天以前 770361cf5d70c7893ffea4f1dacac297628aea1d
main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java
@@ -16,6 +16,7 @@
import com.ruoyi.business.mapper.PurchaseRegistrationMapper;
import com.ruoyi.business.service.PurchaseRegistrationService;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -49,6 +50,13 @@
    @Override
    public IPage<PurchaseRegistration> selectPurchaseRegistrationList(Page page, PurchaseRegistrationDto purchaseRegistrationDto) {
        LambdaQueryWrapper<PurchaseRegistration> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(purchaseRegistrationDto.getSearchAll())){
            queryWrapper.and(wrapper -> wrapper
                    .like(PurchaseRegistration::getCoal, purchaseRegistrationDto.getSearchAll())
                    .or()
                    .like(PurchaseRegistration::getSupplierName, purchaseRegistrationDto.getSearchAll())
            );
        }
        queryWrapper.orderByDesc(PurchaseRegistration::getCreateTime);
        return purchaseRegistrationMapper.selectPage(page, queryWrapper);
    }
@@ -80,7 +88,6 @@
                // 采购登记成功,同步创建待入库记录
                PendingInventory pendingInventory = createPendingInventory(purchaseRegistration);
                pendingInventory.setSupplierName(supply.getSupplierName());
                pendingInventory.setCoal(coalInfo.getCoal());
                return pendingInventoryMapper.insert(pendingInventory);
            }
            return insertCount;