3254194295 9 månader sedan
förälder
incheckning
0e0e3690ae

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/dto/sqarepartmanage/SparePartInfoDTO.java

@@ -27,6 +27,7 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class SparePartInfoDTO extends BaseDTO implements Serializable {
+    private List<String> storeIds;
 
 
     private Integer oldOrNew;

+ 5 - 2
platform-dao/src/main/resources/mapper/sqarepartmanage/SparePartInfoMapper.xml

@@ -368,8 +368,11 @@ and store.store_id=#{storeId}
             resultType="com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO">
         select info.*,sum(spareStore.num) as totalNum from t_spare_part_info info left join t_spare_store spareStore on spareStore.spare_id = info.id
         <where>
-            <if test="storeId!=null and storeId!=''">
-                and spareStore.store_id=#{storeId}
+            <if test="storeIds!=null and storeIds.size()>0">
+                and spareStore.store_id in
+                <foreach collection="storeIds" item="item" close=")" open="(" separator=",">
+                    #{item}
+                </foreach>
             </if>
             <if test="typeId!=null and typeId!=''">
                 and info.type_id=#{typeId}

+ 10 - 0
platform-service/src/main/java/com/platform/service/sqarepartmanage/impl/SparePartInfoServiceImpl.java

@@ -47,6 +47,7 @@ import com.platform.dao.vo.export.sb.ExportSbInfoVO;
 import com.platform.dao.vo.export.sqarepartmanage.ExportSparePartInfoVO;
 import com.platform.dao.vo.query.check.CheckStandardSpareVO;
 import com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO;
+import com.platform.dao.vo.query.store.StoreVO;
 import com.platform.dao.vo.sb.SbInfoVO;
 import com.platform.dao.vo.sb.SbModelSpareBomVO;
 import com.platform.dao.vo.spare.SparePartInfo1VO;
@@ -103,6 +104,15 @@ public class SparePartInfoServiceImpl extends BaseServiceImpl<SparePartInfoMappe
 
     @Override
     public List<SparePartInfoVO> getByCondition(SparePartInfoDTO sparePartInfoDTO) {
+        Store store = new Store();
+        store.setParentId(sparePartInfoDTO.getStoreId());
+        List<Store> stores = storeMapper.select(store);
+        List<String> storeIds = new ArrayList<>();
+        storeIds.add(sparePartInfoDTO.getStoreId());
+        if(stores!=null&&stores.size()>0){
+            storeIds.addAll(stores.stream().map(Store::getId).collect(Collectors.toList()));
+        }
+        sparePartInfoDTO.setStoreIds(storeIds);
         List<SparePartInfoVO> sparePartInfoVOS = mapper.getByCondition(sparePartInfoDTO);
         return sparePartInfoVOS;
     }