From d75958896efd4c8a6daee9c56d048641b99cacf6 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 24 六月 2025 17:54:50 +0800
Subject: [PATCH] 1.二维码巡检记录以及文件上传记录 2.部分优化
---
main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java b/main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java
index ff4252d..51c2d14 100644
--- a/main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java
+++ b/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::getCoalId, purchaseRegistrationDto.getSearchAll())
+ .or()
+ .like(PurchaseRegistration::getSupplierName, purchaseRegistrationDto.getSearchAll())
+ );
+ }
queryWrapper.orderByDesc(PurchaseRegistration::getCreateTime);
return purchaseRegistrationMapper.selectPage(page, queryWrapper);
}
@@ -66,7 +74,7 @@
if (coalInfo == null) {
throw new BaseException("鐓ょ淇℃伅涓嶅瓨鍦�");
}
- purchaseRegistration.setCoal(coalInfo.getCoal());
+// purchaseRegistration.setCoal(coalInfo.getCoal());
Supply supply = supplyMapper.selectById(purchaseRegistrationDto.getSupplierId());
if (supply == null) {
throw new BaseException("渚涘簲鍟嗕俊鎭笉瀛樺湪");
@@ -80,7 +88,6 @@
// 閲囪喘鐧昏鎴愬姛锛屽悓姝ュ垱寤哄緟鍏ュ簱璁板綍
PendingInventory pendingInventory = createPendingInventory(purchaseRegistration);
pendingInventory.setSupplierName(supply.getSupplierName());
- pendingInventory.setCoal(coalInfo.getCoal());
return pendingInventoryMapper.insert(pendingInventory);
}
return insertCount;
@@ -102,6 +109,7 @@
BeanUtils.copyProperties(purchaseRegistration, pendingInventory);
// 璁剧疆寰呭叆搴撹褰曠壒鏈夌殑灞炴�э紙濡傛灉鏈夛級
+ pendingInventory.setCoalId(purchaseRegistration.getCoalId());
pendingInventory.setInventoryQuantity(purchaseRegistration.getPurchaseQuantity());
return pendingInventory;
}
--
Gitblit v1.9.3