From 8876b1b9cd27fad076ea9e5f3e04197b84ba02bd Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 01 八月 2024 14:26:56 +0800
Subject: [PATCH] 代码提交 bug解决

---
 ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesServiceImpl.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesServiceImpl.java b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesServiceImpl.java
index 8272827..84d4bc4 100644
--- a/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesServiceImpl.java
+++ b/ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/service/impl/InventoriesSuppliesServiceImpl.java
@@ -29,6 +29,7 @@
 import com.ruoyi.system.api.domain.SysUser;
 import com.ruoyi.system.api.domain.WebsocketMessageDTO;
 import com.ruoyi.system.api.feignClient.SysUserClient;
+import io.swagger.models.auth.In;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -61,10 +62,10 @@
     @Override
     public PageDTO<InventoriesSuppliesVO> getInventoriesSuppliesList(InventoriesSuppliesQuery inventoriesSuppliesQuery) {
         LambdaQueryWrapper<SlStoreManagement> wrapper= Wrappers.lambdaQuery();
-        if (inventoriesSuppliesQuery.getStoreManagementName()!=null){
+        if (inventoriesSuppliesQuery.getStoreManagementName()!=null&&inventoriesSuppliesQuery.getStoreManagementName()!=""){
             wrapper.eq(SlStoreManagement::getStoreManagementName,inventoriesSuppliesQuery.getStoreManagementName());
         }
-        if (inventoriesSuppliesQuery.getStoreManagementNo()!=null){
+        if (inventoriesSuppliesQuery.getStoreManagementNo()!=null&&inventoriesSuppliesQuery.getStoreManagementNo()!=""){
         wrapper.eq(SlStoreManagement::getStoreManagementNo,inventoriesSuppliesQuery.getStoreManagementNo());
         }
         List<SlStoreManagement> slStoreManagements = slStoreManagementMapper.selectList(wrapper);
@@ -75,7 +76,9 @@
 
         Page<InventoriesSupplies> page = new Page<>(inventoriesSuppliesQuery.getPageCurr(), inventoriesSuppliesQuery.getPageSize());
         LambdaQueryWrapper< InventoriesSupplies> wrapper1= Wrappers.lambdaQuery();
-        wrapper1.like(InventoriesSupplies::getPdrName,inventoriesSuppliesQuery.getPdrName());
+        if (inventoriesSuppliesQuery.getPdrName()!=null&&inventoriesSuppliesQuery.getPdrName()!=""){
+            wrapper1.like(InventoriesSupplies::getPdrName,inventoriesSuppliesQuery.getPdrName());
+        }
         if (slStoreManagementIdList.size()>0){
             wrapper1.in(InventoriesSupplies::getMaterialsId,slStoreManagementIdList);
         }else {
@@ -87,7 +90,7 @@
 
             wrapper1.gt(InventoriesSupplies::getPdTime, inventoriesSuppliesQuery.getStartpdTime());
         }
-        if (inventoriesSuppliesQuery.getEndpdTime()!=null){
+        if (inventoriesSuppliesQuery.getEndpdTime()!=null&&inventoriesSuppliesQuery.getPdrName()!=""){
             wrapper1.le(InventoriesSupplies::getPdTime, inventoriesSuppliesQuery.getEndpdTime());
        }
 
@@ -111,6 +114,7 @@
         InventoriesSupplies inventoriesSupplies=new InventoriesSupplies();
         inventoriesSupplies.setMaterialsId(inventoriesSuppDTO.getMaterialsId());
         inventoriesSupplies.setPdTime(new Date());
+        inventoriesSupplies.setCreateTime(new Date());
         inventoriesSupplies.setPdrId(inventoriesSuppDTO.getPdrId());
         R<SysUser> sysUser = sysUserClient.getSysUser(inventoriesSuppDTO.getPdrId());
         inventoriesSupplies.setPdrName(sysUser.getData().getNickName());
@@ -118,12 +122,17 @@
     }
 
     @Override
-    public void scanCodes(ScanCodesDTO scanCodesDTO) {
+    public void scanCodes(String rkNumber) {
         LambdaQueryWrapper< SlVolumeProductionRk> wrapper1= Wrappers.lambdaQuery();
-        wrapper1.like(SlVolumeProductionRk::getRkNumber,scanCodesDTO.getRkNumber());
+        wrapper1.like(SlVolumeProductionRk::getRkNumber,rkNumber);
         wrapper1.eq( SlVolumeProductionRk::getDelFlag,0);
         wrapper1.orderByDesc(SlVolumeProductionRk::getCreateTime);
         SlVolumeProductionRk page2 = slVolumeProductionRkMapper.selectOne(wrapper1);
+        if (page2.getSmerwmNum()>0){
+            Integer i=page2.getSmerwmNum()-1;
+            page2.setSmerwmNum(i);
+            slVolumeProductionRkMapper.updateById(page2);
+        }
         Map<String, Object> map = new ConcurrentHashMap<>();
         map.put("notification_type", NotificationTypeConstant.SCANCODES);
         map.put("SlVolumeProductionRk",page2);

--
Gitblit v1.7.1