From 6fa160bf2d50107f4845493e82fe9fca312668be Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期一, 27 九月 2021 13:45:12 +0800
Subject: [PATCH] 修改便民服务bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java
index 147b533..ab37ec9 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java
@@ -100,8 +100,6 @@
         List<ConvenientProductSpecificationDTO> productSpecificationDTOList = convenientProductDTO.getProductSpecificationDTOList();
         List<Long> notNeedDelIds = productSpecificationDTOList.stream().filter(specificationDTO -> nonNull(specificationDTO.getId()))
                 .map(ConvenientProductSpecificationDTO::getId).collect(Collectors.toList());
-        //删除已失去关联的规格
-        convenientProductSpecificationDAO.deleteLoseRelationSpecifications(notNeedDelIds);
         Date nowDate = new Date();
         productSpecificationDTOList.forEach(specificationDTO -> {
             Long specificationId = specificationDTO.getId();
@@ -121,6 +119,8 @@
                 convenientProductSpecificationDAO.updateById(convenientProductSpecificationDO);
             }
         });
+        //删除已失去关联的规格
+        convenientProductSpecificationDAO.deleteLoseRelationSpecifications(notNeedDelIds);
         return R.ok();
     }
 
@@ -247,7 +247,8 @@
         if (!records.isEmpty()) {
             List<Long> productIds = records.stream().map(ConvenientProductVO::getId).collect(Collectors.toList());
             List<ConvenientProductSpecificationDO> specificationDOS = convenientProductSpecificationDAO
-                    .selectList(new LambdaQueryWrapper<ConvenientProductSpecificationDO>().in(ConvenientProductSpecificationDO::getProductId, productIds));
+                    .selectList(new LambdaQueryWrapper<ConvenientProductSpecificationDO>()
+                    .eq(ConvenientProductSpecificationDO::getIsDel, false).in(ConvenientProductSpecificationDO::getProductId, productIds));
             List<ConvenientProductSpecificationVO> specificationVOList = new ArrayList<>();
             if (!specificationDOS.isEmpty()) {
                 specificationDOS.forEach(specificationDO -> {

--
Gitblit v1.7.1